@justifi/webcomponents 0.0.6 → 0.0.8
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/cjs/{index-c1726348.js → index-ee888432.js} +1 -1
- package/dist/cjs/justifi-card-form_2.cjs.entry.js +4 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{justifi-webcomponents.cjs.js → webcomponents.cjs.js} +3 -3
- package/dist/collection/components/card-form/card-form.js +4 -5
- package/dist/components/index.d.ts +1 -1
- package/dist/components/justifi-card-form.js +4 -5
- package/dist/esm/{index-df3d4282.js → index-2324c14b.js} +1 -1
- package/dist/esm/justifi-card-form_2.entry.js +4 -4
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{justifi-webcomponents.js → webcomponents.js} +2 -2
- package/dist/types/components/card-form/card-form.d.ts +1 -1
- package/dist/types/components.d.ts +1 -1
- package/dist/{justifi-webcomponents → webcomponents}/index.esm.js +0 -0
- package/dist/{justifi-webcomponents/p-3487f6b8.js → webcomponents/p-5bf626ec.js} +1 -1
- package/dist/{justifi-webcomponents/p-69e18be7.entry.js → webcomponents/p-a7effb1e.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -0
- package/loader/package.json +1 -1
- package/package.json +1 -1
- package/dist/justifi-webcomponents/justifi-webcomponents.esm.js +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-ee888432.js');
|
|
6
6
|
|
|
7
7
|
const cardFormCss = ":host{display:block}iframe{border:none;height:55px;width:100%}";
|
|
8
8
|
|
|
@@ -44,7 +44,7 @@ const CardForm = class {
|
|
|
44
44
|
break;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
triggerTokenization(clientKey,
|
|
47
|
+
triggerTokenization(clientKey, paymentMethodMetadata, account) {
|
|
48
48
|
if (this.iframeElement && this.iframeElement.contentWindow) {
|
|
49
49
|
this.iframeElement.contentWindow.postMessage({
|
|
50
50
|
eventType: DispatchedEventTypes.tokenize,
|
|
@@ -54,7 +54,7 @@ const CardForm = class {
|
|
|
54
54
|
}, '*');
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
async tokenize(clientKey,
|
|
57
|
+
async tokenize(clientKey, paymentMethodMetadata, account) {
|
|
58
58
|
return new Promise((resolve) => {
|
|
59
59
|
const tokenizeEventListener = (event) => {
|
|
60
60
|
if (event.data.eventType !== DispatchedEventTypes.tokenize)
|
|
@@ -63,7 +63,7 @@ const CardForm = class {
|
|
|
63
63
|
resolve(event.data.data);
|
|
64
64
|
};
|
|
65
65
|
window.addEventListener('message', tokenizeEventListener);
|
|
66
|
-
this.triggerTokenization(clientKey,
|
|
66
|
+
this.triggerTokenization(clientKey, paymentMethodMetadata, account);
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-ee888432.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Esm v2.19.3 | MIT Licensed | https://stenciljs.com
|
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["justifi-card-form_2.cjs",[[
|
|
17
|
+
return index.bootstrapLazy([["justifi-card-form_2.cjs",[[0,"justifi-card-form",{"iframeOrigin":[1,"iframe-origin"],"tokenize":[64]}],[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-ee888432.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Stencil Client Patch Browser v2.19.3 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
const patchBrowser = () => {
|
|
9
|
-
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('
|
|
9
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('webcomponents.cjs.js', document.baseURI).href));
|
|
10
10
|
const opts = {};
|
|
11
11
|
if (importMeta !== '') {
|
|
12
12
|
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["justifi-card-form_2.cjs",[[
|
|
18
|
+
return index.bootstrapLazy([["justifi-card-form_2.cjs",[[0,"justifi-card-form",{"iframeOrigin":[1,"iframe-origin"],"tokenize":[64]}],[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]]], options);
|
|
19
19
|
});
|
|
@@ -34,7 +34,7 @@ export class CardForm {
|
|
|
34
34
|
break;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
triggerTokenization(clientKey,
|
|
37
|
+
triggerTokenization(clientKey, paymentMethodMetadata, account) {
|
|
38
38
|
if (this.iframeElement && this.iframeElement.contentWindow) {
|
|
39
39
|
this.iframeElement.contentWindow.postMessage({
|
|
40
40
|
eventType: DispatchedEventTypes.tokenize,
|
|
@@ -44,7 +44,7 @@ export class CardForm {
|
|
|
44
44
|
}, '*');
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
async tokenize(clientKey,
|
|
47
|
+
async tokenize(clientKey, paymentMethodMetadata, account) {
|
|
48
48
|
return new Promise((resolve) => {
|
|
49
49
|
const tokenizeEventListener = (event) => {
|
|
50
50
|
if (event.data.eventType !== DispatchedEventTypes.tokenize)
|
|
@@ -53,7 +53,7 @@ export class CardForm {
|
|
|
53
53
|
resolve(event.data.data);
|
|
54
54
|
};
|
|
55
55
|
window.addEventListener('message', tokenizeEventListener);
|
|
56
|
-
this.triggerTokenization(clientKey,
|
|
56
|
+
this.triggerTokenization(clientKey, paymentMethodMetadata, account);
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
;
|
|
@@ -61,7 +61,6 @@ export class CardForm {
|
|
|
61
61
|
return (h(Host, null, h("iframe", { id: "justifi-card-form", src: this.iframeOrigin || 'https://js.justifi.ai', ref: (el) => this.iframeElement = el })));
|
|
62
62
|
}
|
|
63
63
|
static get is() { return "justifi-card-form"; }
|
|
64
|
-
static get encapsulation() { return "shadow"; }
|
|
65
64
|
static get originalStyleUrls() {
|
|
66
65
|
return {
|
|
67
66
|
"$": ["card-form.css"]
|
|
@@ -160,7 +159,7 @@ export class CardForm {
|
|
|
160
159
|
return {
|
|
161
160
|
"tokenize": {
|
|
162
161
|
"complexType": {
|
|
163
|
-
"signature": "(clientKey: string,
|
|
162
|
+
"signature": "(clientKey: string, paymentMethodMetadata: any, account?: string) => Promise<unknown>",
|
|
164
163
|
"parameters": [{
|
|
165
164
|
"tags": [],
|
|
166
165
|
"text": ""
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* webcomponents custom elements */
|
|
2
2
|
export { CardForm as JustifiCardForm } from '../types/components/card-form/card-form';
|
|
3
3
|
export { PaymentsList as JustifiPaymentsList } from '../types/components/payments-list/payments-list';
|
|
4
4
|
|
|
@@ -13,7 +13,6 @@ const CardForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
13
13
|
constructor() {
|
|
14
14
|
super();
|
|
15
15
|
this.__registerHost();
|
|
16
|
-
this.__attachShadow();
|
|
17
16
|
this.cardFormReady = createEvent(this, "cardFormReady", 7);
|
|
18
17
|
this.cardFormChange = createEvent(this, "cardFormChange", 7);
|
|
19
18
|
this.cardFormBlur = createEvent(this, "cardFormBlur", 7);
|
|
@@ -42,7 +41,7 @@ const CardForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
42
41
|
break;
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
|
-
triggerTokenization(clientKey,
|
|
44
|
+
triggerTokenization(clientKey, paymentMethodMetadata, account) {
|
|
46
45
|
if (this.iframeElement && this.iframeElement.contentWindow) {
|
|
47
46
|
this.iframeElement.contentWindow.postMessage({
|
|
48
47
|
eventType: DispatchedEventTypes.tokenize,
|
|
@@ -52,7 +51,7 @@ const CardForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
52
51
|
}, '*');
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
|
-
async tokenize(clientKey,
|
|
54
|
+
async tokenize(clientKey, paymentMethodMetadata, account) {
|
|
56
55
|
return new Promise((resolve) => {
|
|
57
56
|
const tokenizeEventListener = (event) => {
|
|
58
57
|
if (event.data.eventType !== DispatchedEventTypes.tokenize)
|
|
@@ -61,7 +60,7 @@ const CardForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
61
60
|
resolve(event.data.data);
|
|
62
61
|
};
|
|
63
62
|
window.addEventListener('message', tokenizeEventListener);
|
|
64
|
-
this.triggerTokenization(clientKey,
|
|
63
|
+
this.triggerTokenization(clientKey, paymentMethodMetadata, account);
|
|
65
64
|
});
|
|
66
65
|
}
|
|
67
66
|
;
|
|
@@ -69,7 +68,7 @@ const CardForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
69
68
|
return (h(Host, null, h("iframe", { id: "justifi-card-form", src: this.iframeOrigin || 'https://js.justifi.ai', ref: (el) => this.iframeElement = el })));
|
|
70
69
|
}
|
|
71
70
|
static get style() { return cardFormCss; }
|
|
72
|
-
}, [
|
|
71
|
+
}, [0, "justifi-card-form", {
|
|
73
72
|
"iframeOrigin": [1, "iframe-origin"],
|
|
74
73
|
"tokenize": [64]
|
|
75
74
|
}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-2324c14b.js';
|
|
2
2
|
|
|
3
3
|
const cardFormCss = ":host{display:block}iframe{border:none;height:55px;width:100%}";
|
|
4
4
|
|
|
@@ -40,7 +40,7 @@ const CardForm = class {
|
|
|
40
40
|
break;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
triggerTokenization(clientKey,
|
|
43
|
+
triggerTokenization(clientKey, paymentMethodMetadata, account) {
|
|
44
44
|
if (this.iframeElement && this.iframeElement.contentWindow) {
|
|
45
45
|
this.iframeElement.contentWindow.postMessage({
|
|
46
46
|
eventType: DispatchedEventTypes.tokenize,
|
|
@@ -50,7 +50,7 @@ const CardForm = class {
|
|
|
50
50
|
}, '*');
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
async tokenize(clientKey,
|
|
53
|
+
async tokenize(clientKey, paymentMethodMetadata, account) {
|
|
54
54
|
return new Promise((resolve) => {
|
|
55
55
|
const tokenizeEventListener = (event) => {
|
|
56
56
|
if (event.data.eventType !== DispatchedEventTypes.tokenize)
|
|
@@ -59,7 +59,7 @@ const CardForm = class {
|
|
|
59
59
|
resolve(event.data.data);
|
|
60
60
|
};
|
|
61
61
|
window.addEventListener('message', tokenizeEventListener);
|
|
62
|
-
this.triggerTokenization(clientKey,
|
|
62
|
+
this.triggerTokenization(clientKey, paymentMethodMetadata, account);
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
;
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-2324c14b.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Esm v2.19.3 | MIT Licensed | https://stenciljs.com
|
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["justifi-card-form_2",[[
|
|
13
|
+
return bootstrapLazy([["justifi-card-form_2",[[0,"justifi-card-form",{"iframeOrigin":[1,"iframe-origin"],"tokenize":[64]}],[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-2324c14b.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Browser v2.19.3 | MIT Licensed | https://stenciljs.com
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["justifi-card-form_2",[[
|
|
16
|
+
return bootstrapLazy([["justifi-card-form_2",[[0,"justifi-card-form",{"iframeOrigin":[1,"iframe-origin"],"tokenize":[64]}],[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]]], options);
|
|
17
17
|
});
|
|
@@ -12,6 +12,6 @@ export declare class CardForm {
|
|
|
12
12
|
disconnectedCallback(): void;
|
|
13
13
|
private dispatchMessageEvent;
|
|
14
14
|
private triggerTokenization;
|
|
15
|
-
tokenize(clientKey: string,
|
|
15
|
+
tokenize(clientKey: string, paymentMethodMetadata: any, account?: string): Promise<unknown>;
|
|
16
16
|
render(): any;
|
|
17
17
|
}
|
|
@@ -8,7 +8,7 @@ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
|
8
8
|
export namespace Components {
|
|
9
9
|
interface JustifiCardForm {
|
|
10
10
|
"iframeOrigin": string;
|
|
11
|
-
"tokenize": (clientKey: string,
|
|
11
|
+
"tokenize": (clientKey: string, paymentMethodMetadata: any, account?: string) => Promise<unknown>;
|
|
12
12
|
}
|
|
13
13
|
interface JustifiPaymentsList {
|
|
14
14
|
"accountId": string;
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let e,t,n=!1;const l={},s=e=>"object"==(e=typeof e)||"function"===e,o=(e,t,...n)=>{let l=null,o=!1,r=!1;const i=[],u=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?u(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!s(l))&&(l+=""),o&&r?i[i.length-1].t+=l:i.push(o?c(null,l):l),r=o)};if(u(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const a=c(e,null);return a.l=t,i.length>0&&(a.o=i),a},c=(e,t)=>({i:0,u:e,t,h:null,o:null,l:null}),r={},i=(e,t,n)=>{const l=(e=>R(e).$)(e);return{emit:e=>u(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},u=(e,t,n)=>{const l=G.ce(t,n);return e.dispatchEvent(l),l},a=new WeakMap,f=e=>"sc-"+e.m,h=(e,t,n,l,o,c)=>{if(n!==l){let r=q(e,t);if(t.toLowerCase(),"class"===t){const t=e.classList,s=$(n),o=$(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("ref"===t)l&&l(e);else{const i=s(l);if((r||i&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const s=null==l?"":l;"list"===t?r=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!r||4&c||o)&&!i&&e.setAttribute(t,l=!0===l?"":l)}}},d=/\s/,$=e=>e?e.split(d):[],y=(e,t,n,s)=>{const o=11===t.h.nodeType&&t.h.host?t.h.host:t.h,c=e&&e.l||l,r=t.l||l;for(s in c)s in r||h(o,s,c[s],void 0,n,t.i);for(s in r)h(o,s,c[s],r[s],n,t.i)},m=(t,n,l)=>{const s=n.o[l];let o,c,r=0;if(null!==s.t)o=s.h=D.createTextNode(s.t);else if(o=s.h=D.createElement(s.u),y(null,s,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),s.o)for(r=0;r<s.o.length;++r)c=m(t,s,r),c&&o.appendChild(c);return o},p=(e,n,l,s,o,c)=>{let r,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=c;++o)s[o]&&(r=m(null,l,o),r&&(s[o].h=r,i.insertBefore(r,n)))},b=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.h,g(l),s.remove())},w=(e,t)=>e.u===t.u,S=(e,t)=>{const n=t.h=e.h,l=e.o,s=t.o,o=t.t;null===o?(y(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,r=t.length-1,i=t[0],u=t[r],a=l.length-1,f=l[0],h=l[a];for(;o<=r&&c<=a;)null==i?i=t[++o]:null==u?u=t[--r]:null==f?f=l[++c]:null==h?h=l[--a]:w(i,f)?(S(i,f),i=t[++o],f=l[++c]):w(u,h)?(S(u,h),u=t[--r],h=l[--a]):w(i,h)?(S(i,h),e.insertBefore(i.h,u.h.nextSibling),i=t[++o],h=l[--a]):w(u,f)?(S(u,f),e.insertBefore(u.h,i.h),u=t[--r],f=l[++c]):(s=m(t&&t[c],n,c),f=l[++c],s&&i.h.parentNode.insertBefore(s,i.h));o>r?p(e,null==l[a+1]?null:l[a+1].h,n,l,c,a):c>a&&b(t,o,r)})(n,l,t,s):null!==s?(null!==e.t&&(n.textContent=""),p(n,null,t,s,0,s.length-1)):null!==l&&b(l,0,l.length-1)):e.t!==o&&(n.data=o)},g=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(g)},j=(e,t)=>{t&&!e.p&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.p=t)))},v=(e,t)=>{if(e.i|=16,!(4&e.i))return j(e,e.S),te((()=>k(e,t)));e.i|=512},k=(e,t)=>{const n=e.g;return E(void 0,(()=>C(e,n,t)))},C=async(e,t,n)=>{const l=e.$,s=l["s-rc"];n&&(e=>{const t=e.j,n=e.$,l=t.i,s=((e,t)=>{let n=f(t);const l=z.get(n);if(e=11===e.nodeType?e:D,l)if("string"==typeof l){let t,s=a.get(e=e.head||e);s||a.set(e,s=new Set),s.has(n)||(t=D.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);M(e,t),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>O(e);0===t.length?n():(Promise.all(t).then(n),e.i|=4,t.length=0)}},M=(n,l)=>{try{l=l.render(),n.i&=-17,n.i|=2,((n,l)=>{const s=n.$,i=n.v||c(null,null),u=(e=>e&&e.u===r)(l)?l:o(null,null,l);t=s.tagName,u.u=null,u.i|=4,n.v=u,u.h=i.h=s.shadowRoot||s,e=s["s-sc"],S(i,u)})(n,l)}catch(e){F(e,n.$)}return null},O=e=>{const t=e.$,n=e.S;64&e.i||(e.i|=64,N(t),e.k(t),n||P()),e.C(t),e.p&&(e.p(),e.p=void 0),512&e.i&&ee((()=>v(e,!1))),e.i&=-517},P=()=>{N(D.documentElement),ee((()=>u(B,"appload",{detail:{namespace:"
|
|
1
|
+
let e,t,n=!1;const l={},s=e=>"object"==(e=typeof e)||"function"===e,o=(e,t,...n)=>{let l=null,o=!1,r=!1;const i=[],u=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?u(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!s(l))&&(l+=""),o&&r?i[i.length-1].t+=l:i.push(o?c(null,l):l),r=o)};if(u(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const a=c(e,null);return a.l=t,i.length>0&&(a.o=i),a},c=(e,t)=>({i:0,u:e,t,h:null,o:null,l:null}),r={},i=(e,t,n)=>{const l=(e=>R(e).$)(e);return{emit:e=>u(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},u=(e,t,n)=>{const l=G.ce(t,n);return e.dispatchEvent(l),l},a=new WeakMap,f=e=>"sc-"+e.m,h=(e,t,n,l,o,c)=>{if(n!==l){let r=q(e,t);if(t.toLowerCase(),"class"===t){const t=e.classList,s=$(n),o=$(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("ref"===t)l&&l(e);else{const i=s(l);if((r||i&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const s=null==l?"":l;"list"===t?r=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!r||4&c||o)&&!i&&e.setAttribute(t,l=!0===l?"":l)}}},d=/\s/,$=e=>e?e.split(d):[],y=(e,t,n,s)=>{const o=11===t.h.nodeType&&t.h.host?t.h.host:t.h,c=e&&e.l||l,r=t.l||l;for(s in c)s in r||h(o,s,c[s],void 0,n,t.i);for(s in r)h(o,s,c[s],r[s],n,t.i)},m=(t,n,l)=>{const s=n.o[l];let o,c,r=0;if(null!==s.t)o=s.h=D.createTextNode(s.t);else if(o=s.h=D.createElement(s.u),y(null,s,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),s.o)for(r=0;r<s.o.length;++r)c=m(t,s,r),c&&o.appendChild(c);return o},p=(e,n,l,s,o,c)=>{let r,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=c;++o)s[o]&&(r=m(null,l,o),r&&(s[o].h=r,i.insertBefore(r,n)))},b=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.h,g(l),s.remove())},w=(e,t)=>e.u===t.u,S=(e,t)=>{const n=t.h=e.h,l=e.o,s=t.o,o=t.t;null===o?(y(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,r=t.length-1,i=t[0],u=t[r],a=l.length-1,f=l[0],h=l[a];for(;o<=r&&c<=a;)null==i?i=t[++o]:null==u?u=t[--r]:null==f?f=l[++c]:null==h?h=l[--a]:w(i,f)?(S(i,f),i=t[++o],f=l[++c]):w(u,h)?(S(u,h),u=t[--r],h=l[--a]):w(i,h)?(S(i,h),e.insertBefore(i.h,u.h.nextSibling),i=t[++o],h=l[--a]):w(u,f)?(S(u,f),e.insertBefore(u.h,i.h),u=t[--r],f=l[++c]):(s=m(t&&t[c],n,c),f=l[++c],s&&i.h.parentNode.insertBefore(s,i.h));o>r?p(e,null==l[a+1]?null:l[a+1].h,n,l,c,a):c>a&&b(t,o,r)})(n,l,t,s):null!==s?(null!==e.t&&(n.textContent=""),p(n,null,t,s,0,s.length-1)):null!==l&&b(l,0,l.length-1)):e.t!==o&&(n.data=o)},g=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(g)},j=(e,t)=>{t&&!e.p&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.p=t)))},v=(e,t)=>{if(e.i|=16,!(4&e.i))return j(e,e.S),te((()=>k(e,t)));e.i|=512},k=(e,t)=>{const n=e.g;return E(void 0,(()=>C(e,n,t)))},C=async(e,t,n)=>{const l=e.$,s=l["s-rc"];n&&(e=>{const t=e.j,n=e.$,l=t.i,s=((e,t)=>{let n=f(t);const l=z.get(n);if(e=11===e.nodeType?e:D,l)if("string"==typeof l){let t,s=a.get(e=e.head||e);s||a.set(e,s=new Set),s.has(n)||(t=D.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);M(e,t),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>O(e);0===t.length?n():(Promise.all(t).then(n),e.i|=4,t.length=0)}},M=(n,l)=>{try{l=l.render(),n.i&=-17,n.i|=2,((n,l)=>{const s=n.$,i=n.v||c(null,null),u=(e=>e&&e.u===r)(l)?l:o(null,null,l);t=s.tagName,u.u=null,u.i|=4,n.v=u,u.h=i.h=s.shadowRoot||s,e=s["s-sc"],S(i,u)})(n,l)}catch(e){F(e,n.$)}return null},O=e=>{const t=e.$,n=e.S;64&e.i||(e.i|=64,N(t),e.k(t),n||P()),e.C(t),e.p&&(e.p(),e.p=void 0),512&e.i&&ee((()=>v(e,!1))),e.i&=-517},P=()=>{N(D.documentElement),ee((()=>u(B,"appload",{detail:{namespace:"webcomponents"}})))},x=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){F(e)}},E=(e,t)=>e&&e.then?e.then(t):t(),N=e=>e.classList.add("hydrated"),T=(e,t,n)=>{if(t.M){e.watchers&&(t.O=e.watchers);const l=Object.entries(t.M),o=e.prototype;if(l.map((([e,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(o,e,{get(){return((e,t)=>R(this).P.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=R(e),c=o.$,r=o.P.get(t),i=o.i,u=o.g;if(n=((e,t)=>null==e||s(e)?e:1&t?e+"":e)(n,l.M[t][0]),(!(8&i)||void 0===r)&&n!==r&&(!Number.isNaN(r)||!Number.isNaN(n))&&(o.P.set(t,n),u)){if(l.O&&128&i){const e=l.O[t];e&&e.map((e=>{try{u[e](n,r,t)}catch(e){F(e,c)}}))}2==(18&i)&&v(o,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(o,e,{value(...t){const n=R(this);return n.N.then((()=>n.g[e](...t)))}})})),1&n){const t=new Map;o.attributeChangedCallback=function(e,n,l){G.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(o.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},A=e=>{x(e,"connectedCallback")},H=(e,t={})=>{const n=[],l=t.exclude||[],s=B.customElements,o=D.head,c=o.querySelector("meta[charset]"),r=D.createElement("style"),i=[];let u,a=!0;Object.assign(G,t),G.T=new URL(t.resourcesUrl||"./",D.baseURI).href,e.map((e=>{e[1].map((t=>{const o={i:t[0],m:t[1],M:t[2],A:t[3]};o.M=t[2],o.O={};const c=o.m,r=class extends HTMLElement{constructor(e){super(e),W(e=this,o),1&o.i&&e.attachShadow({mode:"open"})}connectedCallback(){u&&(clearTimeout(u),u=null),a?i.push(this):G.jmp((()=>(e=>{if(0==(1&G.i)){const t=R(e),n=t.j,l=()=>{};if(1&t.i)A(t.g);else{t.i|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){j(t,t.S=n);break}}n.M&&Object.entries(n.M).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.i)){{if(t.i|=32,(s=_(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.O=s.watchers,T(s,n,2),s.isProxied=!0);const e=()=>{};t.i|=8;try{new s(t)}catch(e){F(e)}t.i&=-9,t.i|=128,e(),A(t.g)}if(s.style){let e=s.style;const t=f(n);if(!z.has(t)){const l=()=>{};((e,t,n)=>{let l=z.get(e);J&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,z.set(e,l)})(t,e,!!(1&n.i)),l()}}}const o=t.S,c=()=>v(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){G.jmp((()=>(()=>{0==(1&G.i)&&x(R(this).g,"disconnectedCallback")})()))}componentOnReady(){return R(this).H}};o.L=e[0],l.includes(c)||s.get(c)||(n.push(c),s.define(c,T(r,o,1)))}))})),r.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",r.setAttribute("data-styles",""),o.insertBefore(r,c?c.nextSibling:o.firstChild),a=!1,i.length?i.map((e=>e.connectedCallback())):G.jmp((()=>u=setTimeout(P,30)))},L=new WeakMap,R=e=>L.get(e),U=(e,t)=>L.set(t.g=e,t),W=(e,t)=>{const n={i:0,$:e,j:t,P:new Map};return n.N=new Promise((e=>n.C=e)),n.H=new Promise((e=>n.k=e)),e["s-p"]=[],e["s-rc"]=[],L.set(e,n)},q=(e,t)=>t in e,F=(e,t)=>(0,console.error)(e,t),V=new Map,_=e=>{const t=e.m.replace(/-/g,"_"),n=e.L,l=V.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(V.set(n,e),e[t])),F)
|
|
2
2
|
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},z=new Map,B="undefined"!=typeof window?window:{},D=B.document||{head:{}},G={i:0,T:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},I=e=>Promise.resolve(e),J=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),K=[],Q=[],X=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&G.i?ee(Z):G.raf(Z))},Y=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){F(e)}e.length=0},Z=()=>{Y(K),Y(Q),(n=K.length>0)&&G.raf(Z)},ee=e=>I().then(e),te=X(Q,!0);export{r as H,H as b,i as c,o as h,I as p,U as r}
|
package/dist/{justifi-webcomponents/p-69e18be7.entry.js → webcomponents/p-a7effb1e.entry.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as n,h as e,H as r}from"./p-3487f6b8.js";var i;!function(t){t.blur="blur",t.change="change",t.ready="ready",t.tokenize="tokenize"}(i||(i={}));const o=class{constructor(e){t(this,e),this.cardFormReady=n(this,"cardFormReady",7),this.cardFormChange=n(this,"cardFormChange",7),this.cardFormBlur=n(this,"cardFormBlur",7),this.cardFormTokenize=n(this,"cardFormTokenize",7),this.iframeOrigin=void 0}connectedCallback(){window.addEventListener("message",this.dispatchMessageEvent.bind(this))}disconnectedCallback(){window.removeEventListener("message",this.dispatchMessageEvent.bind(this))}dispatchMessageEvent(t){const n=t.data,e=n.data;switch(n.eventType){case i.ready:this.cardFormReady.emit(e);break;case i.change:this.cardFormChange.emit(e);break;case i.blur:this.cardFormBlur.emit(e)}}triggerTokenization(t,n,e){this.iframeElement&&this.iframeElement.contentWindow&&this.iframeElement.contentWindow.postMessage({eventType:i.tokenize,clientKey:t,paymentMethodMetadata:e,account:n},"*")}async tokenize(t,n,e){return new Promise((r=>{const o=t=>{t.data.eventType===i.tokenize&&(window.removeEventListener("message",o),r(t.data.data))};window.addEventListener("message",o),this.triggerTokenization(t,n,e)}))}render(){return e(r,null,e("iframe",{id:"justifi-card-form",src:this.iframeOrigin||"https://js.justifi.ai",ref:t=>this.iframeElement=t}))}};let a;o.style=":host{display:block}iframe{border:none;height:55px;width:100%}";const u=new Uint8Array(16);function c(){if(!a&&(a="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!a))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(u)}const s=[];for(let t=0;t<256;++t)s.push((t+256).toString(16).slice(1));const d={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function f(t,n,e){if(d.randomUUID&&!n&&!t)return d.randomUUID();const r=(t=t||{}).random||(t.rng||c)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,n){e=e||0;for(let t=0;t<16;++t)n[e+t]=r[t];return n}return function(t,n=0){return(s[t[n+0]]+s[t[n+1]]+s[t[n+2]]+s[t[n+3]]+"-"+s[t[n+4]]+s[t[n+5]]+"-"+s[t[n+6]]+s[t[n+7]]+"-"+s[t[n+8]]+s[t[n+9]]+"-"+s[t[n+10]]+s[t[n+11]]+s[t[n+12]]+s[t[n+13]]+s[t[n+14]]+s[t[n+15]]).toLowerCase()}(r)}var h,l,m,v;!function(t){t.automatic="automatic",t.manual="manual"}(h||(h={})),function(t){t.card="card",t.bankAccount="bank_account"}(l||(l={})),function(t){t.pending="pending",t.authorized="authorized",t.succeeded="succeeded",t.failed="failed",t.disputed="disputed",t.fully_refunded="fully_refunded",t.partially_refunded="partially_refunded"}(m||(m={})),function(t){t.lost="lost",t.open="open"}(v||(v={}));class w{constructor(t){this.id=t.id,this.account_id=t.account_id,this.amount=t.amount,this.amount_disputed=t.amount_disputed,this.amount_refundable=t.amount_refundable,this.amount_refunded=t.amount_refunded,this.balance=t.balance,this.captured=t.captured,this.capture_strategy=t.capture_strategy,this.currency=t.currency,this.description=t.description,this.disputed=t.disputed,this.disputes=t.disputes,this.error_code=t.error_code,this.error_description=t.error_description,this.fee_amount=t.fee_amount,this.is_test=t.is_test,this.metadata=t.metadata,this.payment_method=t.payment_method,this.payment_intent_id=t.payment_intent_id,this.refunded=t.refunded,this.status=t.status,this.created_at=t.created_at,this.updated_at=t.updated_at}get disputedStatus(){const t=this.disputes.some((t=>t.status===v.lost));return this.disputed?t?v.lost:v.open:null}}function y(t){if(null===t||!0===t||!1===t)return NaN;var n=Number(t);return isNaN(n)?n:n<0?Math.ceil(n):Math.floor(n)}function g(t,n){if(n.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+n.length+" present")}function b(t){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t){g(1,arguments);var n=Object.prototype.toString.call(t);return t instanceof Date||"object"===b(t)&&"[object Date]"===n?new Date(t.getTime()):"number"==typeof t||"[object Number]"===n?new Date(t):("string"!=typeof t&&"[object String]"!==n||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function M(t,n){g(2,arguments);var e=p(t).getTime(),r=y(n);return new Date(e+r)}var S={};function E(){return S}function x(t){var n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),t.getTime()-n.getTime()}function P(t){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function D(t){return g(1,arguments),t instanceof Date||"object"===P(t)&&"[object Date]"===Object.prototype.toString.call(t)}function O(t){if(g(1,arguments),!D(t)&&"number"!=typeof t)return!1;var n=p(t);return!isNaN(Number(n))}function j(t,n){g(2,arguments);var e=y(n);return M(t,-e)}function k(t){g(1,arguments);var n=1,e=p(t),r=e.getUTCDay(),i=(r<n?7:0)+r-n;return e.setUTCDate(e.getUTCDate()-i),e.setUTCHours(0,0,0,0),e}function A(t){g(1,arguments);var n=p(t),e=n.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(e+1,0,4),r.setUTCHours(0,0,0,0);var i=k(r),o=new Date(0);o.setUTCFullYear(e,0,4),o.setUTCHours(0,0,0,0);var a=k(o);return n.getTime()>=i.getTime()?e+1:n.getTime()>=a.getTime()?e:e-1}function T(t){g(1,arguments);var n=A(t),e=new Date(0);e.setUTCFullYear(n,0,4),e.setUTCHours(0,0,0,0);var r=k(e);return r}function q(t,n){var e,r,i,o,a,u,c,s;g(1,arguments);var d=E(),f=y(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.weekStartsOn)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==r?r:null===(c=d.locale)||void 0===c||null===(s=c.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==e?e:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=p(t),l=h.getUTCDay(),m=(l<f?7:0)+l-f;return h.setUTCDate(h.getUTCDate()-m),h.setUTCHours(0,0,0,0),h}function W(t,n){var e,r,i,o,a,u,c,s;g(1,arguments);var d=p(t),f=d.getUTCFullYear(),h=E(),l=y(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.firstWeekContainsDate)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==i?i:h.firstWeekContainsDate)&&void 0!==r?r:null===(c=h.locale)||void 0===c||null===(s=c.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==e?e:1);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(f+1,0,l),m.setUTCHours(0,0,0,0);var v=q(m,n),w=new Date(0);w.setUTCFullYear(f,0,l),w.setUTCHours(0,0,0,0);var b=q(w,n);return d.getTime()>=v.getTime()?f+1:d.getTime()>=b.getTime()?f:f-1}function L(t,n){var e,r,i,o,a,u,c,s;g(1,arguments);var d=E(),f=y(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.firstWeekContainsDate)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==i?i:d.firstWeekContainsDate)&&void 0!==r?r:null===(c=d.locale)||void 0===c||null===(s=c.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==e?e:1),h=W(t,n),l=new Date(0);l.setUTCFullYear(h,0,f),l.setUTCHours(0,0,0,0);var m=q(l,n);return m}function Y(t,n){for(var e=t<0?"-":"",r=Math.abs(t).toString();r.length<n;)r="0"+r;return e+r}var F={G:function(t,n,e){var r=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return e.era(r,{width:"abbreviated"});case"GGGGG":return e.era(r,{width:"narrow"});case"GGGG":default:return e.era(r,{width:"wide"})}},y:function(t,n,e){if("yo"===n){var r=t.getUTCFullYear();return e.ordinalNumber(r>0?r:1-r,{unit:"year"})}return function(t,n){var e=t.getUTCFullYear(),r=e>0?e:1-e;return Y("yy"===n?r%100:r,n.length)}(t,n)},Y:function(t,n,e,r){var i=W(t,r),o=i>0?i:1-i;return"YY"===n?Y(o%100,2):"Yo"===n?e.ordinalNumber(o,{unit:"year"}):Y(o,n.length)},R:function(t,n){return Y(A(t),n.length)},u:function(t,n){return Y(t.getUTCFullYear(),n.length)},Q:function(t,n,e){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return Y(r,2);case"Qo":return e.ordinalNumber(r,{unit:"quarter"});case"QQQ":return e.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,e){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return Y(r,2);case"qo":return e.ordinalNumber(r,{unit:"quarter"});case"qqq":return e.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,e){var r=t.getUTCMonth();switch(n){case"M":case"MM":return function(t,n){var e=t.getUTCMonth();return"M"===n?String(e+1):Y(e+1,2)}(t,n);case"Mo":return e.ordinalNumber(r+1,{unit:"month"});case"MMM":return e.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,e){var r=t.getUTCMonth();switch(n){case"L":return String(r+1);case"LL":return Y(r+1,2);case"Lo":return e.ordinalNumber(r+1,{unit:"month"});case"LLL":return e.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,e,r){var i=function(t,n){g(1,arguments);var e=p(t),r=q(e,n).getTime()-L(e,n).getTime();return Math.round(r/6048e5)+1}(t,r);return"wo"===n?e.ordinalNumber(i,{unit:"week"}):Y(i,n.length)},I:function(t,n,e){var r=function(t){g(1,arguments);var n=p(t),e=k(n).getTime()-T(n).getTime();return Math.round(e/6048e5)+1}(t);return"Io"===n?e.ordinalNumber(r,{unit:"week"}):Y(r,n.length)},d:function(t,n,e){return"do"===n?e.ordinalNumber(t.getUTCDate(),{unit:"date"}):function(t,n){return Y(t.getUTCDate(),n.length)}(t,n)},D:function(t,n,e){var r=function(t){g(1,arguments);var n=p(t),e=n.getTime();n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0);var r=n.getTime();return Math.floor((e-r)/864e5)+1}(t);return"Do"===n?e.ordinalNumber(r,{unit:"dayOfYear"}):Y(r,n.length)},E:function(t,n,e){var r=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return e.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(r,{width:"short",context:"formatting"});case"EEEE":default:return e.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,e,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return Y(o,2);case"eo":return e.ordinalNumber(o,{unit:"day"});case"eee":return e.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(i,{width:"short",context:"formatting"});case"eeee":default:return e.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,e,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return Y(o,n.length);case"co":return e.ordinalNumber(o,{unit:"day"});case"ccc":return e.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(i,{width:"narrow",context:"standalone"});case"cccccc":return e.day(i,{width:"short",context:"standalone"});case"cccc":default:return e.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,e){var r=t.getUTCDay(),i=0===r?7:r;switch(n){case"i":return String(i);case"ii":return Y(i,n.length);case"io":return e.ordinalNumber(i,{unit:"day"});case"iii":return e.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(r,{width:"short",context:"formatting"});case"iiii":default:return e.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,e){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,n,e){var r,i=t.getUTCHours();switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",n){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,n,e){var r,i=t.getUTCHours();switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",n){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,n,e){if("ho"===n){var r=t.getUTCHours()%12;return 0===r&&(r=12),e.ordinalNumber(r,{unit:"hour"})}return function(t,n){return Y(t.getUTCHours()%12||12,n.length)}(t,n)},H:function(t,n,e){return"Ho"===n?e.ordinalNumber(t.getUTCHours(),{unit:"hour"}):function(t,n){return Y(t.getUTCHours(),n.length)}(t,n)},K:function(t,n,e){var r=t.getUTCHours()%12;return"Ko"===n?e.ordinalNumber(r,{unit:"hour"}):Y(r,n.length)},k:function(t,n,e){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===n?e.ordinalNumber(r,{unit:"hour"}):Y(r,n.length)},m:function(t,n,e){return"mo"===n?e.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):function(t,n){return Y(t.getUTCMinutes(),n.length)}(t,n)},s:function(t,n,e){return"so"===n?e.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):function(t,n){return Y(t.getUTCSeconds(),n.length)}(t,n)},S:function(t,n){return function(t,n){var e=n.length,r=t.getUTCMilliseconds();return Y(Math.floor(r*Math.pow(10,e-3)),n.length)}(t,n)},X:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(n){case"X":return R(i);case"XXXX":case"XX":return z(i);case"XXXXX":case"XXX":default:return z(i,":")}},x:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"x":return R(i);case"xxxx":case"xx":return z(i);case"xxxxx":case"xxx":default:return z(i,":")}},O:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+N(i,":");case"OOOO":default:return"GMT"+z(i,":")}},z:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+N(i,":");case"zzzz":default:return"GMT"+z(i,":")}},t:function(t,n,e,r){return Y(Math.floor((r._originalDate||t).getTime()/1e3),n.length)},T:function(t,n,e,r){return Y((r._originalDate||t).getTime(),n.length)}};function N(t,n){var e=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(0===o)return e+String(i);var a=n||"";return e+String(i)+a+Y(o,2)}function R(t,n){return t%60==0?(t>0?"-":"+")+Y(Math.abs(t)/60,2):z(t,n)}function z(t,n){var e=n||"",r=t>0?"-":"+",i=Math.abs(t);return r+Y(Math.floor(i/60),2)+e+Y(i%60,2)}var G=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},X=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},C={p:X,P:function(t,n){var e,r=t.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return G(t,n);switch(i){case"P":e=n.dateTime({width:"short"});break;case"PP":e=n.dateTime({width:"medium"});break;case"PPP":e=n.dateTime({width:"long"});break;case"PPPP":default:e=n.dateTime({width:"full"})}return e.replace("{{date}}",G(i,n)).replace("{{time}}",X(o,n))}},B=["D","DD"],Q=["YY","YYYY"];function _(t){return-1!==B.indexOf(t)}function U(t){return-1!==Q.indexOf(t)}function H(t,n,e){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(n,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(n,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(n,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(n,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var $={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function I(t){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.width?String(n.width):t.defaultWidth,r=t.formats[e]||t.formats[t.defaultWidth];return r}}var J={date:I({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:I({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:I({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Z={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function K(t){return function(n,e){var r;if("formatting"===(null!=e&&e.context?String(e.context):"standalone")&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,o=null!=e&&e.width?String(e.width):i;r=t.formattingValues[o]||t.formattingValues[i]}else{var a=t.defaultWidth,u=null!=e&&e.width?String(e.width):t.defaultWidth;r=t.values[u]||t.values[a]}return r[t.argumentCallback?t.argumentCallback(n):n]}}function V(t){return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=n.match(i);if(!o)return null;var a,u=o[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],s=Array.isArray(c)?nt(c,(function(t){return t.test(u)})):tt(c,(function(t){return t.test(u)}));a=t.valueCallback?t.valueCallback(s):s,a=e.valueCallback?e.valueCallback(a):a;var d=n.slice(u.length);return{value:a,rest:d}}}function tt(t,n){for(var e in t)if(t.hasOwnProperty(e)&&n(t[e]))return e}function nt(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return e}var et,rt={code:"en-US",formatDistance:function(t,n,e){var r,i=$[t];return r="string"==typeof i?i:1===n?i.one:i.other.replace("{{count}}",n.toString()),null!=e&&e.addSuffix?e.comparison&&e.comparison>0?"in "+r:r+" ago":r},formatLong:J,formatRelative:function(t){return Z[t]},localize:{ordinalNumber:function(t){var n=Number(t),e=n%100;if(e>20||e<10)switch(e%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:K({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:K({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:K({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:K({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:K({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(et={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.match(et.matchPattern);if(!e)return null;var r=e[0],i=t.match(et.parsePattern);if(!i)return null;var o=et.valueCallback?et.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var a=t.slice(r.length);return{value:o,rest:a}}),era:V({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:V({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:V({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:V({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:V({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},it=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ot=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,at=/^'([^]*?)'?$/,ut=/''/g,ct=/[a-zA-Z]/;function st(t,n,e){var r,i,o,a,u,c,s,d,f,h,l,m,v,w,b,M,S,P;g(2,arguments);var D=String(n),k=E(),A=null!==(r=null!==(i=null==e?void 0:e.locale)&&void 0!==i?i:k.locale)&&void 0!==r?r:rt,T=y(null!==(o=null!==(a=null!==(u=null!==(c=null==e?void 0:e.firstWeekContainsDate)&&void 0!==c?c:null==e||null===(s=e.locale)||void 0===s||null===(d=s.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==u?u:k.firstWeekContainsDate)&&void 0!==a?a:null===(f=k.locale)||void 0===f||null===(h=f.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==o?o:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var q=y(null!==(l=null!==(m=null!==(v=null!==(w=null==e?void 0:e.weekStartsOn)&&void 0!==w?w:null==e||null===(b=e.locale)||void 0===b||null===(M=b.options)||void 0===M?void 0:M.weekStartsOn)&&void 0!==v?v:k.weekStartsOn)&&void 0!==m?m:null===(S=k.locale)||void 0===S||null===(P=S.options)||void 0===P?void 0:P.weekStartsOn)&&void 0!==l?l:0);if(!(q>=0&&q<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!A.localize)throw new RangeError("locale must contain localize property");if(!A.formatLong)throw new RangeError("locale must contain formatLong property");var W=p(t);if(!O(W))throw new RangeError("Invalid time value");var L=x(W),Y=j(W,L),N={firstWeekContainsDate:T,weekStartsOn:q,locale:A,_originalDate:W},R=D.match(ot).map((function(t){var n=t[0];return"p"===n||"P"===n?(0,C[n])(t,A.formatLong):t})).join("").match(it).map((function(r){if("''"===r)return"'";var i=r[0];if("'"===i)return dt(r);var o=F[i];if(o)return null!=e&&e.useAdditionalWeekYearTokens||!U(r)||H(r,n,String(t)),null!=e&&e.useAdditionalDayOfYearTokens||!_(r)||H(r,n,String(t)),o(Y,r,A.localize,N);if(i.match(ct))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("");return R}function dt(t){var n=t.match(at);return n?n[1].replace(ut,"'"):t}function ft(t){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ht(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return lt(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?lt(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}var mt={normalizePrecision:function(t){var n=t.reduce((function(t,n){return Math.max(t.getPrecision(),n.getPrecision())}));return t.map((function(t){return t.getPrecision()!==n?t.convertPrecision(n):t}))},minimum:function(t){var n=ht(t),e=n[0],r=n.slice(1),i=e;return r.forEach((function(t){i=i.lessThan(t)?i:t})),i},maximum:function(t){var n=ht(t),e=n[0],r=n.slice(1),i=e;return r.forEach((function(t){i=i.greaterThan(t)?i:t})),i}};function vt(t){return!isNaN(parseInt(t))&&isFinite(t)}function wt(t){return t%2==0}function yt(t){return vt(t)&&!Number.isInteger(t)}function gt(t){return Math.abs(t)%1==.5}function bt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var e in n)t.setRequestHeader(e,n[e]);return t}function pt(t){return void 0===t}function Mt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",e={};return Object.entries(t).forEach((function(t){if("object"===ft(t[1])){var r=Mt(t[1]);Object.entries(r).forEach((function(r){e[t[0]+n+r[0]]=r[1]}))}else e[t[0]]=t[1]})),e}function St(){var t={HALF_ODD:function(t){var n=Math.round(t);return gt(t)&&wt(n)?n-1:n},HALF_EVEN:function(t){var n=Math.round(t);return gt(t)?wt(n)?n:n-1:n},HALF_UP:function(t){return Math.round(t)},HALF_DOWN:function(t){return gt(t)?Math.floor(t):Math.round(t)},HALF_TOWARDS_ZERO:function(t){return gt(t)?Math.sign(t)*Math.floor(Math.abs(t)):Math.round(t)},HALF_AWAY_FROM_ZERO:function(t){return gt(t)?Math.sign(t)*Math.ceil(Math.abs(t)):Math.round(t)},DOWN:function(t){return Math.floor(t)}};return{add:function(t,n){return t+n},subtract:function(t,n){return t-n},multiply:function(t,n){return yt(t)||yt(n)?function(t,n){var e=function(t){return Math.pow(10,function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0).toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var n=t.split(".")[1];return n?n.length:0}(t))},r=Math.max(e(t),e(n));return Math.round(t*r)*Math.round(n*r)/(r*r)}(t,n):t*n},divide:function(t,n){return t/n},modulo:function(t,n){return t%n},round:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN";return t[e](n)}}}var Et=St();function xt(t){var n=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(t);return{getMatches:function(){return null!==n?n.slice(1).filter((function(t){return!pt(t)})):[]},getMinimumFractionDigits:function(){var t=function(t){return"."===t};return pt(this.getMatches().find(t))?0:this.getMatches()[Et.add(this.getMatches().findIndex(t),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find((function(t){return"USD"===t||"dollar"===t||"$"===t}))]},getStyle:function(){return pt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!pt(this.getMatches().find((function(t){return","===t})))}}}function Pt(t){var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;for(var e in n)t=t.replace("{{".concat(e,"}}"),n[e]);return t};return{getExchangeRate:function(e,r){return(i=t.endpoint,!Boolean(i)||"object"!==ft(i)&&"function"!=typeof i||"function"!=typeof i.then?function(e,r){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(e,r){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===i.readyState&&(i.status>=200&&i.status<400?e(JSON.parse(i.responseText)):r(new Error(i.statusText)))},onerror:function(){r(new Error("Network error"))}});i.open("GET",t,!0),bt(i,n.headers),i.send()}))}(n(t.endpoint,{from:e,to:r}),{headers:t.headers})}(e,r):t.endpoint).then((function(i){return Mt(i)[n(t.propertyPath,{from:e,to:r})]}));var i}}}function Dt(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!t)throw new e(n)}function Ot(t){Dt(function(t){return vt(t)&&t<=100&&t>=0}(t),"You must provide a numeric value between 0 and 100.",RangeError)}function jt(t){Dt(Number.isInteger(t),"You must provide an integer.",TypeError)}var kt=St(),At=Object.assign((function t(n){var e=Object.assign({},{amount:t.defaultAmount,currency:t.defaultCurrency,precision:t.defaultPrecision},n),r=e.amount,i=e.currency,o=e.precision;jt(r),jt(o);var a=t.globalLocale,u=t.globalFormat,c=t.globalRoundingMode,s=t.globalFormatRoundingMode,d=Object.assign({},t.globalExchangeRatesApi),f=function(n){var e=Object.assign({},Object.assign({},{amount:r,currency:i,precision:o},n),Object.assign({},{locale:this.locale},n));return Object.assign(t({amount:e.amount,currency:e.currency,precision:e.precision}),{locale:e.locale})},h=function(t){Dt(this.hasSameCurrency(t),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return i},getLocale:function(){return this.locale||a},setLocale:function(t){return f.call(this,{locale:t})},getPrecision:function(){return o},convertPrecision:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;jt(t);var e=this.getPrecision(),r=t>e,i=r?kt.multiply:kt.divide,o=r?[t,e]:[e,t],a=Math.pow(10,kt.subtract.apply(kt,o));return f.call(this,{amount:kt.round(i(this.getAmount(),a),n),precision:t})},add:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return f.call(this,{amount:kt.add(e[0].getAmount(),e[1].getAmount()),precision:e[0].getPrecision()})},subtract:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return f.call(this,{amount:kt.subtract(e[0].getAmount(),e[1].getAmount()),precision:e[0].getPrecision()})},multiply:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return f.call(this,{amount:kt.round(kt.multiply(this.getAmount(),t),n)})},divide:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return f.call(this,{amount:kt.round(kt.divide(this.getAmount(),t),n)})},percentage:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return Ot(t),this.multiply(kt.divide(t,100),n)},allocate:function(t){var n=this;!function(t){Dt(function(t){return t.length>0&&t.every((function(t){return t>=0}))&&t.some((function(t){return t>0}))}(t),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(t);for(var e=t.reduce((function(t,n){return kt.add(t,n)})),r=this.getAmount(),i=t.map((function(t){var i=Math.floor(kt.divide(kt.multiply(n.getAmount(),t),e));return r=kt.subtract(r,i),f.call(n,{amount:i})})),o=0;r>0;)t[o]>0&&(i[o]=i[o].add(f.call(this,{amount:1})),r=kt.subtract(r,1)),o+=1;return i},convert:function(t){var n=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.endpoint,i=void 0===r?d.endpoint:r,o=e.propertyPath,a=void 0===o?d.propertyPath||"rates.{{to}}":o,u=e.headers,s=void 0===u?d.headers:u,h=e.roundingMode,l=void 0===h?c:h,m=Object.assign({},{endpoint:i,propertyPath:a,headers:s,roundingMode:l});return Pt(m).getExchangeRate(this.getCurrency(),t).then((function(e){return Dt(!pt(e),'No rate was found for the destination currency "'.concat(t,'".'),TypeError),f.call(n,{amount:kt.round(kt.multiply(n.getAmount(),parseFloat(e)),m.roundingMode),currency:t})}))},equalsTo:function(t){return this.hasSameAmount(t)&&this.hasSameCurrency(t)},lessThan:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()<e[1].getAmount()},lessThanOrEqual:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()<=e[1].getAmount()},greaterThan:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()>e[1].getAmount()},greaterThanOrEqual:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()>=e[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==kt.modulo(this.getAmount(),Math.pow(10,o))},hasCents:function(){return 0!==kt.modulo(this.getAmount(),Math.pow(10,o))},hasSameCurrency:function(t){return this.getCurrency()===t.getCurrency()},hasSameAmount:function(n){var e=t.normalizePrecision([this,n]);return e[0].getAmount()===e[1].getAmount()},toFormat:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,e=xt(t);return this.toRoundedUnit(e.getMinimumFractionDigits(),n).toLocaleString(this.getLocale(),{currencyDisplay:e.getCurrencyDisplay(),useGrouping:e.getUseGrouping(),minimumFractionDigits:e.getMinimumFractionDigits(),style:e.getStyle(),currency:this.getCurrency()})},toUnit:function(){return kt.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,e=Math.pow(10,t);return kt.divide(kt.round(kt.multiply(this.toUnit(),e),n),e)},toObject:function(){return{amount:r,currency:i,precision:o}},toJSON:function(){return this.toObject()}}}),{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},{globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}},mt);const Tt=class{constructor(n){t(this,n),this.accountId=void 0,this.auth={},this.payments=[]}requestPropsChanged(){this.fetchData()}fetchData(){const t=`account/${this.accountId}/payments`;(t=>{async function n(){return{Authorization:`Bearer ${t}`,"Idempotency-Key":f(),"Content-Type":"application/json"}}async function e(t,e,r,i,o){const a=`http://localhost:3000/v1/${t}`,u=r?`${a}?${new URLSearchParams(r)}`:a,c=await fetch(u,{method:e,headers:await n(),body:i,signal:o});if(c)return 204===c.status?{}:c.json();!function(t){console.error(`Error fetching from ${t}`)}(u)}return{get:async function(t,n,r){return e(t,"GET",n,null,r)},post:async function(t,n,r,i){return e(t,"POST",r,n,i)},patch:async function(t,n,r,i){return e(t,"PATCH",r,n,i)},destroy:async function(t,n,r){return e(t,"DELETE",n,null,r)}}})(this.auth.token).get(t).then((t=>{const n=t.data.map((t=>new w(t)));this.payments=n}))}render(){return e(r,null,e("table",{class:"justifi-table"},e("thead",null,e("tr",null,e("th",{scope:"col",title:"The date and time each payment was made"},"Made on"),e("th",{scope:"col",title:"The dollar amount of each payment"},"Amount"),e("th",{scope:"col"},"Account"),e("th",{scope:"col"},"Description"),e("th",{scope:"col"},"Payment ID"),e("th",{scope:"col"},"Cardholder"),e("th",{scope:"col"},"Payment Method"),e("th",{scope:"col"},"Status"))),e("tbody",null,this.payments.map((t=>{var n,r,i,o,a;e("tr",null,e("td",null,e("div",null,(a=t.created_at)?st(new Date(a),"MMM d, yyyy"):""),e("div",null,function(t){return t?st(new Date(t),"h:mmaaa"):""}(t.created_at))),e("td",null,function(t,n=!0){function e(t){const e=n?"$0,0.00":"0,0.00";return At({amount:t,currency:"USD"}).toFormat(e)}return t||(t=0),t<0?`(${e(-t)})`:e(t)}(t.amount)),e("td",null,t.account_id),e("td",null,t.description),e("td",null,t.id),e("td",null,null===(r=null===(n=t.payment_method)||void 0===n?void 0:n.card)||void 0===r?void 0:r.name),e("td",null,null===(o=null===(i=t.payment_method)||void 0===i?void 0:i.card)||void 0===o?void 0:o.acct_last_four),e("td",null,t.status))})))))}static get watchers(){return{accountId:["requestPropsChanged"],auth:["requestPropsChanged"]}}};Tt.style=":host{display:block}";export{o as justifi_card_form,Tt as justifi_payments_list}
|
|
1
|
+
import{r as t,c as n,h as e,H as r}from"./p-5bf626ec.js";var i;!function(t){t.blur="blur",t.change="change",t.ready="ready",t.tokenize="tokenize"}(i||(i={}));const o=class{constructor(e){t(this,e),this.cardFormReady=n(this,"cardFormReady",7),this.cardFormChange=n(this,"cardFormChange",7),this.cardFormBlur=n(this,"cardFormBlur",7),this.cardFormTokenize=n(this,"cardFormTokenize",7),this.iframeOrigin=void 0}connectedCallback(){window.addEventListener("message",this.dispatchMessageEvent.bind(this))}disconnectedCallback(){window.removeEventListener("message",this.dispatchMessageEvent.bind(this))}dispatchMessageEvent(t){const n=t.data,e=n.data;switch(n.eventType){case i.ready:this.cardFormReady.emit(e);break;case i.change:this.cardFormChange.emit(e);break;case i.blur:this.cardFormBlur.emit(e)}}triggerTokenization(t,n,e){this.iframeElement&&this.iframeElement.contentWindow&&this.iframeElement.contentWindow.postMessage({eventType:i.tokenize,clientKey:t,paymentMethodMetadata:n,account:e},"*")}async tokenize(t,n,e){return new Promise((r=>{const o=t=>{t.data.eventType===i.tokenize&&(window.removeEventListener("message",o),r(t.data.data))};window.addEventListener("message",o),this.triggerTokenization(t,n,e)}))}render(){return e(r,null,e("iframe",{id:"justifi-card-form",src:this.iframeOrigin||"https://js.justifi.ai",ref:t=>this.iframeElement=t}))}};let a;o.style=":host{display:block}iframe{border:none;height:55px;width:100%}";const u=new Uint8Array(16);function c(){if(!a&&(a="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!a))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(u)}const s=[];for(let t=0;t<256;++t)s.push((t+256).toString(16).slice(1));const d={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function f(t,n,e){if(d.randomUUID&&!n&&!t)return d.randomUUID();const r=(t=t||{}).random||(t.rng||c)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,n){e=e||0;for(let t=0;t<16;++t)n[e+t]=r[t];return n}return function(t,n=0){return(s[t[n+0]]+s[t[n+1]]+s[t[n+2]]+s[t[n+3]]+"-"+s[t[n+4]]+s[t[n+5]]+"-"+s[t[n+6]]+s[t[n+7]]+"-"+s[t[n+8]]+s[t[n+9]]+"-"+s[t[n+10]]+s[t[n+11]]+s[t[n+12]]+s[t[n+13]]+s[t[n+14]]+s[t[n+15]]).toLowerCase()}(r)}var h,l,m,v;!function(t){t.automatic="automatic",t.manual="manual"}(h||(h={})),function(t){t.card="card",t.bankAccount="bank_account"}(l||(l={})),function(t){t.pending="pending",t.authorized="authorized",t.succeeded="succeeded",t.failed="failed",t.disputed="disputed",t.fully_refunded="fully_refunded",t.partially_refunded="partially_refunded"}(m||(m={})),function(t){t.lost="lost",t.open="open"}(v||(v={}));class w{constructor(t){this.id=t.id,this.account_id=t.account_id,this.amount=t.amount,this.amount_disputed=t.amount_disputed,this.amount_refundable=t.amount_refundable,this.amount_refunded=t.amount_refunded,this.balance=t.balance,this.captured=t.captured,this.capture_strategy=t.capture_strategy,this.currency=t.currency,this.description=t.description,this.disputed=t.disputed,this.disputes=t.disputes,this.error_code=t.error_code,this.error_description=t.error_description,this.fee_amount=t.fee_amount,this.is_test=t.is_test,this.metadata=t.metadata,this.payment_method=t.payment_method,this.payment_intent_id=t.payment_intent_id,this.refunded=t.refunded,this.status=t.status,this.created_at=t.created_at,this.updated_at=t.updated_at}get disputedStatus(){const t=this.disputes.some((t=>t.status===v.lost));return this.disputed?t?v.lost:v.open:null}}function y(t){if(null===t||!0===t||!1===t)return NaN;var n=Number(t);return isNaN(n)?n:n<0?Math.ceil(n):Math.floor(n)}function g(t,n){if(n.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+n.length+" present")}function b(t){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t){g(1,arguments);var n=Object.prototype.toString.call(t);return t instanceof Date||"object"===b(t)&&"[object Date]"===n?new Date(t.getTime()):"number"==typeof t||"[object Number]"===n?new Date(t):("string"!=typeof t&&"[object String]"!==n||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function M(t,n){g(2,arguments);var e=p(t).getTime(),r=y(n);return new Date(e+r)}var S={};function E(){return S}function x(t){var n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),t.getTime()-n.getTime()}function P(t){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function D(t){return g(1,arguments),t instanceof Date||"object"===P(t)&&"[object Date]"===Object.prototype.toString.call(t)}function O(t){if(g(1,arguments),!D(t)&&"number"!=typeof t)return!1;var n=p(t);return!isNaN(Number(n))}function j(t,n){g(2,arguments);var e=y(n);return M(t,-e)}function k(t){g(1,arguments);var n=1,e=p(t),r=e.getUTCDay(),i=(r<n?7:0)+r-n;return e.setUTCDate(e.getUTCDate()-i),e.setUTCHours(0,0,0,0),e}function A(t){g(1,arguments);var n=p(t),e=n.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(e+1,0,4),r.setUTCHours(0,0,0,0);var i=k(r),o=new Date(0);o.setUTCFullYear(e,0,4),o.setUTCHours(0,0,0,0);var a=k(o);return n.getTime()>=i.getTime()?e+1:n.getTime()>=a.getTime()?e:e-1}function T(t){g(1,arguments);var n=A(t),e=new Date(0);e.setUTCFullYear(n,0,4),e.setUTCHours(0,0,0,0);var r=k(e);return r}function q(t,n){var e,r,i,o,a,u,c,s;g(1,arguments);var d=E(),f=y(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.weekStartsOn)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==r?r:null===(c=d.locale)||void 0===c||null===(s=c.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==e?e:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=p(t),l=h.getUTCDay(),m=(l<f?7:0)+l-f;return h.setUTCDate(h.getUTCDate()-m),h.setUTCHours(0,0,0,0),h}function W(t,n){var e,r,i,o,a,u,c,s;g(1,arguments);var d=p(t),f=d.getUTCFullYear(),h=E(),l=y(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.firstWeekContainsDate)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==i?i:h.firstWeekContainsDate)&&void 0!==r?r:null===(c=h.locale)||void 0===c||null===(s=c.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==e?e:1);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(f+1,0,l),m.setUTCHours(0,0,0,0);var v=q(m,n),w=new Date(0);w.setUTCFullYear(f,0,l),w.setUTCHours(0,0,0,0);var b=q(w,n);return d.getTime()>=v.getTime()?f+1:d.getTime()>=b.getTime()?f:f-1}function L(t,n){var e,r,i,o,a,u,c,s;g(1,arguments);var d=E(),f=y(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.firstWeekContainsDate)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==i?i:d.firstWeekContainsDate)&&void 0!==r?r:null===(c=d.locale)||void 0===c||null===(s=c.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==e?e:1),h=W(t,n),l=new Date(0);l.setUTCFullYear(h,0,f),l.setUTCHours(0,0,0,0);var m=q(l,n);return m}function Y(t,n){for(var e=t<0?"-":"",r=Math.abs(t).toString();r.length<n;)r="0"+r;return e+r}var F={G:function(t,n,e){var r=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return e.era(r,{width:"abbreviated"});case"GGGGG":return e.era(r,{width:"narrow"});case"GGGG":default:return e.era(r,{width:"wide"})}},y:function(t,n,e){if("yo"===n){var r=t.getUTCFullYear();return e.ordinalNumber(r>0?r:1-r,{unit:"year"})}return function(t,n){var e=t.getUTCFullYear(),r=e>0?e:1-e;return Y("yy"===n?r%100:r,n.length)}(t,n)},Y:function(t,n,e,r){var i=W(t,r),o=i>0?i:1-i;return"YY"===n?Y(o%100,2):"Yo"===n?e.ordinalNumber(o,{unit:"year"}):Y(o,n.length)},R:function(t,n){return Y(A(t),n.length)},u:function(t,n){return Y(t.getUTCFullYear(),n.length)},Q:function(t,n,e){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return Y(r,2);case"Qo":return e.ordinalNumber(r,{unit:"quarter"});case"QQQ":return e.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,e){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return Y(r,2);case"qo":return e.ordinalNumber(r,{unit:"quarter"});case"qqq":return e.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,e){var r=t.getUTCMonth();switch(n){case"M":case"MM":return function(t,n){var e=t.getUTCMonth();return"M"===n?String(e+1):Y(e+1,2)}(t,n);case"Mo":return e.ordinalNumber(r+1,{unit:"month"});case"MMM":return e.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,e){var r=t.getUTCMonth();switch(n){case"L":return String(r+1);case"LL":return Y(r+1,2);case"Lo":return e.ordinalNumber(r+1,{unit:"month"});case"LLL":return e.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,e,r){var i=function(t,n){g(1,arguments);var e=p(t),r=q(e,n).getTime()-L(e,n).getTime();return Math.round(r/6048e5)+1}(t,r);return"wo"===n?e.ordinalNumber(i,{unit:"week"}):Y(i,n.length)},I:function(t,n,e){var r=function(t){g(1,arguments);var n=p(t),e=k(n).getTime()-T(n).getTime();return Math.round(e/6048e5)+1}(t);return"Io"===n?e.ordinalNumber(r,{unit:"week"}):Y(r,n.length)},d:function(t,n,e){return"do"===n?e.ordinalNumber(t.getUTCDate(),{unit:"date"}):function(t,n){return Y(t.getUTCDate(),n.length)}(t,n)},D:function(t,n,e){var r=function(t){g(1,arguments);var n=p(t),e=n.getTime();n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0);var r=n.getTime();return Math.floor((e-r)/864e5)+1}(t);return"Do"===n?e.ordinalNumber(r,{unit:"dayOfYear"}):Y(r,n.length)},E:function(t,n,e){var r=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return e.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(r,{width:"short",context:"formatting"});case"EEEE":default:return e.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,e,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return Y(o,2);case"eo":return e.ordinalNumber(o,{unit:"day"});case"eee":return e.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(i,{width:"short",context:"formatting"});case"eeee":default:return e.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,e,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return Y(o,n.length);case"co":return e.ordinalNumber(o,{unit:"day"});case"ccc":return e.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(i,{width:"narrow",context:"standalone"});case"cccccc":return e.day(i,{width:"short",context:"standalone"});case"cccc":default:return e.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,e){var r=t.getUTCDay(),i=0===r?7:r;switch(n){case"i":return String(i);case"ii":return Y(i,n.length);case"io":return e.ordinalNumber(i,{unit:"day"});case"iii":return e.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(r,{width:"short",context:"formatting"});case"iiii":default:return e.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,e){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,n,e){var r,i=t.getUTCHours();switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",n){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,n,e){var r,i=t.getUTCHours();switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",n){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,n,e){if("ho"===n){var r=t.getUTCHours()%12;return 0===r&&(r=12),e.ordinalNumber(r,{unit:"hour"})}return function(t,n){return Y(t.getUTCHours()%12||12,n.length)}(t,n)},H:function(t,n,e){return"Ho"===n?e.ordinalNumber(t.getUTCHours(),{unit:"hour"}):function(t,n){return Y(t.getUTCHours(),n.length)}(t,n)},K:function(t,n,e){var r=t.getUTCHours()%12;return"Ko"===n?e.ordinalNumber(r,{unit:"hour"}):Y(r,n.length)},k:function(t,n,e){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===n?e.ordinalNumber(r,{unit:"hour"}):Y(r,n.length)},m:function(t,n,e){return"mo"===n?e.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):function(t,n){return Y(t.getUTCMinutes(),n.length)}(t,n)},s:function(t,n,e){return"so"===n?e.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):function(t,n){return Y(t.getUTCSeconds(),n.length)}(t,n)},S:function(t,n){return function(t,n){var e=n.length,r=t.getUTCMilliseconds();return Y(Math.floor(r*Math.pow(10,e-3)),n.length)}(t,n)},X:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(n){case"X":return R(i);case"XXXX":case"XX":return z(i);case"XXXXX":case"XXX":default:return z(i,":")}},x:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"x":return R(i);case"xxxx":case"xx":return z(i);case"xxxxx":case"xxx":default:return z(i,":")}},O:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+N(i,":");case"OOOO":default:return"GMT"+z(i,":")}},z:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+N(i,":");case"zzzz":default:return"GMT"+z(i,":")}},t:function(t,n,e,r){return Y(Math.floor((r._originalDate||t).getTime()/1e3),n.length)},T:function(t,n,e,r){return Y((r._originalDate||t).getTime(),n.length)}};function N(t,n){var e=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(0===o)return e+String(i);var a=n||"";return e+String(i)+a+Y(o,2)}function R(t,n){return t%60==0?(t>0?"-":"+")+Y(Math.abs(t)/60,2):z(t,n)}function z(t,n){var e=n||"",r=t>0?"-":"+",i=Math.abs(t);return r+Y(Math.floor(i/60),2)+e+Y(i%60,2)}var G=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},X=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},C={p:X,P:function(t,n){var e,r=t.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return G(t,n);switch(i){case"P":e=n.dateTime({width:"short"});break;case"PP":e=n.dateTime({width:"medium"});break;case"PPP":e=n.dateTime({width:"long"});break;case"PPPP":default:e=n.dateTime({width:"full"})}return e.replace("{{date}}",G(i,n)).replace("{{time}}",X(o,n))}},B=["D","DD"],Q=["YY","YYYY"];function _(t){return-1!==B.indexOf(t)}function U(t){return-1!==Q.indexOf(t)}function H(t,n,e){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(n,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(n,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(n,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(n,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var $={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function I(t){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.width?String(n.width):t.defaultWidth,r=t.formats[e]||t.formats[t.defaultWidth];return r}}var J={date:I({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:I({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:I({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Z={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function K(t){return function(n,e){var r;if("formatting"===(null!=e&&e.context?String(e.context):"standalone")&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,o=null!=e&&e.width?String(e.width):i;r=t.formattingValues[o]||t.formattingValues[i]}else{var a=t.defaultWidth,u=null!=e&&e.width?String(e.width):t.defaultWidth;r=t.values[u]||t.values[a]}return r[t.argumentCallback?t.argumentCallback(n):n]}}function V(t){return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=n.match(i);if(!o)return null;var a,u=o[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],s=Array.isArray(c)?nt(c,(function(t){return t.test(u)})):tt(c,(function(t){return t.test(u)}));a=t.valueCallback?t.valueCallback(s):s,a=e.valueCallback?e.valueCallback(a):a;var d=n.slice(u.length);return{value:a,rest:d}}}function tt(t,n){for(var e in t)if(t.hasOwnProperty(e)&&n(t[e]))return e}function nt(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return e}var et,rt={code:"en-US",formatDistance:function(t,n,e){var r,i=$[t];return r="string"==typeof i?i:1===n?i.one:i.other.replace("{{count}}",n.toString()),null!=e&&e.addSuffix?e.comparison&&e.comparison>0?"in "+r:r+" ago":r},formatLong:J,formatRelative:function(t){return Z[t]},localize:{ordinalNumber:function(t){var n=Number(t),e=n%100;if(e>20||e<10)switch(e%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:K({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:K({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:K({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:K({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:K({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(et={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.match(et.matchPattern);if(!e)return null;var r=e[0],i=t.match(et.parsePattern);if(!i)return null;var o=et.valueCallback?et.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var a=t.slice(r.length);return{value:o,rest:a}}),era:V({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:V({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:V({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:V({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:V({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},it=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ot=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,at=/^'([^]*?)'?$/,ut=/''/g,ct=/[a-zA-Z]/;function st(t,n,e){var r,i,o,a,u,c,s,d,f,h,l,m,v,w,b,M,S,P;g(2,arguments);var D=String(n),k=E(),A=null!==(r=null!==(i=null==e?void 0:e.locale)&&void 0!==i?i:k.locale)&&void 0!==r?r:rt,T=y(null!==(o=null!==(a=null!==(u=null!==(c=null==e?void 0:e.firstWeekContainsDate)&&void 0!==c?c:null==e||null===(s=e.locale)||void 0===s||null===(d=s.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==u?u:k.firstWeekContainsDate)&&void 0!==a?a:null===(f=k.locale)||void 0===f||null===(h=f.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==o?o:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var q=y(null!==(l=null!==(m=null!==(v=null!==(w=null==e?void 0:e.weekStartsOn)&&void 0!==w?w:null==e||null===(b=e.locale)||void 0===b||null===(M=b.options)||void 0===M?void 0:M.weekStartsOn)&&void 0!==v?v:k.weekStartsOn)&&void 0!==m?m:null===(S=k.locale)||void 0===S||null===(P=S.options)||void 0===P?void 0:P.weekStartsOn)&&void 0!==l?l:0);if(!(q>=0&&q<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!A.localize)throw new RangeError("locale must contain localize property");if(!A.formatLong)throw new RangeError("locale must contain formatLong property");var W=p(t);if(!O(W))throw new RangeError("Invalid time value");var L=x(W),Y=j(W,L),N={firstWeekContainsDate:T,weekStartsOn:q,locale:A,_originalDate:W},R=D.match(ot).map((function(t){var n=t[0];return"p"===n||"P"===n?(0,C[n])(t,A.formatLong):t})).join("").match(it).map((function(r){if("''"===r)return"'";var i=r[0];if("'"===i)return dt(r);var o=F[i];if(o)return null!=e&&e.useAdditionalWeekYearTokens||!U(r)||H(r,n,String(t)),null!=e&&e.useAdditionalDayOfYearTokens||!_(r)||H(r,n,String(t)),o(Y,r,A.localize,N);if(i.match(ct))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("");return R}function dt(t){var n=t.match(at);return n?n[1].replace(ut,"'"):t}function ft(t){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ht(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return lt(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?lt(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}var mt={normalizePrecision:function(t){var n=t.reduce((function(t,n){return Math.max(t.getPrecision(),n.getPrecision())}));return t.map((function(t){return t.getPrecision()!==n?t.convertPrecision(n):t}))},minimum:function(t){var n=ht(t),e=n[0],r=n.slice(1),i=e;return r.forEach((function(t){i=i.lessThan(t)?i:t})),i},maximum:function(t){var n=ht(t),e=n[0],r=n.slice(1),i=e;return r.forEach((function(t){i=i.greaterThan(t)?i:t})),i}};function vt(t){return!isNaN(parseInt(t))&&isFinite(t)}function wt(t){return t%2==0}function yt(t){return vt(t)&&!Number.isInteger(t)}function gt(t){return Math.abs(t)%1==.5}function bt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var e in n)t.setRequestHeader(e,n[e]);return t}function pt(t){return void 0===t}function Mt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",e={};return Object.entries(t).forEach((function(t){if("object"===ft(t[1])){var r=Mt(t[1]);Object.entries(r).forEach((function(r){e[t[0]+n+r[0]]=r[1]}))}else e[t[0]]=t[1]})),e}function St(){var t={HALF_ODD:function(t){var n=Math.round(t);return gt(t)&&wt(n)?n-1:n},HALF_EVEN:function(t){var n=Math.round(t);return gt(t)?wt(n)?n:n-1:n},HALF_UP:function(t){return Math.round(t)},HALF_DOWN:function(t){return gt(t)?Math.floor(t):Math.round(t)},HALF_TOWARDS_ZERO:function(t){return gt(t)?Math.sign(t)*Math.floor(Math.abs(t)):Math.round(t)},HALF_AWAY_FROM_ZERO:function(t){return gt(t)?Math.sign(t)*Math.ceil(Math.abs(t)):Math.round(t)},DOWN:function(t){return Math.floor(t)}};return{add:function(t,n){return t+n},subtract:function(t,n){return t-n},multiply:function(t,n){return yt(t)||yt(n)?function(t,n){var e=function(t){return Math.pow(10,function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0).toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var n=t.split(".")[1];return n?n.length:0}(t))},r=Math.max(e(t),e(n));return Math.round(t*r)*Math.round(n*r)/(r*r)}(t,n):t*n},divide:function(t,n){return t/n},modulo:function(t,n){return t%n},round:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN";return t[e](n)}}}var Et=St();function xt(t){var n=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(t);return{getMatches:function(){return null!==n?n.slice(1).filter((function(t){return!pt(t)})):[]},getMinimumFractionDigits:function(){var t=function(t){return"."===t};return pt(this.getMatches().find(t))?0:this.getMatches()[Et.add(this.getMatches().findIndex(t),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find((function(t){return"USD"===t||"dollar"===t||"$"===t}))]},getStyle:function(){return pt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!pt(this.getMatches().find((function(t){return","===t})))}}}function Pt(t){var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;for(var e in n)t=t.replace("{{".concat(e,"}}"),n[e]);return t};return{getExchangeRate:function(e,r){return(i=t.endpoint,!Boolean(i)||"object"!==ft(i)&&"function"!=typeof i||"function"!=typeof i.then?function(e,r){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(e,r){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===i.readyState&&(i.status>=200&&i.status<400?e(JSON.parse(i.responseText)):r(new Error(i.statusText)))},onerror:function(){r(new Error("Network error"))}});i.open("GET",t,!0),bt(i,n.headers),i.send()}))}(n(t.endpoint,{from:e,to:r}),{headers:t.headers})}(e,r):t.endpoint).then((function(i){return Mt(i)[n(t.propertyPath,{from:e,to:r})]}));var i}}}function Dt(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!t)throw new e(n)}function Ot(t){Dt(function(t){return vt(t)&&t<=100&&t>=0}(t),"You must provide a numeric value between 0 and 100.",RangeError)}function jt(t){Dt(Number.isInteger(t),"You must provide an integer.",TypeError)}var kt=St(),At=Object.assign((function t(n){var e=Object.assign({},{amount:t.defaultAmount,currency:t.defaultCurrency,precision:t.defaultPrecision},n),r=e.amount,i=e.currency,o=e.precision;jt(r),jt(o);var a=t.globalLocale,u=t.globalFormat,c=t.globalRoundingMode,s=t.globalFormatRoundingMode,d=Object.assign({},t.globalExchangeRatesApi),f=function(n){var e=Object.assign({},Object.assign({},{amount:r,currency:i,precision:o},n),Object.assign({},{locale:this.locale},n));return Object.assign(t({amount:e.amount,currency:e.currency,precision:e.precision}),{locale:e.locale})},h=function(t){Dt(this.hasSameCurrency(t),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return i},getLocale:function(){return this.locale||a},setLocale:function(t){return f.call(this,{locale:t})},getPrecision:function(){return o},convertPrecision:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;jt(t);var e=this.getPrecision(),r=t>e,i=r?kt.multiply:kt.divide,o=r?[t,e]:[e,t],a=Math.pow(10,kt.subtract.apply(kt,o));return f.call(this,{amount:kt.round(i(this.getAmount(),a),n),precision:t})},add:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return f.call(this,{amount:kt.add(e[0].getAmount(),e[1].getAmount()),precision:e[0].getPrecision()})},subtract:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return f.call(this,{amount:kt.subtract(e[0].getAmount(),e[1].getAmount()),precision:e[0].getPrecision()})},multiply:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return f.call(this,{amount:kt.round(kt.multiply(this.getAmount(),t),n)})},divide:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return f.call(this,{amount:kt.round(kt.divide(this.getAmount(),t),n)})},percentage:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return Ot(t),this.multiply(kt.divide(t,100),n)},allocate:function(t){var n=this;!function(t){Dt(function(t){return t.length>0&&t.every((function(t){return t>=0}))&&t.some((function(t){return t>0}))}(t),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(t);for(var e=t.reduce((function(t,n){return kt.add(t,n)})),r=this.getAmount(),i=t.map((function(t){var i=Math.floor(kt.divide(kt.multiply(n.getAmount(),t),e));return r=kt.subtract(r,i),f.call(n,{amount:i})})),o=0;r>0;)t[o]>0&&(i[o]=i[o].add(f.call(this,{amount:1})),r=kt.subtract(r,1)),o+=1;return i},convert:function(t){var n=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.endpoint,i=void 0===r?d.endpoint:r,o=e.propertyPath,a=void 0===o?d.propertyPath||"rates.{{to}}":o,u=e.headers,s=void 0===u?d.headers:u,h=e.roundingMode,l=void 0===h?c:h,m=Object.assign({},{endpoint:i,propertyPath:a,headers:s,roundingMode:l});return Pt(m).getExchangeRate(this.getCurrency(),t).then((function(e){return Dt(!pt(e),'No rate was found for the destination currency "'.concat(t,'".'),TypeError),f.call(n,{amount:kt.round(kt.multiply(n.getAmount(),parseFloat(e)),m.roundingMode),currency:t})}))},equalsTo:function(t){return this.hasSameAmount(t)&&this.hasSameCurrency(t)},lessThan:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()<e[1].getAmount()},lessThanOrEqual:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()<=e[1].getAmount()},greaterThan:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()>e[1].getAmount()},greaterThanOrEqual:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()>=e[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==kt.modulo(this.getAmount(),Math.pow(10,o))},hasCents:function(){return 0!==kt.modulo(this.getAmount(),Math.pow(10,o))},hasSameCurrency:function(t){return this.getCurrency()===t.getCurrency()},hasSameAmount:function(n){var e=t.normalizePrecision([this,n]);return e[0].getAmount()===e[1].getAmount()},toFormat:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,e=xt(t);return this.toRoundedUnit(e.getMinimumFractionDigits(),n).toLocaleString(this.getLocale(),{currencyDisplay:e.getCurrencyDisplay(),useGrouping:e.getUseGrouping(),minimumFractionDigits:e.getMinimumFractionDigits(),style:e.getStyle(),currency:this.getCurrency()})},toUnit:function(){return kt.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,e=Math.pow(10,t);return kt.divide(kt.round(kt.multiply(this.toUnit(),e),n),e)},toObject:function(){return{amount:r,currency:i,precision:o}},toJSON:function(){return this.toObject()}}}),{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},{globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}},mt);const Tt=class{constructor(n){t(this,n),this.accountId=void 0,this.auth={},this.payments=[]}requestPropsChanged(){this.fetchData()}fetchData(){const t=`account/${this.accountId}/payments`;(t=>{async function n(){return{Authorization:`Bearer ${t}`,"Idempotency-Key":f(),"Content-Type":"application/json"}}async function e(t,e,r,i,o){const a=`http://localhost:3000/v1/${t}`,u=r?`${a}?${new URLSearchParams(r)}`:a,c=await fetch(u,{method:e,headers:await n(),body:i,signal:o});if(c)return 204===c.status?{}:c.json();!function(t){console.error(`Error fetching from ${t}`)}(u)}return{get:async function(t,n,r){return e(t,"GET",n,null,r)},post:async function(t,n,r,i){return e(t,"POST",r,n,i)},patch:async function(t,n,r,i){return e(t,"PATCH",r,n,i)},destroy:async function(t,n,r){return e(t,"DELETE",n,null,r)}}})(this.auth.token).get(t).then((t=>{const n=t.data.map((t=>new w(t)));this.payments=n}))}render(){return e(r,null,e("table",{class:"justifi-table"},e("thead",null,e("tr",null,e("th",{scope:"col",title:"The date and time each payment was made"},"Made on"),e("th",{scope:"col",title:"The dollar amount of each payment"},"Amount"),e("th",{scope:"col"},"Account"),e("th",{scope:"col"},"Description"),e("th",{scope:"col"},"Payment ID"),e("th",{scope:"col"},"Cardholder"),e("th",{scope:"col"},"Payment Method"),e("th",{scope:"col"},"Status"))),e("tbody",null,this.payments.map((t=>{var n,r,i,o,a;e("tr",null,e("td",null,e("div",null,(a=t.created_at)?st(new Date(a),"MMM d, yyyy"):""),e("div",null,function(t){return t?st(new Date(t),"h:mmaaa"):""}(t.created_at))),e("td",null,function(t,n=!0){function e(t){const e=n?"$0,0.00":"0,0.00";return At({amount:t,currency:"USD"}).toFormat(e)}return t||(t=0),t<0?`(${e(-t)})`:e(t)}(t.amount)),e("td",null,t.account_id),e("td",null,t.description),e("td",null,t.id),e("td",null,null===(r=null===(n=t.payment_method)||void 0===n?void 0:n.card)||void 0===r?void 0:r.name),e("td",null,null===(o=null===(i=t.payment_method)||void 0===i?void 0:i.card)||void 0===o?void 0:o.acct_last_four),e("td",null,t.status))})))))}static get watchers(){return{accountId:["requestPropsChanged"],auth:["requestPropsChanged"]}}};Tt.style=":host{display:block}";export{o as justifi_card_form,Tt as justifi_payments_list}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as i,b as t}from"./p-5bf626ec.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),i(a)})().then((i=>t([["p-a7effb1e",[[0,"justifi-card-form",{iframeOrigin:[1,"iframe-origin"],tokenize:[64]}],[1,"justifi-payments-list",{accountId:[1,"account-id"],auth:[16],payments:[32]}]]]],i)));
|
package/loader/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as i,b as t}from"./p-3487f6b8.js";(()=>{const t=import.meta.url,r={};return""!==t&&(r.resourcesUrl=new URL(".",t).href),i(r)})().then((i=>t([["p-69e18be7",[[1,"justifi-card-form",{iframeOrigin:[1,"iframe-origin"],tokenize:[64]}],[1,"justifi-payments-list",{accountId:[1,"account-id"],auth:[16],payments:[32]}]]]],i)));
|