@nyaruka/temba-components 0.120.1 → 0.120.3

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.
@@ -21,7 +21,7 @@ const k=globalThis,A=k.trustedTypes,S=A?A.createPolicy("lit-html",{createHTML:t=
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
23
23
  */
24
- let lt=class extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const o=i?.renderBefore??e;let n=o._$litPart$;if(void 0===n){const t=i?.renderBefore??null;o._$litPart$=n=new tt(e.insertBefore(z(),t),t,void 0,i??{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Z}};lt._$litElement$=!0,lt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:lt});const ht=globalThis.litElementPolyfillSupport;ht?.({LitElement:lt}),(globalThis.litElementVersions??=[]).push("4.0.4");var ct,dt,ut,pt,mt,gt,ft,vt,bt,yt,_t,xt,wt,kt,At,St,Ct,Tt,Et=function(t,e,i){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,i),i},$t=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};const Ot=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},zt="0123456789abcdef".split(""),Lt=[-2147483648,8388608,32768,128],Mt=[24,16,8,0],It=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Dt=[];class Pt{constructor(t=!1,e=!1){ct.set(this,void 0),dt.set(this,void 0),ut.set(this,void 0),pt.set(this,void 0),mt.set(this,void 0),gt.set(this,void 0),ft.set(this,void 0),vt.set(this,void 0),bt.set(this,void 0),yt.set(this,void 0),_t.set(this,void 0),xt.set(this,void 0),wt.set(this,void 0),kt.set(this,void 0),At.set(this,void 0),St.set(this,void 0),Ct.set(this,0),Tt.set(this,void 0),this.init(t,e)}init(t,e){e?(Dt[0]=Dt[16]=Dt[1]=Dt[2]=Dt[3]=Dt[4]=Dt[5]=Dt[6]=Dt[7]=Dt[8]=Dt[9]=Dt[10]=Dt[11]=Dt[12]=Dt[13]=Dt[14]=Dt[15]=0,Et(this,dt,Dt)):Et(this,dt,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t?(Et(this,gt,3238371032),Et(this,ft,914150663),Et(this,vt,812702999),Et(this,bt,4144912697),Et(this,yt,4290775857),Et(this,_t,1750603025),Et(this,xt,1694076839),Et(this,wt,3204075428)):(Et(this,gt,1779033703),Et(this,ft,3144134277),Et(this,vt,1013904242),Et(this,bt,2773480762),Et(this,yt,1359893119),Et(this,_t,2600822924),Et(this,xt,528734635),Et(this,wt,1541459225)),Et(this,ct,Et(this,Tt,Et(this,ut,Et(this,At,0)))),Et(this,pt,Et(this,kt,!1)),Et(this,mt,!0),Et(this,St,t)}update(t){if($t(this,pt))return this;let e;e=t instanceof ArrayBuffer?new Uint8Array(t):t;let i=0;const o=e.length,n=$t(this,dt);for(;i<o;){let t;if($t(this,kt)&&(Et(this,kt,!1),n[0]=$t(this,ct),n[16]=n[1]=n[2]=n[3]=n[4]=n[5]=n[6]=n[7]=n[8]=n[9]=n[10]=n[11]=n[12]=n[13]=n[14]=n[15]=0),"string"!=typeof e)for(t=$t(this,Tt);i<o&&t<64;++i)n[t>>2]|=e[i]<<Mt[3&t++];else for(t=$t(this,Tt);i<o&&t<64;++i){let o=e.charCodeAt(i);o<128?n[t>>2]|=o<<Mt[3&t++]:o<2048?(n[t>>2]|=(192|o>>6)<<Mt[3&t++],n[t>>2]|=(128|63&o)<<Mt[3&t++]):o<55296||o>=57344?(n[t>>2]|=(224|o>>12)<<Mt[3&t++],n[t>>2]|=(128|o>>6&63)<<Mt[3&t++],n[t>>2]|=(128|63&o)<<Mt[3&t++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),n[t>>2]|=(240|o>>18)<<Mt[3&t++],n[t>>2]|=(128|o>>12&63)<<Mt[3&t++],n[t>>2]|=(128|o>>6&63)<<Mt[3&t++],n[t>>2]|=(128|63&o)<<Mt[3&t++])}Et(this,Ct,t),Et(this,ut,$t(this,ut)+(t-$t(this,Tt))),t>=64?(Et(this,ct,n[16]),Et(this,Tt,t-64),this.hash(),Et(this,kt,!0)):Et(this,Tt,t)}return $t(this,ut)>4294967295&&(Et(this,At,$t(this,At)+($t(this,ut)/4294967296|0)),Et(this,ut,$t(this,ut)%4294967296)),this}finalize(){if($t(this,pt))return;Et(this,pt,!0);const t=$t(this,dt),e=$t(this,Ct);t[16]=$t(this,ct),t[e>>2]|=Lt[3&e],Et(this,ct,t[16]),e>=56&&($t(this,kt)||this.hash(),t[0]=$t(this,ct),t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=$t(this,At)<<3|$t(this,ut)>>>29,t[15]=$t(this,ut)<<3,this.hash()}hash(){let t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt);const l=$t(this,dt);let h,c,d,u,p,m,g,f,v,b;for(let t=16;t<64;++t)u=l[t-15],h=(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3,u=l[t-2],c=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10,l[t]=l[t-16]+h+l[t-7]+c|0;b=e&i;for(let y=0;y<64;y+=4)$t(this,mt)?($t(this,St)?(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),Et(this,mt,!1)):(h=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),c=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),g=t&e,d=g^t&i^b,m=n&s^~n&r,u=a+c+m+It[y]+l[y],p=h+d,a=o+u|0,o=u+p|0),h=(o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10),c=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),f=o&t,d=f^o&e^g,m=a&n^~a&s,u=r+c+m+It[y+1]+l[y+1],p=h+d,r=i+u|0,i=u+p|0,h=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),c=(r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7),v=i&o,d=v^i&t^f,m=r&a^~r&n,u=s+c+m+It[y+2]+l[y+2],p=h+d,s=e+u|0,e=u+p|0,h=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),c=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),b=e&i,d=b^e&o^v,m=s&r^~s&a,u=n+c+m+It[y+3]+l[y+3],p=h+d,n=t+u|0,t=u+p|0;Et(this,gt,$t(this,gt)+t|0),Et(this,ft,$t(this,ft)+e|0),Et(this,vt,$t(this,vt)+i|0),Et(this,bt,$t(this,bt)+o|0),Et(this,yt,$t(this,yt)+n|0),Et(this,_t,$t(this,_t)+s|0),Et(this,xt,$t(this,xt)+r|0),Et(this,wt,$t(this,wt)+a|0)}hex(){this.finalize();const t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt);let l=zt[t>>28&15]+zt[t>>24&15]+zt[t>>20&15]+zt[t>>16&15]+zt[t>>12&15]+zt[t>>8&15]+zt[t>>4&15]+zt[15&t]+zt[e>>28&15]+zt[e>>24&15]+zt[e>>20&15]+zt[e>>16&15]+zt[e>>12&15]+zt[e>>8&15]+zt[e>>4&15]+zt[15&e]+zt[i>>28&15]+zt[i>>24&15]+zt[i>>20&15]+zt[i>>16&15]+zt[i>>12&15]+zt[i>>8&15]+zt[i>>4&15]+zt[15&i]+zt[o>>28&15]+zt[o>>24&15]+zt[o>>20&15]+zt[o>>16&15]+zt[o>>12&15]+zt[o>>8&15]+zt[o>>4&15]+zt[15&o]+zt[n>>28&15]+zt[n>>24&15]+zt[n>>20&15]+zt[n>>16&15]+zt[n>>12&15]+zt[n>>8&15]+zt[n>>4&15]+zt[15&n]+zt[s>>28&15]+zt[s>>24&15]+zt[s>>20&15]+zt[s>>16&15]+zt[s>>12&15]+zt[s>>8&15]+zt[s>>4&15]+zt[15&s]+zt[r>>28&15]+zt[r>>24&15]+zt[r>>20&15]+zt[r>>16&15]+zt[r>>12&15]+zt[r>>8&15]+zt[r>>4&15]+zt[15&r];return $t(this,St)||(l+=zt[a>>28&15]+zt[a>>24&15]+zt[a>>20&15]+zt[a>>16&15]+zt[a>>12&15]+zt[a>>8&15]+zt[a>>4&15]+zt[15&a]),l}toString(){return this.hex()}digest(){this.finalize();const t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt),l=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,n>>24&255,n>>16&255,n>>8&255,255&n,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r];return $t(this,St)||l.push(a>>24&255,a>>16&255,a>>8&255,255&a),l}array(){return this.digest()}arrayBuffer(){this.finalize();const t=new ArrayBuffer($t(this,St)?28:32),e=new DataView(t);return e.setUint32(0,$t(this,gt)),e.setUint32(4,$t(this,ft)),e.setUint32(8,$t(this,vt)),e.setUint32(12,$t(this,bt)),e.setUint32(16,$t(this,yt)),e.setUint32(20,$t(this,_t)),e.setUint32(24,$t(this,xt)),$t(this,St)||e.setUint32(28,$t(this,wt)),t}}function Nt(t){const e=new Pt;return e.update(t),parseInt(e.hex().substring(0,8),16)}ct=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,mt=new WeakMap,gt=new WeakMap,ft=new WeakMap,vt=new WeakMap,bt=new WeakMap,yt=new WeakMap,_t=new WeakMap,xt=new WeakMap,wt=new WeakMap,kt=new WeakMap,At=new WeakMap,St=new WeakMap,Ct=new WeakMap,Tt=new WeakMap;const Bt=function(t,e,i){var o=i<.5?i*(1+e):i+e-i*e,n=2*i-o;return[(t/=360)+1/3,t,t-1/3].map((function(t){return t<0&&t++,t>1&&t--,t=t<1/6?n+6*(o-n)*t:t<.5?o:t<2/3?n+6*(o-n)*(2/3-t):n,Math.round(255*t)}))};const Rt="/api/v2/media.json",qt=new class{constructor(t={}){const[e,i]=[t.lightness,t.saturation].map((function(t){return t=void 0!==t?t:[.35,.5,.65],Array.isArray(t)?t.concat():[t]}));this.L=e,this.S=i,"number"==typeof t.hue&&(t.hue={min:t.hue,max:t.hue}),"object"!=typeof t.hue||Array.isArray(t.hue)||(t.hue=[t.hue]),void 0===t.hue&&(t.hue=[]),this.hueRanges=t.hue.map((function(t){return{min:void 0===t.min?0:t.min,max:void 0===t.max?360:t.max}})),this.hash=Nt,"function"==typeof t.hash&&(this.hash=t.hash),"bkdr"===t.hash&&(this.hash=Ot)}hsl(t){var e,i,o=this.hash(t);if(this.hueRanges.length){const t=this.hueRanges[o%this.hueRanges.length];e=o/this.hueRanges.length%727*(t.max-t.min)/727+t.min}else e=o%359;return o=Math.ceil(o/360),i=this.S[o%this.S.length],o=Math.ceil(o/this.S.length),[e,i,this.L[o%this.L.length]]}rgb(t){var e=this.hsl(t);return Bt.apply(this,e)}hex(t){var e,i=this.rgb(t);return e="#",i.forEach((function(t){t<16&&(e+=0),e+=t.toString(16)})),e}};var Ft;!function(t){t.BLUE="color:#5078b5;",t.GREEN="color:#62bd6a;",t.RED="color:#e36049;",t.PURPLE="color:#a626a4;"}(Ft||(Ft={}));const Ut=(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)},jt=(t={})=>{let e=(t=>{for(const e of document.cookie.split(";")){const i=e.indexOf("=");let o=e.substr(0,i),n=e.substr(i+1);if(o=o.trim(),n=n.trim(),o===t)return n}return null})("csrftoken");if(!e){const t=document.querySelector("[name=csrfmiddlewaretoken]");t&&(e=t.value)}const i=e?{"X-CSRFToken":e}:{},o=window.org_id;return o&&(i["X-Temba-Org"]=o),i["X-Requested-With"]="XMLHttpRequest",Object.keys(t).forEach((e=>{"X-Temba-Service-Org"===e&&delete i["X-Temba-Org"],i[e]=t[e]})),i},Vt=(t,e=null,i={})=>new Promise(((o,n)=>{const s={method:"GET",headers:jt(i)};e&&(s.signal=e.signal),fetch(t,s).then((t=>{t.status<200||t.status>=300?n(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)}))})),Zt=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()},Ht=(t,e=null,i={})=>new Promise(((o,n)=>{Vt(t,e,i).then((t=>{o({results:t.json.results,next:t.json.next})})).catch((t=>n(t)))})),Wt=async(t,e={})=>{if(!t)return new Promise((t=>t([])));let i=[],o=t;for(;o;){const t=await Ht(o,null,e);t.results&&(i=i.concat(t.results)),o=t.next}return i},Gt=t=>new Promise(((e,i)=>{Vt(t).then((t=>{t.status>=200&&t.status<300?e({assets:t.json.results,next:t.json.next}):i(t)})).catch((t=>i(t)))})),Kt=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await Gt(i);t.assets?(e=e.concat(t.assets),i=t.next):i=null}return e},Yt=(t,e,i={},o=null)=>{const n=jt(i);o&&(n["Content-Type"]=o);const s={method:"POST",headers:n,body:e};return new Promise(((e,i)=>{fetch(t,s).then((async t=>{if(t.status>=500)return void i(t);const o=t.headers.get("X-Temba-Toasts");if(o){const t=document.querySelector("temba-toast");t&&t.addMessages(JSON.parse(o))}t.text().then((i=>{let o={};try{o=JSON.parse(i)}catch(t){}e({body:i,json:o,headers:t.headers,status:t.status,redirected:t.redirected,url:t.url})}))})).catch((t=>{i(t)}))}))},Qt=(t,e)=>Yt(t,JSON.stringify(e),!1,"application/json"),Jt=(t,e,i={})=>new Promise(((o,n)=>{Yt(t,e,i).then((e=>{e.status>=200&&e.status<400?o(e):n(t===Rt?e:"Server failure")})).catch((t=>{n(t)}))})),Xt=t=>{const e=t.parentNode||t.host;if(e){const t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY,i=t&&!(t.includes("hidden")||t.includes("visible"));return e?i&&e.scrollHeight>=e.clientHeight?e:Xt(e):null}return null},te=(t,e,i=!1)=>{let o;return function(...n){const s=this,r=i&&!o;clearTimeout(o),o=setTimeout((function(){o=null,i||t.apply(s,n)}),e),r&&t.apply(s,n)}},ee=(t,e)=>{let i=!0;return function(...o){i&&(i=!1,t.apply(this,o),setTimeout((()=>{i=!0}),e))}},ie=(t,e="and")=>1===t.length?t[0]:2===t.length?"object"==typeof t[0]?V`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" "):"object"==typeof t[0]?t.map(((i,o)=>o<t.length-1?V`${i}, `:V`${e} ${i}`)):t.join(", ")+e+t[t.length-1],oe=t=>{let e=null;if(document.cookie&&""!=document.cookie){const i=document.cookie.split(";");for(let o=0;o<i.length;o++){const n=i[o].trim();if(n.substring(0,t.length+1)==t+"="){e=decodeURIComponent(n.substring(t.length+1));break}}}return e};var ne;!function(t){t.SETTINGS="settings",t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(ne||(ne={}));const se=([t,...e],i=navigator.language)=>void 0===t?"":t.toLocaleUpperCase(i)+e.join(""),re=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()},ae=(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)}`},le={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:_},he=(t=le,e,i)=>{const{kind:o,metadata:n}=i;let s=globalThis.litPropertyMetadata.get(n);if(void 0===s&&globalThis.litPropertyMetadata.set(n,s=new Map),s.set(i.name,t),"accessor"===o){const{name:o}=i;return{set(i){const n=e.get.call(this);e.set.call(this,i),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.P(o,void 0,t),e}}}if("setter"===o){const{name:o}=i;return function(i){const n=this[o];e.call(this,i),this.requestUpdate(o,n,t)}}throw Error("Unsupported decorator location: "+o)};function ce(t){return(e,i)=>"object"==typeof i?he(t,e,i):((t,e,i)=>{const o=e.hasOwnProperty(i);return e.constructor.createProperty(i,o?{...t,wrapped:!0}:t),o?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}const de=(t,e,i=!1)=>{if((t.DEBUG_UPDATES||t.DEBUG)&&e.size>0){const o={};for(const i of e.keys())o[i]=[e[i],t[i]];Ut(t.tagName,Ft.PURPLE,[i?"<first-updated>":"<updated>",o])}},ue=(t,e,i=void 0)=>{(t.DEBUG_EVENTS||t.DEBUG)&&Ut(t.tagName,Ft.GREEN,void 0!==i?[e,i]:[e])};class pe extends lt{constructor(){super(...arguments),this.DEBUG=!1,this.DEBUG_UPDATES=!1,this.DEBUG_EVENTS=!1,this.eles={}}getEventHandlers(){return[]}connectedCallback(){super.connectedCallback();for(const t of this.getEventHandlers())t.isDocument?document.addEventListener(t.event,t.method.bind(this)):t.isWindow?window.addEventListener(t.event,t.method.bind(this)):this.addEventListener(t.event,t.method.bind(this))}disconnectedCallback(){for(const t of this.getEventHandlers())t.isDocument?document.removeEventListener(t.event,t.method):t.isWindow?window.removeEventListener(t.event,t.method):this.removeEventListener(t.event,t.method);super.disconnectedCallback()}firstUpdated(t){super.firstUpdated(t),de(this,t,!0)}updated(t){super.updated(t),de(this,t,!1)}getHeaders(){return this.service?{"X-Temba-Service-Org":this.service}:{}}fireEvent(t){return ue(this,t),this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}swallowEvent(t){t.stopPropagation(),t.preventDefault()}fireCustomEvent(t,e={}){this.DEBUG_EVENTS&&ue(this,t,e);const i=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});return this.dispatchEvent(i)}dispatchEvent(t){super.dispatchEvent(t);const e=t.target;if(e){const i=e["-"+t.type];if(i)return i(t);return new Function("event",`\n with(document) {\n with(this) {\n let handler = ${e.getAttribute("-"+t.type)};\n if(typeof handler === 'function') { \n handler(event);\n }\n }\n }\n `).call(e,t)}}closestElement(t,e=this){return function e(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const o=i.closest(t);return o||e(i.getRootNode().host)}(e)}getDiv(t){let e=this.eles[t];return e||(e=this.shadowRoot.querySelector(t),e&&(this.eles[t]=e),e)}stopEvent(t){t&&(t.stopPropagation(),t.preventDefault())}isMobile(){const t=window;return!!t.isMobile&&t.isMobile()}}t([ce({type:String})],pe.prototype,"service",void 0);class me extends pe{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)}}me.formAssociated=!0,t([ce({type:String})],me.prototype,"name",void 0),t([ce({type:String,attribute:"help_text"})],me.prototype,"helpText",void 0),t([ce({type:Boolean,attribute:"help_always"})],me.prototype,"helpAlways",void 0),t([ce({type:Boolean,attribute:"widget_only"})],me.prototype,"widgetOnly",void 0),t([ce({type:Boolean,attribute:"hide_label"})],me.prototype,"hideLabel",void 0),t([ce({type:String})],me.prototype,"label",void 0),t([ce({type:Array})],me.prototype,"errors",void 0),t([ce({type:String})],me.prototype,"value",void 0),t([ce({attribute:!1})],me.prototype,"inputRoot",void 0),t([ce({type:Boolean})],me.prototype,"disabled",void 0);var ge;!function(t){t.ai="beaker-02",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.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.definitions_export="download-cloud-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.export="download-cloud-01",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.import="upload-cloud-01",t.inbox="inbox-01",t.incidents="alert-square",t.incoming_call="phone-incoming-01",t.info="user-square",t.integrations="layers-three-01",t.invitations="user-plus-01",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.notes="edit-03",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.shortcut="zap-fast",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.template_approved="check-circle",t.template_pending="hourglass-01",t.template_rejected="alert-circle",t.tickets="agent",t.tickets_all="archive",t.tickets_closed="check",t.tickets_mine="coffee",t.tickets_mine_done="coffee-empty",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.user_beta="shield-zap",t.user_token="key-01",t.users="users-01",t.video="video-recorder",t.webhook="link-external-01",t.wit="wit",t.workspace="folder",t.zapier="zapier",t.zendesk="zendesk",t.channel_a="channel-android",t.channel_ac="zap",t.channel_at="zap",t.channel_bs="zap",t.channel_bw="zap",t.channel_cs="zap",t.channel_ct="channel-clickatell",t.channel_d3="channel-whatsapp",t.channel_d3c="channel-whatsapp",t.channel_da="zap",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_hm="zap",t.channel_ib="zap",t.channel_ig="channel-instagram",t.channel_jc="channel-jiochat",t.channel_kn="channel-kannel",t.channel_kwa="channel-whatsapp",t.channel_ln="channel-line",t.channel_mt="channel-mtarget",t.channel_mtn="zap",t.channel_nx="channel-vonage",t.channel_pl="channel-plivo",t.channel_rc="channel-rocketchat",t.channel_sl="channel-slack",t.channel_sq="zap",t.channel_st="zap",t.channel_sw="channel-signalwire",t.channel_t="channel-twilio",t.channel_tg="channel-telegram",t.channel_tms="channel-twilio",t.channel_tq="channel-thinq",t.channel_tw="zap",t.channel_twa="channel-whatsapp",t.channel_twc="zap",t.channel_twt="channel-twitter",t.channel_vk="channel-vk",t.channel_vp="channel-viber",t.channel_wa="channel-whatsapp",t.channel_wac="channel-whatsapp",t.channel_wc="channel-wechat",t.channel_yo="zap",t.channel_zvw="channel-whatsapp",t.bothub="bothub",t.chatbase="chatbase",t.dtone="dtone",t.openai="openai",t.anthropic="anthropic",t.default="list",t.datepicker="calendar",t.slider="sliders-02",t.select="browser",t.input="edit-05"}(ge||(ge={}));class fe extends me{constructor(){super(...arguments),this.name="",this.disabled=!1,this.size=1.2,this.animateChange="pulse"}static get styles(){return r`
24
+ let lt=class extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const o=i?.renderBefore??e;let n=o._$litPart$;if(void 0===n){const t=i?.renderBefore??null;o._$litPart$=n=new tt(e.insertBefore(z(),t),t,void 0,i??{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Z}};lt._$litElement$=!0,lt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:lt});const ht=globalThis.litElementPolyfillSupport;ht?.({LitElement:lt}),(globalThis.litElementVersions??=[]).push("4.0.4");var ct,dt,ut,pt,mt,gt,ft,vt,bt,yt,_t,xt,wt,kt,At,St,Ct,Tt,Et=function(t,e,i){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,i),i},$t=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};const Ot=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},zt="0123456789abcdef".split(""),Lt=[-2147483648,8388608,32768,128],Mt=[24,16,8,0],It=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Dt=[];class Pt{constructor(t=!1,e=!1){ct.set(this,void 0),dt.set(this,void 0),ut.set(this,void 0),pt.set(this,void 0),mt.set(this,void 0),gt.set(this,void 0),ft.set(this,void 0),vt.set(this,void 0),bt.set(this,void 0),yt.set(this,void 0),_t.set(this,void 0),xt.set(this,void 0),wt.set(this,void 0),kt.set(this,void 0),At.set(this,void 0),St.set(this,void 0),Ct.set(this,0),Tt.set(this,void 0),this.init(t,e)}init(t,e){e?(Dt[0]=Dt[16]=Dt[1]=Dt[2]=Dt[3]=Dt[4]=Dt[5]=Dt[6]=Dt[7]=Dt[8]=Dt[9]=Dt[10]=Dt[11]=Dt[12]=Dt[13]=Dt[14]=Dt[15]=0,Et(this,dt,Dt)):Et(this,dt,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t?(Et(this,gt,3238371032),Et(this,ft,914150663),Et(this,vt,812702999),Et(this,bt,4144912697),Et(this,yt,4290775857),Et(this,_t,1750603025),Et(this,xt,1694076839),Et(this,wt,3204075428)):(Et(this,gt,1779033703),Et(this,ft,3144134277),Et(this,vt,1013904242),Et(this,bt,2773480762),Et(this,yt,1359893119),Et(this,_t,2600822924),Et(this,xt,528734635),Et(this,wt,1541459225)),Et(this,ct,Et(this,Tt,Et(this,ut,Et(this,At,0)))),Et(this,pt,Et(this,kt,!1)),Et(this,mt,!0),Et(this,St,t)}update(t){if($t(this,pt))return this;let e;e=t instanceof ArrayBuffer?new Uint8Array(t):t;let i=0;const o=e.length,n=$t(this,dt);for(;i<o;){let t;if($t(this,kt)&&(Et(this,kt,!1),n[0]=$t(this,ct),n[16]=n[1]=n[2]=n[3]=n[4]=n[5]=n[6]=n[7]=n[8]=n[9]=n[10]=n[11]=n[12]=n[13]=n[14]=n[15]=0),"string"!=typeof e)for(t=$t(this,Tt);i<o&&t<64;++i)n[t>>2]|=e[i]<<Mt[3&t++];else for(t=$t(this,Tt);i<o&&t<64;++i){let o=e.charCodeAt(i);o<128?n[t>>2]|=o<<Mt[3&t++]:o<2048?(n[t>>2]|=(192|o>>6)<<Mt[3&t++],n[t>>2]|=(128|63&o)<<Mt[3&t++]):o<55296||o>=57344?(n[t>>2]|=(224|o>>12)<<Mt[3&t++],n[t>>2]|=(128|o>>6&63)<<Mt[3&t++],n[t>>2]|=(128|63&o)<<Mt[3&t++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),n[t>>2]|=(240|o>>18)<<Mt[3&t++],n[t>>2]|=(128|o>>12&63)<<Mt[3&t++],n[t>>2]|=(128|o>>6&63)<<Mt[3&t++],n[t>>2]|=(128|63&o)<<Mt[3&t++])}Et(this,Ct,t),Et(this,ut,$t(this,ut)+(t-$t(this,Tt))),t>=64?(Et(this,ct,n[16]),Et(this,Tt,t-64),this.hash(),Et(this,kt,!0)):Et(this,Tt,t)}return $t(this,ut)>4294967295&&(Et(this,At,$t(this,At)+($t(this,ut)/4294967296|0)),Et(this,ut,$t(this,ut)%4294967296)),this}finalize(){if($t(this,pt))return;Et(this,pt,!0);const t=$t(this,dt),e=$t(this,Ct);t[16]=$t(this,ct),t[e>>2]|=Lt[3&e],Et(this,ct,t[16]),e>=56&&($t(this,kt)||this.hash(),t[0]=$t(this,ct),t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=$t(this,At)<<3|$t(this,ut)>>>29,t[15]=$t(this,ut)<<3,this.hash()}hash(){let t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt);const l=$t(this,dt);let h,c,d,u,p,m,g,f,v,b;for(let t=16;t<64;++t)u=l[t-15],h=(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3,u=l[t-2],c=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10,l[t]=l[t-16]+h+l[t-7]+c|0;b=e&i;for(let y=0;y<64;y+=4)$t(this,mt)?($t(this,St)?(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),Et(this,mt,!1)):(h=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),c=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),g=t&e,d=g^t&i^b,m=n&s^~n&r,u=a+c+m+It[y]+l[y],p=h+d,a=o+u|0,o=u+p|0),h=(o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10),c=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),f=o&t,d=f^o&e^g,m=a&n^~a&s,u=r+c+m+It[y+1]+l[y+1],p=h+d,r=i+u|0,i=u+p|0,h=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),c=(r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7),v=i&o,d=v^i&t^f,m=r&a^~r&n,u=s+c+m+It[y+2]+l[y+2],p=h+d,s=e+u|0,e=u+p|0,h=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),c=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),b=e&i,d=b^e&o^v,m=s&r^~s&a,u=n+c+m+It[y+3]+l[y+3],p=h+d,n=t+u|0,t=u+p|0;Et(this,gt,$t(this,gt)+t|0),Et(this,ft,$t(this,ft)+e|0),Et(this,vt,$t(this,vt)+i|0),Et(this,bt,$t(this,bt)+o|0),Et(this,yt,$t(this,yt)+n|0),Et(this,_t,$t(this,_t)+s|0),Et(this,xt,$t(this,xt)+r|0),Et(this,wt,$t(this,wt)+a|0)}hex(){this.finalize();const t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt);let l=zt[t>>28&15]+zt[t>>24&15]+zt[t>>20&15]+zt[t>>16&15]+zt[t>>12&15]+zt[t>>8&15]+zt[t>>4&15]+zt[15&t]+zt[e>>28&15]+zt[e>>24&15]+zt[e>>20&15]+zt[e>>16&15]+zt[e>>12&15]+zt[e>>8&15]+zt[e>>4&15]+zt[15&e]+zt[i>>28&15]+zt[i>>24&15]+zt[i>>20&15]+zt[i>>16&15]+zt[i>>12&15]+zt[i>>8&15]+zt[i>>4&15]+zt[15&i]+zt[o>>28&15]+zt[o>>24&15]+zt[o>>20&15]+zt[o>>16&15]+zt[o>>12&15]+zt[o>>8&15]+zt[o>>4&15]+zt[15&o]+zt[n>>28&15]+zt[n>>24&15]+zt[n>>20&15]+zt[n>>16&15]+zt[n>>12&15]+zt[n>>8&15]+zt[n>>4&15]+zt[15&n]+zt[s>>28&15]+zt[s>>24&15]+zt[s>>20&15]+zt[s>>16&15]+zt[s>>12&15]+zt[s>>8&15]+zt[s>>4&15]+zt[15&s]+zt[r>>28&15]+zt[r>>24&15]+zt[r>>20&15]+zt[r>>16&15]+zt[r>>12&15]+zt[r>>8&15]+zt[r>>4&15]+zt[15&r];return $t(this,St)||(l+=zt[a>>28&15]+zt[a>>24&15]+zt[a>>20&15]+zt[a>>16&15]+zt[a>>12&15]+zt[a>>8&15]+zt[a>>4&15]+zt[15&a]),l}toString(){return this.hex()}digest(){this.finalize();const t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt),l=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,n>>24&255,n>>16&255,n>>8&255,255&n,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r];return $t(this,St)||l.push(a>>24&255,a>>16&255,a>>8&255,255&a),l}array(){return this.digest()}arrayBuffer(){this.finalize();const t=new ArrayBuffer($t(this,St)?28:32),e=new DataView(t);return e.setUint32(0,$t(this,gt)),e.setUint32(4,$t(this,ft)),e.setUint32(8,$t(this,vt)),e.setUint32(12,$t(this,bt)),e.setUint32(16,$t(this,yt)),e.setUint32(20,$t(this,_t)),e.setUint32(24,$t(this,xt)),$t(this,St)||e.setUint32(28,$t(this,wt)),t}}function Nt(t){const e=new Pt;return e.update(t),parseInt(e.hex().substring(0,8),16)}ct=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,mt=new WeakMap,gt=new WeakMap,ft=new WeakMap,vt=new WeakMap,bt=new WeakMap,yt=new WeakMap,_t=new WeakMap,xt=new WeakMap,wt=new WeakMap,kt=new WeakMap,At=new WeakMap,St=new WeakMap,Ct=new WeakMap,Tt=new WeakMap;const Bt=function(t,e,i){var o=i<.5?i*(1+e):i+e-i*e,n=2*i-o;return[(t/=360)+1/3,t,t-1/3].map((function(t){return t<0&&t++,t>1&&t--,t=t<1/6?n+6*(o-n)*t:t<.5?o:t<2/3?n+6*(o-n)*(2/3-t):n,Math.round(255*t)}))};const Rt="/api/v2/media.json",qt=new class{constructor(t={}){const[e,i]=[t.lightness,t.saturation].map((function(t){return t=void 0!==t?t:[.35,.5,.65],Array.isArray(t)?t.concat():[t]}));this.L=e,this.S=i,"number"==typeof t.hue&&(t.hue={min:t.hue,max:t.hue}),"object"!=typeof t.hue||Array.isArray(t.hue)||(t.hue=[t.hue]),void 0===t.hue&&(t.hue=[]),this.hueRanges=t.hue.map((function(t){return{min:void 0===t.min?0:t.min,max:void 0===t.max?360:t.max}})),this.hash=Nt,"function"==typeof t.hash&&(this.hash=t.hash),"bkdr"===t.hash&&(this.hash=Ot)}hsl(t){var e,i,o=this.hash(t);if(this.hueRanges.length){const t=this.hueRanges[o%this.hueRanges.length];e=o/this.hueRanges.length%727*(t.max-t.min)/727+t.min}else e=o%359;return o=Math.ceil(o/360),i=this.S[o%this.S.length],o=Math.ceil(o/this.S.length),[e,i,this.L[o%this.L.length]]}rgb(t){var e=this.hsl(t);return Bt.apply(this,e)}hex(t){var e,i=this.rgb(t);return e="#",i.forEach((function(t){t<16&&(e+=0),e+=t.toString(16)})),e}};var Ft;!function(t){t.BLUE="color:#5078b5;",t.GREEN="color:#62bd6a;",t.RED="color:#e36049;",t.PURPLE="color:#a626a4;"}(Ft||(Ft={}));const Ut=(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)},jt=(t={})=>{let e=(t=>{for(const e of document.cookie.split(";")){const i=e.indexOf("=");let o=e.substr(0,i),n=e.substr(i+1);if(o=o.trim(),n=n.trim(),o===t)return n}return null})("csrftoken");if(!e){const t=document.querySelector("[name=csrfmiddlewaretoken]");t&&(e=t.value)}const i=e?{"X-CSRFToken":e}:{},o=window.org_id;return o&&(i["X-Temba-Org"]=o),i["X-Requested-With"]="XMLHttpRequest",Object.keys(t).forEach((e=>{"X-Temba-Service-Org"===e&&delete i["X-Temba-Org"],i[e]=t[e]})),i},Vt=(t,e=null,i={})=>new Promise(((o,n)=>{const s={method:"GET",headers:jt(i)};e&&(s.signal=e.signal),fetch(t,s).then((t=>{t.status<200||t.status>=300?n(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)}))})),Zt=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()},Ht=(t,e=null,i={})=>new Promise(((o,n)=>{Vt(t,e,i).then((t=>{o({results:t.json.results,next:t.json.next})})).catch((t=>n(t)))})),Wt=async(t,e={})=>{if(!t)return new Promise((t=>t([])));let i=[],o=t;for(;o;){const t=await Ht(o,null,e);t.results&&(i=i.concat(t.results)),o=t.next}return i},Gt=t=>new Promise(((e,i)=>{Vt(t).then((t=>{t.status>=200&&t.status<300?e({assets:t.json.results,next:t.json.next}):i(t)})).catch((t=>i(t)))})),Kt=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await Gt(i);t.assets?(e=e.concat(t.assets),i=t.next):i=null}return e},Yt=(t,e,i={},o=null)=>{const n=jt(i);o&&(n["Content-Type"]=o);const s={method:"POST",headers:n,body:e};return new Promise(((e,i)=>{fetch(t,s).then((async t=>{if(t.status>=500)return void i(t);const o=t.headers.get("X-Temba-Toasts");if(o){const t=document.querySelector("temba-toast");t&&t.addMessages(JSON.parse(o))}t.text().then((i=>{let o={};try{o=JSON.parse(i)}catch(t){}e({body:i,json:o,headers:t.headers,status:t.status,redirected:t.redirected,url:t.url})}))})).catch((t=>{i(t)}))}))},Qt=(t,e)=>Yt(t,JSON.stringify(e),!1,"application/json"),Jt=(t,e,i={})=>new Promise(((o,n)=>{Yt(t,e,i).then((e=>{e.status>=200&&e.status<400?o(e):n(t===Rt?e:"Server failure")})).catch((t=>{n(t)}))})),Xt=t=>{const e=t.parentNode||t.host;if(e){const t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY,i=t&&!(t.includes("hidden")||t.includes("visible"));return e?i&&e.scrollHeight>=e.clientHeight?e:Xt(e):null}return null},te=(t,e,i=!1)=>{let o;return function(...n){const s=this,r=i&&!o;clearTimeout(o),o=setTimeout((function(){o=null,i||t.apply(s,n)}),e),r&&t.apply(s,n)}},ee=(t,e)=>{let i=!0;return function(...o){i&&(i=!1,t.apply(this,o),setTimeout((()=>{i=!0}),e))}},ie=(t,e="and")=>1===t.length?t[0]:2===t.length?"object"==typeof t[0]?V`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" "):"object"==typeof t[0]?t.map(((i,o)=>o<t.length-1?V`${i}, `:V`${e} ${i}`)):t.join(", ")+e+t[t.length-1],oe=t=>{let e=null;if(document.cookie&&""!=document.cookie){const i=document.cookie.split(";");for(let o=0;o<i.length;o++){const n=i[o].trim();if(n.substring(0,t.length+1)==t+"="){e=decodeURIComponent(n.substring(t.length+1));break}}}return e};var ne;!function(t){t.SETTINGS="settings",t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(ne||(ne={}));const se=([t,...e],i=navigator.language)=>void 0===t?"":t.toLocaleUpperCase(i)+e.join(""),re=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()},ae=(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)}`},le={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:_},he=(t=le,e,i)=>{const{kind:o,metadata:n}=i;let s=globalThis.litPropertyMetadata.get(n);if(void 0===s&&globalThis.litPropertyMetadata.set(n,s=new Map),s.set(i.name,t),"accessor"===o){const{name:o}=i;return{set(i){const n=e.get.call(this);e.set.call(this,i),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.P(o,void 0,t),e}}}if("setter"===o){const{name:o}=i;return function(i){const n=this[o];e.call(this,i),this.requestUpdate(o,n,t)}}throw Error("Unsupported decorator location: "+o)};function ce(t){return(e,i)=>"object"==typeof i?he(t,e,i):((t,e,i)=>{const o=e.hasOwnProperty(i);return e.constructor.createProperty(i,o?{...t,wrapped:!0}:t),o?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}const de=(t,e,i=!1)=>{if((t.DEBUG_UPDATES||t.DEBUG)&&e.size>0){const o={};for(const i of e.keys())o[i]=[e[i],t[i]];Ut(t.tagName,Ft.PURPLE,[i?"<first-updated>":"<updated>",o])}},ue=(t,e,i=void 0)=>{(t.DEBUG_EVENTS||t.DEBUG)&&Ut(t.tagName,Ft.GREEN,void 0!==i?[e,i]:[e])};class pe extends lt{constructor(){super(...arguments),this.DEBUG=!1,this.DEBUG_UPDATES=!1,this.DEBUG_EVENTS=!1,this.eles={}}getEventHandlers(){return[]}connectedCallback(){super.connectedCallback();for(const t of this.getEventHandlers())t.isDocument?document.addEventListener(t.event,t.method.bind(this)):t.isWindow?window.addEventListener(t.event,t.method.bind(this)):this.addEventListener(t.event,t.method.bind(this))}disconnectedCallback(){for(const t of this.getEventHandlers())t.isDocument?document.removeEventListener(t.event,t.method):t.isWindow?window.removeEventListener(t.event,t.method):this.removeEventListener(t.event,t.method);super.disconnectedCallback()}firstUpdated(t){super.firstUpdated(t),de(this,t,!0)}updated(t){super.updated(t),de(this,t,!1)}getHeaders(){return this.service?{"X-Temba-Service-Org":this.service}:{}}fireEvent(t){return ue(this,t),this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}swallowEvent(t){t.stopPropagation(),t.preventDefault()}fireCustomEvent(t,e={}){this.DEBUG_EVENTS&&ue(this,t,e);const i=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});return this.dispatchEvent(i)}dispatchEvent(t){super.dispatchEvent(t);const e=t.target;if(e){const i=e["-"+t.type];if(i)return i(t);return new Function("event",`\n with(document) {\n with(this) {\n let handler = ${e.getAttribute("-"+t.type)};\n if(typeof handler === 'function') { \n handler(event);\n }\n }\n }\n `).call(e,t)}}closestElement(t,e=this){return function e(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const o=i.closest(t);return o||e(i.getRootNode().host)}(e)}getDiv(t){let e=this.eles[t];return e||(e=this.shadowRoot.querySelector(t),e&&(this.eles[t]=e),e)}stopEvent(t){t&&(t.stopPropagation(),t.preventDefault())}isMobile(){const t=window;return!!t.isMobile&&t.isMobile()}}t([ce({type:String})],pe.prototype,"service",void 0);class me extends pe{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)}}me.formAssociated=!0,t([ce({type:String})],me.prototype,"name",void 0),t([ce({type:String,attribute:"help_text"})],me.prototype,"helpText",void 0),t([ce({type:Boolean,attribute:"help_always"})],me.prototype,"helpAlways",void 0),t([ce({type:Boolean,attribute:"widget_only"})],me.prototype,"widgetOnly",void 0),t([ce({type:Boolean,attribute:"hide_label"})],me.prototype,"hideLabel",void 0),t([ce({type:String})],me.prototype,"label",void 0),t([ce({type:Array})],me.prototype,"errors",void 0),t([ce({type:String})],me.prototype,"value",void 0),t([ce({attribute:!1})],me.prototype,"inputRoot",void 0),t([ce({type:Boolean})],me.prototype,"disabled",void 0);var ge;!function(t){t.ai="beaker-02",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.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.definitions_export="download-cloud-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.export="download-cloud-01",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.import="upload-cloud-01",t.inbox="inbox-01",t.incidents="alert-square",t.incoming_call="phone-incoming-01",t.info="user-square",t.integrations="layers-three-01",t.invitations="user-plus-01",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.notes="edit-03",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.shortcut="zap-fast",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.template_approved="check-circle",t.template_pending="hourglass-01",t.template_rejected="alert-circle",t.tickets="agent",t.tickets_all="archive",t.tickets_closed="check",t.tickets_mine="coffee",t.tickets_mine_done="coffee-empty",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.user_beta="shield-zap",t.user_token="key-01",t.users="users-01",t.video="video-recorder",t.webhook="link-external-01",t.wit="wit",t.workspace="folder",t.zapier="zapier",t.zendesk="zendesk",t.channel_a="channel-android",t.channel_ac="zap",t.channel_at="zap",t.channel_bs="zap",t.channel_bw="zap",t.channel_cs="zap",t.channel_ct="channel-clickatell",t.channel_d3="channel-whatsapp",t.channel_d3c="channel-whatsapp",t.channel_da="zap",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_hm="zap",t.channel_ib="zap",t.channel_ig="channel-instagram",t.channel_jc="channel-jiochat",t.channel_kn="channel-kannel",t.channel_kwa="channel-whatsapp",t.channel_ln="channel-line",t.channel_mt="channel-mtarget",t.channel_mtn="zap",t.channel_nx="channel-vonage",t.channel_pl="channel-plivo",t.channel_rc="channel-rocketchat",t.channel_sl="channel-slack",t.channel_sq="zap",t.channel_st="zap",t.channel_sw="channel-signalwire",t.channel_t="channel-twilio",t.channel_tg="channel-telegram",t.channel_tms="channel-twilio",t.channel_tq="channel-thinq",t.channel_tw="zap",t.channel_twa="channel-whatsapp",t.channel_twc="zap",t.channel_twt="channel-twitter",t.channel_vk="channel-vk",t.channel_vp="channel-viber",t.channel_wa="channel-whatsapp",t.channel_wac="channel-whatsapp",t.channel_wc="channel-wechat",t.channel_yo="zap",t.channel_zvw="channel-whatsapp",t.bothub="bothub",t.chatbase="chatbase",t.dtone="dtone",t.openai="openai",t.anthropic="anthropic",t.google="gemini",t.openai_azure="openai",t.deepseek="deepseek",t.default="list",t.datepicker="calendar",t.slider="sliders-02",t.select="browser",t.input="edit-05"}(ge||(ge={}));class fe extends me{constructor(){super(...arguments),this.name="",this.disabled=!1,this.size=1.2,this.animateChange="pulse"}static get styles(){return r`
25
25
  :host {
26
26
  color: var(--color-text);
27
27
  display: inline-block;
@@ -915,14 +915,14 @@ let fr=Ks,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
915
915
  pointer-events: none;
916
916
  padding: 0px;
917
917
  }
918
- `}constructor(){super(),this.hiddenInputs=[],this.inputStyle={},this.multi=!1,this.searchOnFocus=!1,this.placeholder="",this.name="",this.nameKey="name",this.valueKey="value",this.queryParam=null,this.input="",this.visibleOptions=[],this.completionOptions=[],this.quietMillis=0,this.searchable=!1,this.cache=!0,this.cacheKey="",this.focused=!1,this.disabled=!1,this.selectedIndex=-1,this.anchorPosition={left:0,top:0},this.tags=!1,this.flavor="default",this.infoText="",this.values=[],this.getName=t=>t[this.nameKey||"name"],this.isMatch=this.isMatchDefault,this.getValue=t=>t[this.valueKey||"value"]||t.id,this.sortFunction=null,this.renderOptionDetail=()=>V``,this.renderSelectedItem=this.renderSelectedItemDefault,this.createArbitraryOption=this.createArbitraryOptionDefault,this.getOptions=this.getOptionsDefault,this.prepareOptions=this.prepareOptionsDefault,this.isComplete=this.isCompleteDefault,this.staticOptions=[],this.allowAnchor=!0,this.alphaSort=(t,e)=>this.endpoint?this.getName(t).localeCompare(this.getName(e)):0,this.next=null,this.lruCache=Le(20,6e4),this.getNameInternal=t=>this.getName(t),this.renderOptionDefault=this.renderOptionDefault.bind(this),this.renderSelectedItemDefault=this.renderSelectedItemDefault.bind(this),this.prepareOptionsDefault=this.prepareOptionsDefault.bind(this),this.isMatchDefault=this.isMatchDefault.bind(this)}prepareOptionsDefault(t){return t}isMatchDefault(t,e){return(this.getName(t)||"").toLowerCase().indexOf(e)>-1}handleSlotChange(){if(this.staticOptions&&0===this.staticOptions.length)for(const t of this.children)if("TEMBA-OPTION"===t.tagName){const e={};for(const i of t.attributes)e[i.name]=i.value;if(e){let t=!1;void 0!==e.selected&&(delete e.selected,t=!0);const i=this.value||this.getAttribute("value");if(i){this.getValue(e)==i&&(t=!0)}this.staticOptions.push(e),t&&(this.multi?this.addValue(e):this.setValues([e]))}}this.searchable&&0===this.staticOptions.length&&(this.quietMillis=200)}checkSelectedOption(){if(this.value&&0==this.values.length&&0==this.staticOptions.length&&this.endpoint){const t=this.value;this.resolving=!0,Wt(this.endpoint).then((e=>{if(e&&e.length>0){if(t){const i=e.find((e=>this.getValue(e)===t));if(i)return this.resolving=!1,this.fetching=!1,void this.setValues([i])}this.setValues([e[0]]),this.resolving=!1}}))}else this.staticOptions.length>0&&(null!==this.getAttribute("multi")?this.addValue(this.staticOptions[0]):this.getAttribute("value")?this.setSelectedValue(this.getAttribute("value")):this.setValues([this.staticOptions[0]]))}firstUpdated(t){super.firstUpdated(t),this.anchorElement=this.shadowRoot.querySelector(".select-container"),this.anchorExpressions=this.shadowRoot.querySelector("#anchor"),this.shadowRoot.addEventListener("slotchange",this.handleSlotChange.bind(this))}updated(t){super.updated(t),t.has("sorted")&&(this.sortFunction=this.sorted?this.alphaSort:null),t.has("value")&&this.value&&!this.values.length&&this.setSelectedValue(this.value),t.has("values")&&(this.updateInputs(),this.hasChanges(t.get("values"))&&this.fireEvent("change")),t.has("cacheKey")&&this.lruCache.clear(),t.has("input")&&!t.has("values")&&!t.has("options")&&this.focused&&(this.lastQuery&&window.clearTimeout(this.lastQuery),this.lastQuery=window.setTimeout((()=>{this.expressions&&this.input.indexOf("@")>-1?this.fetchExpressions():this.fetchOptions(this.input)}),this.quietMillis)),this.endpoint&&t.has("fetching")&&(this.fetching||this.isPastFetchThreshold()||this.fireCustomEvent($e.FetchComplete)),(t.has("cursorIndex")||t.has("visibleOptions"))&&this.endpoint&&!this.fetching&&this.isPastFetchThreshold()&&(this.next?this.fetchOptions(null,null,this.next):this.fetchOptions(this.query,this.page+1)),0===this.values.length&&!this.placeholder&&this.staticOptions.length>0&&this.setValues([this.staticOptions[0]])}hasChanges(t){if(void 0===t)return!1;let e;void 0!==t&&(e=(t||[]).map((t=>this.getValue(t))).join(","));return e!==(this.values||[]).map((t=>this.getValue(t))).join(",")}setSelectedValue(t){if(this.staticOptions.length>0){const e=this.staticOptions.find((e=>this.getValue(e)===t));e&&this.setValues([e])}else this.checkSelectedOption()}updateInputs(){for(let t=null;t=this.hiddenInputs.pop();)t.remove();if(0===this.values.length)this.value=null;else{const t=this.getAttribute("name");t&&(this.multi||1!==this.values.length?this.inputRoot.parentElement&&this.values.forEach((e=>{const i=document.createElement("input");i.setAttribute("type","hidden"),i.setAttribute("name",t),i.setAttribute("value",this.serializeValue(e)),this.hiddenInputs.push(i),this.inputRoot.parentElement.appendChild(i)})):(this.selection=this.values[0],this.value=this.serializeValue(this.values[0])))}}setSelectedOption(t){this.multi?this.addValue(t):this.setValues([t]),this.multi&&this.searchable||(this.blur(),this.focused=!1),this.visibleOptions=[],this.input="",this.next=null,this.complete=!0,this.selectedIndex=-1}isPastFetchThreshold(){return(this.visibleOptions.length>0||this.next)&&!this.complete&&(this.cursorIndex||0)>this.visibleOptions.length-20}handleOptionSelection(t){const e=t.detail.selected;e.post&&this.endpoint?Qt(this.endpoint,e).then((t=>{t.status>=200&&t.status<300?(this.setSelectedOption(t.json),this.lruCache=Le(20,6e4)):this.blur()})):this.setSelectedOption(e)}handleExpressionSelection(t){const e=t.detail.selected,i=t.detail.tabbed,o=this.shadowRoot.querySelector(".searchbox");cl(this.query,o,e),this.query="",this.completionOptions=[],i?this.fetchExpressions():-1===this.input.indexOf("(")&&this.addInputAsValue()}getOptionsDefault(t){return t.json.results}isCompleteDefault(t,e){const i=e.json;return!i.more&&!i.next}handleRemoveSelection(t){this.removeValue(t),this.visibleOptions=[]}createArbitraryOptionDefault(){return null}open(){this.shadowRoot.querySelector(".select-container").click()}isOpen(){return this.visibleOptions.length>0}setOptions(t){this.staticOptions=t}setVisibleOptions(t){if(t=t.filter((t=>!!this.getNameInternal(t)&&(!this.shouldExclude||!this.shouldExclude(t)))),this.input){if(this.searchable&&!this.queryParam){const e=this.input.trim().toLowerCase();t=t.filter((t=>this.isMatch(t,e)))}const e=this.createArbitraryOption(this.input,t);if(e){e.arbitrary=!0;t.find((t=>this.getValue(t)===this.getValue(e)))||(t.length>0&&t[0].arbitrary?t[0]=e:t.unshift(e))}}this.values.length>0&&(this.multi?t=t.filter((t=>!this.values.find((e=>this.getValue(e)===this.getValue(t))))):(this.input?this.cursorIndex=0:this.cursorIndex=t.findIndex((t=>this.getValue(t)===this.getValue(this.values[0]))),this.requestUpdate("cursorIndex"))),this.sortFunction&&t.sort(this.sortFunction),this.visibleOptions=t,this.fireCustomEvent($e.ContentChanged,{options:this.visibleOptions})}fetchExpressions(){const t=document.querySelector("temba-store");if(this.expressions&&t){const e=this.shadowRoot.querySelector(".searchbox"),i=dl(e,t,"session"===this.expressions);return this.query=i.query,this.completionOptions=i.options,this.visibleOptions=[],this.anchorPosition=i.anchorPosition,void this.fireCustomEvent($e.FetchComplete)}}fetchOptions(t,e=0,i=null){if(this.completionOptions=[],!this.fetching){this.fetching=!0;const o=[...this.staticOptions],n=(t||"").trim().toLowerCase();if(this.tags&&n&&(o.find((t=>this.getValue(t)&&this.getValue(t).toLowerCase()===n))||o.splice(0,0,{name:t,value:t})),this.endpoint){let s=this.endpoint;i?s=i:(t&&this.queryParam&&(s.indexOf("?")>-1?s+="&":s+="?",s+=this.queryParam+"="+encodeURIComponent(t)),e&&(s.indexOf("?")>-1?s+="&":s+="?",s+="page="+e));const r=this.lruCache.get(s);if(this.cache&&!this.tags&&r)return 0!==e||this.next?this.setVisibleOptions([...this.visibleOptions,...r.options]):(this.cursorIndex=0,this.setVisibleOptions([...o,...r.options])),this.complete=r.complete,this.next=r.next,void(this.fetching=!1);this.searchable&&!this.queryParam?Wt(s).then((t=>{t=this.prepareOptions(t),this.cache&&!this.tags&&(this.lruCache.set(s,{options:t,complete:!0,next:null}),this.complete=!0,this.next=null,this.setVisibleOptions([...o,...t]),this.fetching=!1)})):Vt(s).then((i=>{let r=this.getOptions(i).filter((t=>this.isMatch(t,n)));r=this.prepareOptions(r),this.next=null;const a=i.json;a.next&&(this.next=a.next),0!==e||this.next?(r.length>0&&this.setVisibleOptions([...this.visibleOptions,...r]),this.complete=this.isComplete(r,i)):(this.cursorIndex=0,this.setVisibleOptions([...o,...r]),this.query=t,this.complete=this.isComplete(this.visibleOptions,i)),this.cache&&!this.tags&&this.lruCache.set(s,{options:r,complete:this.complete,next:this.next}),this.fetching=!1,this.page=e})).catch((t=>{this.fetching=!1,console.error(t)}))}else this.fetching=!1,this.setVisibleOptions(o)}}handleFocus(){this.focused||0!==this.visibleOptions.length||(this.focused=!0)}handleBlur(){this.focused=!1,this.visibleOptions.length>0&&(this.input="",this.next=null,this.complete=!0,this.visibleOptions=[],this.cursorIndex=0)}handleClick(){this.selectedIndex=-1,this.requestUpdate("input")}addInputAsValue(){const t=this.shadowRoot.querySelector(".searchbox"),e={name:t.value,value:t.value,expression:!0};this.multi?this.values.find((t=>t.expression&&t.value&&e.value&&t.value.toLowerCase().trim()==e.value.toLowerCase().trim()))||this.addValue(e):this.setValues([e]),this.input="",this.multi||this.blur()}handleKeyDown(t){if("Enter"===t.key&&this.expressions&&0===this.completionOptions.length&&this.input.indexOf("@")>-1&&this.addInputAsValue(),("Enter"===t.key||"ArrowDown"===t.key||"n"===t.key&&t.ctrlKey)&&0===this.visibleOptions.length&&0===this.completionOptions.length)this.requestUpdate("input");else if(this.multi&&"Backspace"===t.key&&!this.input){if(this.visibleOptions.length>0)return void(this.visibleOptions=[]);-1===this.selectedIndex?(this.selectedIndex=this.values.length-1,this.visibleOptions=[]):(this.popValue(),this.selectedIndex=-1)}else this.selectedIndex=-1}getStaticOptions(){return this.staticOptions}handleInput(t){const e=t.currentTarget;this.input=e.value}handleCancel(){this.visibleOptions=[]}handleCursorChanged(t){this.cursorIndex=t.detail.index}handleContainerClick(t){if(t.stopPropagation(),t.preventDefault(),this.focused=!0,"INPUT"!==t.target.tagName){const t=this.shadowRoot.querySelector("input");if(t)return t.click(),void t.focus();this.visibleOptions.length>0?this.visibleOptions=[]:this.requestUpdate("input")}}getEventHandlers(){return[{event:$e.Canceled,method:this.handleCancel},{event:$e.CursorChanged,method:this.handleCursorChanged},{event:"blur",method:this.handleBlur},{event:"focus",method:this.handleFocus}]}handleArrowClick(t){this.isOpen()&&(t.preventDefault(),t.stopPropagation(),this.blur())}renderOptionDefault(t){if(!t)return null;const e=t.icon;return V`
918
+ `}constructor(){super(),this.hiddenInputs=[],this.inputStyle={},this.multi=!1,this.searchOnFocus=!1,this.placeholder="",this.name="",this.nameKey="name",this.valueKey="value",this.maxItems=0,this.maxItemsText="Maximum items reached",this.queryParam=null,this.input="",this.visibleOptions=[],this.completionOptions=[],this.quietMillis=0,this.searchable=!1,this.cache=!0,this.cacheKey="",this.focused=!1,this.disabled=!1,this.selectedIndex=-1,this.anchorPosition={left:0,top:0},this.tags=!1,this.flavor="default",this.infoText="",this.values=[],this.getName=t=>t[this.nameKey||"name"],this.isMatch=this.isMatchDefault,this.getValue=t=>t[this.valueKey||"value"]||t.id,this.sortFunction=null,this.renderOptionDetail=()=>V``,this.renderSelectedItem=this.renderSelectedItemDefault,this.createArbitraryOption=this.createArbitraryOptionDefault,this.getOptions=this.getOptionsDefault,this.prepareOptions=this.prepareOptionsDefault,this.isComplete=this.isCompleteDefault,this.staticOptions=[],this.allowAnchor=!0,this.alphaSort=(t,e)=>this.endpoint?this.getName(t).localeCompare(this.getName(e)):0,this.next=null,this.lruCache=Le(20,6e4),this.getNameInternal=t=>this.getName(t),this.renderOptionDefault=this.renderOptionDefault.bind(this),this.renderSelectedItemDefault=this.renderSelectedItemDefault.bind(this),this.prepareOptionsDefault=this.prepareOptionsDefault.bind(this),this.isMatchDefault=this.isMatchDefault.bind(this)}prepareOptionsDefault(t){return t}isMatchDefault(t,e){return(this.getName(t)||"").toLowerCase().indexOf(e)>-1}handleSlotChange(){if(this.staticOptions&&0===this.staticOptions.length)for(const t of this.children)if("TEMBA-OPTION"===t.tagName){const e={};for(const i of t.attributes)e[i.name]=i.value;if(e){let t=!1;void 0!==e.selected&&(delete e.selected,t=!0);const i=this.value||this.getAttribute("value");if(i){this.getValue(e)==i&&(t=!0)}this.staticOptions.push(e),t&&(this.multi?this.addValue(e):this.setValues([e]))}}this.searchable&&0===this.staticOptions.length&&(this.quietMillis=200)}checkSelectedOption(){if(this.value&&0==this.values.length&&0==this.staticOptions.length&&this.endpoint){const t=this.value;this.resolving=!0,Wt(this.endpoint).then((e=>{if(e&&e.length>0){if(t){const i=e.find((e=>this.getValue(e)===t));if(i)return this.resolving=!1,this.fetching=!1,void this.setValues([i])}this.setValues([e[0]]),this.resolving=!1}}))}else this.staticOptions.length>0&&(null!==this.getAttribute("multi")?this.addValue(this.staticOptions[0]):this.getAttribute("value")?this.setSelectedValue(this.getAttribute("value")):this.setValues([this.staticOptions[0]]))}firstUpdated(t){super.firstUpdated(t),this.anchorElement=this.shadowRoot.querySelector(".select-container"),this.anchorExpressions=this.shadowRoot.querySelector("#anchor"),this.shadowRoot.addEventListener("slotchange",this.handleSlotChange.bind(this))}updated(t){super.updated(t),t.has("sorted")&&(this.sortFunction=this.sorted?this.alphaSort:null),t.has("value")&&this.value&&!this.values.length&&this.setSelectedValue(this.value),t.has("values")&&(this.updateInputs(),this.hasChanges(t.get("values"))&&this.fireEvent("change")),t.has("cacheKey")&&this.lruCache.clear(),t.has("input")&&!t.has("values")&&!t.has("options")&&this.focused&&(this.lastQuery&&window.clearTimeout(this.lastQuery),this.lastQuery=window.setTimeout((()=>{this.expressions&&this.input.indexOf("@")>-1?this.fetchExpressions():this.fetchOptions(this.input)}),this.quietMillis)),this.endpoint&&t.has("fetching")&&(this.fetching||this.isPastFetchThreshold()||this.fireCustomEvent($e.FetchComplete)),(t.has("cursorIndex")||t.has("visibleOptions"))&&this.endpoint&&!this.fetching&&this.isPastFetchThreshold()&&(this.next?this.fetchOptions(null,null,this.next):this.fetchOptions(this.query,this.page+1)),0===this.values.length&&!this.placeholder&&this.staticOptions.length>0&&this.setValues([this.staticOptions[0]])}hasChanges(t){if(void 0===t)return!1;let e;void 0!==t&&(e=(t||[]).map((t=>this.getValue(t))).join(","));return e!==(this.values||[]).map((t=>this.getValue(t))).join(",")}setSelectedValue(t){if(this.staticOptions.length>0){const e=this.staticOptions.find((e=>this.getValue(e)===t));e&&this.setValues([e])}else this.checkSelectedOption()}updateInputs(){for(let t=null;t=this.hiddenInputs.pop();)t.remove();if(0===this.values.length)this.value=null;else{const t=this.getAttribute("name");t&&(this.multi||1!==this.values.length?this.inputRoot.parentElement&&this.values.forEach((e=>{const i=document.createElement("input");i.setAttribute("type","hidden"),i.setAttribute("name",t),i.setAttribute("value",this.serializeValue(e)),this.hiddenInputs.push(i),this.inputRoot.parentElement.appendChild(i)})):(this.selection=this.values[0],this.value=this.serializeValue(this.values[0])))}}setSelectedOption(t){this.multi?this.addValue(t):this.setValues([t]),this.multi&&this.searchable||(this.blur(),this.focused=!1),this.visibleOptions=[],this.input="",this.next=null,this.complete=!0,this.selectedIndex=-1}isPastFetchThreshold(){return(this.visibleOptions.length>0||this.next)&&!this.complete&&(this.cursorIndex||0)>this.visibleOptions.length-20}handleOptionSelection(t){if(this.multi&&this.maxItems>0&&this.values.length>=this.maxItems)return void(this.infoText=this.maxItemsText);this.infoText="";const e=t.detail.selected;e.post&&this.endpoint?Qt(this.endpoint,e).then((t=>{t.status>=200&&t.status<300?(this.setSelectedOption(t.json),this.lruCache=Le(20,6e4)):this.blur()})):this.setSelectedOption(e)}handleExpressionSelection(t){const e=t.detail.selected,i=t.detail.tabbed,o=this.shadowRoot.querySelector(".searchbox");cl(this.query,o,e),this.query="",this.completionOptions=[],i?this.fetchExpressions():-1===this.input.indexOf("(")&&this.addInputAsValue()}getOptionsDefault(t){return t.json.results}isCompleteDefault(t,e){const i=e.json;return!i.more&&!i.next}handleRemoveSelection(t){this.removeValue(t),this.visibleOptions=[]}createArbitraryOptionDefault(){return null}open(){this.shadowRoot.querySelector(".select-container").click()}isOpen(){return this.visibleOptions.length>0}setOptions(t){this.staticOptions=t}setVisibleOptions(t){if(t=t.filter((t=>!!this.getNameInternal(t)&&(!this.shouldExclude||!this.shouldExclude(t)))),this.input){if(this.searchable&&!this.queryParam){const e=this.input.trim().toLowerCase();t=t.filter((t=>this.isMatch(t,e)))}const e=this.createArbitraryOption(this.input,t);if(e){e.arbitrary=!0;t.find((t=>this.getValue(t)===this.getValue(e)))||(t.length>0&&t[0].arbitrary?t[0]=e:t.unshift(e))}}this.values.length>0&&(this.multi?t=t.filter((t=>!this.values.find((e=>this.getValue(e)===this.getValue(t))))):(this.input?this.cursorIndex=0:this.cursorIndex=t.findIndex((t=>this.getValue(t)===this.getValue(this.values[0]))),this.requestUpdate("cursorIndex"))),this.multi&&this.maxItems>0&&this.values.length>=this.maxItems&&(t=[],this.infoText=this.maxItemsText),this.sortFunction&&t.sort(this.sortFunction),this.visibleOptions=t,this.fireCustomEvent($e.ContentChanged,{options:this.visibleOptions})}fetchExpressions(){const t=document.querySelector("temba-store");if(this.expressions&&t){const e=this.shadowRoot.querySelector(".searchbox"),i=dl(e,t,"session"===this.expressions);return this.query=i.query,this.completionOptions=i.options,this.visibleOptions=[],this.anchorPosition=i.anchorPosition,void this.fireCustomEvent($e.FetchComplete)}}fetchOptions(t,e=0,i=null){if(this.completionOptions=[],!this.fetching){this.fetching=!0;const o=[...this.staticOptions],n=(t||"").trim().toLowerCase();if(this.tags&&n&&(o.find((t=>this.getValue(t)&&this.getValue(t).toLowerCase()===n))||o.splice(0,0,{name:t,value:t})),this.endpoint){let s=this.endpoint;i?s=i:(t&&this.queryParam&&(s.indexOf("?")>-1?s+="&":s+="?",s+=this.queryParam+"="+encodeURIComponent(t)),e&&(s.indexOf("?")>-1?s+="&":s+="?",s+="page="+e));const r=this.lruCache.get(s);if(this.cache&&!this.tags&&r)return 0!==e||this.next?this.setVisibleOptions([...this.visibleOptions,...r.options]):(this.cursorIndex=0,this.setVisibleOptions([...o,...r.options])),this.complete=r.complete,this.next=r.next,void(this.fetching=!1);this.searchable&&!this.queryParam?Wt(s).then((t=>{t=this.prepareOptions(t),this.cache&&!this.tags&&(this.lruCache.set(s,{options:t,complete:!0,next:null}),this.complete=!0,this.next=null,this.setVisibleOptions([...o,...t]),this.fetching=!1)})):Vt(s).then((i=>{let r=this.getOptions(i).filter((t=>this.isMatch(t,n)));r=this.prepareOptions(r),this.next=null;const a=i.json;a.next&&(this.next=a.next),0!==e||this.next?(r.length>0&&this.setVisibleOptions([...this.visibleOptions,...r]),this.complete=this.isComplete(r,i)):(this.cursorIndex=0,this.setVisibleOptions([...o,...r]),this.query=t,this.complete=this.isComplete(this.visibleOptions,i)),this.cache&&!this.tags&&this.lruCache.set(s,{options:r,complete:this.complete,next:this.next}),this.fetching=!1,this.page=e})).catch((t=>{this.fetching=!1,console.error(t)}))}else this.fetching=!1,this.setVisibleOptions(o)}}handleFocus(){this.focused||0!==this.visibleOptions.length||(this.focused=!0)}handleBlur(){this.focused=!1,this.visibleOptions.length>0&&(this.input="",this.next=null,this.complete=!0,this.visibleOptions=[],this.cursorIndex=0),this.multi&&this.maxItems>0&&this.values.length>=this.maxItems&&(this.infoText="")}handleClick(){this.selectedIndex=-1,this.requestUpdate("input")}addInputAsValue(){const t=this.shadowRoot.querySelector(".searchbox"),e={name:t.value,value:t.value,expression:!0};this.multi?this.values.find((t=>t.expression&&t.value&&e.value&&t.value.toLowerCase().trim()==e.value.toLowerCase().trim()))||this.addValue(e):this.setValues([e]),this.input="",this.multi||this.blur()}handleKeyDown(t){if("Enter"===t.key&&this.expressions&&0===this.completionOptions.length&&this.input.indexOf("@")>-1&&this.addInputAsValue(),("Enter"===t.key||"ArrowDown"===t.key||"n"===t.key&&t.ctrlKey)&&0===this.visibleOptions.length&&0===this.completionOptions.length)this.requestUpdate("input");else if(this.multi&&"Backspace"===t.key&&!this.input){if(this.visibleOptions.length>0)return void(this.visibleOptions=[]);-1===this.selectedIndex?(this.selectedIndex=this.values.length-1,this.visibleOptions=[]):(this.popValue(),this.selectedIndex=-1)}else this.selectedIndex=-1}getStaticOptions(){return this.staticOptions}handleInput(t){const e=t.currentTarget;this.input=e.value}handleCancel(){this.visibleOptions=[]}handleCursorChanged(t){this.cursorIndex=t.detail.index}handleContainerClick(t){if(t.stopPropagation(),t.preventDefault(),this.focused=!0,"INPUT"!==t.target.tagName){const t=this.shadowRoot.querySelector("input");if(t)return t.click(),void t.focus();this.visibleOptions.length>0?this.visibleOptions=[]:this.requestUpdate("input")}}getEventHandlers(){return[{event:$e.Canceled,method:this.handleCancel},{event:$e.CursorChanged,method:this.handleCursorChanged},{event:"blur",method:this.handleBlur},{event:"focus",method:this.handleFocus}]}handleArrowClick(t){this.isOpen()&&(t.preventDefault(),t.stopPropagation(),this.blur())}renderOptionDefault(t){if(!t)return null;const e=t.icon;return V`
919
919
  <div class="option-name" style="display:flex">
920
920
  ${e?V`<temba-icon
921
921
  name="${e}"
922
922
  style="margin-right:0.5em;"
923
923
  ></temba-icon>`:null}<span>${this.getName(t)}</span>
924
924
  </div>
925
- `}renderSelectedItemDefault(t){return(this.renderOption||this.renderOptionDefault)(t,!0)}serializeValue(t){return!this.jsonValue&&(this.staticOptions.length>0||this.tags)?t.value:super.serializeValue(t)}setSelection(t){for(const e of this.staticOptions)if(this.getValue(e)===t)return void(0!==this.values.length&&this.values[0].value==""+t||this.setValues([e]))}handleClear(t){t.preventDefault(),t.stopPropagation(),this.setValues([]),this.visibleOptions.length>0&&(this.visibleOptions=[],this.requestUpdate()),this.fireCustomEvent($e.Selection,{selected:null})}setValues(t){const e=this.values;this.values=t,this.requestUpdate("values",e)}addValue(t){const e=[...this.values];this.values.push(t),this.requestUpdate("values",e)}removeValue(t){const e=[...this.values],i=this.values.indexOf(t);i>-1&&this.values.splice(i,1),this.requestUpdate("values",e)}popValue(){const t=[...this.values];this.values.pop(),this.requestUpdate("values",t)}clear(){const t=this.values;this.values=[],this.requestUpdate("values",t)}render(){const t=0===this.values.length?this.placeholder:"",e=V`
925
+ `}renderSelectedItemDefault(t){return(this.renderOption||this.renderOptionDefault)(t,!0)}serializeValue(t){return!this.jsonValue&&(this.staticOptions.length>0||this.tags)?t.value:super.serializeValue(t)}setSelection(t){for(const e of this.staticOptions)if(this.getValue(e)===t)return void(0!==this.values.length&&this.values[0].value==""+t||this.setValues([e]))}handleClear(t){t.preventDefault(),t.stopPropagation(),this.setValues([]),this.visibleOptions.length>0&&(this.visibleOptions=[],this.requestUpdate()),this.fireCustomEvent($e.Selection,{selected:null})}setValues(t){const e=this.values;this.values=t,this.requestUpdate("values",e)}addValue(t){const e=[...this.values];this.values.push(t),this.requestUpdate("values",e)}removeValue(t){const e=[...this.values],i=this.values.indexOf(t);i>-1&&this.values.splice(i,1),this.requestUpdate("values",e),this.infoText=""}popValue(){const t=[...this.values];this.values.pop(),this.requestUpdate("values",t),this.infoText=""}clear(){const t=this.values;this.values=[],this.requestUpdate("values",t)}render(){const t=0===this.values.length?this.placeholder:"",e=V`
926
926
  <div class="placeholder">${t}</div>
927
927
  `,i=this.clearable&&this.values.length>0&&!this.multi?V`<temba-icon
928
928
  name="${ge.select_clear}"
@@ -1047,7 +1047,7 @@ let fr=Ks,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
1047
1047
  </div>`:null}
1048
1048
  </temba-options>
1049
1049
  </temba-field>
1050
- `}}t([ce({type:Object})],ul.prototype,"inputStyle",void 0),t([ce({type:Boolean})],ul.prototype,"multi",void 0),t([ce({type:Boolean})],ul.prototype,"searchOnFocus",void 0),t([ce({type:String})],ul.prototype,"placeholder",void 0),t([ce()],ul.prototype,"name",void 0),t([ce()],ul.prototype,"endpoint",void 0),t([ce({type:String})],ul.prototype,"nameKey",void 0),t([ce({type:String})],ul.prototype,"valueKey",void 0),t([ce({attribute:!1})],ul.prototype,"currentFunction",void 0),t([ce({type:String})],ul.prototype,"queryParam",void 0),t([ce({type:String})],ul.prototype,"input",void 0),t([ce({type:Array})],ul.prototype,"visibleOptions",void 0),t([ce({type:Array})],ul.prototype,"completionOptions",void 0),t([ce({type:Number})],ul.prototype,"quietMillis",void 0),t([ce({type:Boolean})],ul.prototype,"fetching",void 0),t([ce({type:Boolean})],ul.prototype,"resolving",void 0),t([ce({type:Boolean})],ul.prototype,"searchable",void 0),t([ce({type:String})],ul.prototype,"expressions",void 0),t([ce({type:Boolean})],ul.prototype,"cache",void 0),t([ce({type:String})],ul.prototype,"cacheKey",void 0),t([ce({type:Boolean})],ul.prototype,"focused",void 0),t([ce({type:Boolean})],ul.prototype,"disabled",void 0),t([ce({attribute:!1})],ul.prototype,"selectedIndex",void 0),t([ce({type:Number})],ul.prototype,"cursorIndex",void 0),t([ce({attribute:!1})],ul.prototype,"anchorElement",void 0),t([ce({attribute:!1})],ul.prototype,"anchorExpressions",void 0),t([ce({type:Object})],ul.prototype,"anchorPosition",void 0),t([ce({type:Boolean})],ul.prototype,"tags",void 0),t([ce({type:Boolean,attribute:"space_select"})],ul.prototype,"spaceSelect",void 0),t([ce({type:Boolean})],ul.prototype,"jsonValue",void 0),t([ce({type:Boolean})],ul.prototype,"hideErrors",void 0),t([ce({type:Boolean})],ul.prototype,"clearable",void 0),t([ce({type:Boolean})],ul.prototype,"sorted",void 0),t([ce({type:String})],ul.prototype,"flavor",void 0),t([ce({type:String,attribute:"info_text"})],ul.prototype,"infoText",void 0),t([ce({type:Array})],ul.prototype,"values",void 0),t([ce({type:Object})],ul.prototype,"selection",void 0),t([ce({attribute:!1})],ul.prototype,"getName",void 0),t([ce({attribute:!1})],ul.prototype,"isMatch",void 0),t([ce({attribute:!1})],ul.prototype,"getValue",void 0),t([ce({type:Number,attribute:"option-width"})],ul.prototype,"optionWidth",void 0),t([ce({type:Boolean,attribute:"anchor-right"})],ul.prototype,"anchorRight",void 0),t([ce({attribute:!1})],ul.prototype,"shouldExclude",void 0),t([ce({attribute:!1})],ul.prototype,"sortFunction",void 0),t([ce({attribute:!1})],ul.prototype,"renderOption",void 0),t([ce({attribute:!1})],ul.prototype,"renderOptionName",void 0),t([ce({attribute:!1})],ul.prototype,"renderOptionDetail",void 0),t([ce({attribute:!1})],ul.prototype,"renderSelectedItem",void 0),t([ce({attribute:!1})],ul.prototype,"createArbitraryOption",void 0),t([ce({attribute:!1})],ul.prototype,"getOptions",void 0),t([ce({attribute:!1})],ul.prototype,"prepareOptions",void 0),t([ce({attribute:!1})],ul.prototype,"isComplete",void 0),t([ce({type:Array,attribute:"options"})],ul.prototype,"staticOptions",void 0),t([ce({type:Boolean})],ul.prototype,"allowAnchor",void 0);class pl extends me{constructor(){super(...arguments),this.submitOnEnter=!1,this.anchorPosition={left:0,top:0},this.placeholder="",this.options=[],this.name="",this.value="",this.autogrow=!1}static get styles(){return r`
1050
+ `}}t([ce({type:Object})],ul.prototype,"inputStyle",void 0),t([ce({type:Boolean})],ul.prototype,"multi",void 0),t([ce({type:Boolean})],ul.prototype,"searchOnFocus",void 0),t([ce({type:String})],ul.prototype,"placeholder",void 0),t([ce()],ul.prototype,"name",void 0),t([ce()],ul.prototype,"endpoint",void 0),t([ce({type:String})],ul.prototype,"nameKey",void 0),t([ce({type:String})],ul.prototype,"valueKey",void 0),t([ce({type:Number})],ul.prototype,"maxItems",void 0),t([ce({type:String})],ul.prototype,"maxItemsText",void 0),t([ce({attribute:!1})],ul.prototype,"currentFunction",void 0),t([ce({type:String})],ul.prototype,"queryParam",void 0),t([ce({type:String})],ul.prototype,"input",void 0),t([ce({type:Array})],ul.prototype,"visibleOptions",void 0),t([ce({type:Array})],ul.prototype,"completionOptions",void 0),t([ce({type:Number})],ul.prototype,"quietMillis",void 0),t([ce({type:Boolean})],ul.prototype,"fetching",void 0),t([ce({type:Boolean})],ul.prototype,"resolving",void 0),t([ce({type:Boolean})],ul.prototype,"searchable",void 0),t([ce({type:String})],ul.prototype,"expressions",void 0),t([ce({type:Boolean})],ul.prototype,"cache",void 0),t([ce({type:String})],ul.prototype,"cacheKey",void 0),t([ce({type:Boolean})],ul.prototype,"focused",void 0),t([ce({type:Boolean})],ul.prototype,"disabled",void 0),t([ce({attribute:!1})],ul.prototype,"selectedIndex",void 0),t([ce({type:Number})],ul.prototype,"cursorIndex",void 0),t([ce({attribute:!1})],ul.prototype,"anchorElement",void 0),t([ce({attribute:!1})],ul.prototype,"anchorExpressions",void 0),t([ce({type:Object})],ul.prototype,"anchorPosition",void 0),t([ce({type:Boolean})],ul.prototype,"tags",void 0),t([ce({type:Boolean,attribute:"space_select"})],ul.prototype,"spaceSelect",void 0),t([ce({type:Boolean})],ul.prototype,"jsonValue",void 0),t([ce({type:Boolean})],ul.prototype,"hideErrors",void 0),t([ce({type:Boolean})],ul.prototype,"clearable",void 0),t([ce({type:Boolean})],ul.prototype,"sorted",void 0),t([ce({type:String})],ul.prototype,"flavor",void 0),t([ce({type:String,attribute:"info_text"})],ul.prototype,"infoText",void 0),t([ce({type:Array})],ul.prototype,"values",void 0),t([ce({type:Object})],ul.prototype,"selection",void 0),t([ce({attribute:!1})],ul.prototype,"getName",void 0),t([ce({attribute:!1})],ul.prototype,"isMatch",void 0),t([ce({attribute:!1})],ul.prototype,"getValue",void 0),t([ce({type:Number,attribute:"option-width"})],ul.prototype,"optionWidth",void 0),t([ce({type:Boolean,attribute:"anchor-right"})],ul.prototype,"anchorRight",void 0),t([ce({attribute:!1})],ul.prototype,"shouldExclude",void 0),t([ce({attribute:!1})],ul.prototype,"sortFunction",void 0),t([ce({attribute:!1})],ul.prototype,"renderOption",void 0),t([ce({attribute:!1})],ul.prototype,"renderOptionName",void 0),t([ce({attribute:!1})],ul.prototype,"renderOptionDetail",void 0),t([ce({attribute:!1})],ul.prototype,"renderSelectedItem",void 0),t([ce({attribute:!1})],ul.prototype,"createArbitraryOption",void 0),t([ce({attribute:!1})],ul.prototype,"getOptions",void 0),t([ce({attribute:!1})],ul.prototype,"prepareOptions",void 0),t([ce({attribute:!1})],ul.prototype,"isComplete",void 0),t([ce({type:Array,attribute:"options"})],ul.prototype,"staticOptions",void 0),t([ce({type:Boolean})],ul.prototype,"allowAnchor",void 0);class pl extends me{constructor(){super(...arguments),this.submitOnEnter=!1,this.anchorPosition={left:0,top:0},this.placeholder="",this.options=[],this.name="",this.value="",this.autogrow=!1}static get styles(){return r`
1051
1051
  :host {
1052
1052
  display: block;
1053
1053
  }
@@ -3293,7 +3293,7 @@ let fr=Ks,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
3293
3293
  class="${Zt({sheet:""===this.src,[this.animateChange]:!!this.animateChange,[this.animateChange+"-"+this.animationStep]:this.animationStep>0,[this.animateClick]:!!this.animateClick,[this.animateClick+"-"+this.animationStep]:this.animationStep>0})}"
3294
3294
  >
3295
3295
  <use
3296
- href="${this.src?this.src:`${this.prefix||window.static_url||"/static/"}svg/index.svg?v=8bdaba6d3a9e0a4e52fa01f31ac86eac#${t}`}"
3296
+ href="${this.src?this.src:`${this.prefix||window.static_url||"/static/"}svg/index.svg?v=fdc002188459c72f93a899ac53dcffa9#${t}`}"
3297
3297
  />
3298
3298
  </svg>
3299
3299
  </div>
@@ -6256,11 +6256,7 @@ let fr=Ks,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
6256
6256
  temba-shortcuts {
6257
6257
  flex-grow: 1;
6258
6258
  }
6259
-
6260
- .quick-replies {
6261
- background: #f9f9f9;
6262
- }
6263
- `}constructor(){super(),this.index=1,this.maxAttachments=3,this.maxLength=640,this.currentText="",this.initialText="",this.accept="",this.endpoint=Rt,this.languages=[],this.currentAttachments=[],this.currentQuickReplies=[],this.currentOptin=[],this.variables=[],this.optinEndpoint="/api/v2/optins.json",this.templateEndpoint="/api/internal/templates.json",this.empty=!0,this.langValues={},this.currentLanguage="und",this.hasPendingText=!1}isBaseLanguage(){return"und"==this.currentLanguage||this.currentLanguage==this.languages[0].iso}handleTabChanged(){const t=this.shadowRoot.querySelector("temba-tabs");if(this.currentTab=t.getCurrentTab(),this.currentTab&&"Shortcuts"===this.currentTab.name){this.shadowRoot.querySelector("temba-shortcuts").filter=""}this.setFocusOnChatbox()}firstUpdated(t){var e,i;super.firstUpdated(t),t.has("languages")&&this.languages.length>0&&(this.currentLanguage=this.languages[0].iso),t.has("value")&&(this.langValues=this.getDeserializedValue()||{},this.variables=(null===(e=this.langValues[this.currentLanguage])||void 0===e?void 0:e.variables)||[],this.template=(null===(i=this.langValues[this.currentLanguage])||void 0===i?void 0:i.template)||null),this.setFocusOnChatbox()}updated(t){if(super.updated(t),t.has("currentLanguage")&&this.langValues){let t={text:"",attachments:[],quick_replies:[]};this.currentLanguage in this.langValues&&(t=this.langValues[this.currentLanguage]),this.currentText=t.text,this.initialText=t.text,this.currentAttachments=t.attachments,this.currentQuickReplies=(t.quick_replies||[]).map((t=>({name:t,value:t}))),this.currentOptin=t.optin?[t.optin]:[],this.setFocusOnChatbox();const e=this.shadowRoot.querySelector(".chatbox");e&&(e.value=this.initialText),this.resetTabs(),this.requestUpdate("currentAttachments")}if(this.langValues&&(t.has("currentText")||t.has("currentAttachments")||t.has("currentQuickReplies"))||t.has("currentOptin")||t.has("currentTemplate")||t.has("variables")){this.checkIfEmpty();const t=this.currentText?this.currentText.trim():"";t||(this.currentAttachments||[]).length>0||this.currentQuickReplies.length>0||this.variables.length>0?this.langValues[this.currentLanguage]={text:t,attachments:this.currentAttachments,quick_replies:this.currentQuickReplies.map((t=>t.value)),optin:this.currentOptin.length>0?this.currentOptin[0]:null,template:this.currentTemplate?this.currentTemplate.uuid:null,variables:this.variables,locale:this.locale}:delete this.langValues[this.currentLanguage],this.fireCustomEvent($e.ContentChanged,this.langValues),this.requestUpdate("langValues"),this.setValue(this.langValues)}}handleAttachmentsChanged(t){const e=t.target;this.currentAttachments=e.attachments,this.requestUpdate()}setFocusOnChatbox(){const t=this.shadowRoot.querySelector(".chatbox");t&&window.setTimeout((()=>{t.focus()}),0)}reset(){const t=this.shadowRoot.querySelector(".chatbox");t&&(t.textInputElement.value="",t.value="",this.initialText="",this.currentText="",this.currentQuickReplies=[],this.currentAttachments=[],this.resetTabs())}handleQuickReplyChange(){this.requestUpdate("currentQuickReplies")}handleOptInChange(t){this.currentOptin=t.target.values,this.requestUpdate("optIn")}handleChatboxChange(t){const e=t.target.getTextInput().inputElement;this.currentText=e.value,this.hasPendingText=e.value.length>0;const i=e.selectionStart,o=e.value,n=o.lastIndexOf("\n",i-1)+1,s=o.substring(n,i);if(s.startsWith("/")){"Shortcuts"!==this.currentTab.name&&this.getTabs().focusTab("Shortcuts");this.shadowRoot.querySelector("temba-shortcuts").filter=s.substring(1)}}checkIfEmpty(){const t=0===this.currentText.trim().length,e=0===this.currentAttachments.length;this.attachments?this.empty=t&&e:this.empty=t}getCurrentLine(){const t=this.shadowRoot.querySelector(".chatbox"),e=t.getTextInput().inputElement.selectionStart-1,i=t.value.substring(0,e).lastIndexOf("\n")+1;let o=t.value.indexOf("\n",i);return-1===o&&(o=t.value.length),{text:t.value.substring(i,o),index:i}}handleKeyDown(t){const e=this.shadowRoot.querySelector("temba-tabs"),i=parseInt(t.key);if(!Number.isNaN(i)&&i>0&&t.ctrlKey&&t.metaKey&&i<=e.options.length&&(e.index=i-1),"Backspace"===t.key){"/"===this.getCurrentLine().text&&e.focusTab("Reply")}if(("Shortcuts"!==this.currentTab.name||"Enter"!==t.key||t.shiftKey)&&"Enter"===t.key&&!t.shiftKey)if(t.preventDefault(),this.completion){t.target.hasVisibleOptions()||this.triggerSend()}else this.triggerSend()}triggerSend(){this.empty||this.fireCustomEvent($e.Submitted,{langValues:this.langValues})}handleLanguageChange(t){const e=t.target;this.currentLanguage=e.values[0].iso}resetTabs(){this.getTabs().focusTab("Reply")}getTabs(){return this.shadowRoot.querySelector("temba-tabs")}render(){return V`
6259
+ `}constructor(){super(),this.index=1,this.maxAttachments=3,this.maxLength=640,this.maxQuickReplies=10,this.currentText="",this.initialText="",this.accept="",this.endpoint=Rt,this.languages=[],this.currentAttachments=[],this.currentQuickReplies=[],this.currentOptin=[],this.variables=[],this.optinEndpoint="/api/v2/optins.json",this.templateEndpoint="/api/internal/templates.json",this.empty=!0,this.langValues={},this.currentLanguage="und",this.hasPendingText=!1}isBaseLanguage(){return"und"==this.currentLanguage||this.currentLanguage==this.languages[0].iso}handleTabChanged(){const t=this.shadowRoot.querySelector("temba-tabs");if(this.currentTab=t.getCurrentTab(),this.currentTab&&"Shortcuts"===this.currentTab.name){this.shadowRoot.querySelector("temba-shortcuts").filter=""}this.setFocusOnChatbox()}firstUpdated(t){var e,i;super.firstUpdated(t),t.has("languages")&&this.languages.length>0&&(this.currentLanguage=this.languages[0].iso),t.has("value")&&(this.langValues=this.getDeserializedValue()||{},this.variables=(null===(e=this.langValues[this.currentLanguage])||void 0===e?void 0:e.variables)||[],this.template=(null===(i=this.langValues[this.currentLanguage])||void 0===i?void 0:i.template)||null),this.setFocusOnChatbox()}updated(t){if(super.updated(t),t.has("currentLanguage")&&this.langValues){let t={text:"",attachments:[],quick_replies:[]};this.currentLanguage in this.langValues&&(t=this.langValues[this.currentLanguage]),this.currentText=t.text,this.initialText=t.text,this.currentAttachments=t.attachments,this.currentQuickReplies=(t.quick_replies||[]).map((t=>({name:t,value:t}))),this.currentOptin=t.optin?[t.optin]:[],this.setFocusOnChatbox();const e=this.shadowRoot.querySelector(".chatbox");e&&(e.value=this.initialText),this.resetTabs(),this.requestUpdate("currentAttachments")}if(this.langValues&&(t.has("currentText")||t.has("currentAttachments")||t.has("currentQuickReplies"))||t.has("currentOptin")||t.has("currentTemplate")||t.has("variables")){this.checkIfEmpty();const t=this.currentText?this.currentText.trim():"";t||(this.currentAttachments||[]).length>0||this.currentQuickReplies.length>0||this.variables.length>0?this.langValues[this.currentLanguage]={text:t,attachments:this.currentAttachments,quick_replies:this.currentQuickReplies.map((t=>t.value)),optin:this.currentOptin.length>0?this.currentOptin[0]:null,template:this.currentTemplate?this.currentTemplate.uuid:null,variables:this.variables,locale:this.locale}:delete this.langValues[this.currentLanguage],this.fireCustomEvent($e.ContentChanged,this.langValues),this.requestUpdate("langValues"),this.setValue(this.langValues)}}handleAttachmentsChanged(t){const e=t.target;this.currentAttachments=e.attachments,this.requestUpdate()}setFocusOnChatbox(){const t=this.shadowRoot.querySelector(".chatbox");t&&window.setTimeout((()=>{t.focus()}),0)}reset(){const t=this.shadowRoot.querySelector(".chatbox");t&&(t.textInputElement.value="",t.value="",this.initialText="",this.currentText="",this.currentQuickReplies=[],this.currentAttachments=[],this.resetTabs())}handleQuickReplyChange(){this.requestUpdate("currentQuickReplies")}handleOptInChange(t){this.currentOptin=t.target.values,this.requestUpdate("optIn")}handleChatboxChange(t){const e=t.target.getTextInput().inputElement;this.currentText=e.value,this.hasPendingText=e.value.length>0;const i=e.selectionStart,o=e.value,n=o.lastIndexOf("\n",i-1)+1,s=o.substring(n,i);if(s.startsWith("/")){"Shortcuts"!==this.currentTab.name&&this.getTabs().focusTab("Shortcuts");this.shadowRoot.querySelector("temba-shortcuts").filter=s.substring(1)}}checkIfEmpty(){const t=0===this.currentText.trim().length,e=0===this.currentAttachments.length;this.attachments?this.empty=t&&e:this.empty=t}getCurrentLine(){const t=this.shadowRoot.querySelector(".chatbox"),e=t.getTextInput().inputElement.selectionStart-1,i=t.value.substring(0,e).lastIndexOf("\n")+1;let o=t.value.indexOf("\n",i);return-1===o&&(o=t.value.length),{text:t.value.substring(i,o),index:i}}handleKeyDown(t){const e=this.shadowRoot.querySelector("temba-tabs"),i=parseInt(t.key);if(!Number.isNaN(i)&&i>0&&t.ctrlKey&&t.metaKey&&i<=e.options.length&&(e.index=i-1),"Backspace"===t.key){"/"===this.getCurrentLine().text&&e.focusTab("Reply")}if(("Shortcuts"!==this.currentTab.name||"Enter"!==t.key||t.shiftKey)&&"Enter"===t.key&&!t.shiftKey)if(t.preventDefault(),this.completion){t.target.hasVisibleOptions()||this.triggerSend()}else this.triggerSend()}triggerSend(){this.empty||this.fireCustomEvent($e.Submitted,{langValues:this.langValues})}handleLanguageChange(t){const e=t.target;this.currentLanguage=e.values[0].iso}resetTabs(){this.getTabs().focusTab("Reply")}getTabs(){return this.shadowRoot.querySelector("temba-tabs")}render(){return V`
6264
6260
  <temba-field
6265
6261
  name=${this.name}
6266
6262
  .errors=${this.errors}
@@ -6313,9 +6309,10 @@ let fr=Ks,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
6313
6309
  .count=${this.currentQuickReplies.length}
6314
6310
  >
6315
6311
  <temba-select
6316
- class="quick-replies"
6317
6312
  @change=${this.handleQuickReplyChange}
6318
6313
  .values=${this.currentQuickReplies}
6314
+ maxItems=${this.maxQuickReplies}
6315
+ maxItemsText="You can only add ${this.maxQuickReplies} Quick Replies"
6319
6316
  class="quick-replies"
6320
6317
  tags
6321
6318
  multi
@@ -6407,7 +6404,7 @@ let fr=Ks,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
6407
6404
  </temba-tabs>
6408
6405
  `}getCounter(){return V`<temba-charcount
6409
6406
  .text="${this.currentText}"
6410
- ></temba-charcount>`}}t([ce({type:Number})],Qh.prototype,"index",void 0),t([ce({type:Number})],Qh.prototype,"maxAttachments",void 0),t([ce({type:Number})],Qh.prototype,"maxLength",void 0),t([ce({type:Boolean})],Qh.prototype,"completion",void 0),t([ce({type:Boolean})],Qh.prototype,"attachments",void 0),t([ce({type:Boolean})],Qh.prototype,"quickReplies",void 0),t([ce({type:Boolean})],Qh.prototype,"optIns",void 0),t([ce({type:Boolean})],Qh.prototype,"templates",void 0),t([ce({type:Boolean})],Qh.prototype,"counter",void 0),t([ce({type:Boolean})],Qh.prototype,"autogrow",void 0),t([ce({type:Boolean})],Qh.prototype,"shortcuts",void 0),t([ce({type:String})],Qh.prototype,"currentText",void 0),t([ce({type:String})],Qh.prototype,"initialText",void 0),t([ce({type:String})],Qh.prototype,"accept",void 0),t([ce({type:String,attribute:!1})],Qh.prototype,"endpoint",void 0),t([ce({type:Boolean,attribute:!1})],Qh.prototype,"uploading",void 0),t([ce({type:Array})],Qh.prototype,"languages",void 0),t([ce({type:Array})],Qh.prototype,"currentAttachments",void 0),t([ce({type:Array})],Qh.prototype,"currentQuickReplies",void 0),t([ce({type:Array})],Qh.prototype,"currentOptin",void 0),t([ce({type:Array})],Qh.prototype,"variables",void 0),t([ce({type:String})],Qh.prototype,"template",void 0),t([ce({type:Object})],Qh.prototype,"currentTemplate",void 0),t([ce({type:String})],Qh.prototype,"locale",void 0),t([ce({type:String})],Qh.prototype,"optinEndpoint",void 0),t([ce({type:String})],Qh.prototype,"templateEndpoint",void 0),t([ce({type:Boolean,attribute:!1})],Qh.prototype,"empty",void 0),t([ce({type:Boolean,attribute:"widget_only"})],Qh.prototype,"widgetOnly",void 0),t([ce({type:Array})],Qh.prototype,"errors",void 0),t([ce({type:Object})],Qh.prototype,"langValues",void 0),t([ce({type:String})],Qh.prototype,"currentLanguage",void 0),t([ce({type:Object})],Qh.prototype,"currentTab",void 0),t([ce({type:Boolean})],Qh.prototype,"hasPendingText",void 0),t([ce({type:Object})],Qh.prototype,"activeShortcut",void 0);class Jh extends pe{constructor(){super(...arguments),this.animationTime=300,this.show=!1,this.zoom=!1,this.zoomPct=.9,this.scale=1,this.xTrans=0,this.yTrans=0}static get styles(){return r`
6407
+ ></temba-charcount>`}}t([ce({type:Number})],Qh.prototype,"index",void 0),t([ce({type:Number})],Qh.prototype,"maxAttachments",void 0),t([ce({type:Number})],Qh.prototype,"maxLength",void 0),t([ce({type:Number})],Qh.prototype,"maxQuickReplies",void 0),t([ce({type:Boolean})],Qh.prototype,"completion",void 0),t([ce({type:Boolean})],Qh.prototype,"attachments",void 0),t([ce({type:Boolean})],Qh.prototype,"quickReplies",void 0),t([ce({type:Boolean})],Qh.prototype,"optIns",void 0),t([ce({type:Boolean})],Qh.prototype,"templates",void 0),t([ce({type:Boolean})],Qh.prototype,"counter",void 0),t([ce({type:Boolean})],Qh.prototype,"autogrow",void 0),t([ce({type:Boolean})],Qh.prototype,"shortcuts",void 0),t([ce({type:String})],Qh.prototype,"currentText",void 0),t([ce({type:String})],Qh.prototype,"initialText",void 0),t([ce({type:String})],Qh.prototype,"accept",void 0),t([ce({type:String,attribute:!1})],Qh.prototype,"endpoint",void 0),t([ce({type:Boolean,attribute:!1})],Qh.prototype,"uploading",void 0),t([ce({type:Array})],Qh.prototype,"languages",void 0),t([ce({type:Array})],Qh.prototype,"currentAttachments",void 0),t([ce({type:Array})],Qh.prototype,"currentQuickReplies",void 0),t([ce({type:Array})],Qh.prototype,"currentOptin",void 0),t([ce({type:Array})],Qh.prototype,"variables",void 0),t([ce({type:String})],Qh.prototype,"template",void 0),t([ce({type:Object})],Qh.prototype,"currentTemplate",void 0),t([ce({type:String})],Qh.prototype,"locale",void 0),t([ce({type:String})],Qh.prototype,"optinEndpoint",void 0),t([ce({type:String})],Qh.prototype,"templateEndpoint",void 0),t([ce({type:Boolean,attribute:!1})],Qh.prototype,"empty",void 0),t([ce({type:Boolean,attribute:"widget_only"})],Qh.prototype,"widgetOnly",void 0),t([ce({type:Array})],Qh.prototype,"errors",void 0),t([ce({type:Object})],Qh.prototype,"langValues",void 0),t([ce({type:String})],Qh.prototype,"currentLanguage",void 0),t([ce({type:Object})],Qh.prototype,"currentTab",void 0),t([ce({type:Boolean})],Qh.prototype,"hasPendingText",void 0),t([ce({type:Object})],Qh.prototype,"activeShortcut",void 0);class Jh extends pe{constructor(){super(...arguments),this.animationTime=300,this.show=!1,this.zoom=!1,this.zoomPct=.9,this.scale=1,this.xTrans=0,this.yTrans=0}static get styles(){return r`
6411
6408
  :host {
6412
6409
  z-index: 10000;
6413
6410
  position: absolute;