@everymatrix/cashier-method-details 1.24.4 → 1.24.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).app=t()}(this,(function(){"use strict";function e(){}function t(e){return e()}function
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).app=t()}(this,(function(){"use strict";function e(){}function t(e){return e()}function r(){return Object.create(null)}function n(e){e.forEach(t)}function o(e){return"function"==typeof e}function i(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let s;function a(e,t){return s||(s=document.createElement("a")),s.href=t,e===s.href}function l(t,...r){if(null==t)return e;const n=t.subscribe(...r);return n.unsubscribe?()=>n.unsubscribe():n}function c(e,t,r){e.$$.on_destroy.push(l(t,r))}const u="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function h(e,t){e.appendChild(t)}function p(e,t,r){e.insertBefore(t,r||null)}function f(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,t){for(let r=0;r<e.length;r+=1)e[r]&&e[r].d(t)}function m(e){return document.createElement(e)}function y(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function b(e){return document.createTextNode(e)}function g(){return b(" ")}function v(){return b("")}function E(e,t,r,n){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n)}function w(e,t,r){null==r?e.removeAttribute(t):e.getAttribute(t)!==r&&e.setAttribute(t,r)}function T(e,t,r){t in e?e[t]="boolean"==typeof e[t]&&""===r||r:w(e,t,r)}function _(e){return""===e?null:+e}function C(e,t){t=""+t,e.data!==t&&(e.data=t)}function B(e,t){e.value=null==t?"":t}function x(e,t,r){e.classList[r?"add":"remove"](t)}function A(e){const t={};for(const r of e)t[r.name]=r.value;return t}let L;function H(e){L=e}function S(){if(!L)throw new Error("Function called outside component initialization");return L}
|
2
2
|
/**
|
3
3
|
* The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.
|
4
4
|
* It must be called during the component's initialisation (but doesn't need to live *inside* the component;
|
@@ -20,10 +20,10 @@
|
|
20
20
|
*
|
21
21
|
* https://svelte.dev/docs#run-time-svelte-createeventdispatcher
|
22
22
|
*/
|
23
|
-
function
|
23
|
+
function P(){const e=S();return(t,r,{cancelable:n=!1}={})=>{const o=e.$$.callbacks[t];if(o){
|
24
24
|
// TODO are there situations where events could be dispatched
|
25
25
|
// in a server (non-DOM) environment?
|
26
|
-
const
|
26
|
+
const i=function(e,t,{bubbles:r=!1,cancelable:n=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(e,r,n,t),o}(t,r,{cancelable:n});return o.slice().forEach((t=>{t.call(e,i)})),!i.defaultPrevented}return!0}}const M=[],O=[];let R=[];const N=[],k=Promise.resolve();let I=!1;function $(e){R.push(e)}
|
27
27
|
// flush() calls callbacks in this order:
|
28
28
|
// 1. All beforeUpdate callbacks, in order: parents before children
|
29
29
|
// 2. All bind:this callbacks, in reverse order: children before parents.
|
@@ -47,79 +47,142 @@ function F(){
|
|
47
47
|
// Do not reenter flush while dirty components are updated, as this can
|
48
48
|
// result in an infinite loop. Instead, let the inner flush handle it.
|
49
49
|
// Reentrancy is ok afterwards for bindings etc.
|
50
|
-
if(0!==U)return;const e=
|
50
|
+
if(0!==U)return;const e=L;do{
|
51
51
|
// first, call beforeUpdate functions
|
52
52
|
// and update components
|
53
|
-
try{for(;U<
|
53
|
+
try{for(;U<M.length;){const e=M[U];U++,H(e),G(e.$$)}}catch(e){
|
54
54
|
// reset dirty state to not end up in a deadlocked state and then rethrow
|
55
|
-
throw
|
55
|
+
throw M.length=0,U=0,e}for(H(null),M.length=0,U=0;O.length;)O.pop()();
|
56
56
|
// then, once components are updated, call
|
57
57
|
// afterUpdate functions. This may cause
|
58
58
|
// subsequent updates...
|
59
|
-
for(let e=0;e<
|
59
|
+
for(let e=0;e<R.length;e+=1){const t=R[e];D.has(t)||(
|
60
60
|
// ...so guard against infinite loops
|
61
|
-
D.add(t),t())}
|
61
|
+
D.add(t),t())}R.length=0}while(M.length);for(;N.length;)N.pop()();I=!1,D.clear(),H(e)}function G(e){if(null!==e.fragment){e.update(),n(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach($)}}
|
62
62
|
/**
|
63
63
|
* Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.
|
64
|
-
*/const j=new Set;function V(e,t){const
|
64
|
+
*/const j=new Set;function V(e,t){const r=e.$$;null!==r.fragment&&(!function(e){const t=[],r=[];R.forEach((n=>-1===e.indexOf(n)?t.push(n):r.push(n))),r.forEach((e=>e())),R=t}(r.after_update),n(r.on_destroy),r.fragment&&r.fragment.d(t),
|
65
65
|
// TODO null out other refs, including component.$$ (but need to
|
66
66
|
// preserve final state?)
|
67
|
-
|
67
|
+
r.on_destroy=r.fragment=null,r.ctx=[])}function z(e,t){-1===e.$$.dirty[0]&&(M.push(e),I||(I=!0,k.then(F)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function X(i,s,a,l,c,u,h,p=[-1]){const d=L;H(i);const m=i.$$={fragment:null,ctx:[],
|
68
68
|
// state
|
69
|
-
props:u,update:e,not_equal:c,bound:
|
69
|
+
props:u,update:e,not_equal:c,bound:r(),
|
70
70
|
// lifecycle
|
71
|
-
on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(
|
71
|
+
on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(d?d.$$.context:[])),
|
72
72
|
// everything else
|
73
|
-
callbacks:
|
73
|
+
callbacks:r(),dirty:p,skip_bound:!1,root:s.target||d.$$.root};h&&h(m.root);let y=!1;if(m.ctx=a?a(i,s.props||{},((e,t,...r)=>{const n=r.length?r[0]:t;return m.ctx&&c(m.ctx[e],m.ctx[e]=n)&&(!m.skip_bound&&m.bound[e]&&m.bound[e](n),y&&z(i,e)),t})):[],m.update(),y=!0,n(m.before_update),
|
74
74
|
// `false` as a special case of no DOM component
|
75
|
-
|
75
|
+
m.fragment=!!l&&l(m.ctx),s.target){if(s.hydrate){const e=function(e){return Array.from(e.childNodes)}(s.target);
|
76
76
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
77
|
-
|
77
|
+
m.fragment&&m.fragment.l(e),e.forEach(f)}else
|
78
78
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
79
|
-
|
79
|
+
m.fragment&&m.fragment.c();s.intro&&((b=i.$$.fragment)&&b.i&&(j.delete(b),b.i(g))),function(e,r,i,s){const{fragment:a,after_update:l}=e.$$;a&&a.m(r,i),s||
|
80
80
|
// onMount happens before the initial afterUpdate
|
81
|
-
$((()=>{const
|
81
|
+
$((()=>{const r=e.$$.on_mount.map(t).filter(o);
|
82
82
|
// if the component was destroyed immediately
|
83
83
|
// it will update the `$$.on_destroy` reference to `null`.
|
84
84
|
// the destructured on_destroy may still reference to the old array
|
85
|
-
e.$$.on_destroy?e.$$.on_destroy.push(...
|
85
|
+
e.$$.on_destroy?e.$$.on_destroy.push(...r):
|
86
86
|
// Edge case - component was destroyed immediately,
|
87
87
|
// most likely as a result of a binding initialising
|
88
|
-
r
|
88
|
+
n(r),e.$$.on_mount=[]})),l.forEach($)}(i,s.target,s.anchor,s.customElement),F()}var b,g;H(d)}let W;"function"==typeof HTMLElement&&(W=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:e}=this.$$;this.$$.on_disconnect=e.map(t).filter(o);
|
89
89
|
// @ts-ignore todo: improve typings
|
90
90
|
for(const e in this.$$.slotted)
|
91
91
|
// @ts-ignore todo: improve typings
|
92
|
-
this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,
|
92
|
+
this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,r){this[e]=r}disconnectedCallback(){n(this.$$.on_disconnect)}$destroy(){V(this,1),this.$destroy=e}$on(t,r){
|
93
93
|
// TODO should this delegate to addEventListener?
|
94
|
-
if(!
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
94
|
+
if(!o(r))return e;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(r),()=>{const e=n.indexOf(r);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}})
|
95
|
+
/* eslint-disable no-prototype-builtins */;var K="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||
|
96
|
+
// eslint-disable-next-line no-undef
|
97
|
+
"undefined"!=typeof global&&global||{},q="URLSearchParams"in K,Z="Symbol"in K&&"iterator"in Symbol,Y="FileReader"in K&&"Blob"in K&&function(){try{return new Blob,!0}catch(e){return!1}}(),Q="FormData"in K,J="ArrayBuffer"in K;if(J)var ee=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],te=ArrayBuffer.isView||function(e){return e&&ee.indexOf(Object.prototype.toString.call(e))>-1};function re(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function ne(e){return"string"!=typeof e&&(e=String(e)),e}
|
98
|
+
// Build a destructive iterator for the value list
|
99
|
+
function oe(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return Z&&(t[Symbol.iterator]=function(){return t}),t}function ie(e){this.map={},e instanceof ie?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function se(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function ae(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function le(e){var t=new FileReader,r=ae(t);return t.readAsArrayBuffer(e),r}function ce(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function ue(){return this.bodyUsed=!1,this._initBody=function(e){var t;
|
100
|
+
/*
|
101
|
+
fetch-mock wraps the Response object in an ES6 Proxy to
|
102
|
+
provide useful test harness features such as flush. However, on
|
103
|
+
ES5 browsers without fetch or Proxy support pollyfills must be used;
|
104
|
+
the proxy-pollyfill is unable to proxy an attribute unless it exists
|
105
|
+
on the object before the Proxy is created. This change ensures
|
106
|
+
Response.bodyUsed exists on the instance, while maintaining the
|
107
|
+
semantic of setting Request.bodyUsed in the constructor before
|
108
|
+
_initBody is called.
|
109
|
+
*/
|
110
|
+
// eslint-disable-next-line no-self-assign
|
111
|
+
this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Y&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Q&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:q&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():J&&Y&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=ce(e.buffer),
|
112
|
+
// IE 10-11 can't handle a DataView body.
|
113
|
+
this._bodyInit=new Blob([this._bodyArrayBuffer])):J&&(ArrayBuffer.prototype.isPrototypeOf(e)||te(e))?this._bodyArrayBuffer=ce(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):q&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Y&&(this.blob=function(){var e=se(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=se(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(Y)return this.blob().then(le);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,n,o,i=se(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=ae(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),o=n?n[1]:"utf-8",t.readAsText(e,o),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Q&&(this.formData=function(){return this.text().then(fe)}),this.json=function(){return this.text().then(JSON.parse)},this}
|
114
|
+
// HTTP methods whose capitalization should be normalized
|
115
|
+
ie.prototype.append=function(e,t){e=re(e),t=ne(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},ie.prototype.delete=function(e){delete this.map[re(e)]},ie.prototype.get=function(e){return e=re(e),this.has(e)?this.map[e]:null},ie.prototype.has=function(e){return this.map.hasOwnProperty(re(e))},ie.prototype.set=function(e,t){this.map[re(e)]=ne(t)},ie.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},ie.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),oe(e)},ie.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),oe(e)},ie.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),oe(e)},Z&&(ie.prototype[Symbol.iterator]=ie.prototype.entries);var he=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function pe(e,t){if(!(this instanceof pe))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,n,o=(t=t||{}).body;if(e instanceof pe){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new ie(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new ie(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),he.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in K)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){
|
116
|
+
// Search for a '_' parameter in the query string
|
117
|
+
var i=/([?&])_=[^&]*/;if(i.test(this.url))
|
118
|
+
// If it already exists then set the value with the current time
|
119
|
+
this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function fe(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}})),t}function de(e,t){if(!(this instanceof de))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new ie(t.headers),this.url=t.url||"",this._initBody(e)}pe.prototype.clone=function(){return new pe(this,{body:this._bodyInit})},ue.call(pe.prototype),ue.call(de.prototype),de.prototype.clone=function(){return new de(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new ie(this.headers),url:this.url})},de.error=function(){var e=new de(null,{status:200,statusText:""});return e.status=0,e.type="error",e};var me=[301,302,303,307,308];de.redirect=function(e,t){if(-1===me.indexOf(t))throw new RangeError("Invalid status code");return new de(null,{status:t,headers:{location:e}})};var ye=K.DOMException;try{new ye}catch(e){(ye=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),ye.prototype.constructor=ye}function be(e,t){return new Promise((function(r,n){var o=new pe(e,t);if(o.signal&&o.signal.aborted)return n(new ye("Aborted","AbortError"));var i=new XMLHttpRequest;function s(){i.abort()}if(i.onload=function(){var e,t,n={statusText:i.statusText,headers:(e=i.getAllResponseHeaders()||"",t=new ie,
|
120
|
+
// Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill
|
121
|
+
// https://github.com/github/fetch/issues/748
|
122
|
+
// https://github.com/zloirock/core-js/issues/751
|
123
|
+
e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();try{t.append(n,o)}catch(e){console.warn("Response "+e.message)}}})),t)};
|
124
|
+
// This check if specifically for when a user fetches a file locally from the file system
|
125
|
+
// Only if the status is out of a normal range
|
126
|
+
o.url.startsWith("file://")&&(i.status<200||i.status>599)?n.status=200:n.status=i.status,n.url="responseURL"in i?i.responseURL:n.headers.get("X-Request-URL");var s="response"in i?i.response:i.responseText;setTimeout((function(){r(new de(s,n))}),0)},i.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},i.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request timed out"))}),0)},i.onabort=function(){setTimeout((function(){n(new ye("Aborted","AbortError"))}),0)},i.open(o.method,function(e){try{return""===e&&K.location.href?K.location.href:e}catch(t){return e}}(o.url),!0),"include"===o.credentials?i.withCredentials=!0:"omit"===o.credentials&&(i.withCredentials=!1),"responseType"in i&&(Y?i.responseType="blob":J&&(i.responseType="arraybuffer")),t&&"object"==typeof t.headers&&!(t.headers instanceof ie||K.Headers&&t.headers instanceof K.Headers)){var a=[];Object.getOwnPropertyNames(t.headers).forEach((function(e){a.push(re(e)),i.setRequestHeader(e,ne(t.headers[e]))})),o.headers.forEach((function(e,t){-1===a.indexOf(t)&&i.setRequestHeader(t,e)}))}else o.headers.forEach((function(e,t){i.setRequestHeader(t,e)}));o.signal&&(o.signal.addEventListener("abort",s),i.onreadystatechange=function(){
|
127
|
+
// DONE (success or failure)
|
128
|
+
4===i.readyState&&o.signal.removeEventListener("abort",s)}),i.send(void 0===o._bodyInit?null:o._bodyInit)}))}be.polyfill=!0,K.fetch||(K.fetch=be,K.Headers=ie,K.Request=pe,K.Response=de),
|
129
|
+
// the whatwg-fetch polyfill installs the fetch() function
|
130
|
+
// on the global object (window or self)
|
131
|
+
// Return that as the export for use in Webpack, Browserify etc.
|
132
|
+
self.fetch.bind(self);
|
133
|
+
/******************************************************************************
|
134
|
+
Copyright (c) Microsoft Corporation.
|
135
|
+
|
136
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
137
|
+
purpose with or without fee is hereby granted.
|
138
|
+
|
139
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
140
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
141
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
142
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
143
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
144
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
145
|
+
PERFORMANCE OF THIS SOFTWARE.
|
146
|
+
***************************************************************************** */
|
147
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
148
|
+
var ge=function(e,t){return ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},ge(e,t)};function ve(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ge(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function Ee(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function we(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function Te(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function _e(e){return"function"==typeof e}function Ce(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}"function"==typeof SuppressedError&&SuppressedError;var Be=Ce((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function xe(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ae=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,r,n,o;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var s=Ee(i),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else i.remove(this);var l=this.initialTeardown;if(_e(l))try{l()}catch(e){o=e instanceof Be?e.errors:[e]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var u=Ee(c),h=u.next();!h.done;h=u.next()){var p=h.value;try{Se(p)}catch(e){o=null!=o?o:[],e instanceof Be?o=Te(Te([],we(o)),we(e.errors)):o.push(e)}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}}if(o)throw new Be(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Se(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&xe(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&xe(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),Le=Ae.EMPTY;function He(e){return e instanceof Ae||e&&"closed"in e&&_e(e.remove)&&_e(e.add)&&_e(e.unsubscribe)}function Se(e){_e(e)?e():e.unsubscribe()}var Pe={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Me={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Me.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,Te([e,t],we(r))):setTimeout.apply(void 0,Te([e,t],we(r)))},clearTimeout:function(e){var t=Me.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Oe(){}var Re=null;function Ne(e){if(Pe.useDeprecatedSynchronousErrorHandling){var t=!Re;if(t&&(Re={errorThrown:!1,error:null}),e(),t){var r=Re,n=r.errorThrown,o=r.error;if(Re=null,n)throw o}}else e()}var ke=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,He(t)&&t.add(r)):r.destination=Ge,r}return ve(t,e),t.create=function(e,t,r){return new Ue(e,t,r)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Ae),Ie=Function.prototype.bind;function $e(e,t){return Ie.call(e,t)}var De=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Fe(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Fe(e)}else Fe(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Fe(e)}},e}(),Ue=function(e){function t(t,r,n){var o,i,s=e.call(this)||this;_e(t)||!t?o={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&Pe.useDeprecatedNextContext?((i=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},o={next:t.next&&$e(t.next,i),error:t.error&&$e(t.error,i),complete:t.complete&&$e(t.complete,i)}):o=t;return s.destination=new De(o),s}return ve(t,e),t}(ke);function Fe(e){var t;t=e,Me.setTimeout((function(){throw t}))}var Ge={closed:!0,next:Oe,error:function(e){throw e},complete:Oe},je="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ve(e){return e}var ze=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n,o=this,i=(n=e)&&n instanceof ke||function(e){return e&&_e(e.next)&&_e(e.error)&&_e(e.complete)}(n)&&He(n)?e:new Ue(e,t,r);return Ne((function(){var e=o,t=e.operator,r=e.source;i.add(t?t.call(i,r):r?o._subscribe(i):o._trySubscribe(i))})),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=Xe(t))((function(t,n){var o=new Ue({next:function(t){try{e(t)}catch(e){n(e),o.unsubscribe()}},error:n,complete:t});r.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[je]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(0===(e=t).length?Ve:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Xe(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function Xe(e){var t;return null!==(t=null!=e?e:Pe.Promise)&&void 0!==t?t:Promise}var We=Ce((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Ke=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return ve(t,e),t.prototype.lift=function(e){var t=new qe(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new We},t.prototype.next=function(e){var t=this;Ne((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var o=Ee(t.currentObservers),i=o.next();!i.done;i=o.next()){i.value.next(e)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;Ne((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;Ne((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,o=r.isStopped,i=r.observers;return n||o?Le:(this.currentObservers=null,i.push(e),new Ae((function(){t.currentObservers=null,xe(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,o=t.isStopped;r?e.error(n):o&&e.complete()},t.prototype.asObservable=function(){var e=new ze;return e.source=this,e},t.create=function(e,t){return new qe(e,t)},t}(ze),qe=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return ve(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:Le},t}(Ke),Ze={now:function(){return(Ze.delegate||Date).now()},delegate:void 0},Ye=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=Ze);var o=e.call(this)||this;return o._bufferSize=t,o._windowTime=r,o._timestampProvider=n,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,t),o._windowTime=Math.max(1,r),o}return ve(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,o=r._buffer,i=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(o.push(t),!i&&o.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),o=0;o<n.length&&!e.closed;o+=r?1:2)e.next(n[o]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,o=e._infiniteTimeWindow,i=(o?1:2)*t;if(t<1/0&&i<n.length&&n.splice(0,n.length-i),!o){for(var s=r.now(),a=0,l=1;l<n.length&&n[l]<=s;l+=2)a=l;a&&n.splice(0,a+1)}},t}(Ke);let Qe=[],Je={};
|
149
|
+
/**
|
150
|
+
* @name topic
|
151
|
+
* @description A small wrapper over the rxjs to offer the topic method on top of it
|
152
|
+
* @param event [String] Event name
|
153
|
+
* @param step [String] How many values to be buffed for new subscribers - default 0
|
154
|
+
* @returns ReplaySubject
|
99
155
|
*/
|
156
|
+
const et=[];
|
100
157
|
/**
|
101
158
|
* Create a `Writable` store that allows both updating and reading by subscription.
|
102
159
|
* @param {*=}value initial value
|
103
160
|
* @param {StartStopNotifier=} start
|
104
161
|
*/
|
105
|
-
function
|
106
|
-
const e=!
|
162
|
+
function tt(t,r=e){let n;const o=new Set;function s(e){if(i(t,e)&&(t=e,n)){// store is ready
|
163
|
+
const e=!et.length;for(const e of o)e[1](),et.push(e,t);if(e){for(let e=0;e<et.length;e+=2)et[e][0](et[e+1]);et.length=0}}}return{set:s,update:function(e){s(e(t))},subscribe:function(i,a=e){const l=[i,a];return o.add(l),1===o.size&&(n=r(s)||e),i(t),()=>{o.delete(l),0===o.size&&n&&(n(),n=null)}}}}function rt(t,r,i){const s=!Array.isArray(t),a=s?[t]:t,c=r.length<2;return u=t=>{let i=!1;const u=[];let h=0,p=e;const f=()=>{if(h)return;p();const n=r(s?u[0]:u,t);c?t(n):p=o(n)?n:e},d=a.map(((e,t)=>l(e,(e=>{u[t]=e,h&=~(1<<t),i&&f()}),(()=>{h|=1<<t}))));return i=!0,f(),function(){n(d),p(),
|
107
164
|
// We need to set this to false because callbacks can still happen despite having unsubscribed:
|
108
165
|
// Callbacks might already be placed in the queue which doesn't know it should no longer
|
109
166
|
// invoke this derived store.
|
110
|
-
|
167
|
+
i=!1}},{subscribe:tt(i,u).subscribe};
|
168
|
+
/**
|
169
|
+
* Creates a `Readable` store that allows reading by subscription.
|
170
|
+
* @param value initial value
|
171
|
+
* @param {StartStopNotifier} [start]
|
172
|
+
*/
|
173
|
+
var u}var nt=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===ot}(e)}
|
111
174
|
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
|
112
|
-
(e)};var
|
175
|
+
(e)};var ot="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function it(e,t){return!1!==t.clone&&t.isMergeableObject(e)?ut((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function st(e,t,r){return e.concat(t).map((function(e){return it(e,r)}))}function at(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function lt(e,t){try{return t in e}catch(e){return!1}}
|
113
176
|
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
114
|
-
function
|
115
|
-
})(e,
|
177
|
+
function ct(e,t,r){var n={};return r.isMergeableObject(e)&&at(e).forEach((function(t){n[t]=it(e[t],r)})),at(t).forEach((function(o){(function(e,t){return lt(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t));// and also unsafe if they're nonenumerable.
|
178
|
+
})(e,o)||(lt(e,o)&&r.isMergeableObject(t[o])?n[o]=function(e,t){if(!t.customMerge)return ut;var r=t.customMerge(e);return"function"==typeof r?r:ut}(o,r)(e[o],t[o],r):n[o]=it(t[o],r))})),n}function ut(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||st,r.isMergeableObject=r.isMergeableObject||nt,
|
116
179
|
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
|
117
180
|
// implementations can use it. The caller may not replace it.
|
118
|
-
|
181
|
+
r.cloneUnlessOtherwiseSpecified=it;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):ct(e,t,r):it(t,r)}ut.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return ut(e,r,t)}),{})};var ht=ut,pt=function(e,t){return pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},pt(e,t)};function ft(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}pt(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var dt,mt,yt,bt=function(){return bt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},bt.apply(this,arguments)};function gt(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}
|
119
182
|
/**
|
120
183
|
* Type Guards
|
121
184
|
*/
|
122
|
-
function
|
185
|
+
function vt(e){return e.type===mt.literal}function Et(e){return e.type===mt.argument}function wt(e){return e.type===mt.number}function Tt(e){return e.type===mt.date}function _t(e){return e.type===mt.time}function Ct(e){return e.type===mt.select}function Bt(e){return e.type===mt.plural}function xt(e){return e.type===mt.pound}function At(e){return e.type===mt.tag}function Lt(e){return!(!e||"object"!=typeof e||e.type!==yt.number)}function Ht(e){return!(!e||"object"!=typeof e||e.type!==yt.dateTime)}
|
123
186
|
// @generated from regex-gen.ts
|
124
187
|
"function"==typeof SuppressedError&&SuppressedError,function(e){
|
125
188
|
/** Argument is unclosed (e.g. `{0`) */
|
@@ -181,7 +244,7 @@ e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",
|
|
181
244
|
/** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */
|
182
245
|
e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",
|
183
246
|
/** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */
|
184
|
-
e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(
|
247
|
+
e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(dt||(dt={})),function(e){
|
185
248
|
/**
|
186
249
|
* Raw text
|
187
250
|
*/
|
@@ -218,7 +281,7 @@ e[e.pound=7]="pound",
|
|
218
281
|
/**
|
219
282
|
* XML-like tag
|
220
283
|
*/
|
221
|
-
e[e.tag=8]="tag"}(
|
284
|
+
e[e.tag=8]="tag"}(mt||(mt={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(yt||(yt={}));var St=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Pt=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
222
285
|
/**
|
223
286
|
* https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
224
287
|
* Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js
|
@@ -230,33 +293,33 @@ e[e.tag=8]="tag"}(ce||(ce={})),function(e){e[e.number=0]="number",e[e.dateTime=1
|
|
230
293
|
* @public
|
231
294
|
* @param skeleton skeleton string
|
232
295
|
*/
|
233
|
-
function
|
296
|
+
function Mt(e){var t={};return e.replace(Pt,(function(e){var r=e.length;switch(e[0]){
|
234
297
|
// Era
|
235
|
-
case"G":t.era=4===
|
298
|
+
case"G":t.era=4===r?"long":5===r?"narrow":"short";break;
|
236
299
|
// Year
|
237
|
-
case"y":t.year=2===
|
300
|
+
case"y":t.year=2===r?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
|
238
301
|
// Quarter
|
239
302
|
case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
240
303
|
// Month
|
241
|
-
case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][
|
304
|
+
case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;
|
242
305
|
// Week
|
243
|
-
case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][
|
306
|
+
case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
244
307
|
// Weekday
|
245
|
-
case"E":t.weekday=4===
|
308
|
+
case"E":t.weekday=4===r?"short":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;
|
246
309
|
// Period
|
247
310
|
case"a":// AM, PM
|
248
311
|
t.hour12=!0;break;case"b":// am, pm, noon, midnight
|
249
312
|
case"B":// flexible day periods
|
250
313
|
throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
251
314
|
// Hour
|
252
|
-
case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][
|
315
|
+
case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
|
253
316
|
// Minute
|
254
|
-
case"m":t.minute=["numeric","2-digit"][
|
317
|
+
case"m":t.minute=["numeric","2-digit"][r-1];break;
|
255
318
|
// Second
|
256
|
-
case"s":t.second=["numeric","2-digit"][
|
319
|
+
case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
257
320
|
// Zone
|
258
321
|
case"z":// 1..3, 4: specific non-location format
|
259
|
-
t.timeZoneName=
|
322
|
+
t.timeZoneName=r<4?"short":"long";break;case"Z":// 1..3, 4, 5: The ISO8601 varios formats
|
260
323
|
case"O":// 1, 4: miliseconds in day short, long
|
261
324
|
case"v":// 1, 4: generic non-location format
|
262
325
|
case"V":// 1, 2, 3, 4: time zone ID or city
|
@@ -264,33 +327,33 @@ case"X":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
264
327
|
case"x":// 1, 2, 3, 4: The ISO8601 varios formats
|
265
328
|
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}
|
266
329
|
// @generated from regex-gen.ts
|
267
|
-
var
|
330
|
+
var Ot=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var Rt=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Nt=/^(@+)?(\+|#+)?[rs]?$/g,kt=/(\*)(0+)|(#+)(0+)|(0+)/g,It=/^(0+)$/;function $t(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(Nt,(function(e,r,n){
|
268
331
|
// @@@ case
|
269
|
-
return"string"!=typeof
|
332
|
+
return"string"!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===n?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""})),t}function Dt(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function Ut(e){
|
270
333
|
// Engineering
|
271
|
-
var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var
|
334
|
+
var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var r=e.slice(0,2);if("+!"===r?(t.signDisplay="always",e=e.slice(2)):"+?"===r&&(t.signDisplay="exceptZero",e=e.slice(2)),!It.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function Ft(e){var t=Dt(e);return t||{}}
|
272
335
|
/**
|
273
336
|
* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options
|
274
|
-
*/function
|
337
|
+
*/function Gt(e){for(var t={},r=0,n=e;r<n.length;r++){var o=n[r];switch(o.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=o.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=o.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=bt(bt(bt({},t),{notation:"scientific"}),o.options.reduce((function(e,t){return bt(bt({},e),Ft(t))}),{}));continue;case"engineering":t=bt(bt(bt({},t),{notation:"engineering"}),o.options.reduce((function(e,t){return bt(bt({},e),Ft(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;
|
275
338
|
// https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
|
276
|
-
case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(
|
339
|
+
case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(o.options[0]);continue;
|
277
340
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
278
|
-
case"integer-width":if(
|
341
|
+
case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(kt,(function(e,r,n,o,i,s){if(r)t.minimumIntegerDigits=n.length;else{if(o&&i)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""}));continue}
|
279
342
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
280
|
-
if(
|
343
|
+
if(It.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(Rt.test(o.stem)){
|
281
344
|
// Precision
|
282
345
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision
|
283
346
|
// precision-integer case
|
284
|
-
if(
|
347
|
+
if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(Rt,(function(e,r,n,o,i,s){
|
285
348
|
// .000* case (before ICU67 it was .000+)
|
286
|
-
return"*"===
|
349
|
+
return"*"===n?t.minimumFractionDigits=r.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:i&&s?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+s.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""}));var i=o.options[0];
|
287
350
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
|
288
|
-
"w"===
|
351
|
+
"w"===i?t=bt(bt({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=bt(bt({},t),$t(i)))}
|
289
352
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision
|
290
|
-
else if(
|
353
|
+
else if(Nt.test(o.stem))t=bt(bt({},t),$t(o.stem));else{var s=Dt(o.stem);s&&(t=bt(bt({},t),s));var a=Ut(o.stem);a&&(t=bt(bt({},t),a))}}return t}
|
291
354
|
// @generated from time-data-gen.ts
|
292
355
|
// prettier-ignore
|
293
|
-
var
|
356
|
+
var jt,Vt={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};
|
294
357
|
/**
|
295
358
|
* Returns the best matching date time pattern if a date time skeleton
|
296
359
|
* pattern is provided with a locale. Follows the Unicode specification:
|
@@ -303,7 +366,7 @@ var Ie,$e={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H
|
|
303
366
|
* of the given `locale` to the corresponding time pattern.
|
304
367
|
* @param locale
|
305
368
|
*/
|
306
|
-
function
|
369
|
+
function zt(e){var t=e.hourCycle;if(void 0===t&&
|
307
370
|
// @ts-ignore hourCycle(s) is not identified yet
|
308
371
|
e.hourCycles&&
|
309
372
|
// @ts-ignore
|
@@ -311,37 +374,37 @@ e.hourCycles.length&&(
|
|
311
374
|
// @ts-ignore
|
312
375
|
t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}
|
313
376
|
// TODO: Once hourCycle is fully supported remove the following with data generation
|
314
|
-
var n
|
377
|
+
var r,n=e.language;return"root"!==n&&(r=e.maximize().region),(Vt[r||""]||Vt[n||""]||Vt["".concat(n,"-001")]||Vt["001"])[0]}var Xt=new RegExp("^".concat(St.source,"*")),Wt=new RegExp("".concat(St.source,"*$"));function Kt(e,t){return{start:e,end:t}}
|
315
378
|
// #region Ponyfills
|
316
379
|
// Consolidate these variables up top for easier toggling during debugging
|
317
|
-
var
|
380
|
+
var qt=!!String.prototype.startsWith,Zt=!!String.fromCodePoint,Yt=!!Object.fromEntries,Qt=!!String.prototype.codePointAt,Jt=!!String.prototype.trimStart,er=!!String.prototype.trimEnd,tr=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},rr=!0;try{
|
318
381
|
/**
|
319
382
|
* legacy Edge or Xbox One browser
|
320
383
|
* Unicode flag support: supported
|
321
384
|
* Pattern_Syntax support: not supported
|
322
385
|
* See https://github.com/formatjs/formatjs/issues/2822
|
323
386
|
*/
|
324
|
-
|
325
|
-
function(e,t,
|
326
|
-
function(e,t,
|
327
|
-
function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n
|
387
|
+
rr="a"===(null===(jt=ur("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===jt?void 0:jt[0])}catch(e){rr=!1}var nr,or=qt?// Native
|
388
|
+
function(e,t,r){return e.startsWith(t,r)}:// For IE11
|
389
|
+
function(e,t,r){return e.slice(r,r+t.length)===t},ir=Zt?String.fromCodePoint:// IE11
|
390
|
+
function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r,n="",o=e.length,i=0;o>i;){if((r=e[i++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},sr=
|
328
391
|
// native
|
329
|
-
|
330
|
-
function(e){for(var t={},
|
392
|
+
Yt?Object.fromEntries:// Ponyfill
|
393
|
+
function(e){for(var t={},r=0,n=e;r<n.length;r++){var o=n[r],i=o[0],s=o[1];t[i]=s}return t},ar=Qt?// Native
|
331
394
|
function(e,t){return e.codePointAt(t)}:// IE 11
|
332
|
-
function(e,t){var
|
395
|
+
function(e,t){var r=e.length;if(!(t<0||t>=r)){var n,o=e.charCodeAt(t);return o<55296||o>56319||t+1===r||(n=e.charCodeAt(t+1))<56320||n>57343?o:n-56320+(o-55296<<10)+65536}},lr=Jt?// Native
|
333
396
|
function(e){return e.trimStart()}:// Ponyfill
|
334
|
-
function(e){return e.replace(
|
397
|
+
function(e){return e.replace(Xt,"")},cr=er?// Native
|
335
398
|
function(e){return e.trimEnd()}:// Ponyfill
|
336
|
-
function(e){return e.replace(
|
399
|
+
function(e){return e.replace(Wt,"")};
|
337
400
|
// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.
|
338
|
-
function
|
401
|
+
function ur(e,t){return new RegExp(e,t)}
|
339
402
|
// #endregion
|
340
|
-
if(
|
403
|
+
if(rr){
|
341
404
|
// Native
|
342
|
-
var
|
405
|
+
var hr=ur("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");nr=function(e,t){var r;return hr.lastIndex=t,null!==(r=hr.exec(e)[1])&&void 0!==r?r:""}}else
|
343
406
|
// IE11
|
344
|
-
|
407
|
+
nr=function(e,t){for(var r=[];;){var n=ar(e,t);if(void 0===n||dr(n)||mr(n))break;r.push(n),t+=n>=65536?2:1}return ir.apply(void 0,r)};var pr=/** @class */function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,r){for(var n=[];!this.isEOF();){var o=this.char();if(123/* `{` */===o){if((i=this.parseArgument(e,r)).err)return i;n.push(i.val)}else{if(125/* `}` */===o&&e>0)break;if(35/* `#` */!==o||"plural"!==t&&"selectordinal"!==t){if(60/* `<` */===o&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(dt.UNMATCHED_CLOSING_TAG,Kt(this.clonePosition(),this.clonePosition()))}if(60/* `<` */===o&&!this.ignoreTag&&fr(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;n.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;n.push(i.val)}}else{var s=this.clonePosition();this.bump(),n.push({type:mt.pound,location:Kt(s,this.clonePosition())})}}}return{val:n,err:null}},
|
345
408
|
/**
|
346
409
|
* A tag name must start with an ASCII lower/upper case letter. The grammar is based on the
|
347
410
|
* [custom element name][] except that a dash is NOT always mandatory and uppercase letters
|
@@ -360,17 +423,17 @@ qe=function(e,t){for(var n=[];;){var r=tt(e,t);if(void 0===r||lt(r)||ct(r))break
|
|
360
423
|
* NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do
|
361
424
|
* since other tag-based engines like React allow it
|
362
425
|
*/
|
363
|
-
e.prototype.parseTag=function(e,t){var
|
364
|
-
var
|
426
|
+
e.prototype.parseTag=function(e,t){var r=this.clonePosition();this.bump();// `<`
|
427
|
+
var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))
|
365
428
|
// Self closing tag
|
366
|
-
return{val:{type:
|
429
|
+
return{val:{type:mt.literal,value:"<".concat(n,"/>"),location:Kt(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var i=o.val,s=this.clonePosition();
|
367
430
|
// Expecting a close tag
|
368
|
-
if(this.bumpIf("</")){if(this.isEOF()||!
|
431
|
+
if(this.bumpIf("</")){if(this.isEOF()||!fr(this.char()))return this.error(dt.INVALID_TAG,Kt(s,this.clonePosition()));var a=this.clonePosition();return n!==this.parseTagName()?this.error(dt.UNMATCHED_CLOSING_TAG,Kt(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:mt.tag,value:n,children:i,location:Kt(r,this.clonePosition())},err:null}:this.error(dt.INVALID_TAG,Kt(s,this.clonePosition())))}return this.error(dt.UNCLOSED_TAG,Kt(r,this.clonePosition()))}return this.error(dt.INVALID_TAG,Kt(r,this.clonePosition()))},
|
369
432
|
/**
|
370
433
|
* This method assumes that the caller has peeked ahead for the first tag character.
|
371
434
|
*/
|
372
435
|
e.prototype.parseTagName=function(){var e,t=this.offset();// the first tag name character
|
373
|
-
for(this.bump();!this.isEOF()&&(45/* '-' */===(e=this.char())||46/* '.' */===e||e>=48&&e<=57/* 0..9 */||95/* '_' */===e||e>=97&&e<=122/** a..z */||e>=65&&e<=90/* A..Z */||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var
|
436
|
+
for(this.bump();!this.isEOF()&&(45/* '-' */===(e=this.char())||46/* '.' */===e||e>=48&&e<=57/* 0..9 */||95/* '_' */===e||e>=97&&e<=122/** a..z */||e>=65&&e<=90/* A..Z */||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var r=this.clonePosition(),n="";;){var o=this.tryParseQuote(t);if(o)n+=o;else{var i=this.tryParseUnquoted(e,t);if(i)n+=i;else{var s=this.tryParseLeftAngleBracket();if(!s)break;n+=s}}}var a=Kt(r,this.clonePosition());return{val:{type:mt.literal,value:n,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60/* `<` */!==this.char()||!this.ignoreTag&&(fr(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e;
|
374
437
|
/** See `parseTag` function docs. */},
|
375
438
|
/**
|
376
439
|
* Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes
|
@@ -388,71 +451,71 @@ case 123:case 60:case 62:case 125:break;case 35:// '#'
|
|
388
451
|
if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();// apostrophe
|
389
452
|
var t=[this.char()];// escaped char
|
390
453
|
// read chars until the optional closing apostrophe is found
|
391
|
-
for(this.bump();!this.isEOF();){var
|
454
|
+
for(this.bump();!this.isEOF();){var r=this.char();if(39/* `'` */===r){if(39/* `'` */!==this.peek()){
|
392
455
|
// Optional closing apostrophe.
|
393
456
|
this.bump();break}t.push(39),
|
394
457
|
// Bump one more time because we need to skip 2 characters.
|
395
|
-
this.bump()}else t.push(
|
396
|
-
this.bumpSpace(),this.isEOF())return this.error(
|
458
|
+
this.bump()}else t.push(r);this.bump()}return ir.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var r=this.char();return 60/* `<` */===r||123/* `{` */===r||35/* `#` */===r&&("plural"===t||"selectordinal"===t)||125/* `}` */===r&&e>0?null:(this.bump(),ir(r))},e.prototype.parseArgument=function(e,t){var r=this.clonePosition();if(this.bump(),// `{`
|
459
|
+
this.bumpSpace(),this.isEOF())return this.error(dt.EXPECT_ARGUMENT_CLOSING_BRACE,Kt(r,this.clonePosition()));if(125/* `}` */===this.char())return this.bump(),this.error(dt.EMPTY_ARGUMENT,Kt(r,this.clonePosition()));
|
397
460
|
// argument name
|
398
|
-
var
|
461
|
+
var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(dt.MALFORMED_ARGUMENT,Kt(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(dt.EXPECT_ARGUMENT_CLOSING_BRACE,Kt(r,this.clonePosition()));switch(this.char()){
|
399
462
|
// Simple argument: `{name}`
|
400
463
|
case 125/* `}` */:// `}`
|
401
|
-
return this.bump(),{val:{type:
|
464
|
+
return this.bump(),{val:{type:mt.argument,
|
402
465
|
// value does not include the opening and closing braces.
|
403
|
-
value:
|
466
|
+
value:n,location:Kt(r,this.clonePosition())},err:null};
|
404
467
|
// Argument with options: `{name, format, ...}`
|
405
468
|
case 44/* `,` */:return this.bump(),// `,`
|
406
|
-
this.bumpSpace(),this.isEOF()?this.error(
|
469
|
+
this.bumpSpace(),this.isEOF()?this.error(dt.EXPECT_ARGUMENT_CLOSING_BRACE,Kt(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(dt.MALFORMED_ARGUMENT,Kt(r,this.clonePosition()))}},
|
407
470
|
/**
|
408
471
|
* Advance the parser until the end of the identifier, if it is currently on
|
409
472
|
* an identifier character. Return an empty string otherwise.
|
410
473
|
*/
|
411
|
-
e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),
|
474
|
+
e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),r=nr(this.message,t),n=t+r.length;return this.bumpTo(n),{value:r,location:Kt(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,r,n){var o,i=this.clonePosition(),s=this.parseIdentifierIfPossible().value,a=this.clonePosition();
|
412
475
|
// Parse this range:
|
413
476
|
// {name, type, style}
|
414
477
|
// ^---^
|
415
478
|
switch(s){case"":
|
416
479
|
// Expecting a style string number, date, time, plural, selectordinal, or select.
|
417
|
-
return this.error(
|
480
|
+
return this.error(dt.EXPECT_ARGUMENT_TYPE,Kt(i,a));case"number":case"date":case"time":
|
418
481
|
// Parse this range:
|
419
482
|
// {name, number, style}
|
420
483
|
// ^-------^
|
421
|
-
this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((b=this.parseSimpleArgStyleIfPossible()).err)return b;if(0===(
|
484
|
+
this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((b=this.parseSimpleArgStyleIfPossible()).err)return b;if(0===(f=cr(b.val)).length)return this.error(dt.EXPECT_ARGUMENT_STYLE,Kt(this.clonePosition(),this.clonePosition()));l={style:f,styleLocation:Kt(c,this.clonePosition())}}if((g=this.tryParseArgumentClose(n)).err)return g;var u=Kt(n,this.clonePosition());
|
422
485
|
// Extract style or skeleton
|
423
|
-
if(l&&
|
486
|
+
if(l&&or(null==l?void 0:l.style,"::",0)){
|
424
487
|
// Skeleton starts with `::`.
|
425
|
-
var h=
|
488
|
+
var h=lr(l.style.slice(2));if("number"===s)return(b=this.parseNumberSkeletonFromString(h,l.styleLocation)).err?b:{val:{type:mt.number,value:r,location:u,style:b.val},err:null};if(0===h.length)return this.error(dt.EXPECT_DATE_TIME_SKELETON,u);var p=h;
|
426
489
|
// Get "best match" pattern only if locale is passed, if not, let it
|
427
490
|
// pass as-is where `parseDateTimeSkeleton()` will throw an error
|
428
491
|
// for unsupported patterns.
|
429
|
-
this.locale&&(p=function(e,t){for(var
|
492
|
+
this.locale&&(p=function(e,t){for(var r="",n=0;n<e.length;n++){var o=e.charAt(n);if("j"===o){for(var i=0;n+1<e.length&&e.charAt(n+1)===o;)i++,n++;var s=1+(1&i),a=i<2?1:3+(i>>1),l=zt(t);for("H"!=l&&"k"!=l||(a=0);a-- >0;)r+="a";for(;s-- >0;)r=l+r}else r+="J"===o?"H":o}return r}(h,this.locale));var f={type:yt.dateTime,pattern:p,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?Mt(p):{}};return{val:{type:"date"===s?mt.date:mt.time,value:r,location:u,style:f},err:null}}
|
430
493
|
// Regular style or no style.
|
431
|
-
return{val:{type:"number"===s?
|
494
|
+
return{val:{type:"number"===s?mt.number:"date"===s?mt.date:mt.time,value:r,location:u,style:null!==(o=null==l?void 0:l.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":
|
432
495
|
// Parse this range:
|
433
496
|
// {name, plural, options}
|
434
497
|
// ^---------^
|
435
|
-
var
|
498
|
+
var d=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(dt.EXPECT_SELECT_ARGUMENT_OPTIONS,Kt(d,bt({},d)));this.bumpSpace();
|
436
499
|
// Parse offset:
|
437
500
|
// {name, plural, offset:1, options}
|
438
501
|
// ^-----^
|
439
502
|
// or the first option:
|
440
503
|
// {name, plural, one {...} other {...}}
|
441
504
|
// ^--^
|
442
|
-
var
|
505
|
+
var m=this.parseIdentifierIfPossible(),y=0;if("select"!==s&&"offset"===m.value){if(!this.bumpIf(":"))return this.error(dt.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Kt(this.clonePosition(),this.clonePosition()));var b;if(this.bumpSpace(),(b=this.tryParseDecimalInteger(dt.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,dt.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return b;
|
443
506
|
// Parse another identifier for option parsing
|
444
|
-
this.bumpSpace(),
|
507
|
+
this.bumpSpace(),m=this.parseIdentifierIfPossible(),y=b.val}var g,v=this.tryParsePluralOrSelectOptions(e,s,t,m);if(v.err)return v;if((g=this.tryParseArgumentClose(n)).err)return g;var E=Kt(n,this.clonePosition());return"select"===s?{val:{type:mt.select,value:r,options:sr(v.val),location:E},err:null}:{val:{type:mt.plural,value:r,options:sr(v.val),offset:y,pluralType:"plural"===s?"cardinal":"ordinal",location:E},err:null};default:return this.error(dt.INVALID_ARGUMENT_TYPE,Kt(i,a))}},e.prototype.tryParseArgumentClose=function(e){
|
445
508
|
// Parse: {value, number, ::currency/GBP }
|
446
|
-
return this.isEOF()||125/* `}` */!==this.char()?this.error(
|
509
|
+
return this.isEOF()||125/* `}` */!==this.char()?this.error(dt.EXPECT_ARGUMENT_CLOSING_BRACE,Kt(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},
|
447
510
|
/**
|
448
511
|
* See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659
|
449
512
|
*/
|
450
513
|
e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39/* `'` */:
|
451
514
|
// Treat apostrophe as quoting but include it in the style part.
|
452
515
|
// Find the end of the quoted literal text.
|
453
|
-
this.bump();var
|
516
|
+
this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(dt.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Kt(r,this.clonePosition()));this.bump();break;case 123/* `{` */:e+=1,this.bump();break;case 125/* `}` */:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var r=[];try{r=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");
|
454
517
|
// Parse the skeleton
|
455
|
-
for(var t=[],
|
518
|
+
for(var t=[],r=0,n=e.split(Ot).filter((function(e){return e.length>0}));r<n.length;r++){var o=n[r].split("/");if(0===o.length)throw new Error("Invalid number skeleton");for(var i=o[0],s=o.slice(1),a=0,l=s;a<l.length;a++)if(0===l[a].length)throw new Error("Invalid number skeleton");t.push({stem:i,options:s})}return t}(e)}catch(e){return this.error(dt.INVALID_NUMBER_SKELETON,t)}return{val:{type:yt.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?Gt(r):{}},err:null}},
|
456
519
|
/**
|
457
520
|
* @param nesting_level The current nesting level of messages.
|
458
521
|
* This can be positive when parsing message fragment in select or plural argument options.
|
@@ -463,30 +526,30 @@ for(var t=[],n=0,r=e.split(xe).filter((function(e){return e.length>0}));n<r.leng
|
|
463
526
|
* between a pair of opening and closing tags. The nested message will not parse beyond
|
464
527
|
* the closing tag boundary.
|
465
528
|
*/
|
466
|
-
e.prototype.tryParsePluralOrSelectOptions=function(e,t,n
|
529
|
+
e.prototype.tryParsePluralOrSelectOptions=function(e,t,r,n){
|
467
530
|
// Parse:
|
468
531
|
// one {one apple}
|
469
532
|
// ^--^
|
470
|
-
for(var i
|
533
|
+
for(var o,i=!1,s=[],a=new Set,l=n.value,c=n.location;;){if(0===l.length){var u=this.clonePosition();if("select"===t||!this.bumpIf("="))break;
|
471
534
|
// Try parse `={number}` selector
|
472
|
-
var h=this.tryParseDecimalInteger(
|
535
|
+
var h=this.tryParseDecimalInteger(dt.EXPECT_PLURAL_ARGUMENT_SELECTOR,dt.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;c=Kt(u,this.clonePosition()),l=this.message.slice(u.offset,this.offset())}
|
473
536
|
// Duplicate selector clauses
|
474
|
-
if(a.has(l))return this.error("select"===t?
|
537
|
+
if(a.has(l))return this.error("select"===t?dt.DUPLICATE_SELECT_ARGUMENT_SELECTOR:dt.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===l&&(i=!0),
|
475
538
|
// Parse:
|
476
539
|
// one {one apple}
|
477
540
|
// ^----------^
|
478
|
-
this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?
|
541
|
+
this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?dt.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:dt.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Kt(this.clonePosition(),this.clonePosition()));var f=this.parseMessage(e+1,t,r);if(f.err)return f;var d=this.tryParseArgumentClose(p);if(d.err)return d;s.push([l,{value:f.val,location:Kt(p,this.clonePosition())}]),
|
479
542
|
// Keep track of the existing selectors
|
480
543
|
a.add(l),
|
481
544
|
// Prep next selector clause.
|
482
|
-
this.bumpSpace(),l=(
|
545
|
+
this.bumpSpace(),l=(o=this.parseIdentifierIfPossible()).value,c=o.location}return 0===s.length?this.error("select"===t?dt.EXPECT_SELECT_ARGUMENT_SELECTOR:dt.EXPECT_PLURAL_ARGUMENT_SELECTOR,Kt(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(dt.MISSING_OTHER_CLAUSE,Kt(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var r=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var o=!1,i=0;!this.isEOF();){var s=this.char();if(!(s>=48/* `0` */&&s<=57/* `9` */))break;o=!0,i=10*i+(s-48),this.bump()}var a=Kt(n,this.clonePosition());return o?tr(i*=r)?{val:i,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){
|
483
546
|
// This is much faster than `Object.assign` or spread.
|
484
547
|
return{offset:this.position.offset,line:this.position.line,column:this.position.column}},
|
485
548
|
/**
|
486
549
|
* Return the code point at the current position of the parser.
|
487
550
|
* Throws if the index is out of bound.
|
488
551
|
*/
|
489
|
-
e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=
|
552
|
+
e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=ar(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},
|
490
553
|
/** Bump the parser to the next UTF-16 code unit. */
|
491
554
|
e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10/* '\n' */===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,
|
492
555
|
// 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.
|
@@ -497,176 +560,180 @@ this.position.offset+=e<65536?1:2)}},
|
|
497
560
|
* following the prefix and return true. Otherwise, don't bump the parser
|
498
561
|
* and return false.
|
499
562
|
*/
|
500
|
-
e.prototype.bumpIf=function(e){if(
|
563
|
+
e.prototype.bumpIf=function(e){if(or(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},
|
501
564
|
/**
|
502
565
|
* Bump the parser until the pattern character is found and return `true`.
|
503
566
|
* Otherwise bump to the end of the file and return `false`.
|
504
567
|
*/
|
505
|
-
e.prototype.bumpUntil=function(e){var t=this.offset(),
|
568
|
+
e.prototype.bumpUntil=function(e){var t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},
|
506
569
|
/**
|
507
570
|
* Bump the parser to the target offset.
|
508
571
|
* If target offset is beyond the end of the input, bump the parser to the end of the input.
|
509
572
|
*/
|
510
573
|
e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},
|
511
574
|
/** advance the parser through all whitespace to the next non-whitespace code unit. */
|
512
|
-
e.prototype.bumpSpace=function(){for(;!this.isEOF()&&
|
575
|
+
e.prototype.bumpSpace=function(){for(;!this.isEOF()&&dr(this.char());)this.bump()},
|
513
576
|
/**
|
514
577
|
* Peek at the *next* Unicode codepoint in the input without advancing the parser.
|
515
578
|
* If the input has been exhausted, then this returns null.
|
516
579
|
*/
|
517
|
-
e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),
|
580
|
+
e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),r=this.message.charCodeAt(t+(e>=65536?2:1));return null!=r?r:null},e}();
|
518
581
|
/**
|
519
582
|
* This check if codepoint is alphabet (lower & uppercase)
|
520
583
|
* @param codepoint
|
521
584
|
* @returns
|
522
|
-
*/function
|
585
|
+
*/function fr(e){return e>=97&&e<=122||e>=65&&e<=90}
|
523
586
|
/**
|
524
587
|
* Code point equivalent of regex `\p{White_Space}`.
|
525
588
|
* From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
526
589
|
*/
|
527
|
-
function
|
590
|
+
function dr(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}
|
528
591
|
/**
|
529
592
|
* Code point equivalent of regex `\p{Pattern_Syntax}`.
|
530
593
|
* See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
531
|
-
*/function
|
594
|
+
*/function mr(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function yr(e){e.forEach((function(e){if(delete e.location,Ct(e)||Bt(e))for(var t in e.options)delete e.options[t].location,yr(e.options[t].value);else wt(e)&&Lt(e.style)||(Tt(e)||_t(e))&&Ht(e.style)?delete e.style.location:At(e)&&yr(e.children)}))}function br(e,t){void 0===t&&(t={}),t=bt({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new pr(e,t).parse();if(r.err){var n=SyntaxError(dt[r.err.kind]);
|
532
595
|
// @ts-expect-error Assign to error object
|
533
|
-
throw
|
596
|
+
throw n.location=r.err.location,
|
534
597
|
// @ts-expect-error Assign to error object
|
535
|
-
|
598
|
+
n.originalMessage=r.err.message,n}return(null==t?void 0:t.captureLocation)||yr(r.val),r.val}
|
536
599
|
|
537
600
|
// Main
|
538
601
|
|
539
|
-
function
|
602
|
+
function gr(e,t){var r=t&&t.cache?t.cache:xr,n=t&&t.serializer?t.serializer:_r;return(t&&t.strategy?t.strategy:Tr)(e,{cache:r,serializer:n})}
|
540
603
|
|
541
604
|
// Strategy
|
542
605
|
|
543
|
-
function
|
606
|
+
function vr(e,t,r,n){var o,i=null==(o=n)||"number"==typeof o||"boolean"==typeof o?n:r(n),s=t.get(i);return void 0===s&&(s=e.call(this,n),t.set(i,s)),s}function Er(e,t,r){var n=Array.prototype.slice.call(arguments,3),o=r(n),i=t.get(o);return void 0===i&&(i=e.apply(this,n),t.set(o,i)),i}function wr(e,t,r,n,o){return r.bind(t,e,n,o)}function Tr(e,t){return wr(e,this,1===e.length?vr:Er,t.cache.create(),t.serializer)}
|
544
607
|
// Serializer
|
545
|
-
var
|
608
|
+
var _r=function(){return JSON.stringify(arguments)};
|
546
609
|
|
547
610
|
// Cache
|
548
611
|
|
549
|
-
function
|
612
|
+
function Cr(){this.cache=Object.create(null)}Cr.prototype.get=function(e){return this.cache[e]},Cr.prototype.set=function(e,t){this.cache[e]=t};var Br,xr={create:function(){
|
550
613
|
// @ts-ignore
|
551
|
-
return new
|
614
|
+
return new Cr}},Ar={variadic:function(e,t){return wr(e,this,Er,t.cache.create(),t.serializer)},monadic:function(e,t){return wr(e,this,vr,t.cache.create(),t.serializer)}};!function(e){
|
552
615
|
// When we have a placeholder but no value to format
|
553
616
|
e.MISSING_VALUE="MISSING_VALUE",
|
554
617
|
// When value supplied is invalid
|
555
618
|
e.INVALID_VALUE="INVALID_VALUE",
|
556
619
|
// When we need specific Intl API but it's not available
|
557
|
-
e.MISSING_INTL_API="MISSING_INTL_API"}(
|
620
|
+
e.MISSING_INTL_API="MISSING_INTL_API"}(Br||(Br={}));var Lr,Hr=/** @class */function(e){function t(t,r,n){var o=e.call(this,t)||this;return o.code=r,o.originalMessage=n,o}return ft(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),Sr=/** @class */function(e){function t(t,r,n,o){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(r,'". Options are "').concat(Object.keys(n).join('", "'),'"'),Br.INVALID_VALUE,o)||this}return ft(t,e),t}(Hr),Pr=/** @class */function(e){function t(t,r,n){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(r),Br.INVALID_VALUE,n)||this}return ft(t,e),t}(Hr),Mr=/** @class */function(e){function t(t,r){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(r,'"'),Br.MISSING_VALUE,r)||this}return ft(t,e),t}(Hr);function Or(e){return"function"==typeof e}
|
558
621
|
// TODO(skeleton): add skeleton support
|
559
|
-
function
|
622
|
+
function Rr(e,t,r,n,o,i,
|
560
623
|
// For debugging
|
561
624
|
s){
|
562
625
|
// Hot path for straight simple msg translations
|
563
|
-
if(1===e.length&&
|
626
|
+
if(1===e.length&&vt(e[0]))return[{type:Lr.literal,value:e[0].value}];for(var a=[],l=0,c=e;l<c.length;l++){var u=c[l];
|
564
627
|
// Exit early for string parts.
|
565
|
-
if(
|
628
|
+
if(vt(u))a.push({type:Lr.literal,value:u.value});else
|
566
629
|
// TODO: should this part be literal type?
|
567
630
|
// Replace `#` in plural rules with the actual numeric value.
|
568
|
-
if(
|
631
|
+
if(xt(u))"number"==typeof i&&a.push({type:Lr.literal,value:r.getNumberFormat(t).format(i)});else{var h=u.value;
|
569
632
|
// Enforce that all required values are provided by the caller.
|
570
|
-
if(!
|
633
|
+
if(!o||!(h in o))throw new Mr(h,s);var p=o[h];if(Et(u))p&&"string"!=typeof p&&"number"!=typeof p||(p="string"==typeof p||"number"==typeof p?String(p):""),a.push({type:"string"==typeof p?Lr.literal:Lr.object,value:p});else
|
571
634
|
// Recursively format plural and select parts' option — which can be a
|
572
635
|
// nested pattern structure. The choosing of the option to use is
|
573
636
|
// abstracted-by and delegated-to the part helper object.
|
574
|
-
if(
|
637
|
+
if(Tt(u)){var f="string"==typeof u.style?n.date[u.style]:Ht(u.style)?u.style.parsedOptions:void 0;a.push({type:Lr.literal,value:r.getDateTimeFormat(t,f).format(p)})}else if(_t(u)){f="string"==typeof u.style?n.time[u.style]:Ht(u.style)?u.style.parsedOptions:n.time.medium;a.push({type:Lr.literal,value:r.getDateTimeFormat(t,f).format(p)})}else if(wt(u)){(f="string"==typeof u.style?n.number[u.style]:Lt(u.style)?u.style.parsedOptions:void 0)&&f.scale&&(p*=f.scale||1),a.push({type:Lr.literal,value:r.getNumberFormat(t,f).format(p)})}else{if(At(u)){var d=u.children,m=u.value,y=o[m];if(!Or(y))throw new Pr(m,"function",s);var b=y(Rr(d,t,r,n,o,i).map((function(e){return e.value})));Array.isArray(b)||(b=[b]),a.push.apply(a,b.map((function(e){return{type:"string"==typeof e?Lr.literal:Lr.object,value:e}})))}if(Ct(u)){if(!(g=u.options[p]||u.options.other))throw new Sr(u.value,p,Object.keys(u.options),s);a.push.apply(a,Rr(g.value,t,r,n,o))}else if(Bt(u)){var g;if(!(g=u.options["=".concat(p)])){if(!Intl.PluralRules)throw new Hr('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Br.MISSING_INTL_API,s);var v=r.getPluralRules(t,{type:u.pluralType}).select(p-(u.offset||0));g=u.options[v]||u.options.other}if(!g)throw new Sr(u.value,p,Object.keys(u.options),s);a.push.apply(a,Rr(g.value,t,r,n,o,p-(u.offset||0)))}else;}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var r=e[e.length-1];return r&&r.type===Lr.literal&&t.type===Lr.literal?r.value+=t.value:e.push(t),e}),[])}(a)}
|
575
638
|
/*
|
576
639
|
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
577
640
|
Copyrights licensed under the New BSD License.
|
578
641
|
See the accompanying LICENSE file for terms.
|
579
642
|
*/
|
580
643
|
// -- MessageFormat --------------------------------------------------------
|
581
|
-
function
|
644
|
+
function Nr(e,t){return t?Object.keys(e).reduce((function(r,n){var o,i;return r[n]=(o=e[n],(i=t[n])?bt(bt(bt({},o||{}),i||{}),Object.keys(o).reduce((function(e,t){return e[t]=bt(bt({},o[t]),i[t]||{}),e}),{})):o),r}),bt({},e)):e}function kr(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(Lr||(Lr={}));var Ir=/** @class */function(){function e(t,r,n,o){var i,s=this;if(void 0===r&&(r=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=s.formatToParts(e);
|
582
645
|
// Hot path for straight simple msg translations
|
583
|
-
if(1===t.length)return t[0].value;var
|
646
|
+
if(1===t.length)return t[0].value;var r=t.reduce((function(e,t){return e.length&&t.type===Lr.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return r.length<=1?r[0]||"":r},this.formatToParts=function(e){return Rr(s.ast,s.locales,s.formatters,s.formats,e,void 0,s.message)},this.resolvedOptions=function(){return{locale:s.resolvedLocale.toString()}},this.getAst=function(){return s.ast},
|
584
647
|
// Defined first because it's used to build the format pattern.
|
585
|
-
this.locales=
|
648
|
+
this.locales=r,this.resolvedLocale=e.resolveLocale(r),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
586
649
|
// Parse string messages into an AST.
|
587
|
-
this.ast=e.__parse(t,{ignoreTag:null==
|
650
|
+
this.ast=e.__parse(t,{ignoreTag:null==o?void 0:o.ignoreTag,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");
|
588
651
|
// Creates a new object with the specified `formats` merged with the default
|
589
652
|
// formats.
|
590
|
-
this.formats=
|
653
|
+
this.formats=Nr(e.formats,n),this.formatters=o&&o.formatters||(void 0===(i=this.formatterCache)&&(i={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:gr((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.NumberFormat).bind.apply(e,gt([void 0],t,!1)))}),{cache:kr(i.number),strategy:Ar.variadic}),getDateTimeFormat:gr((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.DateTimeFormat).bind.apply(e,gt([void 0],t,!1)))}),{cache:kr(i.dateTime),strategy:Ar.variadic}),getPluralRules:gr((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.PluralRules).bind.apply(e,gt([void 0],t,!1)))}),{cache:kr(i.pluralRules),strategy:Ar.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])},e.__parse=br,
|
591
654
|
// Default format options used as the prototype of the `formats` provided to the
|
592
655
|
// constructor. These are used when constructing the internal Intl.NumberFormat
|
593
656
|
// and Intl.DateTimeFormat instances.
|
594
|
-
e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();const
|
657
|
+
e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();const $r={},Dr=(e,t,r)=>r?(t in $r||($r[t]={}),e in $r[t]||($r[t][e]=r),r):r,Ur=(e,t)=>{if(null==t)return;if(t in $r&&e in $r[t])return $r[t][e];const r=pn(t);for(let n=0;n<r.length;n++){const o=Vr(r[n],e);if(o)return Dr(e,t,o)}};let Fr;const Gr=tt({});function jr(e){return e in Fr}function Vr(e,t){if(!jr(e))return null;const r=function(e){return Fr[e]||null}(e);return function(e,t){if(null==t)return;if(t in e)return e[t];const r=t.split(".");let n=e;for(let e=0;e<r.length;e++)if("object"==typeof n){if(e>0){const t=r.slice(e,r.length).join(".");if(t in n){n=n[t];break}}n=n[r[e]]}else n=void 0;return n}(r,t)}function zr(e,...t){delete $r[e],Gr.update((r=>(r[e]=ht.all([r[e]||{},...t]),r)))}rt([Gr],(([e])=>Object.keys(e))),Gr.subscribe((e=>Fr=e));const Xr={};function Wr(e){return Xr[e]}function Kr(e){return null!=e&&pn(e).some((e=>{var t;return null==(t=Wr(e))?void 0:t.size}))}function qr(e,t){const r=Promise.all(t.map((t=>(function(e,t){Xr[e].delete(t),0===Xr[e].size&&delete Xr[e]}(e,t),t().then((e=>e.default||e))))));return r.then((t=>zr(e,...t)))}const Zr={};function Yr(e){if(!Kr(e))return e in Zr?Zr[e]:Promise.resolve();const t=function(e){return pn(e).map((e=>{const t=Wr(e);return[e,t?[...t]:[]]})).filter((([,e])=>e.length>0))}(e);return Zr[e]=Promise.all(t.map((([e,t])=>qr(e,t)))).then((()=>{if(Kr(e))return Yr(e);delete Zr[e]})),Zr[e]}const Qr={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function Jr(){return Qr}const en=tt(!1);var tn=Object.defineProperty,rn=Object.defineProperties,nn=Object.getOwnPropertyDescriptors,on=Object.getOwnPropertySymbols,sn=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable,ln=(e,t,r)=>t in e?tn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;let cn;const un=tt(null);function hn(e){return e.split("-").map(((e,t,r)=>r.slice(0,t+1).join("-"))).reverse()}function pn(e,t=Jr().fallbackLocale){const r=hn(e);return t?[...new Set([...r,...hn(t)])]:r}function fn(){return null!=cn?cn:void 0}un.subscribe((e=>{cn=null!=e?e:void 0,"undefined"!=typeof window&&null!=e&&document.documentElement.setAttribute("lang",e)}));const dn=(mn=((e,t)=>{for(var r in t||(t={}))sn.call(t,r)&&ln(e,r,t[r]);if(on)for(var r of on(t))an.call(t,r)&&ln(e,r,t[r]);return e})({},un),rn(mn,nn({set:e=>{if(e&&function(e){if(null==e)return;const t=pn(e);for(let e=0;e<t.length;e++){const r=t[e];if(jr(r))return r}}(e)&&Kr(e)){const{loadingDelay:t}=Jr();let r;return"undefined"!=typeof window&&null!=fn()&&t?r=window.setTimeout((()=>en.set(!0)),t):en.set(!0),Yr(e).then((()=>{un.set(e)})).finally((()=>{clearTimeout(r),en.set(!1)}))}return un.set(e)}})));var mn;const yn=e=>{const t=Object.create(null);return r=>{const n=JSON.stringify(r);return n in t?t[n]:t[n]=e(r)}};var bn=Object.defineProperty,gn=Object.getOwnPropertySymbols,vn=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable,wn=(e,t,r)=>t in e?bn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tn=(e,t)=>{for(var r in t||(t={}))vn.call(t,r)&&wn(e,r,t[r]);if(gn)for(var r of gn(t))En.call(t,r)&&wn(e,r,t[r]);return e},_n=(e,t)=>{var r={};for(var n in e)vn.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&gn)for(var n of gn(e))t.indexOf(n)<0&&En.call(e,n)&&(r[n]=e[n]);return r};const Cn=(e,t)=>{const{formats:r}=Jr();if(e in r&&t in r[e])return r[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},Bn=yn((e=>{var t=e,{locale:r,format:n}=t,o=_n(t,["locale","format"]);if(null==r)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(o=Cn("number",n)),new Intl.NumberFormat(r,o)})),xn=yn((e=>{var t=e,{locale:r,format:n}=t,o=_n(t,["locale","format"]);if(null==r)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?o=Cn("date",n):0===Object.keys(o).length&&(o=Cn("date","short")),new Intl.DateTimeFormat(r,o)})),An=yn((e=>{var t=e,{locale:r,format:n}=t,o=_n(t,["locale","format"]);if(null==r)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?o=Cn("time",n):0===Object.keys(o).length&&(o=Cn("time","short")),new Intl.DateTimeFormat(r,o)})),Ln=yn((
|
595
658
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
596
|
-
(e,t=
|
597
|
-
/* ../cashier-iframe-redirect/src/CashierIframeRedirect.svelte generated by Svelte v3.59.2 */function
|
659
|
+
(e,t=fn())=>new Ir(e,t,Jr().formats,{ignoreTag:Jr().ignoreTag}))),Hn=(e,t={})=>{var r,n,o,i;let s=t;"object"==typeof e&&(s=e,e=s.id);const{values:a,locale:l=fn(),default:c}=s;if(null==l)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let u=Ur(e,l);if(u){if("string"!=typeof u)return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof u}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),u}else u=null!=(i=null!=(o=null==(n=(r=Jr()).handleMissingMessage)?void 0:n.call(r,{locale:l,id:e,defaultValue:c}))?o:c)?i:e;if(!a)return u;let h=u;try{h=Ln(u,l).format(a)}catch(t){t instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,t.message)}return h},Sn=(e,t)=>((e={})=>{var t=e,{locale:r=fn()}=t,n=_n(t,["locale"]);return An(Tn({locale:r},n))})(t).format(e),Pn=(e,t)=>((e={})=>{var t=e,{locale:r=fn()}=t,n=_n(t,["locale"]);return xn(Tn({locale:r},n))})(t).format(e),Mn=(e,t)=>((e={})=>{var t=e,{locale:r=fn()}=t,n=_n(t,["locale"]);return Bn(Tn({locale:r},n))})(t).format(e),On=(e,t=fn())=>Ur(e,t),Rn=rt([dn,Gr],(()=>Hn));rt([dn],(()=>Sn)),rt([dn],(()=>Pn)),rt([dn],(()=>Mn)),rt([dn,Gr],(()=>On)),window.emWidgets={topic:(e,t=0)=>{if(-1==Qe.indexOf(e)){let r=new Ye(t);Je[e]=r,Qe.push(e)}return Je[e]}};function Nn(e,t){zr(e,t)}const kn={en:{loading:"Loading...",amountLabel:"Amount",makeDepositButton:"Deposit",confirmDepositText:"Are you sure you want to deposit",confirmDepositButton:"Ok",redirectTitle:"You are redirected to the payment's provider page",redirectMessage:"Please complete your transaction on the payment's provider page.",backToPayment:"Close",retryText:"Please note that your popup blocker may prevent the payment window from appearing",retryButton:"RETRY",processingButton:"Processing...",generalMin:"Min",generalMax:"Max",amountPlaceholder:"0.00",change:"Change"}};function In(e,t){zr(e,t)}const $n={en:{backButton:"Back"}};
|
660
|
+
/* ../cashier-iframe-redirect/src/CashierIframeRedirect.svelte generated by Svelte v3.59.2 */function Dn(t){let r,n,o,i,s,l,c,u,d,v,T,_,B=/*$_*/t[1]("backButton")+"";return{c(){r=m("div"),n=m("div"),o=y("svg"),i=y("path"),s=g(),l=m("span"),c=b(B),u=g(),d=m("iframe"),this.c=e,w(i,"fill-rule","evenodd"),w(i,"clip-rule","evenodd"),w(i,"d","M12.5632 3.47776C12.4787 3.50132 12.3362 3.57499 12.2465 3.64147C12.1567 3.708 10.8069 5.0421 9.24694 6.6062C6.11944 9.74186 6.25999 9.58198 6.25999 10.0036C6.25999 10.4243 6.13093 10.2783 9.34296 13.4902C12.4449 16.5921 12.356 16.5115 12.7278 16.5555C13.1855 16.6098 13.6413 16.2584 13.7301 15.783C13.7612 15.6163 13.7212 15.3394 13.6437 15.1846C13.6158 15.1289 12.451 13.9396 11.0553 12.5417L8.51768 9.99999L11.0553 7.45831C12.451 6.06042 13.6158 4.87108 13.6437 4.81538C13.7729 4.55745 13.7703 4.20054 13.6374 3.94268C13.4469 3.57304 12.9668 3.36526 12.5632 3.47776Z"),w(i,"fill","#111111"),w(o,"xmlns","http://www.w3.org/2000/svg"),w(o,"width","20"),w(o,"height","20"),w(o,"viewBox","0 0 20 20"),w(o,"fill","none"),w(n,"class","BackButton"),a(d.src,v=/*iframeurl*/t[0])||w(d,"src",v),w(d,"frameborder","0"),w(r,"class","CashierRedirectIframe")},m(e,a){p(e,r,a),h(r,n),h(n,o),h(o,i),h(n,s),h(n,l),h(l,c),h(r,u),h(r,d),T||(_=E(n,"click",/*close*/t[2]),T=!0)},p(e,[t]){/*$_*/2&t&&B!==(B=/*$_*/e[1]("backButton")+"")&&C(c,B),/*iframeurl*/1&t&&!a(d.src,v=/*iframeurl*/e[0])&&w(d,"src",v)},i:e,o:e,d(e){e&&f(r),T=!1,_()}}}function Un(e,t,r){let n;c(e,Rn,(e=>r(1,n=e)));let{lang:o="en"}=t,{iframeurl:i}=t,{translationurl:s=""}=t;P();Object.keys($n).forEach((e=>{In(e,$n[e])}));const a=()=>{var e;e=o,dn.set(e)};return e.$$set=e=>{"lang"in e&&r(3,o=e.lang),"iframeurl"in e&&r(0,i=e.iframeurl),"translationurl"in e&&r(4,s=e.translationurl)},e.$$.update=()=>{/*lang*/8&e.$$.dirty&&o&&a(),/*translationurl*/16&e.$$.dirty&&s&&(()=>{if(s)fetch(s).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{In(t,e[t])}))})).catch((e=>{console.log(e)}))})()},[i,n,()=>{dispatchEvent(new CustomEvent("closeIframe",{bubbles:!0,cancelable:!0,composed:!0}))},o,s]}
|
598
661
|
/* ../cashier-confirm-modal/src/CashierConfirmModal.svelte generated by Svelte v3.59.2 */
|
599
|
-
function
|
662
|
+
function Fn(t){let r,o,i,s,a,l,c,u,d,y,b,v;return{c(){r=m("div"),o=m("div"),i=m("div"),s=m("slot"),a=g(),l=m("slot"),c=g(),u=m("span"),u.innerHTML='<slot name="confirm"></slot>',d=g(),y=m("span"),y.innerHTML='<slot name="close"><svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></slot>',this.c=e,w(s,"name","title"),w(s,"class","CashierModalTitle"),w(l,"name","text"),w(l,"class","CashierModalText"),w(u,"class","ModalOkBtn"),w(u,"role","button"),w(y,"class","ModalCloseBtn"),w(y,"role","button"),w(i,"class","CashierModalContainer"),w(i,"part","CashierModalContainer"),w(o,"class","CashierModalWindow"),w(o,"part","CashierModalWindow"),w(o,"id","Modal"),w(r,"part","CustomStylingContainer")},m(e,n){p(e,r,n),h(r,o),h(o,i),h(i,s),h(i,a),h(i,l),h(i,c),h(i,u),h(i,d),h(i,y),b||(v=[E(u,"click",/*confirm*/t[1]),E(y,"click",/*close*/t[0])],b=!0)},p:e,i:e,o:e,d(e){e&&f(r),b=!1,n(v)}}}function Gn(e){const t=()=>{dispatchEvent(new CustomEvent("closeModal",{bubbles:!0,cancelable:!0,composed:!0}))};return[t,()=>{dispatchEvent(new CustomEvent("confirmModal",{bubbles:!0,cancelable:!0,composed:!0})),t()}]}!customElements.get("cashier-iframe-redirect")&&customElements.define("cashier-iframe-redirect",class extends W{constructor(e){super();const t=document.createElement("style");t.textContent=".CashierRedirectIframe{height:inherit;width:inherit}iframe{height:100%;width:100%;background:rgba(0, 0, 0, 0.1)}.BackButton{position:absolute;display:flex;align-items:center;padding:8px 8px 8px 4px;margin:8px;border-radius:2px;background:rgba(0, 0, 0, 0.1);justify-content:center;cursor:pointer}",this.shadowRoot.appendChild(t),X(this,{target:this.shadowRoot,props:A(this.attributes),customElement:!0},Un,Dn,i,{lang:3,iframeurl:0,translationurl:4},null),e&&(e.target&&p(e.target,this,e.anchor),e.props&&(this.$set(e.props),F()))}static get observedAttributes(){return["lang","iframeurl","translationurl"]}get lang(){return this.$$.ctx[3]}set lang(e){this.$$set({lang:e}),F()}get iframeurl(){return this.$$.ctx[0]}set iframeurl(e){this.$$set({iframeurl:e}),F()}get translationurl(){return this.$$.ctx[4]}set translationurl(e){this.$$set({translationurl:e}),F()}});
|
600
663
|
/* ../cashier-notifications/src/CashierNotifications.svelte generated by Svelte v3.59.2 */
|
601
|
-
function
|
664
|
+
function jn(t){let r,n,o,i,s,a,l,c;return{c(){r=m("div"),n=m("span"),o=b(/*text*/t[0]),i=g(),s=m("button"),a=b(/*button*/t[1]),this.c=e,w(r,"class","cashier-notifications")},m(e,u){p(e,r,u),h(r,n),h(n,o),h(r,i),h(r,s),h(s,a),l||(c=E(s,"click",/*notificationClick*/t[2]),l=!0)},p(e,[t]){/*text*/1&t&&C(o,/*text*/e[0]),/*button*/2&t&&C(a,/*button*/e[1])},i:e,o:e,d(e){e&&f(r),l=!1,c()}}}function Vn(e,t,r){let{text:n}=t,{button:o}=t;return e.$$set=e=>{"text"in e&&r(0,n=e.text),"button"in e&&r(1,o=e.button)},[n,o,()=>{dispatchEvent(new CustomEvent("notificationButtonClick",{bubbles:!0,cancelable:!0,composed:!0}))}]}!customElements.get("cashier-confirm-modal")&&customElements.define("cashier-confirm-modal",class extends W{constructor(e){super();const t=document.createElement("style");t.textContent="*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}.CashierModalWindow{container-type:inline-size;container-name:confirm-modal;display:flex;position:absolute;align-items:center;justify-content:center;width:100%;height:100%;z-index:100;top:0;left:0;background-color:rgba(0, 0, 0, 0.1)}.CashierModalWindow .CashierModalContainer{width:500px;display:flex;gap:20px;align-items:center;position:relative;padding:15px;min-height:200px;box-shadow:0 2px 6px 0 rgba(0, 0, 0, 0.1);justify-content:center;border-radius:10px;flex-direction:column;background-color:#fff}.CashierModalWindow .ModalOkBtn{color:#FFF;display:flex;align-items:center;justify-content:center;font-size:14px;font-style:normal;font-weight:400;height:46px;border-radius:50px;line-height:normal;border:none;background-color:rgb(126, 197, 30);width:100%;margin:12px 0;cursor:pointer}.CashierModalWindow .ModalCloseBtn{position:absolute;display:flex;align-items:center;justify-content:center;top:-50px;right:-50px;padding:6px;border-radius:50%;color:#FFFFFF;background:rgba(84, 77, 77, 0.1);cursor:pointer;transition:all 150ms ease-in-out}.CashierModalWindow .ModalCloseBtn svg{width:32px;height:32px}.CashierModalWindow .ModalCloseBtn:hover{background:rgba(255, 255, 255, 0.2)}@container confirm-modal (max-width: 750px){.CashierModalContainer{margin:30px}.CashierModalContainer .ModalCloseBtn{top:-30px;right:-30px}.CashierModalContainer .ModalCloseBtn svg{width:20px;height:20px}}",this.shadowRoot.appendChild(t),X(this,{target:this.shadowRoot,props:A(this.attributes),customElement:!0},Gn,Fn,i,{},null),e&&e.target&&p(e.target,this,e.anchor)}});!customElements.get("cashier-notifications")&&customElements.define("cashier-notifications",class extends W{constructor(e){super();const t=document.createElement("style");t.textContent='.cashier-notifications{position:absolute;margin:12px 0;background-color:rgb(17, 17, 17);color:rgb(255, 255, 255);display:flex;border-radius:4px;align-items:center;gap:12px;padding:12px 15px;min-height:65px;pointer-events:auto;bottom:0;width:calc(100% - 30px)}.cashier-notifications span,.cashier-notifications button{font-family:"Roboto", sans-serif;border:none;font-variant:normal}.cashier-notifications span{line-height:normal}.cashier-notifications button{color:rgb(126, 197, 30);background-color:rgb(17, 17, 17);cursor:pointer;font-size:14px;font-style:normal;font-weight:700}',this.shadowRoot.appendChild(t),X(this,{target:this.shadowRoot,props:A(this.attributes),customElement:!0},Vn,jn,i,{text:0,button:1},null),e&&(e.target&&p(e.target,this,e.anchor),e.props&&(this.$set(e.props),F()))}static get observedAttributes(){return["text","button"]}get text(){return this.$$.ctx[0]}set text(e){this.$$set({text:e}),F()}get button(){return this.$$.ctx[1]}set button(e){this.$$set({button:e}),F()}});
|
602
665
|
/* src/CashierMethodDetails.svelte generated by Svelte v3.59.2 */
|
603
|
-
const{document:
|
604
|
-
// (
|
605
|
-
function
|
606
|
-
return e[
|
666
|
+
const{document:zn,window:Xn}=u;function Wn(e,t,r){const n=e.slice();return n[71]=t[r],n[72]=t,n[73]=r,n}function Kn(e,t,r){const n=e.slice();return n[74]=t[r],n}
|
667
|
+
// (336:2) {#if isTranslationLoaded && selectedPaymentMethod.Name}
|
668
|
+
function qn(e){let t,r,n,o,i,s,l,c,u,y,v,T,_,B,x,A,L,H,S,P=/*selectedPaymentMethod*/e[10].Label+"",M=/*mobileView*/e[8]&&Zn(e),O=!/*selectedPaymentMethod*/e[10].HideAmountField&&Yn(e),R=/*fields*/e[11],N=[];for(let t=0;t<R.length;t+=1)N[t]=yo(Wn(e,R,t));function k(e,t){/*isProcessingTxn*/
|
669
|
+
return e[18]?bo:go}let I=k(e),$=I(e),D=/*showRetryNotification*/e[17]&&vo(e),U=/*showRedirectNotification*/e[15]&&Eo(e);return{c(){t=m("div"),r=m("form"),n=m("div"),o=m("div"),i=m("div"),s=m("img"),u=g(),y=m("div"),v=b(P),T=g(),M&&M.c(),_=g(),O&&O.c(),B=g();for(let e=0;e<N.length;e+=1)N[e].c();x=g(),$.c(),A=g(),D&&D.c(),L=g(),U&&U.c(),a(s.src,l=/*selectedPaymentMethod*/e[10].Logos[0].LogoUrl)||w(s,"src",l),w(s,"alt",c=/*selectedPaymentMethod*/e[10].Label),w(i,"class","SelectedLogoWrapper"),w(y,"class","SelectedLogoDescription"),w(o,"class","form-logo"),w(n,"class","FieldWrapper"),w(t,"class","MethodsDetails")},m(a,l){p(a,t,l),h(t,r),h(r,n),h(n,o),h(o,i),h(i,s),h(o,u),h(o,y),h(y,v),h(o,T),M&&M.m(o,null),h(n,_),O&&O.m(n,null),h(r,B);for(let e=0;e<N.length;e+=1)N[e]&&N[e].m(r,null);var c;h(r,x),$.m(r,null),h(r,A),D&&D.m(r,null),h(t,L),U&&U.m(t,null),H||(S=E(r,"submit",(c=/*prepareTxn*/e[23],function(e){
|
607
670
|
// @ts-ignore
|
608
|
-
return e.preventDefault(),c.call(this,e)})),
|
609
|
-
// (
|
610
|
-
function
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
// (
|
615
|
-
function
|
616
|
-
// (
|
617
|
-
function
|
618
|
-
// (
|
619
|
-
function
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
// (
|
624
|
-
function
|
625
|
-
// (
|
626
|
-
function
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
// (
|
631
|
-
function
|
632
|
-
// (
|
633
|
-
function
|
634
|
-
|
635
|
-
|
636
|
-
/*
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
// (
|
661
|
-
function
|
662
|
-
// (
|
663
|
-
function
|
664
|
-
// (
|
665
|
-
function
|
666
|
-
// (
|
667
|
-
function
|
668
|
-
// (
|
669
|
-
function
|
670
|
-
// (
|
671
|
-
function dr(e){let t,n,r,i,o,s,a,l,c,u,m,g=/*$_*/e[18]("confirmDepositText")+"",E=/*$_*/e[18]("confirmDepositButton")+"";return{c(){t=f("cashier-confirm-modal"),n=f("span"),r=b(g),i=y(),o=b(/*amount*/e[1]),s=y(),a=b(/*currency*/e[5]),l=b(" ?"),c=y(),u=f("div"),m=b(E),T(n,"slot","text"),T(u,"slot","confirm")},m(e,d){p(e,t,d),h(t,n),h(n,r),h(n,i),h(n,o),h(n,s),h(n,a),h(n,l),h(t,c),h(t,u),h(u,m)},p(e,t){/*$_*/262144&t[0]&&g!==(g=/*$_*/e[18]("confirmDepositText")+"")&&B(r,g),/*amount*/2&t[0]&&B(o,/*amount*/e[1]),/*currency*/32&t[0]&&B(a,/*currency*/e[5]),/*$_*/262144&t[0]&&E!==(E=/*$_*/e[18]("confirmDepositButton")+"")&&B(m,E)},d(e){e&&d(t)}}}function mr(t){let n,r,i,o,s,l,c=/*isTranslationLoaded*/t[16]&&/*selectedPaymentMethod*/t[7].Name&&Gn(t),u=/*redirectUrl*/t[11]&&/*redirectMode*/t[13]===/*RedirectionModeStringEnum*/t[2].Default&&pr(t),m=/*showConfirmModal*/t[10]&&dr(t);return{c(){n=f("script"),i=y(),o=f("div"),c&&c.c(),s=y(),u&&u.c(),l=y(),m&&m.c(),this.c=e,a(n.src,r=fr)||T(n,"src",r),T(o,"class","CashierMethodDetails")},m(e,t){h(Dn.head,n),p(e,i,t),p(e,o,t),c&&c.m(o,null),h(o,s),u&&u.m(o,null),h(o,l),m&&m.m(o,null)},p(e,t){/*isTranslationLoaded*/e[16]&&/*selectedPaymentMethod*/e[7].Name?c?c.p(e,t):(c=Gn(e),c.c(),c.m(o,s)):c&&(c.d(1),c=null),/*redirectUrl*/e[11]&&/*redirectMode*/e[13]===/*RedirectionModeStringEnum*/e[2].Default?u?u.p(e,t):(u=pr(e),u.c(),u.m(o,l)):u&&(u.d(1),u=null),/*showConfirmModal*/e[10]?m?m.p(e,t):(m=dr(e),m.c(),m.m(o,null)):m&&(m.d(1),m=null)},i:e,o:e,d(e){d(n),e&&d(i),e&&d(o),c&&c.d(),u&&u.d(),m&&m.d()}}}let fr="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js";function gr(e,t,n){let r;c(e,An,(e=>n(18,r=e)));class i{constructor(e){this.correlationFieldName=e.CorrelationFieldName||null,this.correlationFieldValue=e.CorrelationFieldValue&&e.CorrelationFieldValue.length>0?e.CorrelationFieldValue.split(","):[],this.name=e.Name||null,this.label=e.Label||null,this.description=e.Description||null,this.type=e.Type||null,this.defaultValue=this.calcDefaultValue(e),this.format=e.Format||null,this.placeholder=e.Placeholder||null,this.isReadonly=e.IsReadonly||!1,this.isRequired=e.IsRequired||!1,this.maxValue=e.MaxValue||null,this.minValue=e.MinValue||null,this.isPrimaryField=e.IsPrimaryField||!1,this.demandUserInput=e.DemandUserInput||!1,this.autoTrim=e.AutoTrim||!1,this.autoUppercase=e.AutoUppercase||!1,this.notEqualToFieldName=e.NotEqualToFieldName||null,this.values=e.Values,this.useCopyButton=e.UseCopyButton||!1,this.inputMask=e.InputMask,this.tags=e.Tags||null}calcDefaultValue(e){return 2===this.type?"True"===e.DefaultValue:e.DefaultValue||null}get descriptionWithLink(){if("Boolean"===o[this.type]&&this.placeholder||"Link"===o[this.type]){const e=/{link}/i,t=`<a href="${this.placeholder||this.defaultValue}" target="_blank" rel="noopener noreferrer">${this.label}</a>`;return this.description.match(e)?this.description.replace(e,t):`${this.description} ${t}`}return this.description}}let{FieldTypes:o}=t;!function(e){e.Unknown="Unknown",e.Text="Text",e.Boolean="Boolean",e.Number="Number",e.Money="Money",e.DateTime="DateTime",e.Lookup="Lookup",e.IpAddress="IpAddress",e.Date="Date",e.Time="Time",e.LookupCollection="LookupCollection",e.Hidden="Hidden",e.Label="Label",e.Password="Password",e.Link="Link",e.Image="Image",e.Html="Html",e.QRCode="QR"}(o||(o={}));let s,{endpoint:a}=t,{session:l}=t,{lang:u}=t,{translationurl:h}=t,{customerid:p}=t,{currency:d}=t,{amount:m}=t,{selectedpaymentmethodname:f}=t,{clientstyling:g=""}=t,{clientstylingurl:b=""}=t,{RedirectionModeStringEnum:y}=t;!function(e){e.Default="Default",e.RedirectWithRetry="Redirect"}(y||(y={}));let E,v,T,w,B,L,H,x,A,_={},M=[],S={},N=!1,k=[];const O=()=>{var e;e=u,ln.set(e)};Object.keys(Pn).forEach((e=>{_n(e,Pn[e])}));var I;I=()=>(window.addEventListener("closeModal",F,!1),window.addEventListener("confirmModal",G,!1),window.addEventListener("closeIframe",U,!1),window.addEventListener("notificationButtonClick",j,!1),document.addEventListener("click",$),()=>{window.removeEventListener("closeModal",F),window.removeEventListener("confirmModal",G),window.removeEventListener("closeIframe",U),window.removeEventListener("notificationButtonClick",j)}),P().$$.on_mount.push(I);const $=e=>{e.composedPath().includes(A)||n(17,x=null)},D=(e,t)=>{t!==x?(A=e.composedPath()[0],n(17,x=t)):n(17,x=null)},U=()=>{n(11,E=null)},F=()=>{n(10,N=!1)},G=()=>{n(15,L=!0);const e=new URL(`${a}/v1/player/${p}/payment/GetPaymentConfirm`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json");const r={method:"POST",mode:"cors",headers:t,body:JSON.stringify({XPaymentSessionToken:s})};fetch(e,r).then((e=>e.json())).then((e=>{s=e.XPaymentSessionToken,n(11,E=e.RedirectUrl),n(13,w=e.RedirectionMode),n(15,L=!1),e.RedirectionMode===y.RedirectWithRetry&&(v=window.open(e.RedirectUrl,"_blank"),n(12,T=!!v),v||n(14,B=!0))}))},j=()=>{v=window.open(E,"_blank"),n(12,T=!0),n(14,B=!1)},V=e=>{e&&window.postMessage({type:"NavigateTo",path:e,target:"_blank",externalLink:!1},window.location.href)};return e.$$set=e=>{"FieldTypes"in e&&n(0,o=e.FieldTypes),"endpoint"in e&&n(24,a=e.endpoint),"session"in e&&n(25,l=e.session),"lang"in e&&n(3,u=e.lang),"translationurl"in e&&n(4,h=e.translationurl),"customerid"in e&&n(26,p=e.customerid),"currency"in e&&n(5,d=e.currency),"amount"in e&&n(1,m=e.amount),"selectedpaymentmethodname"in e&&n(27,f=e.selectedpaymentmethodname),"clientstyling"in e&&n(28,g=e.clientstyling),"clientstylingurl"in e&&n(29,b=e.clientstylingurl),"RedirectionModeStringEnum"in e&&n(2,y=e.RedirectionModeStringEnum)},e.$$.update=()=>{/*endpoint, session, selectedpaymentmethodname, currency*/184549408&e.$$.dirty[0]&&a&&l&&f&&d&&(()=>{const e=new URL(`${a}/v1/player/${p}/payment/GetPaymentMethod`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json");const r={method:"POST",mode:"cors",headers:t,body:JSON.stringify({PaymentMethodName:f,Currency:d,XPaymentSessionToken:l})};fetch(e,r).then((e=>e.json())).then((e=>{s=e.XPaymentSessionToken,n(7,_=e.PaymentMethod),n(8,M=_.Fields&&_.Fields.map((e=>new i(e)))),n(9,S={})}))})(),e.$$.dirty[0],e.$$.dirty[0],/*lang*/8&e.$$.dirty[0]&&u&&O(),/*lang, translationurl*/24&e.$$.dirty[0]&&u&&h&&(()=>{if(h)fetch(h).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{_n(t,e[t]),n(16,H=!0)}))})).catch((e=>{n(16,H=!0)}))})(),/*selectedpaymentmethodname, qrCodeContainer*/134217792&e.$$.dirty[0]&&f&&k.length&&k.forEach((e=>{if(e&&e.innerText){const t=e.innerText;e.innerText="",new QRCode(e,{text:t,width:250,height:250})}}))},[o,m,y,u,h,d,k,_,M,S,N,E,T,w,B,L,H,x,r,D,()=>{n(15,L=!0);const e=new URL(`${a}/v1/player/${p}/payment/GetPaymentPrepare`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json");const r={method:"POST",mode:"cors",headers:t,body:JSON.stringify({XPaymentSessionToken:s,Transaction:{PaymentMethod:_.Name,Amount:m,Currency:d,CustomFields:S},Account:{}})};fetch(e,r).then((e=>e.json())).then((e=>{s=e.XPaymentSessionToken,n(15,L=!1),n(10,N=!0)}))},V,e=>!e.correlationFieldName||e.correlationFieldName&&S[e.correlationFieldName]===e.correlationFieldValue,i,a,l,p,f,g,b,function(){m=C(this.value),n(1,m)},function(e){S[e.name]=this.value,n(9,S)},function(e){S[e.name]=C(this.value),n(9,S)},function(e){S[e.name]=this.value,n(9,S)},function(e){S[e.name]=this.value,n(9,S)},(e,t)=>D(t,e),(e,t)=>{n(9,S[e.name]=t.name,S),n(8,M)},function(e){S[e.name]=this.value,n(9,S)},function(e){R[e?"unshift":"push"]((()=>{k[k.length]=e,n(6,k)}))},e=>{V(e.description)},function(e){S[e.name]=this.value,n(9,S)},()=>{n(12,T=!1)}]}class br extends W{constructor(e){super();const t=document.createElement("style");t.textContent='@keyframes loading-spinner{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.MethodsDetails{position:relative;display:flex;flex-direction:column;gap:5px}.MethodsDetails:has(.RedirectionNotification) form{visibility:hidden}.form-logo{align-items:center;display:flex;height:50px;border-bottom:1px solid var(--emw--color-gray-100, #E8E9EB)}.form-logo .SelectedLogoDescription{color:var(--emw--color-black, #111);font-size:var(--emw--font-size-small, 14px);margin:7px 5px 7px 7px;word-break:break-word}.form-logo .SelectedLogoWrapper{width:56px;height:32px;flex-shrink:0;background:var(--emw--color-background, #FFF);border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-large, 6px)}.form-logo .SelectedLogoWrapper img{max-height:32px;max-width:56px}.RedirectionNotification{height:100%;width:inherit;position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px}.RedirectionNotification .RedirectionClose{display:flex;width:234px;height:36px;flex-direction:column;justify-content:center;flex-shrink:0;color:var(--emw--color-white, #FFF);cursor:pointer;text-align:center;font-size:var(--emw--font-size-x-small, 12px);font-style:normal;font-weight:500;line-height:normal;text-transform:uppercase;border-radius:4px;background:var(--emw--color-primary, #7EC51E)}.RedirectionNotification .RedirectionTitle{color:var(--emw--color-black, #111);font-size:var(--emw--font-size-x-small, 12px);font-style:normal;text-transform:none;font-weight:var(--emw--font-weight-bold, 600)}.RedirectionNotification .RedirectionMessage{color:var(--emw--color-gray-300, #666);font-size:var(--emw--font-size-x-small, 12px);font-style:normal;text-transform:none}cashier-iframe-redirect{height:inherit;width:inherit}.IframeRedirect{display:flex;position:absolute;align-items:center;justify-content:center;width:100%;height:100%;z-index:100;top:0;left:0;background-color:var(--emw--color-gray-transparency-20, rgba(0, 0, 0, 0.2))}.FieldWrapper,label{display:flex;flex-direction:column}.FieldWrapper{background-color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));border-radius:6px;box-shadow:0 2px 6px 0 rgba(0, 0, 0, 0.1);padding:0 15px 15px;margin-bottom:10px}.FieldWrapper:has(.QRCode, .Label){box-shadow:none;background:transparent}.FieldWrapper.Hidden{height:0;visibility:hidden;margin:0;padding:0}.AmountLimits{color:var(--emw--color-gray-300, #666);font-size:var(--emw--font-size-x-small, 12px);margin:5px 0 0 2px;line-height:var(--emw--font-size-x-small, 12px)}input,.Selected{border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-medium, 4px);height:40px;line-height:var(--emw--size-small, 14px);color:var(--emw--color-black, #111);padding:0 15px}input:focus,.Selected:focus{outline:none}label{color:var(--emw--color-black, #111);font-size:var(--emw--size-small, 14px);margin-top:7px;line-height:27px}label span.Required:before{content:"*";display:inline-block;margin-right:2px}.Description{color:var(--emw--color-gray-300, #666);font-size:var(--emw--font-size-x-small, 12px);margin:0 0 5px 2px;line-height:var(--emw--font-size-x-small, 12px)}.PrimaryButton{color:var(--emw--color-white, #FFF);text-align:center;font-size:var(--emw--font-size-small, 14px);font-style:normal;font-weight:400;height:46px;border-radius:50px;line-height:normal;border:none;background:var(--emw--color-primary, #7EC51E);width:100%;margin:12px 0;cursor:pointer;text-transform:uppercase}.PrimaryButton .ButtonSpinner{animation:loading-spinner 1s linear infinite}.QRCode{width:250px;margin:auto}.Checkbox{display:flex;position:relative;margin-top:12px}.Checkbox .Description{margin:0 0 0 20px;cursor:pointer;line-height:var(--emw--font-size-medium, 16px)}.Checkbox .Checkmark{position:absolute;top:2px;left:0;height:12px;width:12px;border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-medium, 4px);background-color:var(--emw--color-white, #FFF);cursor:pointer}.Checkbox .Checkmark:after{content:"";position:absolute;display:none}.Checkbox .Checkmark:after{left:4px;top:0;width:2px;height:8px;border:solid var(--emw--color-white, #FFF);border-width:0 2px 2px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.Checkbox input{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.Checkbox input:checked~.Checkmark{background-color:var(--emw--color-primary, #7EC51E);border-color:var(--emw--color-primary, #7EC51E)}.Checkbox input:checked~.Checkmark:after{display:block}.CustomSelect{width:100%;position:relative}.Selected{display:flex;align-items:center;cursor:pointer}.Selected:after{position:absolute;content:"";top:19px;right:10px;width:0;height:0;border:6px solid transparent;border-color:rgb(168, 169, 170) transparent transparent transparent}.OptionList{display:none;position:absolute;top:100%;left:0;right:0;z-index:99;background-color:white;border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-medium, 4px);margin-top:5px}.OptionList div{padding:8px 16px;cursor:pointer;user-select:none}.OptionList div:hover{background-color:var(--emw--color-background-secondary, #F9F9F9)}.OptionList.Opened{display:block}',this.shadowRoot.appendChild(t),z(this,{target:this.shadowRoot,props:x(this.attributes),customElement:!0},gr,mr,o,{PaymentMethodDetails:23,FieldTypes:0,endpoint:24,session:25,lang:3,translationurl:4,customerid:26,currency:5,amount:1,selectedpaymentmethodname:27,clientstyling:28,clientstylingurl:29,RedirectionModeStringEnum:2},null,[-1,-1,-1]),e&&(e.target&&p(e.target,this,e.anchor),e.props&&(this.$set(e.props),F()))}static get observedAttributes(){return["PaymentMethodDetails","FieldTypes","endpoint","session","lang","translationurl","customerid","currency","amount","selectedpaymentmethodname","clientstyling","clientstylingurl","RedirectionModeStringEnum"]}get PaymentMethodDetails(){return this.$$.ctx[23]}get FieldTypes(){return this.$$.ctx[0]}set FieldTypes(e){this.$$set({FieldTypes:e}),F()}get endpoint(){return this.$$.ctx[24]}set endpoint(e){this.$$set({endpoint:e}),F()}get session(){return this.$$.ctx[25]}set session(e){this.$$set({session:e}),F()}get lang(){return this.$$.ctx[3]}set lang(e){this.$$set({lang:e}),F()}get translationurl(){return this.$$.ctx[4]}set translationurl(e){this.$$set({translationurl:e}),F()}get customerid(){return this.$$.ctx[26]}set customerid(e){this.$$set({customerid:e}),F()}get currency(){return this.$$.ctx[5]}set currency(e){this.$$set({currency:e}),F()}get amount(){return this.$$.ctx[1]}set amount(e){this.$$set({amount:e}),F()}get selectedpaymentmethodname(){return this.$$.ctx[27]}set selectedpaymentmethodname(e){this.$$set({selectedpaymentmethodname:e}),F()}get clientstyling(){return this.$$.ctx[28]}set clientstyling(e){this.$$set({clientstyling:e}),F()}get clientstylingurl(){return this.$$.ctx[29]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),F()}get RedirectionModeStringEnum(){return this.$$.ctx[2]}set RedirectionModeStringEnum(e){this.$$set({RedirectionModeStringEnum:e}),F()}}return!customElements.get("cashier-method-details")&&customElements.define("cashier-method-details",br),br}));
|
671
|
+
return e.preventDefault(),c.call(this,e)})),H=!0)},p(e,i){if(/*selectedPaymentMethod*/1024&i[0]&&!a(s.src,l=/*selectedPaymentMethod*/e[10].Logos[0].LogoUrl)&&w(s,"src",l),/*selectedPaymentMethod*/1024&i[0]&&c!==(c=/*selectedPaymentMethod*/e[10].Label)&&w(s,"alt",c),/*selectedPaymentMethod*/1024&i[0]&&P!==(P=/*selectedPaymentMethod*/e[10].Label+"")&&C(v,P),/*mobileView*/e[8]?M?M.p(e,i):(M=Zn(e),M.c(),M.m(o,null)):M&&(M.d(1),M=null),/*selectedPaymentMethod*/e[10].HideAmountField?O&&(O.d(1),O=null):O?O.p(e,i):(O=Yn(e),O.c(),O.m(n,null)),/*fields, FieldTypes, prepareFields, openedLookup, showLookup, openUrlInNewTab, qrCodeContainer, showField*/105912449&i[0]){let t;for(R=/*fields*/e[11],t=0;t<R.length;t+=1){const n=Wn(e,R,t);N[t]?N[t].p(n,i):(N[t]=yo(n),N[t].c(),N[t].m(r,x))}for(;t<N.length;t+=1)N[t].d(1);N.length=R.length}I===(I=k(e))&&$?$.p(e,i):($.d(1),$=I(e),$&&($.c(),$.m(r,A))),/*showRetryNotification*/e[17]?D?D.p(e,i):(D=vo(e),D.c(),D.m(r,null)):D&&(D.d(1),D=null),/*showRedirectNotification*/e[15]?U?U.p(e,i):(U=Eo(e),U.c(),U.m(t,null)):U&&(U.d(1),U=null)},d(e){e&&f(t),M&&M.d(),O&&O.d(),d(N,e),$.d(),D&&D.d(),U&&U.d(),H=!1,S()}}}
|
672
|
+
// (347:12) {#if mobileView}
|
673
|
+
function Zn(e){let t,r,n,o,i=/*$_*/e[21]("change")+"";return{c(){t=m("div"),r=b(i),w(t,"class","ChangePaymeth")},m(i,s){p(i,t,s),h(t,r),n||(o=E(t,"click",/*click_handler*/e[35]),n=!0)},p(e,t){/*$_*/2097152&t[0]&&i!==(i=/*$_*/e[21]("change")+"")&&C(r,i)},d(e){e&&f(t),n=!1,o()}}}
|
674
|
+
// (351:10) {#if !selectedPaymentMethod.HideAmountField}
|
675
|
+
function Yn(e){let t,r,n,o,i,s=/*$_*/e[21]("amountLabel")+"";function a(e,t){/*selectedPaymentMethod*/
|
676
|
+
return e[10].IsAmountConfigurable?Jn:Qn}let l=a(e),c=l(e);return{c(){t=m("div"),r=m("label"),n=m("span"),o=b(s),i=g(),c.c(),w(n,"class","Required"),w(t,"class","Amount")},m(e,s){p(e,t,s),h(t,r),h(r,n),h(n,o),h(r,i),c.m(r,null)},p(e,t){/*$_*/2097152&t[0]&&s!==(s=/*$_*/e[21]("amountLabel")+"")&&C(o,s),l===(l=a(e))&&c?c.p(e,t):(c.d(1),c=l(e),c&&(c.c(),c.m(r,null)))},d(e){e&&f(t),c.d()}}}
|
677
|
+
// (365:14) {:else}
|
678
|
+
function Qn(e){let t,r,n,o;return{c(){t=m("span"),r=b(/*amount*/e[1]),n=g(),o=b(/*currency*/e[5]),w(t,"class","NonConfigurableAmount")},m(e,i){p(e,t,i),h(t,r),h(t,n),h(t,o)},p(e,t){/*amount*/2&t[0]&&C(r,/*amount*/e[1]),/*currency*/32&t[0]&&C(o,/*currency*/e[5])},d(e){e&&f(t)}}}
|
679
|
+
// (357:14) {#if selectedPaymentMethod.IsAmountConfigurable}
|
680
|
+
function Jn(e){let t,r,n,o,i,s,a=/*selectedPaymentMethod*/e[10].DisplayCurrency&&eo(e);return{c(){t=m("input"),n=g(),a&&a.c(),o=v(),w(t,"type","number"),w(t,"placeholder",r=/*$_*/e[21]("amountPlaceholder"))},m(r,l){p(r,t,l),B(t,/*amount*/e[1]),p(r,n,l),a&&a.m(r,l),p(r,o,l),i||(s=E(t,"input",/*input_input_handler*/e[36]),i=!0)},p(e,n){/*$_*/2097152&n[0]&&r!==(r=/*$_*/e[21]("amountPlaceholder"))&&w(t,"placeholder",r),/*amount*/2&n[0]&&_(t.value)!==/*amount*/e[1]&&B(t,/*amount*/e[1]),/*selectedPaymentMethod*/e[10].DisplayCurrency?a?a.p(e,n):(a=eo(e),a.c(),a.m(o.parentNode,o)):a&&(a.d(1),a=null)},d(e){e&&f(t),e&&f(n),a&&a.d(e),e&&f(o),i=!1,s()}}}
|
681
|
+
// (359:16) {#if selectedPaymentMethod.DisplayCurrency}
|
682
|
+
function eo(e){let t,r,n,o,i=/*selectedPaymentMethod*/e[10].DisplayCurrency.MinAmountLimit?`${/*$_*/e[21]("generalMin")} ${/*selectedPaymentMethod*/e[10].DisplayCurrency.MinAmountLimit} ${/*currency*/e[5]}`:"",s=/*selectedPaymentMethod*/e[10].DisplayCurrency.MaxAmountLimit?`/ ${/*$_*/e[21]("generalMax")} ${/*selectedPaymentMethod*/e[10].DisplayCurrency.MaxAmountLimit} ${/*currency*/e[5]}`:"";return{c(){t=m("span"),r=b(i),n=g(),o=b(s),w(t,"class","AmountLimits")},m(e,i){p(e,t,i),h(t,r),h(t,n),h(t,o)},p(e,t){/*selectedPaymentMethod, $_, currency*/2098208&t[0]&&i!==(i=/*selectedPaymentMethod*/e[10].DisplayCurrency.MinAmountLimit?`${/*$_*/e[21]("generalMin")} ${/*selectedPaymentMethod*/e[10].DisplayCurrency.MinAmountLimit} ${/*currency*/e[5]}`:"")&&C(r,i),/*selectedPaymentMethod, $_, currency*/2098208&t[0]&&s!==(s=/*selectedPaymentMethod*/e[10].DisplayCurrency.MaxAmountLimit?`/ ${/*$_*/e[21]("generalMax")} ${/*selectedPaymentMethod*/e[10].DisplayCurrency.MaxAmountLimit} ${/*currency*/e[5]}`:"")&&C(o,s)},d(e){e&&f(t)}}}
|
683
|
+
// (375:12) {#if showField(field)}
|
684
|
+
function to(e){let t,r,n,o,i=/*field*/e[71].label&&/*field*/e[71].type!==/*FieldTypes*/e[0].Link&&/*field*/e[71].type!==/*FieldTypes*/e[0].Boolean&&ro(e),s=/*field*/e[71].description&&/*field*/e[71].description!==/*field*/e[71].label&&/*field*/e[71].type!==/*FieldTypes*/e[0].QRCode&&/*field*/e[71].type!==/*FieldTypes*/e[0].Boolean&&/*field*/e[71].type!==/*FieldTypes*/e[0].Link&&no(e);function a(e,t){/*field*/
|
685
|
+
return e[71].type===/*FieldTypes*/e[0].Text?fo:/*field*/e[71].type===/*FieldTypes*/e[0].Number||/*field*/e[71].type===/*FieldTypes*/e[0].Money?po:/*field*/e[71].type===/*FieldTypes*/e[0].Password?ho:/*field*/e[71].type===/*FieldTypes*/e[0].Hidden?uo:/*field*/e[71].type===/*FieldTypes*/e[0].Lookup?co:/*field*/e[71].type===/*FieldTypes*/e[0].Boolean?lo:/*field*/e[71].type===/*FieldTypes*/e[0].QRCode?ao:/*field*/e[71].type===/*FieldTypes*/e[0].Link?so:/*field*/e[71].type===/*FieldTypes*/e[0].Label?io:oo}let l=a(e),c=l(e);return{c(){t=m("div"),r=m("label"),i&&i.c(),n=g(),s&&s.c(),o=g(),c.c(),w(t,"class","FieldWrapper"),x(t,"Hidden",/*field*/e[71].type===/*FieldTypes*/e[0].Hidden)},m(e,a){p(e,t,a),h(t,r),i&&i.m(r,null),h(r,n),s&&s.m(r,null),h(r,o),c.m(r,null)},p(e,u){/*field*/e[71].label&&/*field*/e[71].type!==/*FieldTypes*/e[0].Link&&/*field*/e[71].type!==/*FieldTypes*/e[0].Boolean?i?i.p(e,u):(i=ro(e),i.c(),i.m(r,n)):i&&(i.d(1),i=null),/*field*/e[71].description&&/*field*/e[71].description!==/*field*/e[71].label&&/*field*/e[71].type!==/*FieldTypes*/e[0].QRCode&&/*field*/e[71].type!==/*FieldTypes*/e[0].Boolean&&/*field*/e[71].type!==/*FieldTypes*/e[0].Link?s?s.p(e,u):(s=no(e),s.c(),s.m(r,o)):s&&(s.d(1),s=null),l===(l=a(e))&&c?c.p(e,u):(c.d(1),c=l(e),c&&(c.c(),c.m(r,null))),/*fields, FieldTypes*/2049&u[0]&&x(t,"Hidden",/*field*/e[71].type===/*FieldTypes*/e[0].Hidden)},d(e){e&&f(t),i&&i.d(),s&&s.d(),c.d()}}}
|
686
|
+
// (378:16) {#if field.label && field.type !== FieldTypes.Link && field.type !== FieldTypes.Boolean}
|
687
|
+
function ro(e){let t,r,n=/*field*/e[71].label+"";return{c(){t=m("span"),r=b(n),x(t,"Required",/*field*/e[71].isRequired)},m(e,n){p(e,t,n),h(t,r)},p(e,o){/*fields*/2048&o[0]&&n!==(n=/*field*/e[71].label+"")&&C(r,n),/*fields*/2048&o[0]&&x(t,"Required",/*field*/e[71].isRequired)},d(e){e&&f(t)}}}
|
688
|
+
// (381:16) {#if field.description && field.description !== field.label && field.type !== FieldTypes.QRCode && field.type !== FieldTypes.Boolean && field.type !== FieldTypes.Link}
|
689
|
+
function no(e){let t,r,n=/*field*/e[71].description+"";return{c(){t=m("span"),r=b(n),w(t,"class","Description")},m(e,n){p(e,t,n),h(t,r)},p(e,t){/*fields*/2048&t[0]&&n!==(n=/*field*/e[71].description+"")&&C(r,n)},d(e){e&&f(t)}}}
|
690
|
+
// (421:16) {:else}
|
691
|
+
function oo(e){let t,r,n,o;function i(){
|
692
|
+
/*input_input_handler_5*/e[46].call(t,/*field*/e[71])}return{c(){t=m("input"),w(t,"type","text"),w(t,"placeholder",r=/*field*/e[71].placeholder)},m(r,s){p(r,t,s),B(t,/*prepareFields*/e[12][/*field*/e[71].name]),n||(o=E(t,"input",i),n=!0)},p(n,o){e=n,/*fields*/2048&o[0]&&r!==(r=/*field*/e[71].placeholder)&&w(t,"placeholder",r),/*prepareFields, fields*/6144&o[0]&&t.value!==/*prepareFields*/e[12][/*field*/e[71].name]&&B(t,/*prepareFields*/e[12][/*field*/e[71].name])},d(e){e&&f(t),n=!1,o()}}}
|
693
|
+
// (419:58)
|
694
|
+
function io(t){let r;return{c(){r=m("span"),w(r,"class","Label")},m(e,t){p(e,r,t)},p:e,d(e){e&&f(r)}}}
|
695
|
+
// (417:57)
|
696
|
+
function so(e){let t,r=/*field*/e[71].descriptionWithLink+"";return{c(){t=m("span")},m(e,n){p(e,t,n),t.innerHTML=r},p(e,n){/*fields*/2048&n[0]&&r!==(r=/*field*/e[71].descriptionWithLink+"")&&(t.innerHTML=r)},d(e){e&&f(t)}}}
|
697
|
+
// (413:59)
|
698
|
+
function ao(e){let t,r,n,o,i,s=/*field*/e[71].defaultValue+"";function a(){/*click_handler_3*/
|
699
|
+
return e[45](/*field*/e[71])}return{c(){t=m("div"),r=m("div"),n=b(s),w(t,"class","QRCode")},m(s,l){p(s,t,l),h(t,r),h(r,n),
|
700
|
+
/*div0_binding*/e[44](r),o||(i=E(t,"click",a),o=!0)},p(t,r){e=t,/*fields*/2048&r[0]&&s!==(s=/*field*/e[71].defaultValue+"")&&C(n,s)},d(r){r&&f(t)
|
701
|
+
/*div0_binding*/,e[44](null),o=!1,i()}}}
|
702
|
+
// (407:60)
|
703
|
+
function lo(e){let t,r,n,o,i,s,a,l,c,u=/*field*/e[71].descriptionWithLink+"";function d(){
|
704
|
+
/*input_change_handler*/e[43].call(r,/*field*/e[71])}return{c(){t=m("div"),r=m("input"),o=g(),i=m("span"),s=g(),a=m("span"),w(r,"type","checkbox"),w(r,"placeholder",n=/*field*/e[71].placeholder),w(i,"class","Checkmark"),w(a,"class","Description"),w(t,"class","Checkbox")},m(n,f){p(n,t,f),h(t,r),B(r,/*prepareFields*/e[12][/*field*/e[71].name]),h(t,o),h(t,i),h(t,s),h(t,a),a.innerHTML=u,l||(c=E(r,"change",d),l=!0)},p(t,o){e=t,/*fields*/2048&o[0]&&n!==(n=/*field*/e[71].placeholder)&&w(r,"placeholder",n),/*prepareFields, fields*/6144&o[0]&&B(r,/*prepareFields*/e[12][/*field*/e[71].name]),/*fields*/2048&o[0]&&u!==(u=/*field*/e[71].descriptionWithLink+"")&&(a.innerHTML=u)},d(e){e&&f(t),l=!1,c()}}}
|
705
|
+
// (396:59)
|
706
|
+
function co(e){let t,r,n,o,i,s,a,l=/*prepareFields*/(e[12][/*field*/e[71].name]||"")+"";function c(...t){/*click_handler_1*/
|
707
|
+
return e[41](/*index*/e[73],...t)}let u=/*field*/e[71].values,y=[];for(let t=0;t<u.length;t+=1)y[t]=mo(Kn(e,u,t));return{c(){t=m("div"),r=m("div"),n=b(l),o=g(),i=m("div");for(let e=0;e<y.length;e+=1)y[e].c();w(r,"class","Selected"),w(r,"id",/*index*/e[73]),w(i,"class","OptionList"),x(i,"Opened",/*openedLookup*/e[20]===/*index*/e[73]),w(t,"class","CustomSelect")},m(e,l){p(e,t,l),h(t,r),h(r,n),h(t,o),h(t,i);for(let e=0;e<y.length;e+=1)y[e]&&y[e].m(i,null);s||(a=E(r,"click",c),s=!0)},p(t,r){if(e=t,/*prepareFields, fields*/6144&r[0]&&l!==(l=/*prepareFields*/(e[12][/*field*/e[71].name]||"")+"")&&C(n,l),/*prepareFields, fields*/6144&r[0]){let t;for(u=/*field*/e[71].values,t=0;t<u.length;t+=1){const n=Kn(e,u,t);y[t]?y[t].p(n,r):(y[t]=mo(n),y[t].c(),y[t].m(i,null))}for(;t<y.length;t+=1)y[t].d(1);y.length=u.length}/*openedLookup*/1048576&r[0]&&x(i,"Opened",/*openedLookup*/e[20]===/*index*/e[73])},d(e){e&&f(t),d(y,e),s=!1,a()}}}
|
708
|
+
// (393:59)
|
709
|
+
function uo(e){let t,r,n,o;function i(){
|
710
|
+
/*input_input_handler_4*/e[40].call(t,/*field*/e[71])}return{c(){t=m("input"),w(t,"type","hidden"),w(t,"placeholder",r=/*field*/e[71].placeholder)},m(r,s){p(r,t,s),B(t,/*prepareFields*/e[12][/*field*/e[71].name]),n||(o=E(t,"input",i),n=!0)},p(n,o){e=n,/*fields*/2048&o[0]&&r!==(r=/*field*/e[71].placeholder)&&w(t,"placeholder",r),/*prepareFields, fields*/6144&o[0]&&B(t,/*prepareFields*/e[12][/*field*/e[71].name])},d(e){e&&f(t),n=!1,o()}}}
|
711
|
+
// (390:61)
|
712
|
+
function ho(e){let t,r,n,o;function i(){
|
713
|
+
/*input_input_handler_3*/e[39].call(t,/*field*/e[71])}return{c(){t=m("input"),w(t,"type","password"),w(t,"placeholder",r=/*field*/e[71].placeholder)},m(r,s){p(r,t,s),B(t,/*prepareFields*/e[12][/*field*/e[71].name]),n||(o=E(t,"input",i),n=!0)},p(n,o){e=n,/*fields*/2048&o[0]&&r!==(r=/*field*/e[71].placeholder)&&w(t,"placeholder",r),/*prepareFields, fields*/6144&o[0]&&t.value!==/*prepareFields*/e[12][/*field*/e[71].name]&&B(t,/*prepareFields*/e[12][/*field*/e[71].name])},d(e){e&&f(t),n=!1,o()}}}
|
714
|
+
// (387:94)
|
715
|
+
function po(e){let t,r,n,o;function i(){
|
716
|
+
/*input_input_handler_2*/e[38].call(t,/*field*/e[71])}return{c(){t=m("input"),w(t,"type","number"),w(t,"placeholder",r=/*field*/e[71].placeholder)},m(r,s){p(r,t,s),B(t,/*prepareFields*/e[12][/*field*/e[71].name]),n||(o=E(t,"input",i),n=!0)},p(n,o){e=n,/*fields*/2048&o[0]&&r!==(r=/*field*/e[71].placeholder)&&w(t,"placeholder",r),/*prepareFields, fields*/6144&o[0]&&_(t.value)!==/*prepareFields*/e[12][/*field*/e[71].name]&&B(t,/*prepareFields*/e[12][/*field*/e[71].name])},d(e){e&&f(t),n=!1,o()}}}
|
717
|
+
// (384:16) {#if field.type === FieldTypes.Text}
|
718
|
+
function fo(e){let t,r,n,o;function i(){
|
719
|
+
/*input_input_handler_1*/e[37].call(t,/*field*/e[71])}return{c(){t=m("input"),w(t,"type","text"),w(t,"placeholder",r=/*field*/e[71].placeholder)},m(r,s){p(r,t,s),B(t,/*prepareFields*/e[12][/*field*/e[71].name]),n||(o=E(t,"input",i),n=!0)},p(n,o){e=n,/*fields*/2048&o[0]&&r!==(r=/*field*/e[71].placeholder)&&w(t,"placeholder",r),/*prepareFields, fields*/6144&o[0]&&t.value!==/*prepareFields*/e[12][/*field*/e[71].name]&&B(t,/*prepareFields*/e[12][/*field*/e[71].name])},d(e){e&&f(t),n=!1,o()}}}
|
720
|
+
// (400:22) {#each field.values as value}
|
721
|
+
function mo(e){let t,r,n,o,i,s=/*value*/e[74].value+"";function a(){/*click_handler_2*/
|
722
|
+
return e[42](/*field*/e[71],/*value*/e[74])}return{c(){t=m("div"),r=m("span"),n=b(s)},m(e,s){p(e,t,s),h(t,r),h(r,n),o||(i=E(t,"click",a),o=!0)},p(t,r){e=t,/*fields*/2048&r[0]&&s!==(s=/*value*/e[74].value+"")&&C(n,s)},d(e){e&&f(t),o=!1,i()}}}
|
723
|
+
// (374:10) {#each fields as field, index}
|
724
|
+
function yo(e){let t,r=/*showField*/e[26](/*field*/e[71]),n=r&&to(e);return{c(){n&&n.c(),t=v()},m(e,r){n&&n.m(e,r),p(e,t,r)},p(e,o){/*fields*/2048&o[0]&&(r=/*showField*/e[26](/*field*/e[71])),r?n?n.p(e,o):(n=to(e),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(e){n&&n.d(e),e&&f(t)}}}
|
725
|
+
// (436:8) {:else}
|
726
|
+
function bo(e){let t,r,n,o,i,s=/*$_*/e[21]("processingButton")+"";return{c(){t=m("button"),r=y("svg"),n=y("path"),o=g(),i=b(s),w(n,"d","M14.0282 6.58425C13.9037 4.05374 12.3688 1.68916 10.0872 0.61058C7.59818 -0.509483 4.56986 -0.0531603 2.49567 1.68916C0.504443 3.34851 -0.408201 6.04496 0.172573 8.57547C0.711862 11.0645 2.6616 13.0972 5.10915 13.7609C8.0545 14.5906 10.7509 13.1802 12.4103 10.7741C10.9169 12.7653 8.63527 14.0928 6.10476 13.6365C3.57424 13.1802 1.50005 11.2719 0.919281 8.78289C0.297024 6.12793 1.54154 3.34851 3.90612 1.97955C6.35366 0.569097 9.79682 1.10839 11.4147 3.51445C11.8295 4.09522 12.1199 4.80045 12.2444 5.50567C12.3688 6.08644 12.3273 6.7087 12.4103 7.28947C12.4933 7.82876 12.9496 8.53399 13.5718 8.16063C14.1111 7.82876 14.0696 7.12354 14.0282 6.58425C14.0696 6.87464 14.0282 6.41831 14.0282 6.58425Z"),w(n,"fill","white"),w(r,"class","ButtonSpinner"),w(r,"xmlns","http://www.w3.org/2000/svg"),w(r,"width","15"),w(r,"height","14"),w(r,"viewBox","0 0 15 14"),w(r,"fill","none"),w(t,"class","PrimaryButton")},m(e,s){p(e,t,s),h(t,r),h(r,n),h(t,o),h(t,i)},p(e,t){/*$_*/2097152&t[0]&&s!==(s=/*$_*/e[21]("processingButton")+"")&&C(i,s)},d(e){e&&f(t)}}}
|
727
|
+
// (428:8) {#if !isProcessingTxn}
|
728
|
+
function go(e){let t,r,n,o,i,s,a,l,c,u,d=/*$_*/e[21]("makeDepositButton")+"",v=/*amount*/(e[1]||/*$_*/e[21]("amountPlaceholder"))+"";return{c(){t=m("button"),r=y("svg"),n=y("path"),o=g(),i=b(d),s=g(),a=m("span"),l=b(v),c=g(),u=b(/*currency*/e[5]),w(n,"fill-rule","evenodd"),w(n,"clip-rule","evenodd"),w(n,"d","M7.51564 0.574496C6.49714 0.733152 5.5928 1.46162 5.21164 2.43037C5.01714 2.92471 4.98674 3.24368 4.98671 4.78987L4.98668 5.99306L4.55336 6.00671C4.20693 6.01762 4.08258 6.03221 3.93336 6.07946C3.43136 6.23846 3.00318 6.58293 2.73943 7.04C2.70133 7.106 2.63639 7.256 2.59508 7.37334L2.52002 7.58665V13.9067L2.59268 14.12C2.6993 14.4331 2.83849 14.6518 3.09336 14.9067C3.34821 15.1615 3.56693 15.3007 3.88002 15.4073L4.09336 15.48H11.9067L12.12 15.4073C12.4331 15.3007 12.6518 15.1615 12.9067 14.9067C13.1616 14.6518 13.3007 14.4331 13.4074 14.12L13.48 13.9067V7.58665L13.405 7.37334C13.1846 6.74712 12.6999 6.27875 12.0667 6.08C11.9191 6.03371 11.7891 6.0184 11.4467 6.00696L11.0134 5.99253L11.0133 4.78959C11.0133 4.128 11.0008 3.45465 10.9855 3.29334C10.9257 2.66268 10.7188 2.13556 10.3497 1.67368C9.66549 0.817589 8.6023 0.405214 7.51564 0.574496ZM8.46436 1.58665C9.01596 1.7035 9.52999 2.11659 9.79758 2.65809C9.98521 3.03771 9.98202 3.00646 9.99305 4.58L10.003 6H5.99702L6.00699 4.58C6.01802 3.00646 6.01483 3.03771 6.20246 2.65809C6.31793 2.42446 6.43799 2.26065 6.61818 2.09103C6.89043 1.83468 7.21371 1.65496 7.52352 1.58775C7.74977 1.53865 8.23518 1.53809 8.46436 1.58665ZM11.9201 7.0955C12.0975 7.17871 12.2992 7.37412 12.3874 7.54806C12.4231 7.61846 12.465 7.75796 12.4805 7.85803C12.4993 7.97978 12.5061 8.97962 12.501 10.88L12.4934 13.72L12.4082 13.8997C12.26 14.2127 12.0016 14.419 11.6821 14.4796C11.4864 14.5167 4.51364 14.5167 4.31793 14.4796C3.99843 14.419 3.74008 14.2127 3.59183 13.8997L3.50668 13.72L3.49905 10.88C3.49393 8.97728 3.50074 7.97987 3.51964 7.85778C3.57627 7.49218 3.79218 7.21543 4.12918 7.0765L4.28002 7.01431L8.02668 7.0205L11.7734 7.02665L11.9201 7.0955Z"),w(n,"fill","white"),w(r,"class","ButtonLock"),w(r,"xmlns","http://www.w3.org/2000/svg"),w(r,"width","16"),w(r,"height","16"),w(r,"viewBox","0 0 16 16"),w(r,"fill","none"),w(a,"class","ButtonAmount"),w(t,"class","PrimaryButton"),w(t,"type","submit")},m(e,f){p(e,t,f),h(t,r),h(r,n),h(t,o),h(t,i),h(t,s),h(t,a),h(a,l),h(a,c),h(a,u)},p(e,t){/*$_*/2097152&t[0]&&d!==(d=/*$_*/e[21]("makeDepositButton")+"")&&C(i,d),/*amount, $_*/2097154&t[0]&&v!==(v=/*amount*/(e[1]||/*$_*/e[21]("amountPlaceholder"))+"")&&C(l,v),/*currency*/32&t[0]&&C(u,/*currency*/e[5])},d(e){e&&f(t)}}}
|
729
|
+
// (444:8) {#if showRetryNotification}
|
730
|
+
function vo(e){let t,r,n;return{c(){t=m("cashier-notifications"),T(t,"text",r=/*$_*/e[21]("retryText")),T(t,"button",n=/*$_*/e[21]("retryButton"))},m(e,r){p(e,t,r)},p(e,o){/*$_*/2097152&o[0]&&r!==(r=/*$_*/e[21]("retryText"))&&T(t,"text",r),/*$_*/2097152&o[0]&&n!==(n=/*$_*/e[21]("retryButton"))&&T(t,"button",n)},d(e){e&&f(t)}}}
|
731
|
+
// (452:6) {#if showRedirectNotification}
|
732
|
+
function Eo(e){let t,r,n,o,i,s,l,c,u,d,y,v,T,_,B=/*$_*/e[21]("redirectTitle")+"",x=/*$_*/e[21]("redirectMessage")+"",A=/*$_*/e[21]("backToPayment")+"";return{c(){t=m("div"),r=m("img"),o=g(),i=m("span"),s=b(B),l=g(),c=m("span"),u=b(x),d=g(),y=m("div"),v=b(A),a(r.src,n="//static.everymatrix.com/mmstage/cashier/assets/redirect.png")||w(r,"src","//static.everymatrix.com/mmstage/cashier/assets/redirect.png"),w(r,"alt",""),w(i,"class","RedirectionTitle"),w(c,"class","RedirectionMessage"),w(y,"class","RedirectionClose"),w(t,"class","RedirectionNotification")},m(n,a){p(n,t,a),h(t,r),h(t,o),h(t,i),h(i,s),h(t,l),h(t,c),h(c,u),h(t,d),h(t,y),h(y,v),T||(_=E(y,"click",/*click_handler_4*/e[47]),T=!0)},p(e,t){/*$_*/2097152&t[0]&&B!==(B=/*$_*/e[21]("redirectTitle")+"")&&C(s,B),/*$_*/2097152&t[0]&&x!==(x=/*$_*/e[21]("redirectMessage")+"")&&C(u,x),/*$_*/2097152&t[0]&&A!==(A=/*$_*/e[21]("backToPayment")+"")&&C(v,A)},d(e){e&&f(t),T=!1,_()}}}
|
733
|
+
// (462:2) {#if redirectUrl && redirectMode === RedirectionModeStringEnum.Default}
|
734
|
+
function wo(e){let t,r;return{c(){t=m("div"),r=m("cashier-iframe-redirect"),T(r,"lang",/*lang*/e[3]),T(r,"translationurl",/*translationurl*/e[4]),T(r,"iframeurl",/*redirectUrl*/e[14]),w(t,"class","IframeRedirect")},m(e,n){p(e,t,n),h(t,r)},p(e,t){/*lang*/8&t[0]&&T(r,"lang",/*lang*/e[3]),/*translationurl*/16&t[0]&&T(r,"translationurl",/*translationurl*/e[4]),/*redirectUrl*/16384&t[0]&&T(r,"iframeurl",/*redirectUrl*/e[14])},d(e){e&&f(t)}}}
|
735
|
+
// (471:2) {#if showConfirmModal}
|
736
|
+
function To(e){let t,r,n,o,i,s,a,l,c,u,d,y=/*$_*/e[21]("confirmDepositText")+"",v=/*$_*/e[21]("confirmDepositButton")+"";return{c(){t=m("cashier-confirm-modal"),r=m("span"),n=b(y),o=g(),i=b(/*amount*/e[1]),s=g(),a=b(/*currency*/e[5]),l=b(" ?"),c=g(),u=m("div"),d=b(v),w(r,"slot","text"),w(u,"slot","confirm")},m(e,f){p(e,t,f),h(t,r),h(r,n),h(r,o),h(r,i),h(r,s),h(r,a),h(r,l),h(t,c),h(t,u),h(u,d)},p(e,t){/*$_*/2097152&t[0]&&y!==(y=/*$_*/e[21]("confirmDepositText")+"")&&C(n,y),/*amount*/2&t[0]&&C(i,/*amount*/e[1]),/*currency*/32&t[0]&&C(a,/*currency*/e[5]),/*$_*/2097152&t[0]&&v!==(v=/*$_*/e[21]("confirmDepositButton")+"")&&C(d,v)},d(e){e&&f(t)}}}function _o(t){let r,n,o,i,s,l,c,u;$(/*onwindowresize*/t[34]);let d=/*isTranslationLoaded*/t[19]&&/*selectedPaymentMethod*/t[10].Name&&qn(t),y=/*redirectUrl*/t[14]&&/*redirectMode*/t[16]===/*RedirectionModeStringEnum*/t[2].Default&&wo(t),b=/*showConfirmModal*/t[13]&&To(t);return{c(){r=m("script"),o=g(),i=m("div"),d&&d.c(),s=g(),y&&y.c(),l=g(),b&&b.c(),this.c=e,a(r.src,n=Co)||w(r,"src",n),w(i,"class","CashierMethodDetails")},m(e,n){h(zn.head,r),p(e,o,n),p(e,i,n),d&&d.m(i,null),h(i,s),y&&y.m(i,null),h(i,l),b&&b.m(i,null)
|
737
|
+
/*div_binding*/,t[48](i),c||(u=E(Xn,"resize",/*onwindowresize*/t[34]),c=!0)},p(e,t){/*isTranslationLoaded*/e[19]&&/*selectedPaymentMethod*/e[10].Name?d?d.p(e,t):(d=qn(e),d.c(),d.m(i,s)):d&&(d.d(1),d=null),/*redirectUrl*/e[14]&&/*redirectMode*/e[16]===/*RedirectionModeStringEnum*/e[2].Default?y?y.p(e,t):(y=wo(e),y.c(),y.m(i,l)):y&&(y.d(1),y=null),/*showConfirmModal*/e[13]?b?b.p(e,t):(b=To(e),b.c(),b.m(i,null)):b&&(b.d(1),b=null)},i:e,o:e,d(e){f(r),e&&f(o),e&&f(i),d&&d.d(),y&&y.d(),b&&b.d()
|
738
|
+
/*div_binding*/,t[48](null),c=!1,u()}}}let Co="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js";function Bo(e,t,r){let n;c(e,Rn,(e=>r(21,n=e)));class o{constructor(e){this.correlationFieldName=e.CorrelationFieldName||null,this.correlationFieldValue=e.CorrelationFieldValue&&e.CorrelationFieldValue.length>0?e.CorrelationFieldValue.split(","):[],this.name=e.Name||null,this.label=e.Label||null,this.description=e.Description||null,this.type=e.Type||null,this.defaultValue=this.calcDefaultValue(e),this.format=e.Format||null,this.placeholder=e.Placeholder||null,this.isReadonly=e.IsReadonly||!1,this.isRequired=e.IsRequired||!1,this.maxValue=e.MaxValue||null,this.minValue=e.MinValue||null,this.isPrimaryField=e.IsPrimaryField||!1,this.demandUserInput=e.DemandUserInput||!1,this.autoTrim=e.AutoTrim||!1,this.autoUppercase=e.AutoUppercase||!1,this.notEqualToFieldName=e.NotEqualToFieldName||null,this.values=e.Values,this.useCopyButton=e.UseCopyButton||!1,this.inputMask=e.InputMask,this.tags=e.Tags||null}calcDefaultValue(e){return 2===this.type?"True"===e.DefaultValue:e.DefaultValue||null}get descriptionWithLink(){if("Boolean"===i[this.type]&&this.placeholder||"Link"===i[this.type]){const e=/{link}/i,t=`<a href="${this.placeholder||this.defaultValue}" target="_blank" rel="noopener noreferrer">${this.label}</a>`;return this.description.match(e)?this.description.replace(e,t):`${this.description} ${t}`}return this.description}}let{FieldTypes:i}=t;!function(e){e.Unknown="Unknown",e.Text="Text",e.Boolean="Boolean",e.Number="Number",e.Money="Money",e.DateTime="DateTime",e.Lookup="Lookup",e.IpAddress="IpAddress",e.Date="Date",e.Time="Time",e.LookupCollection="LookupCollection",e.Hidden="Hidden",e.Label="Label",e.Password="Password",e.Link="Link",e.Image="Image",e.Html="Html",e.QRCode="QR"}(i||(i={}));let s,{endpoint:a}=t,{session:l}=t,{lang:u}=t,{translationurl:h}=t,{customerid:p}=t,{currency:f}=t,{amount:d}=t,{selectedpaymentmethodname:m}=t,{clientstyling:y=""}=t,{clientstylingurl:b=""}=t,{RedirectionModeStringEnum:g}=t;!function(e){e.Default="Default",e.RedirectWithRetry="Redirect"}(g||(g={}));let v,E,w,T,C,B,x,A,L,H,P,M={},R=[],N={},k=!1,I=[],$=!1,D=window.navigator.userAgent,U=window.matchMedia("(max-width: 750px)");const F=()=>{var e;e=u,dn.set(e)};Object.keys(kn).forEach((e=>{Nn(e,kn[e])}));var G;G=()=>(window.addEventListener("closeModal",q,!1),window.addEventListener("confirmModal",Z,!1),window.addEventListener("closeIframe",K,!1),window.addEventListener("notificationButtonClick",Y,!1),document.addEventListener("click",j),()=>{window.removeEventListener("closeModal",q),window.removeEventListener("confirmModal",Z),window.removeEventListener("closeIframe",K),window.removeEventListener("notificationButtonClick",Y)}),S().$$.on_mount.push(G);const j=e=>{e.composedPath().includes(H)||r(20,L=null)},V=(e,t)=>{t!==L?(H=e.composedPath()[0],r(20,L=t)):r(20,L=null)},z=()=>{dispatchEvent(new CustomEvent("backToMethodList",{bubbles:!0,cancelable:!0,composed:!0})),X()},X=()=>{dispatchEvent(new CustomEvent("hidePaymentDetails",{detail:{hideMethodDetails:$},bubbles:!0,cancelable:!0,composed:!0}))},W=()=>{dispatchEvent(new CustomEvent("hideMethodsList",{detail:{hideMethodsList:$},bubbles:!0,cancelable:!0,composed:!0}))},K=()=>{r(14,E=null)},q=()=>{r(13,k=!1)},Z=()=>{r(18,x=!0);const e=new URL(`${a}/v1/player/${p}/payment/GetPaymentConfirm`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json");const n={method:"POST",mode:"cors",headers:t,body:JSON.stringify({XPaymentSessionToken:s})};fetch(e,n).then((e=>e.json())).then((e=>{s=e.XPaymentSessionToken,r(14,E=e.RedirectUrl),r(16,C=e.RedirectionMode),r(18,x=!1),e.RedirectionMode===g.RedirectWithRetry&&(w=window.open(e.RedirectUrl,"_blank"),r(15,T=!!w),w||r(17,B=!0))}))},Y=()=>{w=window.open(E,"_blank"),r(15,T=!0),r(17,B=!1)},Q=e=>{e&&window.postMessage({type:"NavigateTo",path:e,target:"_blank",externalLink:!1},window.location.href)};return e.$$set=e=>{"FieldTypes"in e&&r(0,i=e.FieldTypes),"endpoint"in e&&r(28,a=e.endpoint),"session"in e&&r(29,l=e.session),"lang"in e&&r(3,u=e.lang),"translationurl"in e&&r(4,h=e.translationurl),"customerid"in e&&r(30,p=e.customerid),"currency"in e&&r(5,f=e.currency),"amount"in e&&r(1,d=e.amount),"selectedpaymentmethodname"in e&&r(31,m=e.selectedpaymentmethodname),"clientstyling"in e&&r(32,y=e.clientstyling),"clientstylingurl"in e&&r(33,b=e.clientstylingurl),"RedirectionModeStringEnum"in e&&r(2,g=e.RedirectionModeStringEnum)},e.$$.update=()=>{/*endpoint, session, currency*/805306400&e.$$.dirty[0]|/*selectedpaymentmethodname*/1&e.$$.dirty[1]&&a&&l&&m&&f&&(()=>{const e=new URL(`${a}/v1/player/${p}/payment/GetPaymentMethod`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json");const n={method:"POST",mode:"cors",headers:t,body:JSON.stringify({PaymentMethodName:m,Currency:f,XPaymentSessionToken:l})};fetch(e,n).then((e=>e.json())).then((e=>{s=e.XPaymentSessionToken,r(10,M=e.PaymentMethod),r(11,R=M.Fields&&M.Fields.map((e=>new o(e)))),r(12,N={}),W()}))})(),/*customStylingContainer*/64&e.$$.dirty[0]|/*clientstyling*/2&e.$$.dirty[1]&&y&&v&&(()=>{let e=document.createElement("style");e.innerHTML=y,v.appendChild(e)})(),/*customStylingContainer*/64&e.$$.dirty[0]|/*clientstylingurl*/4&e.$$.dirty[1]&&b&&v&&(()=>{let e=new URL(b),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{v.appendChild(t)}),1),setTimeout((()=>{}),500)}))})(),/*lang*/8&e.$$.dirty[0]&&u&&F(),/*lang, translationurl*/24&e.$$.dirty[0]&&u&&h&&(()=>{if(h)fetch(h).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{Nn(t,e[t]),r(19,A=!0)}))})).catch((e=>{r(19,A=!0)}))})(),/*qrCodeContainer*/128&e.$$.dirty[0]|/*selectedpaymentmethodname*/1&e.$$.dirty[1]&&m&&I.length&&I.forEach((e=>{if(e&&e.innerText){const t=e.innerText;e.innerText="",new QRCode(e,{text:t,width:250,height:250})}})),/*innerWidth*/512&e.$$.dirty[0]&&P&&r(8,$=(e=>!!(e.toLowerCase().match(/android/i)||e.toLowerCase().match(/blackberry|bb/i)||e.toLowerCase().match(/iphone|ipad|ipod/i)||e.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)))(D)||U.matches),/*mobileView*/256&e.$$.dirty[0]&&$.toString()&&W()},[i,d,g,u,h,f,v,I,$,P,M,R,N,k,E,T,C,B,x,A,L,n,V,()=>{r(18,x=!0);const e=new URL(`${a}/v1/player/${p}/payment/GetPaymentPrepare`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json");const n={method:"POST",mode:"cors",headers:t,body:JSON.stringify({XPaymentSessionToken:s,Transaction:{PaymentMethod:M.Name,Amount:d,Currency:f,CustomFields:N},Account:{}})};fetch(e,n).then((e=>e.json())).then((e=>{s=e.XPaymentSessionToken,r(18,x=!1),r(13,k=!0)}))},z,Q,e=>!e.correlationFieldName||e.correlationFieldName&&N[e.correlationFieldName]===e.correlationFieldValue,o,a,l,p,m,y,b,function(){r(9,P=Xn.innerWidth)},()=>z(),function(){d=_(this.value),r(1,d)},function(e){N[e.name]=this.value,r(12,N)},function(e){N[e.name]=_(this.value),r(12,N)},function(e){N[e.name]=this.value,r(12,N)},function(e){N[e.name]=this.value,r(12,N)},(e,t)=>V(t,e),(e,t)=>{r(12,N[e.name]=t.name,N),r(11,R)},function(e){N[e.name]=this.value,r(12,N)},function(e){O[e?"unshift":"push"]((()=>{I[I.length]=e,r(7,I)}))},e=>{Q(e.description)},function(e){N[e.name]=this.value,r(12,N)},()=>{r(15,T=!1)},function(e){O[e?"unshift":"push"]((()=>{v=e,r(6,v)}))}]}class xo extends W{constructor(e){super();const t=document.createElement("style");t.textContent='@keyframes loading-spinner{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.MethodsDetails{position:relative;display:flex;flex-direction:column;gap:5px}.MethodsDetails:has(.RedirectionNotification) form{visibility:hidden}.form-logo{align-items:center;display:flex;height:50px;border-bottom:1px solid var(--emw--color-gray-100, #E8E9EB)}.form-logo .SelectedLogoDescription{color:var(--emw--color-black, #111);font-size:var(--emw--font-size-small, 14px);margin:7px 5px 7px 7px;word-break:break-word}.form-logo .SelectedLogoWrapper{width:56px;height:32px;flex-shrink:0;background:var(--emw--color-background, #FFF);border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-large, 6px)}.form-logo .SelectedLogoWrapper img{max-height:32px;max-width:56px}.form-logo .ChangePaymeth{margin-left:auto;cursor:pointer;color:var(--emw--color-black, #111);font-size:var(--emw--font-size-small, 14px);text-decoration-line:underline}.RedirectionNotification{height:100%;width:inherit;position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px}.RedirectionNotification .RedirectionClose{display:flex;width:234px;height:36px;flex-direction:column;justify-content:center;flex-shrink:0;color:var(--emw--color-white, #FFF);cursor:pointer;text-align:center;font-size:var(--emw--font-size-x-small, 12px);font-style:normal;font-weight:500;line-height:normal;text-transform:uppercase;border-radius:4px;background:var(--emw--color-primary, #7EC51E)}.RedirectionNotification .RedirectionTitle{color:var(--emw--color-black, #111);font-size:var(--emw--font-size-x-small, 12px);font-style:normal;text-transform:none;font-weight:var(--emw--font-weight-bold, 600)}.RedirectionNotification .RedirectionMessage{color:var(--emw--color-gray-300, #666);font-size:var(--emw--font-size-x-small, 12px);font-style:normal;text-transform:none}cashier-iframe-redirect{height:inherit;width:inherit}.IframeRedirect{display:flex;position:absolute;align-items:center;justify-content:center;width:100%;height:100%;z-index:100;top:0;left:0;background-color:var(--emw--color-gray-transparency-20, rgba(0, 0, 0, 0.2))}.FieldWrapper,label{display:flex;flex-direction:column}.FieldWrapper{background-color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));border-radius:6px;box-shadow:0 2px 6px 0 rgba(0, 0, 0, 0.1);padding:0 15px 15px;margin-bottom:10px}.FieldWrapper:has(.QRCode, .Label){box-shadow:none;background:transparent}.FieldWrapper.Hidden{height:0;visibility:hidden;margin:0;padding:0}.AmountLimits{color:var(--emw--color-gray-300, #666);font-size:var(--emw--font-size-x-small, 12px);margin:5px 0 0 2px;line-height:var(--emw--font-size-x-small, 12px)}input,.Selected{border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-medium, 4px);height:40px;line-height:var(--emw--size-small, 14px);color:var(--emw--color-black, #111);padding:0 15px}input:focus,.Selected:focus{outline:none}label{color:var(--emw--color-black, #111);font-size:var(--emw--size-small, 14px);margin-top:7px;line-height:27px}label span.Required:before{content:"*";display:inline-block;margin-right:2px}.Description{color:var(--emw--color-gray-300, #666);font-size:var(--emw--font-size-x-small, 12px);margin:0 0 5px 2px;line-height:var(--emw--font-size-x-small, 12px)}.PrimaryButton{color:var(--emw--color-white, #FFF);text-align:center;font-size:var(--emw--font-size-small, 14px);font-style:normal;font-weight:400;height:46px;border-radius:50px;line-height:normal;border:none;background:var(--emw--color-primary, #7EC51E);width:100%;margin:12px 0;cursor:pointer;text-transform:uppercase}.PrimaryButton .ButtonSpinner{animation:loading-spinner 1s linear infinite}.QRCode{width:250px;margin:auto}.Checkbox{display:flex;position:relative;margin-top:12px}.Checkbox .Description{margin:0 0 0 20px;cursor:pointer;line-height:var(--emw--font-size-medium, 16px)}.Checkbox .Checkmark{position:absolute;top:2px;left:0;height:12px;width:12px;border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-medium, 4px);background-color:var(--emw--color-white, #FFF);cursor:pointer}.Checkbox .Checkmark:after{content:"";position:absolute;display:none}.Checkbox .Checkmark:after{left:4px;top:0;width:2px;height:8px;border:solid var(--emw--color-white, #FFF);border-width:0 2px 2px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.Checkbox input{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.Checkbox input:checked~.Checkmark{background-color:var(--emw--color-primary, #7EC51E);border-color:var(--emw--color-primary, #7EC51E)}.Checkbox input:checked~.Checkmark:after{display:block}.CustomSelect{width:100%;position:relative}.Selected{display:flex;align-items:center;cursor:pointer}.Selected:after{position:absolute;content:"";top:19px;right:10px;width:0;height:0;border:6px solid transparent;border-color:rgb(168, 169, 170) transparent transparent transparent}.OptionList{display:none;position:absolute;top:100%;left:0;right:0;z-index:99;background-color:white;border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-medium, 4px);margin-top:5px}.OptionList div{padding:8px 16px;cursor:pointer;user-select:none}.OptionList div:hover{background-color:var(--emw--color-background-secondary, #F9F9F9)}.OptionList.Opened{display:block}',this.shadowRoot.appendChild(t),X(this,{target:this.shadowRoot,props:A(this.attributes),customElement:!0},Bo,_o,i,{PaymentMethodDetails:27,FieldTypes:0,endpoint:28,session:29,lang:3,translationurl:4,customerid:30,currency:5,amount:1,selectedpaymentmethodname:31,clientstyling:32,clientstylingurl:33,RedirectionModeStringEnum:2},null,[-1,-1,-1]),e&&(e.target&&p(e.target,this,e.anchor),e.props&&(this.$set(e.props),F()))}static get observedAttributes(){return["PaymentMethodDetails","FieldTypes","endpoint","session","lang","translationurl","customerid","currency","amount","selectedpaymentmethodname","clientstyling","clientstylingurl","RedirectionModeStringEnum"]}get PaymentMethodDetails(){return this.$$.ctx[27]}get FieldTypes(){return this.$$.ctx[0]}set FieldTypes(e){this.$$set({FieldTypes:e}),F()}get endpoint(){return this.$$.ctx[28]}set endpoint(e){this.$$set({endpoint:e}),F()}get session(){return this.$$.ctx[29]}set session(e){this.$$set({session:e}),F()}get lang(){return this.$$.ctx[3]}set lang(e){this.$$set({lang:e}),F()}get translationurl(){return this.$$.ctx[4]}set translationurl(e){this.$$set({translationurl:e}),F()}get customerid(){return this.$$.ctx[30]}set customerid(e){this.$$set({customerid:e}),F()}get currency(){return this.$$.ctx[5]}set currency(e){this.$$set({currency:e}),F()}get amount(){return this.$$.ctx[1]}set amount(e){this.$$set({amount:e}),F()}get selectedpaymentmethodname(){return this.$$.ctx[31]}set selectedpaymentmethodname(e){this.$$set({selectedpaymentmethodname:e}),F()}get clientstyling(){return this.$$.ctx[32]}set clientstyling(e){this.$$set({clientstyling:e}),F()}get clientstylingurl(){return this.$$.ctx[33]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),F()}get RedirectionModeStringEnum(){return this.$$.ctx[2]}set RedirectionModeStringEnum(e){this.$$set({RedirectionModeStringEnum:e}),F()}}return!customElements.get("cashier-method-details")&&customElements.define("cashier-method-details",xo),xo}));
|
672
739
|
//# sourceMappingURL=cashier-method-details.js.map
|