@nyaruka/temba-components 0.75.3 → 0.76.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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- function t(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r}const e=window,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),n=new WeakMap;class s{constructor(t,e,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=n.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&n.set(e,t))}return t}toString(){return this.cssText}}const r=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1]),t[0]);return new s(i,t,o)},a=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new s("string"==typeof t?t:t+"",void 0,o))(e)})(t):t;var l;const h=window,c=h.trustedTypes,d=c?c.emptyScript:"",u=h.reactiveElementPolyfillSupport,p={toAttribute(t,e){switch(e){case Boolean:t=t?d:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},m=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:p,reflect:!1,hasChanged:m};class f extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const o=this._$Ep(i,e);void 0!==o&&(this._$Ev.set(o,i),t.push(o))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,i,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(o){const n=this[t];this[e]=o,this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const o=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,o)=>{i?t.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):o.forEach((i=>{const o=document.createElement("style"),n=e.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=i.cssText,t.appendChild(o)}))})(o,this.constructor.elementStyles),o}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=g){var o;const n=this.constructor._$Ep(t,i);if(void 0!==n&&!0===i.reflect){const s=(void 0!==(null===(o=i.converter)||void 0===o?void 0:o.toAttribute)?i.converter:p).toAttribute(e,i.type);this._$El=t,null==s?this.removeAttribute(n):this.setAttribute(n,s),this._$El=null}}_$AK(t,e){var i;const o=this.constructor,n=o._$Ev.get(t);if(void 0!==n&&this._$El!==n){const t=o.getPropertyOptions(n),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:p;this._$El=n,this[n]=s.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let o=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||m)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}var v;f.finalized=!0,f.elementProperties=new Map,f.elementStyles=[],f.shadowRootOptions={mode:"open"},null==u||u({ReactiveElement:f}),(null!==(l=h.reactiveElementVersions)&&void 0!==l?l:h.reactiveElementVersions=[]).push("1.5.0");const y=window,b=y.trustedTypes,_=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,x=`lit$${(Math.random()+"").slice(9)}$`,w="?"+x,k=`<${w}>`,S=document,$=(t="")=>S.createComment(t),C=t=>null===t||"object"!=typeof t&&"function"!=typeof t,E=Array.isArray,T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,A=/-->/g,M=/>/g,O=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),z=/'/g,P=/"/g,I=/^(?:script|style|textarea|title)$/i,D=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),N=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),B=new WeakMap,q=S.createTreeWalker(S,129,null,!1),U=(t,e)=>{const i=t.length-1,o=[];let n,s=2===e?"<svg>":"",r=T;for(let e=0;e<i;e++){const i=t[e];let a,l,h=-1,c=0;for(;c<i.length&&(r.lastIndex=c,l=r.exec(i),null!==l);)c=r.lastIndex,r===T?"!--"===l[1]?r=A:void 0!==l[1]?r=M:void 0!==l[2]?(I.test(l[2])&&(n=RegExp("</"+l[2],"g")),r=O):void 0!==l[3]&&(r=O):r===O?">"===l[0]?(r=null!=n?n:T,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?O:'"'===l[3]?P:z):r===P||r===z?r=O:r===A||r===M?r=T:(r=O,n=void 0);const d=r===O&&t[e+1].startsWith("/>")?" ":"";s+=r===T?i+k:h>=0?(o.push(a),i.slice(0,h)+"$lit$"+i.slice(h)+x+d):i+x+(-2===h?(o.push(void 0),e):d)}const a=s+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==_?_.createHTML(a):a,o]};class F{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let n=0,s=0;const r=t.length-1,a=this.parts,[l,h]=U(t,e);if(this.el=F.createElement(l,i),q.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=q.nextNode())&&a.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(x)){const i=h[s++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(x),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?W:"?"===e[1]?K:"@"===e[1]?Y:H})}else a.push({type:6,index:n})}for(const e of t)o.removeAttribute(e)}if(I.test(o.tagName)){const t=o.textContent.split(x),e=t.length-1;if(e>0){o.textContent=b?b.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],$()),q.nextNode(),a.push({type:2,index:++n});o.append(t[e],$())}}}else if(8===o.nodeType)if(o.data===w)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=o.data.indexOf(x,t+1));)a.push({type:7,index:n}),t+=x.length-1}n++}}static createElement(t,e){const i=S.createElement("template");return i.innerHTML=t,i}}function Z(t,e,i=t,o){var n,s,r,a;if(e===N)return e;let l=void 0!==o?null===(n=i._$Co)||void 0===n?void 0:n[o]:i._$Cl;const h=C(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(s=null==l?void 0:l._$AO)||void 0===s||s.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,i,o)),void 0!==o?(null!==(r=(a=i)._$Co)&&void 0!==r?r:a._$Co=[])[o]=l:i._$Cl=l),void 0!==l&&(e=Z(t,l._$AS(t,e.values),l,o)),e}class V{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:o}=this._$AD,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:S).importNode(i,!0);q.currentNode=n;let s=q.nextNode(),r=0,a=0,l=o[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new j(s,s.nextSibling,this,t):1===l.type?e=new l.ctor(s,l.name,l.strings,this,t):6===l.type&&(e=new J(s,this,t)),this.u.push(e),l=o[++a]}r!==(null==l?void 0:l.index)&&(s=q.nextNode(),r++)}return n}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class j{constructor(t,e,i,o){var n;this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cm=null===(n=null==o?void 0:o.isConnected)||void 0===n||n}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Z(this,t,e),C(t)?t===R||null==t||""===t?(this._$AH!==R&&this._$AR(),this._$AH=R):t!==this._$AH&&t!==N&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>E(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==R&&C(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:o}=t,n="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=F.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.p(i);else{const t=new V(n,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=B.get(t.strings);return void 0===e&&B.set(t.strings,e=new F(t)),e}k(t){E(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const n of t)o===e.length?e.push(i=new j(this.O($()),this.O($()),this,this.options)):i=e[o],i._$AI(n),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class H{constructor(t,e,i,o,n){this.type=1,this._$AH=R,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const n=this.strings;let s=!1;if(void 0===n)t=Z(this,t,e,0),s=!C(t)||t!==this._$AH&&t!==N,s&&(this._$AH=t);else{const o=t;let r,a;for(t=n[0],r=0;r<n.length-1;r++)a=Z(this,o[i+r],e,r),a===N&&(a=this._$AH[r]),s||(s=!C(a)||a!==this._$AH[r]),a===R?t=R:t!==R&&(t+=(null!=a?a:"")+n[r+1]),this._$AH[r]=a}s&&!o&&this.j(t)}j(t){t===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class W extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===R?void 0:t}}const G=b?b.emptyScript:"";class K extends H{constructor(){super(...arguments),this.type=4}j(t){t&&t!==R?this.element.setAttribute(this.name,G):this.element.removeAttribute(this.name)}}class Y extends H{constructor(t,e,i,o,n){super(t,e,i,o,n),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=Z(this,t,e,0))&&void 0!==i?i:R)===N)return;const o=this._$AH,n=t===R&&o!==R||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,s=t!==R&&(o===R||n);n&&this.element.removeEventListener(this.name,this,o),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class J{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Z(this,t)}}const X=y.litHtmlPolyfillSupport;null==X||X(F,j),(null!==(v=y.litHtmlVersions)&&void 0!==v?v:y.litHtmlVersions=[]).push("2.5.0");var Q,tt;class et extends f{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var o,n;const s=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let r=s._$litPart$;if(void 0===r){const t=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:null;s._$litPart$=r=new j(e.insertBefore($(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return N}}et.finalized=!0,et._$litElement$=!0,null===(Q=globalThis.litElementHydrateSupport)||void 0===Q||Q.call(globalThis,{LitElement:et});const it=globalThis.litElementPolyfillSupport;null==it||it({LitElement:et}),(null!==(tt=globalThis.litElementVersions)&&void 0!==tt?tt:globalThis.litElementVersions=[]).push("3.2.2");var ot,nt,st,rt,at,lt,ht,ct,dt,ut,pt,mt,gt,ft,vt,yt,bt,_t,xt=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},wt=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};const kt=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},St="0123456789abcdef".split(""),$t=[-2147483648,8388608,32768,128],Ct=[24,16,8,0],Et=[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],Tt=[];class Lt{constructor(t=!1,e=!1){ot.set(this,void 0),nt.set(this,void 0),st.set(this,void 0),rt.set(this,void 0),at.set(this,void 0),lt.set(this,void 0),ht.set(this,void 0),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),yt.set(this,void 0),bt.set(this,0),_t.set(this,void 0),this.init(t,e)}init(t,e){e?(Tt[0]=Tt[16]=Tt[1]=Tt[2]=Tt[3]=Tt[4]=Tt[5]=Tt[6]=Tt[7]=Tt[8]=Tt[9]=Tt[10]=Tt[11]=Tt[12]=Tt[13]=Tt[14]=Tt[15]=0,xt(this,nt,Tt)):xt(this,nt,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t?(xt(this,lt,3238371032),xt(this,ht,914150663),xt(this,ct,812702999),xt(this,dt,4144912697),xt(this,ut,4290775857),xt(this,pt,1750603025),xt(this,mt,1694076839),xt(this,gt,3204075428)):(xt(this,lt,1779033703),xt(this,ht,3144134277),xt(this,ct,1013904242),xt(this,dt,2773480762),xt(this,ut,1359893119),xt(this,pt,2600822924),xt(this,mt,528734635),xt(this,gt,1541459225)),xt(this,ot,xt(this,_t,xt(this,st,xt(this,vt,0)))),xt(this,rt,xt(this,ft,!1)),xt(this,at,!0),xt(this,yt,t)}update(t){if(wt(this,rt))return this;let e;e=t instanceof ArrayBuffer?new Uint8Array(t):t;let i=0;const o=e.length,n=wt(this,nt);for(;i<o;){let t;if(wt(this,ft)&&(xt(this,ft,!1),n[0]=wt(this,ot),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=wt(this,_t);i<o&&t<64;++i)n[t>>2]|=e[i]<<Ct[3&t++];else for(t=wt(this,_t);i<o&&t<64;++i){let o=e.charCodeAt(i);o<128?n[t>>2]|=o<<Ct[3&t++]:o<2048?(n[t>>2]|=(192|o>>6)<<Ct[3&t++],n[t>>2]|=(128|63&o)<<Ct[3&t++]):o<55296||o>=57344?(n[t>>2]|=(224|o>>12)<<Ct[3&t++],n[t>>2]|=(128|o>>6&63)<<Ct[3&t++],n[t>>2]|=(128|63&o)<<Ct[3&t++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),n[t>>2]|=(240|o>>18)<<Ct[3&t++],n[t>>2]|=(128|o>>12&63)<<Ct[3&t++],n[t>>2]|=(128|o>>6&63)<<Ct[3&t++],n[t>>2]|=(128|63&o)<<Ct[3&t++])}xt(this,bt,t),xt(this,st,wt(this,st)+(t-wt(this,_t))),t>=64?(xt(this,ot,n[16]),xt(this,_t,t-64),this.hash(),xt(this,ft,!0)):xt(this,_t,t)}return wt(this,st)>4294967295&&(xt(this,vt,wt(this,vt)+(wt(this,st)/4294967296<<0)),xt(this,st,wt(this,st)%4294967296)),this}finalize(){if(wt(this,rt))return;xt(this,rt,!0);const t=wt(this,nt),e=wt(this,bt);t[16]=wt(this,ot),t[e>>2]|=$t[3&e],xt(this,ot,t[16]),e>=56&&(wt(this,ft)||this.hash(),t[0]=wt(this,ot),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]=wt(this,vt)<<3|wt(this,st)>>>29,t[15]=wt(this,st)<<3,this.hash()}hash(){let t=wt(this,lt),e=wt(this,ht),i=wt(this,ct),o=wt(this,dt),n=wt(this,ut),s=wt(this,pt),r=wt(this,mt),a=wt(this,gt);const l=wt(this,nt);let h,c,d,u,p,m,g,f,v,y;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;y=e&i;for(let b=0;b<64;b+=4)wt(this,at)?(wt(this,yt)?(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),xt(this,at,!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^y,m=n&s^~n&r,u=a+c+m+Et[b]+l[b],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+Et[b+1]+l[b+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+Et[b+2]+l[b+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),y=e&i,d=y^e&o^v,m=s&r^~s&a,u=n+c+m+Et[b+3]+l[b+3],p=h+d,n=t+u<<0,t=u+p<<0;xt(this,lt,wt(this,lt)+t<<0),xt(this,ht,wt(this,ht)+e<<0),xt(this,ct,wt(this,ct)+i<<0),xt(this,dt,wt(this,dt)+o<<0),xt(this,ut,wt(this,ut)+n<<0),xt(this,pt,wt(this,pt)+s<<0),xt(this,mt,wt(this,mt)+r<<0),xt(this,gt,wt(this,gt)+a<<0)}hex(){this.finalize();const t=wt(this,lt),e=wt(this,ht),i=wt(this,ct),o=wt(this,dt),n=wt(this,ut),s=wt(this,pt),r=wt(this,mt),a=wt(this,gt);let l=St[t>>28&15]+St[t>>24&15]+St[t>>20&15]+St[t>>16&15]+St[t>>12&15]+St[t>>8&15]+St[t>>4&15]+St[15&t]+St[e>>28&15]+St[e>>24&15]+St[e>>20&15]+St[e>>16&15]+St[e>>12&15]+St[e>>8&15]+St[e>>4&15]+St[15&e]+St[i>>28&15]+St[i>>24&15]+St[i>>20&15]+St[i>>16&15]+St[i>>12&15]+St[i>>8&15]+St[i>>4&15]+St[15&i]+St[o>>28&15]+St[o>>24&15]+St[o>>20&15]+St[o>>16&15]+St[o>>12&15]+St[o>>8&15]+St[o>>4&15]+St[15&o]+St[n>>28&15]+St[n>>24&15]+St[n>>20&15]+St[n>>16&15]+St[n>>12&15]+St[n>>8&15]+St[n>>4&15]+St[15&n]+St[s>>28&15]+St[s>>24&15]+St[s>>20&15]+St[s>>16&15]+St[s>>12&15]+St[s>>8&15]+St[s>>4&15]+St[15&s]+St[r>>28&15]+St[r>>24&15]+St[r>>20&15]+St[r>>16&15]+St[r>>12&15]+St[r>>8&15]+St[r>>4&15]+St[15&r];return wt(this,yt)||(l+=St[a>>28&15]+St[a>>24&15]+St[a>>20&15]+St[a>>16&15]+St[a>>12&15]+St[a>>8&15]+St[a>>4&15]+St[15&a]),l}toString(){return this.hex()}digest(){this.finalize();const t=wt(this,lt),e=wt(this,ht),i=wt(this,ct),o=wt(this,dt),n=wt(this,ut),s=wt(this,pt),r=wt(this,mt),a=wt(this,gt),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 wt(this,yt)||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(wt(this,yt)?28:32),e=new DataView(t);return e.setUint32(0,wt(this,lt)),e.setUint32(4,wt(this,ht)),e.setUint32(8,wt(this,ct)),e.setUint32(12,wt(this,dt)),e.setUint32(16,wt(this,ut)),e.setUint32(20,wt(this,pt)),e.setUint32(24,wt(this,mt)),wt(this,yt)||e.setUint32(28,wt(this,gt)),t}}function At(t){const e=new Lt;return e.update(t),parseInt(e.hex().substring(0,8),16)}ot=new WeakMap,nt=new WeakMap,st=new WeakMap,rt=new WeakMap,at=new WeakMap,lt=new WeakMap,ht=new WeakMap,ct=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,mt=new WeakMap,gt=new WeakMap,ft=new WeakMap,vt=new WeakMap,yt=new WeakMap,bt=new WeakMap,_t=new WeakMap;const Mt=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 Ot="/api/v2/media.json",zt=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=At,"function"==typeof t.hash&&(this.hash=t.hash),"bkdr"===t.hash&&(this.hash=kt)}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 Mt.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 Pt;!function(t){t.BLUE="color:#5078b5;",t.GREEN="color:#62bd6a;",t.RED="color:#e36049;",t.PURPLE="color:#a626a4;"}(Pt||(Pt={}));const It=(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)},Dt=(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},Nt=(t,e=null,i={})=>new Promise(((o,n)=>{const s={method:"GET",headers:Dt(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)}))})),Rt=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()},Bt=(t,e=null)=>new Promise(((i,o)=>{Nt(t,e).then((t=>{i({results:t.json.results,next:t.json.next})})).catch((t=>o(t)))})),qt=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await Bt(i);t.results&&(e=e.concat(t.results)),i=t.next}return e},Ut=t=>new Promise(((e,i)=>{Nt(t).then((t=>{t.status>=200&&t.status<300?e({assets:t.json.results,next:t.json.next}):i(t)})).catch((t=>i(t)))})),Ft=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await Ut(i);t.assets?(e=e.concat(t.assets),i=t.next):i=null}return e},Zt=(t,e,i={},o=null)=>{const n=Dt(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=>{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)}))}))},Vt=(t,e)=>Zt(t,JSON.stringify(e),!1,"application/json"),jt=(t,e)=>new Promise(((i,o)=>{Zt(t,e,!0).then((e=>{e.status>=200&&e.status<400?i(e):o(t===Ot?e:"Server failure")})).catch((t=>{console.error(t),o(t)}))})),Ht=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:Ht(e):null}return null},Wt=(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)}},Gt=(t,e)=>{let i=!0;return function(...o){i&&(i=!1,t.apply(this,o),setTimeout((()=>{i=!0}),e))}},Kt=(t,e="and")=>1===t.length?t[0]:2===t.length?"object"==typeof t[0]?D`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" "):"object"==typeof t[0]?t.map(((i,o)=>o<t.length-1?D`${i}, `:D`${e} ${i}`)):t.join(", ")+e+t[t.length-1],Yt=(t,e,i="and")=>Kt(t.map(e),i);var Jt;!function(t){t.SETTINGS="settings",t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(Jt||(Jt={}));const Xt=([t,...e],i=navigator.language)=>void 0===t?"":t.toLocaleUpperCase(i)+e.join(""),Qt=(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]},te=t=>{t&&(t.stopPropagation(),t.preventDefault())},ee=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()},ie=(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)}`},oe=(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]];It(t.tagName,Pt.PURPLE,[i?"<first-updated>":"<updated>",o])}},ne=(t,e,i)=>{(t.DEBUG_EVENTS||t.DEBUG)&&It(t.tagName,Pt.GREEN,void 0!==i?[e,i]:[e])};class se extends et{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),oe(this,t,!0)}updated(t){super.updated(t),oe(this,t,!1)}fireEvent(t){return ne(this,t),this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}swallowEvent(t){t.stopPropagation(),t.preventDefault()}fireCustomEvent(t,e={}){this.DEBUG_EVENTS&&ne(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()}}const re=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function ae(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):re(t,e)}var le;null===(le=window.HTMLSlotElement)||void 0===le||le.prototype.assignedElements;class he extends se{constructor(){super(),this.name="",this.value=null,this.inputRoot=this,this.disabled=!1,this.internals=this.attachInternals()}updated(t){super.updated(t),t.has("value")&&this.internals.setFormValue(this.value)}get form(){return this.internals.form}setValue(t){this.value=this.serializeValue(t)}getDeserializedValue(){return JSON.parse(this.value)}serializeValue(t){return JSON.stringify(t)}}he.formAssociated=!0,t([ae({type:String})],he.prototype,"name",void 0),t([ae({type:String,attribute:"help_text"})],he.prototype,"helpText",void 0),t([ae({type:Boolean,attribute:"help_always"})],he.prototype,"helpAlways",void 0),t([ae({type:Boolean,attribute:"widget_only"})],he.prototype,"widgetOnly",void 0),t([ae({type:Boolean,attribute:"hide_label"})],he.prototype,"hideLabel",void 0),t([ae({type:String})],he.prototype,"label",void 0),t([ae({type:Array})],he.prototype,"errors",void 0),t([ae({type:String})],he.prototype,"value",void 0),t([ae({attribute:!1})],he.prototype,"inputRoot",void 0),t([ae({type:Boolean})],he.prototype,"disabled",void 0);var ce;!function(t){t.alert_warning="alert-square",t.account="user-01",t.active="play",t.add="plus",t.add_note="file-02",t.airtime="bank-note-01",t.analytics="bar-chart-01",t.archive="archive",t.arrow_up="chevron-up",t.arrow_down="chevron-down",t.arrow_left="chevron-left",t.arrow_right="chevron-right",t.attachment="paperclip",t.attachment_audio="volume-min",t.attachment_document="file-06",t.attachment_image="image-01",t.attachment_location="marker-pin-01",t.attachment_video="video-recorder",t.branding="brush-02",t.branding_hostname="server-05",t.branding_notifications="mail-01",t.branding_styling="palette",t.branding_raw="pencil-01",t.broadcast="announcement-01",t.call="phone-call-01",t.call_missed="phone-call-02",t.campaign="clock-refresh",t.campaign_active="play",t.campaign_archived="archive",t.campaigns="clock-refresh",t.channel="zap",t.channel_a="channel-android",t.channel_ct="channel-clickatell",t.channel_d3="channel-whatsapp",t.channel_ds="channel-discord",t.channel_ex="zap",t.channel_fb="channel-facebook",t.channel_fba="channel-facebook",t.channel_fc="channel-freshchat",t.channel_fcm="channel-firebase",t.channel_ig="channel-instagram",t.channel_jc="channel-jiochat",t.channel_jn="channel-junebug",t.channel_kn="channel-kannel",t.channel_kwa="channel-whatsapp",t.channel_ln="channel-line",t.channel_mg="channel-mtarget",t.channel_pl="channel-plivo",t.channel_rc="channel-rocketchat",t.channel_sl="channel-slack",t.channel_sw="channel-signalwire",t.channel_tq="channel-thinq",t.channel_tg="channel-telegram",t.channel_t="channel-twilio",t.channel_twt="channel-twitter",t.channel_twa="channel-whatsapp",t.channel_vp="channel-viber",t.channel_vk="channel-vk",t.channel_nx="channel-vonage",t.channel_wc="channel-wechat",t.channel_wa="channel-whatsapp",t.channel_wac="channel-whatsapp",t.channel_zvw="channel-whatsapp",t.children="git-branch-01",t.check="check",t.checkbox="square",t.checkbox_checked="check-square",t.checkbox_partial="stop-square",t.classifier_wit="classifier-wit",t.classifier_luis="classifier-luis",t.classifier_bothub="classifier-bothub",t.close="x",t.compose="send-01",t.contact="user-01",t.contact_archived="archive",t.contact_blocked="message-x-square",t.contact_export="download-cloud-01",t.contact_import="upload-cloud-01",t.contact_stopped="slash-octagon",t.contact_updated="user-edit",t.contacts="user-01",t.copy="copy-04",t.dashboard="pie-chart-01",t.delete="trash-03",t.delete_small="x",t.down="chevron-down",t.download="download-01",t.edit="edit-03",t.email="mail-01",t.error="alert-circle",t.event="zap",t.expressions="at-sign",t.fields="user-edit",t.filter="filter-funnel-01",t.flow="flow",t.flow_background="layers-two-01",t.flow_interrupted="x-close",t.flow_ivr="phone",t.flow_message="message-square-02",t.flow_surveyor="tablet-01",t.flow_user="hard-drive",t.flows="flow",t.global="at-sign",t.grid="dots-grid",t.group="users-01",t.group_exclude="users-x",t.group_include="users-check",t.group_smart="atom-01",t.help="help-circle",t.hide="eye-off",t.home="settings-02",t.image="image-01",t.inbox="inbox-01",t.incidents="alert-square",t.incoming_call="phone-incoming-01",t.integrations="layers-three-01",t.info="user-square",t.issue="alert-square",t.label="tag-01",t.language="translate-01",t.link="link-external-01",t.location="marker-pin-01",t.log="file-02",t.logout="log-out-04",t.menu="menu-01",t.menu_collapse="chevron-left-double",t.message="message-square-02",t.message_export="download-cloud-01",t.messages="message-square-02",t.missing="maximize-02",t.missed_call="phone-x",t.new="plus",t.next_schedule="alarm-clock",t.notification="bell-01",t.number="hash-01",t.optin_requested="message-notification-circle",t.optin="message-check-circle",t.optout="message-x-circle",t.org_active="credit-card-02",t.org_anonymous="glasses-01",t.org_bulk="credit-card-plus",t.org_flagged="flag-01",t.org_new="stars-02",t.org_suspended="slash-circle-01",t.org_verified="check-verified-02",t.overview="pie-chart-01",t.prometheus="prometheus",t.progress_spinner="refresh-cw-04",t.featured="star-01",t.quick_replies="dotpoints-01",t.recording="microphone-01",t.resend="refresh-cw-05",t.reset="flip-backward",t.resthooks="share-07",t.restore="play",t.results_export="download-cloud-01",t.retry="refresh-cw-05",t.revisions="clock-rewind",t.rocketchat="rocketchat",t.runs="rows-03",t.schedule="calendar",t.search="search-refraction",t.select_open="chevron-down",t.select_clear="x",t.send="send-03",t.service="magic-wand-01",t.service_end="log-out-04",t.settings="settings-02",t.show="eye",t.simulator="phone-02",t.sort="chevron-selector-vertical",t.sort_down="sort-arrow-down",t.sort_up="sort-arrow-up",t.staff="hard-drive",t.submit="check",t.success="check",t.tickets="agent",t.tickets_all="archive",t.tickets_closed="check",t.tickets_mine="coffee",t.tickets_open="inbox-01",t.tickets_export="download-cloud-01",t.tickets_unassigned="inbox-01",t.topic="message-text-circle-02",t.two_factor_enabled="shield-02",t.two_factor_disabled="shield-01",t.trigger="signal-01",t.trigger_active="play",t.trigger_archived="archive",t.trigger_new="plus",t.trigger_keyword="message-check-square",t.trigger_catch_all="message-question-square",t.trigger_inbound_call="phone-incoming-01",t.trigger_missed_call="phone-hang-up",t.trigger_schedule="calendar",t.trigger_new_conversation="message-chat-square",t.trigger_referral="user-right-01",t.trigger_closed_ticket="agent",t.trigger_opt_in="message-check-circle",t.trigger_opt_out="message-x-circle",t.triggers="signal-01",t.updated="edit-02",t.up="chevron-up",t.upload="upload-cloud-01",t.upload_image="camera-01",t.usages="link-04",t.user="users-01",t.users="users-01",t.user_beta="shield-zap",t.webhook="link-external-01",t.wit="wit",t.workspace="folder",t.zapier="zapier",t.zendesk="zendesk",t.ext="lightning-01",t.fcm="lightning-01",t.bothub="bothub",t.chatbase="chatbase",t.dtone="dtone",t.default="list",t.datepicker="calendar",t.slider="sliders-02",t.select="browser",t.input="edit-05"}(ce||(ce={}));class de extends he{constructor(){super(...arguments),this.name="",this.disabled=!1,this.size=1.2,this.animateChange="pulse"}static get styles(){return r`
1
+ function t(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r}const e=window,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),n=new WeakMap;class s{constructor(t,e,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=n.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&n.set(e,t))}return t}toString(){return this.cssText}}const r=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1]),t[0]);return new s(i,t,o)},a=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new s("string"==typeof t?t:t+"",void 0,o))(e)})(t):t;var l;const h=window,c=h.trustedTypes,d=c?c.emptyScript:"",u=h.reactiveElementPolyfillSupport,p={toAttribute(t,e){switch(e){case Boolean:t=t?d:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},m=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:p,reflect:!1,hasChanged:m};class f extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const o=this._$Ep(i,e);void 0!==o&&(this._$Ev.set(o,i),t.push(o))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,i,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(o){const n=this[t];this[e]=o,this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const o=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,o)=>{i?t.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):o.forEach((i=>{const o=document.createElement("style"),n=e.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=i.cssText,t.appendChild(o)}))})(o,this.constructor.elementStyles),o}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=g){var o;const n=this.constructor._$Ep(t,i);if(void 0!==n&&!0===i.reflect){const s=(void 0!==(null===(o=i.converter)||void 0===o?void 0:o.toAttribute)?i.converter:p).toAttribute(e,i.type);this._$El=t,null==s?this.removeAttribute(n):this.setAttribute(n,s),this._$El=null}}_$AK(t,e){var i;const o=this.constructor,n=o._$Ev.get(t);if(void 0!==n&&this._$El!==n){const t=o.getPropertyOptions(n),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:p;this._$El=n,this[n]=s.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let o=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||m)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}var v;f.finalized=!0,f.elementProperties=new Map,f.elementStyles=[],f.shadowRootOptions={mode:"open"},null==u||u({ReactiveElement:f}),(null!==(l=h.reactiveElementVersions)&&void 0!==l?l:h.reactiveElementVersions=[]).push("1.5.0");const y=window,b=y.trustedTypes,_=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,x=`lit$${(Math.random()+"").slice(9)}$`,w="?"+x,k=`<${w}>`,S=document,$=(t="")=>S.createComment(t),C=t=>null===t||"object"!=typeof t&&"function"!=typeof t,E=Array.isArray,T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,A=/-->/g,M=/>/g,O=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),z=/'/g,P=/"/g,I=/^(?:script|style|textarea|title)$/i,D=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),N=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),B=new WeakMap,q=S.createTreeWalker(S,129,null,!1),U=(t,e)=>{const i=t.length-1,o=[];let n,s=2===e?"<svg>":"",r=T;for(let e=0;e<i;e++){const i=t[e];let a,l,h=-1,c=0;for(;c<i.length&&(r.lastIndex=c,l=r.exec(i),null!==l);)c=r.lastIndex,r===T?"!--"===l[1]?r=A:void 0!==l[1]?r=M:void 0!==l[2]?(I.test(l[2])&&(n=RegExp("</"+l[2],"g")),r=O):void 0!==l[3]&&(r=O):r===O?">"===l[0]?(r=null!=n?n:T,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?O:'"'===l[3]?P:z):r===P||r===z?r=O:r===A||r===M?r=T:(r=O,n=void 0);const d=r===O&&t[e+1].startsWith("/>")?" ":"";s+=r===T?i+k:h>=0?(o.push(a),i.slice(0,h)+"$lit$"+i.slice(h)+x+d):i+x+(-2===h?(o.push(void 0),e):d)}const a=s+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==_?_.createHTML(a):a,o]};class F{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let n=0,s=0;const r=t.length-1,a=this.parts,[l,h]=U(t,e);if(this.el=F.createElement(l,i),q.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=q.nextNode())&&a.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(x)){const i=h[s++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(x),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?W:"?"===e[1]?K:"@"===e[1]?Y:H})}else a.push({type:6,index:n})}for(const e of t)o.removeAttribute(e)}if(I.test(o.tagName)){const t=o.textContent.split(x),e=t.length-1;if(e>0){o.textContent=b?b.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],$()),q.nextNode(),a.push({type:2,index:++n});o.append(t[e],$())}}}else if(8===o.nodeType)if(o.data===w)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=o.data.indexOf(x,t+1));)a.push({type:7,index:n}),t+=x.length-1}n++}}static createElement(t,e){const i=S.createElement("template");return i.innerHTML=t,i}}function Z(t,e,i=t,o){var n,s,r,a;if(e===N)return e;let l=void 0!==o?null===(n=i._$Co)||void 0===n?void 0:n[o]:i._$Cl;const h=C(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(s=null==l?void 0:l._$AO)||void 0===s||s.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,i,o)),void 0!==o?(null!==(r=(a=i)._$Co)&&void 0!==r?r:a._$Co=[])[o]=l:i._$Cl=l),void 0!==l&&(e=Z(t,l._$AS(t,e.values),l,o)),e}class V{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:o}=this._$AD,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:S).importNode(i,!0);q.currentNode=n;let s=q.nextNode(),r=0,a=0,l=o[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new j(s,s.nextSibling,this,t):1===l.type?e=new l.ctor(s,l.name,l.strings,this,t):6===l.type&&(e=new J(s,this,t)),this.u.push(e),l=o[++a]}r!==(null==l?void 0:l.index)&&(s=q.nextNode(),r++)}return n}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class j{constructor(t,e,i,o){var n;this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cm=null===(n=null==o?void 0:o.isConnected)||void 0===n||n}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Z(this,t,e),C(t)?t===R||null==t||""===t?(this._$AH!==R&&this._$AR(),this._$AH=R):t!==this._$AH&&t!==N&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>E(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==R&&C(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:o}=t,n="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=F.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.p(i);else{const t=new V(n,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=B.get(t.strings);return void 0===e&&B.set(t.strings,e=new F(t)),e}k(t){E(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const n of t)o===e.length?e.push(i=new j(this.O($()),this.O($()),this,this.options)):i=e[o],i._$AI(n),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class H{constructor(t,e,i,o,n){this.type=1,this._$AH=R,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const n=this.strings;let s=!1;if(void 0===n)t=Z(this,t,e,0),s=!C(t)||t!==this._$AH&&t!==N,s&&(this._$AH=t);else{const o=t;let r,a;for(t=n[0],r=0;r<n.length-1;r++)a=Z(this,o[i+r],e,r),a===N&&(a=this._$AH[r]),s||(s=!C(a)||a!==this._$AH[r]),a===R?t=R:t!==R&&(t+=(null!=a?a:"")+n[r+1]),this._$AH[r]=a}s&&!o&&this.j(t)}j(t){t===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class W extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===R?void 0:t}}const G=b?b.emptyScript:"";class K extends H{constructor(){super(...arguments),this.type=4}j(t){t&&t!==R?this.element.setAttribute(this.name,G):this.element.removeAttribute(this.name)}}class Y extends H{constructor(t,e,i,o,n){super(t,e,i,o,n),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=Z(this,t,e,0))&&void 0!==i?i:R)===N)return;const o=this._$AH,n=t===R&&o!==R||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,s=t!==R&&(o===R||n);n&&this.element.removeEventListener(this.name,this,o),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class J{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Z(this,t)}}const X=y.litHtmlPolyfillSupport;null==X||X(F,j),(null!==(v=y.litHtmlVersions)&&void 0!==v?v:y.litHtmlVersions=[]).push("2.5.0");var Q,tt;class et extends f{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var o,n;const s=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let r=s._$litPart$;if(void 0===r){const t=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:null;s._$litPart$=r=new j(e.insertBefore($(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return N}}et.finalized=!0,et._$litElement$=!0,null===(Q=globalThis.litElementHydrateSupport)||void 0===Q||Q.call(globalThis,{LitElement:et});const it=globalThis.litElementPolyfillSupport;null==it||it({LitElement:et}),(null!==(tt=globalThis.litElementVersions)&&void 0!==tt?tt:globalThis.litElementVersions=[]).push("3.2.2");var ot,nt,st,rt,at,lt,ht,ct,dt,ut,pt,mt,gt,ft,vt,yt,bt,_t,xt=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},wt=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};const kt=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},St="0123456789abcdef".split(""),$t=[-2147483648,8388608,32768,128],Ct=[24,16,8,0],Et=[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],Tt=[];class Lt{constructor(t=!1,e=!1){ot.set(this,void 0),nt.set(this,void 0),st.set(this,void 0),rt.set(this,void 0),at.set(this,void 0),lt.set(this,void 0),ht.set(this,void 0),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),yt.set(this,void 0),bt.set(this,0),_t.set(this,void 0),this.init(t,e)}init(t,e){e?(Tt[0]=Tt[16]=Tt[1]=Tt[2]=Tt[3]=Tt[4]=Tt[5]=Tt[6]=Tt[7]=Tt[8]=Tt[9]=Tt[10]=Tt[11]=Tt[12]=Tt[13]=Tt[14]=Tt[15]=0,xt(this,nt,Tt)):xt(this,nt,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t?(xt(this,lt,3238371032),xt(this,ht,914150663),xt(this,ct,812702999),xt(this,dt,4144912697),xt(this,ut,4290775857),xt(this,pt,1750603025),xt(this,mt,1694076839),xt(this,gt,3204075428)):(xt(this,lt,1779033703),xt(this,ht,3144134277),xt(this,ct,1013904242),xt(this,dt,2773480762),xt(this,ut,1359893119),xt(this,pt,2600822924),xt(this,mt,528734635),xt(this,gt,1541459225)),xt(this,ot,xt(this,_t,xt(this,st,xt(this,vt,0)))),xt(this,rt,xt(this,ft,!1)),xt(this,at,!0),xt(this,yt,t)}update(t){if(wt(this,rt))return this;let e;e=t instanceof ArrayBuffer?new Uint8Array(t):t;let i=0;const o=e.length,n=wt(this,nt);for(;i<o;){let t;if(wt(this,ft)&&(xt(this,ft,!1),n[0]=wt(this,ot),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=wt(this,_t);i<o&&t<64;++i)n[t>>2]|=e[i]<<Ct[3&t++];else for(t=wt(this,_t);i<o&&t<64;++i){let o=e.charCodeAt(i);o<128?n[t>>2]|=o<<Ct[3&t++]:o<2048?(n[t>>2]|=(192|o>>6)<<Ct[3&t++],n[t>>2]|=(128|63&o)<<Ct[3&t++]):o<55296||o>=57344?(n[t>>2]|=(224|o>>12)<<Ct[3&t++],n[t>>2]|=(128|o>>6&63)<<Ct[3&t++],n[t>>2]|=(128|63&o)<<Ct[3&t++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),n[t>>2]|=(240|o>>18)<<Ct[3&t++],n[t>>2]|=(128|o>>12&63)<<Ct[3&t++],n[t>>2]|=(128|o>>6&63)<<Ct[3&t++],n[t>>2]|=(128|63&o)<<Ct[3&t++])}xt(this,bt,t),xt(this,st,wt(this,st)+(t-wt(this,_t))),t>=64?(xt(this,ot,n[16]),xt(this,_t,t-64),this.hash(),xt(this,ft,!0)):xt(this,_t,t)}return wt(this,st)>4294967295&&(xt(this,vt,wt(this,vt)+(wt(this,st)/4294967296<<0)),xt(this,st,wt(this,st)%4294967296)),this}finalize(){if(wt(this,rt))return;xt(this,rt,!0);const t=wt(this,nt),e=wt(this,bt);t[16]=wt(this,ot),t[e>>2]|=$t[3&e],xt(this,ot,t[16]),e>=56&&(wt(this,ft)||this.hash(),t[0]=wt(this,ot),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]=wt(this,vt)<<3|wt(this,st)>>>29,t[15]=wt(this,st)<<3,this.hash()}hash(){let t=wt(this,lt),e=wt(this,ht),i=wt(this,ct),o=wt(this,dt),n=wt(this,ut),s=wt(this,pt),r=wt(this,mt),a=wt(this,gt);const l=wt(this,nt);let h,c,d,u,p,m,g,f,v,y;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;y=e&i;for(let b=0;b<64;b+=4)wt(this,at)?(wt(this,yt)?(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),xt(this,at,!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^y,m=n&s^~n&r,u=a+c+m+Et[b]+l[b],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+Et[b+1]+l[b+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+Et[b+2]+l[b+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),y=e&i,d=y^e&o^v,m=s&r^~s&a,u=n+c+m+Et[b+3]+l[b+3],p=h+d,n=t+u<<0,t=u+p<<0;xt(this,lt,wt(this,lt)+t<<0),xt(this,ht,wt(this,ht)+e<<0),xt(this,ct,wt(this,ct)+i<<0),xt(this,dt,wt(this,dt)+o<<0),xt(this,ut,wt(this,ut)+n<<0),xt(this,pt,wt(this,pt)+s<<0),xt(this,mt,wt(this,mt)+r<<0),xt(this,gt,wt(this,gt)+a<<0)}hex(){this.finalize();const t=wt(this,lt),e=wt(this,ht),i=wt(this,ct),o=wt(this,dt),n=wt(this,ut),s=wt(this,pt),r=wt(this,mt),a=wt(this,gt);let l=St[t>>28&15]+St[t>>24&15]+St[t>>20&15]+St[t>>16&15]+St[t>>12&15]+St[t>>8&15]+St[t>>4&15]+St[15&t]+St[e>>28&15]+St[e>>24&15]+St[e>>20&15]+St[e>>16&15]+St[e>>12&15]+St[e>>8&15]+St[e>>4&15]+St[15&e]+St[i>>28&15]+St[i>>24&15]+St[i>>20&15]+St[i>>16&15]+St[i>>12&15]+St[i>>8&15]+St[i>>4&15]+St[15&i]+St[o>>28&15]+St[o>>24&15]+St[o>>20&15]+St[o>>16&15]+St[o>>12&15]+St[o>>8&15]+St[o>>4&15]+St[15&o]+St[n>>28&15]+St[n>>24&15]+St[n>>20&15]+St[n>>16&15]+St[n>>12&15]+St[n>>8&15]+St[n>>4&15]+St[15&n]+St[s>>28&15]+St[s>>24&15]+St[s>>20&15]+St[s>>16&15]+St[s>>12&15]+St[s>>8&15]+St[s>>4&15]+St[15&s]+St[r>>28&15]+St[r>>24&15]+St[r>>20&15]+St[r>>16&15]+St[r>>12&15]+St[r>>8&15]+St[r>>4&15]+St[15&r];return wt(this,yt)||(l+=St[a>>28&15]+St[a>>24&15]+St[a>>20&15]+St[a>>16&15]+St[a>>12&15]+St[a>>8&15]+St[a>>4&15]+St[15&a]),l}toString(){return this.hex()}digest(){this.finalize();const t=wt(this,lt),e=wt(this,ht),i=wt(this,ct),o=wt(this,dt),n=wt(this,ut),s=wt(this,pt),r=wt(this,mt),a=wt(this,gt),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 wt(this,yt)||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(wt(this,yt)?28:32),e=new DataView(t);return e.setUint32(0,wt(this,lt)),e.setUint32(4,wt(this,ht)),e.setUint32(8,wt(this,ct)),e.setUint32(12,wt(this,dt)),e.setUint32(16,wt(this,ut)),e.setUint32(20,wt(this,pt)),e.setUint32(24,wt(this,mt)),wt(this,yt)||e.setUint32(28,wt(this,gt)),t}}function At(t){const e=new Lt;return e.update(t),parseInt(e.hex().substring(0,8),16)}ot=new WeakMap,nt=new WeakMap,st=new WeakMap,rt=new WeakMap,at=new WeakMap,lt=new WeakMap,ht=new WeakMap,ct=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,mt=new WeakMap,gt=new WeakMap,ft=new WeakMap,vt=new WeakMap,yt=new WeakMap,bt=new WeakMap,_t=new WeakMap;const Mt=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 Ot="/api/v2/media.json",zt=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=At,"function"==typeof t.hash&&(this.hash=t.hash),"bkdr"===t.hash&&(this.hash=kt)}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 Mt.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 Pt;!function(t){t.BLUE="color:#5078b5;",t.GREEN="color:#62bd6a;",t.RED="color:#e36049;",t.PURPLE="color:#a626a4;"}(Pt||(Pt={}));const It=(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)},Dt=(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},Nt=(t,e=null,i={})=>new Promise(((o,n)=>{const s={method:"GET",headers:Dt(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)}))})),Rt=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()},Bt=(t,e=null)=>new Promise(((i,o)=>{Nt(t,e).then((t=>{i({results:t.json.results,next:t.json.next})})).catch((t=>o(t)))})),qt=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await Bt(i);t.results&&(e=e.concat(t.results)),i=t.next}return e},Ut=t=>new Promise(((e,i)=>{Nt(t).then((t=>{t.status>=200&&t.status<300?e({assets:t.json.results,next:t.json.next}):i(t)})).catch((t=>i(t)))})),Ft=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await Ut(i);t.assets?(e=e.concat(t.assets),i=t.next):i=null}return e},Zt=(t,e,i={},o=null)=>{const n=Dt(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=>{t.status>=500?i(t):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)}))}))},Vt=(t,e)=>Zt(t,JSON.stringify(e),!1,"application/json"),jt=(t,e)=>new Promise(((i,o)=>{Zt(t,e,!0).then((e=>{e.status>=200&&e.status<400?i(e):o(t===Ot?e:"Server failure")})).catch((t=>{console.error(t),o(t)}))})),Ht=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:Ht(e):null}return null},Wt=(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)}},Gt=(t,e)=>{let i=!0;return function(...o){i&&(i=!1,t.apply(this,o),setTimeout((()=>{i=!0}),e))}},Kt=(t,e="and")=>1===t.length?t[0]:2===t.length?"object"==typeof t[0]?D`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" "):"object"==typeof t[0]?t.map(((i,o)=>o<t.length-1?D`${i}, `:D`${e} ${i}`)):t.join(", ")+e+t[t.length-1],Yt=(t,e,i="and")=>Kt(t.map(e),i);var Jt;!function(t){t.SETTINGS="settings",t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(Jt||(Jt={}));const Xt=([t,...e],i=navigator.language)=>void 0===t?"":t.toLocaleUpperCase(i)+e.join(""),Qt=(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]},te=t=>{t&&(t.stopPropagation(),t.preventDefault())},ee=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()},ie=(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)}`},oe=(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]];It(t.tagName,Pt.PURPLE,[i?"<first-updated>":"<updated>",o])}},ne=(t,e,i)=>{(t.DEBUG_EVENTS||t.DEBUG)&&It(t.tagName,Pt.GREEN,void 0!==i?[e,i]:[e])};class se extends et{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),oe(this,t,!0)}updated(t){super.updated(t),oe(this,t,!1)}fireEvent(t){return ne(this,t),this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}swallowEvent(t){t.stopPropagation(),t.preventDefault()}fireCustomEvent(t,e={}){this.DEBUG_EVENTS&&ne(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()}}const re=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function ae(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):re(t,e)}var le;null===(le=window.HTMLSlotElement)||void 0===le||le.prototype.assignedElements;class he extends se{constructor(){super(),this.name="",this.value=null,this.inputRoot=this,this.disabled=!1,this.internals=this.attachInternals()}updated(t){super.updated(t),t.has("value")&&this.internals.setFormValue(this.value)}get form(){return this.internals.form}setValue(t){this.value=this.serializeValue(t)}getDeserializedValue(){return JSON.parse(this.value)}serializeValue(t){return JSON.stringify(t)}}he.formAssociated=!0,t([ae({type:String})],he.prototype,"name",void 0),t([ae({type:String,attribute:"help_text"})],he.prototype,"helpText",void 0),t([ae({type:Boolean,attribute:"help_always"})],he.prototype,"helpAlways",void 0),t([ae({type:Boolean,attribute:"widget_only"})],he.prototype,"widgetOnly",void 0),t([ae({type:Boolean,attribute:"hide_label"})],he.prototype,"hideLabel",void 0),t([ae({type:String})],he.prototype,"label",void 0),t([ae({type:Array})],he.prototype,"errors",void 0),t([ae({type:String})],he.prototype,"value",void 0),t([ae({attribute:!1})],he.prototype,"inputRoot",void 0),t([ae({type:Boolean})],he.prototype,"disabled",void 0);var ce;!function(t){t.alert_warning="alert-square",t.account="user-01",t.active="play",t.add="plus",t.add_note="file-02",t.airtime="bank-note-01",t.analytics="bar-chart-01",t.archive="archive",t.arrow_up="chevron-up",t.arrow_down="chevron-down",t.arrow_left="chevron-left",t.arrow_right="chevron-right",t.attachment="paperclip",t.attachment_audio="volume-min",t.attachment_document="file-06",t.attachment_image="image-01",t.attachment_location="marker-pin-01",t.attachment_video="video-recorder",t.branding="brush-02",t.branding_hostname="server-05",t.branding_notifications="mail-01",t.branding_styling="palette",t.branding_raw="pencil-01",t.broadcast="announcement-01",t.call="phone-call-01",t.call_missed="phone-call-02",t.campaign="clock-refresh",t.campaign_active="play",t.campaign_archived="archive",t.campaigns="clock-refresh",t.channel="zap",t.channel_a="channel-android",t.channel_ct="channel-clickatell",t.channel_d3="channel-whatsapp",t.channel_ds="channel-discord",t.channel_ex="zap",t.channel_fb="channel-facebook",t.channel_fba="channel-facebook",t.channel_fc="channel-freshchat",t.channel_fcm="channel-firebase",t.channel_ig="channel-instagram",t.channel_jc="channel-jiochat",t.channel_jn="channel-junebug",t.channel_kn="channel-kannel",t.channel_kwa="channel-whatsapp",t.channel_ln="channel-line",t.channel_mg="channel-mtarget",t.channel_pl="channel-plivo",t.channel_rc="channel-rocketchat",t.channel_sl="channel-slack",t.channel_sw="channel-signalwire",t.channel_tq="channel-thinq",t.channel_tg="channel-telegram",t.channel_t="channel-twilio",t.channel_twt="channel-twitter",t.channel_twa="channel-whatsapp",t.channel_vp="channel-viber",t.channel_vk="channel-vk",t.channel_nx="channel-vonage",t.channel_wc="channel-wechat",t.channel_wa="channel-whatsapp",t.channel_wac="channel-whatsapp",t.channel_zvw="channel-whatsapp",t.children="git-branch-01",t.check="check",t.checkbox="square",t.checkbox_checked="check-square",t.checkbox_partial="stop-square",t.classifier_wit="classifier-wit",t.classifier_luis="classifier-luis",t.classifier_bothub="classifier-bothub",t.close="x",t.compose="send-01",t.contact="user-01",t.contact_archived="archive",t.contact_blocked="message-x-square",t.contact_export="download-cloud-01",t.contact_import="upload-cloud-01",t.contact_stopped="slash-octagon",t.contact_updated="user-edit",t.contacts="user-01",t.copy="copy-04",t.dashboard="pie-chart-01",t.delete="trash-03",t.delete_small="x",t.down="chevron-down",t.download="download-01",t.edit="edit-03",t.email="mail-01",t.error="alert-circle",t.event="zap",t.expressions="at-sign",t.fields="user-edit",t.filter="filter-funnel-01",t.flow="flow",t.flow_background="layers-two-01",t.flow_interrupted="x-close",t.flow_ivr="phone",t.flow_message="message-square-02",t.flow_surveyor="tablet-01",t.flow_user="hard-drive",t.flows="flow",t.global="at-sign",t.grid="dots-grid",t.group="users-01",t.group_exclude="users-x",t.group_include="users-check",t.group_smart="atom-01",t.help="help-circle",t.hide="eye-off",t.home="settings-02",t.image="image-01",t.inbox="inbox-01",t.incidents="alert-square",t.incoming_call="phone-incoming-01",t.integrations="layers-three-01",t.info="user-square",t.issue="alert-square",t.label="tag-01",t.language="translate-01",t.link="link-external-01",t.location="marker-pin-01",t.log="file-02",t.logout="log-out-04",t.menu="menu-01",t.menu_collapse="chevron-left-double",t.message="message-square-02",t.message_export="download-cloud-01",t.messages="message-square-02",t.missing="maximize-02",t.missed_call="phone-x",t.new="plus",t.next_schedule="alarm-clock",t.notification="bell-01",t.number="hash-01",t.optin_requested="message-notification-circle",t.optin="message-check-circle",t.optout="message-x-circle",t.org_active="credit-card-02",t.org_anonymous="glasses-01",t.org_bulk="credit-card-plus",t.org_flagged="flag-01",t.org_new="stars-02",t.org_suspended="slash-circle-01",t.org_verified="check-verified-02",t.overview="pie-chart-01",t.prometheus="prometheus",t.progress_spinner="refresh-cw-04",t.featured="star-01",t.quick_replies="dotpoints-01",t.recording="microphone-01",t.resend="refresh-cw-05",t.reset="flip-backward",t.resthooks="share-07",t.restore="play",t.results_export="download-cloud-01",t.retry="refresh-cw-05",t.revisions="clock-rewind",t.rocketchat="rocketchat",t.runs="rows-03",t.schedule="calendar",t.search="search-refraction",t.select_open="chevron-down",t.select_clear="x",t.send="send-03",t.service="magic-wand-01",t.service_end="log-out-04",t.settings="settings-02",t.show="eye",t.simulator="phone-02",t.sort="chevron-selector-vertical",t.sort_down="sort-arrow-down",t.sort_up="sort-arrow-up",t.staff="hard-drive",t.submit="check",t.success="check",t.tickets="agent",t.tickets_all="archive",t.tickets_closed="check",t.tickets_mine="coffee",t.tickets_open="inbox-01",t.tickets_export="download-cloud-01",t.tickets_unassigned="inbox-01",t.topic="message-text-circle-02",t.two_factor_enabled="shield-02",t.two_factor_disabled="shield-01",t.trigger="signal-01",t.trigger_active="play",t.trigger_archived="archive",t.trigger_new="plus",t.trigger_keyword="message-check-square",t.trigger_catch_all="message-question-square",t.trigger_inbound_call="phone-incoming-01",t.trigger_missed_call="phone-hang-up",t.trigger_schedule="calendar",t.trigger_new_conversation="message-chat-square",t.trigger_referral="user-right-01",t.trigger_closed_ticket="agent",t.trigger_opt_in="message-check-circle",t.trigger_opt_out="message-x-circle",t.triggers="signal-01",t.updated="edit-02",t.up="chevron-up",t.upload="upload-cloud-01",t.upload_image="camera-01",t.usages="link-04",t.user="users-01",t.users="users-01",t.user_beta="shield-zap",t.webhook="link-external-01",t.wit="wit",t.workspace="folder",t.zapier="zapier",t.zendesk="zendesk",t.ext="lightning-01",t.fcm="lightning-01",t.bothub="bothub",t.chatbase="chatbase",t.dtone="dtone",t.default="list",t.datepicker="calendar",t.slider="sliders-02",t.select="browser",t.input="edit-05"}(ce||(ce={}));class de extends he{constructor(){super(...arguments),this.name="",this.disabled=!1,this.size=1.2,this.animateChange="pulse"}static get styles(){return r`
2
2
  :host {
3
3
  color: var(--color-text);
4
4
  display: inline-block;
@@ -253,7 +253,7 @@ function t(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPro
253
253
  width: 100%;
254
254
  top: 0.5em;
255
255
  }
256
- `}getLocale(){return this.locale[0]}clearCache(){this.cache=$e(this.max,this.ttl)}reset(){this.ready=!1,this.clearCache(),this.settings=JSON.parse((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})("settings")||"{}");const t=[];this.completionEndpoint&&t.push(Nt(this.completionEndpoint).then((t=>{this.schema=t.json.context,this.fnOptions=t.json.functions}))),this.fieldsEndpoint&&t.push(this.refreshFields()),this.globalsEndpoint&&t.push(Ft(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))),this.languagesEndpoint&&t.push(Ft(this.languagesEndpoint).then((t=>{this.languages=t.reduce((function(t,e){return t[e.value]=e.name,t}),{})}))),this.groupsEndpoint&&t.push(Ft(this.groupsEndpoint).then((t=>{t.forEach((t=>{this.groups[t.uuid]=t}))}))),this.workspaceEndpoint&&t.push(Nt(this.workspaceEndpoint).then((t=>{this.workspace=t.json;const e=t.headers.get("content-language");e&&(this.locale=[e,...this.locale])}))),this.usersEndpoint&&t.push(Ft(this.usersEndpoint).then((t=>{this.users=t}))),this.initialHttpComplete=Promise.all(t),this.initialHttpComplete.then((()=>{this.ready=!0}))}getAssignableUsers(){return this.users.filter((t=>["administrator","editor","agent"].includes(t.role)))}getUser(t){return this.users.find((e=>e.email===t))}firstUpdated(){this.reset()}getLanguageCode(){return this.locale.length>0?this.locale[0].split("-")[0]:"en"}refreshGlobals(){Ft(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))}refreshFields(){return Ft(this.fieldsEndpoint).then((t=>{this.keyedAssets.fields=[],this.featuredFields=[],t.forEach((t=>{this.keyedAssets.fields.push(t.key),this.fields[t.key]=t,t.featured&&this.featuredFields.push(t)})),this.featuredFields.sort(((t,e)=>e.priority-t.priority)),this.keyedAssets.fields.sort(),this.fireCustomEvent(we.StoreUpdated,{url:this.fieldsEndpoint,data:this.keyedAssets.fields})}))}getShortDuration(t,e=null){const i=e||ws.now();return t.setLocale(this.locale[0]).toRelative({base:i,style:"long"})}getShortDurationFromIso(t,e=null){const i=ws.fromISO(t),o=e?ws.fromISO(e):ws.now();return this.getShortDuration(i,o)}setKeyedAssets(t,e){this.keyedAssets[t]=e}updated(t){if(super.updated(t),t.has("ready")&&this.ready){const t=this.getLanguageCode(),e=js.find((e=>e===t));e&&Hs(e)}}getCompletionSchema(){return this.schema}getFunctions(){return this.fnOptions}getKeyedAssets(){return this.keyedAssets}getFieldKeys(){return this.keyedAssets.fields||[]}getContactField(t){return this.fields[t]}getFeaturedFields(){return this.featuredFields}getLanguageName(t){return this.languages[t]}isDynamicGroup(t){const e=this.groups[t];return e||console.warn("No group for "+t),!(e&&!e.query)}getWorkspace(){return this.workspace}formatDate(t){return ws.fromISO(t).setLocale(this.getLocale()).toLocaleString(ws.DATETIME_SHORT)}postJSON(t,e=""){return Vt(t,e)}postForm(t,e){return((t,e)=>{const i=new FormData;return Object.keys(e).forEach((t=>{i.append(t,e[t])})),jt(t,i)})(t,e)}postUrl(t,e="",i={},o=null){return Zt(t,e,i,o)}getUrl(t,e){return!(e=e||{}).force&&this.cache.has(t)?new Promise((e=>{e(this.cache.get(t))})):Nt(t,e.controller,e.headers||{}).then((e=>new Promise(((i,o)=>{e.status>=200&&e.status<=300?(this.cache.set(t,e),i(e)):o("Status: "+e.status)}))))}getResults(t,e){e=e||{};const i="results_"+t,o=this.cache.get(i);return!e.force&&o?new Promise((t=>{t(o)})):new Promise((e=>{const o=this.pendingResolves[t]||[];o.push(e),this.pendingResolves[t]=o,o.length<=1&&qt(t).then((e=>{this.cache.set(i,e);const o=this.pendingResolves[t]||[];for(;o.length>0;){o.pop()(e)}}))}))}updateCache(t,e){this.cache.set(t,e),this.fireCustomEvent(we.StoreUpdated,{url:t,data:e})}makeRequest(t,e){const i=this.fetching[t],o=(new Date).getTime();if(i&&o-i<500)return;this.fetching[t]=o,e=e||{};const n=this.cache.get(t);n&&!e.force?this.fireCustomEvent(we.StoreUpdated,{url:t,data:n}):qt(t).then((i=>{i=e.prepareData?e.prepareData(i):i,this.cache.set(t,i),this.fireCustomEvent(we.StoreUpdated,{url:t,data:i}),delete this.fetching[t]}))}get(t,e=null){return this.settings[t]||e}set(t,e){this.settings[t]=e}render(){if(!this.ready&&this.loader)return D`<temba-loading size="10" units="8"></temba-loading>`}}t([ae({type:Number})],Ws.prototype,"ttl",void 0),t([ae({type:Number})],Ws.prototype,"max",void 0),t([ae({type:Boolean})],Ws.prototype,"ready",void 0),t([ae({type:Boolean})],Ws.prototype,"loader",void 0),t([ae({type:String,attribute:"completion"})],Ws.prototype,"completionEndpoint",void 0),t([ae({type:String,attribute:"fields"})],Ws.prototype,"fieldsEndpoint",void 0),t([ae({type:String,attribute:"groups"})],Ws.prototype,"groupsEndpoint",void 0),t([ae({type:String,attribute:"globals"})],Ws.prototype,"globalsEndpoint",void 0),t([ae({type:String,attribute:"languages"})],Ws.prototype,"languagesEndpoint",void 0),t([ae({type:String,attribute:"workspace"})],Ws.prototype,"workspaceEndpoint",void 0),t([ae({type:String,attribute:"users"})],Ws.prototype,"usersEndpoint",void 0),t([ae({type:Object,attribute:!1})],Ws.prototype,"schema",void 0),t([ae({type:Object,attribute:!1})],Ws.prototype,"fnOptions",void 0),t([ae({type:Object,attribute:!1})],Ws.prototype,"keyedAssets",void 0);class Gs extends se{constructor(){super(...arguments),this.marginHorizontal=0,this.marginVertical=7,this.scrollPct=75,this.cursorIndex=-1,this.internalFocusDisabled=!1,this.nameKey="name",this.loading=!1,this.hideShadow=!1,this.getName=function(t){return t[this.nameKey||"name"]},this.renderInputOption=function(){return null},this.scrollHeight=0,this.triggerScroll=!1,this.scrollParent=null,this.setCursor=Gt((function(t){this.internalFocusDisabled||t!==this.cursorIndex&&(this.cursorIndex=t)}),50)}static get styles(){return r`
256
+ `}getLocale(){return this.locale[0]}clearCache(){this.cache=$e(this.max,this.ttl)}reset(){this.ready=!1,this.clearCache(),this.settings=JSON.parse((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})("settings")||"{}");const t=[];this.completionEndpoint&&t.push(Nt(this.completionEndpoint).then((t=>{this.schema=t.json.context,this.fnOptions=t.json.functions}))),this.fieldsEndpoint&&t.push(this.refreshFields()),this.globalsEndpoint&&t.push(Ft(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))),this.languagesEndpoint&&t.push(Ft(this.languagesEndpoint).then((t=>{this.languages=t.reduce((function(t,e){return t[e.value]=e.name,t}),{})}))),this.groupsEndpoint&&t.push(Ft(this.groupsEndpoint).then((t=>{t.forEach((t=>{this.groups[t.uuid]=t}))}))),this.workspaceEndpoint&&t.push(Nt(this.workspaceEndpoint).then((t=>{this.workspace=t.json;const e=t.headers.get("content-language");e&&(this.locale=[e,...this.locale])}))),this.usersEndpoint&&t.push(Ft(this.usersEndpoint).then((t=>{this.users=t}))),this.initialHttpComplete=Promise.all(t),this.initialHttpComplete.then((()=>{this.ready=!0}))}getAssignableUsers(){return this.users.filter((t=>["administrator","editor","agent"].includes(t.role)))}getUser(t){return this.users.find((e=>e.email===t))}firstUpdated(){this.reset()}getLanguageCode(){return this.locale.length>0?this.locale[0].split("-")[0]:"en"}refreshGlobals(){Ft(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))}refreshFields(){return Ft(this.fieldsEndpoint).then((t=>{this.keyedAssets.fields=[],this.featuredFields=[],t.forEach((t=>{this.keyedAssets.fields.push(t.key),this.fields[t.key]=t,t.featured&&this.featuredFields.push(t)})),this.featuredFields.sort(((t,e)=>e.priority-t.priority)),this.keyedAssets.fields.sort(),this.fireCustomEvent(we.StoreUpdated,{url:this.fieldsEndpoint,data:this.keyedAssets.fields})}))}getShortDuration(t,e=null){const i=e||ws.now();return t.setLocale(this.locale[0]).toRelative({base:i,style:"long"})}getShortDurationFromIso(t,e=null){const i=ws.fromISO(t),o=e?ws.fromISO(e):ws.now();return this.getShortDuration(i,o)}setKeyedAssets(t,e){this.keyedAssets[t]=e}updated(t){if(super.updated(t),t.has("ready")&&this.ready){const t=this.getLanguageCode(),e=js.find((e=>e===t));e&&Hs(e)}}getCompletionSchema(){return this.schema}getFunctions(){return this.fnOptions}getKeyedAssets(){return this.keyedAssets}getFieldKeys(){return this.keyedAssets.fields||[]}getContactField(t){return this.fields[t]}getFeaturedFields(){return this.featuredFields}getLanguageName(t){return this.languages[t]}isDynamicGroup(t){const e=this.groups[t];return e||console.warn("No group for "+t),!(e&&!e.query)}getWorkspace(){return this.workspace}formatDate(t){return ws.fromISO(t).setLocale(this.getLocale()).toLocaleString(ws.DATETIME_SHORT)}postJSON(t,e=""){return Vt(t,e)}postForm(t,e){return((t,e)=>{const i=new FormData;return Object.keys(e).forEach((t=>{i.append(t,e[t])})),jt(t,i)})(t,e)}postUrl(t,e="",i={},o=null){return Zt(t,e,i,o)}getUrl(t,e){return!(e=e||{}).force&&this.cache.has(t)?new Promise((e=>{e(this.cache.get(t))})):Nt(t,e.controller,e.headers||{}).then((e=>new Promise(((i,o)=>{e.status>=200&&e.status<=300?(this.cache.set(t,e),i(e)):o("Status: "+e.status)}))))}getResults(t,e){e=e||{};const i="results_"+t,o=this.cache.get(i);return!e.force&&o?new Promise((t=>{t(o)})):new Promise((e=>{const o=this.pendingResolves[t]||[];o.push(e),this.pendingResolves[t]=o,o.length<=1&&qt(t).then((e=>{this.cache.set(i,e);const o=this.pendingResolves[t]||[];for(;o.length>0;){o.pop()(e)}}))}))}updateCache(t,e){this.cache.set(t,e),this.fireCustomEvent(we.StoreUpdated,{url:t,data:e})}makeRequest(t,e){const i=this.fetching[t],o=(new Date).getTime();if(i&&o-i<500)return;this.fetching[t]=o,e=e||{};const n=this.cache.get(t);n&&!e.force?this.fireCustomEvent(we.StoreUpdated,{url:t,data:n}):qt(t).then((i=>{i?(i=e.prepareData?e.prepareData(i):i,this.cache.set(t,i),this.fireCustomEvent(we.StoreUpdated,{url:t,data:i}),delete this.fetching[t]):delete this.fetching[t]}))}get(t,e=null){return this.settings[t]||e}set(t,e){this.settings[t]=e}render(){if(!this.ready&&this.loader)return D`<temba-loading size="10" units="8"></temba-loading>`}}t([ae({type:Number})],Ws.prototype,"ttl",void 0),t([ae({type:Number})],Ws.prototype,"max",void 0),t([ae({type:Boolean})],Ws.prototype,"ready",void 0),t([ae({type:Boolean})],Ws.prototype,"loader",void 0),t([ae({type:String,attribute:"completion"})],Ws.prototype,"completionEndpoint",void 0),t([ae({type:String,attribute:"fields"})],Ws.prototype,"fieldsEndpoint",void 0),t([ae({type:String,attribute:"groups"})],Ws.prototype,"groupsEndpoint",void 0),t([ae({type:String,attribute:"globals"})],Ws.prototype,"globalsEndpoint",void 0),t([ae({type:String,attribute:"languages"})],Ws.prototype,"languagesEndpoint",void 0),t([ae({type:String,attribute:"workspace"})],Ws.prototype,"workspaceEndpoint",void 0),t([ae({type:String,attribute:"users"})],Ws.prototype,"usersEndpoint",void 0),t([ae({type:Object,attribute:!1})],Ws.prototype,"schema",void 0),t([ae({type:Object,attribute:!1})],Ws.prototype,"fnOptions",void 0),t([ae({type:Object,attribute:!1})],Ws.prototype,"keyedAssets",void 0);class Gs extends se{constructor(){super(...arguments),this.marginHorizontal=0,this.marginVertical=7,this.scrollPct=75,this.cursorIndex=-1,this.internalFocusDisabled=!1,this.nameKey="name",this.loading=!1,this.hideShadow=!1,this.getName=function(t){return t[this.nameKey||"name"]},this.renderInputOption=function(){return null},this.scrollHeight=0,this.triggerScroll=!1,this.scrollParent=null,this.setCursor=Gt((function(t){this.internalFocusDisabled||t!==this.cursorIndex&&(this.cursorIndex=t)}),50)}static get styles(){return r`
257
257
  .options-container {
258
258
  background: var(--color-options-bg);
259
259
  user-select: none;
@@ -3574,6 +3574,25 @@ function t(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPro
3574
3574
  display: none;
3575
3575
  }
3576
3576
 
3577
+ .root.fully-collapsed.mobile .level.level-0 > .empty {
3578
+ display: block;
3579
+ width: 100%;
3580
+ min-width: inherit;
3581
+ max-width: inherit;
3582
+ }
3583
+
3584
+ .root .level.level-0 > .show-mobile {
3585
+ display: none;
3586
+ }
3587
+
3588
+ .root.mobile .level.level-0 > .show-mobile {
3589
+ display: flex;
3590
+ }
3591
+
3592
+ .root.fully-collapsed.mobile .level.level-0 > .show-mobile {
3593
+ display: contents !important;
3594
+ }
3595
+
3577
3596
  .root.fully-collapsed.mobile .level.level-0 .expand-icon {
3578
3597
  max-height: 100%;
3579
3598
  padding: 1em;
@@ -3852,7 +3871,7 @@ function t(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPro
3852
3871
  size="${0===t.level?"1.5":"1"}"
3853
3872
  name="${t.collapsed_icon}"
3854
3873
  class="collapse-icon"
3855
- ></temba-icon>`:null,r=Rt({["menu-"+t.id]:!0,"child-selected":o,selected:i,item:!(t.avatar&&0===t.level),avatar:!!t.avatar,popup:t.popup,inline:t.inline,expanding:this.expanding&&this.expanding===t.id,expanded:this.isExpanded(t),iconless:!n&&!s&&!t.avatar,pressed:this.pressedItem&&this.pressedItem.id==t.id});t.avatar&&(n=(t=>{t.position||(t.position="right");let e=t.name;if(t.user&&t.user.first_name&&t.user.last_name&&(e=`${t.user.first_name} ${t.user.last_name}`),!e)return null;let i="",o=zt.hex(e);t.user&&t.user.avatar?o=`url('${t.user.avatar}') center / contain no-repeat`:e&&(i=ee(e));const n=D` <div style="display:flex;flex-direction:column;align-items:center;transform:scale(${t.scale||1})"> <div class="avatar-circle" style="display:flex;height:30px;width:30px;flex-direction:row;align-items:center;color:#fff;border-radius:100%;font-weight:400;overflow:hidden;font-size:12px;box-shadow:inset 0 0 0 3px rgba(0,0,0,.1);background:${o}"> ${i?D` <div style="border:0 solid red;display:flex;flex-direction:column;align-items:center;flex-grow:1"> <div style="border:0 solid #00f">${i}</div> </div>`:null} </div> </div> `;return t.tip?D` <temba-tip text="${e}" position="${t.position}"> ${n} </temba-tip> `:n})({name:t.avatar,tip:!1,scale:e?.9:1.2}),t.bubble&&(n=D`${n}${t.bubble?D`<div
3874
+ ></temba-icon>`:null,r=Rt({["menu-"+t.id]:!0,"child-selected":o,selected:i,item:!(t.avatar&&0===t.level),avatar:!!t.avatar,popup:t.popup,inline:t.inline,expanding:this.expanding&&this.expanding===t.id,expanded:this.isExpanded(t),iconless:!n&&!s&&!t.avatar,pressed:this.pressedItem&&this.pressedItem.id==t.id,"show-mobile":t.mobile});t.avatar&&(n=(t=>{t.position||(t.position="right");let e=t.name;if(t.user&&t.user.first_name&&t.user.last_name&&(e=`${t.user.first_name} ${t.user.last_name}`),!e)return null;let i="",o=zt.hex(e);t.user&&t.user.avatar?o=`url('${t.user.avatar}') center / contain no-repeat`:e&&(i=ee(e));const n=D` <div style="display:flex;flex-direction:column;align-items:center;transform:scale(${t.scale||1})"> <div class="avatar-circle" style="display:flex;height:30px;width:30px;flex-direction:row;align-items:center;color:#fff;border-radius:100%;font-weight:400;overflow:hidden;font-size:12px;box-shadow:inset 0 0 0 3px rgba(0,0,0,.1);background:${o}"> ${i?D` <div style="border:0 solid red;display:flex;flex-direction:column;align-items:center;flex-grow:1"> <div style="border:0 solid #00f">${i}</div> </div>`:null} </div> </div> `;return t.tip?D` <temba-tip text="${e}" position="${t.position}"> ${n} </temba-tip> `:n})({name:t.avatar,tip:!1,scale:e?.9:1.2}),t.bubble&&(n=D`${n}${t.bubble?D`<div
3856
3875
  style="background-color: ${t.bubble}"
3857
3876
  class="bubble"
3858
3877
  ></div>`:null}`),n=D`<div style="position:relative; padding: 0em">${n}</div>`);const a=D`
@@ -3903,7 +3922,7 @@ function t(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPro
3903
3922
  </div>
3904
3923
  </div>
3905
3924
  </temba-dropdown>
3906
- `:a},this.doRefresh=this.doRefresh.bind(this),this.addEventListener("blur",(()=>{this.shadowRoot.querySelectorAll("temba-list, temba-notification-list").forEach((t=>{t.scrollToTop()}))}))}setBubble(t,e){const i=El(this.root.items,t);return!(!i||!i.item)&&(i.item.bubble=e,this.requestUpdate("root"),!0)}getMenuItemState(t){let e={};return t&&(e=this.state[t],e||(e={},this.state[t]=e)),e}updated(t){t.has("endpoint")&&(this.root={level:-1,endpoint:this.endpoint},this.wait?this.fireCustomEvent(we.Ready):this.loadItems(this.root)),t.has("root")&&this.value&&(this.setFocusedItem(this.value),this.value=null)}reset(){this.loadItems(this.root)}async doRefresh(){const t=[...this.selection];let e=this.root;for(;t.length>0;){this.loadItems(e),await this.httpComplete;const i=t.shift();e=(e.items||[]).find((t=>t.id==i))}this.loadItems(e),this.shadowRoot.querySelectorAll("temba-notification-list").forEach((t=>{t.refresh()}))}loadItems(t,e=null){t&&t.endpoint&&(t.loading=!0,this.httpComplete=qt(t.endpoint).then((i=>{if(i.forEach((e=>{if(!e.items){const i=(t.items||[]).find((t=>t.id==e.id));i&&i.items&&(e.items=i.items)}})),i.forEach((e=>{e.level=t.level+1,e.items&&e.items.forEach((e=>{e.level=t.level+2}))})),t.items=i,t.loading=!1,this.submenu&&0==this.selection.length){const t=this.getMenuItemForSelection([this.submenu]);this.handleItemClicked(e,t)}this.wait||(this.fireCustomEvent(we.Ready),this.wait=!0),this.requestUpdate("root"),this.scrollSelectedIntoView()})))}handleItemClicked(t,e,i=null){if(i&&i.popup){const o=this.shadowRoot.querySelector("temba-dropdown");return o&&o.blur(),void(t&&this.fireCustomEvent(we.ButtonClicked,{item:e,selection:this.getSelection(),parent:i}))}if(e.popup)t&&this.fireCustomEvent(we.ButtonClicked,{item:e,selection:this.getSelection(),parent:i});else if(t&&(t.preventDefault(),t.stopPropagation(),t.metaKey&&e.href))window.open(e.href,"_blank");else if(i&&i.inline&&this.handleItemClicked(null,i),this.collapsed&&!this.isMobile()&&(this.collapsed=!1),this.isMobile()&&(this.collapsed=!0),e.trigger)this.fireCustomEvent(we.ButtonClicked,{item:e,selection:this.getSelection(),parent:i});else{if(e.level>=this.selection.length?this.selection.push(e.vanity_id||e.id):this.selection.splice(e.level,this.selection.length-e.level,e.vanity_id||e.id),e.endpoint){if(this.loadItems(e,t),!e.href)return}else this.requestUpdate();e.href&&this.dispatchEvent(new Event("change")),this.fireCustomEvent(we.ButtonClicked,{item:e,selection:this.getSelection(),parent:i})}}scrollSelectedIntoView(){window.setTimeout((()=>{this.shadowRoot.querySelectorAll(".selected").forEach((t=>{t.scrollIntoView({block:"end",behavior:"smooth"})}))}),0)}clickItem(t){const e=[...this.selection];e.splice(e.length-1,1,t);const i=this.getMenuItemForSelection(e);return!!i&&(this.handleItemClicked(null,i),this.scrollSelectedIntoView(),!0)}getMenuItem(){return this.getMenuItemForSelection([...this.selection])}getMenuItemForSelection(t){const e=[...t];let i=this.root.items,o=null;for(;e.length>0;){const t=e.splice(0,1)[0];if(!i)break;if(o=El(i,t).item,!o)break;i=o.items}return o}getSelection(){return this.selection}handleExpand(){this.collapsed=!1}handleCollapse(){this.collapsed=!0}async setFocusedItem(t){const e=t.split("/").filter((t=>!!t));if(!this.root)return;if(e.length>0){if(!El(this.root.items,e[0]).item)return}const i=[];let o=this.root;for(;e.length>0;){const t=e.shift();t&&(o.items||(this.loadItems(o),await this.httpComplete),o=El(o.items,t).item,o?i.push(t):e.splice(0,e.length))}this.selection=i,this.refresh(),this.requestUpdate("root")}isSelected(t){if(t.level<this.selection.length){return this.selection[t.level]==(t.vanity_id||t.id)}return!1}isExpanded(t){return!!this.selection.find((e=>e===t.vanity_id||t.id))}render(){if(!this.root||!this.root.items)return null;let t=this.root.items||[];const e=[],i=this.isMobile()?ce.menu:ce.menu_collapse;e.push(D`<div class="level level-0 ${this.submenu?"hidden":""}">
3925
+ `:a},this.doRefresh=this.doRefresh.bind(this),this.addEventListener("blur",(()=>{this.shadowRoot.querySelectorAll("temba-list, temba-notification-list").forEach((t=>{t.scrollToTop()}))}))}setBubble(t,e){const i=El(this.root.items,t);return!(!i||!i.item)&&(i.item.bubble=e,this.requestUpdate("root"),!0)}getMenuItemState(t){let e={};return t&&(e=this.state[t],e||(e={},this.state[t]=e)),e}updated(t){t.has("endpoint")&&(this.root={level:-1,endpoint:this.endpoint},this.wait?this.fireCustomEvent(we.Ready):this.loadItems(this.root)),t.has("root")&&this.value&&(this.setFocusedItem(this.value),this.value=null)}reset(){this.loadItems(this.root)}async doRefresh(){const t=[...this.selection];let e=this.root;for(;t.length>0;){this.loadItems(e),await this.httpComplete;const i=t.shift();e=(e.items||[]).find((t=>t.id==i))}this.loadItems(e),this.shadowRoot.querySelectorAll("temba-notification-list").forEach((t=>{t.refresh()}))}loadItems(t,e=null){t&&t.endpoint&&(t.loading=!0,this.httpComplete=qt(t.endpoint).then((i=>{if(i.forEach((e=>{if(!e.items){const i=(t.items||[]).find((t=>t.id==e.id));i&&i.items&&(e.items=i.items)}})),i.forEach((e=>{e.level=t.level+1,e.items&&e.items.forEach((e=>{e.level=t.level+2}))})),t.items=i,t.loading=!1,this.submenu&&0==this.selection.length){const t=this.getMenuItemForSelection([this.submenu]);this.handleItemClicked(e,t)}this.wait||(this.fireCustomEvent(we.Ready),this.wait=!0),this.requestUpdate("root"),this.scrollSelectedIntoView()})))}handleItemClicked(t,e,i=null){if(i&&i.popup){const o=this.shadowRoot.querySelector("temba-dropdown");return o&&o.blur(),void(t&&this.fireCustomEvent(we.ButtonClicked,{item:e,selection:this.getSelection(),parent:i}))}if(e.popup)t&&this.fireCustomEvent(we.ButtonClicked,{item:e,selection:this.getSelection(),parent:i});else if(t&&(t.preventDefault(),t.stopPropagation(),t.metaKey&&e.href))window.open(e.href,"_blank");else if(i&&i.inline&&this.handleItemClicked(null,i),this.collapsed&&!this.isMobile()&&(this.collapsed=!1),this.isMobile()&&(this.collapsed=!0),e.trigger||e.event)this.fireCustomEvent(we.ButtonClicked,{item:e,selection:this.getSelection(),parent:i});else{if(e.level>=this.selection.length?this.selection.push(e.vanity_id||e.id):this.selection.splice(e.level,this.selection.length-e.level,e.vanity_id||e.id),e.endpoint){if(this.loadItems(e,t),!e.href)return}else this.requestUpdate();e.href&&this.dispatchEvent(new Event("change")),this.fireCustomEvent(we.ButtonClicked,{item:e,selection:this.getSelection(),parent:i})}}scrollSelectedIntoView(){window.setTimeout((()=>{this.shadowRoot.querySelectorAll(".selected").forEach((t=>{t.scrollIntoView({block:"end",behavior:"smooth"})}))}),0)}clickItem(t){const e=[...this.selection];e.splice(e.length-1,1,t);const i=this.getMenuItemForSelection(e);return!!i&&(this.handleItemClicked(null,i),this.scrollSelectedIntoView(),!0)}getMenuItem(){return this.getMenuItemForSelection([...this.selection])}getMenuItemForSelection(t){const e=[...t];let i=this.root.items,o=null;for(;e.length>0;){const t=e.splice(0,1)[0];if(!i)break;if(o=El(i,t).item,!o)break;i=o.items}return o}getSelection(){return this.selection}handleExpand(){this.collapsed=!1}handleCollapse(){this.collapsed=!0}async setFocusedItem(t){const e=t.split("/").filter((t=>!!t));if(!this.root)return;if(e.length>0){if(!El(this.root.items,e[0]).item)return}const i=[];let o=this.root;for(;e.length>0;){const t=e.shift();t&&(o.items||(this.loadItems(o),await this.httpComplete),o=El(o.items,t).item,o?i.push(t):e.splice(0,e.length))}this.selection=i,this.refresh(),this.requestUpdate("root")}isSelected(t){if(t.level<this.selection.length){return this.selection[t.level]==(t.vanity_id||t.id)}return!1}isExpanded(t){return!!this.selection.find((e=>e===t.vanity_id||t.id))}render(){if(!this.root||!this.root.items)return null;let t=this.root.items||[];const e=[],i=this.isMobile()?ce.menu:ce.menu_collapse;e.push(D`<div class="level level-0 ${this.submenu?"hidden":""}">
3907
3926
  <div class="top">
3908
3927
  <div class="expand-icon" @click=${this.handleExpand}>
3909
3928
  <temba-icon
@@ -4495,7 +4514,7 @@ function t(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPro
4495
4514
  .disabled .toggle {
4496
4515
  display: none;
4497
4516
  }
4498
- `}connectedCallback(){super.connectedCallback(),this.handleFieldChanged=this.handleFieldChanged.bind(this)}isAgent(){return"T"===this.role}updated(t){super.updated(t),t.has("data")&&Object.keys(this.data.fields).length<=10&&(this.showAll=!0)}handleFieldChanged(t){const e=t.currentTarget,i=e.value;Vt("/api/v2/contacts.json?uuid="+this.data.uuid,{fields:{[e.key]:i}}).then((t=>{e.handleResponse(t),this.setContact(t.json)}))}handleToggle(t){const e=t.currentTarget;this.showAll=e.checked}render(){if(this.data){const t=Object.entries(this.data.fields).sort(((t,e)=>{const[i]=t,[o]=e,n=this.store.getContactField(i),s=this.store.getContactField(o);if("ward"===n.type)return 1;if("ward"===s.type)return-1;if("district"===n.type&&"ward"!==s.type&&"district"!==s.type)return 1;if("district"===s.type&&"ward"!==n.type&&"district"!==n.type)return-1;if("state"===n.type&&"ward"!==s.type&&"district"!==s.type&&"state"!==s.type)return 1;if("state"===s.type&&"ward"!==n.type&&"district"!==n.type&&"state"!==n.type)return-1;if(n.featured&&!s.featured)return-1;if(s.featured&&!n.featured)return 1;const r=s.priority-n.priority;return 0!==r?r:i.localeCompare(o)}));if(0==t.length)return D`<slot name="empty"></slot>`;const e=t.map((t=>{const[e,i]=t,o=this.store.getContactField(e);return D`<temba-contact-field
4517
+ `}connectedCallback(){super.connectedCallback(),this.handleFieldChanged=this.handleFieldChanged.bind(this)}isAgent(){return"T"===this.role}updated(t){super.updated(t),t.has("data")&&Object.keys(this.data.fields).length<=10&&(this.showAll=!0)}handleFieldChanged(t){const e=t.currentTarget,i=e.value;Vt("/api/v2/contacts.json?uuid="+this.data.uuid,{fields:{[e.key]:i}}).then((t=>{e.handleResponse(t),this.setContact(t.json)})).catch((t=>{e.handleResponse(t)}))}handleToggle(t){const e=t.currentTarget;this.showAll=e.checked}render(){if(this.data){const t=Object.entries(this.data.fields).sort(((t,e)=>{const[i]=t,[o]=e,n=this.store.getContactField(i),s=this.store.getContactField(o);if("ward"===n.type)return 1;if("ward"===s.type)return-1;if("district"===n.type&&"ward"!==s.type&&"district"!==s.type)return 1;if("district"===s.type&&"ward"!==n.type&&"district"!==n.type)return-1;if("state"===n.type&&"ward"!==s.type&&"district"!==s.type&&"state"!==s.type)return 1;if("state"===s.type&&"ward"!==n.type&&"district"!==n.type&&"state"!==n.type)return-1;if(n.featured&&!s.featured)return-1;if(s.featured&&!n.featured)return 1;const r=s.priority-n.priority;return 0!==r?r:i.localeCompare(o)}));if(0==t.length)return D`<slot name="empty"></slot>`;const e=t.map((t=>{const[e,i]=t,o=this.store.getContactField(e);return D`<temba-contact-field
4499
4518
  class=${Rt({set:!!i,unset:!i,featured:o.featured})}
4500
4519
  key=${o.key}
4501
4520
  name=${o.label}
@@ -4750,7 +4769,7 @@ function t(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPro
4750
4769
  cursor: default !important;
4751
4770
  opacity: 0.7;
4752
4771
  }
4753
- `}connectedCallback(){super.connectedCallback(),this.handleInput=this.handleInput.bind(this),this.handleSubmit=this.handleSubmit.bind(this)}handleIconClick(t){const e=t.target.getAttribute("icon-action"),i=this.shadowRoot.querySelector("temba-textinput");"copy"===e&&navigator.clipboard&&(this.iconClass="clicked",navigator.clipboard.writeText(i.getDisplayValue()).then((()=>{window.setTimeout((()=>{this.iconClass=""}),300)}))),"search"===e&&this.fireCustomEvent(we.ButtonClicked,{key:this.key,value:this.value}),t.preventDefault(),t.stopPropagation()}handleResponse(t){200===t.status?(this.value=t.json.fields[this.key],this.status=Nl.Ready,this.dirty=!1):this.status=Nl.Failure}handleSubmit(){const t=this.shadowRoot.querySelector("temba-textinput, temba-datepicker");t.value!==this.value&&(this.dirty=!0,this.status=Nl.Saving,this.value=t.value,this.fireEvent("change"))}handleChange(t){t.preventDefault(),t.stopPropagation()}handleDateChange(t){t.preventDefault(),t.stopPropagation(),this.dirty=!0}handleInput(t){const e=t.currentTarget;"Enter"===t.key?(e.blur(),this.handleSubmit()):e.value!==this.value&&(this.dirty=!0)}getInputType(t){return"numeric"===t?ye.Number:ye.Text}render(){const t=D`<div class="save-state">
4772
+ `}connectedCallback(){super.connectedCallback(),this.handleInput=this.handleInput.bind(this),this.handleSubmit=this.handleSubmit.bind(this)}handleIconClick(t){const e=t.target.getAttribute("icon-action"),i=this.shadowRoot.querySelector("temba-textinput");"copy"===e&&navigator.clipboard&&(this.iconClass="clicked",navigator.clipboard.writeText(i.getDisplayValue()).then((()=>{window.setTimeout((()=>{this.iconClass=""}),300)}))),"search"===e&&this.fireCustomEvent(we.ButtonClicked,{key:this.key,value:this.value}),t.preventDefault(),t.stopPropagation()}handleResponse(t){200===t.status?(this.value=t.json.fields[this.key],this.status=Nl.Ready,this.dirty=!1):(this.status=Nl.Failure,this.dirty=!1)}handleSubmit(){const t=this.shadowRoot.querySelector("temba-textinput, temba-datepicker");t.value!==this.value&&(this.dirty=!0,this.status=Nl.Saving,this.value=t.value,this.fireEvent("change"))}handleChange(t){t.preventDefault(),t.stopPropagation()}handleDateChange(t){t.preventDefault(),t.stopPropagation(),this.dirty=!0}handleInput(t){const e=t.currentTarget;"Enter"===t.key?(e.blur(),this.handleSubmit()):e.value!==this.value&&(this.dirty=!0)}getInputType(t){return"numeric"===t?ye.Number:ye.Text}render(){const t=D`<div class="save-state">
4754
4773
  ${this.dirty?D`<temba-button
4755
4774
  class="save-button"
4756
4775
  name="Save"
package/dist/sw.js CHANGED
@@ -1,2 +1,2 @@
1
- if(!self.define){let e,t={};const o=(o,n)=>(o=new URL(o+".js",n).href,t[o]||new Promise((t=>{if("document"in self){const e=document.createElement("script");e.src=o,e.onload=t,document.head.appendChild(e)}else e=o,importScripts(o),t()})).then((()=>{let e=t[o];if(!e)throw new Error(`Module ${o} didn’t register its module`);return e})));self.define=(n,s)=>{const i=e||("document"in self?document.currentScript.src:"")||location.href;if(t[i])return;let r={};const l=e=>o(e,i),d={module:{uri:i},exports:r,require:l};t[i]=Promise.all(n.map((e=>d[e]||l(e)))).then((e=>(s(...e),r)))}}define(["./workbox-919adfb7"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"42372647.js",revision:"50d8f02b8297e5411865a105f1e99563"},{url:"templates/components-body.html",revision:"c496b733ded9266a28e59ed5f17a6ba8"},{url:"templates/components-head.html",revision:"e0430f4e1f143fe2d612e068a78ea19b"}],{}),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/index.html"))),e.registerRoute("polyfills/*.js",new e.CacheFirst,"GET")}));
1
+ if(!self.define){let e,t={};const o=(o,n)=>(o=new URL(o+".js",n).href,t[o]||new Promise((t=>{if("document"in self){const e=document.createElement("script");e.src=o,e.onload=t,document.head.appendChild(e)}else e=o,importScripts(o),t()})).then((()=>{let e=t[o];if(!e)throw new Error(`Module ${o} didn’t register its module`);return e})));self.define=(n,s)=>{const i=e||("document"in self?document.currentScript.src:"")||location.href;if(t[i])return;let r={};const d=e=>o(e,i),l={module:{uri:i},exports:r,require:d};t[i]=Promise.all(n.map((e=>l[e]||d(e)))).then((e=>(s(...e),r)))}}define(["./workbox-919adfb7"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"3c275eb2.js",revision:"2846b1048f3f0f0896d088caca6cb22b"},{url:"templates/components-body.html",revision:"6a880bab9e5dc5ef32839ad3a340fd23"},{url:"templates/components-head.html",revision:"43d59176beaf04d5ed6e2d714ad0815a"}],{}),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/index.html"))),e.registerRoute("polyfills/*.js",new e.CacheFirst,"GET")}));
2
2
  //# sourceMappingURL=sw.js.map
package/dist/sw.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sw.js","sources":["../../tmp/3b35805a68d2c7b67aa7736034230bc1/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/workspaces/temba-components/node_modules/workbox-routing/registerRoute.mjs';\nimport {CacheFirst as workbox_strategies_CacheFirst} from '/workspaces/temba-components/node_modules/workbox-strategies/CacheFirst.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/workspaces/temba-components/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/workspaces/temba-components/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/workspaces/temba-components/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/workspaces/temba-components/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"42372647.js\",\n \"revision\": \"50d8f02b8297e5411865a105f1e99563\"\n },\n {\n \"url\": \"templates/components-body.html\",\n \"revision\": \"c496b733ded9266a28e59ed5f17a6ba8\"\n },\n {\n \"url\": \"templates/components-head.html\",\n \"revision\": \"e0430f4e1f143fe2d612e068a78ea19b\"\n }\n], {});\n\nworkbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"/index.html\")));\n\n\nworkbox_routing_registerRoute(\"polyfills/*.js\", new workbox_strategies_CacheFirst(), 'GET');\n\n\n\n\n"],"names":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","url","revision","workbox","registerRoute","workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL","workbox_strategies_CacheFirst"],"mappings":"0nBAwBAA,KAAKC,cAELC,EAAAA,eAQAC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,qCAEb,CAAE,GAEwBC,EAAAC,cAAC,IAAIC,EAAAA,gBAAgCC,EAAAA,wBAA2C,iBAGhFH,EAAAC,cAAC,iBAAkB,IAAIG,aAAiC"}
1
+ {"version":3,"file":"sw.js","sources":["../../tmp/c4a636b426ba507bda2690c94adcf5c1/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/workspaces/temba-components/node_modules/workbox-routing/registerRoute.mjs';\nimport {CacheFirst as workbox_strategies_CacheFirst} from '/workspaces/temba-components/node_modules/workbox-strategies/CacheFirst.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/workspaces/temba-components/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/workspaces/temba-components/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/workspaces/temba-components/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/workspaces/temba-components/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"3c275eb2.js\",\n \"revision\": \"2846b1048f3f0f0896d088caca6cb22b\"\n },\n {\n \"url\": \"templates/components-body.html\",\n \"revision\": \"6a880bab9e5dc5ef32839ad3a340fd23\"\n },\n {\n \"url\": \"templates/components-head.html\",\n \"revision\": \"43d59176beaf04d5ed6e2d714ad0815a\"\n }\n], {});\n\nworkbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"/index.html\")));\n\n\nworkbox_routing_registerRoute(\"polyfills/*.js\", new workbox_strategies_CacheFirst(), 'GET');\n\n\n\n\n"],"names":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","url","revision","workbox","registerRoute","workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL","workbox_strategies_CacheFirst"],"mappings":"0nBAwBAA,KAAKC,cAELC,EAAAA,eAQAC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,qCAEb,CAAE,GAEwBC,EAAAC,cAAC,IAAIC,EAAAA,gBAAgCC,EAAAA,wBAA2C,iBAGhFH,EAAAC,cAAC,iBAAkB,IAAIG,aAAiC"}
@@ -1 +1 @@
1
- <script type="module" src="{{STATIC_URL}}@nyaruka/temba-components/dist/42372647.js"></script><script>window.TEMBA_COMPONENTS_VERSION="0.75.3"</script>
1
+ <script type="module" src="{{STATIC_URL}}@nyaruka/temba-components/dist/3c275eb2.js"></script><script>window.TEMBA_COMPONENTS_VERSION="0.76.0"</script>
@@ -1 +1 @@
1
- <script src="{{STATIC_URL}}croppie/croppie.js"></script><link rel="modulepreload" href="{{STATIC_URL}}@nyaruka/temba-components/dist/42372647.js" crossorigin="anonymous">
1
+ <script src="{{STATIC_URL}}croppie/croppie.js"></script><link rel="modulepreload" href="{{STATIC_URL}}@nyaruka/temba-components/dist/3c275eb2.js" crossorigin="anonymous">
@@ -295,6 +295,7 @@ export class ContactFieldEditor extends RapidElement {
295
295
  }
296
296
  else {
297
297
  this.status = Status.Failure;
298
+ this.dirty = false;
298
299
  }
299
300
  }
300
301
  handleSubmit() {
@@ -1 +1 @@
1
- {"version":3,"file":"ContactFieldEditor.js","sourceRoot":"","sources":["../../../src/contacts/ContactFieldEditor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAa,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,UAAU,EAAe,MAAM,UAAU,CAAC;AAEnD,IAAK,MAKJ;AALD,WAAK,MAAM;IACT,6BAAmB,CAAA;IACnB,6BAAmB,CAAA;IACnB,2BAAiB,CAAA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Y;uBACpB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;4BACvB,IAAI,CAAC,QAAQ;;;sCAGH,IAAI,CAAC,IAAI;;;;;oCAKX,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,KAAK;gBAC1D,CAAC,CAAC,OAAO;gBACT,CAAC,CAAC,EAAE;6BACG,IAAI,CAAC,eAAe;;sBAE3B,KAAK;;;;;8BAKG,IAAI,CAAC,MAAM;;;;;;8BAMX,IAAI,CAAC,IAAI;;;;;;;aAO1B;;KAER,CAAC;IACJ,CAAC;CACF;AAtcC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACf;AAGZ;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDACb;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACd;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACd;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDACV;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACiB;AAG5C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDACZ;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACG;AAG9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACX;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDACd","sourcesContent":["import { css, html, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { FormElement } from '../FormElement';\nimport { CustomEventType } from '../interfaces';\nimport { RapidElement } from '../RapidElement';\nimport { InputType, TextInput } from '../textinput/TextInput';\nimport { Icon } from '../vectoricon';\nimport { getClasses, WebResponse } from '../utils';\n\nenum Status {\n Success = 'success',\n Failure = 'failure',\n Saving = 'saving',\n Ready = 'ready',\n}\n\nexport class ContactFieldEditor extends RapidElement {\n @property({ type: String })\n key: string;\n\n @property({ type: String })\n value: string;\n\n @property({ type: String })\n name: string;\n\n @property({ type: String })\n type: string;\n\n @property({ type: String })\n timezone: string;\n\n @property({ type: String })\n icon = navigator.clipboard ? Icon.copy : '';\n\n @property({ type: String })\n iconClass = '';\n\n @property({ type: String })\n status: Status = Status.Ready;\n\n @property({ type: Boolean })\n disabled = false;\n\n @property({ type: Boolean })\n dirty = false;\n\n static get styles() {\n return css`\n :host {\n --transition-speed: 0ms;\n }\n\n .wrapper {\n --temba-textinput-padding: 1.4em 0.8em 0.4em 0.8em;\n --disabled-opacity: 1;\n position: relative;\n --color-widget-bg: transparent;\n --color-widget-bg-focused: #fff;\n --widget-box-shadow: none;\n padding-bottom: 0.6em;\n border-bottom: 1px solid #ececec;\n }\n\n .wrapper.disabled {\n --color-widget-border: transparent;\n }\n\n .wrapper.mutable:hover {\n }\n\n .wrapper.mutable {\n --color-widget-border: rgb(235, 235, 235);\n --color-widget-bg: transparent;\n --input-cursor: pointer;\n\n border-bottom: none;\n margin-bottom: 0.5em;\n padding-bottom: 0em;\n }\n\n .mutable.success {\n --color-widget-border: rgba(var(--success-rgb), 0.6);\n }\n\n .mutable.failure {\n --color-widget-border: rgba(var(--error-rgb), 0.3) !important;\n }\n\n .mutable .dirty {\n --color-widget-border: rgb(235, 235, 235);\n }\n\n .prefix {\n border-top-left-radius: var(--curvature-widget);\n border-bottom-left-radius: var(--curvature-widget);\n cursor: pointer !important;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n padding: 0em 0.5em;\n position: absolute;\n margin-top: 0.2em;\n pointer-events: none;\n }\n\n .wrapper {\n margin-bottom: 0.5em;\n }\n\n .prefix .name {\n padding: 0em 0.4em;\n color: rgba(100, 100, 100, 0.7);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: 0.8em;\n }\n\n .postfix {\n display: flex;\n align-items: stretch;\n margin-left: 1em;\n }\n\n .popper {\n background: rgba(0, 0, 0, 0.03);\n border-top-right-radius: var(--curvature-widget);\n border-bottom-right-radius: var(--curvature-widget);\n --icon-color: #888;\n display: flex;\n cursor: default;\n transition: all var(--transition-speed) ease-in-out;\n align-items: stretch;\n margin: -1px;\n }\n\n temba-icon[name='calendar'] {\n --icon-color: rgba(0, 0, 0, 0.2);\n }\n\n temba-icon:hover {\n --icon-color: rgba(0, 0, 0, 0.5);\n }\n\n temba-icon {\n cursor: pointer;\n --icon-color: rgba(0, 0, 0, 0.3);\n }\n\n temba-textinput:focus .popper,\n temba-textinput:hover .popper {\n display: flex;\n }\n\n .disabled temba-textinput .postfix {\n display: none;\n padding: none;\n }\n\n .unset temba-textinput .popper .copy,\n .unset temba-textinput .popper .search {\n display: none;\n }\n\n .unset temba-textinput:focus .popper .copy,\n .unset temba-textinput:hover .popper .copy,\n .unset temba-textinput:focus .popper .save,\n .unset temba-textinput:hover .popper .save {\n display: none;\n }\n\n .popper temba-icon {\n padding: 0.5em 0em;\n padding-right: 1em;\n }\n\n .popper:first-child {\n padding: 0.5em 0em;\n padding-right: 0.5em;\n padding-left: 1em;\n }\n\n .popper:last-child {\n padding-right: 0em;\n }\n\n .copy.clicked temba-icon {\n transform: scale(1.2);\n }\n\n temba-icon {\n transition: all 200ms ease-in-out;\n }\n\n temba-datepicker {\n position: relative;\n }\n\n .save-state {\n display: flex;\n align-items: center;\n }\n\n .save-button {\n padding-right: 1em;\n }\n\n .dirty .copy,\n .dirty .search {\n display: none;\n }\n\n .saving .copy,\n .saving .search {\n display: none;\n }\n\n .success .copy,\n .success .search {\n display: none;\n }\n\n .failure .copy,\n .failure .search {\n display: none;\n }\n\n .popper.success {\n background: rgb(var(--success-rgb));\n }\n\n .popper.failure {\n background: rgb(var(--error-rgb));\n }\n\n .popper.success temba-icon,\n .popper.failure temba-icon {\n --icon-color: #fff !important;\n }\n\n .popper.dirty {\n background: rgba(0, 0, 0, 0.03);\n }\n\n temba-datepicker .popper {\n border-radius: 0px;\n }\n\n temba-datepicker .popper:first-child {\n padding: 0;\n }\n\n .dirty temba-datepicker .popper:first-child {\n padding-left: 1em;\n }\n\n .success temba-datepicker .popper:first-child {\n padding-left: 1em;\n }\n\n .failure temba-datepicker .popper:first-child {\n padding-left: 1em;\n }\n\n .saving temba-datepicker .popper:first-child {\n padding-left: 1em;\n }\n\n temba-datepicker .postfix {\n margin-left: 0;\n }\n\n .saving temba-datepicker,\n .saving temba-textinput {\n pointer-events: none !important;\n cursor: default !important;\n opacity: 0.7;\n }\n `;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.handleInput = this.handleInput.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n }\n\n public handleIconClick(evt: MouseEvent) {\n const ele = evt.target as HTMLDivElement;\n const icon = ele.getAttribute('icon-action');\n const input = this.shadowRoot.querySelector('temba-textinput') as TextInput;\n\n if (icon === 'copy') {\n if (navigator.clipboard) {\n this.iconClass = 'clicked';\n navigator.clipboard.writeText(input.getDisplayValue()).then(() => {\n window.setTimeout(() => {\n this.iconClass = '';\n }, 300);\n });\n }\n }\n\n if (icon === 'search') {\n this.fireCustomEvent(CustomEventType.ButtonClicked, {\n key: this.key,\n value: this.value,\n });\n }\n\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n public handleResponse(response: WebResponse) {\n if (response.status === 200) {\n this.value = response.json.fields[this.key];\n // this.status = Status.Success;\n // on success lets go back to ready state for now\n this.status = Status.Ready;\n this.dirty = false;\n } else {\n this.status = Status.Failure;\n }\n }\n\n public handleSubmit() {\n const input = this.shadowRoot.querySelector(\n 'temba-textinput, temba-datepicker'\n ) as FormElement;\n\n if (input.value !== this.value) {\n this.dirty = true;\n this.status = Status.Saving;\n this.value = input.value;\n this.fireEvent('change');\n }\n }\n\n public handleChange(evt: Event) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n public handleDateChange(evt: Event) {\n evt.preventDefault();\n evt.stopPropagation();\n this.dirty = true;\n }\n\n public handleInput(evt: KeyboardEvent) {\n const input = evt.currentTarget as TextInput;\n if (evt.key === 'Enter') {\n input.blur();\n this.handleSubmit();\n } else {\n if (input.value !== this.value) {\n this.dirty = true;\n }\n }\n }\n\n private getInputType(type: string): string {\n if (type === 'numeric') {\n return InputType.Number;\n }\n return InputType.Text;\n }\n\n public render(): TemplateResult {\n const state = html`<div class=\"save-state\">\n ${this.dirty\n ? html`<temba-button\n class=\"save-button\"\n name=\"Save\"\n small\n @click=${this.handleSubmit}\n ></temba-button>`\n : html` ${this.status === Status.Saving\n ? html`<temba-icon\n spin\n name=\"${Icon.progress_spinner}\"\n ></temba-icon>`\n : null}\n ${this.status === Status.Success && !this.dirty\n ? html`<temba-icon name=\"${Icon.success}\"></temba-icon>`\n : null}\n ${this.status === Status.Failure\n ? html`<temba-tip text=\"Failed to save changes, try again later.\"\n ><temba-icon name=\"${Icon.alert_warning}\"></temba-icon\n ></temba-tip>`\n : null}`}\n </div>`;\n\n return html`\n <div\n class=${this.status +\n ' ' +\n getClasses({\n wrapper: true,\n set: !!this.value,\n unset: !this.value,\n disabled: this.disabled,\n mutable: !this.disabled,\n dirty: this.dirty,\n })}\n >\n ${this.type === 'datetime'\n ? html`\n <temba-datepicker\n timezone=${this.timezone}\n value=\"${this.value ? this.value : ''}\"\n @change=${this.handleDateChange}\n ?disabled=${this.disabled}\n time\n >\n <div class=\"prefix\" slot=\"prefix\">\n <div class=\"name\">${this.name}</div>\n </div>\n <div class=\"postfix\" slot=\"postfix\">\n <div\n class=\"popper ${this.status} ${this.dirty ? 'dirty' : ''}\"\n >\n ${state}\n </div>\n </div>\n </temba-datepicker>\n `\n : html`\n <temba-textinput\n class=\"${this.status} ${this.dirty ? 'dirty' : ''}\"\n value=\"${this.value ? this.value : ''}\"\n @keyup=${this.handleInput}\n @change=${this.handleChange}\n type=${this.getInputType(this.type)}\n ?disabled=${this.disabled}\n >\n <div class=\"prefix\" slot=\"prefix\">\n <div class=\"name\">${this.name}</div>\n </div>\n\n <div class=\"postfix\">\n <div\n class=\"popper ${this.iconClass} ${this.status} ${this.dirty\n ? 'dirty'\n : ''}\"\n @click=${this.handleIconClick}\n >\n ${state}\n\n <temba-icon\n class=\"search\"\n icon-action=\"search\"\n name=\"${Icon.search}\"\n animateclick=\"pulse\"\n ></temba-icon>\n <temba-icon\n class=\"copy\"\n icon-action=\"copy\"\n name=\"${this.icon}\"\n animatechange=\"spin\"\n animateclick=\"pulse\"\n ></temba-icon>\n </div>\n </div>\n </temba-textinput>\n `}\n </div>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"ContactFieldEditor.js","sourceRoot":"","sources":["../../../src/contacts/ContactFieldEditor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAa,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,UAAU,EAAe,MAAM,UAAU,CAAC;AAEnD,IAAK,MAKJ;AALD,WAAK,MAAM;IACT,6BAAmB,CAAA;IACnB,6BAAmB,CAAA;IACnB,2BAAiB,CAAA;IACjB,yBAAe,CAAA;AACjB,CAAC,EALI,MAAM,KAAN,MAAM,QAKV;AAED,MAAM,OAAO,kBAAmB,SAAQ,YAAY;IAApD;;QAiBE,SAAI,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAG5C,cAAS,GAAG,EAAE,CAAC;QAGf,WAAM,G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AO;gBACT,CAAC,CAAC,EAAE;6BACG,IAAI,CAAC,eAAe;;sBAE3B,KAAK;;;;;8BAKG,IAAI,CAAC,MAAM;;;;;;8BAMX,IAAI,CAAC,IAAI;;;;;;;aAO1B;;KAER,CAAC;IACJ,CAAC;CACF;AAvcC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACf;AAGZ;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDACb;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACd;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACd;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDACV;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACiB;AAG5C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDACZ;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACG;AAG9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACX;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDACd","sourcesContent":["import { css, html, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { FormElement } from '../FormElement';\nimport { CustomEventType } from '../interfaces';\nimport { RapidElement } from '../RapidElement';\nimport { InputType, TextInput } from '../textinput/TextInput';\nimport { Icon } from '../vectoricon';\nimport { getClasses, WebResponse } from '../utils';\n\nenum Status {\n Success = 'success',\n Failure = 'failure',\n Saving = 'saving',\n Ready = 'ready',\n}\n\nexport class ContactFieldEditor extends RapidElement {\n @property({ type: String })\n key: string;\n\n @property({ type: String })\n value: string;\n\n @property({ type: String })\n name: string;\n\n @property({ type: String })\n type: string;\n\n @property({ type: String })\n timezone: string;\n\n @property({ type: String })\n icon = navigator.clipboard ? Icon.copy : '';\n\n @property({ type: String })\n iconClass = '';\n\n @property({ type: String })\n status: Status = Status.Ready;\n\n @property({ type: Boolean })\n disabled = false;\n\n @property({ type: Boolean })\n dirty = false;\n\n static get styles() {\n return css`\n :host {\n --transition-speed: 0ms;\n }\n\n .wrapper {\n --temba-textinput-padding: 1.4em 0.8em 0.4em 0.8em;\n --disabled-opacity: 1;\n position: relative;\n --color-widget-bg: transparent;\n --color-widget-bg-focused: #fff;\n --widget-box-shadow: none;\n padding-bottom: 0.6em;\n border-bottom: 1px solid #ececec;\n }\n\n .wrapper.disabled {\n --color-widget-border: transparent;\n }\n\n .wrapper.mutable:hover {\n }\n\n .wrapper.mutable {\n --color-widget-border: rgb(235, 235, 235);\n --color-widget-bg: transparent;\n --input-cursor: pointer;\n\n border-bottom: none;\n margin-bottom: 0.5em;\n padding-bottom: 0em;\n }\n\n .mutable.success {\n --color-widget-border: rgba(var(--success-rgb), 0.6);\n }\n\n .mutable.failure {\n --color-widget-border: rgba(var(--error-rgb), 0.3) !important;\n }\n\n .mutable .dirty {\n --color-widget-border: rgb(235, 235, 235);\n }\n\n .prefix {\n border-top-left-radius: var(--curvature-widget);\n border-bottom-left-radius: var(--curvature-widget);\n cursor: pointer !important;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n padding: 0em 0.5em;\n position: absolute;\n margin-top: 0.2em;\n pointer-events: none;\n }\n\n .wrapper {\n margin-bottom: 0.5em;\n }\n\n .prefix .name {\n padding: 0em 0.4em;\n color: rgba(100, 100, 100, 0.7);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: 0.8em;\n }\n\n .postfix {\n display: flex;\n align-items: stretch;\n margin-left: 1em;\n }\n\n .popper {\n background: rgba(0, 0, 0, 0.03);\n border-top-right-radius: var(--curvature-widget);\n border-bottom-right-radius: var(--curvature-widget);\n --icon-color: #888;\n display: flex;\n cursor: default;\n transition: all var(--transition-speed) ease-in-out;\n align-items: stretch;\n margin: -1px;\n }\n\n temba-icon[name='calendar'] {\n --icon-color: rgba(0, 0, 0, 0.2);\n }\n\n temba-icon:hover {\n --icon-color: rgba(0, 0, 0, 0.5);\n }\n\n temba-icon {\n cursor: pointer;\n --icon-color: rgba(0, 0, 0, 0.3);\n }\n\n temba-textinput:focus .popper,\n temba-textinput:hover .popper {\n display: flex;\n }\n\n .disabled temba-textinput .postfix {\n display: none;\n padding: none;\n }\n\n .unset temba-textinput .popper .copy,\n .unset temba-textinput .popper .search {\n display: none;\n }\n\n .unset temba-textinput:focus .popper .copy,\n .unset temba-textinput:hover .popper .copy,\n .unset temba-textinput:focus .popper .save,\n .unset temba-textinput:hover .popper .save {\n display: none;\n }\n\n .popper temba-icon {\n padding: 0.5em 0em;\n padding-right: 1em;\n }\n\n .popper:first-child {\n padding: 0.5em 0em;\n padding-right: 0.5em;\n padding-left: 1em;\n }\n\n .popper:last-child {\n padding-right: 0em;\n }\n\n .copy.clicked temba-icon {\n transform: scale(1.2);\n }\n\n temba-icon {\n transition: all 200ms ease-in-out;\n }\n\n temba-datepicker {\n position: relative;\n }\n\n .save-state {\n display: flex;\n align-items: center;\n }\n\n .save-button {\n padding-right: 1em;\n }\n\n .dirty .copy,\n .dirty .search {\n display: none;\n }\n\n .saving .copy,\n .saving .search {\n display: none;\n }\n\n .success .copy,\n .success .search {\n display: none;\n }\n\n .failure .copy,\n .failure .search {\n display: none;\n }\n\n .popper.success {\n background: rgb(var(--success-rgb));\n }\n\n .popper.failure {\n background: rgb(var(--error-rgb));\n }\n\n .popper.success temba-icon,\n .popper.failure temba-icon {\n --icon-color: #fff !important;\n }\n\n .popper.dirty {\n background: rgba(0, 0, 0, 0.03);\n }\n\n temba-datepicker .popper {\n border-radius: 0px;\n }\n\n temba-datepicker .popper:first-child {\n padding: 0;\n }\n\n .dirty temba-datepicker .popper:first-child {\n padding-left: 1em;\n }\n\n .success temba-datepicker .popper:first-child {\n padding-left: 1em;\n }\n\n .failure temba-datepicker .popper:first-child {\n padding-left: 1em;\n }\n\n .saving temba-datepicker .popper:first-child {\n padding-left: 1em;\n }\n\n temba-datepicker .postfix {\n margin-left: 0;\n }\n\n .saving temba-datepicker,\n .saving temba-textinput {\n pointer-events: none !important;\n cursor: default !important;\n opacity: 0.7;\n }\n `;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.handleInput = this.handleInput.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n }\n\n public handleIconClick(evt: MouseEvent) {\n const ele = evt.target as HTMLDivElement;\n const icon = ele.getAttribute('icon-action');\n const input = this.shadowRoot.querySelector('temba-textinput') as TextInput;\n\n if (icon === 'copy') {\n if (navigator.clipboard) {\n this.iconClass = 'clicked';\n navigator.clipboard.writeText(input.getDisplayValue()).then(() => {\n window.setTimeout(() => {\n this.iconClass = '';\n }, 300);\n });\n }\n }\n\n if (icon === 'search') {\n this.fireCustomEvent(CustomEventType.ButtonClicked, {\n key: this.key,\n value: this.value,\n });\n }\n\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n public handleResponse(response: WebResponse) {\n if (response.status === 200) {\n this.value = response.json.fields[this.key];\n // this.status = Status.Success;\n // on success lets go back to ready state for now\n this.status = Status.Ready;\n this.dirty = false;\n } else {\n this.status = Status.Failure;\n this.dirty = false;\n }\n }\n\n public handleSubmit() {\n const input = this.shadowRoot.querySelector(\n 'temba-textinput, temba-datepicker'\n ) as FormElement;\n\n if (input.value !== this.value) {\n this.dirty = true;\n this.status = Status.Saving;\n this.value = input.value;\n this.fireEvent('change');\n }\n }\n\n public handleChange(evt: Event) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n public handleDateChange(evt: Event) {\n evt.preventDefault();\n evt.stopPropagation();\n this.dirty = true;\n }\n\n public handleInput(evt: KeyboardEvent) {\n const input = evt.currentTarget as TextInput;\n if (evt.key === 'Enter') {\n input.blur();\n this.handleSubmit();\n } else {\n if (input.value !== this.value) {\n this.dirty = true;\n }\n }\n }\n\n private getInputType(type: string): string {\n if (type === 'numeric') {\n return InputType.Number;\n }\n return InputType.Text;\n }\n\n public render(): TemplateResult {\n const state = html`<div class=\"save-state\">\n ${this.dirty\n ? html`<temba-button\n class=\"save-button\"\n name=\"Save\"\n small\n @click=${this.handleSubmit}\n ></temba-button>`\n : html` ${this.status === Status.Saving\n ? html`<temba-icon\n spin\n name=\"${Icon.progress_spinner}\"\n ></temba-icon>`\n : null}\n ${this.status === Status.Success && !this.dirty\n ? html`<temba-icon name=\"${Icon.success}\"></temba-icon>`\n : null}\n ${this.status === Status.Failure\n ? html`<temba-tip text=\"Failed to save changes, try again later.\"\n ><temba-icon name=\"${Icon.alert_warning}\"></temba-icon\n ></temba-tip>`\n : null}`}\n </div>`;\n\n return html`\n <div\n class=${this.status +\n ' ' +\n getClasses({\n wrapper: true,\n set: !!this.value,\n unset: !this.value,\n disabled: this.disabled,\n mutable: !this.disabled,\n dirty: this.dirty,\n })}\n >\n ${this.type === 'datetime'\n ? html`\n <temba-datepicker\n timezone=${this.timezone}\n value=\"${this.value ? this.value : ''}\"\n @change=${this.handleDateChange}\n ?disabled=${this.disabled}\n time\n >\n <div class=\"prefix\" slot=\"prefix\">\n <div class=\"name\">${this.name}</div>\n </div>\n <div class=\"postfix\" slot=\"postfix\">\n <div\n class=\"popper ${this.status} ${this.dirty ? 'dirty' : ''}\"\n >\n ${state}\n </div>\n </div>\n </temba-datepicker>\n `\n : html`\n <temba-textinput\n class=\"${this.status} ${this.dirty ? 'dirty' : ''}\"\n value=\"${this.value ? this.value : ''}\"\n @keyup=${this.handleInput}\n @change=${this.handleChange}\n type=${this.getInputType(this.type)}\n ?disabled=${this.disabled}\n >\n <div class=\"prefix\" slot=\"prefix\">\n <div class=\"name\">${this.name}</div>\n </div>\n\n <div class=\"postfix\">\n <div\n class=\"popper ${this.iconClass} ${this.status} ${this.dirty\n ? 'dirty'\n : ''}\"\n @click=${this.handleIconClick}\n >\n ${state}\n\n <temba-icon\n class=\"search\"\n icon-action=\"search\"\n name=\"${Icon.search}\"\n animateclick=\"pulse\"\n ></temba-icon>\n <temba-icon\n class=\"copy\"\n icon-action=\"copy\"\n name=\"${this.icon}\"\n animatechange=\"spin\"\n animateclick=\"pulse\"\n ></temba-icon>\n </div>\n </div>\n </temba-textinput>\n `}\n </div>\n `;\n }\n}\n"]}
@@ -89,10 +89,14 @@ export class ContactFields extends ContactStoreElement {
89
89
  const value = field.value;
90
90
  postJSON('/api/v2/contacts.json?uuid=' + this.data.uuid, {
91
91
  fields: { [field.key]: value },
92
- }).then((response) => {
92
+ })
93
+ .then((response) => {
93
94
  field.handleResponse(response);
94
95
  // returns a single contact with latest updates
95
96
  this.setContact(response.json);
97
+ })
98
+ .catch(error => {
99
+ field.handleResponse(error);
96
100
  });
97
101
  }
98
102
  handleToggle(evt) {
@@ -1 +1 @@
1
- {"version":3,"file":"ContactFields.js","sourceRoot":"","sources":["../../../src/contacts/ContactFields.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAoC,MAAM,KAAK,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,MAAM,OAAO,aAAc,SAAQ,mBAAmB;IAAtD;;QA8EE,aAAQ,GAAG,KAAK,CAAC;IA0JnB,CAAC;IAvOC,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyDT,CAAC;IACJ,CAAC;IAoBD,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CA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AAC,CAAC;YAEH,OAAO,IAAI,CAAA;qBACI,UAAU,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;+BAC7B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM;YAC5D,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,IAAI,cAAc;gBACtD,CAAC,CAAC,IAAI,CAAA;;;;+BAIa,IAAI,CAAC,OAAO;8BACb,IAAI,CAAC,YAAY;;;;qBAI1B;gBACT,CAAC,CAAC,IAAI;;OAEX,CAAC;SACH;QAED,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;IACxB,CAAC;CACF;AAzKC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CACZ;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CACb;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACX;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACV;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACd;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CACX","sourcesContent":["import { css, html, PropertyValueMap, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { getClasses, postJSON } from '../utils';\nimport { ContactFieldEditor } from './ContactFieldEditor';\nimport { ContactStoreElement } from './ContactStoreElement';\nimport { Checkbox } from '../checkbox/Checkbox';\n\nconst MIN_FOR_FILTER = 10;\n\nexport class ContactFields extends ContactStoreElement {\n static get styles() {\n return css`\n .field {\n display: flex;\n margin: 0.3em 0.3em;\n box-shadow: 0 0 0.2em rgba(0, 0, 0, 0.15);\n border-radius: 0px;\n align-items: center;\n overflow: hidden;\n }\n\n .show-all .unset,\n .featured {\n display: block !important;\n }\n\n .unset {\n display: none;\n }\n\n .field:hover {\n box-shadow: 1px 1px 6px 2px rgba(0, 0, 0, 0.05),\n 0px 0px 0px 2px var(--color-link-primary);\n cursor: pointer;\n }\n\n .label {\n padding: 0.25em 1em;\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n color: #777;\n font-size: 0.9em;\n font-weight: 400;\n box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.1) inset;\n }\n\n .value {\n --icon-color: #ddd;\n max-width: 150px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0.25em 1em;\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n font-size: 0.9em;\n }\n\n .toggle {\n display: flex;\n background: #fff;\n align-items: center;\n margin-bottom: 0.5em;\n }\n\n .disabled .toggle {\n display: none;\n }\n `;\n }\n\n @property({ type: Boolean })\n system: boolean;\n\n @property({ type: Boolean })\n dirty: boolean;\n\n @property({ type: Boolean })\n showAll: boolean;\n\n @property({ type: String })\n timezone: string;\n\n @property({ type: String })\n role: string;\n\n @property({ type: Boolean })\n disabled = false;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.handleFieldChanged = this.handleFieldChanged.bind(this);\n }\n\n private isAgent(): boolean {\n return this.role === 'T';\n }\n\n protected updated(\n changes: PropertyValueMap<any> | Map<PropertyKey, unknown>\n ): void {\n super.updated(changes);\n if (changes.has('data')) {\n if (Object.keys(this.data.fields).length <= MIN_FOR_FILTER) {\n this.showAll = true;\n }\n }\n }\n\n public handleFieldChanged(evt: InputEvent) {\n const field = evt.currentTarget as ContactFieldEditor;\n const value = field.value;\n postJSON('/api/v2/contacts.json?uuid=' + this.data.uuid, {\n fields: { [field.key]: value },\n }).then((response: any) => {\n field.handleResponse(response);\n\n // returns a single contact with latest updates\n this.setContact(response.json);\n });\n }\n\n public handleToggle(evt: Event) {\n const checkbox = evt.currentTarget as Checkbox;\n this.showAll = checkbox.checked;\n }\n\n public render(): TemplateResult {\n if (this.data) {\n const fieldsToShow = Object.entries(this.data.fields).sort(\n (a: [string, string], b: [string, string]) => {\n const [ak] = a;\n const [bk] = b;\n const fieldA = this.store.getContactField(ak);\n const fieldB = this.store.getContactField(bk);\n\n if (fieldA.type === 'ward') {\n return 1;\n }\n\n if (fieldB.type === 'ward') {\n return -1;\n }\n\n if (\n fieldA.type === 'district' &&\n fieldB.type !== 'ward' &&\n fieldB.type !== 'district'\n ) {\n return 1;\n }\n\n if (\n fieldB.type === 'district' &&\n fieldA.type !== 'ward' &&\n fieldA.type !== 'district'\n ) {\n return -1;\n }\n\n if (\n fieldA.type === 'state' &&\n fieldB.type !== 'ward' &&\n fieldB.type !== 'district' &&\n fieldB.type !== 'state'\n ) {\n return 1;\n }\n\n if (\n fieldB.type === 'state' &&\n fieldA.type !== 'ward' &&\n fieldA.type !== 'district' &&\n fieldA.type !== 'state'\n ) {\n return -1;\n }\n\n if (fieldA.featured && !fieldB.featured) {\n return -1;\n }\n\n if (fieldB.featured && !fieldA.featured) {\n return 1;\n }\n\n const priority = fieldB.priority - fieldA.priority;\n if (priority !== 0) {\n return priority;\n }\n\n return ak.localeCompare(bk);\n }\n );\n\n if (fieldsToShow.length == 0) {\n return html`<slot name=\"empty\"></slot>`;\n }\n\n const fields = fieldsToShow.map((entry: [string, string]) => {\n const [k, v] = entry;\n const field = this.store.getContactField(k);\n return html`<temba-contact-field\n class=${getClasses({ set: !!v, unset: !v, featured: field.featured })}\n key=${field.key}\n name=${field.label}\n value=${v}\n type=${field.value_type}\n @change=${this.handleFieldChanged}\n timezone=${this.timezone}\n ?disabled=${(this.isAgent() && field.agent_access === 'view') ||\n this.disabled ||\n field.value_type === 'ward' ||\n field.value_type === 'district' ||\n field.value_type === 'state'\n ? true\n : false}\n ></temba-contact-field>`;\n });\n\n return html`\n <div class=${getClasses({ disabled: this.disabled })}>\n <div class=\"fields ${this.showAll ? 'show-all' : ''}\">${fields}</div>\n ${Object.keys(this.data.fields).length >= MIN_FOR_FILTER\n ? html`<div class=\"toggle\">\n <div style=\"flex-grow: 1\"></div>\n <div>\n <temba-checkbox\n ?checked=${this.showAll}\n @change=${this.handleToggle}\n label=\"Show All\"\n ></temba-checkbox>\n </div>\n </div>`\n : null}\n </div>\n `;\n }\n\n return super.render();\n }\n}\n"]}
1
+ {"version":3,"file":"ContactFields.js","sourceRoot":"","sources":["../../../src/contacts/ContactFields.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAoC,MAAM,KAAK,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,MAAM,OAAO,aAAc,SAAQ,mBAAmB;IAAtD;;QA8EE,aAAQ,GAAG,KAAK,CAAC;IA8JnB,CAAC;IA3OC,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyDT,CAAC;IACJ,CAAC;IAoBD,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC;IAEO,OAAO;QACb,OAAO,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC;IAC3B,CAAC;IAES,OAAO,CACf,OAA0D;QAE1D,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvB,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACvB,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CA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,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,IAAI,cAAc;gBACtD,CAAC,CAAC,IAAI,CAAA;;;;+BAIa,IAAI,CAAC,OAAO;8BACb,IAAI,CAAC,YAAY;;;;qBAI1B;gBACT,CAAC,CAAC,IAAI;;OAEX,CAAC;SACH;QAED,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;IACxB,CAAC;CACF;AA7KC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CACZ;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CACb;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACX;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACV;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACd;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CACX","sourcesContent":["import { css, html, PropertyValueMap, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { getClasses, postJSON } from '../utils';\nimport { ContactFieldEditor } from './ContactFieldEditor';\nimport { ContactStoreElement } from './ContactStoreElement';\nimport { Checkbox } from '../checkbox/Checkbox';\n\nconst MIN_FOR_FILTER = 10;\n\nexport class ContactFields extends ContactStoreElement {\n static get styles() {\n return css`\n .field {\n display: flex;\n margin: 0.3em 0.3em;\n box-shadow: 0 0 0.2em rgba(0, 0, 0, 0.15);\n border-radius: 0px;\n align-items: center;\n overflow: hidden;\n }\n\n .show-all .unset,\n .featured {\n display: block !important;\n }\n\n .unset {\n display: none;\n }\n\n .field:hover {\n box-shadow: 1px 1px 6px 2px rgba(0, 0, 0, 0.05),\n 0px 0px 0px 2px var(--color-link-primary);\n cursor: pointer;\n }\n\n .label {\n padding: 0.25em 1em;\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n color: #777;\n font-size: 0.9em;\n font-weight: 400;\n box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.1) inset;\n }\n\n .value {\n --icon-color: #ddd;\n max-width: 150px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0.25em 1em;\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n font-size: 0.9em;\n }\n\n .toggle {\n display: flex;\n background: #fff;\n align-items: center;\n margin-bottom: 0.5em;\n }\n\n .disabled .toggle {\n display: none;\n }\n `;\n }\n\n @property({ type: Boolean })\n system: boolean;\n\n @property({ type: Boolean })\n dirty: boolean;\n\n @property({ type: Boolean })\n showAll: boolean;\n\n @property({ type: String })\n timezone: string;\n\n @property({ type: String })\n role: string;\n\n @property({ type: Boolean })\n disabled = false;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.handleFieldChanged = this.handleFieldChanged.bind(this);\n }\n\n private isAgent(): boolean {\n return this.role === 'T';\n }\n\n protected updated(\n changes: PropertyValueMap<any> | Map<PropertyKey, unknown>\n ): void {\n super.updated(changes);\n if (changes.has('data')) {\n if (Object.keys(this.data.fields).length <= MIN_FOR_FILTER) {\n this.showAll = true;\n }\n }\n }\n\n public handleFieldChanged(evt: InputEvent) {\n const field = evt.currentTarget as ContactFieldEditor;\n const value = field.value;\n postJSON('/api/v2/contacts.json?uuid=' + this.data.uuid, {\n fields: { [field.key]: value },\n })\n .then((response: any) => {\n field.handleResponse(response);\n\n // returns a single contact with latest updates\n this.setContact(response.json);\n })\n .catch(error => {\n field.handleResponse(error);\n });\n }\n\n public handleToggle(evt: Event) {\n const checkbox = evt.currentTarget as Checkbox;\n this.showAll = checkbox.checked;\n }\n\n public render(): TemplateResult {\n if (this.data) {\n const fieldsToShow = Object.entries(this.data.fields).sort(\n (a: [string, string], b: [string, string]) => {\n const [ak] = a;\n const [bk] = b;\n const fieldA = this.store.getContactField(ak);\n const fieldB = this.store.getContactField(bk);\n\n if (fieldA.type === 'ward') {\n return 1;\n }\n\n if (fieldB.type === 'ward') {\n return -1;\n }\n\n if (\n fieldA.type === 'district' &&\n fieldB.type !== 'ward' &&\n fieldB.type !== 'district'\n ) {\n return 1;\n }\n\n if (\n fieldB.type === 'district' &&\n fieldA.type !== 'ward' &&\n fieldA.type !== 'district'\n ) {\n return -1;\n }\n\n if (\n fieldA.type === 'state' &&\n fieldB.type !== 'ward' &&\n fieldB.type !== 'district' &&\n fieldB.type !== 'state'\n ) {\n return 1;\n }\n\n if (\n fieldB.type === 'state' &&\n fieldA.type !== 'ward' &&\n fieldA.type !== 'district' &&\n fieldA.type !== 'state'\n ) {\n return -1;\n }\n\n if (fieldA.featured && !fieldB.featured) {\n return -1;\n }\n\n if (fieldB.featured && !fieldA.featured) {\n return 1;\n }\n\n const priority = fieldB.priority - fieldA.priority;\n if (priority !== 0) {\n return priority;\n }\n\n return ak.localeCompare(bk);\n }\n );\n\n if (fieldsToShow.length == 0) {\n return html`<slot name=\"empty\"></slot>`;\n }\n\n const fields = fieldsToShow.map((entry: [string, string]) => {\n const [k, v] = entry;\n const field = this.store.getContactField(k);\n return html`<temba-contact-field\n class=${getClasses({ set: !!v, unset: !v, featured: field.featured })}\n key=${field.key}\n name=${field.label}\n value=${v}\n type=${field.value_type}\n @change=${this.handleFieldChanged}\n timezone=${this.timezone}\n ?disabled=${(this.isAgent() && field.agent_access === 'view') ||\n this.disabled ||\n field.value_type === 'ward' ||\n field.value_type === 'district' ||\n field.value_type === 'state'\n ? true\n : false}\n ></temba-contact-field>`;\n });\n\n return html`\n <div class=${getClasses({ disabled: this.disabled })}>\n <div class=\"fields ${this.showAll ? 'show-all' : ''}\">${fields}</div>\n ${Object.keys(this.data.fields).length >= MIN_FOR_FILTER\n ? html`<div class=\"toggle\">\n <div style=\"flex-grow: 1\"></div>\n <div>\n <temba-checkbox\n ?checked=${this.showAll}\n @change=${this.handleToggle}\n label=\"Show All\"\n ></temba-checkbox>\n </div>\n </div>`\n : null}\n </div>\n `;\n }\n\n return super.render();\n }\n}\n"]}