@nyaruka/temba-components 0.88.0 → 0.89.0

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/CHANGELOG.md CHANGED
@@ -4,27 +4,40 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v0.89.0](https://github.com/nyaruka/temba-components/compare/v0.88.0...v0.89.0)
8
+
9
+ - Add csrf fallback if cookie isn't there [`#429`](https://github.com/nyaruka/temba-components/pull/429)
10
+ - Check for existence of csrf element first [`c136a78`](https://github.com/nyaruka/temba-components/commit/c136a78d36e28760fe95b2dfa7a994b1c82b338c)
11
+
7
12
  #### [v0.88.0](https://github.com/nyaruka/temba-components/compare/v0.87.0...v0.88.0)
8
13
 
14
+ > 17 May 2024
15
+
9
16
  - Temba toast [`#428`](https://github.com/nyaruka/temba-components/pull/428)
10
17
  - Add toasts [`4bbc215`](https://github.com/nyaruka/temba-components/commit/4bbc215178be81f80a1729b32a54cbba87065bea)
11
18
  - Make toasts more configurable [`9e3a68f`](https://github.com/nyaruka/temba-components/commit/9e3a68f0e116f6835c42f8672726c4efd0d629c9)
12
19
  - Remove excess logging for temba list [`706e1f2`](https://github.com/nyaruka/temba-components/commit/706e1f25735d40180e9306b70a421bbe683126c0)
13
20
 
14
- #### [v0.87.0](https://github.com/nyaruka/temba-components/compare/v0.86.0...v0.87.0)
21
+ #### [v0.87.0](https://github.com/nyaruka/temba-components/compare/v0.86.1...v0.87.0)
15
22
 
16
23
  > 9 May 2024
17
24
 
18
25
  - Add general avatar and fix message grouping [`#427`](https://github.com/nyaruka/temba-components/pull/427)
19
26
  - Linting updates [`#426`](https://github.com/nyaruka/temba-components/pull/426)
20
27
  - Webchat history [`#425`](https://github.com/nyaruka/temba-components/pull/425)
21
- - Bump ejs from 3.1.9 to 3.1.10 [`#420`](https://github.com/nyaruka/temba-components/pull/420)
22
- - Include number of records on notifications for some export types [`#424`](https://github.com/nyaruka/temba-components/pull/424)
23
- - Support flow export notification [`#423`](https://github.com/nyaruka/temba-components/pull/423)
24
28
  - Fix linting issues [`b2bd993`](https://github.com/nyaruka/temba-components/commit/b2bd99309e79c9b1b6a5121a4df75a4c1ae78e57)
25
29
  - Add history paging to webchat [`86ebcfa`](https://github.com/nyaruka/temba-components/commit/86ebcfacd1de17b919dc0f64dad4c83884103e68)
26
30
  - Show scroll markers after fetching [`40bf4c4`](https://github.com/nyaruka/temba-components/commit/40bf4c44075bc2c531b4fa3aeda5e725ba15634e)
27
31
 
32
+ #### [v0.86.1](https://github.com/nyaruka/temba-components/compare/v0.86.0...v0.86.1)
33
+
34
+ > 7 May 2024
35
+
36
+ - Bump ejs from 3.1.9 to 3.1.10 [`#420`](https://github.com/nyaruka/temba-components/pull/420)
37
+ - Include number of records on notifications for some export types [`#424`](https://github.com/nyaruka/temba-components/pull/424)
38
+ - Support flow export notification [`#423`](https://github.com/nyaruka/temba-components/pull/423)
39
+ - Support definition export notification [`cd69bec`](https://github.com/nyaruka/temba-components/commit/cd69bec0f4a5e836f1635348df835d13f641f093)
40
+
28
41
  #### [v0.86.0](https://github.com/nyaruka/temba-components/compare/v0.85.0...v0.86.0)
29
42
 
30
43
  > 2 May 2024
@@ -74,7 +87,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
74
87
 
75
88
  - Add beat for temba-option collection [`3406463`](https://github.com/nyaruka/temba-components/commit/3406463dd07490615ec979c21c8701f7694a4f80)
76
89
 
77
- #### [v0.80.0](https://github.com/nyaruka/temba-components/compare/v0.77.0...v0.80.0)
90
+ #### [v0.80.0](https://github.com/nyaruka/temba-components/compare/v0.78.2...v0.80.0)
78
91
 
79
92
  > 9 April 2024
80
93
 
@@ -82,12 +95,30 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
82
95
  - Update dependencies [`#411`](https://github.com/nyaruka/temba-components/pull/411)
83
96
  - Dependency updates [`#409`](https://github.com/nyaruka/temba-components/pull/409)
84
97
  - Add status for chat [`#410`](https://github.com/nyaruka/temba-components/pull/410)
85
- - Ensure we have icons for all channel types in use [`#407`](https://github.com/nyaruka/temba-components/pull/407)
86
- - Rework `temba-date` to be inline span instead of div [`#406`](https://github.com/nyaruka/temba-components/pull/406)
87
98
  - Yarn update [`9fe452e`](https://github.com/nyaruka/temba-components/commit/9fe452ece62a7f40707e37ac1bd70ea10cd87789)
88
99
  - Update open-wc [`f433526`](https://github.com/nyaruka/temba-components/commit/f4335262417c6c45f45b60f3fad0a7f1204845e7)
89
100
  - Show connection status on chat widget [`f75ec9b`](https://github.com/nyaruka/temba-components/commit/f75ec9b61d5ab7e2080d887f2afc3a28b86148eb)
90
101
 
102
+ #### [v0.78.2](https://github.com/nyaruka/temba-components/compare/v0.78.1...v0.78.2)
103
+
104
+ > 4 April 2024
105
+
106
+ - Add icons for template statuses [`4b1cf1c`](https://github.com/nyaruka/temba-components/commit/4b1cf1c9dce5c5b508a000cef9c99dc0684f1a8e)
107
+
108
+ #### [v0.78.1](https://github.com/nyaruka/temba-components/compare/v0.78.0...v0.78.1)
109
+
110
+ > 4 April 2024
111
+
112
+ - Ensure we have icons for all channel types in use [`#407`](https://github.com/nyaruka/temba-components/pull/407)
113
+
114
+ #### [v0.78.0](https://github.com/nyaruka/temba-components/compare/v0.77.0...v0.78.0)
115
+
116
+ > 3 April 2024
117
+
118
+ - Rework `temba-date` to be inline span instead of div [`#406`](https://github.com/nyaruka/temba-components/pull/406)
119
+ - Add test to ensure date renders inline [`abcbc1f`](https://github.com/nyaruka/temba-components/commit/abcbc1f226e59a39b6f53d00d9178adb68df852d)
120
+ - Rework temba-date to be inline [`78af86e`](https://github.com/nyaruka/temba-components/commit/78af86e22b92cd2546b62bfc7bd46250250b84cf)
121
+
91
122
  #### [v0.77.0](https://github.com/nyaruka/temba-components/compare/v0.76.0...v0.77.0)
92
123
 
93
124
  > 29 March 2024
@@ -21,7 +21,7 @@ const k=globalThis,A=k.trustedTypes,C=A?A.createPolicy("lit-html",{createHTML:t=
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
23
23
  */
24
- let lt=class extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const o=i?.renderBefore??e;let n=o._$litPart$;if(void 0===n){const t=i?.renderBefore??null;o._$litPart$=n=new tt(e.insertBefore(O(),t),t,void 0,i??{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return H}};lt._$litElement$=!0,lt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:lt});const ht=globalThis.litElementPolyfillSupport;ht?.({LitElement:lt}),(globalThis.litElementVersions??=[]).push("4.0.4");var ct,dt,ut,pt,mt,gt,ft,vt,bt,yt,_t,xt,wt,kt,At,Ct,St,Et,Tt=function(t,e,i){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,i),i},$t=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};const Mt=function(t){var e=0;t+="x";var i=Math.floor(65745979961613.07);for(let o=0;o<t.length;o++)e>i&&(e=Math.floor(e/137)),e=131*e+t.charCodeAt(o);return e},Ot="0123456789abcdef".split(""),Lt=[-2147483648,8388608,32768,128],zt=[24,16,8,0],Pt=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Dt=[];class It{constructor(t=!1,e=!1){ct.set(this,void 0),dt.set(this,void 0),ut.set(this,void 0),pt.set(this,void 0),mt.set(this,void 0),gt.set(this,void 0),ft.set(this,void 0),vt.set(this,void 0),bt.set(this,void 0),yt.set(this,void 0),_t.set(this,void 0),xt.set(this,void 0),wt.set(this,void 0),kt.set(this,void 0),At.set(this,void 0),Ct.set(this,void 0),St.set(this,0),Et.set(this,void 0),this.init(t,e)}init(t,e){e?(Dt[0]=Dt[16]=Dt[1]=Dt[2]=Dt[3]=Dt[4]=Dt[5]=Dt[6]=Dt[7]=Dt[8]=Dt[9]=Dt[10]=Dt[11]=Dt[12]=Dt[13]=Dt[14]=Dt[15]=0,Tt(this,dt,Dt)):Tt(this,dt,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t?(Tt(this,gt,3238371032),Tt(this,ft,914150663),Tt(this,vt,812702999),Tt(this,bt,4144912697),Tt(this,yt,4290775857),Tt(this,_t,1750603025),Tt(this,xt,1694076839),Tt(this,wt,3204075428)):(Tt(this,gt,1779033703),Tt(this,ft,3144134277),Tt(this,vt,1013904242),Tt(this,bt,2773480762),Tt(this,yt,1359893119),Tt(this,_t,2600822924),Tt(this,xt,528734635),Tt(this,wt,1541459225)),Tt(this,ct,Tt(this,Et,Tt(this,ut,Tt(this,At,0)))),Tt(this,pt,Tt(this,kt,!1)),Tt(this,mt,!0),Tt(this,Ct,t)}update(t){if($t(this,pt))return this;let e;e=t instanceof ArrayBuffer?new Uint8Array(t):t;let i=0;const o=e.length,n=$t(this,dt);for(;i<o;){let t;if($t(this,kt)&&(Tt(this,kt,!1),n[0]=$t(this,ct),n[16]=n[1]=n[2]=n[3]=n[4]=n[5]=n[6]=n[7]=n[8]=n[9]=n[10]=n[11]=n[12]=n[13]=n[14]=n[15]=0),"string"!=typeof e)for(t=$t(this,Et);i<o&&t<64;++i)n[t>>2]|=e[i]<<zt[3&t++];else for(t=$t(this,Et);i<o&&t<64;++i){let o=e.charCodeAt(i);o<128?n[t>>2]|=o<<zt[3&t++]:o<2048?(n[t>>2]|=(192|o>>6)<<zt[3&t++],n[t>>2]|=(128|63&o)<<zt[3&t++]):o<55296||o>=57344?(n[t>>2]|=(224|o>>12)<<zt[3&t++],n[t>>2]|=(128|o>>6&63)<<zt[3&t++],n[t>>2]|=(128|63&o)<<zt[3&t++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),n[t>>2]|=(240|o>>18)<<zt[3&t++],n[t>>2]|=(128|o>>12&63)<<zt[3&t++],n[t>>2]|=(128|o>>6&63)<<zt[3&t++],n[t>>2]|=(128|63&o)<<zt[3&t++])}Tt(this,St,t),Tt(this,ut,$t(this,ut)+(t-$t(this,Et))),t>=64?(Tt(this,ct,n[16]),Tt(this,Et,t-64),this.hash(),Tt(this,kt,!0)):Tt(this,Et,t)}return $t(this,ut)>4294967295&&(Tt(this,At,$t(this,At)+($t(this,ut)/4294967296|0)),Tt(this,ut,$t(this,ut)%4294967296)),this}finalize(){if($t(this,pt))return;Tt(this,pt,!0);const t=$t(this,dt),e=$t(this,St);t[16]=$t(this,ct),t[e>>2]|=Lt[3&e],Tt(this,ct,t[16]),e>=56&&($t(this,kt)||this.hash(),t[0]=$t(this,ct),t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=$t(this,At)<<3|$t(this,ut)>>>29,t[15]=$t(this,ut)<<3,this.hash()}hash(){let t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt);const l=$t(this,dt);let h,c,d,u,p,m,g,f,v,b;for(let t=16;t<64;++t)u=l[t-15],h=(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3,u=l[t-2],c=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10,l[t]=l[t-16]+h+l[t-7]+c|0;b=e&i;for(let y=0;y<64;y+=4)$t(this,mt)?($t(this,Ct)?(g=300032,u=l[0]-1413257819,a=u-150054599|0,o=u+24177077|0):(g=704751109,u=l[0]-210244248,a=u-1521486534|0,o=u+143694565|0),Tt(this,mt,!1)):(h=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),c=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),g=t&e,d=g^t&i^b,m=n&s^~n&r,u=a+c+m+Pt[y]+l[y],p=h+d,a=o+u|0,o=u+p|0),h=(o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10),c=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),f=o&t,d=f^o&e^g,m=a&n^~a&s,u=r+c+m+Pt[y+1]+l[y+1],p=h+d,r=i+u|0,i=u+p|0,h=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),c=(r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7),v=i&o,d=v^i&t^f,m=r&a^~r&n,u=s+c+m+Pt[y+2]+l[y+2],p=h+d,s=e+u|0,e=u+p|0,h=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),c=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),b=e&i,d=b^e&o^v,m=s&r^~s&a,u=n+c+m+Pt[y+3]+l[y+3],p=h+d,n=t+u|0,t=u+p|0;Tt(this,gt,$t(this,gt)+t|0),Tt(this,ft,$t(this,ft)+e|0),Tt(this,vt,$t(this,vt)+i|0),Tt(this,bt,$t(this,bt)+o|0),Tt(this,yt,$t(this,yt)+n|0),Tt(this,_t,$t(this,_t)+s|0),Tt(this,xt,$t(this,xt)+r|0),Tt(this,wt,$t(this,wt)+a|0)}hex(){this.finalize();const t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt);let l=Ot[t>>28&15]+Ot[t>>24&15]+Ot[t>>20&15]+Ot[t>>16&15]+Ot[t>>12&15]+Ot[t>>8&15]+Ot[t>>4&15]+Ot[15&t]+Ot[e>>28&15]+Ot[e>>24&15]+Ot[e>>20&15]+Ot[e>>16&15]+Ot[e>>12&15]+Ot[e>>8&15]+Ot[e>>4&15]+Ot[15&e]+Ot[i>>28&15]+Ot[i>>24&15]+Ot[i>>20&15]+Ot[i>>16&15]+Ot[i>>12&15]+Ot[i>>8&15]+Ot[i>>4&15]+Ot[15&i]+Ot[o>>28&15]+Ot[o>>24&15]+Ot[o>>20&15]+Ot[o>>16&15]+Ot[o>>12&15]+Ot[o>>8&15]+Ot[o>>4&15]+Ot[15&o]+Ot[n>>28&15]+Ot[n>>24&15]+Ot[n>>20&15]+Ot[n>>16&15]+Ot[n>>12&15]+Ot[n>>8&15]+Ot[n>>4&15]+Ot[15&n]+Ot[s>>28&15]+Ot[s>>24&15]+Ot[s>>20&15]+Ot[s>>16&15]+Ot[s>>12&15]+Ot[s>>8&15]+Ot[s>>4&15]+Ot[15&s]+Ot[r>>28&15]+Ot[r>>24&15]+Ot[r>>20&15]+Ot[r>>16&15]+Ot[r>>12&15]+Ot[r>>8&15]+Ot[r>>4&15]+Ot[15&r];return $t(this,Ct)||(l+=Ot[a>>28&15]+Ot[a>>24&15]+Ot[a>>20&15]+Ot[a>>16&15]+Ot[a>>12&15]+Ot[a>>8&15]+Ot[a>>4&15]+Ot[15&a]),l}toString(){return this.hex()}digest(){this.finalize();const t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt),l=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,n>>24&255,n>>16&255,n>>8&255,255&n,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r];return $t(this,Ct)||l.push(a>>24&255,a>>16&255,a>>8&255,255&a),l}array(){return this.digest()}arrayBuffer(){this.finalize();const t=new ArrayBuffer($t(this,Ct)?28:32),e=new DataView(t);return e.setUint32(0,$t(this,gt)),e.setUint32(4,$t(this,ft)),e.setUint32(8,$t(this,vt)),e.setUint32(12,$t(this,bt)),e.setUint32(16,$t(this,yt)),e.setUint32(20,$t(this,_t)),e.setUint32(24,$t(this,xt)),$t(this,Ct)||e.setUint32(28,$t(this,wt)),t}}function Nt(t){const e=new It;return e.update(t),parseInt(e.hex().substring(0,8),16)}ct=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,mt=new WeakMap,gt=new WeakMap,ft=new WeakMap,vt=new WeakMap,bt=new WeakMap,yt=new WeakMap,_t=new WeakMap,xt=new WeakMap,wt=new WeakMap,kt=new WeakMap,At=new WeakMap,Ct=new WeakMap,St=new WeakMap,Et=new WeakMap;const Bt=function(t,e,i){var o=i<.5?i*(1+e):i+e-i*e,n=2*i-o;return[(t/=360)+1/3,t,t-1/3].map((function(t){return t<0&&t++,t>1&&t--,t=t<1/6?n+6*(o-n)*t:t<.5?o:t<2/3?n+6*(o-n)*(2/3-t):n,Math.round(255*t)}))};const Rt="/api/v2/media.json",qt=new class{constructor(t={}){const[e,i]=[t.lightness,t.saturation].map((function(t){return t=void 0!==t?t:[.35,.5,.65],Array.isArray(t)?t.concat():[t]}));this.L=e,this.S=i,"number"==typeof t.hue&&(t.hue={min:t.hue,max:t.hue}),"object"!=typeof t.hue||Array.isArray(t.hue)||(t.hue=[t.hue]),void 0===t.hue&&(t.hue=[]),this.hueRanges=t.hue.map((function(t){return{min:void 0===t.min?0:t.min,max:void 0===t.max?360:t.max}})),this.hash=Nt,"function"==typeof t.hash&&(this.hash=t.hash),"bkdr"===t.hash&&(this.hash=Mt)}hsl(t){var e,i,o=this.hash(t);if(this.hueRanges.length){const t=this.hueRanges[o%this.hueRanges.length];e=o/this.hueRanges.length%727*(t.max-t.min)/727+t.min}else e=o%359;return o=Math.ceil(o/360),i=this.S[o%this.S.length],o=Math.ceil(o/this.S.length),[e,i,this.L[o%this.L.length]]}rgb(t){var e=this.hsl(t);return Bt.apply(this,e)}hex(t){var e,i=this.rgb(t);return e="#",i.forEach((function(t){t<16&&(e+=0),e+=t.toString(16)})),e}};var Ut;!function(t){t.BLUE="color:#5078b5;",t.GREEN="color:#62bd6a;",t.RED="color:#e36049;",t.PURPLE="color:#a626a4;"}(Ut||(Ut={}));const Ft=(t,e="",i=[])=>{""!==e?"object"!=typeof t?console.log("%c"+t,e,...i):console.log("%c"+JSON.stringify(t,null,2),e):console.log(t)},Zt=(t={})=>{const e=(t=>{for(const e of document.cookie.split(";")){const i=e.indexOf("=");let o=e.substr(0,i),n=e.substr(i+1);if(o=o.trim(),n=n.trim(),o===t)return n}return null})("csrftoken"),i=e?{"X-CSRFToken":e}:{};return i["X-Requested-With"]="XMLHttpRequest",Object.keys(t).forEach((e=>{i[e]=t[e]})),i},jt=(t,e=null,i={})=>new Promise(((o,n)=>{const s={method:"GET",headers:Zt(i)};e&&(s.signal=e.signal),fetch(t,s).then((t=>{t.text().then((i=>{let n={};try{n=JSON.parse(i)}catch(t){}o({controller:e,body:i,json:n,url:t.url,headers:t.headers,status:t.status})}))})).catch((t=>{n(t)}))})),Ht=t=>{const e=[];Object.keys(t).forEach((i=>{t[i]&&e.push(i)}));let i=e.join(" ");return i.trim().length>0&&(i=" "+i),i.trim()},Vt=(t,e=null)=>new Promise(((i,o)=>{jt(t,e).then((t=>{i({results:t.json.results,next:t.json.next})})).catch((t=>o(t)))})),Wt=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await Vt(i);t.results&&(e=e.concat(t.results)),i=t.next}return e},Gt=t=>new Promise(((e,i)=>{jt(t).then((t=>{t.status>=200&&t.status<300?e({assets:t.json.results,next:t.json.next}):i(t)})).catch((t=>i(t)))})),Qt=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await Gt(i);t.assets?(e=e.concat(t.assets),i=t.next):i=null}return e},Kt=(t,e,i={},o=null)=>{const n=Zt(i);o&&(n["Content-Type"]=o);const s={method:"POST",headers:n,body:e};return new Promise(((e,i)=>{fetch(t,s).then((async t=>{if(t.status>=500)return void i(t);const o=t.headers.get("x-temba-toasts");if(o){const t=document.querySelector("temba-toast");t&&t.addMessages(JSON.parse(o))}t.text().then((i=>{let o={};try{o=JSON.parse(i)}catch(t){}e({body:i,json:o,headers:t.headers,status:t.status,redirected:t.redirected,url:t.url})}))})).catch((t=>{i(t)}))}))},Yt=(t,e)=>Kt(t,JSON.stringify(e),!1,"application/json"),Jt=(t,e,i={})=>new Promise(((o,n)=>{Kt(t,e,i).then((e=>{e.status>=200&&e.status<400?o(e):n(t===Rt?e:"Server failure")})).catch((t=>{console.error(t),n(t)}))})),Xt=t=>{const e=t.parentNode||t.host;if(e){const t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY,i=t&&!(t.includes("hidden")||t.includes("visible"));return e?i&&e.scrollHeight>=e.clientHeight?e:Xt(e):null}return null},te=(t,e,i=!1)=>{let o;return function(...n){const s=this,r=i&&!o;clearTimeout(o),o=setTimeout((function(){o=null,i||t.apply(s,n)}),e),r&&t.apply(s,n)}},ee=(t,e)=>{let i=!0;return function(...o){i&&(i=!1,t.apply(this,o),setTimeout((()=>{i=!0}),e))}},ie=(t,e="and")=>1===t.length?t[0]:2===t.length?"object"==typeof t[0]?j`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" "):"object"==typeof t[0]?t.map(((i,o)=>o<t.length-1?j`${i}, `:j`${e} ${i}`)):t.join(", ")+e+t[t.length-1],oe=(t,e,i="and")=>ie(t.map(e),i),ne=t=>{let e=null;if(document.cookie&&""!=document.cookie){const i=document.cookie.split(";");for(let o=0;o<i.length;o++){const n=i[o].trim();if(n.substring(0,t.length+1)==t+"="){e=decodeURIComponent(n.substring(t.length+1));break}}}return e};var se;!function(t){t.SETTINGS="settings",t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(se||(se={}));const re=([t,...e],i=navigator.language)=>void 0===t?"":t.toLocaleUpperCase(i)+e.join(""),ae=(t,e)=>{if(0==t)return"0 KB";const i=e||2,o=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,o)).toFixed(i))+" "+["B","KB","MB","GB"][o]},le=t=>{t&&(t.stopPropagation(),t.preventDefault())},he=t=>{let e=(t=t.trim()).match(/(([\p{L}\p{N}]+-[\p{L}\p{N}]+)|([\p{L}\p{N}]+))/gu)||[];if(1==e.length&&(e=t.match(/[\p{L}\p{N}]+/gu)),0==e.length)return"?";if(1==e.length)return e[0].substring(0,2).toUpperCase();const i=e.map((t=>t.substring(0,1))),o=i.filter(((t,e)=>t==t.toUpperCase()||0==e));return o.length>=2?(o[0]+o[1]).toUpperCase():(i[0]+i[1]).toUpperCase()},ce=(t,e,i)=>{i/=100;const o=e*Math.min(i,1-i)/100,n=e=>{const n=(e+t/30)%12,s=i-o*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*s).toString(16).padStart(2,"0")};return`#${n(0)}${n(8)}${n(4)}`},de=(t,e,i=!1)=>{if((t.DEBUG_UPDATES||t.DEBUG)&&e.size>0){const o={};for(const i of e.keys())o[i]=[e[i],t[i]];Ft(t.tagName,Ut.PURPLE,[i?"<first-updated>":"<updated>",o])}},ue=(t,e,i=void 0)=>{(t.DEBUG_EVENTS||t.DEBUG)&&Ft(t.tagName,Ut.GREEN,void 0!==i?[e,i]:[e])};class pe extends lt{constructor(){super(...arguments),this.DEBUG=!1,this.DEBUG_UPDATES=!1,this.DEBUG_EVENTS=!1,this.eles={}}getEventHandlers(){return[]}connectedCallback(){super.connectedCallback();for(const t of this.getEventHandlers())t.isDocument?document.addEventListener(t.event,t.method.bind(this)):t.isWindow?window.addEventListener(t.event,t.method.bind(this)):this.addEventListener(t.event,t.method.bind(this))}disconnectedCallback(){for(const t of this.getEventHandlers())t.isDocument?document.removeEventListener(t.event,t.method):t.isWindow?window.removeEventListener(t.event,t.method):this.removeEventListener(t.event,t.method);super.disconnectedCallback()}firstUpdated(t){super.firstUpdated(t),de(this,t,!0)}updated(t){super.updated(t),de(this,t,!1)}fireEvent(t){return ue(this,t),this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}swallowEvent(t){t.stopPropagation(),t.preventDefault()}fireCustomEvent(t,e={}){this.DEBUG_EVENTS&&ue(this,t,e);const i=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});return this.dispatchEvent(i)}dispatchEvent(t){super.dispatchEvent(t);const e=t.target;if(e){const i=e["-"+t.type];if(i)return i(t);return new Function("event",`\n with(document) {\n with(this) {\n let handler = ${e.getAttribute("-"+t.type)};\n if(typeof handler === 'function') { \n handler(event);\n }\n }\n }\n `).call(e,t)}}closestElement(t,e=this){return function e(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const o=i.closest(t);return o||e(i.getRootNode().host)}(e)}getDiv(t){let e=this.eles[t];return e||(e=this.shadowRoot.querySelector(t),e&&(this.eles[t]=e),e)}stopEvent(t){t&&(t.stopPropagation(),t.preventDefault())}isMobile(){const t=window;return!!t.isMobile&&t.isMobile()}}
24
+ let lt=class extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const o=i?.renderBefore??e;let n=o._$litPart$;if(void 0===n){const t=i?.renderBefore??null;o._$litPart$=n=new tt(e.insertBefore(O(),t),t,void 0,i??{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return H}};lt._$litElement$=!0,lt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:lt});const ht=globalThis.litElementPolyfillSupport;ht?.({LitElement:lt}),(globalThis.litElementVersions??=[]).push("4.0.4");var ct,dt,ut,pt,mt,gt,ft,vt,bt,yt,_t,xt,wt,kt,At,Ct,St,Et,Tt=function(t,e,i){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,i),i},$t=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};const Mt=function(t){var e=0;t+="x";var i=Math.floor(65745979961613.07);for(let o=0;o<t.length;o++)e>i&&(e=Math.floor(e/137)),e=131*e+t.charCodeAt(o);return e},Ot="0123456789abcdef".split(""),Lt=[-2147483648,8388608,32768,128],zt=[24,16,8,0],Pt=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Dt=[];class It{constructor(t=!1,e=!1){ct.set(this,void 0),dt.set(this,void 0),ut.set(this,void 0),pt.set(this,void 0),mt.set(this,void 0),gt.set(this,void 0),ft.set(this,void 0),vt.set(this,void 0),bt.set(this,void 0),yt.set(this,void 0),_t.set(this,void 0),xt.set(this,void 0),wt.set(this,void 0),kt.set(this,void 0),At.set(this,void 0),Ct.set(this,void 0),St.set(this,0),Et.set(this,void 0),this.init(t,e)}init(t,e){e?(Dt[0]=Dt[16]=Dt[1]=Dt[2]=Dt[3]=Dt[4]=Dt[5]=Dt[6]=Dt[7]=Dt[8]=Dt[9]=Dt[10]=Dt[11]=Dt[12]=Dt[13]=Dt[14]=Dt[15]=0,Tt(this,dt,Dt)):Tt(this,dt,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t?(Tt(this,gt,3238371032),Tt(this,ft,914150663),Tt(this,vt,812702999),Tt(this,bt,4144912697),Tt(this,yt,4290775857),Tt(this,_t,1750603025),Tt(this,xt,1694076839),Tt(this,wt,3204075428)):(Tt(this,gt,1779033703),Tt(this,ft,3144134277),Tt(this,vt,1013904242),Tt(this,bt,2773480762),Tt(this,yt,1359893119),Tt(this,_t,2600822924),Tt(this,xt,528734635),Tt(this,wt,1541459225)),Tt(this,ct,Tt(this,Et,Tt(this,ut,Tt(this,At,0)))),Tt(this,pt,Tt(this,kt,!1)),Tt(this,mt,!0),Tt(this,Ct,t)}update(t){if($t(this,pt))return this;let e;e=t instanceof ArrayBuffer?new Uint8Array(t):t;let i=0;const o=e.length,n=$t(this,dt);for(;i<o;){let t;if($t(this,kt)&&(Tt(this,kt,!1),n[0]=$t(this,ct),n[16]=n[1]=n[2]=n[3]=n[4]=n[5]=n[6]=n[7]=n[8]=n[9]=n[10]=n[11]=n[12]=n[13]=n[14]=n[15]=0),"string"!=typeof e)for(t=$t(this,Et);i<o&&t<64;++i)n[t>>2]|=e[i]<<zt[3&t++];else for(t=$t(this,Et);i<o&&t<64;++i){let o=e.charCodeAt(i);o<128?n[t>>2]|=o<<zt[3&t++]:o<2048?(n[t>>2]|=(192|o>>6)<<zt[3&t++],n[t>>2]|=(128|63&o)<<zt[3&t++]):o<55296||o>=57344?(n[t>>2]|=(224|o>>12)<<zt[3&t++],n[t>>2]|=(128|o>>6&63)<<zt[3&t++],n[t>>2]|=(128|63&o)<<zt[3&t++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),n[t>>2]|=(240|o>>18)<<zt[3&t++],n[t>>2]|=(128|o>>12&63)<<zt[3&t++],n[t>>2]|=(128|o>>6&63)<<zt[3&t++],n[t>>2]|=(128|63&o)<<zt[3&t++])}Tt(this,St,t),Tt(this,ut,$t(this,ut)+(t-$t(this,Et))),t>=64?(Tt(this,ct,n[16]),Tt(this,Et,t-64),this.hash(),Tt(this,kt,!0)):Tt(this,Et,t)}return $t(this,ut)>4294967295&&(Tt(this,At,$t(this,At)+($t(this,ut)/4294967296|0)),Tt(this,ut,$t(this,ut)%4294967296)),this}finalize(){if($t(this,pt))return;Tt(this,pt,!0);const t=$t(this,dt),e=$t(this,St);t[16]=$t(this,ct),t[e>>2]|=Lt[3&e],Tt(this,ct,t[16]),e>=56&&($t(this,kt)||this.hash(),t[0]=$t(this,ct),t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=$t(this,At)<<3|$t(this,ut)>>>29,t[15]=$t(this,ut)<<3,this.hash()}hash(){let t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt);const l=$t(this,dt);let h,c,d,u,p,m,g,f,v,b;for(let t=16;t<64;++t)u=l[t-15],h=(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3,u=l[t-2],c=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10,l[t]=l[t-16]+h+l[t-7]+c|0;b=e&i;for(let y=0;y<64;y+=4)$t(this,mt)?($t(this,Ct)?(g=300032,u=l[0]-1413257819,a=u-150054599|0,o=u+24177077|0):(g=704751109,u=l[0]-210244248,a=u-1521486534|0,o=u+143694565|0),Tt(this,mt,!1)):(h=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),c=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),g=t&e,d=g^t&i^b,m=n&s^~n&r,u=a+c+m+Pt[y]+l[y],p=h+d,a=o+u|0,o=u+p|0),h=(o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10),c=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),f=o&t,d=f^o&e^g,m=a&n^~a&s,u=r+c+m+Pt[y+1]+l[y+1],p=h+d,r=i+u|0,i=u+p|0,h=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),c=(r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7),v=i&o,d=v^i&t^f,m=r&a^~r&n,u=s+c+m+Pt[y+2]+l[y+2],p=h+d,s=e+u|0,e=u+p|0,h=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),c=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),b=e&i,d=b^e&o^v,m=s&r^~s&a,u=n+c+m+Pt[y+3]+l[y+3],p=h+d,n=t+u|0,t=u+p|0;Tt(this,gt,$t(this,gt)+t|0),Tt(this,ft,$t(this,ft)+e|0),Tt(this,vt,$t(this,vt)+i|0),Tt(this,bt,$t(this,bt)+o|0),Tt(this,yt,$t(this,yt)+n|0),Tt(this,_t,$t(this,_t)+s|0),Tt(this,xt,$t(this,xt)+r|0),Tt(this,wt,$t(this,wt)+a|0)}hex(){this.finalize();const t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt);let l=Ot[t>>28&15]+Ot[t>>24&15]+Ot[t>>20&15]+Ot[t>>16&15]+Ot[t>>12&15]+Ot[t>>8&15]+Ot[t>>4&15]+Ot[15&t]+Ot[e>>28&15]+Ot[e>>24&15]+Ot[e>>20&15]+Ot[e>>16&15]+Ot[e>>12&15]+Ot[e>>8&15]+Ot[e>>4&15]+Ot[15&e]+Ot[i>>28&15]+Ot[i>>24&15]+Ot[i>>20&15]+Ot[i>>16&15]+Ot[i>>12&15]+Ot[i>>8&15]+Ot[i>>4&15]+Ot[15&i]+Ot[o>>28&15]+Ot[o>>24&15]+Ot[o>>20&15]+Ot[o>>16&15]+Ot[o>>12&15]+Ot[o>>8&15]+Ot[o>>4&15]+Ot[15&o]+Ot[n>>28&15]+Ot[n>>24&15]+Ot[n>>20&15]+Ot[n>>16&15]+Ot[n>>12&15]+Ot[n>>8&15]+Ot[n>>4&15]+Ot[15&n]+Ot[s>>28&15]+Ot[s>>24&15]+Ot[s>>20&15]+Ot[s>>16&15]+Ot[s>>12&15]+Ot[s>>8&15]+Ot[s>>4&15]+Ot[15&s]+Ot[r>>28&15]+Ot[r>>24&15]+Ot[r>>20&15]+Ot[r>>16&15]+Ot[r>>12&15]+Ot[r>>8&15]+Ot[r>>4&15]+Ot[15&r];return $t(this,Ct)||(l+=Ot[a>>28&15]+Ot[a>>24&15]+Ot[a>>20&15]+Ot[a>>16&15]+Ot[a>>12&15]+Ot[a>>8&15]+Ot[a>>4&15]+Ot[15&a]),l}toString(){return this.hex()}digest(){this.finalize();const t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt),l=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,n>>24&255,n>>16&255,n>>8&255,255&n,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r];return $t(this,Ct)||l.push(a>>24&255,a>>16&255,a>>8&255,255&a),l}array(){return this.digest()}arrayBuffer(){this.finalize();const t=new ArrayBuffer($t(this,Ct)?28:32),e=new DataView(t);return e.setUint32(0,$t(this,gt)),e.setUint32(4,$t(this,ft)),e.setUint32(8,$t(this,vt)),e.setUint32(12,$t(this,bt)),e.setUint32(16,$t(this,yt)),e.setUint32(20,$t(this,_t)),e.setUint32(24,$t(this,xt)),$t(this,Ct)||e.setUint32(28,$t(this,wt)),t}}function Nt(t){const e=new It;return e.update(t),parseInt(e.hex().substring(0,8),16)}ct=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,mt=new WeakMap,gt=new WeakMap,ft=new WeakMap,vt=new WeakMap,bt=new WeakMap,yt=new WeakMap,_t=new WeakMap,xt=new WeakMap,wt=new WeakMap,kt=new WeakMap,At=new WeakMap,Ct=new WeakMap,St=new WeakMap,Et=new WeakMap;const Bt=function(t,e,i){var o=i<.5?i*(1+e):i+e-i*e,n=2*i-o;return[(t/=360)+1/3,t,t-1/3].map((function(t){return t<0&&t++,t>1&&t--,t=t<1/6?n+6*(o-n)*t:t<.5?o:t<2/3?n+6*(o-n)*(2/3-t):n,Math.round(255*t)}))};const Rt="/api/v2/media.json",qt=new class{constructor(t={}){const[e,i]=[t.lightness,t.saturation].map((function(t){return t=void 0!==t?t:[.35,.5,.65],Array.isArray(t)?t.concat():[t]}));this.L=e,this.S=i,"number"==typeof t.hue&&(t.hue={min:t.hue,max:t.hue}),"object"!=typeof t.hue||Array.isArray(t.hue)||(t.hue=[t.hue]),void 0===t.hue&&(t.hue=[]),this.hueRanges=t.hue.map((function(t){return{min:void 0===t.min?0:t.min,max:void 0===t.max?360:t.max}})),this.hash=Nt,"function"==typeof t.hash&&(this.hash=t.hash),"bkdr"===t.hash&&(this.hash=Mt)}hsl(t){var e,i,o=this.hash(t);if(this.hueRanges.length){const t=this.hueRanges[o%this.hueRanges.length];e=o/this.hueRanges.length%727*(t.max-t.min)/727+t.min}else e=o%359;return o=Math.ceil(o/360),i=this.S[o%this.S.length],o=Math.ceil(o/this.S.length),[e,i,this.L[o%this.L.length]]}rgb(t){var e=this.hsl(t);return Bt.apply(this,e)}hex(t){var e,i=this.rgb(t);return e="#",i.forEach((function(t){t<16&&(e+=0),e+=t.toString(16)})),e}};var Ut;!function(t){t.BLUE="color:#5078b5;",t.GREEN="color:#62bd6a;",t.RED="color:#e36049;",t.PURPLE="color:#a626a4;"}(Ut||(Ut={}));const Ft=(t,e="",i=[])=>{""!==e?"object"!=typeof t?console.log("%c"+t,e,...i):console.log("%c"+JSON.stringify(t,null,2),e):console.log(t)},Zt=(t={})=>{let e=(t=>{for(const e of document.cookie.split(";")){const i=e.indexOf("=");let o=e.substr(0,i),n=e.substr(i+1);if(o=o.trim(),n=n.trim(),o===t)return n}return null})("csrftoken");if(!e){const t=document.querySelector("[name=csrfmiddlewaretoken]");t&&(e=t.value)}const i=e?{"X-CSRFToken":e}:{};return i["X-Requested-With"]="XMLHttpRequest",Object.keys(t).forEach((e=>{i[e]=t[e]})),i},jt=(t,e=null,i={})=>new Promise(((o,n)=>{const s={method:"GET",headers:Zt(i)};e&&(s.signal=e.signal),fetch(t,s).then((t=>{t.text().then((i=>{let n={};try{n=JSON.parse(i)}catch(t){}o({controller:e,body:i,json:n,url:t.url,headers:t.headers,status:t.status})}))})).catch((t=>{n(t)}))})),Ht=t=>{const e=[];Object.keys(t).forEach((i=>{t[i]&&e.push(i)}));let i=e.join(" ");return i.trim().length>0&&(i=" "+i),i.trim()},Vt=(t,e=null)=>new Promise(((i,o)=>{jt(t,e).then((t=>{i({results:t.json.results,next:t.json.next})})).catch((t=>o(t)))})),Wt=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await Vt(i);t.results&&(e=e.concat(t.results)),i=t.next}return e},Gt=t=>new Promise(((e,i)=>{jt(t).then((t=>{t.status>=200&&t.status<300?e({assets:t.json.results,next:t.json.next}):i(t)})).catch((t=>i(t)))})),Qt=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await Gt(i);t.assets?(e=e.concat(t.assets),i=t.next):i=null}return e},Kt=(t,e,i={},o=null)=>{const n=Zt(i);o&&(n["Content-Type"]=o);const s={method:"POST",headers:n,body:e};return new Promise(((e,i)=>{fetch(t,s).then((async t=>{if(t.status>=500)return void i(t);const o=t.headers.get("x-temba-toasts");if(o){const t=document.querySelector("temba-toast");t&&t.addMessages(JSON.parse(o))}t.text().then((i=>{let o={};try{o=JSON.parse(i)}catch(t){}e({body:i,json:o,headers:t.headers,status:t.status,redirected:t.redirected,url:t.url})}))})).catch((t=>{i(t)}))}))},Yt=(t,e)=>Kt(t,JSON.stringify(e),!1,"application/json"),Jt=(t,e,i={})=>new Promise(((o,n)=>{Kt(t,e,i).then((e=>{e.status>=200&&e.status<400?o(e):n(t===Rt?e:"Server failure")})).catch((t=>{console.error(t),n(t)}))})),Xt=t=>{const e=t.parentNode||t.host;if(e){const t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY,i=t&&!(t.includes("hidden")||t.includes("visible"));return e?i&&e.scrollHeight>=e.clientHeight?e:Xt(e):null}return null},te=(t,e,i=!1)=>{let o;return function(...n){const s=this,r=i&&!o;clearTimeout(o),o=setTimeout((function(){o=null,i||t.apply(s,n)}),e),r&&t.apply(s,n)}},ee=(t,e)=>{let i=!0;return function(...o){i&&(i=!1,t.apply(this,o),setTimeout((()=>{i=!0}),e))}},ie=(t,e="and")=>1===t.length?t[0]:2===t.length?"object"==typeof t[0]?j`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" "):"object"==typeof t[0]?t.map(((i,o)=>o<t.length-1?j`${i}, `:j`${e} ${i}`)):t.join(", ")+e+t[t.length-1],oe=(t,e,i="and")=>ie(t.map(e),i),ne=t=>{let e=null;if(document.cookie&&""!=document.cookie){const i=document.cookie.split(";");for(let o=0;o<i.length;o++){const n=i[o].trim();if(n.substring(0,t.length+1)==t+"="){e=decodeURIComponent(n.substring(t.length+1));break}}}return e};var se;!function(t){t.SETTINGS="settings",t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(se||(se={}));const re=([t,...e],i=navigator.language)=>void 0===t?"":t.toLocaleUpperCase(i)+e.join(""),ae=(t,e)=>{if(0==t)return"0 KB";const i=e||2,o=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,o)).toFixed(i))+" "+["B","KB","MB","GB"][o]},le=t=>{t&&(t.stopPropagation(),t.preventDefault())},he=t=>{let e=(t=t.trim()).match(/(([\p{L}\p{N}]+-[\p{L}\p{N}]+)|([\p{L}\p{N}]+))/gu)||[];if(1==e.length&&(e=t.match(/[\p{L}\p{N}]+/gu)),0==e.length)return"?";if(1==e.length)return e[0].substring(0,2).toUpperCase();const i=e.map((t=>t.substring(0,1))),o=i.filter(((t,e)=>t==t.toUpperCase()||0==e));return o.length>=2?(o[0]+o[1]).toUpperCase():(i[0]+i[1]).toUpperCase()},ce=(t,e,i)=>{i/=100;const o=e*Math.min(i,1-i)/100,n=e=>{const n=(e+t/30)%12,s=i-o*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*s).toString(16).padStart(2,"0")};return`#${n(0)}${n(8)}${n(4)}`},de=(t,e,i=!1)=>{if((t.DEBUG_UPDATES||t.DEBUG)&&e.size>0){const o={};for(const i of e.keys())o[i]=[e[i],t[i]];Ft(t.tagName,Ut.PURPLE,[i?"<first-updated>":"<updated>",o])}},ue=(t,e,i=void 0)=>{(t.DEBUG_EVENTS||t.DEBUG)&&Ft(t.tagName,Ut.GREEN,void 0!==i?[e,i]:[e])};class pe extends lt{constructor(){super(...arguments),this.DEBUG=!1,this.DEBUG_UPDATES=!1,this.DEBUG_EVENTS=!1,this.eles={}}getEventHandlers(){return[]}connectedCallback(){super.connectedCallback();for(const t of this.getEventHandlers())t.isDocument?document.addEventListener(t.event,t.method.bind(this)):t.isWindow?window.addEventListener(t.event,t.method.bind(this)):this.addEventListener(t.event,t.method.bind(this))}disconnectedCallback(){for(const t of this.getEventHandlers())t.isDocument?document.removeEventListener(t.event,t.method):t.isWindow?window.removeEventListener(t.event,t.method):this.removeEventListener(t.event,t.method);super.disconnectedCallback()}firstUpdated(t){super.firstUpdated(t),de(this,t,!0)}updated(t){super.updated(t),de(this,t,!1)}fireEvent(t){return ue(this,t),this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}swallowEvent(t){t.stopPropagation(),t.preventDefault()}fireCustomEvent(t,e={}){this.DEBUG_EVENTS&&ue(this,t,e);const i=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});return this.dispatchEvent(i)}dispatchEvent(t){super.dispatchEvent(t);const e=t.target;if(e){const i=e["-"+t.type];if(i)return i(t);return new Function("event",`\n with(document) {\n with(this) {\n let handler = ${e.getAttribute("-"+t.type)};\n if(typeof handler === 'function') { \n handler(event);\n }\n }\n }\n `).call(e,t)}}closestElement(t,e=this){return function e(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const o=i.closest(t);return o||e(i.getRootNode().host)}(e)}getDiv(t){let e=this.eles[t];return e||(e=this.shadowRoot.querySelector(t),e&&(this.eles[t]=e),e)}stopEvent(t){t&&(t.stopPropagation(),t.preventDefault())}isMobile(){const t=window;return!!t.isMobile&&t.isMobile()}}
25
25
  /**
26
26
  * @license
27
27
  * Copyright 2017 Google LLC