@everymatrix/general-navigation-bar 1.29.6 → 1.29.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/general-navigation-bar.js +179 -167
- package/dist/general-navigation-bar.js.map +1 -1
- package/index.html +9 -2
- package/package.json +2 -2
- package/src/GeneralNavigationBar.svelte +265 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).app=e()}(this,(function(){"use strict";function t(){}function e(t){return t()}function
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).app=e()}(this,(function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function r(t){t.forEach(e)}function i(t){return"function"==typeof t}function o(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}let a,s;function c(t,e){return a||(a=document.createElement("a")),a.href=e,t===a.href}function l(e,...n){if(null==e)return t;const r=e.subscribe(...n);return r.unsubscribe?()=>r.unsubscribe():r}function h(t,e){t.appendChild(e)}function u(t,e,n){t.insertBefore(e,n||null)}function f(t){t.parentNode&&t.parentNode.removeChild(t)}function p(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function d(t){return document.createElement(t)}function m(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function g(t){return document.createTextNode(t)}function y(){return g(" ")}function v(){return g("")}function b(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function E(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function w(t,e){e=""+e,t.data!==e&&(t.data=e)}function _(t){const e={};for(const n of t)e[n.name]=n.value;return e}function N(t){s=t}
|
|
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;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* https://svelte.dev/docs#run-time-svelte-onmount
|
|
10
10
|
*/
|
|
11
|
-
function T(t){(function(){if(!s)throw new Error("Function called outside component initialization");return s})().$$.on_mount.push(t)}const A=[],B=[];let
|
|
11
|
+
function T(t){(function(){if(!s)throw new Error("Function called outside component initialization");return s})().$$.on_mount.push(t)}const A=[],B=[];let I=[];const S=[],P=Promise.resolve();let H=!1;function L(t){I.push(t)}
|
|
12
12
|
// flush() calls callbacks in this order:
|
|
13
13
|
// 1. All beforeUpdate callbacks, in order: parents before children
|
|
14
14
|
// 2. All bind:this callbacks, in reverse order: children before parents.
|
|
@@ -27,61 +27,61 @@ function T(t){(function(){if(!s)throw new Error("Function called outside compone
|
|
|
27
27
|
// 3. During afterUpdate, any updated components will NOT have their afterUpdate
|
|
28
28
|
// callback called a second time; the seen_callbacks set, outside the flush()
|
|
29
29
|
// function, guarantees this behavior.
|
|
30
|
-
const O=new Set;let
|
|
30
|
+
const O=new Set;let x=0;// Do *not* move this inside the flush() function
|
|
31
31
|
function C(){
|
|
32
32
|
// Do not reenter flush while dirty components are updated, as this can
|
|
33
33
|
// result in an infinite loop. Instead, let the inner flush handle it.
|
|
34
34
|
// Reentrancy is ok afterwards for bindings etc.
|
|
35
|
-
if(0!==
|
|
35
|
+
if(0!==x)return;const t=s;do{
|
|
36
36
|
// first, call beforeUpdate functions
|
|
37
37
|
// and update components
|
|
38
|
-
try{for(;
|
|
38
|
+
try{for(;x<A.length;){const t=A[x];x++,N(t),M(t.$$)}}catch(t){
|
|
39
39
|
// reset dirty state to not end up in a deadlocked state and then rethrow
|
|
40
|
-
throw A.length=0,
|
|
40
|
+
throw A.length=0,x=0,t}for(N(null),A.length=0,x=0;B.length;)B.pop()();
|
|
41
41
|
// then, once components are updated, call
|
|
42
42
|
// afterUpdate functions. This may cause
|
|
43
43
|
// subsequent updates...
|
|
44
|
-
for(let t=0;t<
|
|
44
|
+
for(let t=0;t<I.length;t+=1){const e=I[t];O.has(e)||(
|
|
45
45
|
// ...so guard against infinite loops
|
|
46
|
-
O.add(e),e())}
|
|
46
|
+
O.add(e),e())}I.length=0}while(A.length);for(;S.length;)S.pop()();H=!1,O.clear(),N(t)}function M(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(L)}}
|
|
47
47
|
/**
|
|
48
48
|
* Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.
|
|
49
|
-
*/const
|
|
49
|
+
*/const R=new Set;function U(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];I.forEach((r=>-1===t.indexOf(r)?e.push(r):n.push(r))),n.forEach((t=>t())),I=e}(n.after_update),r(n.on_destroy),n.fragment&&n.fragment.d(e),
|
|
50
50
|
// TODO null out other refs, including component.$$ (but need to
|
|
51
51
|
// preserve final state?)
|
|
52
|
-
|
|
52
|
+
n.on_destroy=n.fragment=null,n.ctx=[])}function F(t,e){-1===t.$$.dirty[0]&&(A.push(t),H||(H=!0,P.then(C)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function D(o,a,c,l,h,u,p,d=[-1]){const m=s;N(o);const g=o.$$={fragment:null,ctx:[],
|
|
53
53
|
// state
|
|
54
|
-
props:
|
|
54
|
+
props:u,update:t,not_equal:h,bound:n(),
|
|
55
55
|
// lifecycle
|
|
56
56
|
on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a.context||(m?m.$$.context:[])),
|
|
57
57
|
// everything else
|
|
58
|
-
callbacks:
|
|
58
|
+
callbacks:n(),dirty:d,skip_bound:!1,root:a.target||m.$$.root};p&&p(g.root);let y=!1;if(g.ctx=c?c(o,a.props||{},((t,e,...n)=>{const r=n.length?n[0]:e;return g.ctx&&h(g.ctx[t],g.ctx[t]=r)&&(!g.skip_bound&&g.bound[t]&&g.bound[t](r),y&&F(o,t)),e})):[],g.update(),y=!0,r(g.before_update),
|
|
59
59
|
// `false` as a special case of no DOM component
|
|
60
60
|
g.fragment=!!l&&l(g.ctx),a.target){if(a.hydrate){const t=function(t){return Array.from(t.childNodes)}(a.target);
|
|
61
61
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
62
62
|
g.fragment&&g.fragment.l(t),t.forEach(f)}else
|
|
63
63
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
64
|
-
g.fragment&&g.fragment.c();a.intro&&((
|
|
64
|
+
g.fragment&&g.fragment.c();a.intro&&((v=o.$$.fragment)&&v.i&&(R.delete(v),v.i(b))),function(t,n,o,a){const{fragment:s,after_update:c}=t.$$;s&&s.m(n,o),a||
|
|
65
65
|
// onMount happens before the initial afterUpdate
|
|
66
|
-
|
|
66
|
+
L((()=>{const n=t.$$.on_mount.map(e).filter(i);
|
|
67
67
|
// if the component was destroyed immediately
|
|
68
68
|
// it will update the `$$.on_destroy` reference to `null`.
|
|
69
69
|
// the destructured on_destroy may still reference to the old array
|
|
70
|
-
t.$$.on_destroy?t.$$.on_destroy.push(...
|
|
70
|
+
t.$$.on_destroy?t.$$.on_destroy.push(...n):
|
|
71
71
|
// Edge case - component was destroyed immediately,
|
|
72
72
|
// most likely as a result of a binding initialising
|
|
73
|
-
n
|
|
73
|
+
r(n),t.$$.on_mount=[]})),c.forEach(L)}(o,a.target,a.anchor,a.customElement),C()}var v,b;N(m)}let k;"function"==typeof HTMLElement&&(k=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(i);
|
|
74
74
|
// @ts-ignore todo: improve typings
|
|
75
75
|
for(const t in this.$$.slotted)
|
|
76
76
|
// @ts-ignore todo: improve typings
|
|
77
|
-
this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,
|
|
77
|
+
this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){r(this.$$.on_disconnect)}$destroy(){U(this,1),this.$destroy=t}$on(e,n){
|
|
78
78
|
// TODO should this delegate to addEventListener?
|
|
79
|
-
if(!i(
|
|
79
|
+
if(!i(n))return t;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const t=r.indexOf(n);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}})
|
|
80
80
|
/* eslint-disable no-prototype-builtins */;var G="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||
|
|
81
81
|
// eslint-disable-next-line no-undef
|
|
82
|
-
"undefined"!=typeof global&&global||{}
|
|
82
|
+
"undefined"!=typeof global&&global||{},$="URLSearchParams"in G,j="Symbol"in G&&"iterator"in Symbol,W="FileReader"in G&&"Blob"in G&&function(){try{return new Blob,!0}catch(t){return!1}}(),V="FormData"in G,X="ArrayBuffer"in G;if(X)var z=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],K=ArrayBuffer.isView||function(t){return t&&z.indexOf(Object.prototype.toString.call(t))>-1};function Y(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function Z(t){return"string"!=typeof t&&(t=String(t)),t}
|
|
83
83
|
// Build a destructive iterator for the value list
|
|
84
|
-
function
|
|
84
|
+
function q(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return j&&(e[Symbol.iterator]=function(){return e}),e}function J(t){this.map={},t instanceof J?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function Q(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function tt(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function et(t){var e=new FileReader,n=tt(e);return e.readAsArrayBuffer(t),n}function nt(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function rt(){return this.bodyUsed=!1,this._initBody=function(t){var e;
|
|
85
85
|
/*
|
|
86
86
|
fetch-mock wraps the Response object in an ES6 Proxy to
|
|
87
87
|
provide useful test harness features such as flush. However, on
|
|
@@ -93,24 +93,24 @@ function Z(t){var e={next:function(){var e=t.shift();return{done:void 0===e,valu
|
|
|
93
93
|
_initBody is called.
|
|
94
94
|
*/
|
|
95
95
|
// eslint-disable-next-line no-self-assign
|
|
96
|
-
this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:
|
|
96
|
+
this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:W&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:V&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:$&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():X&&W&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=nt(t.buffer),
|
|
97
97
|
// IE 10-11 can't handle a DataView body.
|
|
98
|
-
this._bodyInit=new Blob([this._bodyArrayBuffer])):
|
|
98
|
+
this._bodyInit=new Blob([this._bodyArrayBuffer])):X&&(ArrayBuffer.prototype.isPrototypeOf(t)||K(t))?this._bodyArrayBuffer=nt(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):$&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},W&&(this.blob=function(){var t=Q(this);if(t)return t;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 t=Q(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(W)return this.blob().then(et);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t,e,n,r,i,o=Q(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,n=tt(e),r=/charset=([A-Za-z0-9_-]+)/.exec(t.type),i=r?r[1]:"utf-8",e.readAsText(t,i),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},V&&(this.formData=function(){return this.text().then(at)}),this.json=function(){return this.text().then(JSON.parse)},this}
|
|
99
99
|
// HTTP methods whose capitalization should be normalized
|
|
100
|
-
|
|
100
|
+
J.prototype.append=function(t,e){t=Y(t),e=Z(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},J.prototype.delete=function(t){delete this.map[Y(t)]},J.prototype.get=function(t){return t=Y(t),this.has(t)?this.map[t]:null},J.prototype.has=function(t){return this.map.hasOwnProperty(Y(t))},J.prototype.set=function(t,e){this.map[Y(t)]=Z(e)},J.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},J.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),q(t)},J.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),q(t)},J.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),q(t)},j&&(J.prototype[Symbol.iterator]=J.prototype.entries);var it=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function ot(t,e){if(!(this instanceof ot))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,i=(e=e||{}).body;if(t instanceof ot){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new J(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new J(e.headers)),this.method=(n=e.method||this.method||"GET",r=n.toUpperCase(),it.indexOf(r)>-1?r:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in G)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){
|
|
101
101
|
// Search for a '_' parameter in the query string
|
|
102
102
|
var o=/([?&])_=[^&]*/;if(o.test(this.url))
|
|
103
103
|
// If it already exists then set the value with the current time
|
|
104
|
-
this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function
|
|
104
|
+
this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function at(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}})),e}function st(t,e){if(!(this instanceof st))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.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===e.statusText?"":""+e.statusText,this.headers=new J(e.headers),this.url=e.url||"",this._initBody(t)}ot.prototype.clone=function(){return new ot(this,{body:this._bodyInit})},rt.call(ot.prototype),rt.call(st.prototype),st.prototype.clone=function(){return new st(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new J(this.headers),url:this.url})},st.error=function(){var t=new st(null,{status:200,statusText:""});return t.status=0,t.type="error",t};var ct=[301,302,303,307,308];st.redirect=function(t,e){if(-1===ct.indexOf(e))throw new RangeError("Invalid status code");return new st(null,{status:e,headers:{location:t}})};var lt=G.DOMException;try{new lt}catch(t){(lt=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack}).prototype=Object.create(Error.prototype),lt.prototype.constructor=lt}function ht(t,e){return new Promise((function(n,r){var i=new ot(t,e);if(i.signal&&i.signal.aborted)return r(new lt("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}if(o.onload=function(){var t,e,r={statusText:o.statusText,headers:(t=o.getAllResponseHeaders()||"",e=new J,
|
|
105
105
|
// Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill
|
|
106
106
|
// https://github.com/github/fetch/issues/748
|
|
107
107
|
// https://github.com/zloirock/core-js/issues/751
|
|
108
|
-
t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var
|
|
108
|
+
t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();try{e.append(r,i)}catch(t){console.warn("Response "+t.message)}}})),e)};
|
|
109
109
|
// This check if specifically for when a user fetches a file locally from the file system
|
|
110
110
|
// Only if the status is out of a normal range
|
|
111
|
-
i.url.startsWith("file://")&&(o.status<200||o.status>599)?
|
|
111
|
+
i.url.startsWith("file://")&&(o.status<200||o.status>599)?r.status=200:r.status=o.status,r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var a="response"in o?o.response:o.responseText;setTimeout((function(){n(new st(a,r))}),0)},o.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},o.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request timed out"))}),0)},o.onabort=function(){setTimeout((function(){r(new lt("Aborted","AbortError"))}),0)},o.open(i.method,function(t){try{return""===t&&G.location.href?G.location.href:t}catch(e){return t}}(i.url),!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&(W?o.responseType="blob":X&&(o.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof J||G.Headers&&e.headers instanceof G.Headers)){var s=[];Object.getOwnPropertyNames(e.headers).forEach((function(t){s.push(Y(t)),o.setRequestHeader(t,Z(e.headers[t]))})),i.headers.forEach((function(t,e){-1===s.indexOf(e)&&o.setRequestHeader(e,t)}))}else i.headers.forEach((function(t,e){o.setRequestHeader(e,t)}));i.signal&&(i.signal.addEventListener("abort",a),o.onreadystatechange=function(){
|
|
112
112
|
// DONE (success or failure)
|
|
113
|
-
4===o.readyState&&i.signal.removeEventListener("abort",a)}),o.send(void 0===i._bodyInit?null:i._bodyInit)}))}
|
|
113
|
+
4===o.readyState&&i.signal.removeEventListener("abort",a)}),o.send(void 0===i._bodyInit?null:i._bodyInit)}))}ht.polyfill=!0,G.fetch||(G.fetch=ht,G.Headers=J,G.Request=ot,G.Response=st),
|
|
114
114
|
// the whatwg-fetch polyfill installs the fetch() function
|
|
115
115
|
// on the global object (window or self)
|
|
116
116
|
// Return that as the export for use in Webpack, Browserify etc.
|
|
@@ -130,7 +130,7 @@ self.fetch.bind(self);
|
|
|
130
130
|
PERFORMANCE OF THIS SOFTWARE.
|
|
131
131
|
***************************************************************************** */
|
|
132
132
|
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
133
|
-
var ut=function(t,e){return ut=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},ut(t,e)};function ht(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}ut(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function ft(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function pt(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function dt(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}function mt(t){return"function"==typeof t}function gt(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}"function"==typeof SuppressedError&&SuppressedError;var yt=gt((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function bt(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var vt=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var t,e,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=ft(o),s=a.next();!s.done;s=a.next()){s.value.remove(this)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var c=this.initialTeardown;if(mt(c))try{c()}catch(t){i=t instanceof yt?t.errors:[t]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=ft(l),h=u.next();!h.done;h=u.next()){var f=h.value;try{_t(f)}catch(t){i=null!=i?i:[],t instanceof yt?i=dt(dt([],pt(i)),pt(t.errors)):i.push(t)}}}catch(t){r={error:t}}finally{try{h&&!h.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}}if(i)throw new yt(i)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)_t(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&bt(e,t)},t.prototype.remove=function(e){var r=this._finalizers;r&&bt(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Et=vt.EMPTY;function wt(t){return t instanceof vt||t&&"closed"in t&&mt(t.remove)&&mt(t.add)&&mt(t.unsubscribe)}function _t(t){mt(t)?t():t.unsubscribe()}var Tt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},At={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=At.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,dt([t,e],pt(r))):setTimeout.apply(void 0,dt([t,e],pt(r)))},clearTimeout:function(t){var e=At.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Bt(){}var Nt=null;function St(t){if(Tt.useDeprecatedSynchronousErrorHandling){var e=!Nt;if(e&&(Nt={errorThrown:!1,error:null}),t(),e){var r=Nt,n=r.errorThrown,i=r.error;if(Nt=null,n)throw i}}else t()}var Ht=function(t){function e(e){var r=t.call(this)||this;return r.isStopped=!1,e?(r.destination=e,wt(e)&&e.add(r)):r.destination=xt,r}return ht(e,t),e.create=function(t,e,r){return new Lt(t,e,r)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(vt),Pt=Function.prototype.bind;function It(t,e){return Pt.call(t,e)}var Ot=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){Ct(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){Ct(t)}else Ct(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){Ct(t)}},t}(),Lt=function(t){function e(e,r,n){var i,o,a=t.call(this)||this;mt(e)||!e?i={next:null!=e?e:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:a&&Tt.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return a.unsubscribe()},i={next:e.next&&It(e.next,o),error:e.error&&It(e.error,o),complete:e.complete&&It(e.complete,o)}):i=e;return a.destination=new Ot(i),a}return ht(e,t),e}(Ht);function Ct(t){var e;e=t,At.setTimeout((function(){throw e}))}var xt={closed:!0,next:Bt,error:function(t){throw t},complete:Bt},Mt="function"==typeof Symbol&&Symbol.observable||"@@observable";function Rt(t){return t}var Ut=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n,i=this,o=(n=t)&&n instanceof Ht||function(t){return t&&mt(t.next)&&mt(t.error)&&mt(t.complete)}(n)&&wt(n)?t:new Lt(t,e,r);return St((function(){var t=i,e=t.operator,r=t.source;o.add(e?e.call(o,r):r?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=Dt(e))((function(e,n){var i=new Lt({next:function(e){try{t(e)}catch(t){n(t),i.unsubscribe()}},error:n,complete:e});r.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Mt]=function(){return this},t.prototype.pipe=function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return(0===(t=e).length?Rt:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)})(this)},t.prototype.toPromise=function(t){var e=this;return new(t=Dt(t))((function(t,r){var n;e.subscribe((function(t){return n=t}),(function(t){return r(t)}),(function(){return t(n)}))}))},t.create=function(e){return new t(e)},t}();function Dt(t){var e;return null!==(e=null!=t?t:Tt.Promise)&&void 0!==e?e:Promise}var Ft=gt((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Gt=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return ht(e,t),e.prototype.lift=function(t){var e=new kt(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new Ft},e.prototype.next=function(t){var e=this;St((function(){var r,n;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=ft(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},e.prototype.error=function(t){var e=this;St((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var r=e.observers;r.length;)r.shift().error(t)}}))},e.prototype.complete=function(){var t=this;St((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?Et:(this.currentObservers=null,o.push(t),new vt((function(){e.currentObservers=null,bt(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,r=e.hasError,n=e.thrownError,i=e.isStopped;r?t.error(n):i&&t.complete()},e.prototype.asObservable=function(){var t=new Ut;return t.source=this,t},e.create=function(t,e){return new kt(t,e)},e}(Ut),kt=function(t){function e(e,r){var n=t.call(this)||this;return n.destination=e,n.source=r,n}return ht(e,t),e.prototype.next=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===r||r.call(e,t)},e.prototype.error=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===r||r.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,r;return null!==(r=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==r?r:Et},e}(Gt),$t={now:function(){return($t.delegate||Date).now()},delegate:void 0},jt=function(t){function e(e,r,n){void 0===e&&(e=1/0),void 0===r&&(r=1/0),void 0===n&&(n=$t);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,r),i}return ht(e,t),e.prototype.next=function(e){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,a=r._timestampProvider,s=r._windowTime;n||(i.push(e),!o&&i.push(a.now()+s)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!t.closed;i+=r?1:2)t.next(n[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,r=t._timestampProvider,n=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var a=r.now(),s=0,c=1;c<n.length&&n[c]<=a;c+=2)s=c;s&&n.splice(0,s+1)}},e}(Gt);let Vt=[],Wt={};
|
|
133
|
+
var ut=function(t,e){return ut=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},ut(t,e)};function ft(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ut(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function pt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function dt(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function mt(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function gt(t){return"function"==typeof t}function yt(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}"function"==typeof SuppressedError&&SuppressedError;var vt=yt((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function bt(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Et=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=pt(o),s=a.next();!s.done;s=a.next()){s.value.remove(this)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var c=this.initialTeardown;if(gt(c))try{c()}catch(t){i=t instanceof vt?t.errors:[t]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var h=pt(l),u=h.next();!u.done;u=h.next()){var f=u.value;try{Nt(f)}catch(t){i=null!=i?i:[],t instanceof vt?i=mt(mt([],dt(i)),dt(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}if(i)throw new vt(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Nt(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&bt(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&bt(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),wt=Et.EMPTY;function _t(t){return t instanceof Et||t&&"closed"in t&>(t.remove)&>(t.add)&>(t.unsubscribe)}function Nt(t){gt(t)?t():t.unsubscribe()}var Tt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},At={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=At.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,mt([t,e],dt(n))):setTimeout.apply(void 0,mt([t,e],dt(n)))},clearTimeout:function(t){var e=At.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Bt(){}var It=null;function St(t){if(Tt.useDeprecatedSynchronousErrorHandling){var e=!It;if(e&&(It={errorThrown:!1,error:null}),t(),e){var n=It,r=n.errorThrown,i=n.error;if(It=null,r)throw i}}else t()}var Pt=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,_t(e)&&e.add(n)):n.destination=Mt,n}return ft(e,t),e.create=function(t,e,n){return new xt(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Et),Ht=Function.prototype.bind;function Lt(t,e){return Ht.call(t,e)}var Ot=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){Ct(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){Ct(t)}else Ct(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){Ct(t)}},t}(),xt=function(t){function e(e,n,r){var i,o,a=t.call(this)||this;gt(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:a&&Tt.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return a.unsubscribe()},i={next:e.next&&Lt(e.next,o),error:e.error&&Lt(e.error,o),complete:e.complete&&Lt(e.complete,o)}):i=e;return a.destination=new Ot(i),a}return ft(e,t),e}(Pt);function Ct(t){var e;e=t,At.setTimeout((function(){throw e}))}var Mt={closed:!0,next:Bt,error:function(t){throw t},complete:Bt},Rt="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ut(t){return t}var Ft=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof Pt||function(t){return t&>(t.next)&>(t.error)&>(t.complete)}(r)&&_t(r)?t:new xt(t,e,n);return St((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=Dt(e))((function(e,r){var i=new xt({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Rt]=function(){return this},t.prototype.pipe=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(0===(t=e).length?Ut:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)})(this)},t.prototype.toPromise=function(t){var e=this;return new(t=Dt(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function Dt(t){var e;return null!==(e=null!=t?t:Tt.Promise)&&void 0!==e?e:Promise}var kt=yt((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Gt=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return ft(e,t),e.prototype.lift=function(t){var e=new $t(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new kt},e.prototype.next=function(t){var e=this;St((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=pt(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;St((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;St((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?wt:(this.currentObservers=null,o.push(t),new Et((function(){e.currentObservers=null,bt(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new Ft;return t.source=this,t},e.create=function(t,e){return new $t(t,e)},e}(Ft),$t=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return ft(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:wt},e}(Gt),jt={now:function(){return(jt.delegate||Date).now()},delegate:void 0},Wt=function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=jt);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}return ft(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,a=n._timestampProvider,s=n._windowTime;r||(i.push(e),!o&&i.push(a.now()+s)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var a=n.now(),s=0,c=1;c<r.length&&r[c]<=a;c+=2)s=c;s&&r.splice(0,s+1)}},e}(Gt);let Vt=[],Xt={};
|
|
134
134
|
/**
|
|
135
135
|
* @name topic
|
|
136
136
|
* @description A small wrapper over the rxjs to offer the topic method on top of it
|
|
@@ -138,36 +138,36 @@ var ut=function(t,e){return ut=Object.setPrototypeOf||{__proto__:[]}instanceof A
|
|
|
138
138
|
* @param step [String] How many values to be buffed for new subscribers - default 0
|
|
139
139
|
* @returns ReplaySubject
|
|
140
140
|
*/
|
|
141
|
-
const
|
|
141
|
+
const zt=[];
|
|
142
142
|
/**
|
|
143
143
|
* Create a `Writable` store that allows both updating and reading by subscription.
|
|
144
144
|
* @param {*=}value initial value
|
|
145
145
|
* @param {StartStopNotifier=} start
|
|
146
146
|
*/
|
|
147
|
-
function
|
|
148
|
-
const t=!
|
|
147
|
+
function Kt(e,n=t){let r;const i=new Set;function a(t){if(o(e,t)&&(e=t,r)){// store is ready
|
|
148
|
+
const t=!zt.length;for(const t of i)t[1](),zt.push(t,e);if(t){for(let t=0;t<zt.length;t+=2)zt[t][0](zt[t+1]);zt.length=0}}}return{set:a,update:function(t){a(t(e))},subscribe:function(o,s=t){const c=[o,s];return i.add(c),1===i.size&&(r=n(a)||t),o(e),()=>{i.delete(c),0===i.size&&r&&(r(),r=null)}}}}function Yt(e,n,o){const a=!Array.isArray(e),s=a?[e]:e,c=n.length<2;return h=e=>{let o=!1;const h=[];let u=0,f=t;const p=()=>{if(u)return;f();const r=n(a?h[0]:h,e);c?e(r):f=i(r)?r:t},d=s.map(((t,e)=>l(t,(t=>{h[e]=t,u&=~(1<<e),o&&p()}),(()=>{u|=1<<e}))));return o=!0,p(),function(){r(d),f(),
|
|
149
149
|
// We need to set this to false because callbacks can still happen despite having unsubscribed:
|
|
150
150
|
// Callbacks might already be placed in the queue which doesn't know it should no longer
|
|
151
151
|
// invoke this derived store.
|
|
152
|
-
o=!1}},{subscribe:
|
|
152
|
+
o=!1}},{subscribe:Kt(o,h).subscribe};
|
|
153
153
|
/**
|
|
154
154
|
* Creates a `Readable` store that allows reading by subscription.
|
|
155
155
|
* @param value initial value
|
|
156
156
|
* @param {StartStopNotifier} [start]
|
|
157
157
|
*/
|
|
158
|
-
var
|
|
158
|
+
var h}var Zt=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===qt}(t)}
|
|
159
159
|
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
|
|
160
|
-
(t)};var
|
|
160
|
+
(t)};var qt="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Jt(t,e){return!1!==e.clone&&e.isMergeableObject(t)?re((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function Qt(t,e,n){return t.concat(e).map((function(t){return Jt(t,n)}))}function te(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return Object.propertyIsEnumerable.call(t,e)})):[]}(t))}function ee(t,e){try{return e in t}catch(t){return!1}}
|
|
161
161
|
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
|
162
|
-
function
|
|
163
|
-
})(t,i)||(
|
|
162
|
+
function ne(t,e,n){var r={};return n.isMergeableObject(t)&&te(t).forEach((function(e){r[e]=Jt(t[e],n)})),te(e).forEach((function(i){(function(t,e){return ee(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e));// and also unsafe if they're nonenumerable.
|
|
163
|
+
})(t,i)||(ee(t,i)&&n.isMergeableObject(e[i])?r[i]=function(t,e){if(!e.customMerge)return re;var n=e.customMerge(t);return"function"==typeof n?n:re}(i,n)(t[i],e[i],n):r[i]=Jt(e[i],n))})),r}function re(t,e,n){(n=n||{}).arrayMerge=n.arrayMerge||Qt,n.isMergeableObject=n.isMergeableObject||Zt,
|
|
164
164
|
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
|
|
165
165
|
// implementations can use it. The caller may not replace it.
|
|
166
|
-
|
|
166
|
+
n.cloneUnlessOtherwiseSpecified=Jt;var r=Array.isArray(e);return r===Array.isArray(t)?r?n.arrayMerge(t,e,n):ne(t,e,n):Jt(e,n)}re.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,n){return re(t,n,e)}),{})};var ie=re,oe=function(t,e){return oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},oe(t,e)};function ae(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}oe(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var se,ce,le,he=function(){return he=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},he.apply(this,arguments)};function ue(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}
|
|
167
167
|
/**
|
|
168
168
|
* Type Guards
|
|
169
169
|
*/
|
|
170
|
-
function
|
|
170
|
+
function fe(t){return t.type===ce.literal}function pe(t){return t.type===ce.argument}function de(t){return t.type===ce.number}function me(t){return t.type===ce.date}function ge(t){return t.type===ce.time}function ye(t){return t.type===ce.select}function ve(t){return t.type===ce.plural}function be(t){return t.type===ce.pound}function Ee(t){return t.type===ce.tag}function we(t){return!(!t||"object"!=typeof t||t.type!==le.number)}function _e(t){return!(!t||"object"!=typeof t||t.type!==le.dateTime)}
|
|
171
171
|
// @generated from regex-gen.ts
|
|
172
172
|
"function"==typeof SuppressedError&&SuppressedError,function(t){
|
|
173
173
|
/** Argument is unclosed (e.g. `{0`) */
|
|
@@ -229,7 +229,7 @@ t[t.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",
|
|
|
229
229
|
/** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */
|
|
230
230
|
t[t.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",
|
|
231
231
|
/** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */
|
|
232
|
-
t[t.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(
|
|
232
|
+
t[t.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(se||(se={})),function(t){
|
|
233
233
|
/**
|
|
234
234
|
* Raw text
|
|
235
235
|
*/
|
|
@@ -266,7 +266,7 @@ t[t.pound=7]="pound",
|
|
|
266
266
|
/**
|
|
267
267
|
* XML-like tag
|
|
268
268
|
*/
|
|
269
|
-
t[t.tag=8]="tag"}(
|
|
269
|
+
t[t.tag=8]="tag"}(ce||(ce={})),function(t){t[t.number=0]="number",t[t.dateTime=1]="dateTime"}(le||(le={}));var Ne=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Te=/(?:[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;
|
|
270
270
|
/**
|
|
271
271
|
* https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
272
272
|
* Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js
|
|
@@ -278,33 +278,33 @@ t[t.tag=8]="tag"}(se||(se={})),function(t){t[t.number=0]="number",t[t.dateTime=1
|
|
|
278
278
|
* @public
|
|
279
279
|
* @param skeleton skeleton string
|
|
280
280
|
*/
|
|
281
|
-
function Ae(t){var e={};return t.replace(Te,(function(t){var
|
|
281
|
+
function Ae(t){var e={};return t.replace(Te,(function(t){var n=t.length;switch(t[0]){
|
|
282
282
|
// Era
|
|
283
|
-
case"G":e.era=4===
|
|
283
|
+
case"G":e.era=4===n?"long":5===n?"narrow":"short";break;
|
|
284
284
|
// Year
|
|
285
|
-
case"y":e.year=2===
|
|
285
|
+
case"y":e.year=2===n?"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");
|
|
286
286
|
// Quarter
|
|
287
287
|
case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
|
288
288
|
// Month
|
|
289
|
-
case"M":case"L":e.month=["numeric","2-digit","short","long","narrow"][
|
|
289
|
+
case"M":case"L":e.month=["numeric","2-digit","short","long","narrow"][n-1];break;
|
|
290
290
|
// Week
|
|
291
|
-
case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":e.day=["numeric","2-digit"][
|
|
291
|
+
case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":e.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
|
292
292
|
// Weekday
|
|
293
|
-
case"E":e.weekday=4===
|
|
293
|
+
case"E":e.weekday=4===n?"short":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][n-4];break;
|
|
294
294
|
// Period
|
|
295
295
|
case"a":// AM, PM
|
|
296
296
|
e.hour12=!0;break;case"b":// am, pm, noon, midnight
|
|
297
297
|
case"B":// flexible day periods
|
|
298
298
|
throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
|
299
299
|
// Hour
|
|
300
|
-
case"h":e.hourCycle="h12",e.hour=["numeric","2-digit"][
|
|
300
|
+
case"h":e.hourCycle="h12",e.hour=["numeric","2-digit"][n-1];break;case"H":e.hourCycle="h23",e.hour=["numeric","2-digit"][n-1];break;case"K":e.hourCycle="h11",e.hour=["numeric","2-digit"][n-1];break;case"k":e.hourCycle="h24",e.hour=["numeric","2-digit"][n-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");
|
|
301
301
|
// Minute
|
|
302
|
-
case"m":e.minute=["numeric","2-digit"][
|
|
302
|
+
case"m":e.minute=["numeric","2-digit"][n-1];break;
|
|
303
303
|
// Second
|
|
304
|
-
case"s":e.second=["numeric","2-digit"][
|
|
304
|
+
case"s":e.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
|
305
305
|
// Zone
|
|
306
306
|
case"z":// 1..3, 4: specific non-location format
|
|
307
|
-
e.timeZoneName=
|
|
307
|
+
e.timeZoneName=n<4?"short":"long";break;case"Z":// 1..3, 4, 5: The ISO8601 varios formats
|
|
308
308
|
case"O":// 1, 4: miliseconds in day short, long
|
|
309
309
|
case"v":// 1, 4: generic non-location format
|
|
310
310
|
case"V":// 1, 2, 3, 4: time zone ID or city
|
|
@@ -312,33 +312,33 @@ case"X":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
|
312
312
|
case"x":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
313
313
|
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),e}
|
|
314
314
|
// @generated from regex-gen.ts
|
|
315
|
-
var Be=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var
|
|
315
|
+
var Be=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var Ie=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Se=/^(@+)?(\+|#+)?[rs]?$/g,Pe=/(\*)(0+)|(#+)(0+)|(0+)/g,He=/^(0+)$/;function Le(t){var e={};return"r"===t[t.length-1]?e.roundingPriority="morePrecision":"s"===t[t.length-1]&&(e.roundingPriority="lessPrecision"),t.replace(Se,(function(t,n,r){
|
|
316
316
|
// @@@ case
|
|
317
|
-
return"string"!=typeof
|
|
317
|
+
return"string"!=typeof r?(e.minimumSignificantDigits=n.length,e.maximumSignificantDigits=n.length):"+"===r?e.minimumSignificantDigits=n.length:"#"===n[0]?e.maximumSignificantDigits=n.length:(e.minimumSignificantDigits=n.length,e.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),e}function Oe(t){switch(t){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 xe(t){
|
|
318
318
|
// Engineering
|
|
319
|
-
var e;if("E"===t[0]&&"E"===t[1]?(e={notation:"engineering"},t=t.slice(2)):"E"===t[0]&&(e={notation:"scientific"},t=t.slice(1)),e){var
|
|
319
|
+
var e;if("E"===t[0]&&"E"===t[1]?(e={notation:"engineering"},t=t.slice(2)):"E"===t[0]&&(e={notation:"scientific"},t=t.slice(1)),e){var n=t.slice(0,2);if("+!"===n?(e.signDisplay="always",t=t.slice(2)):"+?"===n&&(e.signDisplay="exceptZero",t=t.slice(2)),!He.test(t))throw new Error("Malformed concise eng/scientific notation");e.minimumIntegerDigits=t.length}return e}function Ce(t){var e=Oe(t);return e||{}}
|
|
320
320
|
/**
|
|
321
321
|
* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options
|
|
322
|
-
*/function
|
|
322
|
+
*/function Me(t){for(var e={},n=0,r=t;n<r.length;n++){var i=r[n];switch(i.stem){case"percent":case"%":e.style="percent";continue;case"%x100":e.style="percent",e.scale=100;continue;case"currency":e.style="currency",e.currency=i.options[0];continue;case"group-off":case",_":e.useGrouping=!1;continue;case"precision-integer":case".":e.maximumFractionDigits=0;continue;case"measure-unit":case"unit":e.style="unit",e.unit=i.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":e.notation="compact",e.compactDisplay="short";continue;case"compact-long":case"KK":e.notation="compact",e.compactDisplay="long";continue;case"scientific":e=he(he(he({},e),{notation:"scientific"}),i.options.reduce((function(t,e){return he(he({},t),Ce(e))}),{}));continue;case"engineering":e=he(he(he({},e),{notation:"engineering"}),i.options.reduce((function(t,e){return he(he({},t),Ce(e))}),{}));continue;case"notation-simple":e.notation="standard";continue;
|
|
323
323
|
// https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
|
|
324
324
|
case"unit-width-narrow":e.currencyDisplay="narrowSymbol",e.unitDisplay="narrow";continue;case"unit-width-short":e.currencyDisplay="code",e.unitDisplay="short";continue;case"unit-width-full-name":e.currencyDisplay="name",e.unitDisplay="long";continue;case"unit-width-iso-code":e.currencyDisplay="symbol";continue;case"scale":e.scale=parseFloat(i.options[0]);continue;
|
|
325
325
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
326
|
-
case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(
|
|
326
|
+
case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Pe,(function(t,n,r,i,o,a){if(n)e.minimumIntegerDigits=r.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""}));continue}
|
|
327
327
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
328
|
-
if(
|
|
328
|
+
if(He.test(i.stem))e.minimumIntegerDigits=i.stem.length;else if(Ie.test(i.stem)){
|
|
329
329
|
// Precision
|
|
330
330
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision
|
|
331
331
|
// precision-integer case
|
|
332
|
-
if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(
|
|
332
|
+
if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(Ie,(function(t,n,r,i,o,a){
|
|
333
333
|
// .000* case (before ICU67 it was .000+)
|
|
334
|
-
return"*"===
|
|
334
|
+
return"*"===r?e.minimumFractionDigits=n.length:i&&"#"===i[0]?e.maximumFractionDigits=i.length:o&&a?(e.minimumFractionDigits=o.length,e.maximumFractionDigits=o.length+a.length):(e.minimumFractionDigits=n.length,e.maximumFractionDigits=n.length),""}));var o=i.options[0];
|
|
335
335
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
|
|
336
|
-
"w"===o?e=
|
|
336
|
+
"w"===o?e=he(he({},e),{trailingZeroDisplay:"stripIfInteger"}):o&&(e=he(he({},e),Le(o)))}
|
|
337
337
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision
|
|
338
|
-
else if(Se.test(i.stem))e=
|
|
338
|
+
else if(Se.test(i.stem))e=he(he({},e),Le(i.stem));else{var a=Oe(i.stem);a&&(e=he(he({},e),a));var s=xe(i.stem);s&&(e=he(he({},e),s))}}return e}
|
|
339
339
|
// @generated from time-data-gen.ts
|
|
340
340
|
// prettier-ignore
|
|
341
|
-
var
|
|
341
|
+
var Re,Ue={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"]};
|
|
342
342
|
/**
|
|
343
343
|
* Returns the best matching date time pattern if a date time skeleton
|
|
344
344
|
* pattern is provided with a locale. Follows the Unicode specification:
|
|
@@ -351,7 +351,7 @@ var Me,Re={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H
|
|
|
351
351
|
* of the given `locale` to the corresponding time pattern.
|
|
352
352
|
* @param locale
|
|
353
353
|
*/
|
|
354
|
-
function
|
|
354
|
+
function Fe(t){var e=t.hourCycle;if(void 0===e&&
|
|
355
355
|
// @ts-ignore hourCycle(s) is not identified yet
|
|
356
356
|
t.hourCycles&&
|
|
357
357
|
// @ts-ignore
|
|
@@ -359,37 +359,37 @@ t.hourCycles.length&&(
|
|
|
359
359
|
// @ts-ignore
|
|
360
360
|
e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}
|
|
361
361
|
// TODO: Once hourCycle is fully supported remove the following with data generation
|
|
362
|
-
var r
|
|
362
|
+
var n,r=t.language;return"root"!==r&&(n=t.maximize().region),(Ue[n||""]||Ue[r||""]||Ue["".concat(r,"-001")]||Ue["001"])[0]}var De=new RegExp("^".concat(Ne.source,"*")),ke=new RegExp("".concat(Ne.source,"*$"));function Ge(t,e){return{start:t,end:e}}
|
|
363
363
|
// #region Ponyfills
|
|
364
364
|
// Consolidate these variables up top for easier toggling during debugging
|
|
365
|
-
var
|
|
365
|
+
var $e=!!String.prototype.startsWith,je=!!String.fromCodePoint,We=!!Object.fromEntries,Ve=!!String.prototype.codePointAt,Xe=!!String.prototype.trimStart,ze=!!String.prototype.trimEnd,Ke=!!Number.isSafeInteger?Number.isSafeInteger:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},Ye=!0;try{
|
|
366
366
|
/**
|
|
367
367
|
* legacy Edge or Xbox One browser
|
|
368
368
|
* Unicode flag support: supported
|
|
369
369
|
* Pattern_Syntax support: not supported
|
|
370
370
|
* See https://github.com/formatjs/formatjs/issues/2822
|
|
371
371
|
*/
|
|
372
|
-
|
|
373
|
-
function(t,e,
|
|
374
|
-
function(t,e,
|
|
375
|
-
function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r
|
|
372
|
+
Ye="a"===(null===(Re=rn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===Re?void 0:Re[0])}catch(t){Ye=!1}var Ze,qe=$e?// Native
|
|
373
|
+
function(t,e,n){return t.startsWith(e,n)}:// For IE11
|
|
374
|
+
function(t,e,n){return t.slice(n,n+e.length)===e},Je=je?String.fromCodePoint:// IE11
|
|
375
|
+
function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n,r="",i=t.length,o=0;i>o;){if((n=t[o++])>1114111)throw RangeError(n+" is not a valid code point");r+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return r},Qe=
|
|
376
376
|
// native
|
|
377
|
-
|
|
378
|
-
function(t){for(var e={},
|
|
377
|
+
We?Object.fromEntries:// Ponyfill
|
|
378
|
+
function(t){for(var e={},n=0,r=t;n<r.length;n++){var i=r[n],o=i[0],a=i[1];e[o]=a}return e},tn=Ve?// Native
|
|
379
379
|
function(t,e){return t.codePointAt(e)}:// IE 11
|
|
380
|
-
function(t,e){var
|
|
380
|
+
function(t,e){var n=t.length;if(!(e<0||e>=n)){var r,i=t.charCodeAt(e);return i<55296||i>56319||e+1===n||(r=t.charCodeAt(e+1))<56320||r>57343?i:r-56320+(i-55296<<10)+65536}},en=Xe?// Native
|
|
381
381
|
function(t){return t.trimStart()}:// Ponyfill
|
|
382
|
-
function(t){return t.replace(De,"")},
|
|
382
|
+
function(t){return t.replace(De,"")},nn=ze?// Native
|
|
383
383
|
function(t){return t.trimEnd()}:// Ponyfill
|
|
384
|
-
function(t){return t.replace(
|
|
384
|
+
function(t){return t.replace(ke,"")};
|
|
385
385
|
// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.
|
|
386
|
-
function
|
|
386
|
+
function rn(t,e){return new RegExp(t,e)}
|
|
387
387
|
// #endregion
|
|
388
|
-
if(
|
|
388
|
+
if(Ye){
|
|
389
389
|
// Native
|
|
390
|
-
var
|
|
390
|
+
var on=rn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Ze=function(t,e){var n;return on.lastIndex=e,null!==(n=on.exec(t)[1])&&void 0!==n?n:""}}else
|
|
391
391
|
// IE11
|
|
392
|
-
|
|
392
|
+
Ze=function(t,e){for(var n=[];;){var r=tn(t,e);if(void 0===r||cn(r)||ln(r))break;n.push(r),e+=r>=65536?2:1}return Je.apply(void 0,n)};var an=/** @class */function(){function t(t,e){void 0===e&&(e={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!e.ignoreTag,this.locale=e.locale,this.requiresOtherClause=!!e.requiresOtherClause,this.shouldParseSkeletons=!!e.shouldParseSkeletons}return t.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(t,e,n){for(var r=[];!this.isEOF();){var i=this.char();if(123/* `{` */===i){if((o=this.parseArgument(t,n)).err)return o;r.push(o.val)}else{if(125/* `}` */===i&&t>0)break;if(35/* `#` */!==i||"plural"!==e&&"selectordinal"!==e){if(60/* `<` */===i&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(se.UNMATCHED_CLOSING_TAG,Ge(this.clonePosition(),this.clonePosition()))}if(60/* `<` */===i&&!this.ignoreTag&&sn(this.peek()||0)){if((o=this.parseTag(t,e)).err)return o;r.push(o.val)}else{var o;if((o=this.parseLiteral(t,e)).err)return o;r.push(o.val)}}else{var a=this.clonePosition();this.bump(),r.push({type:ce.pound,location:Ge(a,this.clonePosition())})}}}return{val:r,err:null}},
|
|
393
393
|
/**
|
|
394
394
|
* A tag name must start with an ASCII lower/upper case letter. The grammar is based on the
|
|
395
395
|
* [custom element name][] except that a dash is NOT always mandatory and uppercase letters
|
|
@@ -408,17 +408,17 @@ Ye=function(t,e){for(var r=[];;){var n=Qe(t,e);if(void 0===n||ar(n)||sr(n))break
|
|
|
408
408
|
* NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do
|
|
409
409
|
* since other tag-based engines like React allow it
|
|
410
410
|
*/
|
|
411
|
-
t.prototype.parseTag=function(t,e){var
|
|
412
|
-
var
|
|
411
|
+
t.prototype.parseTag=function(t,e){var n=this.clonePosition();this.bump();// `<`
|
|
412
|
+
var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))
|
|
413
413
|
// Self closing tag
|
|
414
|
-
return{val:{type:
|
|
414
|
+
return{val:{type:ce.literal,value:"<".concat(r,"/>"),location:Ge(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(t+1,e,!0);if(i.err)return i;var o=i.val,a=this.clonePosition();
|
|
415
415
|
// Expecting a close tag
|
|
416
|
-
if(this.bumpIf("</")){if(this.isEOF()||!
|
|
416
|
+
if(this.bumpIf("</")){if(this.isEOF()||!sn(this.char()))return this.error(se.INVALID_TAG,Ge(a,this.clonePosition()));var s=this.clonePosition();return r!==this.parseTagName()?this.error(se.UNMATCHED_CLOSING_TAG,Ge(s,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:ce.tag,value:r,children:o,location:Ge(n,this.clonePosition())},err:null}:this.error(se.INVALID_TAG,Ge(a,this.clonePosition())))}return this.error(se.UNCLOSED_TAG,Ge(n,this.clonePosition()))}return this.error(se.INVALID_TAG,Ge(n,this.clonePosition()))},
|
|
417
417
|
/**
|
|
418
418
|
* This method assumes that the caller has peeked ahead for the first tag character.
|
|
419
419
|
*/
|
|
420
420
|
t.prototype.parseTagName=function(){var t,e=this.offset();// the first tag name character
|
|
421
|
-
for(this.bump();!this.isEOF()&&(45/* '-' */===(t=this.char())||46/* '.' */===t||t>=48&&t<=57/* 0..9 */||95/* '_' */===t||t>=97&&t<=122/** a..z */||t>=65&&t<=90/* A..Z */||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039);)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(t,e){for(var
|
|
421
|
+
for(this.bump();!this.isEOF()&&(45/* '-' */===(t=this.char())||46/* '.' */===t||t>=48&&t<=57/* 0..9 */||95/* '_' */===t||t>=97&&t<=122/** a..z */||t>=65&&t<=90/* A..Z */||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039);)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(t,e){for(var n=this.clonePosition(),r="";;){var i=this.tryParseQuote(e);if(i)r+=i;else{var o=this.tryParseUnquoted(t,e);if(o)r+=o;else{var a=this.tryParseLeftAngleBracket();if(!a)break;r+=a}}}var s=Ge(n,this.clonePosition());return{val:{type:ce.literal,value:r,location:s},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60/* `<` */!==this.char()||!this.ignoreTag&&(sn(t=this.peek()||0)||47===t)?null:(this.bump(),"<");var t;
|
|
422
422
|
/** See `parseTag` function docs. */},
|
|
423
423
|
/**
|
|
424
424
|
* Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes
|
|
@@ -436,71 +436,71 @@ case 123:case 60:case 62:case 125:break;case 35:// '#'
|
|
|
436
436
|
if("plural"===t||"selectordinal"===t)break;return null;default:return null}this.bump();// apostrophe
|
|
437
437
|
var e=[this.char()];// escaped char
|
|
438
438
|
// read chars until the optional closing apostrophe is found
|
|
439
|
-
for(this.bump();!this.isEOF();){var
|
|
439
|
+
for(this.bump();!this.isEOF();){var n=this.char();if(39/* `'` */===n){if(39/* `'` */!==this.peek()){
|
|
440
440
|
// Optional closing apostrophe.
|
|
441
441
|
this.bump();break}e.push(39),
|
|
442
442
|
// Bump one more time because we need to skip 2 characters.
|
|
443
|
-
this.bump()}else e.push(
|
|
444
|
-
this.bumpSpace(),this.isEOF())return this.error(
|
|
443
|
+
this.bump()}else e.push(n);this.bump()}return Je.apply(void 0,e)},t.prototype.tryParseUnquoted=function(t,e){if(this.isEOF())return null;var n=this.char();return 60/* `<` */===n||123/* `{` */===n||35/* `#` */===n&&("plural"===e||"selectordinal"===e)||125/* `}` */===n&&t>0?null:(this.bump(),Je(n))},t.prototype.parseArgument=function(t,e){var n=this.clonePosition();if(this.bump(),// `{`
|
|
444
|
+
this.bumpSpace(),this.isEOF())return this.error(se.EXPECT_ARGUMENT_CLOSING_BRACE,Ge(n,this.clonePosition()));if(125/* `}` */===this.char())return this.bump(),this.error(se.EMPTY_ARGUMENT,Ge(n,this.clonePosition()));
|
|
445
445
|
// argument name
|
|
446
|
-
var
|
|
446
|
+
var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(se.MALFORMED_ARGUMENT,Ge(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(se.EXPECT_ARGUMENT_CLOSING_BRACE,Ge(n,this.clonePosition()));switch(this.char()){
|
|
447
447
|
// Simple argument: `{name}`
|
|
448
448
|
case 125/* `}` */:// `}`
|
|
449
|
-
return this.bump(),{val:{type:
|
|
449
|
+
return this.bump(),{val:{type:ce.argument,
|
|
450
450
|
// value does not include the opening and closing braces.
|
|
451
|
-
value:
|
|
451
|
+
value:r,location:Ge(n,this.clonePosition())},err:null};
|
|
452
452
|
// Argument with options: `{name, format, ...}`
|
|
453
453
|
case 44/* `,` */:return this.bump(),// `,`
|
|
454
|
-
this.bumpSpace(),this.isEOF()?this.error(
|
|
454
|
+
this.bumpSpace(),this.isEOF()?this.error(se.EXPECT_ARGUMENT_CLOSING_BRACE,Ge(n,this.clonePosition())):this.parseArgumentOptions(t,e,r,n);default:return this.error(se.MALFORMED_ARGUMENT,Ge(n,this.clonePosition()))}},
|
|
455
455
|
/**
|
|
456
456
|
* Advance the parser until the end of the identifier, if it is currently on
|
|
457
457
|
* an identifier character. Return an empty string otherwise.
|
|
458
458
|
*/
|
|
459
|
-
t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),
|
|
459
|
+
t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),n=Ze(this.message,e),r=e+n.length;return this.bumpTo(r),{value:n,location:Ge(t,this.clonePosition())}},t.prototype.parseArgumentOptions=function(t,e,n,r){var i,o=this.clonePosition(),a=this.parseIdentifierIfPossible().value,s=this.clonePosition();
|
|
460
460
|
// Parse this range:
|
|
461
461
|
// {name, type, style}
|
|
462
462
|
// ^---^
|
|
463
463
|
switch(a){case"":
|
|
464
464
|
// Expecting a style string number, date, time, plural, selectordinal, or select.
|
|
465
|
-
return this.error(
|
|
465
|
+
return this.error(se.EXPECT_ARGUMENT_TYPE,Ge(o,s));case"number":case"date":case"time":
|
|
466
466
|
// Parse this range:
|
|
467
467
|
// {name, number, style}
|
|
468
468
|
// ^-------^
|
|
469
|
-
this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition();if((y=this.parseSimpleArgStyleIfPossible()).err)return y;if(0===(p=
|
|
469
|
+
this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition();if((y=this.parseSimpleArgStyleIfPossible()).err)return y;if(0===(p=nn(y.val)).length)return this.error(se.EXPECT_ARGUMENT_STYLE,Ge(this.clonePosition(),this.clonePosition()));c={style:p,styleLocation:Ge(l,this.clonePosition())}}if((v=this.tryParseArgumentClose(r)).err)return v;var h=Ge(r,this.clonePosition());
|
|
470
470
|
// Extract style or skeleton
|
|
471
|
-
if(c&&
|
|
471
|
+
if(c&&qe(null==c?void 0:c.style,"::",0)){
|
|
472
472
|
// Skeleton starts with `::`.
|
|
473
|
-
var
|
|
473
|
+
var u=en(c.style.slice(2));if("number"===a)return(y=this.parseNumberSkeletonFromString(u,c.styleLocation)).err?y:{val:{type:ce.number,value:n,location:h,style:y.val},err:null};if(0===u.length)return this.error(se.EXPECT_DATE_TIME_SKELETON,h);var f=u;
|
|
474
474
|
// Get "best match" pattern only if locale is passed, if not, let it
|
|
475
475
|
// pass as-is where `parseDateTimeSkeleton()` will throw an error
|
|
476
476
|
// for unsupported patterns.
|
|
477
|
-
this.locale&&(f=function(t,e){for(var
|
|
477
|
+
this.locale&&(f=function(t,e){for(var n="",r=0;r<t.length;r++){var i=t.charAt(r);if("j"===i){for(var o=0;r+1<t.length&&t.charAt(r+1)===i;)o++,r++;var a=1+(1&o),s=o<2?1:3+(o>>1),c=Fe(e);for("H"!=c&&"k"!=c||(s=0);s-- >0;)n+="a";for(;a-- >0;)n=c+n}else n+="J"===i?"H":i}return n}(u,this.locale));var p={type:le.dateTime,pattern:f,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?Ae(f):{}};return{val:{type:"date"===a?ce.date:ce.time,value:n,location:h,style:p},err:null}}
|
|
478
478
|
// Regular style or no style.
|
|
479
|
-
return{val:{type:"number"===a?
|
|
479
|
+
return{val:{type:"number"===a?ce.number:"date"===a?ce.date:ce.time,value:n,location:h,style:null!==(i=null==c?void 0:c.style)&&void 0!==i?i:null},err:null};case"plural":case"selectordinal":case"select":
|
|
480
480
|
// Parse this range:
|
|
481
481
|
// {name, plural, options}
|
|
482
482
|
// ^---------^
|
|
483
|
-
var d=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(
|
|
483
|
+
var d=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(se.EXPECT_SELECT_ARGUMENT_OPTIONS,Ge(d,he({},d)));this.bumpSpace();
|
|
484
484
|
// Parse offset:
|
|
485
485
|
// {name, plural, offset:1, options}
|
|
486
486
|
// ^-----^
|
|
487
487
|
// or the first option:
|
|
488
488
|
// {name, plural, one {...} other {...}}
|
|
489
489
|
// ^--^
|
|
490
|
-
var m=this.parseIdentifierIfPossible(),g=0;if("select"!==a&&"offset"===m.value){if(!this.bumpIf(":"))return this.error(
|
|
490
|
+
var m=this.parseIdentifierIfPossible(),g=0;if("select"!==a&&"offset"===m.value){if(!this.bumpIf(":"))return this.error(se.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Ge(this.clonePosition(),this.clonePosition()));var y;if(this.bumpSpace(),(y=this.tryParseDecimalInteger(se.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,se.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return y;
|
|
491
491
|
// Parse another identifier for option parsing
|
|
492
|
-
this.bumpSpace(),m=this.parseIdentifierIfPossible(),g=y.val}var b
|
|
492
|
+
this.bumpSpace(),m=this.parseIdentifierIfPossible(),g=y.val}var v,b=this.tryParsePluralOrSelectOptions(t,a,e,m);if(b.err)return b;if((v=this.tryParseArgumentClose(r)).err)return v;var E=Ge(r,this.clonePosition());return"select"===a?{val:{type:ce.select,value:n,options:Qe(b.val),location:E},err:null}:{val:{type:ce.plural,value:n,options:Qe(b.val),offset:g,pluralType:"plural"===a?"cardinal":"ordinal",location:E},err:null};default:return this.error(se.INVALID_ARGUMENT_TYPE,Ge(o,s))}},t.prototype.tryParseArgumentClose=function(t){
|
|
493
493
|
// Parse: {value, number, ::currency/GBP }
|
|
494
|
-
return this.isEOF()||125/* `}` */!==this.char()?this.error(
|
|
494
|
+
return this.isEOF()||125/* `}` */!==this.char()?this.error(se.EXPECT_ARGUMENT_CLOSING_BRACE,Ge(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},
|
|
495
495
|
/**
|
|
496
496
|
* See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659
|
|
497
497
|
*/
|
|
498
498
|
t.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,e=this.clonePosition();!this.isEOF();){switch(this.char()){case 39/* `'` */:
|
|
499
499
|
// Treat apostrophe as quoting but include it in the style part.
|
|
500
500
|
// Find the end of the quoted literal text.
|
|
501
|
-
this.bump();var
|
|
501
|
+
this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(se.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Ge(n,this.clonePosition()));this.bump();break;case 123/* `{` */:t+=1,this.bump();break;case 125/* `}` */:if(!(t>0))return{val:this.message.slice(e.offset,this.offset()),err:null};t-=1;break;default:this.bump()}}return{val:this.message.slice(e.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(t,e){var n=[];try{n=function(t){if(0===t.length)throw new Error("Number skeleton cannot be empty");
|
|
502
502
|
// Parse the skeleton
|
|
503
|
-
for(var e=[],
|
|
503
|
+
for(var e=[],n=0,r=t.split(Be).filter((function(t){return t.length>0}));n<r.length;n++){var i=r[n].split("/");if(0===i.length)throw new Error("Invalid number skeleton");for(var o=i[0],a=i.slice(1),s=0,c=a;s<c.length;s++)if(0===c[s].length)throw new Error("Invalid number skeleton");e.push({stem:o,options:a})}return e}(t)}catch(t){return this.error(se.INVALID_NUMBER_SKELETON,e)}return{val:{type:le.number,tokens:n,location:e,parsedOptions:this.shouldParseSkeletons?Me(n):{}},err:null}},
|
|
504
504
|
/**
|
|
505
505
|
* @param nesting_level The current nesting level of messages.
|
|
506
506
|
* This can be positive when parsing message fragment in select or plural argument options.
|
|
@@ -511,30 +511,30 @@ for(var e=[],r=0,n=t.split(Be).filter((function(t){return t.length>0}));r<n.leng
|
|
|
511
511
|
* between a pair of opening and closing tags. The nested message will not parse beyond
|
|
512
512
|
* the closing tag boundary.
|
|
513
513
|
*/
|
|
514
|
-
t.prototype.tryParsePluralOrSelectOptions=function(t,e,r
|
|
514
|
+
t.prototype.tryParsePluralOrSelectOptions=function(t,e,n,r){
|
|
515
515
|
// Parse:
|
|
516
516
|
// one {one apple}
|
|
517
517
|
// ^--^
|
|
518
|
-
for(var i,o=!1,a=[],s=new Set,c=
|
|
518
|
+
for(var i,o=!1,a=[],s=new Set,c=r.value,l=r.location;;){if(0===c.length){var h=this.clonePosition();if("select"===e||!this.bumpIf("="))break;
|
|
519
519
|
// Try parse `={number}` selector
|
|
520
|
-
var
|
|
520
|
+
var u=this.tryParseDecimalInteger(se.EXPECT_PLURAL_ARGUMENT_SELECTOR,se.INVALID_PLURAL_ARGUMENT_SELECTOR);if(u.err)return u;l=Ge(h,this.clonePosition()),c=this.message.slice(h.offset,this.offset())}
|
|
521
521
|
// Duplicate selector clauses
|
|
522
|
-
if(s.has(c))return this.error("select"===e?
|
|
522
|
+
if(s.has(c))return this.error("select"===e?se.DUPLICATE_SELECT_ARGUMENT_SELECTOR:se.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,l);"other"===c&&(o=!0),
|
|
523
523
|
// Parse:
|
|
524
524
|
// one {one apple}
|
|
525
525
|
// ^----------^
|
|
526
|
-
this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===e?
|
|
526
|
+
this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===e?se.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:se.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Ge(this.clonePosition(),this.clonePosition()));var p=this.parseMessage(t+1,e,n);if(p.err)return p;var d=this.tryParseArgumentClose(f);if(d.err)return d;a.push([c,{value:p.val,location:Ge(f,this.clonePosition())}]),
|
|
527
527
|
// Keep track of the existing selectors
|
|
528
528
|
s.add(c),
|
|
529
529
|
// Prep next selector clause.
|
|
530
|
-
this.bumpSpace(),c=(i=this.parseIdentifierIfPossible()).value,l=i.location}return 0===a.length?this.error("select"===e?
|
|
530
|
+
this.bumpSpace(),c=(i=this.parseIdentifierIfPossible()).value,l=i.location}return 0===a.length?this.error("select"===e?se.EXPECT_SELECT_ARGUMENT_SELECTOR:se.EXPECT_PLURAL_ARGUMENT_SELECTOR,Ge(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(se.MISSING_OTHER_CLAUSE,Ge(this.clonePosition(),this.clonePosition())):{val:a,err:null}},t.prototype.tryParseDecimalInteger=function(t,e){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var i=!1,o=0;!this.isEOF();){var a=this.char();if(!(a>=48/* `0` */&&a<=57/* `9` */))break;i=!0,o=10*o+(a-48),this.bump()}var s=Ge(r,this.clonePosition());return i?Ke(o*=n)?{val:o,err:null}:this.error(e,s):this.error(t,s)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){
|
|
531
531
|
// This is much faster than `Object.assign` or spread.
|
|
532
532
|
return{offset:this.position.offset,line:this.position.line,column:this.position.column}},
|
|
533
533
|
/**
|
|
534
534
|
* Return the code point at the current position of the parser.
|
|
535
535
|
* Throws if the index is out of bound.
|
|
536
536
|
*/
|
|
537
|
-
t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=
|
|
537
|
+
t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=tn(this.message,t);if(void 0===e)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return e},t.prototype.error=function(t,e){return{val:null,err:{kind:t,message:this.message,location:e}}},
|
|
538
538
|
/** Bump the parser to the next UTF-16 code unit. */
|
|
539
539
|
t.prototype.bump=function(){if(!this.isEOF()){var t=this.char();10/* '\n' */===t?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,
|
|
540
540
|
// 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.
|
|
@@ -545,146 +545,158 @@ this.position.offset+=t<65536?1:2)}},
|
|
|
545
545
|
* following the prefix and return true. Otherwise, don't bump the parser
|
|
546
546
|
* and return false.
|
|
547
547
|
*/
|
|
548
|
-
t.prototype.bumpIf=function(t){if(
|
|
548
|
+
t.prototype.bumpIf=function(t){if(qe(this.message,t,this.offset())){for(var e=0;e<t.length;e++)this.bump();return!0}return!1},
|
|
549
549
|
/**
|
|
550
550
|
* Bump the parser until the pattern character is found and return `true`.
|
|
551
551
|
* Otherwise bump to the end of the file and return `false`.
|
|
552
552
|
*/
|
|
553
|
-
t.prototype.bumpUntil=function(t){var e=this.offset(),
|
|
553
|
+
t.prototype.bumpUntil=function(t){var e=this.offset(),n=this.message.indexOf(t,e);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},
|
|
554
554
|
/**
|
|
555
555
|
* Bump the parser to the target offset.
|
|
556
556
|
* If target offset is beyond the end of the input, bump the parser to the end of the input.
|
|
557
557
|
*/
|
|
558
558
|
t.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var e=this.offset();if(e===t)break;if(e>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},
|
|
559
559
|
/** advance the parser through all whitespace to the next non-whitespace code unit. */
|
|
560
|
-
t.prototype.bumpSpace=function(){for(;!this.isEOF()&&
|
|
560
|
+
t.prototype.bumpSpace=function(){for(;!this.isEOF()&&cn(this.char());)this.bump()},
|
|
561
561
|
/**
|
|
562
562
|
* Peek at the *next* Unicode codepoint in the input without advancing the parser.
|
|
563
563
|
* If the input has been exhausted, then this returns null.
|
|
564
564
|
*/
|
|
565
|
-
t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),
|
|
565
|
+
t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),n=this.message.charCodeAt(e+(t>=65536?2:1));return null!=n?n:null},t}();
|
|
566
566
|
/**
|
|
567
567
|
* This check if codepoint is alphabet (lower & uppercase)
|
|
568
568
|
* @param codepoint
|
|
569
569
|
* @returns
|
|
570
|
-
*/function
|
|
570
|
+
*/function sn(t){return t>=97&&t<=122||t>=65&&t<=90}
|
|
571
571
|
/**
|
|
572
572
|
* Code point equivalent of regex `\p{White_Space}`.
|
|
573
573
|
* From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
|
574
574
|
*/
|
|
575
|
-
function
|
|
575
|
+
function cn(t){return t>=9&&t<=13||32===t||133===t||t>=8206&&t<=8207||8232===t||8233===t}
|
|
576
576
|
/**
|
|
577
577
|
* Code point equivalent of regex `\p{Pattern_Syntax}`.
|
|
578
578
|
* See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
|
579
|
-
*/function
|
|
579
|
+
*/function ln(t){return t>=33&&t<=35||36===t||t>=37&&t<=39||40===t||41===t||42===t||43===t||44===t||45===t||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||91===t||92===t||93===t||94===t||96===t||123===t||124===t||125===t||126===t||161===t||t>=162&&t<=165||166===t||167===t||169===t||171===t||172===t||174===t||176===t||177===t||182===t||187===t||191===t||215===t||247===t||t>=8208&&t<=8213||t>=8214&&t<=8215||8216===t||8217===t||8218===t||t>=8219&&t<=8220||8221===t||8222===t||8223===t||t>=8224&&t<=8231||t>=8240&&t<=8248||8249===t||8250===t||t>=8251&&t<=8254||t>=8257&&t<=8259||8260===t||8261===t||8262===t||t>=8263&&t<=8273||8274===t||8275===t||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||8608===t||t>=8609&&t<=8610||8611===t||t>=8612&&t<=8613||8614===t||t>=8615&&t<=8621||8622===t||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||8658===t||8659===t||8660===t||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||8968===t||8969===t||8970===t||8971===t||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||9001===t||9002===t||t>=9003&&t<=9083||9084===t||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||9655===t||t>=9656&&t<=9664||9665===t||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||9839===t||t>=9840&&t<=10087||10088===t||10089===t||10090===t||10091===t||10092===t||10093===t||10094===t||10095===t||10096===t||10097===t||10098===t||10099===t||10100===t||10101===t||t>=10132&&t<=10175||t>=10176&&t<=10180||10181===t||10182===t||t>=10183&&t<=10213||10214===t||10215===t||10216===t||10217===t||10218===t||10219===t||10220===t||10221===t||10222===t||10223===t||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||10627===t||10628===t||10629===t||10630===t||10631===t||10632===t||10633===t||10634===t||10635===t||10636===t||10637===t||10638===t||10639===t||10640===t||10641===t||10642===t||10643===t||10644===t||10645===t||10646===t||10647===t||10648===t||t>=10649&&t<=10711||10712===t||10713===t||10714===t||10715===t||t>=10716&&t<=10747||10748===t||10749===t||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||11158===t||t>=11159&&t<=11263||t>=11776&&t<=11777||11778===t||11779===t||11780===t||11781===t||t>=11782&&t<=11784||11785===t||11786===t||11787===t||11788===t||11789===t||t>=11790&&t<=11798||11799===t||t>=11800&&t<=11801||11802===t||11803===t||11804===t||11805===t||t>=11806&&t<=11807||11808===t||11809===t||11810===t||11811===t||11812===t||11813===t||11814===t||11815===t||11816===t||11817===t||t>=11818&&t<=11822||11823===t||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||11840===t||11841===t||11842===t||t>=11843&&t<=11855||t>=11856&&t<=11857||11858===t||t>=11859&&t<=11903||t>=12289&&t<=12291||12296===t||12297===t||12298===t||12299===t||12300===t||12301===t||12302===t||12303===t||12304===t||12305===t||t>=12306&&t<=12307||12308===t||12309===t||12310===t||12311===t||12312===t||12313===t||12314===t||12315===t||12316===t||12317===t||t>=12318&&t<=12319||12320===t||12336===t||64830===t||64831===t||t>=65093&&t<=65094}function hn(t){t.forEach((function(t){if(delete t.location,ye(t)||ve(t))for(var e in t.options)delete t.options[e].location,hn(t.options[e].value);else de(t)&&we(t.style)||(me(t)||ge(t))&&_e(t.style)?delete t.style.location:Ee(t)&&hn(t.children)}))}function un(t,e){void 0===e&&(e={}),e=he({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var n=new an(t,e).parse();if(n.err){var r=SyntaxError(se[n.err.kind]);
|
|
580
580
|
// @ts-expect-error Assign to error object
|
|
581
|
-
throw
|
|
581
|
+
throw r.location=n.err.location,
|
|
582
582
|
// @ts-expect-error Assign to error object
|
|
583
|
-
|
|
583
|
+
r.originalMessage=n.err.message,r}return(null==e?void 0:e.captureLocation)||hn(n.val),n.val}
|
|
584
584
|
|
|
585
585
|
// Main
|
|
586
586
|
|
|
587
|
-
function
|
|
587
|
+
function fn(t,e){var n=e&&e.cache?e.cache:En,r=e&&e.serializer?e.serializer:yn;return(e&&e.strategy?e.strategy:gn)(t,{cache:n,serializer:r})}
|
|
588
588
|
|
|
589
589
|
// Strategy
|
|
590
590
|
|
|
591
|
-
function
|
|
591
|
+
function pn(t,e,n,r){var i,o=null==(i=r)||"number"==typeof i||"boolean"==typeof i?r:n(r),a=e.get(o);return void 0===a&&(a=t.call(this,r),e.set(o,a)),a}function dn(t,e,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=e.get(i);return void 0===o&&(o=t.apply(this,r),e.set(i,o)),o}function mn(t,e,n,r,i){return n.bind(e,t,r,i)}function gn(t,e){return mn(t,this,1===t.length?pn:dn,e.cache.create(),e.serializer)}
|
|
592
592
|
// Serializer
|
|
593
|
-
var
|
|
593
|
+
var yn=function(){return JSON.stringify(arguments)};
|
|
594
594
|
|
|
595
595
|
// Cache
|
|
596
596
|
|
|
597
|
-
function
|
|
597
|
+
function vn(){this.cache=Object.create(null)}vn.prototype.get=function(t){return this.cache[t]},vn.prototype.set=function(t,e){this.cache[t]=e};var bn,En={create:function(){
|
|
598
598
|
// @ts-ignore
|
|
599
|
-
return new
|
|
599
|
+
return new vn}},wn={variadic:function(t,e){return mn(t,this,dn,e.cache.create(),e.serializer)},monadic:function(t,e){return mn(t,this,pn,e.cache.create(),e.serializer)}};!function(t){
|
|
600
600
|
// When we have a placeholder but no value to format
|
|
601
601
|
t.MISSING_VALUE="MISSING_VALUE",
|
|
602
602
|
// When value supplied is invalid
|
|
603
603
|
t.INVALID_VALUE="INVALID_VALUE",
|
|
604
604
|
// When we need specific Intl API but it's not available
|
|
605
|
-
t.MISSING_INTL_API="MISSING_INTL_API"}(
|
|
605
|
+
t.MISSING_INTL_API="MISSING_INTL_API"}(bn||(bn={}));var _n,Nn=/** @class */function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.code=n,i.originalMessage=r,i}return ae(e,t),e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),Tn=/** @class */function(t){function e(e,n,r,i){return t.call(this,'Invalid values for "'.concat(e,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),bn.INVALID_VALUE,i)||this}return ae(e,t),e}(Nn),An=/** @class */function(t){function e(e,n,r){return t.call(this,'Value for "'.concat(e,'" must be of type ').concat(n),bn.INVALID_VALUE,r)||this}return ae(e,t),e}(Nn),Bn=/** @class */function(t){function e(e,n){return t.call(this,'The intl string context variable "'.concat(e,'" was not provided to the string "').concat(n,'"'),bn.MISSING_VALUE,n)||this}return ae(e,t),e}(Nn);function In(t){return"function"==typeof t}
|
|
606
606
|
// TODO(skeleton): add skeleton support
|
|
607
|
-
function
|
|
607
|
+
function Sn(t,e,n,r,i,o,
|
|
608
608
|
// For debugging
|
|
609
609
|
a){
|
|
610
610
|
// Hot path for straight simple msg translations
|
|
611
|
-
if(1===t.length&&
|
|
611
|
+
if(1===t.length&&fe(t[0]))return[{type:_n.literal,value:t[0].value}];for(var s=[],c=0,l=t;c<l.length;c++){var h=l[c];
|
|
612
612
|
// Exit early for string parts.
|
|
613
|
-
if(
|
|
613
|
+
if(fe(h))s.push({type:_n.literal,value:h.value});else
|
|
614
614
|
// TODO: should this part be literal type?
|
|
615
615
|
// Replace `#` in plural rules with the actual numeric value.
|
|
616
|
-
if(be(
|
|
616
|
+
if(be(h))"number"==typeof o&&s.push({type:_n.literal,value:n.getNumberFormat(e).format(o)});else{var u=h.value;
|
|
617
617
|
// Enforce that all required values are provided by the caller.
|
|
618
|
-
if(!i||!(
|
|
618
|
+
if(!i||!(u in i))throw new Bn(u,a);var f=i[u];if(pe(h))f&&"string"!=typeof f&&"number"!=typeof f||(f="string"==typeof f||"number"==typeof f?String(f):""),s.push({type:"string"==typeof f?_n.literal:_n.object,value:f});else
|
|
619
619
|
// Recursively format plural and select parts' option — which can be a
|
|
620
620
|
// nested pattern structure. The choosing of the option to use is
|
|
621
621
|
// abstracted-by and delegated-to the part helper object.
|
|
622
|
-
if(
|
|
622
|
+
if(me(h)){var p="string"==typeof h.style?r.date[h.style]:_e(h.style)?h.style.parsedOptions:void 0;s.push({type:_n.literal,value:n.getDateTimeFormat(e,p).format(f)})}else if(ge(h)){p="string"==typeof h.style?r.time[h.style]:_e(h.style)?h.style.parsedOptions:r.time.medium;s.push({type:_n.literal,value:n.getDateTimeFormat(e,p).format(f)})}else if(de(h)){(p="string"==typeof h.style?r.number[h.style]:we(h.style)?h.style.parsedOptions:void 0)&&p.scale&&(f*=p.scale||1),s.push({type:_n.literal,value:n.getNumberFormat(e,p).format(f)})}else{if(Ee(h)){var d=h.children,m=h.value,g=i[m];if(!In(g))throw new An(m,"function",a);var y=g(Sn(d,e,n,r,i,o).map((function(t){return t.value})));Array.isArray(y)||(y=[y]),s.push.apply(s,y.map((function(t){return{type:"string"==typeof t?_n.literal:_n.object,value:t}})))}if(ye(h)){if(!(v=h.options[f]||h.options.other))throw new Tn(h.value,f,Object.keys(h.options),a);s.push.apply(s,Sn(v.value,e,n,r,i))}else if(ve(h)){var v;if(!(v=h.options["=".concat(f)])){if(!Intl.PluralRules)throw new Nn('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',bn.MISSING_INTL_API,a);var b=n.getPluralRules(e,{type:h.pluralType}).select(f-(h.offset||0));v=h.options[b]||h.options.other}if(!v)throw new Tn(h.value,f,Object.keys(h.options),a);s.push.apply(s,Sn(v.value,e,n,r,i,f-(h.offset||0)))}else;}}}return function(t){return t.length<2?t:t.reduce((function(t,e){var n=t[t.length-1];return n&&n.type===_n.literal&&e.type===_n.literal?n.value+=e.value:t.push(e),t}),[])}(s)}
|
|
623
623
|
/*
|
|
624
624
|
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
|
625
625
|
Copyrights licensed under the New BSD License.
|
|
626
626
|
See the accompanying LICENSE file for terms.
|
|
627
627
|
*/
|
|
628
628
|
// -- MessageFormat --------------------------------------------------------
|
|
629
|
-
function
|
|
629
|
+
function Pn(t,e){return e?Object.keys(t).reduce((function(n,r){var i,o;return n[r]=(i=t[r],(o=e[r])?he(he(he({},i||{}),o||{}),Object.keys(i).reduce((function(t,e){return t[e]=he(he({},i[e]),o[e]||{}),t}),{})):i),n}),he({},t)):t}function Hn(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,n){t[e]=n}}}}}!function(t){t[t.literal=0]="literal",t[t.object=1]="object"}(_n||(_n={}));var Ln=/** @class */function(){function t(e,n,r,i){var o,a=this;if(void 0===n&&(n=t.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(t){var e=a.formatToParts(t);
|
|
630
630
|
// Hot path for straight simple msg translations
|
|
631
|
-
if(1===e.length)return e[0].value;var
|
|
631
|
+
if(1===e.length)return e[0].value;var n=e.reduce((function(t,e){return t.length&&e.type===_n.literal&&"string"==typeof t[t.length-1]?t[t.length-1]+=e.value:t.push(e.value),t}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(t){return Sn(a.ast,a.locales,a.formatters,a.formats,t,void 0,a.message)},this.resolvedOptions=function(){return{locale:a.resolvedLocale.toString()}},this.getAst=function(){return a.ast},
|
|
632
632
|
// Defined first because it's used to build the format pattern.
|
|
633
|
-
this.locales=
|
|
633
|
+
this.locales=n,this.resolvedLocale=t.resolveLocale(n),"string"==typeof e){if(this.message=e,!t.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
634
634
|
// Parse string messages into an AST.
|
|
635
635
|
this.ast=t.__parse(e,{ignoreTag:null==i?void 0:i.ignoreTag,locale:this.resolvedLocale})}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");
|
|
636
636
|
// Creates a new object with the specified `formats` merged with the default
|
|
637
637
|
// formats.
|
|
638
|
-
this.formats=
|
|
638
|
+
this.formats=Pn(t.formats,r),this.formatters=i&&i.formatters||(void 0===(o=this.formatterCache)&&(o={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:fn((function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new((t=Intl.NumberFormat).bind.apply(t,ue([void 0],e,!1)))}),{cache:Hn(o.number),strategy:wn.variadic}),getDateTimeFormat:fn((function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new((t=Intl.DateTimeFormat).bind.apply(t,ue([void 0],e,!1)))}),{cache:Hn(o.dateTime),strategy:wn.variadic}),getPluralRules:fn((function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new((t=Intl.PluralRules).bind.apply(t,ue([void 0],e,!1)))}),{cache:Hn(o.pluralRules),strategy:wn.variadic})})}return Object.defineProperty(t,"defaultLocale",{get:function(){return t.memoizedDefaultLocale||(t.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),t.memoizedDefaultLocale},enumerable:!1,configurable:!0}),t.memoizedDefaultLocale=null,t.resolveLocale=function(t){var e=Intl.NumberFormat.supportedLocalesOf(t);return e.length>0?new Intl.Locale(e[0]):new Intl.Locale("string"==typeof t?t:t[0])},t.__parse=un,
|
|
639
639
|
// Default format options used as the prototype of the `formats` provided to the
|
|
640
640
|
// constructor. These are used when constructing the internal Intl.NumberFormat
|
|
641
641
|
// and Intl.DateTimeFormat instances.
|
|
642
|
-
t.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"}}},t}();const
|
|
642
|
+
t.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"}}},t}();const On={},xn=(t,e,n)=>n?(e in On||(On[e]={}),t in On[e]||(On[e][t]=n),n):n,Cn=(t,e)=>{if(null==e)return;if(e in On&&t in On[e])return On[e][t];const n=or(e);for(let r=0;r<n.length;r++){const i=Fn(n[r],t);if(i)return xn(t,e,i)}};let Mn;const Rn=Kt({});function Un(t){return t in Mn}function Fn(t,e){if(!Un(t))return null;const n=function(t){return Mn[t]||null}(t);return function(t,e){if(null==e)return;if(e in t)return t[e];const n=e.split(".");let r=t;for(let t=0;t<n.length;t++)if("object"==typeof r){if(t>0){const e=n.slice(t,n.length).join(".");if(e in r){r=r[e];break}}r=r[n[t]]}else r=void 0;return r}(n,e)}function Dn(t,...e){delete On[t],Rn.update((n=>(n[t]=ie.all([n[t]||{},...e]),n)))}Yt([Rn],(([t])=>Object.keys(t))),Rn.subscribe((t=>Mn=t));const kn={};function Gn(t){return kn[t]}function $n(t){return null!=t&&or(t).some((t=>{var e;return null==(e=Gn(t))?void 0:e.size}))}function jn(t,e){const n=Promise.all(e.map((e=>(function(t,e){kn[t].delete(e),0===kn[t].size&&delete kn[t]}(t,e),e().then((t=>t.default||t))))));return n.then((e=>Dn(t,...e)))}const Wn={};function Vn(t){if(!$n(t))return t in Wn?Wn[t]:Promise.resolve();const e=function(t){return or(t).map((t=>{const e=Gn(t);return[t,e?[...e]:[]]})).filter((([,t])=>t.length>0))}(t);return Wn[t]=Promise.all(e.map((([t,e])=>jn(t,e)))).then((()=>{if($n(t))return Vn(t);delete Wn[t]})),Wn[t]}const Xn={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 zn(){return Xn}const Kn=Kt(!1);var Yn=Object.defineProperty,Zn=Object.defineProperties,qn=Object.getOwnPropertyDescriptors,Jn=Object.getOwnPropertySymbols,Qn=Object.prototype.hasOwnProperty,tr=Object.prototype.propertyIsEnumerable,er=(t,e,n)=>e in t?Yn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;let nr;const rr=Kt(null);function ir(t){return t.split("-").map(((t,e,n)=>n.slice(0,e+1).join("-"))).reverse()}function or(t,e=zn().fallbackLocale){const n=ir(t);return e?[...new Set([...n,...ir(e)])]:n}function ar(){return null!=nr?nr:void 0}rr.subscribe((t=>{nr=null!=t?t:void 0,"undefined"!=typeof window&&null!=t&&document.documentElement.setAttribute("lang",t)}));const sr=(cr=((t,e)=>{for(var n in e||(e={}))Qn.call(e,n)&&er(t,n,e[n]);if(Jn)for(var n of Jn(e))tr.call(e,n)&&er(t,n,e[n]);return t})({},rr),Zn(cr,qn({set:t=>{if(t&&function(t){if(null==t)return;const e=or(t);for(let t=0;t<e.length;t++){const n=e[t];if(Un(n))return n}}(t)&&$n(t)){const{loadingDelay:e}=zn();let n;return"undefined"!=typeof window&&null!=ar()&&e?n=window.setTimeout((()=>Kn.set(!0)),e):Kn.set(!0),Vn(t).then((()=>{rr.set(t)})).finally((()=>{clearTimeout(n),Kn.set(!1)}))}return rr.set(t)}})));var cr;const lr=t=>{const e=Object.create(null);return n=>{const r=JSON.stringify(n);return r in e?e[r]:e[r]=t(n)}};var hr=Object.defineProperty,ur=Object.getOwnPropertySymbols,fr=Object.prototype.hasOwnProperty,pr=Object.prototype.propertyIsEnumerable,dr=(t,e,n)=>e in t?hr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,mr=(t,e)=>{for(var n in e||(e={}))fr.call(e,n)&&dr(t,n,e[n]);if(ur)for(var n of ur(e))pr.call(e,n)&&dr(t,n,e[n]);return t},gr=(t,e)=>{var n={};for(var r in t)fr.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&ur)for(var r of ur(t))e.indexOf(r)<0&&pr.call(t,r)&&(n[r]=t[r]);return n};const yr=(t,e)=>{const{formats:n}=zn();if(t in n&&e in n[t])return n[t][e];throw new Error(`[svelte-i18n] Unknown "${e}" ${t} format.`)},vr=lr((t=>{var e=t,{locale:n,format:r}=e,i=gr(e,["locale","format"]);if(null==n)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return r&&(i=yr("number",r)),new Intl.NumberFormat(n,i)})),br=lr((t=>{var e=t,{locale:n,format:r}=e,i=gr(e,["locale","format"]);if(null==n)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return r?i=yr("date",r):0===Object.keys(i).length&&(i=yr("date","short")),new Intl.DateTimeFormat(n,i)})),Er=lr((t=>{var e=t,{locale:n,format:r}=e,i=gr(e,["locale","format"]);if(null==n)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return r?i=yr("time",r):0===Object.keys(i).length&&(i=yr("time","short")),new Intl.DateTimeFormat(n,i)})),wr=lr((
|
|
643
643
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
644
|
-
(t,e=
|
|
644
|
+
(t,e=ar())=>new Ln(t,e,zn().formats,{ignoreTag:zn().ignoreTag}))),_r=(t,e={})=>{var n,r,i,o;let a=e;"object"==typeof t&&(a=t,t=a.id);const{values:s,locale:c=ar(),default:l}=a;if(null==c)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let h=Cn(t,c);if(h){if("string"!=typeof h)return console.warn(`[svelte-i18n] Message with id "${t}" must be of type "string", found: "${typeof h}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),h}else h=null!=(o=null!=(i=null==(r=(n=zn()).handleMissingMessage)?void 0:r.call(n,{locale:c,id:t,defaultValue:l}))?i:l)?o:t;if(!s)return h;let u=h;try{u=wr(h,c).format(s)}catch(e){e instanceof Error&&console.warn(`[svelte-i18n] Message "${t}" has syntax error:`,e.message)}return u},Nr=(t,e)=>((t={})=>{var e=t,{locale:n=ar()}=e,r=gr(e,["locale"]);return Er(mr({locale:n},r))})(e).format(t),Tr=(t,e)=>((t={})=>{var e=t,{locale:n=ar()}=e,r=gr(e,["locale"]);return br(mr({locale:n},r))})(e).format(t),Ar=(t,e)=>((t={})=>{var e=t,{locale:n=ar()}=e,r=gr(e,["locale"]);return vr(mr({locale:n},r))})(e).format(t),Br=(t,e=ar())=>Cn(t,e),Ir=Yt([sr,Rn],(()=>_r));Yt([sr],(()=>Nr)),Yt([sr],(()=>Tr)),Yt([sr],(()=>Ar)),Yt([sr,Rn],(()=>Br)),window.emWidgets={topic:(t,e=0)=>{if(-1==Vt.indexOf(t)){let n=new Wt(e);Xt[t]=n,Vt.push(t)}return Xt[t]}};
|
|
645
645
|
/**
|
|
646
646
|
* @name getDevice
|
|
647
647
|
* @description A method that returns the type of the device
|
|
648
648
|
* @param {String} userAgent window.navigator.userAgent
|
|
649
649
|
* @returns {String} Android/iPhone/iPad/PC
|
|
650
650
|
*/
|
|
651
|
-
const
|
|
652
|
-
/* src/GeneralNavigationBar.svelte generated by Svelte v3.59.2 */function
|
|
653
|
-
// (
|
|
654
|
-
function
|
|
655
|
-
/*div2_binding*/,t[
|
|
656
|
-
/*div2_binding*/,t[
|
|
657
|
-
// (
|
|
658
|
-
function
|
|
659
|
-
// (
|
|
660
|
-
function
|
|
661
|
-
// (
|
|
662
|
-
function
|
|
663
|
-
return t[
|
|
664
|
-
// (
|
|
665
|
-
function
|
|
666
|
-
// (
|
|
667
|
-
function
|
|
668
|
-
return t[
|
|
669
|
-
// (
|
|
670
|
-
function
|
|
671
|
-
return t[
|
|
672
|
-
// (
|
|
673
|
-
function
|
|
674
|
-
// (
|
|
675
|
-
function
|
|
651
|
+
const Sr=t=>t.toLowerCase().match(/android/i)?"Android":t.toLowerCase().match(/iphone/i)?"iPhone":t.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC";function Pr(t,e){Dn(t,e)}const Hr={en:{secondaryMenuTitle:"Categories"},"zh-hk":{secondaryMenuTitle:"類別"},fr:{secondaryMenuTitle:"Catégories"},ro:{secondaryMenuTitle:"Categorii"},es:{secondaryMenuTitle:"Categorias"},pt:{secondaryMenuTitle:"Categorias"},hr:{secondaryMenuTitle:"Kategorije"},"pt-br":{secondaryMenuTitle:"Categorias"},"es-mx":{secondaryMenuTitle:"Categorias"}};
|
|
652
|
+
/* src/GeneralNavigationBar.svelte generated by Svelte v3.59.2 */function Lr(t,e,n){const r=t.slice();return r[41]=e[n],r[43]=n,r}function Or(t,e,n){const r=t.slice();return r[41]=e[n],r}
|
|
653
|
+
// (195:0) {#if !isLoading && isMobile && showNavigation}
|
|
654
|
+
function xr(t){let e,n,r,i,o,a,s,c,l=!/*navigationBarSimple*/t[6]&&Cr(t),m=/*primaryMenuSpliced*/t[7],g=[];for(let e=0;e<m.length;e+=1)g[e]=Fr(Lr(t,m,e));let v=!/*navigationBarSimple*/t[6]&&Dr(t);return{c(){e=d("div"),n=d("div"),l&&l.c(),r=y(),i=d("div");for(let t=0;t<g.length;t+=1)g[t].c();o=y(),v&&v.c(),E(i,"class",a="NavigationBar "+(/*navigationWindowOpened*/t[4]?"NavigationBarOpened":"")+" "+(/*navigationBarSimple*/t[6]?"NavigationBarSimple":"")),E(i,"part",s="NavigationBar "+(/*navigationWindowOpened*/t[4]?"NavigationBarOpened":"")+" "+(/*navigationBarSimple*/t[6]?"NavigationBarSimple":"")),E(n,"class","NavigationPanel"),E(e,"class",c="NavigationWrapper "+(/*mobileLandscapeView*/t[10]?"NavigationWrapperLandScape":""))},m(a,s){u(a,e,s),h(e,n),l&&l.m(n,null),h(n,r),h(n,i);for(let t=0;t<g.length;t+=1)g[t]&&g[t].m(i,null);h(i,o),v&&v.m(i,null)
|
|
655
|
+
/*div2_binding*/,t[27](e)},p(t,h){if(/*navigationBarSimple*/t[6]?l&&(l.d(1),l=null):l?l.p(t,h):(l=Cr(t),l.c(),l.m(n,r)),/*activeMenuItemId, primaryMenuSpliced, triggerNavigation*/32928&h[0]){let e;for(m=/*primaryMenuSpliced*/t[7],e=0;e<m.length;e+=1){const n=Lr(t,m,e);g[e]?g[e].p(n,h):(g[e]=Fr(n),g[e].c(),g[e].m(i,o))}for(;e<g.length;e+=1)g[e].d(1);g.length=m.length}/*navigationBarSimple*/t[6]?v&&(v.d(1),v=null):v?v.p(t,h):(v=Dr(t),v.c(),v.m(i,null)),/*navigationWindowOpened, navigationBarSimple*/80&h[0]&&a!==(a="NavigationBar "+(/*navigationWindowOpened*/t[4]?"NavigationBarOpened":"")+" "+(/*navigationBarSimple*/t[6]?"NavigationBarSimple":""))&&E(i,"class",a),/*navigationWindowOpened, navigationBarSimple*/80&h[0]&&s!==(s="NavigationBar "+(/*navigationWindowOpened*/t[4]?"NavigationBarOpened":"")+" "+(/*navigationBarSimple*/t[6]?"NavigationBarSimple":""))&&E(i,"part",s),/*mobileLandscapeView*/1024&h[0]&&c!==(c="NavigationWrapper "+(/*mobileLandscapeView*/t[10]?"NavigationWrapperLandScape":""))&&E(e,"class",c)},d(n){n&&f(e),l&&l.d(),p(g,n),v&&v.d()
|
|
656
|
+
/*div2_binding*/,t[27](null)}}}
|
|
657
|
+
// (198:6) {#if !navigationBarSimple}
|
|
658
|
+
function Cr(t){let e,n,r,i,o,a,s,c,l,m,v=/*secondarymenutitle*/(t[0]||/*$_*/t[12]("secondaryMenuTitle"))+"",_=/*secondaryMenu*/t[8],N=[];for(let e=0;e<_.length;e+=1)N[e]=Rr(Or(t,_,e));return{c(){e=d("div"),n=d("span"),n.innerHTML='<slot name="close"><svg class="w-6 h-6" part="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path part="ModalCloseBtnPath" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></slot>',r=y(),i=d("h3"),o=g(v),a=y(),s=d("div");for(let t=0;t<N.length;t+=1)N[t].c();E(n,"class","ModalCloseBtn"),E(n,"part","ModalCloseBtn"),E(n,"role","button"),E(i,"class","NavigationWindowTitle"),E(s,"class","NavigationSecondaryWrapper"),E(e,"class",c="NavigationWindow "+(/*navigationWindowOpened*/t[4]?"NavigationWindowOpened":""))},m(c,f){u(c,e,f),h(e,n),h(e,r),h(e,i),h(i,o),h(e,a),h(e,s);for(let t=0;t<N.length;t+=1)N[t]&&N[t].m(s,null);l||(m=b(n,"click",/*navigationWindowToggle*/t[14]),l=!0)},p(t,n){if(/*secondarymenutitle, $_*/4097&n[0]&&v!==(v=/*secondarymenutitle*/(t[0]||/*$_*/t[12]("secondaryMenuTitle"))+"")&&w(o,v),/*activeMenuItemId, secondaryMenu, triggerNavigation*/33056&n[0]){let e;for(_=/*secondaryMenu*/t[8],e=0;e<_.length;e+=1){const r=Or(t,_,e);N[e]?N[e].p(r,n):(N[e]=Rr(r),N[e].c(),N[e].m(s,null))}for(;e<N.length;e+=1)N[e].d(1);N.length=_.length}/*navigationWindowOpened*/16&n[0]&&c!==(c="NavigationWindow "+(/*navigationWindowOpened*/t[4]?"NavigationWindowOpened":""))&&E(e,"class",c)},d(t){t&&f(e),p(N,t),l=!1,m()}}}
|
|
659
|
+
// (209:16) {#if item.img}
|
|
660
|
+
function Mr(t){let e,n,r,i;return{c(){e=d("div"),n=d("img"),E(n,"class","NavigationSecondaryItemImg"),E(n,"part","NavigationSecondaryItemImg"),c(n.src,r=/*item*/t[41].img)||E(n,"src",r),E(n,"alt",i=/*item*/t[41].label),E(e,"class","NavigationSecondaryItemImgWrapper"),E(e,"part","NavigationSecondaryItemImgWrapper")},m(t,r){u(t,e,r),h(e,n)},p(t,e){/*secondaryMenu*/256&e[0]&&!c(n.src,r=/*item*/t[41].img)&&E(n,"src",r),/*secondaryMenu*/256&e[0]&&i!==(i=/*item*/t[41].label)&&E(n,"alt",i)},d(t){t&&f(e)}}}
|
|
661
|
+
// (207:12) {#each secondaryMenu as item}
|
|
662
|
+
function Rr(t){let e,n,r,i,o,a,s,c,l=/*item*/t[41].label+"",p=/*item*/t[41].img&&Mr(t);function m(){/*click_handler*/
|
|
663
|
+
return t[25](/*item*/t[41])}return{c(){e=d("div"),p&&p.c(),n=y(),r=d("p"),i=g(l),o=y(),E(r,"class","NavigationSecondaryItemLabel"),E(r,"part","NavigationSecondaryItemLabel"),E(e,"class",a="NavigationSecondaryItemAnchor "+(/*activeMenuItemId*/t[5]===/*item*/t[41].id?"ActiveItem":""))},m(t,a){u(t,e,a),p&&p.m(e,null),h(e,n),h(e,r),h(r,i),h(e,o),s||(c=b(e,"click",m),s=!0)},p(r,o){/*item*/(t=r)[41].img?p?p.p(t,o):(p=Mr(t),p.c(),p.m(e,n)):p&&(p.d(1),p=null),/*secondaryMenu*/256&o[0]&&l!==(l=/*item*/t[41].label+"")&&w(i,l),/*activeMenuItemId, secondaryMenu*/288&o[0]&&a!==(a="NavigationSecondaryItemAnchor "+(/*activeMenuItemId*/t[5]===/*item*/t[41].id?"ActiveItem":""))&&E(e,"class",a)},d(t){t&&f(e),p&&p.d(),s=!1,c()}}}
|
|
664
|
+
// (223:12) {#if item.img}
|
|
665
|
+
function Ur(t){let e,n,r,i;return{c(){e=d("div"),n=d("img"),E(n,"class","NavigationPrimaryItemImg"),c(n.src,r=/*item*/t[41].img)||E(n,"src",r),E(n,"alt",i=/*item*/t[41].label),E(e,"class","NavigationPrimaryItemImgWrapper")},m(t,r){u(t,e,r),h(e,n)},p(t,e){/*primaryMenuSpliced*/128&e[0]&&!c(n.src,r=/*item*/t[41].img)&&E(n,"src",r),/*primaryMenuSpliced*/128&e[0]&&i!==(i=/*item*/t[41].label)&&E(n,"alt",i)},d(t){t&&f(e)}}}
|
|
666
|
+
// (221:8) {#each primaryMenuSpliced as item, i}
|
|
667
|
+
function Fr(t){let e,n,r,i,o,a,s,c=/*item*/t[41].label+"",l=/*item*/t[41].img&&Ur(t);function p(){/*click_handler_1*/
|
|
668
|
+
return t[26](/*item*/t[41])}return{c(){e=d("div"),l&&l.c(),n=y(),r=d("p"),i=g(c),E(r,"class","NavigationPrimaryItemLabel"),E(e,"class",o="NavigationPrimaryItemAnchor NavItem"+/*i*/t[43]+" "+(/*activeMenuItemId*/t[5]===/*item*/t[41].id?"ActiveItem":""))},m(t,o){u(t,e,o),l&&l.m(e,null),h(e,n),h(e,r),h(r,i),a||(s=b(e,"click",p),a=!0)},p(r,a){/*item*/(t=r)[41].img?l?l.p(t,a):(l=Ur(t),l.c(),l.m(e,n)):l&&(l.d(1),l=null),/*primaryMenuSpliced*/128&a[0]&&c!==(c=/*item*/t[41].label+"")&&w(i,c),/*activeMenuItemId, primaryMenuSpliced*/160&a[0]&&o!==(o="NavigationPrimaryItemAnchor NavItem"+/*i*/t[43]+" "+(/*activeMenuItemId*/t[5]===/*item*/t[41].id?"ActiveItem":""))&&E(e,"class",o)},d(t){t&&f(e),l&&l.d(),a=!1,s()}}}
|
|
669
|
+
// (231:8) {#if !navigationBarSimple}
|
|
670
|
+
function Dr(t){let e,n,r,i,o;function a(t,e){/*isFlowerMenu*/
|
|
671
|
+
return t[11]?kr:Gr}let s=a(t),c=s(t);return{c(){e=d("button"),n=d("span"),c.c(),E(n,"class","NavigationButtonSpan"),E(n,"part","NavigationButtonSpan"),E(e,"class",r="NavigationButton "+(/*navigationWindowOpened*/t[4]?"NavigationButtonActive":""))},m(r,a){u(r,e,a),h(e,n),c.m(n,null),i||(o=b(e,"click",/*navigationWindowToggle*/t[14]),i=!0)},p(t,i){s===(s=a(t))&&c?c.p(t,i):(c.d(1),c=s(t),c&&(c.c(),c.m(n,null))),/*navigationWindowOpened*/16&i[0]&&r!==(r="NavigationButton "+(/*navigationWindowOpened*/t[4]?"NavigationButtonActive":""))&&E(e,"class",r)},d(t){t&&f(e),c.d(),i=!1,o()}}}
|
|
672
|
+
// (240:14) {:else}
|
|
673
|
+
function kr(t){let e,n,r,i,o,a,s;return{c(){e=d("div"),n=d("span"),r=y(),i=d("span"),o=y(),a=d("span"),E(n,"class","middleIconLine"),E(i,"class","middleIconLine"),E(a,"class","middleIconLine"),E(e,"class",s="labelMiddleIcon "+(/*navigationWindowOpened*/t[4]?"labelMiddleIconActive":""))},m(t,s){u(t,e,s),h(e,n),h(e,r),h(e,i),h(e,o),h(e,a)},p(t,n){/*navigationWindowOpened*/16&n[0]&&s!==(s="labelMiddleIcon "+(/*navigationWindowOpened*/t[4]?"labelMiddleIconActive":""))&&E(e,"class",s)},d(t){t&&f(e)}}}
|
|
674
|
+
// (234:14) {#if !isFlowerMenu}
|
|
675
|
+
function Gr(t){let e;function n(t,e){/*imageIconUrl*/
|
|
676
|
+
return t[9]?jr:$r}let r=n(t),i=r(t);return{c(){i.c(),e=v()},m(t,n){i.m(t,n),u(t,e,n)},p(t,o){r===(r=n(t))&&i?i.p(t,o):(i.d(1),i=r(t),i&&(i.c(),i.m(e.parentNode,e)))},d(t){i.d(t),t&&f(e)}}}
|
|
677
|
+
// (237:16) {:else}
|
|
678
|
+
function $r(e){let n,r,i,o,a,s,c,l,p,d,g,y,v,b;return{c(){n=m("svg"),r=m("g"),i=m("g"),o=m("rect"),a=m("rect"),s=m("g"),c=m("rect"),l=m("rect"),p=m("g"),d=m("rect"),g=m("rect"),y=m("g"),v=m("rect"),b=m("rect"),E(o,"class","b"),E(o,"part","b"),E(o,"width","10"),E(o,"height","10"),E(o,"rx","2"),E(a,"class","c"),E(a,"part","c"),E(a,"x","0.5"),E(a,"y","0.5"),E(a,"width","9"),E(a,"height","9"),E(a,"rx","1.5"),E(i,"class","a"),E(i,"part","a"),E(i,"transform","translate(150 514)"),E(c,"class","b"),E(c,"part","b"),E(c,"width","10"),E(c,"height","10"),E(c,"rx","2"),E(l,"class","c"),E(l,"part","c"),E(l,"x","0.5"),E(l,"y","0.5"),E(l,"width","9"),E(l,"height","9"),E(l,"rx","1.5"),E(s,"class","a"),E(s,"part","a"),E(s,"transform","translate(161 514)"),E(d,"class","b"),E(d,"part","b"),E(d,"width","10"),E(d,"height","10"),E(d,"rx","2"),E(g,"class","c"),E(g,"part","c"),E(g,"x","0.5"),E(g,"y","0.5"),E(g,"width","9"),E(g,"height","9"),E(g,"rx","1.5"),E(p,"class","a"),E(p,"part","a"),E(p,"transform","translate(161 525)"),E(v,"class","b"),E(v,"part","b"),E(v,"width","10"),E(v,"height","10"),E(v,"rx","2"),E(b,"class","c"),E(b,"part","c"),E(b,"x","0.5"),E(b,"y","0.5"),E(b,"width","9"),E(b,"height","9"),E(b,"rx","1.5"),E(y,"class","a"),E(y,"part","a"),E(y,"transform","translate(150 525)"),E(r,"transform","translate(-150 -514)"),E(n,"class","middleIcon"),E(n,"xmlns","http://www.w3.org/2000/svg"),E(n,"width","21"),E(n,"height","21"),E(n,"viewBox","0 0 21 21")},m(t,e){u(t,n,e),h(n,r),h(r,i),h(i,o),h(i,a),h(r,s),h(s,c),h(s,l),h(r,p),h(p,d),h(p,g),h(r,y),h(y,v),h(y,b)},p:t,d(t){t&&f(n)}}}
|
|
679
|
+
// (235:16) {#if imageIconUrl}
|
|
680
|
+
function jr(t){let e,n;return{c(){e=d("img"),c(e.src,n=/*imageIconUrl*/t[9])||E(e,"src",n),E(e,"class","middleIcon"),E(e,"alt",/*imageIconUrl*/t[9])},m(t,n){u(t,e,n)},p(t,r){/*imageIconUrl*/512&r[0]&&!c(e.src,n=/*imageIconUrl*/t[9])&&E(e,"src",n),/*imageIconUrl*/512&r[0]&&E(e,"alt",/*imageIconUrl*/t[9])},d(t){t&&f(e)}}}
|
|
681
|
+
// (454:0) {:else}
|
|
682
|
+
function Wr(t){let e;return{c(){e=d("style"),e.textContent='.NavigationWrapper {\n background: var(--emfe-w-color-gray-50, #F9F8F8);\n width: 100%;\n}\n\n.NavigationPanel {\n position: fixed;\n display: flex;\n flex-direction: column;\n bottom: 0;\n width: 100%;\n z-index: 30;\n}\n\n.NavigationWindow {\n display: flex;\n flex-direction: column;\n backdrop-filter: blur(2px);\n background: linear-gradient(0deg, var(--emfe-w-color-black, #000000) 0%, transparent 100%);\n opacity: 0;\n transition: 0.25s ease;\n width: 100%;\n max-height: 40vh;\n}\n.NavigationWindow.NavigationWindowOpened {\n opacity: 1;\n}\n.NavigationWindow.NavigationWindowOpened .NavigationSecondaryWrapper .NavigationSecondaryItemAnchor:nth-child(1) {\n transform: translate3d(-210%, 50%, 0);\n transition: transform 0.1s;\n}\n.NavigationWindow.NavigationWindowOpened .NavigationSecondaryWrapper .NavigationSecondaryItemAnchor:nth-child(2) {\n transform: translate3d(-150%, -50%, 0);\n transition: transform 0.1s 0.1s;\n}\n.NavigationWindow.NavigationWindowOpened .NavigationSecondaryWrapper .NavigationSecondaryItemAnchor:nth-child(3) {\n transform: translate3d(-50%, -100%, 0);\n transition: transform 0.1s 0.2s;\n}\n.NavigationWindow.NavigationWindowOpened .NavigationSecondaryWrapper .NavigationSecondaryItemAnchor:nth-child(4) {\n transform: translate3d(50%, -50%, 0);\n transition: transform 0.1s 0.3s;\n}\n.NavigationWindow.NavigationWindowOpened .NavigationSecondaryWrapper .NavigationSecondaryItemAnchor:nth-child(5) {\n transform: translate3d(110%, 50%, 0);\n transition: transform 0.1s 0.4s;\n}\n.NavigationWindow .ModalCloseBtn, .NavigationWindow .NavigationWindowTitle {\n display: none;\n}\n.NavigationWindow .NavigationSecondaryWrapper {\n position: relative;\n width: 100%;\n height: 170px;\n list-style: none;\n}\n.NavigationWindow .NavigationSecondaryWrapper .NavigationSecondaryItemAnchor {\n display: flex;\n width: 60px;\n position: absolute;\n top: 50%;\n left: 50%;\n padding: 0px;\n flex-direction: column;\n transform: translate(-50%, 150%);\n}\n.NavigationWindow .NavigationSecondaryWrapper .NavigationSecondaryItemAnchor .NavigationSecondaryItemLabel {\n width: 100%;\n height: 20px;\n text-wrap: pretty;\n line-height: 10px;\n color: var(--emfe-w-color-white, #FFFFFF);\n}\n\n.NavigationPrimaryItemAnchor.NavItem0 {\n grid-area: item0;\n}\n\n.NavigationPrimaryItemAnchor.NavItem1 {\n grid-area: item1;\n}\n\n.NavigationPrimaryItemAnchor.NavItem2 {\n grid-area: item2;\n}\n\n.NavigationPrimaryItemAnchor.NavItem3 {\n grid-area: item3;\n}\n\n.NavigationPrimaryItemAnchor.NavItem4 {\n grid-area: item4;\n}\n\n.NavigationBar {\n background: var(--emfe-w-color-white, #FFFFFF);\n display: grid;\n grid-auto-flow: column;\n grid-template-columns: 1fr 1fr 20% 1fr 1fr;\n grid-template-areas: "item0 item1 . item2 item3";\n border-radius: 5px;\n position: relative;\n}\n.NavigationBar.NavigationBarSimple {\n grid-template-columns: repeat(5, 20%);\n grid-template-areas: "item0 item1 item2 item3 item4";\n}\n.NavigationBar.NavigationBarOpened {\n box-shadow: 0 0 11px rgba(0, 0, 0, 0.09);\n}\n\n.NavigationPrimaryItemAnchor,\n.NavigationSecondaryItemAnchor {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 5px;\n text-decoration: none;\n color: var(--emfe-w-color-black, #000000);\n font-size: 9px;\n overflow: hidden;\n white-space: nowrap;\n padding: 10px;\n}\n.NavigationPrimaryItemAnchor .NavigationPrimaryItemImg,\n.NavigationSecondaryItemAnchor .NavigationPrimaryItemImg {\n width: 20px;\n height: 20px;\n}\n.NavigationPrimaryItemAnchor .NavigationSecondaryItemImgWrapper,\n.NavigationSecondaryItemAnchor .NavigationSecondaryItemImgWrapper {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 5px;\n border-radius: 100%;\n background-color: var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n}\n.NavigationPrimaryItemAnchor .NavigationSecondaryItemImgWrapper .NavigationSecondaryItemImg,\n.NavigationSecondaryItemAnchor .NavigationSecondaryItemImgWrapper .NavigationSecondaryItemImg {\n width: 25px;\n height: 25px;\n}\n.NavigationPrimaryItemAnchor .NavigationPrimaryItemLabel,\n.NavigationPrimaryItemAnchor .NavigationSecondaryItemLabel,\n.NavigationSecondaryItemAnchor .NavigationPrimaryItemLabel,\n.NavigationSecondaryItemAnchor .NavigationSecondaryItemLabel {\n margin: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-align: center;\n}\n\n.NavigationButton {\n background: var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n border: none;\n position: absolute;\n border-radius: 100%;\n top: 20%;\n left: 50%;\n transform: translate(-50%, -50%);\n padding: 10px;\n}\n.NavigationButton .NavigationButtonSpan {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.NavigationButton .labelMiddleIcon {\n cursor: pointer;\n display: grid;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n padding: 4px;\n overflow: hidden;\n}\n.NavigationButton .labelMiddleIcon .middleIconLine {\n background: var(--emfe-w-color-white, #FFFFFF);\n content: "";\n height: 2px;\n width: 20px;\n grid-row-start: 1;\n grid-column-start: 1;\n transition: transform ease 0.2s, margin-top ease 0.2s 0.2s, width ease 0.2s 0.4s;\n}\n.NavigationButton .labelMiddleIcon .middleIconLine:nth-child(1) {\n margin-top: 10px;\n}\n.NavigationButton .labelMiddleIcon .middleIconLine:nth-child(2) {\n margin: auto;\n}\n.NavigationButton .labelMiddleIcon .middleIconLine:nth-child(3) {\n margin-top: -10px;\n}\n.NavigationButton .labelMiddleIconActive .middleIconLine:nth-child(1) {\n margin-top: 0px;\n transform: rotate(-45deg);\n transition: margin-top ease 0.2s 0.2s, transform ease 0.2s 0.4s;\n}\n.NavigationButton .labelMiddleIconActive .middleIconLine:nth-child(2) {\n width: 0px;\n transition: width ease 0.2s;\n}\n.NavigationButton .labelMiddleIconActive .middleIconLine:nth-child(3) {\n margin-top: 0px;\n transform: rotate(45deg);\n transition: margin-top ease 0.2s 0.2s, transform ease 0.2s 0.4s;\n}',E(e,"lang","scss")},m(t,n){u(t,e,n)},d(t){t&&f(e)}}}
|
|
683
|
+
// (255:0) {#if !isFlowerMenu}
|
|
684
|
+
function Vr(t){let e;return{c(){e=d("style"),e.textContent='.NavigationWrapper {\n background: var(--emfe-w-color-gray-50, #F9F8F8);\n width: 100%;\n height: 100px;\n}\n\n.NavigationPanel {\n position: fixed;\n bottom: 20px;\n left: 50%;\n transform: translateX(-50%);\n width: calc(100% - 30px);\n max-width: 450px;\n height: 70px;\n z-index: 30;\n}\n\n.NavigationWindow {\n display: flex;\n flex-direction: column;\n background: var(--emfe-w-color-white, #FFFFFF);\n position: absolute;\n bottom: 30px;\n left: 0;\n opacity: 0;\n transform: translateY(100%);\n border-radius: 5px 5px 0 0;\n transition: 0.25s ease;\n width: 100%;\n max-height: 40vh;\n}\n.NavigationWindow.NavigationWindowOpened {\n opacity: 1;\n padding-bottom: 60px;\n transform: translateY(5px);\n}\n.NavigationWindow .ModalCloseBtn {\n position: absolute;\n top: 10px;\n right: 10px;\n width: 24px;\n height: 24px;\n border-radius: 100%;\n color: var(--emfe-w-color-secondary, var(--emfe-w-color-secondary, #FD2839));\n background: rgba(255, 255, 255, 0.1);\n cursor: pointer;\n transition: all 150ms ease-in-out;\n z-index: 1;\n}\n.NavigationWindow .ModalCloseBtn svg {\n width: 24px;\n height: 24px;\n margin: 50%;\n transform: translate(-50%, -50%);\n}\n.NavigationWindow .ModalCloseBtn:hover {\n background: rgba(255, 255, 255, 0.2);\n}\n.NavigationWindow .NavigationWindowTitle {\n padding: 16px 10px;\n margin: 0;\n color: var(--emfe-w-color-black, #000000);\n font-size: 12px;\n flex-grow: 0;\n}\n.NavigationWindow .NavigationSecondaryWrapper {\n display: flex;\n flex-wrap: wrap;\n padding: 0 10px;\n flex-grow: 1;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n}\n\n.NavigationPrimaryItemAnchor.NavItem0 {\n grid-area: item0;\n}\n\n.NavigationPrimaryItemAnchor.NavItem1 {\n grid-area: item1;\n}\n\n.NavigationPrimaryItemAnchor.NavItem2 {\n grid-area: item2;\n}\n\n.NavigationPrimaryItemAnchor.NavItem3 {\n grid-area: item3;\n}\n\n.NavigationPrimaryItemAnchor.NavItem4 {\n grid-area: item4;\n}\n\n.NavigationBar {\n background: var(--emfe-w-color-white, #FFFFFF);\n display: grid;\n grid-auto-flow: column;\n grid-template-columns: 1fr 1fr 20% 1fr 1fr;\n grid-template-areas: "item0 item1 . item2 item3";\n height: 70px;\n border-radius: 5px;\n position: relative;\n}\n.NavigationBar.NavigationBarSimple {\n grid-template-columns: repeat(5, 20%);\n grid-template-areas: "item0 item1 item2 item3 item4";\n}\n.NavigationBar.NavigationBarOpened {\n box-shadow: 0 0 11px rgba(0, 0, 0, 0.09);\n}\n\n.NavigationPrimaryItemAnchor,\n.NavigationSecondaryItemAnchor {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 5px;\n text-decoration: none;\n color: var(--emfe-w-color-black, #000000);\n font-size: 9px;\n overflow: hidden;\n white-space: nowrap;\n padding-bottom: 12px;\n}\n.NavigationPrimaryItemAnchor .NavigationPrimaryItemImg,\n.NavigationPrimaryItemAnchor .NavigationSecondaryItemImg,\n.NavigationSecondaryItemAnchor .NavigationPrimaryItemImg,\n.NavigationSecondaryItemAnchor .NavigationSecondaryItemImg {\n width: 20px;\n}\n.NavigationPrimaryItemAnchor .NavigationPrimaryItemLabel,\n.NavigationPrimaryItemAnchor .NavigationSecondaryItemLabel,\n.NavigationSecondaryItemAnchor .NavigationPrimaryItemLabel,\n.NavigationSecondaryItemAnchor .NavigationSecondaryItemLabel {\n margin: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n width: 100%;\n text-align: center;\n}\n\n.NavigationSecondaryItemAnchor {\n width: 25%;\n padding: 10px 0;\n}\n\n.ActiveItem {\n background-color: var(--emfe-w-color-primary-50, var(--emfe-w-color-pink-20, #FBECF4));\n}\n\n.NavigationButton {\n background: var(--emfe-w-color-white, #FFFFFF);\n border: none;\n width: 20%;\n height: 100%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n padding: 0;\n padding-bottom: 12px;\n}\n.NavigationButton .middleIcon {\n width: 32px;\n height: 32px;\n}\n.NavigationButton .middleIcon .a {\n fill: var(--emfe-w-color-white, #FFFFFF);\n stroke: var(--emfe-w-color-primary, #D0046C);\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n.NavigationButton .middleIcon .b {\n stroke: none;\n}\n.NavigationButton .middleIcon .c {\n fill: none;\n}\n.NavigationButton:before {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-top: 8px solid var(--emfe-w-color-gray-50, #F9F8F8);\n content: "";\n height: 0;\n left: 50%;\n opacity: 0;\n position: absolute;\n top: 0;\n transform: translateX(-50%);\n width: 0;\n}\n.NavigationButton.NavigationButtonActive:before {\n opacity: 1;\n transition: 0.7s ease;\n}',E(e,"lang","scss")},m(t,n){u(t,e,n)},d(t){t&&f(e)}}}function Xr(e){let n,r,i=!/*isLoading*/e[1]&&/*isMobile*/e[13]&&/*showNavigation*/e[3]&&xr(e);function o(t,e){/*isFlowerMenu*/
|
|
685
|
+
return t[11]?Wr:Vr}let a=o(e),s=a(e);return{c(){i&&i.c(),n=y(),s.c(),r=v(),this.c=t},m(t,e){i&&i.m(t,e),u(t,n,e),s.m(t,e),u(t,r,e)},p(t,e){!/*isLoading*/t[1]&&/*isMobile*/t[13]&&/*showNavigation*/t[3]?i?i.p(t,e):(i=xr(t),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null),a!==(a=o(t))&&(s.d(1),s=a(t),s&&(s.c(),s.m(r.parentNode,r)))},i:t,o:t,d(t){i&&i.d(t),t&&f(n),s.d(t),t&&f(r)}}}function zr(t,e,n){let r;var i,o;i=Ir,o=t=>n(12,r=t),t.$$.on_destroy.push(l(i,o));let a,s,{cmsendpoint:c=""}=e,{lang:h=""}=e,{env:u=""}=e,{secondarymenutitle:f=""}=e,{userroles:p=""}=e,{clientstyling:d=""}=e,{clientstylingurl:m=""}=e,{translationurl:g=""}=e,{activecategory:y=""}=e,{flowermenustyle:v="false"}=e,b=window.navigator.userAgent,E="PC"!==Sr(b),w=!0,_=!1,N=!1,A="",I=!1,S=[],P=[],H=[],L="",O={},x=!1;Object.keys(Hr).forEach((t=>{Pr(t,Hr[t])}));const C=t=>{if(t.data)switch(t.data.type){case"PlayerAccountMenuActive":case"OpenLoginRegisterModal":case"GoToHomepage":n(4,N=!1)}},M=()=>{G(),n(1,w=!0);let t=Sr(b),e=new URL(`${c}/${h}/bottom-mobile-menu?env=${u}`);e.searchParams.append("userRoles",p),t&&e.searchParams.append("device","mtWeb"),fetch(e.href).then((t=>t.json())).then((t=>{
|
|
676
686
|
// Reset arrays
|
|
677
|
-
S=[],
|
|
687
|
+
S=[],n(8,H=[]),
|
|
678
688
|
// Show navigation only if there are items coming from CMS
|
|
679
|
-
|
|
689
|
+
n(3,_=t.length>0),
|
|
680
690
|
// Get items
|
|
681
691
|
t.forEach((t=>{
|
|
682
692
|
//check if the operator wants an event interpreted
|
|
683
|
-
O[t.label]=t.eventTrigger?t.path:null,"/menu-item"==t.path?(
|
|
693
|
+
O[t.label]=t.eventTrigger?t.path:null,"/menu-item"==t.path?(n(9,L=null==t?void 0:t.img),n(8,H=t.children)):S.push(t)})),
|
|
684
694
|
// Hide secondary menu if there are no items configured in CMS
|
|
685
|
-
|
|
695
|
+
n(6,I=0==H.length),
|
|
696
|
+
//Deleting the elements from secondaryMenu when flowerMenu is true
|
|
697
|
+
H.length>=5&&x&&n(8,H=H.splice(0,5)),(t=>{n(7,P=[]),n(7,P=I?t.splice(0,5):t.splice(0,4)),y&&R()})(S),n(1,w=!1)})).then((()=>{
|
|
686
698
|
// html menu item is generated after fetching data. after this, set custom styling
|
|
687
|
-
d&&
|
|
699
|
+
d&&F(),m&&D()})).catch((t=>{n(1,w=!1),console.error(t)}))},R=()=>{const t=P.concat(H).find((t=>t.path.includes(y)));t&&n(5,A=t.id)},U=(t,e,n,r)=>{O[r]?window.postMessage({type:"MobileBottomNavigationEvent",event:O[r]},window.location.href):window.postMessage({type:"NavigateTo",path:t,target:e||null,externalLink:n||!1},window.location.href),
|
|
688
700
|
//Analytics event
|
|
689
|
-
"function"==typeof gtag&>ag("event","ChangeMenu",{context:"MobileBottomNavigation",menuItem:`${t}`})},
|
|
701
|
+
"function"==typeof gtag&>ag("event","ChangeMenu",{context:"MobileBottomNavigation",menuItem:`${t}`})},F=()=>{let t=document.createElement("style");d&&a&&(t.innerHTML=d,a.appendChild(t))},D=()=>{let t=new URL(m),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{a.appendChild(e)}),1)}))},k=()=>{var t;t=h,sr.set(t)},G=()=>{n(10,s=E&&window.innerHeight/window.innerWidth<1)};T((()=>(window.addEventListener("message",C,!1),E&&window.screen.orientation.addEventListener("change",G),()=>{window.removeEventListener("message",C),E&&window.screen.orientation.removeEventListener("change",G)})));return t.$$set=t=>{"cmsendpoint"in t&&n(16,c=t.cmsendpoint),"lang"in t&&n(17,h=t.lang),"env"in t&&n(18,u=t.env),"secondarymenutitle"in t&&n(0,f=t.secondarymenutitle),"userroles"in t&&n(19,p=t.userroles),"clientstyling"in t&&n(20,d=t.clientstyling),"clientstylingurl"in t&&n(21,m=t.clientstylingurl),"translationurl"in t&&n(22,g=t.translationurl),"activecategory"in t&&n(23,y=t.activecategory),"flowermenustyle"in t&&n(24,v=t.flowermenustyle)},t.$$.update=()=>{/*flowermenustyle*/16777216&t.$$.dirty[0]&&v&&n(11,x="true"===v.toLowerCase()),/*activecategory, isLoading*/8388610&t.$$.dirty[0]&&y&&!w&&R(),/*lang*/131072&t.$$.dirty[0]&&h&&k(),/*cmsendpoint, lang, env, userroles*/983040&t.$$.dirty[0]&&c&&h&&u&&p&&M(),/*clientstyling, customStylingContainer*/1048580&t.$$.dirty[0]&&d&&a&&F(),/*clientstylingurl, customStylingContainer*/2097156&t.$$.dirty[0]&&m&&a&&D(),/*translationurl*/4194304&t.$$.dirty[0]&&g&&fetch(g).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{Pr(e,t[e])}))})).catch((t=>{console.log(t)}))},[f,w,a,_,N,A,I,P,H,L,s,x,r,E,()=>{n(4,N=!N),window.postMessage({type:"MobileBottomNav",navigationWindowOpened:N},window.location.href)},U,c,h,u,p,d,m,g,y,v,t=>{t.attrs?.target?U(t.path,t.attrs?.target,t?.externalLink,t.label):U(t.path,null,t?.externalLink,t.label)},t=>{t.attrs?.target?U(t.path,t.attrs?.target,t?.externalLink,t.label):U(t.path,null,t?.externalLink,t.label)},function(t){B[t?"unshift":"push"]((()=>{a=t,n(2,a)}))}]}class Kr extends k{constructor(t){super(),D(this,{target:this.shadowRoot,props:_(this.attributes),customElement:!0},zr,Xr,o,{cmsendpoint:16,lang:17,env:18,secondarymenutitle:0,userroles:19,clientstyling:20,clientstylingurl:21,translationurl:22,activecategory:23,flowermenustyle:24},null,[-1,-1]),t&&(t.target&&u(t.target,this,t.anchor),t.props&&(this.$set(t.props),C()))}static get observedAttributes(){return["cmsendpoint","lang","env","secondarymenutitle","userroles","clientstyling","clientstylingurl","translationurl","activecategory","flowermenustyle"]}get cmsendpoint(){return this.$$.ctx[16]}set cmsendpoint(t){this.$$set({cmsendpoint:t}),C()}get lang(){return this.$$.ctx[17]}set lang(t){this.$$set({lang:t}),C()}get env(){return this.$$.ctx[18]}set env(t){this.$$set({env:t}),C()}get secondarymenutitle(){return this.$$.ctx[0]}set secondarymenutitle(t){this.$$set({secondarymenutitle:t}),C()}get userroles(){return this.$$.ctx[19]}set userroles(t){this.$$set({userroles:t}),C()}get clientstyling(){return this.$$.ctx[20]}set clientstyling(t){this.$$set({clientstyling:t}),C()}get clientstylingurl(){return this.$$.ctx[21]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),C()}get translationurl(){return this.$$.ctx[22]}set translationurl(t){this.$$set({translationurl:t}),C()}get activecategory(){return this.$$.ctx[23]}set activecategory(t){this.$$set({activecategory:t}),C()}get flowermenustyle(){return this.$$.ctx[24]}set flowermenustyle(t){this.$$set({flowermenustyle:t}),C()}}return!customElements.get("general-navigation-bar")&&customElements.define("general-navigation-bar",Kr),Kr}));
|
|
690
702
|
//# sourceMappingURL=general-navigation-bar.js.map
|