@snippyly/plugin-staging 1.0.922 → 1.0.924

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.
@@ -14,7 +14,7 @@
14
14
  * Copyright 2017 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- var w;m.finalized=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},null==p||p({ReactiveElement:m}),(null!==(d=globalThis.reactiveElementVersions)&&void 0!==d?d:globalThis.reactiveElementVersions=[]).push("1.3.2");const y=globalThis.trustedTypes,b=y?y.createPolicy("lit-html",{createHTML:t=>t}):void 0,C=`lit$${(Math.random()+"").slice(9)}$`,x="?"+C,E=`<${x}>`,k=document,S=(t="")=>k.createComment(t),M=t=>null===t||"object"!=typeof t&&"function"!=typeof t,A=Array.isArray,T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,I=/-->/g,_=/>/g,$=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,N=/'/g,O=/"/g,L=/^(?:script|style|textarea|title)$/i,R=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),D=Symbol.for("lit-noChange"),F=Symbol.for("lit-nothing"),P=new WeakMap,j=k.createTreeWalker(k,129,null,!1),V=(t,e)=>{const i=t.length-1,o=[];let n,r=2===e?"<svg>":"",s=T;for(let e=0;e<i;e++){const i=t[e];let a,l,c=-1,d=0;for(;d<i.length&&(s.lastIndex=d,l=s.exec(i),null!==l);)d=s.lastIndex,s===T?"!--"===l[1]?s=I:void 0!==l[1]?s=_:void 0!==l[2]?(L.test(l[2])&&(n=RegExp("</"+l[2],"g")),s=$):void 0!==l[3]&&(s=$):s===$?">"===l[0]?(s=null!=n?n:T,c=-1):void 0===l[1]?c=-2:(c=s.lastIndex-l[2].length,a=l[1],s=void 0===l[3]?$:'"'===l[3]?O:N):s===O||s===N?s=$:s===I||s===_?s=T:(s=$,n=void 0);const h=s===$&&t[e+1].startsWith("/>")?" ":"";r+=s===T?i+E:c>=0?(o.push(a),i.slice(0,c)+"$lit$"+i.slice(c)+C+h):i+C+(-2===c?(o.push(void 0),e):h)}const a=r+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==b?b.createHTML(a):a,o]};class U{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let n=0,r=0;const s=t.length-1,a=this.parts,[l,c]=V(t,e);if(this.el=U.createElement(l,i),j.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=j.nextNode())&&a.length<s;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(C)){const i=c[r++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(C),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?W:"?"===e[1]?Z:"@"===e[1]?K:G})}else a.push({type:6,index:n})}for(const e of t)o.removeAttribute(e)}if(L.test(o.tagName)){const t=o.textContent.split(C),e=t.length-1;if(e>0){o.textContent=y?y.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],S()),j.nextNode(),a.push({type:2,index:++n});o.append(t[e],S())}}}else if(8===o.nodeType)if(o.data===x)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=o.data.indexOf(C,t+1));)a.push({type:7,index:n}),t+=C.length-1}n++}}static createElement(t,e){const i=k.createElement("template");return i.innerHTML=t,i}}function B(t,e,i=t,o){var n,r,s,a;if(e===D)return e;let l=void 0!==o?null===(n=i._$Cl)||void 0===n?void 0:n[o]:i._$Cu;const c=M(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==c&&(null===(r=null==l?void 0:l._$AO)||void 0===r||r.call(l,!1),void 0===c?l=void 0:(l=new c(t),l._$AT(t,i,o)),void 0!==o?(null!==(s=(a=i)._$Cl)&&void 0!==s?s:a._$Cl=[])[o]=l:i._$Cu=l),void 0!==l&&(e=B(t,l._$AS(t,e.values),l,o)),e}class z{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:o}=this._$AD,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:k).importNode(i,!0);j.currentNode=n;let r=j.nextNode(),s=0,a=0,l=o[0];for(;void 0!==l;){if(s===l.index){let e;2===l.type?e=new H(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new J(r,this,t)),this.v.push(e),l=o[++a]}s!==(null==l?void 0:l.index)&&(r=j.nextNode(),s++)}return n}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}let H=class t{constructor(t,e,i,o){var n;this.type=2,this._$AH=F,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cg=null===(n=null==o?void 0:o.isConnected)||void 0===n||n}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=B(this,t,e),M(t)?t===F||null==t||""===t?(this._$AH!==F&&this._$AR(),this._$AH=F):t!==this._$AH&&t!==D&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>{var e;return A(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.S(t):this.$(t)}M(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==F&&M(this._$AH)?this._$AA.nextSibling.data=t:this.k(k.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:o}=t,n="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=U.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.m(i);else{const t=new z(n,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=P.get(t.strings);return void 0===e&&P.set(t.strings,e=new U(t)),e}S(e){A(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let o,n=0;for(const r of e)n===i.length?i.push(o=new t(this.M(S()),this.M(S()),this,this.options)):o=i[n],o._$AI(r),n++;n<i.length&&(this._$AR(o&&o._$AB.nextSibling,n),i.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}},G=class{constructor(t,e,i,o,n){this.type=1,this._$AH=F,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=F}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const n=this.strings;let r=!1;if(void 0===n)t=B(this,t,e,0),r=!M(t)||t!==this._$AH&&t!==D,r&&(this._$AH=t);else{const o=t;let s,a;for(t=n[0],s=0;s<n.length-1;s++)a=B(this,o[i+s],e,s),a===D&&(a=this._$AH[s]),r||(r=!M(a)||a!==this._$AH[s]),a===F?t=F:t!==F&&(t+=(null!=a?a:"")+n[s+1]),this._$AH[s]=a}r&&!o&&this.C(t)}C(t){t===F?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}};class W extends G{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===F?void 0:t}}const q=y?y.emptyScript:"";let Z=class extends G{constructor(){super(...arguments),this.type=4}C(t){t&&t!==F?this.element.setAttribute(this.name,q):this.element.removeAttribute(this.name)}};class K extends G{constructor(t,e,i,o,n){super(t,e,i,o,n),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=B(this,t,e,0))&&void 0!==i?i:F)===D)return;const o=this._$AH,n=t===F&&o!==F||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,r=t!==F&&(o===F||n);n&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class J{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){B(this,t)}}const Y=window.litHtmlPolyfillSupport;
17
+ var w;m.finalized=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},null==p||p({ReactiveElement:m}),(null!==(d=globalThis.reactiveElementVersions)&&void 0!==d?d:globalThis.reactiveElementVersions=[]).push("1.3.2");const y=globalThis.trustedTypes,b=y?y.createPolicy("lit-html",{createHTML:t=>t}):void 0,C=`lit$${(Math.random()+"").slice(9)}$`,x="?"+C,E=`<${x}>`,k=document,S=(t="")=>k.createComment(t),A=t=>null===t||"object"!=typeof t&&"function"!=typeof t,M=Array.isArray,T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,I=/-->/g,_=/>/g,$=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,N=/'/g,O=/"/g,L=/^(?:script|style|textarea|title)$/i,R=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),D=Symbol.for("lit-noChange"),F=Symbol.for("lit-nothing"),P=new WeakMap,j=k.createTreeWalker(k,129,null,!1),V=(t,e)=>{const i=t.length-1,o=[];let n,r=2===e?"<svg>":"",s=T;for(let e=0;e<i;e++){const i=t[e];let a,l,c=-1,d=0;for(;d<i.length&&(s.lastIndex=d,l=s.exec(i),null!==l);)d=s.lastIndex,s===T?"!--"===l[1]?s=I:void 0!==l[1]?s=_:void 0!==l[2]?(L.test(l[2])&&(n=RegExp("</"+l[2],"g")),s=$):void 0!==l[3]&&(s=$):s===$?">"===l[0]?(s=null!=n?n:T,c=-1):void 0===l[1]?c=-2:(c=s.lastIndex-l[2].length,a=l[1],s=void 0===l[3]?$:'"'===l[3]?O:N):s===O||s===N?s=$:s===I||s===_?s=T:(s=$,n=void 0);const h=s===$&&t[e+1].startsWith("/>")?" ":"";r+=s===T?i+E:c>=0?(o.push(a),i.slice(0,c)+"$lit$"+i.slice(c)+C+h):i+C+(-2===c?(o.push(void 0),e):h)}const a=r+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==b?b.createHTML(a):a,o]};class U{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let n=0,r=0;const s=t.length-1,a=this.parts,[l,c]=V(t,e);if(this.el=U.createElement(l,i),j.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=j.nextNode())&&a.length<s;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(C)){const i=c[r++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(C),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?W:"?"===e[1]?Z:"@"===e[1]?K:G})}else a.push({type:6,index:n})}for(const e of t)o.removeAttribute(e)}if(L.test(o.tagName)){const t=o.textContent.split(C),e=t.length-1;if(e>0){o.textContent=y?y.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],S()),j.nextNode(),a.push({type:2,index:++n});o.append(t[e],S())}}}else if(8===o.nodeType)if(o.data===x)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=o.data.indexOf(C,t+1));)a.push({type:7,index:n}),t+=C.length-1}n++}}static createElement(t,e){const i=k.createElement("template");return i.innerHTML=t,i}}function B(t,e,i=t,o){var n,r,s,a;if(e===D)return e;let l=void 0!==o?null===(n=i._$Cl)||void 0===n?void 0:n[o]:i._$Cu;const c=A(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==c&&(null===(r=null==l?void 0:l._$AO)||void 0===r||r.call(l,!1),void 0===c?l=void 0:(l=new c(t),l._$AT(t,i,o)),void 0!==o?(null!==(s=(a=i)._$Cl)&&void 0!==s?s:a._$Cl=[])[o]=l:i._$Cu=l),void 0!==l&&(e=B(t,l._$AS(t,e.values),l,o)),e}class z{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:o}=this._$AD,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:k).importNode(i,!0);j.currentNode=n;let r=j.nextNode(),s=0,a=0,l=o[0];for(;void 0!==l;){if(s===l.index){let e;2===l.type?e=new H(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new J(r,this,t)),this.v.push(e),l=o[++a]}s!==(null==l?void 0:l.index)&&(r=j.nextNode(),s++)}return n}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}let H=class t{constructor(t,e,i,o){var n;this.type=2,this._$AH=F,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cg=null===(n=null==o?void 0:o.isConnected)||void 0===n||n}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=B(this,t,e),A(t)?t===F||null==t||""===t?(this._$AH!==F&&this._$AR(),this._$AH=F):t!==this._$AH&&t!==D&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>{var e;return M(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.S(t):this.$(t)}M(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==F&&A(this._$AH)?this._$AA.nextSibling.data=t:this.k(k.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:o}=t,n="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=U.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.m(i);else{const t=new z(n,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=P.get(t.strings);return void 0===e&&P.set(t.strings,e=new U(t)),e}S(e){M(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let o,n=0;for(const r of e)n===i.length?i.push(o=new t(this.M(S()),this.M(S()),this,this.options)):o=i[n],o._$AI(r),n++;n<i.length&&(this._$AR(o&&o._$AB.nextSibling,n),i.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}},G=class{constructor(t,e,i,o,n){this.type=1,this._$AH=F,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=F}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const n=this.strings;let r=!1;if(void 0===n)t=B(this,t,e,0),r=!A(t)||t!==this._$AH&&t!==D,r&&(this._$AH=t);else{const o=t;let s,a;for(t=n[0],s=0;s<n.length-1;s++)a=B(this,o[i+s],e,s),a===D&&(a=this._$AH[s]),r||(r=!A(a)||a!==this._$AH[s]),a===F?t=F:t!==F&&(t+=(null!=a?a:"")+n[s+1]),this._$AH[s]=a}r&&!o&&this.C(t)}C(t){t===F?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}};class W extends G{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===F?void 0:t}}const q=y?y.emptyScript:"";let Z=class extends G{constructor(){super(...arguments),this.type=4}C(t){t&&t!==F?this.element.setAttribute(this.name,q):this.element.removeAttribute(this.name)}};class K extends G{constructor(t,e,i,o,n){super(t,e,i,o,n),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=B(this,t,e,0))&&void 0!==i?i:F)===D)return;const o=this._$AH,n=t===F&&o!==F||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,r=t!==F&&(o===F||n);n&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class J{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){B(this,t)}}const Y=window.litHtmlPolyfillSupport;
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2017 Google LLC
@@ -68,7 +68,7 @@ const lt=1,ct=2,dt=t=>(...e)=>({_$litDirective$:t,values:e});class ht{constructo
68
68
  * @license
69
69
  * Copyright 2017 Google LLC
70
70
  * SPDX-License-Identifier: BSD-3-Clause
71
- */class pt extends ht{constructor(t){if(super(t),this.it=F,t.type!==ct)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===F||null==t)return this.ft=void 0,this.it=t;if(t===D)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.ft;this.it=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}pt.directiveName="unsafeHTML",pt.resultType=1;const vt=dt(pt);class gt{}gt.Events={GUEST_MODE_SIGN_IN_DIALOG_SHOWN:"guestModeSignInDialogShown",GUEST_MODE_NAME_DIALOG_SHOWN:"guestModeNameDialogShown",GUEST_MODE_SIGN_IN_BANNER_SHOWN:"guestModeSignInBannerShown",GUEST_MODE_SIGN_IN_BUTTON_CLICKED:"guestModeSignInButtonClicked",PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED:"passwordProtectedModalCloseButtonClicked",PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED:"passwordProtectedModalOpenButtonClicked",TOOLBAR_EXPANDED:"toolbarExpanded",TOOLBAR_COLLAPSED:"toolbarCollapsed",TOOLBAR_NOTIFICATION_CLICKED:"toolbarNotificationClicked",GUEST_MODE_SKIP_BUTTON_CLICKED:"guestModeSkipButtonClicked",GUEST_MODE_SIGN_IN_NUDGE_SHOWN:"guestModeSignInNudgeShown",GUEST_MODE_NAME_NUDGE_SHOWN:"guestModeNameNudgeShown",GUEST_MODE_SIGN_IN_CLICKED:"guestModeSignInClicked",GUEST_MODE_PRESENT:"guestModePresent",GUEST_MODE_NAME_ADDED:"guestModeNameAdded",REVIEW_PASSWORD_ADDED:"reviewPasswordAdded",REVIEW_PASSWORD_REJECTED:"reviewPasswordRejected",REVIEW_PASSWORD_ACCEPTED:"reviewPasswordAccepted",PRIVATE_MODE_ENABLED:"privateModeEnabled",PRIVATE_MODE_DISABLED:"privateModeDisabled",VISIBILITY_OPTIONS_ENABLED:"visibilityOptionsEnabled",VISIBILITY_OPTIONS_DISABLED:"visibilityOptionsDisabled",VIEW_PROJECT_CLICKED:"viewProjectClicked",REPORT_BUG_CLICKED:"reportBugClicked",REPORT_BUG_SUBMITTED:"reportBugSubmitted",OPEN_MOBILE_CLICKED:"openMobileClicked",EXIT_REVIEW_MODE_CLICKED:"exitReviewModeClicked",SIGNOUT_CLICKED:"signoutClicked",SIGNIN_CLICKED:"signinClicked",SIGN_IN_REQUIRED:"signInRequired",USER_EMAIL_NOT_WHITELISTED:"userEmailNotWhitelisted",DOMAIN_NOT_WHITELISTED:"domainNotWhitelisted",DUPLICATE_SCRIPT_INSTALLED:"duplicateScriptInstalled",TOOLBAR_DISABLED:"toolbarDisabled",INVITE_MODAL_OPENED:"inviteModalOpened",INVITE_SENT:"inviteSent",QUALITY_CHECK_RUN_TOOLBAR_CLICKED:"qualityCheckRunFromToolbarClicked",PROJECT_APPROVE_CLICKED:"projectApproveClicked",PROJECT_APPROVED:"projectApproved",PROJECT_APPROVE_FAILED:"projectApproveFailed",CLIENT_MODE_LOADED:"clientModeLoaded",CLIENT_REQUEST_ADDED:"clientRequestAdded",CLIENT_MODE_SIGN_IN_CLICKED:"clientModeSignInClicked",REQUEST_MODE_LOADED:"requestModeLoaded",REQUEST_ADDED:"requestAdded"};const ft="1.0.780",mt="6.0.34",wt="6.0.34",yt="Superflow Organization",bt=["v3ogId1G43AFHehEOewv","rNYzMJd13L27xtfipmSK","aU1MxKP0rca2UXwKi8bl"],Ct=["ockkGlKLaApkEOBShhbR"],xt="sfSidebarV2Enabled",Et="sfUseProxy",kt=["v3ogId1G43AFHehEOewv"],St=[],Mt="review",At="feedback",Tt="sembed",It="scommentmode",_t="sreadonly",$t="sagentcomments",Nt="spath",Ot="sonboarding",Lt="sf-onboarding-agent-status",Rt="sf-onboarding-ready",Dt="sf-onboarding-diagnostics-request",Ft="sf-onboarding-diagnostics",Pt=3e5,jt=["failed","systemError","error"],Vt={SDK_NOT_READY:"sdk-not-ready",SDK_RETURNED_NULL:"sdk-returned-null",FETCH_THREW:"fetch-threw"},Ut="sfOnboardingSidebarDismissed",Bt="Unknown Agent",zt=[{hostSuffix:"cloudfunctions.net",pathPrefix:"/previewproxy"},{hostSuffix:"api.velt.dev",pathPrefix:"/previewproxy"}],Ht=["superflow-preview.com","stg.superflow-preview.com"],Gt=/^[a-z2-7]+-[a-z2-7]{16}$/,Wt="sf-preview-navigate",qt="sfPageCommentsHidden",Zt="sreviewId",Kt="scommentId",Jt="snippyly-user",Yt="st",Qt="_sfut",Xt="_sfuc",te="_sfgut",ee="sfGuestMigrationRefused",ie="projectVersionKey",oe="projectVersion",ne="sversion",re="sprojectInstall",se="sflivedemo",ae="sffigmademo",le="sfTourCommentTooltip",ce="sfUserAdmin",de="sfGuestMode",he="sfPasswordProtected",ue="sfQueryParamsComments",pe="sfUsePageTitleAsLocationName",ve="sfPasswordIsValid",ge="sfPrivateMode",fe="organizationPrivate",me="sfGuestModeAllowSignIn",we="sfGuestUserModelOpened",ye="sfGuestUserNameUpdated",be="sfGuestUserBannerOpened",Ce="sfCustomerMetadata",xe="sfContentWarningSidebarOpen",Ee={LOADING:"loading",RUNNING:"running",FINDINGS:"findings",CLEAN:"clean",IDLE:"idle"},ke={QA_AGENTS:"QA Agents",LOADING:"Running QA Agents",RUNNING:"Running",RUNNING_SINGLE:"Running 1 QA Agent",FINDING_SINGLE:"1 Agent Finding",FINDINGS:"Agent Findings",NO_FINDINGS_FOUND:"No Findings"},Se="sfNativeScreenshotPermission",Me="sfSamlConfig",Ae=[{hostSuffix:"drive.usesuperflow.com",pathPrefix:"/"},{hostSuffix:"superflow-file-viewer-staging.web.app",pathPrefix:"/"},{hostSuffix:"app.usesuperflow.com",pathPrefix:"/drive"},{hostSuffix:"superflow-portal-v2-staging.firebaseapp.com",pathPrefix:"/drive"},{hostSuffix:"superflow-portal-v2-staging.web.app",pathPrefix:"/drive"},{hostSuffix:"superflow-portal-v2-prod.firebaseapp.com",pathPrefix:"/drive"},{hostSuffix:"superflow-portal-v2-prod.web.app",pathPrefix:"/drive"}],Te=["app.usesuperflow.com","superflow-portal-v2-staging.firebaseapp.com"],Ie="suggestion",_e={AGENT:"agent:",AGENT_TYPE_CUSTOM:"agentType:custom"},$e={SPELL_CHECK:"spell-check",BROKEN_LINKS:"broken-links",GRAMMAR_CHECK:"grammar-check"},Ne={VELT_ROOT:"velt-root",VELT_PRESENCE:"velt-presence",VELT_CURSOR:"velt-cursor",VELT_COMMENT_TOOL:"velt-comment-tool",VELT_COMMENTS:"velt-comments",SNIPPYLY_TEXT_HIGHLIGHT:"snippyly-text-highlight",VELT_COMMENTS_SIDEBAR_LEGACY:"velt-comments-sidebar",VELT_COMMENTS_SIDEBAR_V2:"velt-comments-sidebar-v2",VELT_HUDDLE:"velt-huddle",VELT_RECORDER_NOTES:"velt-recorder-notes",VELT_RECORDER_CONTROL_PANEL:"velt-recorder-control-panel",VELT_ARROWS:"velt-arrows",VELT_NOTIFICATIONS_HISTORY_PANEL:"velt-notifications-history-panel"},Oe={ENABLE_URL_NAVIGATION:"enable-url-navigation",URL_NAVIGATION:"url-navigation",CURRENT_LOCATION_SUFFIX:"current-location-suffix",SIDEBAR_BUTTON_COUNT_TYPE:"sidebar-button-count-type",CUSTOM_ACTIONS:"custom-actions"},Le="filter",Re={customBranding:{logo:{logoMark:{lightUrl:'\n\t\t\t\t<svg viewBox="0 0 49 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 8C8 3.58172 11.5817 0 16 0V0C20.4183 0 24 3.58172 24 8V16H16C11.5817 16 8 12.4183 8 8V8Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 29C0 22.3726 5.37258 17 12 17H24V29C24 35.6274 18.6274 41 12 41V41C5.37258 41 0 35.6274 0 29V29Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 19C25 12.3726 30.3726 7 37 7V7C43.6274 7 49 12.3726 49 19V19C49 25.6274 43.6274 31 37 31H25V19Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 32H33C37.4183 32 41 35.5817 41 40V40C41 44.4183 37.4183 48 33 48V48C28.5817 48 25 44.4183 25 40V32Z" fill="#0DCF82"/>\n\t\t\t\t</svg>\n\t\t\t\t',darkUrl:'\n\t\t\t\t<svg viewBox="0 0 49 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 8C8 3.58172 11.5817 0 16 0V0C20.4183 0 24 3.58172 24 8V16H16C11.5817 16 8 12.4183 8 8V8Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 29C0 22.3726 5.37258 17 12 17H24V29C24 35.6274 18.6274 41 12 41V41C5.37258 41 0 35.6274 0 29V29Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 19C25 12.3726 30.3726 7 37 7V7C43.6274 7 49 12.3726 49 19V19C49 25.6274 43.6274 31 37 31H25V19Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 32H33C37.4183 32 41 35.5817 41 40V40C41 44.4183 37.4183 48 33 48V48C28.5817 48 25 44.4183 25 40V32Z" fill="#0DCF82"/>\n\t\t\t\t</svg>\n\t\t\t\t'},wordMark:{lightUrl:'\n\t\t\t\t<svg width="257" height="65" viewBox="0 0 257 65" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 16C8 11.5817 11.5817 8 16 8V8C20.4183 8 24 11.5817 24 16V24H16C11.5817 24 8 20.4183 8 16V16Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 37C0 30.3726 5.37258 25 12 25H24V37C24 43.6274 18.6274 49 12 49V49C5.37258 49 0 43.6274 0 37V37Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 27C25 20.3726 30.3726 15 37 15V15C43.6274 15 49 20.3726 49 27V27C49 33.6274 43.6274 39 37 39H25V27Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 40H33C37.4183 40 41 43.5817 41 48V48C41 52.4183 37.4183 56 33 56V56C28.5817 56 25 52.4183 25 48V40Z" fill="#0DCF82"/>\n\t\t\t\t\t<path d="M73.4 46.28C71.4533 46.28 69.6933 45.9467 68.12 45.28C66.5733 44.6133 65.3467 43.6533 64.44 42.4C63.5333 41.1467 63.0667 39.6667 63.04 37.96H69.04C69.12 39.1067 69.52 40.0133 70.24 40.68C70.9867 41.3467 72 41.68 73.28 41.68C74.5867 41.68 75.6133 41.3733 76.36 40.76C77.1067 40.12 77.48 39.2933 77.48 38.28C77.48 37.4533 77.2267 36.7733 76.72 36.24C76.2133 35.7067 75.5733 35.2933 74.8 35C74.0533 34.68 73.0133 34.3333 71.68 33.96C69.8667 33.4267 68.3867 32.9067 67.24 32.4C66.12 31.8667 65.1467 31.08 64.32 30.04C63.52 28.9733 63.12 27.56 63.12 25.8C63.12 24.1467 63.5333 22.7067 64.36 21.48C65.1867 20.2533 66.3467 19.32 67.84 18.68C69.3333 18.0133 71.04 17.68 72.96 17.68C75.84 17.68 78.1733 18.3867 79.96 19.8C81.7733 21.1867 82.7733 23.1333 82.96 25.64H76.8C76.7467 24.68 76.3333 23.8933 75.56 23.28C74.8133 22.64 73.8133 22.32 72.56 22.32C71.4667 22.32 70.5867 22.6 69.92 23.16C69.28 23.72 68.96 24.5333 68.96 25.6C68.96 26.3467 69.2 26.9733 69.68 27.48C70.1867 27.96 70.8 28.36 71.52 28.68C72.2667 28.9733 73.3067 29.32 74.64 29.72C76.4533 30.2533 77.9333 30.7867 79.08 31.32C80.2267 31.8533 81.2133 32.6533 82.04 33.72C82.8667 34.7867 83.28 36.1867 83.28 37.92C83.28 39.4133 82.8933 40.8 82.12 42.08C81.3467 43.36 80.2133 44.3867 78.72 45.16C77.2267 45.9067 75.4533 46.28 73.4 46.28ZM107.855 23.84V46H102.215V43.2C101.495 44.16 100.548 44.92 99.375 45.48C98.2283 46.0133 96.975 46.28 95.615 46.28C93.8817 46.28 92.3483 45.92 91.015 45.2C89.6817 44.4533 88.6283 43.3733 87.855 41.96C87.1083 40.52 86.735 38.8133 86.735 36.84V23.84H92.335V36.04C92.335 37.8 92.775 39.16 93.655 40.12C94.535 41.0533 95.735 41.52 97.255 41.52C98.8017 41.52 100.015 41.0533 100.895 40.12C101.775 39.16 102.215 37.8 102.215 36.04V23.84H107.855ZM116.98 27.04C117.7 26.0267 118.687 25.1867 119.94 24.52C121.22 23.8267 122.674 23.48 124.3 23.48C126.194 23.48 127.9 23.9467 129.42 24.88C130.967 25.8133 132.18 27.1467 133.06 28.88C133.967 30.5867 134.42 32.5733 134.42 34.84C134.42 37.1067 133.967 39.12 133.06 40.88C132.18 42.6133 130.967 43.96 129.42 44.92C127.9 45.88 126.194 46.36 124.3 46.36C122.674 46.36 121.234 46.0267 119.98 45.36C118.754 44.6933 117.754 43.8533 116.98 42.84V56.56H111.38V23.84H116.98V27.04ZM128.7 34.84C128.7 33.5067 128.42 32.36 127.86 31.4C127.327 30.4133 126.607 29.6667 125.7 29.16C124.82 28.6533 123.86 28.4 122.82 28.4C121.807 28.4 120.847 28.6667 119.94 29.2C119.06 29.7067 118.34 30.4533 117.78 31.44C117.247 32.4267 116.98 33.5867 116.98 34.92C116.98 36.2533 117.247 37.4133 117.78 38.4C118.34 39.3867 119.06 40.1467 119.94 40.68C120.847 41.1867 121.807 41.44 122.82 41.44C123.86 41.44 124.82 41.1733 125.7 40.64C126.607 40.1067 127.327 39.3467 127.86 38.36C128.42 37.3733 128.7 36.2 128.7 34.84ZM158.29 34.44C158.29 35.24 158.236 35.96 158.13 36.6H141.93C142.063 38.2 142.623 39.4533 143.61 40.36C144.596 41.2667 145.81 41.72 147.25 41.72C149.33 41.72 150.81 40.8267 151.69 39.04H157.73C157.09 41.1733 155.863 42.9333 154.05 44.32C152.236 45.68 150.01 46.36 147.37 46.36C145.236 46.36 143.316 45.8933 141.61 44.96C139.93 44 138.61 42.6533 137.65 40.92C136.716 39.1867 136.25 37.1867 136.25 34.92C136.25 32.6267 136.716 30.6133 137.65 28.88C138.583 27.1467 139.89 25.8133 141.57 24.88C143.25 23.9467 145.183 23.48 147.37 23.48C149.476 23.48 151.356 23.9333 153.01 24.84C154.69 25.7467 155.983 27.04 156.89 28.72C157.823 30.3733 158.29 32.28 158.29 34.44ZM152.49 32.84C152.463 31.4 151.943 30.2533 150.93 29.4C149.916 28.52 148.676 28.08 147.21 28.08C145.823 28.08 144.65 28.5067 143.69 29.36C142.756 30.1867 142.183 31.3467 141.97 32.84H152.49ZM167.177 27.28C167.897 26.1067 168.831 25.1867 169.977 24.52C171.151 23.8533 172.484 23.52 173.977 23.52V29.4H172.497C170.737 29.4 169.404 29.8133 168.497 30.64C167.617 31.4667 167.177 32.9067 167.177 34.96V46H161.577V23.84H167.177V27.28ZM188.309 28.44H184.429V46H178.749V28.44H176.229V23.84H178.749V22.72C178.749 20 179.522 18 181.069 16.72C182.616 15.44 184.949 14.84 188.069 14.92V19.64C186.709 19.6133 185.762 19.84 185.229 20.32C184.696 20.8 184.429 21.6667 184.429 22.92V23.84H188.309V28.44ZM197.538 16.4V46H191.938V16.4H197.538ZM211.711 46.36C209.578 46.36 207.658 45.8933 205.951 44.96C204.244 44 202.898 42.6533 201.911 40.92C200.951 39.1867 200.471 37.1867 200.471 34.92C200.471 32.6533 200.964 30.6533 201.951 28.92C202.964 27.1867 204.338 25.8533 206.071 24.92C207.804 23.96 209.738 23.48 211.871 23.48C214.004 23.48 215.938 23.96 217.671 24.92C219.404 25.8533 220.764 27.1867 221.751 28.92C222.764 30.6533 223.271 32.6533 223.271 34.92C223.271 37.1867 222.751 39.1867 221.711 40.92C220.698 42.6533 219.311 44 217.551 44.96C215.818 45.8933 213.871 46.36 211.711 46.36ZM211.711 41.48C212.724 41.48 213.671 41.24 214.551 40.76C215.458 40.2533 216.178 39.5067 216.711 38.52C217.244 37.5333 217.511 36.3333 217.511 34.92C217.511 32.8133 216.951 31.2 215.831 30.08C214.738 28.9333 213.391 28.36 211.791 28.36C210.191 28.36 208.844 28.9333 207.751 30.08C206.684 31.2 206.151 32.8133 206.151 34.92C206.151 37.0267 206.671 38.6533 207.711 39.8C208.778 40.92 210.111 41.48 211.711 41.48ZM256.499 23.84L250.019 46H243.979L239.939 30.52L235.899 46H229.819L223.299 23.84H228.979L232.899 40.72L237.139 23.84H243.059L247.219 40.68L251.139 23.84H256.499Z" fill="#141416"/>\n\t\t\t\t</svg>\n\t\t\t\t',darkUrl:'\n\t\t\t\t<svg width="257" height="65" viewBox="0 0 257 65" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 16C8 11.5817 11.5817 8 16 8V8C20.4183 8 24 11.5817 24 16V24H16C11.5817 24 8 20.4183 8 16V16Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 37C0 30.3726 5.37258 25 12 25H24V37C24 43.6274 18.6274 49 12 49V49C5.37258 49 0 43.6274 0 37V37Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 27C25 20.3726 30.3726 15 37 15V15C43.6274 15 49 20.3726 49 27V27C49 33.6274 43.6274 39 37 39H25V27Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 40H33C37.4183 40 41 43.5817 41 48V48C41 52.4183 37.4183 56 33 56V56C28.5817 56 25 52.4183 25 48V40Z" fill="#0DCF82"/>\n\t\t\t\t\t<path d="M73.4 46.28C71.4533 46.28 69.6933 45.9467 68.12 45.28C66.5733 44.6133 65.3467 43.6533 64.44 42.4C63.5333 41.1467 63.0667 39.6667 63.04 37.96H69.04C69.12 39.1067 69.52 40.0133 70.24 40.68C70.9867 41.3467 72 41.68 73.28 41.68C74.5867 41.68 75.6133 41.3733 76.36 40.76C77.1067 40.12 77.48 39.2933 77.48 38.28C77.48 37.4533 77.2267 36.7733 76.72 36.24C76.2133 35.7067 75.5733 35.2933 74.8 35C74.0533 34.68 73.0133 34.3333 71.68 33.96C69.8667 33.4267 68.3867 32.9067 67.24 32.4C66.12 31.8667 65.1467 31.08 64.32 30.04C63.52 28.9733 63.12 27.56 63.12 25.8C63.12 24.1467 63.5333 22.7067 64.36 21.48C65.1867 20.2533 66.3467 19.32 67.84 18.68C69.3333 18.0133 71.04 17.68 72.96 17.68C75.84 17.68 78.1733 18.3867 79.96 19.8C81.7733 21.1867 82.7733 23.1333 82.96 25.64H76.8C76.7467 24.68 76.3333 23.8933 75.56 23.28C74.8133 22.64 73.8133 22.32 72.56 22.32C71.4667 22.32 70.5867 22.6 69.92 23.16C69.28 23.72 68.96 24.5333 68.96 25.6C68.96 26.3467 69.2 26.9733 69.68 27.48C70.1867 27.96 70.8 28.36 71.52 28.68C72.2667 28.9733 73.3067 29.32 74.64 29.72C76.4533 30.2533 77.9333 30.7867 79.08 31.32C80.2267 31.8533 81.2133 32.6533 82.04 33.72C82.8667 34.7867 83.28 36.1867 83.28 37.92C83.28 39.4133 82.8933 40.8 82.12 42.08C81.3467 43.36 80.2133 44.3867 78.72 45.16C77.2267 45.9067 75.4533 46.28 73.4 46.28ZM107.855 23.84V46H102.215V43.2C101.495 44.16 100.548 44.92 99.375 45.48C98.2283 46.0133 96.975 46.28 95.615 46.28C93.8817 46.28 92.3483 45.92 91.015 45.2C89.6817 44.4533 88.6283 43.3733 87.855 41.96C87.1083 40.52 86.735 38.8133 86.735 36.84V23.84H92.335V36.04C92.335 37.8 92.775 39.16 93.655 40.12C94.535 41.0533 95.735 41.52 97.255 41.52C98.8017 41.52 100.015 41.0533 100.895 40.12C101.775 39.16 102.215 37.8 102.215 36.04V23.84H107.855ZM116.98 27.04C117.7 26.0267 118.687 25.1867 119.94 24.52C121.22 23.8267 122.674 23.48 124.3 23.48C126.194 23.48 127.9 23.9467 129.42 24.88C130.967 25.8133 132.18 27.1467 133.06 28.88C133.967 30.5867 134.42 32.5733 134.42 34.84C134.42 37.1067 133.967 39.12 133.06 40.88C132.18 42.6133 130.967 43.96 129.42 44.92C127.9 45.88 126.194 46.36 124.3 46.36C122.674 46.36 121.234 46.0267 119.98 45.36C118.754 44.6933 117.754 43.8533 116.98 42.84V56.56H111.38V23.84H116.98V27.04ZM128.7 34.84C128.7 33.5067 128.42 32.36 127.86 31.4C127.327 30.4133 126.607 29.6667 125.7 29.16C124.82 28.6533 123.86 28.4 122.82 28.4C121.807 28.4 120.847 28.6667 119.94 29.2C119.06 29.7067 118.34 30.4533 117.78 31.44C117.247 32.4267 116.98 33.5867 116.98 34.92C116.98 36.2533 117.247 37.4133 117.78 38.4C118.34 39.3867 119.06 40.1467 119.94 40.68C120.847 41.1867 121.807 41.44 122.82 41.44C123.86 41.44 124.82 41.1733 125.7 40.64C126.607 40.1067 127.327 39.3467 127.86 38.36C128.42 37.3733 128.7 36.2 128.7 34.84ZM158.29 34.44C158.29 35.24 158.236 35.96 158.13 36.6H141.93C142.063 38.2 142.623 39.4533 143.61 40.36C144.596 41.2667 145.81 41.72 147.25 41.72C149.33 41.72 150.81 40.8267 151.69 39.04H157.73C157.09 41.1733 155.863 42.9333 154.05 44.32C152.236 45.68 150.01 46.36 147.37 46.36C145.236 46.36 143.316 45.8933 141.61 44.96C139.93 44 138.61 42.6533 137.65 40.92C136.716 39.1867 136.25 37.1867 136.25 34.92C136.25 32.6267 136.716 30.6133 137.65 28.88C138.583 27.1467 139.89 25.8133 141.57 24.88C143.25 23.9467 145.183 23.48 147.37 23.48C149.476 23.48 151.356 23.9333 153.01 24.84C154.69 25.7467 155.983 27.04 156.89 28.72C157.823 30.3733 158.29 32.28 158.29 34.44ZM152.49 32.84C152.463 31.4 151.943 30.2533 150.93 29.4C149.916 28.52 148.676 28.08 147.21 28.08C145.823 28.08 144.65 28.5067 143.69 29.36C142.756 30.1867 142.183 31.3467 141.97 32.84H152.49ZM167.177 27.28C167.897 26.1067 168.831 25.1867 169.977 24.52C171.151 23.8533 172.484 23.52 173.977 23.52V29.4H172.497C170.737 29.4 169.404 29.8133 168.497 30.64C167.617 31.4667 167.177 32.9067 167.177 34.96V46H161.577V23.84H167.177V27.28ZM188.309 28.44H184.429V46H178.749V28.44H176.229V23.84H178.749V22.72C178.749 20 179.522 18 181.069 16.72C182.616 15.44 184.949 14.84 188.069 14.92V19.64C186.709 19.6133 185.762 19.84 185.229 20.32C184.696 20.8 184.429 21.6667 184.429 22.92V23.84H188.309V28.44ZM197.538 16.4V46H191.938V16.4H197.538ZM211.711 46.36C209.578 46.36 207.658 45.8933 205.951 44.96C204.244 44 202.898 42.6533 201.911 40.92C200.951 39.1867 200.471 37.1867 200.471 34.92C200.471 32.6533 200.964 30.6533 201.951 28.92C202.964 27.1867 204.338 25.8533 206.071 24.92C207.804 23.96 209.738 23.48 211.871 23.48C214.004 23.48 215.938 23.96 217.671 24.92C219.404 25.8533 220.764 27.1867 221.751 28.92C222.764 30.6533 223.271 32.6533 223.271 34.92C223.271 37.1867 222.751 39.1867 221.711 40.92C220.698 42.6533 219.311 44 217.551 44.96C215.818 45.8933 213.871 46.36 211.711 46.36ZM211.711 41.48C212.724 41.48 213.671 41.24 214.551 40.76C215.458 40.2533 216.178 39.5067 216.711 38.52C217.244 37.5333 217.511 36.3333 217.511 34.92C217.511 32.8133 216.951 31.2 215.831 30.08C214.738 28.9333 213.391 28.36 211.791 28.36C210.191 28.36 208.844 28.9333 207.751 30.08C206.684 31.2 206.151 32.8133 206.151 34.92C206.151 37.0267 206.671 38.6533 207.711 39.8C208.778 40.92 210.111 41.48 211.711 41.48ZM256.499 23.84L250.019 46H243.979L239.939 30.52L235.899 46H229.819L223.299 23.84H228.979L232.899 40.72L237.139 23.84H243.059L247.219 40.68L251.139 23.84H256.499Z" fill="white"/>\n\t\t\t\t</svg>\n\t\t\t\t'}}}},De=[{name:"Peppa Pig",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fpeppa_pig.svg?alt=media&token=a9fc83f7-b347-4868-8d52-0e888f0de73a&_gl=1*jzxghx*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTQ5LjQyLjAuMA.."},{name:"Dazzling Dalmatian",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fdazzling_dalmatian.svg?alt=media&token=5842b24c-7e58-4bb5-96c2-d09aa11f7f9e&_gl=1*11ayw3z*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxOTY4LjExLjAuMA.."},{name:"Rosy Rabbit",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Frosy_rabbit.svg?alt=media&token=4e65a9e3-080d-4416-839d-e761b6b37181&_gl=1*156om5t*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjUzLjYwLjAuMA.."},{name:"Leo the Lion",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fleo_the_lion.svg?alt=media&token=58d1296e-fefd-42ce-80ea-ae2cc830f1a9&_gl=1*1cz8e9q*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTAwLjIwLjAuMA.."},{name:"Ducky Down",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fducky_down.svg?alt=media&token=d67ae889-78c5-46e3-aaa9-3eb511fe90b3&_gl=1*cxyj7o*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxOTkwLjYwLjAuMA.."},{name:"Merry Monkey",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fmerry_monkey.svg?alt=media&token=5bd2f69a-7211-42df-9718-5339c467b2d1&_gl=1*1labjed*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTE3LjMuMC4w"},{name:"Ecstatic Elephant",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fecstatic_elephant.svg?alt=media&token=fbd2ba76-6c3a-47a7-beac-0460a2178b7d&_gl=1*aku3ps*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDA3LjQzLjAuMA.."},{name:"Baby Bear",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fbaby_bear.svg?alt=media&token=71d0c5fb-60aa-4304-adc1-635a83650bde&_gl=1*1dxajmf*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxMjQyLjUyLjAuMA.."},{name:"Freddy Froglet",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Ffreddy_froglet.svg?alt=media&token=e3b2e292-6480-4507-9da3-21a62a1346d4&_gl=1*s4yycs*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDQzLjcuMC4w"},{name:"Powerful Panda",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fpowerful_panda.svg?alt=media&token=07f9d60f-aa14-4a77-ad5b-c48ee76db3f5&_gl=1*7gfuit*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTkzLjYwLjAuMA.."},{name:"Curious Cat",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fcurious_cat.svg?alt=media&token=dccf6824-3b7c-4e4e-8559-40fbb8ff6186&_gl=1*1nwi0ti*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxOTM3LjQyLjAuMA.."},{name:"Playful Penguin",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fplayful_penguin.svg?alt=media&token=c6d1b11a-43a6-4001-ae56-e04fd5a3f965&_gl=1*1xdxvkx*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTYzLjI4LjAuMA.."},{name:"Kind Koala",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fkind_koala.svg?alt=media&token=974396d6-6ccd-4367-8563-b27634849cb5&_gl=1*1w1gbnn*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDgwLjQwLjAuMA.."},{name:"Tommy Tiger",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Ftommy_tiger.svg?alt=media&token=40a95ac7-cc91-4b74-859a-4e2e5964b967&_gl=1*1n0cr0n*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjczLjQwLjAuMA.."},{name:"Wally Walrus",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fwally_walrus.svg?alt=media&token=31e02ef2-c986-4724-b987-dca97f84f81b&_gl=1*y5by2c*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjkxLjIyLjAuMA.."},{name:"Ricky Rhino",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fricky_rhino.svg?alt=media&token=5d9dafe5-f4de-4f8b-94c1-49e01c776611&_gl=1*zyp4n2*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjMxLjIyLjAuMA.."},{name:"Oliver Otter",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Foliver_otter.svg?alt=media&token=5298b869-0903-40b2-a702-224a3e0bcd95&_gl=1*aicppz*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTMxLjYwLjAuMA.."},{name:"Reggie Ratling",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Freggie_ratling.svg?alt=media&token=f37fd4a0-9dbd-403a-bb82-81fdfb63cf88&_gl=1*16lzeql*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjA3LjQ2LjAuMA.."},{name:"Gentle Giraffe",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fgentle_giraffe.svg?alt=media&token=f097ec12-e8ce-4d26-bf32-43e470eb7907&_gl=1*11ctuwz*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDYwLjYwLjAuMA.."},{name:"Fabulous Fox",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Ffabulous_fox.svg?alt=media&token=fe1a4236-af45-427f-a035-1eda417b0682&_gl=1*xyyv1g*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDIxLjI5LjAuMA.."}],Fe="bugReport",Pe="create",je="Sign in to report a bug.",Ve="Something went wrong. Please try again.",Ue={console:100,errors:25,network:25},Be={maxMessageChars:5e3,maxDigestBytes:2048,maxBundleBytes:262144,maxEntryChars:500,maxStackFrames:5,digestListSize:5};const ze=[{pattern:/eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]*/g,replacement:"[REDACTED_JWT]"},{pattern:/\b(sk|pk|rk)_(live|test)_[A-Za-z0-9]{8,}/g,replacement:"[REDACTED_STRIPE_KEY]"},{pattern:/\bAIza[0-9A-Za-z_-]{35}\b/g,replacement:"[REDACTED_FIREBASE_KEY]"},{pattern:/\bghp_[A-Za-z0-9]{20,}\b/g,replacement:"[REDACTED_GITHUB_TOKEN]"},{pattern:/\bxox[abprs]-[A-Za-z0-9-]{10,}\b/gi,replacement:"[REDACTED_SLACK_TOKEN]"},{pattern:/\b(?:sk|pk|api|key)[_-][A-Za-z0-9]{12,}\b/gi,replacement:"[REDACTED_API_KEY]"},{pattern:/\b[Bb]earer\s+[A-Za-z0-9._-]{16,}/g,replacement:"Bearer [REDACTED]"},{pattern:/\bAuthorization\s*:\s*(?:Bearer|Basic|Token|Digest)?\s*\S+/gi,replacement:"Authorization: [REDACTED]"},{pattern:/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g,replacement:"[REDACTED_EMAIL]"},{pattern:/\b\d{4}[ -]\d{4}[ -]\d{4}[ -]\d{1,4}\b/g,replacement:"[REDACTED_CARD_NUMBER]"},{pattern:/\b\d{13,19}\b/g,replacement:function(t){try{return function(t){try{let e=0,i=!1;for(let o=t.length-1;o>=0;o-=1){let n=Number(t[o]);i&&(n*=2,n>9&&(n-=9)),e+=n,i=!i}return e%10==0}catch{return!0}}(t)?"[REDACTED_CARD_NUMBER]":t}catch{return"[REDACTED_CARD_NUMBER]"}}},{pattern:/\b[A-Fa-f0-9]{40,}\b/g,replacement:"[REDACTED_HEX]"},{pattern:/\b[A-Za-z0-9+/]{40,}={0,2}\b/g,replacement:"[REDACTED_BASE64]"}],He="__SUPERFLOW_LIVE_SIGNIN__",Ge="__sf_signin",We="guest";var qe=Object.freeze({__proto__:null,AGENT_COMMENTS_MODE:$t,AGENT_FIELD_PREFIXES:_e,ANNOTATION_STATUS_TERMINAL:"terminal",ANNOTATION_TYPE_SUGGESTION:Ie,APPROVAL_NOTICE_DURATION_MS:5e3,ATTRIBUTES:Oe,AUTO_COMMENT_MODE:It,BUG_REPORT_AUTH_REQUIRED_ERROR:je,BUG_REPORT_EVENT_TYPE:Fe,BUG_REPORT_SCHEMA_VERSION:1,BUG_REPORT_SUBMIT_FAILED_ERROR:Ve,BUG_REPORT_SUB_EVENT_TYPE_CREATE:Pe,COMMENT_PRIVATE_MODE_TYPE_ORGANIZATION:fe,DEFAULT_CUSTOMER_METADATA:Re,DOCUMENT_TITLE_CHANGE_LISTENER_API_KEYS:bt,DRIVE_HOSTS:Ae,DRIVE_NEW_PROD_URL:"app.usesuperflow.com/drive",DRIVE_NEW_STAGING_URL:"superflow-portal-v2-staging.firebaseapp.com/drive",DRIVE_PROD_URL:"drive.usesuperflow.com",DRIVE_STAGING_URL:"superflow-file-viewer-staging.web.app",EMBED_MODE:Tt,EXCLUDED_API_KEYS_FROM_CHECK_PRIORITIES:Ct,EXCLUDED_API_KEYS_FROM_LATEST_VERSION:["I9R2VqG45F5AgpIicnht"],FEEDBACK_MODE:At,FIGMA_DEMO_MODAL:ae,GUEST_USERS:De,LIVE_DEMO_MODAL:se,LIVE_PREVIEW_SIGN_IN_GLOBAL:He,LIVE_PREVIEW_SIGN_IN_PARAM:Ge,LIVE_PREVIEW_SIGN_OUT_VALUE:We,ONBOARDING_AGENT_BUTTON_LABELS:ke,ONBOARDING_AGENT_BUTTON_STATE:Ee,ONBOARDING_AGENT_STATUS_MESSAGE_TYPE:Lt,ONBOARDING_DIAGNOSTICS_MESSAGE_TYPE:Ft,ONBOARDING_DIAGNOSTICS_REQUEST_MESSAGE_TYPE:Dt,ONBOARDING_FAILED_AGENT_STATUSES:jt,ONBOARDING_FETCH_ERROR:Vt,ONBOARDING_FINDINGS_FETCH_INTERVAL_MS:3e3,ONBOARDING_FINDINGS_FETCH_MAX_ATTEMPTS:10,ONBOARDING_FINDINGS_FETCH_MAX_ATTEMPTS_PER_RUN:30,ONBOARDING_MAX_AGENT_STATUSES:50,ONBOARDING_MAX_DISMISSED_PROJECTS:20,ONBOARDING_MODE:Ot,ONBOARDING_READY_MESSAGE_TYPE:Rt,ONBOARDING_STATUS_FIRST_MESSAGE_TIMEOUT_MS:2e4,ONBOARDING_STATUS_STALE_MS:Pt,ONBOARDING_VIEWPORT_GUTTER_PX:8,PLACEHOLDER_ORGANIZATION_NAME:yt,PREVIEW_LIVE_DOMAINS:Ht,PREVIEW_LIVE_LABEL_PATTERN:Gt,PREVIEW_LOCATION_PATH:Nt,PREVIEW_NAVIGATE_MESSAGE_TYPE:Wt,PREVIEW_PROXY_HOSTS:zt,PROJECT_INSTALL:re,PROJECT_VERSION:oe,PROJECT_VERSION_DEFAULT_KEY:ne,PROJECT_VERSION_KEY:ie,PROXY_DISABLED_DEFAULT_API_KEYS:kt,READ_ONLY_MODE:_t,REVIEW_DOC_ID:Zt,REVIEW_MODE:Mt,SCREENSHOT_DISABLED_HOSTS:Te,SIDEBAR_BUTTON_COUNT_TYPE_FILTER:Le,SIDEBAR_V1_DEFAULT_API_KEYS:St,SNIPPYLY_COMMENT_ID:Kt,SNIPPYLY_TOKEN:Yt,SNIPPYLY_USER:Jt,SUPERFLOW_CONTENT_WARNING_SIDEBAR_OPEN:xe,SUPERFLOW_CUSTOMER_METADATA:Ce,SUPERFLOW_DOCUMENT_METADATA:"sfDocumentMetadata",SUPERFLOW_GUEST_MIGRATION_REFUSED:ee,SUPERFLOW_GUEST_MODE:de,SUPERFLOW_GUEST_MODE_ALLOW_SIGN_IN:me,SUPERFLOW_GUEST_USER_BANNER_OPENED:be,SUPERFLOW_GUEST_USER_MODEL_OPENED:we,SUPERFLOW_GUEST_USER_NAME_MODEL_OPENED:"sfGuestUserNameModelOpened",SUPERFLOW_GUEST_USER_NAME_UPDATED:ye,SUPERFLOW_GUEST_USER_TOKEN:te,SUPERFLOW_NATIVE_SCREENSHOT_PERMISSION:Se,SUPERFLOW_ONBOARDING_SIDEBAR_DISMISSED:Ut,SUPERFLOW_PAGE_COMMENTS_HIDDEN:qt,SUPERFLOW_PASSWORD_IS_VALID:ve,SUPERFLOW_PASSWORD_PROTECTED:he,SUPERFLOW_PRIVATE_MODE:ge,SUPERFLOW_QUERY_PARAMS_COMMENTS:ue,SUPERFLOW_SAML_CONFIG:Me,SUPERFLOW_SIDEBAR_V2_ENABLED:xt,SUPERFLOW_USER_ADMIN:ce,SUPERFLOW_USER_CREDENTIAL:Xt,SUPERFLOW_USER_CREDENTIAL_EXPIRY_MARGIN_MS:6e4,SUPERFLOW_USER_TOKEN:Qt,SUPERFLOW_USE_PAGE_TITLE_AS_LOCATION_NAME:pe,SUPERFLOW_VERSION:ft,SYSTEM_AGENT_IDS:$e,TAGS:Ne,TELEMETRY_BUFFER_CAPS:Ue,TELEMETRY_REDACTION_RULES:ze,TELEMETRY_SIZE_LIMITS:Be,TOUR_COMMENT_TOOLTIP:le,UNKNOWN_AGENT_NAME:Bt,VELT_PROXY_FLAG:Et,VELT_SDK_DEVELOP_VERSION:mt,VELT_SDK_PROD_VERSION:wt,VELT_SDK_STAGING_VERSION:"6.0.34"});const Ze=!0,Ke="https://superflow-portal-v2-staging.firebaseapp.com/",Je="https://superflow-portal-v2-staging.firebaseapp.com/settings/billing",Ye="9dbcd2509e0fa90a5c81f038ce618e3f",Qe="6d24f74f12f6fb84c87efa8f791cfb2e",Xe="https://us-central1-snipply-sdk-staging.cloudfunctions.net/sa",ti="https://us-central1-snipply-sdk-staging.cloudfunctions.net/superflowtoolbarhandler",ei="https://us-central1-snipply-sdk-staging.cloudfunctions.net/anonymoushandler",ii=["review","feedback","scommentId","st","snippyly_google_token","sembed","scommentmode","sreadonly","sagentcomments","spath","sonboarding","sprojectInstall","sflivedemo","sffigmademo"],oi=["review","feedback"],ni=["sembed","scommentmode","sreadonly","sagentcomments","spath","sonboarding"],ri="_sfls",si="sf_review",ai=["invalid","expired","revoked","exhausted","origin-mismatch","disabled","not-found","rate-limited","internal"];function li(t){try{const e=new URL(t);return e.searchParams.delete(si),e.toString()}catch(e){return t}}async function ci(t,e,i){try{const o=await t.fetchFn(t.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{subEventType:e,...i}})});if(!o||!o.ok)return{kind:"transport"};let n;try{n=await o.json()}catch(t){return{kind:"transport"}}const r=n&&"object"==typeof n?n.result:void 0;if(null==r||"object"!=typeof r)return{kind:"transport"};const s=r.error;return s&&"object"==typeof s?{kind:"error",code:di(s.code)}:{kind:"ok",result:r}}catch(t){return{kind:"transport"}}}function di(t){try{return"string"==typeof t&&ai.includes(t)?t:"internal"}catch(t){return"internal"}}const hi="My requests",ui="Sign in",pi=Object.freeze({id:"CLIENT_REQUEST",name:"Client Request",color:"#7c3aed",lightColor:"#ede9fe",svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M4 21V5C4 4.46957 4.21071 3.96086 4.58579 3.58579C4.96086 3.21071 5.46957 3 6 3H19L16 8L19 13H6C5.46957 13 4.96086 13.2107 4.58579 13.5858C4.21071 13.9609 4 14.4696 4 15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>'});function vi(t){try{const e=mi(t,ri);return"string"==typeof e&&e?e:null}catch(t){return null}}function gi(t){try{t&&t.removeItem(ri)}catch(t){console.warn("[superflow client mode] could not clear the live session:",t)}}function fi(t){try{return t()||null}catch(t){return null}}function mi(t,e){try{return t?t.getItem(e):null}catch(t){return null}}function wi(t){try{if(!t||"object"!=typeof t)return null;const e=t,i=e.annotation&&"object"==typeof e.annotation?e.annotation.annotationId:void 0,o="string"==typeof i&&i?i:e.annotationId;return"string"==typeof o&&o?o:null}catch(t){return null}}function yi(t){return{sf:{type:"request",visibility:"client",pageUrl:li("string"==typeof t?t:"")}}}function bi(t,e,i){try{const o=new Map;for(const i of function(t,e){try{return Array.isArray(t)?t.filter((t=>function(t,e){try{if(!e||!t||"object"!=typeof t)return!1;const i=t.from;return!!i&&"object"==typeof i&&i.userId===e}catch(t){return!1}}(t,e))):[]}catch(t){return[]}}(t,e)){const t=Ci(i);o.has(t)||o.set(t,[]),o.get(t).push(i)}const n=[];return o.forEach(((t,e)=>{n.push({groupId:e,groupName:e,isExpanded:e===i,annotations:t})})),n}catch(t){return console.warn("[superflow client mode] buildClientSidebarData failed:",t),[]}}function Ci(t){var e,i,o;try{const n=t,r=(null===(e=null==n?void 0:n.pageInfo)||void 0===e?void 0:e.path)||(null===(i=null==n?void 0:n.pageInfo)||void 0===i?void 0:i.url)||(null===(o=null==n?void 0:n.location)||void 0===o?void 0:o.path);return"string"==typeof r&&r?r:"/"}catch(t){return"/"}}function xi(t){try{return t&&"string"==typeof t.buttonLabel?t.buttonLabel.trim():""}catch(t){return""}}function Ei(t){try{return t&&"left"===t.buttonPosition?"left":"right"}catch(t){return"right"}}function ki(t){try{return!(t&&"object"==typeof t&&!1===t.enabled)}catch(t){return!0}}const Si=function(t){const e=[];let i=0;for(let o=0;o<t.length;o++){let n=t.charCodeAt(o);n<128?e[i++]=n:n<2048?(e[i++]=n>>6|192,e[i++]=63&n|128):55296==(64512&n)&&o+1<t.length&&56320==(64512&t.charCodeAt(o+1))?(n=65536+((1023&n)<<10)+(1023&t.charCodeAt(++o)),e[i++]=n>>18|240,e[i++]=n>>12&63|128,e[i++]=n>>6&63|128,e[i++]=63&n|128):(e[i++]=n>>12|224,e[i++]=n>>6&63|128,e[i++]=63&n|128)}return e},Mi={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const i=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,o=[];for(let e=0;e<t.length;e+=3){const n=t[e],r=e+1<t.length,s=r?t[e+1]:0,a=e+2<t.length,l=a?t[e+2]:0,c=n>>2,d=(3&n)<<4|s>>4;let h=(15&s)<<2|l>>6,u=63&l;a||(u=64,r||(h=64)),o.push(i[c],i[d],i[h],i[u])}return o.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(Si(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){const e=[];let i=0,o=0;for(;i<t.length;){const n=t[i++];if(n<128)e[o++]=String.fromCharCode(n);else if(n>191&&n<224){const r=t[i++];e[o++]=String.fromCharCode((31&n)<<6|63&r)}else if(n>239&&n<365){const r=((7&n)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536;e[o++]=String.fromCharCode(55296+(r>>10)),e[o++]=String.fromCharCode(56320+(1023&r))}else{const r=t[i++],s=t[i++];e[o++]=String.fromCharCode((15&n)<<12|(63&r)<<6|63&s)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const i=e?this.charToByteMapWebSafe_:this.charToByteMap_,o=[];for(let e=0;e<t.length;){const n=i[t.charAt(e++)],r=e<t.length?i[t.charAt(e)]:0;++e;const s=e<t.length?i[t.charAt(e)]:64;++e;const a=e<t.length?i[t.charAt(e)]:64;if(++e,null==n||null==r||null==s||null==a)throw new Ai;const l=n<<2|r>>4;if(o.push(l),64!==s){const t=r<<4&240|s>>2;if(o.push(t),64!==a){const t=s<<6&192|a;o.push(t)}}}return o},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};
71
+ */class pt extends ht{constructor(t){if(super(t),this.it=F,t.type!==ct)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===F||null==t)return this.ft=void 0,this.it=t;if(t===D)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.ft;this.it=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}pt.directiveName="unsafeHTML",pt.resultType=1;const vt=dt(pt);class gt{}gt.Events={GUEST_MODE_SIGN_IN_DIALOG_SHOWN:"guestModeSignInDialogShown",GUEST_MODE_NAME_DIALOG_SHOWN:"guestModeNameDialogShown",GUEST_MODE_SIGN_IN_BANNER_SHOWN:"guestModeSignInBannerShown",GUEST_MODE_SIGN_IN_BUTTON_CLICKED:"guestModeSignInButtonClicked",PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED:"passwordProtectedModalCloseButtonClicked",PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED:"passwordProtectedModalOpenButtonClicked",TOOLBAR_EXPANDED:"toolbarExpanded",TOOLBAR_COLLAPSED:"toolbarCollapsed",TOOLBAR_NOTIFICATION_CLICKED:"toolbarNotificationClicked",GUEST_MODE_SKIP_BUTTON_CLICKED:"guestModeSkipButtonClicked",GUEST_MODE_SIGN_IN_NUDGE_SHOWN:"guestModeSignInNudgeShown",GUEST_MODE_NAME_NUDGE_SHOWN:"guestModeNameNudgeShown",GUEST_MODE_SIGN_IN_CLICKED:"guestModeSignInClicked",GUEST_MODE_PRESENT:"guestModePresent",GUEST_MODE_NAME_ADDED:"guestModeNameAdded",REVIEW_PASSWORD_ADDED:"reviewPasswordAdded",REVIEW_PASSWORD_REJECTED:"reviewPasswordRejected",REVIEW_PASSWORD_ACCEPTED:"reviewPasswordAccepted",PRIVATE_MODE_ENABLED:"privateModeEnabled",PRIVATE_MODE_DISABLED:"privateModeDisabled",VISIBILITY_OPTIONS_ENABLED:"visibilityOptionsEnabled",VISIBILITY_OPTIONS_DISABLED:"visibilityOptionsDisabled",VIEW_PROJECT_CLICKED:"viewProjectClicked",REPORT_BUG_CLICKED:"reportBugClicked",REPORT_BUG_SUBMITTED:"reportBugSubmitted",OPEN_MOBILE_CLICKED:"openMobileClicked",EXIT_REVIEW_MODE_CLICKED:"exitReviewModeClicked",SIGNOUT_CLICKED:"signoutClicked",SIGNIN_CLICKED:"signinClicked",SIGN_IN_REQUIRED:"signInRequired",USER_EMAIL_NOT_WHITELISTED:"userEmailNotWhitelisted",DOMAIN_NOT_WHITELISTED:"domainNotWhitelisted",DUPLICATE_SCRIPT_INSTALLED:"duplicateScriptInstalled",TOOLBAR_DISABLED:"toolbarDisabled",INVITE_MODAL_OPENED:"inviteModalOpened",INVITE_SENT:"inviteSent",QUALITY_CHECK_RUN_TOOLBAR_CLICKED:"qualityCheckRunFromToolbarClicked",PROJECT_APPROVE_CLICKED:"projectApproveClicked",PROJECT_APPROVED:"projectApproved",PROJECT_APPROVE_FAILED:"projectApproveFailed",CLIENT_MODE_LOADED:"clientModeLoaded",CLIENT_REQUEST_ADDED:"clientRequestAdded",CLIENT_MODE_SIGN_IN_CLICKED:"clientModeSignInClicked",REQUEST_MODE_LOADED:"requestModeLoaded",REQUEST_ADDED:"requestAdded"};const ft="1.0.782",mt="6.0.34",wt="6.0.34",yt="Superflow Organization",bt=["v3ogId1G43AFHehEOewv","rNYzMJd13L27xtfipmSK","aU1MxKP0rca2UXwKi8bl"],Ct=["ockkGlKLaApkEOBShhbR"],xt="sfSidebarV2Enabled",Et="sfUseProxy",kt=["v3ogId1G43AFHehEOewv"],St=[],At="review",Mt="feedback",Tt="sembed",It="scommentmode",_t="sreadonly",$t="sagentcomments",Nt="spath",Ot="sonboarding",Lt="sf-onboarding-agent-status",Rt="sf-onboarding-ready",Dt="sf-onboarding-diagnostics-request",Ft="sf-onboarding-diagnostics",Pt=3e5,jt=["failed","systemError","error"],Vt={SDK_NOT_READY:"sdk-not-ready",SDK_RETURNED_NULL:"sdk-returned-null",FETCH_THREW:"fetch-threw"},Ut="sfOnboardingSidebarDismissed",Bt="Unknown Agent",zt=[{hostSuffix:"cloudfunctions.net",pathPrefix:"/previewproxy"},{hostSuffix:"api.velt.dev",pathPrefix:"/previewproxy"}],Ht=["superflow-preview.com","stg.superflow-preview.com"],Gt=/^[a-z2-7]+-[a-z2-7]{16}$/,Wt="sf-preview-navigate",qt="sfPageCommentsHidden",Zt="sreviewId",Kt="scommentId",Jt="snippyly-user",Yt="st",Qt="_sfut",Xt="_sfuc",te=6e4,ee="_sfgut",ie="sfGuestMigrationRefused",oe="projectVersionKey",ne="projectVersion",re="sversion",se="sprojectInstall",ae="sflivedemo",le="sffigmademo",ce="sfTourCommentTooltip",de="sfUserAdmin",he="sfGuestMode",ue="sfPasswordProtected",pe="sfQueryParamsComments",ve="sfUsePageTitleAsLocationName",ge="sfPasswordIsValid",fe="sfPrivateMode",me="organizationPrivate",we="sfGuestModeAllowSignIn",ye="sfGuestUserModelOpened",be="sfGuestUserNameUpdated",Ce="sfGuestUserBannerOpened",xe="sfCustomerMetadata",Ee="sfContentWarningSidebarOpen",ke={LOADING:"loading",RUNNING:"running",FINDINGS:"findings",CLEAN:"clean",IDLE:"idle"},Se={QA_AGENTS:"QA Agents",LOADING:"Running QA Agents",RUNNING:"Running",RUNNING_SINGLE:"Running 1 QA Agent",FINDING_SINGLE:"1 Agent Finding",FINDINGS:"Agent Findings",NO_FINDINGS_FOUND:"No Findings"},Ae="sfNativeScreenshotPermission",Me="sfSamlConfig",Te=[{hostSuffix:"drive.usesuperflow.com",pathPrefix:"/"},{hostSuffix:"superflow-file-viewer-staging.web.app",pathPrefix:"/"},{hostSuffix:"app.usesuperflow.com",pathPrefix:"/drive"},{hostSuffix:"superflow-portal-v2-staging.firebaseapp.com",pathPrefix:"/drive"},{hostSuffix:"superflow-portal-v2-staging.web.app",pathPrefix:"/drive"},{hostSuffix:"superflow-portal-v2-prod.firebaseapp.com",pathPrefix:"/drive"},{hostSuffix:"superflow-portal-v2-prod.web.app",pathPrefix:"/drive"}],Ie=["app.usesuperflow.com","superflow-portal-v2-staging.firebaseapp.com"],_e="suggestion",$e={AGENT:"agent:",AGENT_TYPE_CUSTOM:"agentType:custom"},Ne={SPELL_CHECK:"spell-check",BROKEN_LINKS:"broken-links",GRAMMAR_CHECK:"grammar-check"},Oe={VELT_ROOT:"velt-root",VELT_PRESENCE:"velt-presence",VELT_CURSOR:"velt-cursor",VELT_COMMENT_TOOL:"velt-comment-tool",VELT_COMMENTS:"velt-comments",SNIPPYLY_TEXT_HIGHLIGHT:"snippyly-text-highlight",VELT_COMMENTS_SIDEBAR_LEGACY:"velt-comments-sidebar",VELT_COMMENTS_SIDEBAR_V2:"velt-comments-sidebar-v2",VELT_HUDDLE:"velt-huddle",VELT_RECORDER_NOTES:"velt-recorder-notes",VELT_RECORDER_CONTROL_PANEL:"velt-recorder-control-panel",VELT_ARROWS:"velt-arrows",VELT_NOTIFICATIONS_HISTORY_PANEL:"velt-notifications-history-panel"},Le={ENABLE_URL_NAVIGATION:"enable-url-navigation",URL_NAVIGATION:"url-navigation",CURRENT_LOCATION_SUFFIX:"current-location-suffix",SIDEBAR_BUTTON_COUNT_TYPE:"sidebar-button-count-type",CUSTOM_ACTIONS:"custom-actions"},Re="filter",De={customBranding:{logo:{logoMark:{lightUrl:'\n\t\t\t\t<svg viewBox="0 0 49 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 8C8 3.58172 11.5817 0 16 0V0C20.4183 0 24 3.58172 24 8V16H16C11.5817 16 8 12.4183 8 8V8Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 29C0 22.3726 5.37258 17 12 17H24V29C24 35.6274 18.6274 41 12 41V41C5.37258 41 0 35.6274 0 29V29Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 19C25 12.3726 30.3726 7 37 7V7C43.6274 7 49 12.3726 49 19V19C49 25.6274 43.6274 31 37 31H25V19Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 32H33C37.4183 32 41 35.5817 41 40V40C41 44.4183 37.4183 48 33 48V48C28.5817 48 25 44.4183 25 40V32Z" fill="#0DCF82"/>\n\t\t\t\t</svg>\n\t\t\t\t',darkUrl:'\n\t\t\t\t<svg viewBox="0 0 49 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 8C8 3.58172 11.5817 0 16 0V0C20.4183 0 24 3.58172 24 8V16H16C11.5817 16 8 12.4183 8 8V8Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 29C0 22.3726 5.37258 17 12 17H24V29C24 35.6274 18.6274 41 12 41V41C5.37258 41 0 35.6274 0 29V29Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 19C25 12.3726 30.3726 7 37 7V7C43.6274 7 49 12.3726 49 19V19C49 25.6274 43.6274 31 37 31H25V19Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 32H33C37.4183 32 41 35.5817 41 40V40C41 44.4183 37.4183 48 33 48V48C28.5817 48 25 44.4183 25 40V32Z" fill="#0DCF82"/>\n\t\t\t\t</svg>\n\t\t\t\t'},wordMark:{lightUrl:'\n\t\t\t\t<svg width="257" height="65" viewBox="0 0 257 65" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 16C8 11.5817 11.5817 8 16 8V8C20.4183 8 24 11.5817 24 16V24H16C11.5817 24 8 20.4183 8 16V16Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 37C0 30.3726 5.37258 25 12 25H24V37C24 43.6274 18.6274 49 12 49V49C5.37258 49 0 43.6274 0 37V37Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 27C25 20.3726 30.3726 15 37 15V15C43.6274 15 49 20.3726 49 27V27C49 33.6274 43.6274 39 37 39H25V27Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 40H33C37.4183 40 41 43.5817 41 48V48C41 52.4183 37.4183 56 33 56V56C28.5817 56 25 52.4183 25 48V40Z" fill="#0DCF82"/>\n\t\t\t\t\t<path d="M73.4 46.28C71.4533 46.28 69.6933 45.9467 68.12 45.28C66.5733 44.6133 65.3467 43.6533 64.44 42.4C63.5333 41.1467 63.0667 39.6667 63.04 37.96H69.04C69.12 39.1067 69.52 40.0133 70.24 40.68C70.9867 41.3467 72 41.68 73.28 41.68C74.5867 41.68 75.6133 41.3733 76.36 40.76C77.1067 40.12 77.48 39.2933 77.48 38.28C77.48 37.4533 77.2267 36.7733 76.72 36.24C76.2133 35.7067 75.5733 35.2933 74.8 35C74.0533 34.68 73.0133 34.3333 71.68 33.96C69.8667 33.4267 68.3867 32.9067 67.24 32.4C66.12 31.8667 65.1467 31.08 64.32 30.04C63.52 28.9733 63.12 27.56 63.12 25.8C63.12 24.1467 63.5333 22.7067 64.36 21.48C65.1867 20.2533 66.3467 19.32 67.84 18.68C69.3333 18.0133 71.04 17.68 72.96 17.68C75.84 17.68 78.1733 18.3867 79.96 19.8C81.7733 21.1867 82.7733 23.1333 82.96 25.64H76.8C76.7467 24.68 76.3333 23.8933 75.56 23.28C74.8133 22.64 73.8133 22.32 72.56 22.32C71.4667 22.32 70.5867 22.6 69.92 23.16C69.28 23.72 68.96 24.5333 68.96 25.6C68.96 26.3467 69.2 26.9733 69.68 27.48C70.1867 27.96 70.8 28.36 71.52 28.68C72.2667 28.9733 73.3067 29.32 74.64 29.72C76.4533 30.2533 77.9333 30.7867 79.08 31.32C80.2267 31.8533 81.2133 32.6533 82.04 33.72C82.8667 34.7867 83.28 36.1867 83.28 37.92C83.28 39.4133 82.8933 40.8 82.12 42.08C81.3467 43.36 80.2133 44.3867 78.72 45.16C77.2267 45.9067 75.4533 46.28 73.4 46.28ZM107.855 23.84V46H102.215V43.2C101.495 44.16 100.548 44.92 99.375 45.48C98.2283 46.0133 96.975 46.28 95.615 46.28C93.8817 46.28 92.3483 45.92 91.015 45.2C89.6817 44.4533 88.6283 43.3733 87.855 41.96C87.1083 40.52 86.735 38.8133 86.735 36.84V23.84H92.335V36.04C92.335 37.8 92.775 39.16 93.655 40.12C94.535 41.0533 95.735 41.52 97.255 41.52C98.8017 41.52 100.015 41.0533 100.895 40.12C101.775 39.16 102.215 37.8 102.215 36.04V23.84H107.855ZM116.98 27.04C117.7 26.0267 118.687 25.1867 119.94 24.52C121.22 23.8267 122.674 23.48 124.3 23.48C126.194 23.48 127.9 23.9467 129.42 24.88C130.967 25.8133 132.18 27.1467 133.06 28.88C133.967 30.5867 134.42 32.5733 134.42 34.84C134.42 37.1067 133.967 39.12 133.06 40.88C132.18 42.6133 130.967 43.96 129.42 44.92C127.9 45.88 126.194 46.36 124.3 46.36C122.674 46.36 121.234 46.0267 119.98 45.36C118.754 44.6933 117.754 43.8533 116.98 42.84V56.56H111.38V23.84H116.98V27.04ZM128.7 34.84C128.7 33.5067 128.42 32.36 127.86 31.4C127.327 30.4133 126.607 29.6667 125.7 29.16C124.82 28.6533 123.86 28.4 122.82 28.4C121.807 28.4 120.847 28.6667 119.94 29.2C119.06 29.7067 118.34 30.4533 117.78 31.44C117.247 32.4267 116.98 33.5867 116.98 34.92C116.98 36.2533 117.247 37.4133 117.78 38.4C118.34 39.3867 119.06 40.1467 119.94 40.68C120.847 41.1867 121.807 41.44 122.82 41.44C123.86 41.44 124.82 41.1733 125.7 40.64C126.607 40.1067 127.327 39.3467 127.86 38.36C128.42 37.3733 128.7 36.2 128.7 34.84ZM158.29 34.44C158.29 35.24 158.236 35.96 158.13 36.6H141.93C142.063 38.2 142.623 39.4533 143.61 40.36C144.596 41.2667 145.81 41.72 147.25 41.72C149.33 41.72 150.81 40.8267 151.69 39.04H157.73C157.09 41.1733 155.863 42.9333 154.05 44.32C152.236 45.68 150.01 46.36 147.37 46.36C145.236 46.36 143.316 45.8933 141.61 44.96C139.93 44 138.61 42.6533 137.65 40.92C136.716 39.1867 136.25 37.1867 136.25 34.92C136.25 32.6267 136.716 30.6133 137.65 28.88C138.583 27.1467 139.89 25.8133 141.57 24.88C143.25 23.9467 145.183 23.48 147.37 23.48C149.476 23.48 151.356 23.9333 153.01 24.84C154.69 25.7467 155.983 27.04 156.89 28.72C157.823 30.3733 158.29 32.28 158.29 34.44ZM152.49 32.84C152.463 31.4 151.943 30.2533 150.93 29.4C149.916 28.52 148.676 28.08 147.21 28.08C145.823 28.08 144.65 28.5067 143.69 29.36C142.756 30.1867 142.183 31.3467 141.97 32.84H152.49ZM167.177 27.28C167.897 26.1067 168.831 25.1867 169.977 24.52C171.151 23.8533 172.484 23.52 173.977 23.52V29.4H172.497C170.737 29.4 169.404 29.8133 168.497 30.64C167.617 31.4667 167.177 32.9067 167.177 34.96V46H161.577V23.84H167.177V27.28ZM188.309 28.44H184.429V46H178.749V28.44H176.229V23.84H178.749V22.72C178.749 20 179.522 18 181.069 16.72C182.616 15.44 184.949 14.84 188.069 14.92V19.64C186.709 19.6133 185.762 19.84 185.229 20.32C184.696 20.8 184.429 21.6667 184.429 22.92V23.84H188.309V28.44ZM197.538 16.4V46H191.938V16.4H197.538ZM211.711 46.36C209.578 46.36 207.658 45.8933 205.951 44.96C204.244 44 202.898 42.6533 201.911 40.92C200.951 39.1867 200.471 37.1867 200.471 34.92C200.471 32.6533 200.964 30.6533 201.951 28.92C202.964 27.1867 204.338 25.8533 206.071 24.92C207.804 23.96 209.738 23.48 211.871 23.48C214.004 23.48 215.938 23.96 217.671 24.92C219.404 25.8533 220.764 27.1867 221.751 28.92C222.764 30.6533 223.271 32.6533 223.271 34.92C223.271 37.1867 222.751 39.1867 221.711 40.92C220.698 42.6533 219.311 44 217.551 44.96C215.818 45.8933 213.871 46.36 211.711 46.36ZM211.711 41.48C212.724 41.48 213.671 41.24 214.551 40.76C215.458 40.2533 216.178 39.5067 216.711 38.52C217.244 37.5333 217.511 36.3333 217.511 34.92C217.511 32.8133 216.951 31.2 215.831 30.08C214.738 28.9333 213.391 28.36 211.791 28.36C210.191 28.36 208.844 28.9333 207.751 30.08C206.684 31.2 206.151 32.8133 206.151 34.92C206.151 37.0267 206.671 38.6533 207.711 39.8C208.778 40.92 210.111 41.48 211.711 41.48ZM256.499 23.84L250.019 46H243.979L239.939 30.52L235.899 46H229.819L223.299 23.84H228.979L232.899 40.72L237.139 23.84H243.059L247.219 40.68L251.139 23.84H256.499Z" fill="#141416"/>\n\t\t\t\t</svg>\n\t\t\t\t',darkUrl:'\n\t\t\t\t<svg width="257" height="65" viewBox="0 0 257 65" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 16C8 11.5817 11.5817 8 16 8V8C20.4183 8 24 11.5817 24 16V24H16C11.5817 24 8 20.4183 8 16V16Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 37C0 30.3726 5.37258 25 12 25H24V37C24 43.6274 18.6274 49 12 49V49C5.37258 49 0 43.6274 0 37V37Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 27C25 20.3726 30.3726 15 37 15V15C43.6274 15 49 20.3726 49 27V27C49 33.6274 43.6274 39 37 39H25V27Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 40H33C37.4183 40 41 43.5817 41 48V48C41 52.4183 37.4183 56 33 56V56C28.5817 56 25 52.4183 25 48V40Z" fill="#0DCF82"/>\n\t\t\t\t\t<path d="M73.4 46.28C71.4533 46.28 69.6933 45.9467 68.12 45.28C66.5733 44.6133 65.3467 43.6533 64.44 42.4C63.5333 41.1467 63.0667 39.6667 63.04 37.96H69.04C69.12 39.1067 69.52 40.0133 70.24 40.68C70.9867 41.3467 72 41.68 73.28 41.68C74.5867 41.68 75.6133 41.3733 76.36 40.76C77.1067 40.12 77.48 39.2933 77.48 38.28C77.48 37.4533 77.2267 36.7733 76.72 36.24C76.2133 35.7067 75.5733 35.2933 74.8 35C74.0533 34.68 73.0133 34.3333 71.68 33.96C69.8667 33.4267 68.3867 32.9067 67.24 32.4C66.12 31.8667 65.1467 31.08 64.32 30.04C63.52 28.9733 63.12 27.56 63.12 25.8C63.12 24.1467 63.5333 22.7067 64.36 21.48C65.1867 20.2533 66.3467 19.32 67.84 18.68C69.3333 18.0133 71.04 17.68 72.96 17.68C75.84 17.68 78.1733 18.3867 79.96 19.8C81.7733 21.1867 82.7733 23.1333 82.96 25.64H76.8C76.7467 24.68 76.3333 23.8933 75.56 23.28C74.8133 22.64 73.8133 22.32 72.56 22.32C71.4667 22.32 70.5867 22.6 69.92 23.16C69.28 23.72 68.96 24.5333 68.96 25.6C68.96 26.3467 69.2 26.9733 69.68 27.48C70.1867 27.96 70.8 28.36 71.52 28.68C72.2667 28.9733 73.3067 29.32 74.64 29.72C76.4533 30.2533 77.9333 30.7867 79.08 31.32C80.2267 31.8533 81.2133 32.6533 82.04 33.72C82.8667 34.7867 83.28 36.1867 83.28 37.92C83.28 39.4133 82.8933 40.8 82.12 42.08C81.3467 43.36 80.2133 44.3867 78.72 45.16C77.2267 45.9067 75.4533 46.28 73.4 46.28ZM107.855 23.84V46H102.215V43.2C101.495 44.16 100.548 44.92 99.375 45.48C98.2283 46.0133 96.975 46.28 95.615 46.28C93.8817 46.28 92.3483 45.92 91.015 45.2C89.6817 44.4533 88.6283 43.3733 87.855 41.96C87.1083 40.52 86.735 38.8133 86.735 36.84V23.84H92.335V36.04C92.335 37.8 92.775 39.16 93.655 40.12C94.535 41.0533 95.735 41.52 97.255 41.52C98.8017 41.52 100.015 41.0533 100.895 40.12C101.775 39.16 102.215 37.8 102.215 36.04V23.84H107.855ZM116.98 27.04C117.7 26.0267 118.687 25.1867 119.94 24.52C121.22 23.8267 122.674 23.48 124.3 23.48C126.194 23.48 127.9 23.9467 129.42 24.88C130.967 25.8133 132.18 27.1467 133.06 28.88C133.967 30.5867 134.42 32.5733 134.42 34.84C134.42 37.1067 133.967 39.12 133.06 40.88C132.18 42.6133 130.967 43.96 129.42 44.92C127.9 45.88 126.194 46.36 124.3 46.36C122.674 46.36 121.234 46.0267 119.98 45.36C118.754 44.6933 117.754 43.8533 116.98 42.84V56.56H111.38V23.84H116.98V27.04ZM128.7 34.84C128.7 33.5067 128.42 32.36 127.86 31.4C127.327 30.4133 126.607 29.6667 125.7 29.16C124.82 28.6533 123.86 28.4 122.82 28.4C121.807 28.4 120.847 28.6667 119.94 29.2C119.06 29.7067 118.34 30.4533 117.78 31.44C117.247 32.4267 116.98 33.5867 116.98 34.92C116.98 36.2533 117.247 37.4133 117.78 38.4C118.34 39.3867 119.06 40.1467 119.94 40.68C120.847 41.1867 121.807 41.44 122.82 41.44C123.86 41.44 124.82 41.1733 125.7 40.64C126.607 40.1067 127.327 39.3467 127.86 38.36C128.42 37.3733 128.7 36.2 128.7 34.84ZM158.29 34.44C158.29 35.24 158.236 35.96 158.13 36.6H141.93C142.063 38.2 142.623 39.4533 143.61 40.36C144.596 41.2667 145.81 41.72 147.25 41.72C149.33 41.72 150.81 40.8267 151.69 39.04H157.73C157.09 41.1733 155.863 42.9333 154.05 44.32C152.236 45.68 150.01 46.36 147.37 46.36C145.236 46.36 143.316 45.8933 141.61 44.96C139.93 44 138.61 42.6533 137.65 40.92C136.716 39.1867 136.25 37.1867 136.25 34.92C136.25 32.6267 136.716 30.6133 137.65 28.88C138.583 27.1467 139.89 25.8133 141.57 24.88C143.25 23.9467 145.183 23.48 147.37 23.48C149.476 23.48 151.356 23.9333 153.01 24.84C154.69 25.7467 155.983 27.04 156.89 28.72C157.823 30.3733 158.29 32.28 158.29 34.44ZM152.49 32.84C152.463 31.4 151.943 30.2533 150.93 29.4C149.916 28.52 148.676 28.08 147.21 28.08C145.823 28.08 144.65 28.5067 143.69 29.36C142.756 30.1867 142.183 31.3467 141.97 32.84H152.49ZM167.177 27.28C167.897 26.1067 168.831 25.1867 169.977 24.52C171.151 23.8533 172.484 23.52 173.977 23.52V29.4H172.497C170.737 29.4 169.404 29.8133 168.497 30.64C167.617 31.4667 167.177 32.9067 167.177 34.96V46H161.577V23.84H167.177V27.28ZM188.309 28.44H184.429V46H178.749V28.44H176.229V23.84H178.749V22.72C178.749 20 179.522 18 181.069 16.72C182.616 15.44 184.949 14.84 188.069 14.92V19.64C186.709 19.6133 185.762 19.84 185.229 20.32C184.696 20.8 184.429 21.6667 184.429 22.92V23.84H188.309V28.44ZM197.538 16.4V46H191.938V16.4H197.538ZM211.711 46.36C209.578 46.36 207.658 45.8933 205.951 44.96C204.244 44 202.898 42.6533 201.911 40.92C200.951 39.1867 200.471 37.1867 200.471 34.92C200.471 32.6533 200.964 30.6533 201.951 28.92C202.964 27.1867 204.338 25.8533 206.071 24.92C207.804 23.96 209.738 23.48 211.871 23.48C214.004 23.48 215.938 23.96 217.671 24.92C219.404 25.8533 220.764 27.1867 221.751 28.92C222.764 30.6533 223.271 32.6533 223.271 34.92C223.271 37.1867 222.751 39.1867 221.711 40.92C220.698 42.6533 219.311 44 217.551 44.96C215.818 45.8933 213.871 46.36 211.711 46.36ZM211.711 41.48C212.724 41.48 213.671 41.24 214.551 40.76C215.458 40.2533 216.178 39.5067 216.711 38.52C217.244 37.5333 217.511 36.3333 217.511 34.92C217.511 32.8133 216.951 31.2 215.831 30.08C214.738 28.9333 213.391 28.36 211.791 28.36C210.191 28.36 208.844 28.9333 207.751 30.08C206.684 31.2 206.151 32.8133 206.151 34.92C206.151 37.0267 206.671 38.6533 207.711 39.8C208.778 40.92 210.111 41.48 211.711 41.48ZM256.499 23.84L250.019 46H243.979L239.939 30.52L235.899 46H229.819L223.299 23.84H228.979L232.899 40.72L237.139 23.84H243.059L247.219 40.68L251.139 23.84H256.499Z" fill="white"/>\n\t\t\t\t</svg>\n\t\t\t\t'}}}},Fe=[{name:"Peppa Pig",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fpeppa_pig.svg?alt=media&token=a9fc83f7-b347-4868-8d52-0e888f0de73a&_gl=1*jzxghx*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTQ5LjQyLjAuMA.."},{name:"Dazzling Dalmatian",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fdazzling_dalmatian.svg?alt=media&token=5842b24c-7e58-4bb5-96c2-d09aa11f7f9e&_gl=1*11ayw3z*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxOTY4LjExLjAuMA.."},{name:"Rosy Rabbit",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Frosy_rabbit.svg?alt=media&token=4e65a9e3-080d-4416-839d-e761b6b37181&_gl=1*156om5t*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjUzLjYwLjAuMA.."},{name:"Leo the Lion",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fleo_the_lion.svg?alt=media&token=58d1296e-fefd-42ce-80ea-ae2cc830f1a9&_gl=1*1cz8e9q*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTAwLjIwLjAuMA.."},{name:"Ducky Down",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fducky_down.svg?alt=media&token=d67ae889-78c5-46e3-aaa9-3eb511fe90b3&_gl=1*cxyj7o*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxOTkwLjYwLjAuMA.."},{name:"Merry Monkey",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fmerry_monkey.svg?alt=media&token=5bd2f69a-7211-42df-9718-5339c467b2d1&_gl=1*1labjed*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTE3LjMuMC4w"},{name:"Ecstatic Elephant",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fecstatic_elephant.svg?alt=media&token=fbd2ba76-6c3a-47a7-beac-0460a2178b7d&_gl=1*aku3ps*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDA3LjQzLjAuMA.."},{name:"Baby Bear",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fbaby_bear.svg?alt=media&token=71d0c5fb-60aa-4304-adc1-635a83650bde&_gl=1*1dxajmf*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxMjQyLjUyLjAuMA.."},{name:"Freddy Froglet",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Ffreddy_froglet.svg?alt=media&token=e3b2e292-6480-4507-9da3-21a62a1346d4&_gl=1*s4yycs*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDQzLjcuMC4w"},{name:"Powerful Panda",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fpowerful_panda.svg?alt=media&token=07f9d60f-aa14-4a77-ad5b-c48ee76db3f5&_gl=1*7gfuit*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTkzLjYwLjAuMA.."},{name:"Curious Cat",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fcurious_cat.svg?alt=media&token=dccf6824-3b7c-4e4e-8559-40fbb8ff6186&_gl=1*1nwi0ti*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxOTM3LjQyLjAuMA.."},{name:"Playful Penguin",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fplayful_penguin.svg?alt=media&token=c6d1b11a-43a6-4001-ae56-e04fd5a3f965&_gl=1*1xdxvkx*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTYzLjI4LjAuMA.."},{name:"Kind Koala",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fkind_koala.svg?alt=media&token=974396d6-6ccd-4367-8563-b27634849cb5&_gl=1*1w1gbnn*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDgwLjQwLjAuMA.."},{name:"Tommy Tiger",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Ftommy_tiger.svg?alt=media&token=40a95ac7-cc91-4b74-859a-4e2e5964b967&_gl=1*1n0cr0n*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjczLjQwLjAuMA.."},{name:"Wally Walrus",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fwally_walrus.svg?alt=media&token=31e02ef2-c986-4724-b987-dca97f84f81b&_gl=1*y5by2c*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjkxLjIyLjAuMA.."},{name:"Ricky Rhino",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fricky_rhino.svg?alt=media&token=5d9dafe5-f4de-4f8b-94c1-49e01c776611&_gl=1*zyp4n2*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjMxLjIyLjAuMA.."},{name:"Oliver Otter",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Foliver_otter.svg?alt=media&token=5298b869-0903-40b2-a702-224a3e0bcd95&_gl=1*aicppz*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTMxLjYwLjAuMA.."},{name:"Reggie Ratling",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Freggie_ratling.svg?alt=media&token=f37fd4a0-9dbd-403a-bb82-81fdfb63cf88&_gl=1*16lzeql*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjA3LjQ2LjAuMA.."},{name:"Gentle Giraffe",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fgentle_giraffe.svg?alt=media&token=f097ec12-e8ce-4d26-bf32-43e470eb7907&_gl=1*11ctuwz*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDYwLjYwLjAuMA.."},{name:"Fabulous Fox",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Ffabulous_fox.svg?alt=media&token=fe1a4236-af45-427f-a035-1eda417b0682&_gl=1*xyyv1g*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDIxLjI5LjAuMA.."}],Pe="bugReport",je="create",Ve="Sign in to report a bug.",Ue="Something went wrong. Please try again.",Be={console:100,errors:25,network:25},ze={maxMessageChars:5e3,maxDigestBytes:2048,maxBundleBytes:262144,maxEntryChars:500,maxStackFrames:5,digestListSize:5};const He=[{pattern:/eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]*/g,replacement:"[REDACTED_JWT]"},{pattern:/\b(sk|pk|rk)_(live|test)_[A-Za-z0-9]{8,}/g,replacement:"[REDACTED_STRIPE_KEY]"},{pattern:/\bAIza[0-9A-Za-z_-]{35}\b/g,replacement:"[REDACTED_FIREBASE_KEY]"},{pattern:/\bghp_[A-Za-z0-9]{20,}\b/g,replacement:"[REDACTED_GITHUB_TOKEN]"},{pattern:/\bxox[abprs]-[A-Za-z0-9-]{10,}\b/gi,replacement:"[REDACTED_SLACK_TOKEN]"},{pattern:/\b(?:sk|pk|api|key)[_-][A-Za-z0-9]{12,}\b/gi,replacement:"[REDACTED_API_KEY]"},{pattern:/\b[Bb]earer\s+[A-Za-z0-9._-]{16,}/g,replacement:"Bearer [REDACTED]"},{pattern:/\bAuthorization\s*:\s*(?:Bearer|Basic|Token|Digest)?\s*\S+/gi,replacement:"Authorization: [REDACTED]"},{pattern:/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g,replacement:"[REDACTED_EMAIL]"},{pattern:/\b\d{4}[ -]\d{4}[ -]\d{4}[ -]\d{1,4}\b/g,replacement:"[REDACTED_CARD_NUMBER]"},{pattern:/\b\d{13,19}\b/g,replacement:function(t){try{return function(t){try{let e=0,i=!1;for(let o=t.length-1;o>=0;o-=1){let n=Number(t[o]);i&&(n*=2,n>9&&(n-=9)),e+=n,i=!i}return e%10==0}catch{return!0}}(t)?"[REDACTED_CARD_NUMBER]":t}catch{return"[REDACTED_CARD_NUMBER]"}}},{pattern:/\b[A-Fa-f0-9]{40,}\b/g,replacement:"[REDACTED_HEX]"},{pattern:/\b[A-Za-z0-9+/]{40,}={0,2}\b/g,replacement:"[REDACTED_BASE64]"}],Ge="__SUPERFLOW_LIVE_SIGNIN__",We="__sf_signin",qe="guest";var Ze=Object.freeze({__proto__:null,AGENT_COMMENTS_MODE:$t,AGENT_FIELD_PREFIXES:$e,ANNOTATION_STATUS_TERMINAL:"terminal",ANNOTATION_TYPE_SUGGESTION:_e,APPROVAL_NOTICE_DURATION_MS:5e3,ATTRIBUTES:Le,AUTO_COMMENT_MODE:It,BUG_REPORT_AUTH_REQUIRED_ERROR:Ve,BUG_REPORT_EVENT_TYPE:Pe,BUG_REPORT_SCHEMA_VERSION:1,BUG_REPORT_SUBMIT_FAILED_ERROR:Ue,BUG_REPORT_SUB_EVENT_TYPE_CREATE:je,COMMENT_PRIVATE_MODE_TYPE_ORGANIZATION:me,DEFAULT_CUSTOMER_METADATA:De,DOCUMENT_TITLE_CHANGE_LISTENER_API_KEYS:bt,DRIVE_HOSTS:Te,DRIVE_NEW_PROD_URL:"app.usesuperflow.com/drive",DRIVE_NEW_STAGING_URL:"superflow-portal-v2-staging.firebaseapp.com/drive",DRIVE_PROD_URL:"drive.usesuperflow.com",DRIVE_STAGING_URL:"superflow-file-viewer-staging.web.app",EMBED_MODE:Tt,EXCLUDED_API_KEYS_FROM_CHECK_PRIORITIES:Ct,EXCLUDED_API_KEYS_FROM_LATEST_VERSION:["I9R2VqG45F5AgpIicnht"],FEEDBACK_MODE:Mt,FIGMA_DEMO_MODAL:le,GUEST_USERS:Fe,LIVE_DEMO_MODAL:ae,LIVE_PREVIEW_SIGN_IN_GLOBAL:Ge,LIVE_PREVIEW_SIGN_IN_PARAM:We,LIVE_PREVIEW_SIGN_OUT_VALUE:qe,ONBOARDING_AGENT_BUTTON_LABELS:Se,ONBOARDING_AGENT_BUTTON_STATE:ke,ONBOARDING_AGENT_STATUS_MESSAGE_TYPE:Lt,ONBOARDING_DIAGNOSTICS_MESSAGE_TYPE:Ft,ONBOARDING_DIAGNOSTICS_REQUEST_MESSAGE_TYPE:Dt,ONBOARDING_FAILED_AGENT_STATUSES:jt,ONBOARDING_FETCH_ERROR:Vt,ONBOARDING_FINDINGS_FETCH_INTERVAL_MS:3e3,ONBOARDING_FINDINGS_FETCH_MAX_ATTEMPTS:10,ONBOARDING_FINDINGS_FETCH_MAX_ATTEMPTS_PER_RUN:30,ONBOARDING_MAX_AGENT_STATUSES:50,ONBOARDING_MAX_DISMISSED_PROJECTS:20,ONBOARDING_MODE:Ot,ONBOARDING_READY_MESSAGE_TYPE:Rt,ONBOARDING_STATUS_FIRST_MESSAGE_TIMEOUT_MS:2e4,ONBOARDING_STATUS_STALE_MS:Pt,ONBOARDING_VIEWPORT_GUTTER_PX:8,PLACEHOLDER_ORGANIZATION_NAME:yt,PREVIEW_LIVE_DOMAINS:Ht,PREVIEW_LIVE_LABEL_PATTERN:Gt,PREVIEW_LOCATION_PATH:Nt,PREVIEW_NAVIGATE_MESSAGE_TYPE:Wt,PREVIEW_PROXY_HOSTS:zt,PROJECT_INSTALL:se,PROJECT_VERSION:ne,PROJECT_VERSION_DEFAULT_KEY:re,PROJECT_VERSION_KEY:oe,PROXY_DISABLED_DEFAULT_API_KEYS:kt,READ_ONLY_MODE:_t,REVIEW_DOC_ID:Zt,REVIEW_MODE:At,SCREENSHOT_DISABLED_HOSTS:Ie,SIDEBAR_BUTTON_COUNT_TYPE_FILTER:Re,SIDEBAR_V1_DEFAULT_API_KEYS:St,SNIPPYLY_COMMENT_ID:Kt,SNIPPYLY_TOKEN:Yt,SNIPPYLY_USER:Jt,SUPERFLOW_CONTENT_WARNING_SIDEBAR_OPEN:Ee,SUPERFLOW_CUSTOMER_METADATA:xe,SUPERFLOW_DOCUMENT_METADATA:"sfDocumentMetadata",SUPERFLOW_GUEST_MIGRATION_REFUSED:ie,SUPERFLOW_GUEST_MODE:he,SUPERFLOW_GUEST_MODE_ALLOW_SIGN_IN:we,SUPERFLOW_GUEST_USER_BANNER_OPENED:Ce,SUPERFLOW_GUEST_USER_MODEL_OPENED:ye,SUPERFLOW_GUEST_USER_NAME_MODEL_OPENED:"sfGuestUserNameModelOpened",SUPERFLOW_GUEST_USER_NAME_UPDATED:be,SUPERFLOW_GUEST_USER_TOKEN:ee,SUPERFLOW_NATIVE_SCREENSHOT_PERMISSION:Ae,SUPERFLOW_ONBOARDING_SIDEBAR_DISMISSED:Ut,SUPERFLOW_PAGE_COMMENTS_HIDDEN:qt,SUPERFLOW_PASSWORD_IS_VALID:ge,SUPERFLOW_PASSWORD_PROTECTED:ue,SUPERFLOW_PRIVATE_MODE:fe,SUPERFLOW_QUERY_PARAMS_COMMENTS:pe,SUPERFLOW_SAML_CONFIG:Me,SUPERFLOW_SIDEBAR_V2_ENABLED:xt,SUPERFLOW_USER_ADMIN:de,SUPERFLOW_USER_CREDENTIAL:Xt,SUPERFLOW_USER_CREDENTIAL_EXPIRY_MARGIN_MS:te,SUPERFLOW_USER_TOKEN:Qt,SUPERFLOW_USE_PAGE_TITLE_AS_LOCATION_NAME:ve,SUPERFLOW_VERSION:ft,SYSTEM_AGENT_IDS:Ne,TAGS:Oe,TELEMETRY_BUFFER_CAPS:Be,TELEMETRY_REDACTION_RULES:He,TELEMETRY_SIZE_LIMITS:ze,TOUR_COMMENT_TOOLTIP:ce,UNKNOWN_AGENT_NAME:Bt,VELT_PROXY_FLAG:Et,VELT_SDK_DEVELOP_VERSION:mt,VELT_SDK_PROD_VERSION:wt,VELT_SDK_STAGING_VERSION:"6.0.34"});const Ke=!0,Je="https://superflow-portal-v2-staging.firebaseapp.com/",Ye="https://superflow-portal-v2-staging.firebaseapp.com/settings/billing",Qe="9dbcd2509e0fa90a5c81f038ce618e3f",Xe="6d24f74f12f6fb84c87efa8f791cfb2e",ti="https://us-central1-snipply-sdk-staging.cloudfunctions.net/sa",ei="https://us-central1-snipply-sdk-staging.cloudfunctions.net/superflowtoolbarhandler",ii="https://us-central1-snipply-sdk-staging.cloudfunctions.net/anonymoushandler",oi=["review","feedback","scommentId","st","snippyly_google_token","sembed","scommentmode","sreadonly","sagentcomments","spath","sonboarding","sprojectInstall","sflivedemo","sffigmademo"],ni=["review","feedback"],ri=["sembed","scommentmode","sreadonly","sagentcomments","spath","sonboarding"],si="_sfls",ai="sf_review",li=["invalid","expired","revoked","exhausted","origin-mismatch","disabled","not-found","rate-limited","internal"];function ci(t){try{const e=new URL(t);return e.searchParams.delete(ai),e.toString()}catch(e){return t}}async function di(t,e,i){try{const o=await t.fetchFn(t.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{subEventType:e,...i}})});if(!o||!o.ok)return{kind:"transport"};let n;try{n=await o.json()}catch(t){return{kind:"transport"}}const r=n&&"object"==typeof n?n.result:void 0;if(null==r||"object"!=typeof r)return{kind:"transport"};const s=r.error;return s&&"object"==typeof s?{kind:"error",code:hi(s.code)}:{kind:"ok",result:r}}catch(t){return{kind:"transport"}}}function hi(t){try{return"string"==typeof t&&li.includes(t)?t:"internal"}catch(t){return"internal"}}const ui="My requests",pi="Sign in",vi=Object.freeze({id:"CLIENT_REQUEST",name:"Client Request",color:"#7c3aed",lightColor:"#ede9fe",svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M4 21V5C4 4.46957 4.21071 3.96086 4.58579 3.58579C4.96086 3.21071 5.46957 3 6 3H19L16 8L19 13H6C5.46957 13 4.96086 13.2107 4.58579 13.5858C4.21071 13.9609 4 14.4696 4 15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>'});function gi(t){try{const e=wi(t,si);return"string"==typeof e&&e?e:null}catch(t){return null}}function fi(t){try{t&&t.removeItem(si)}catch(t){console.warn("[superflow client mode] could not clear the live session:",t)}}function mi(t){try{return t()||null}catch(t){return null}}function wi(t,e){try{return t?t.getItem(e):null}catch(t){return null}}function yi(t){try{if(!t||"object"!=typeof t)return null;const e=t,i=e.annotation&&"object"==typeof e.annotation?e.annotation.annotationId:void 0,o="string"==typeof i&&i?i:e.annotationId;return"string"==typeof o&&o?o:null}catch(t){return null}}function bi(t){return{sf:{type:"request",visibility:"client",pageUrl:ci("string"==typeof t?t:"")}}}function Ci(t,e,i){try{const o=new Map;for(const i of function(t,e){try{return Array.isArray(t)?t.filter((t=>function(t,e){try{if(!e||!t||"object"!=typeof t)return!1;const i=t.from;return!!i&&"object"==typeof i&&i.userId===e}catch(t){return!1}}(t,e))):[]}catch(t){return[]}}(t,e)){const t=xi(i);o.has(t)||o.set(t,[]),o.get(t).push(i)}const n=[];return o.forEach(((t,e)=>{n.push({groupId:e,groupName:e,isExpanded:e===i,annotations:t})})),n}catch(t){return console.warn("[superflow client mode] buildClientSidebarData failed:",t),[]}}function xi(t){var e,i,o;try{const n=t,r=(null===(e=null==n?void 0:n.pageInfo)||void 0===e?void 0:e.path)||(null===(i=null==n?void 0:n.pageInfo)||void 0===i?void 0:i.url)||(null===(o=null==n?void 0:n.location)||void 0===o?void 0:o.path);return"string"==typeof r&&r?r:"/"}catch(t){return"/"}}function Ei(t){try{return t&&"string"==typeof t.buttonLabel?t.buttonLabel.trim():""}catch(t){return""}}function ki(t){try{return t&&"left"===t.buttonPosition?"left":"right"}catch(t){return"right"}}function Si(t){try{return!(t&&"object"==typeof t&&!1===t.enabled)}catch(t){return!0}}const Ai=function(t){const e=[];let i=0;for(let o=0;o<t.length;o++){let n=t.charCodeAt(o);n<128?e[i++]=n:n<2048?(e[i++]=n>>6|192,e[i++]=63&n|128):55296==(64512&n)&&o+1<t.length&&56320==(64512&t.charCodeAt(o+1))?(n=65536+((1023&n)<<10)+(1023&t.charCodeAt(++o)),e[i++]=n>>18|240,e[i++]=n>>12&63|128,e[i++]=n>>6&63|128,e[i++]=63&n|128):(e[i++]=n>>12|224,e[i++]=n>>6&63|128,e[i++]=63&n|128)}return e},Mi={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const i=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,o=[];for(let e=0;e<t.length;e+=3){const n=t[e],r=e+1<t.length,s=r?t[e+1]:0,a=e+2<t.length,l=a?t[e+2]:0,c=n>>2,d=(3&n)<<4|s>>4;let h=(15&s)<<2|l>>6,u=63&l;a||(u=64,r||(h=64)),o.push(i[c],i[d],i[h],i[u])}return o.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(Ai(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){const e=[];let i=0,o=0;for(;i<t.length;){const n=t[i++];if(n<128)e[o++]=String.fromCharCode(n);else if(n>191&&n<224){const r=t[i++];e[o++]=String.fromCharCode((31&n)<<6|63&r)}else if(n>239&&n<365){const r=((7&n)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536;e[o++]=String.fromCharCode(55296+(r>>10)),e[o++]=String.fromCharCode(56320+(1023&r))}else{const r=t[i++],s=t[i++];e[o++]=String.fromCharCode((15&n)<<12|(63&r)<<6|63&s)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const i=e?this.charToByteMapWebSafe_:this.charToByteMap_,o=[];for(let e=0;e<t.length;){const n=i[t.charAt(e++)],r=e<t.length?i[t.charAt(e)]:0;++e;const s=e<t.length?i[t.charAt(e)]:64;++e;const a=e<t.length?i[t.charAt(e)]:64;if(++e,null==n||null==r||null==s||null==a)throw new Ti;const l=n<<2|r>>4;if(o.push(l),64!==s){const t=r<<4&240|s>>2;if(o.push(t),64!==a){const t=s<<6&192|a;o.push(t)}}}return o},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};
72
72
  /**
73
73
  * @license
74
74
  * Copyright 2017 Google LLC
@@ -84,7 +84,7 @@ const lt=1,ct=2,dt=t=>(...e)=>({_$litDirective$:t,values:e});class ht{constructo
84
84
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
85
85
  * See the License for the specific language governing permissions and
86
86
  * limitations under the License.
87
- */class Ai extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Ti=function(t){return function(t){const e=Si(t);return Mi.encodeByteArray(e,!0)}(t).replace(/\./g,"")},Ii=function(t){try{return Mi.decodeString(t,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};
87
+ */class Ti extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Ii=function(t){return function(t){const e=Ai(t);return Mi.encodeByteArray(e,!0)}(t).replace(/\./g,"")},_i=function(t){try{return Mi.decodeString(t,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};
88
88
  /**
89
89
  * @license
90
90
  * Copyright 2022 Google LLC
@@ -101,7 +101,7 @@ const lt=1,ct=2,dt=t=>(...e)=>({_$litDirective$:t,values:e});class ht{constructo
101
101
  * See the License for the specific language governing permissions and
102
102
  * limitations under the License.
103
103
  */
104
- const _i=()=>
104
+ const $i=()=>
105
105
  /**
106
106
  * @license
107
107
  * Copyright 2022 Google LLC
@@ -118,7 +118,7 @@ const _i=()=>
118
118
  * See the License for the specific language governing permissions and
119
119
  * limitations under the License.
120
120
  */
121
- function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}().t,$i=()=>{try{return _i()||(()=>{if("undefined"==typeof process||void 0===process.env)return;const t=process.env.t;return t?JSON.parse(t):void 0})()||(()=>{if("undefined"==typeof document)return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(t){return}const e=t&&Ii(t[1]);return e&&JSON.parse(e)})()}catch(t){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`)}},Ni=t=>{var e,i;return null===(i=null===(e=$i())||void 0===e?void 0:e.emulatorHosts)||void 0===i?void 0:i[t]},Oi=()=>{var t;return null===(t=$i())||void 0===t?void 0:t.config},Li=t=>{var e;return null===(e=$i())||void 0===e?void 0:e[`_${t}`]};
121
+ function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}().t,Ni=()=>{try{return $i()||(()=>{if("undefined"==typeof process||void 0===process.env)return;const t=process.env.t;return t?JSON.parse(t):void 0})()||(()=>{if("undefined"==typeof document)return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(t){return}const e=t&&_i(t[1]);return e&&JSON.parse(e)})()}catch(t){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`)}},Oi=t=>{var e,i;return null===(i=null===(e=Ni())||void 0===e?void 0:e.emulatorHosts)||void 0===i?void 0:i[t]},Li=()=>{var t;return null===(t=Ni())||void 0===t?void 0:t.config},Ri=t=>{var e;return null===(e=Ni())||void 0===e?void 0:e[`_${t}`]};
122
122
  /**
123
123
  * @license
124
124
  * Copyright 2017 Google LLC
@@ -135,7 +135,7 @@ function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window
135
135
  * See the License for the specific language governing permissions and
136
136
  * limitations under the License.
137
137
  */
138
- class Ri{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}wrapCallback(t){return(e,i)=>{e?this.reject(e):this.resolve(i),"function"==typeof t&&(this.promise.catch((()=>{})),1===t.length?t(e):t(e,i))}}}
138
+ class Di{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}wrapCallback(t){return(e,i)=>{e?this.reject(e):this.resolve(i),"function"==typeof t&&(this.promise.catch((()=>{})),1===t.length?t(e):t(e,i))}}}
139
139
  /**
140
140
  * @license
141
141
  * Copyright 2017 Google LLC
@@ -151,7 +151,7 @@ class Ri{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new P
151
151
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
152
152
  * See the License for the specific language governing permissions and
153
153
  * limitations under the License.
154
- */function Di(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}class Fi extends Error{constructor(t,e,i){super(e),this.code=t,this.customData=i,this.name="FirebaseError",Object.setPrototypeOf(this,Fi.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Pi.prototype.create)}}class Pi{constructor(t,e,i){this.service=t,this.serviceName=e,this.errors=i}create(t,...e){const i=e[0]||{},o=`${this.service}/${t}`,n=this.errors[t],r=n?function(t,e){return t.replace(ji,((t,i)=>{const o=e[i];return null!=o?String(o):`<${i}?>`}))}(n,i):"Error",s=`${this.serviceName}: ${r} (${o}).`;return new Fi(o,s,i)}}const ji=/\{\$([^}]+)}/g;function Vi(t,e){if(t===e)return!0;const i=Object.keys(t),o=Object.keys(e);for(const n of i){if(!o.includes(n))return!1;const i=t[n],r=e[n];if(Ui(i)&&Ui(r)){if(!Vi(i,r))return!1}else if(i!==r)return!1}for(const t of o)if(!i.includes(t))return!1;return!0}function Ui(t){return null!==t&&"object"==typeof t}
154
+ */function Fi(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}class Pi extends Error{constructor(t,e,i){super(e),this.code=t,this.customData=i,this.name="FirebaseError",Object.setPrototypeOf(this,Pi.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ji.prototype.create)}}class ji{constructor(t,e,i){this.service=t,this.serviceName=e,this.errors=i}create(t,...e){const i=e[0]||{},o=`${this.service}/${t}`,n=this.errors[t],r=n?function(t,e){return t.replace(Vi,((t,i)=>{const o=e[i];return null!=o?String(o):`<${i}?>`}))}(n,i):"Error",s=`${this.serviceName}: ${r} (${o}).`;return new Pi(o,s,i)}}const Vi=/\{\$([^}]+)}/g;function Ui(t,e){if(t===e)return!0;const i=Object.keys(t),o=Object.keys(e);for(const n of i){if(!o.includes(n))return!1;const i=t[n],r=e[n];if(Bi(i)&&Bi(r)){if(!Ui(i,r))return!1}else if(i!==r)return!1}for(const t of o)if(!i.includes(t))return!1;return!0}function Bi(t){return null!==t&&"object"==typeof t}
155
155
  /**
156
156
  * @license
157
157
  * Copyright 2017 Google LLC
@@ -167,7 +167,7 @@ class Ri{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new P
167
167
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
168
168
  * See the License for the specific language governing permissions and
169
169
  * limitations under the License.
170
- */function Bi(t){const e=[];for(const[i,o]of Object.entries(t))Array.isArray(o)?o.forEach((t=>{e.push(encodeURIComponent(i)+"="+encodeURIComponent(t))})):e.push(encodeURIComponent(i)+"="+encodeURIComponent(o));return e.length?"&"+e.join("&"):""}class zi{constructor(t,e){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then((()=>{t(this)})).catch((t=>{this.error(t)}))}next(t){this.forEachObserver((e=>{e.next(t)}))}error(t){this.forEachObserver((e=>{e.error(t)})),this.close(t)}complete(){this.forEachObserver((t=>{t.complete()})),this.close()}subscribe(t,e,i){let o;if(void 0===t&&void 0===e&&void 0===i)throw new Error("Missing Observer.");o=function(t,e){if("object"!=typeof t||null===t)return!1;for(const i of e)if(i in t&&"function"==typeof t[i])return!0;return!1}(t,["next","error","complete"])?t:{next:t,error:e,complete:i},void 0===o.next&&(o.next=Hi),void 0===o.error&&(o.error=Hi),void 0===o.complete&&(o.complete=Hi);const n=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((()=>{try{this.finalError?o.error(this.finalError):o.complete()}catch(t){}})),this.observers.push(o),n}unsubscribeOne(t){void 0!==this.observers&&void 0!==this.observers[t]&&(delete this.observers[t],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let e=0;e<this.observers.length;e++)this.sendOne(e,t)}sendOne(t,e){this.task.then((()=>{if(void 0!==this.observers&&void 0!==this.observers[t])try{e(this.observers[t])}catch(t){"undefined"!=typeof console&&console.error&&console.error(t)}}))}close(t){this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then((()=>{this.observers=void 0,this.onNoObservers=void 0})))}}function Hi(){}
170
+ */function zi(t){const e=[];for(const[i,o]of Object.entries(t))Array.isArray(o)?o.forEach((t=>{e.push(encodeURIComponent(i)+"="+encodeURIComponent(t))})):e.push(encodeURIComponent(i)+"="+encodeURIComponent(o));return e.length?"&"+e.join("&"):""}class Hi{constructor(t,e){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then((()=>{t(this)})).catch((t=>{this.error(t)}))}next(t){this.forEachObserver((e=>{e.next(t)}))}error(t){this.forEachObserver((e=>{e.error(t)})),this.close(t)}complete(){this.forEachObserver((t=>{t.complete()})),this.close()}subscribe(t,e,i){let o;if(void 0===t&&void 0===e&&void 0===i)throw new Error("Missing Observer.");o=function(t,e){if("object"!=typeof t||null===t)return!1;for(const i of e)if(i in t&&"function"==typeof t[i])return!0;return!1}(t,["next","error","complete"])?t:{next:t,error:e,complete:i},void 0===o.next&&(o.next=Gi),void 0===o.error&&(o.error=Gi),void 0===o.complete&&(o.complete=Gi);const n=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((()=>{try{this.finalError?o.error(this.finalError):o.complete()}catch(t){}})),this.observers.push(o),n}unsubscribeOne(t){void 0!==this.observers&&void 0!==this.observers[t]&&(delete this.observers[t],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let e=0;e<this.observers.length;e++)this.sendOne(e,t)}sendOne(t,e){this.task.then((()=>{if(void 0!==this.observers&&void 0!==this.observers[t])try{e(this.observers[t])}catch(t){"undefined"!=typeof console&&console.error&&console.error(t)}}))}close(t){this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then((()=>{this.observers=void 0,this.onNoObservers=void 0})))}}function Gi(){}
171
171
  /**
172
172
  * @license
173
173
  * Copyright 2021 Google LLC
@@ -183,7 +183,7 @@ class Ri{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new P
183
183
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
184
184
  * See the License for the specific language governing permissions and
185
185
  * limitations under the License.
186
- */function Gi(t){return t&&t._delegate?t._delegate:t}class Wi{constructor(t,e,i){this.name=t,this.instanceFactory=e,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}
186
+ */function Wi(t){return t&&t._delegate?t._delegate:t}class qi{constructor(t,e,i){this.name=t,this.instanceFactory=e,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}
187
187
  /**
188
188
  * @license
189
189
  * Copyright 2019 Google LLC
@@ -199,7 +199,7 @@ class Ri{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new P
199
199
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
200
  * See the License for the specific language governing permissions and
201
201
  * limitations under the License.
202
- */const qi="[DEFAULT]";
202
+ */const Zi="[DEFAULT]";
203
203
  /**
204
204
  * @license
205
205
  * Copyright 2019 Google LLC
@@ -215,7 +215,7 @@ class Ri{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new P
215
215
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
216
216
  * See the License for the specific language governing permissions and
217
217
  * limitations under the License.
218
- */class Zi{constructor(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const e=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(e)){const t=new Ri;if(this.instancesDeferred.set(e,t),this.isInitialized(e)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:e});i&&t.resolve(i)}catch(t){}}return this.instancesDeferred.get(e).promise}getImmediate(t){var e;const i=this.normalizeInstanceIdentifier(null==t?void 0:t.identifier),o=null!==(e=null==t?void 0:t.optional)&&void 0!==e&&e;if(!this.isInitialized(i)&&!this.shouldAutoInitialize()){if(o)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:i})}catch(t){if(o)return null;throw t}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,this.shouldAutoInitialize()){if(function(t){return"EAGER"===t.instantiationMode}
218
+ */class Ki{constructor(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const e=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(e)){const t=new Di;if(this.instancesDeferred.set(e,t),this.isInitialized(e)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:e});i&&t.resolve(i)}catch(t){}}return this.instancesDeferred.get(e).promise}getImmediate(t){var e;const i=this.normalizeInstanceIdentifier(null==t?void 0:t.identifier),o=null!==(e=null==t?void 0:t.optional)&&void 0!==e&&e;if(!this.isInitialized(i)&&!this.shouldAutoInitialize()){if(o)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:i})}catch(t){if(o)return null;throw t}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,this.shouldAutoInitialize()){if(function(t){return"EAGER"===t.instantiationMode}
219
219
  /**
220
220
  * @license
221
221
  * Copyright 2019 Google LLC
@@ -231,7 +231,7 @@ class Ri{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new P
231
231
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
232
232
  * See the License for the specific language governing permissions and
233
233
  * limitations under the License.
234
- */(t))try{this.getOrInitializeService({instanceIdentifier:qi})}catch(t){}for(const[t,e]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(t);try{const t=this.getOrInitializeService({instanceIdentifier:i});e.resolve(t)}catch(t){}}}}clearInstance(t=qi){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter((t=>"INTERNAL"in t)).map((t=>t.INTERNAL.delete())),...t.filter((t=>"_delete"in t)).map((t=>t._delete()))])}isComponentSet(){return null!=this.component}isInitialized(t=qi){return this.instances.has(t)}getOptions(t=qi){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:e={}}=t,i=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(i))throw Error(`${this.name}(${i}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const o=this.getOrInitializeService({instanceIdentifier:i,options:e});for(const[t,e]of this.instancesDeferred.entries()){i===this.normalizeInstanceIdentifier(t)&&e.resolve(o)}return o}onInit(t,e){var i;const o=this.normalizeInstanceIdentifier(e),n=null!==(i=this.onInitCallbacks.get(o))&&void 0!==i?i:new Set;n.add(t),this.onInitCallbacks.set(o,n);const r=this.instances.get(o);return r&&t(r,o),()=>{n.delete(t)}}invokeOnInitCallbacks(t,e){const i=this.onInitCallbacks.get(e);if(i)for(const o of i)try{o(t,e)}catch(t){}}getOrInitializeService({instanceIdentifier:t,options:e={}}){let i=this.instances.get(t);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:(o=t,o===qi?void 0:o),options:e}),this.instances.set(t,i),this.instancesOptions.set(t,e),this.invokeOnInitCallbacks(i,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,i)}catch(t){}var o;return i||null}normalizeInstanceIdentifier(t=qi){return this.component?this.component.multipleInstances?t:qi:t}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class Ki{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const e=this.getProvider(t.name);if(e.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);e.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const e=new Zi(t,this);return this.providers.set(t,e),e}getProviders(){return Array.from(this.providers.values())}}
234
+ */(t))try{this.getOrInitializeService({instanceIdentifier:Zi})}catch(t){}for(const[t,e]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(t);try{const t=this.getOrInitializeService({instanceIdentifier:i});e.resolve(t)}catch(t){}}}}clearInstance(t=Zi){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter((t=>"INTERNAL"in t)).map((t=>t.INTERNAL.delete())),...t.filter((t=>"_delete"in t)).map((t=>t._delete()))])}isComponentSet(){return null!=this.component}isInitialized(t=Zi){return this.instances.has(t)}getOptions(t=Zi){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:e={}}=t,i=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(i))throw Error(`${this.name}(${i}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const o=this.getOrInitializeService({instanceIdentifier:i,options:e});for(const[t,e]of this.instancesDeferred.entries()){i===this.normalizeInstanceIdentifier(t)&&e.resolve(o)}return o}onInit(t,e){var i;const o=this.normalizeInstanceIdentifier(e),n=null!==(i=this.onInitCallbacks.get(o))&&void 0!==i?i:new Set;n.add(t),this.onInitCallbacks.set(o,n);const r=this.instances.get(o);return r&&t(r,o),()=>{n.delete(t)}}invokeOnInitCallbacks(t,e){const i=this.onInitCallbacks.get(e);if(i)for(const o of i)try{o(t,e)}catch(t){}}getOrInitializeService({instanceIdentifier:t,options:e={}}){let i=this.instances.get(t);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:(o=t,o===Zi?void 0:o),options:e}),this.instances.set(t,i),this.instancesOptions.set(t,e),this.invokeOnInitCallbacks(i,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,i)}catch(t){}var o;return i||null}normalizeInstanceIdentifier(t=Zi){return this.component?this.component.multipleInstances?t:Zi:t}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class Ji{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const e=this.getProvider(t.name);if(e.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);e.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const e=new Ki(t,this);return this.providers.set(t,e),e}getProviders(){return Array.from(this.providers.values())}}
235
235
  /**
236
236
  * @license
237
237
  * Copyright 2017 Google LLC
@@ -247,7 +247,7 @@ class Ri{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new P
247
247
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
248
248
  * See the License for the specific language governing permissions and
249
249
  * limitations under the License.
250
- */var Ji;!function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"}(Ji||(Ji={}));const Yi={debug:Ji.DEBUG,verbose:Ji.VERBOSE,info:Ji.INFO,warn:Ji.WARN,error:Ji.ERROR,silent:Ji.SILENT},Qi=Ji.INFO,Xi={[Ji.DEBUG]:"log",[Ji.VERBOSE]:"log",[Ji.INFO]:"info",[Ji.WARN]:"warn",[Ji.ERROR]:"error"},to=(t,e,...i)=>{if(e<t.logLevel)return;const o=(new Date).toISOString(),n=Xi[e];if(!n)throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`);console[n](`[${o}] ${t.name}:`,...i)};class eo{constructor(t){this.name=t,this._logLevel=Qi,this._logHandler=to,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in Ji))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel="string"==typeof t?Yi[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,Ji.DEBUG,...t),this._logHandler(this,Ji.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,Ji.VERBOSE,...t),this._logHandler(this,Ji.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,Ji.INFO,...t),this._logHandler(this,Ji.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,Ji.WARN,...t),this._logHandler(this,Ji.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,Ji.ERROR,...t),this._logHandler(this,Ji.ERROR,...t)}}let io,oo;const no=new WeakMap,ro=new WeakMap,so=new WeakMap,ao=new WeakMap,lo=new WeakMap;let co={get(t,e,i){if(t instanceof IDBTransaction){if("done"===e)return ro.get(t);if("objectStoreNames"===e)return t.objectStoreNames||so.get(t);if("store"===e)return i.objectStoreNames[1]?void 0:i.objectStore(i.objectStoreNames[0])}return po(t[e])},set:(t,e,i)=>(t[e]=i,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function ho(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(oo||(oo=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(vo(this),e),po(no.get(this))}:function(...e){return po(t.apply(vo(this),e))}:function(e,...i){const o=t.call(vo(this),e,...i);return so.set(o,e.sort?e.sort():[e]),po(o)}}function uo(t){return"function"==typeof t?ho(t):(t instanceof IDBTransaction&&function(t){if(ro.has(t))return;const e=new Promise(((e,i)=>{const o=()=>{t.removeEventListener("complete",n),t.removeEventListener("error",r),t.removeEventListener("abort",r)},n=()=>{e(),o()},r=()=>{i(t.error||new DOMException("AbortError","AbortError")),o()};t.addEventListener("complete",n),t.addEventListener("error",r),t.addEventListener("abort",r)}));ro.set(t,e)}(t),e=t,(io||(io=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((t=>e instanceof t))?new Proxy(t,co):t);var e}function po(t){if(t instanceof IDBRequest)return function(t){const e=new Promise(((e,i)=>{const o=()=>{t.removeEventListener("success",n),t.removeEventListener("error",r)},n=()=>{e(po(t.result)),o()},r=()=>{i(t.error),o()};t.addEventListener("success",n),t.addEventListener("error",r)}));return e.then((e=>{e instanceof IDBCursor&&no.set(e,t)})).catch((()=>{})),lo.set(e,t),e}(t);if(ao.has(t))return ao.get(t);const e=uo(t);return e!==t&&(ao.set(t,e),lo.set(e,t)),e}const vo=t=>lo.get(t);const go=["get","getKey","getAll","getAllKeys","count"],fo=["put","add","delete","clear"],mo=new Map;function wo(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(mo.get(e))return mo.get(e);const i=e.replace(/FromIndex$/,""),o=e!==i,n=fo.includes(i);if(!(i in(o?IDBIndex:IDBObjectStore).prototype)||!n&&!go.includes(i))return;const r=async function(t,...e){const r=this.transaction(t,n?"readwrite":"readonly");let s=r.store;return o&&(s=s.index(e.shift())),(await Promise.all([s[i](...e),n&&r.done]))[0]};return mo.set(e,r),r}co=(t=>({...t,get:(e,i,o)=>wo(e,i)||t.get(e,i,o),has:(e,i)=>!!wo(e,i)||t.has(e,i)}))(co);
250
+ */var Yi;!function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"}(Yi||(Yi={}));const Qi={debug:Yi.DEBUG,verbose:Yi.VERBOSE,info:Yi.INFO,warn:Yi.WARN,error:Yi.ERROR,silent:Yi.SILENT},Xi=Yi.INFO,to={[Yi.DEBUG]:"log",[Yi.VERBOSE]:"log",[Yi.INFO]:"info",[Yi.WARN]:"warn",[Yi.ERROR]:"error"},eo=(t,e,...i)=>{if(e<t.logLevel)return;const o=(new Date).toISOString(),n=to[e];if(!n)throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`);console[n](`[${o}] ${t.name}:`,...i)};class io{constructor(t){this.name=t,this._logLevel=Xi,this._logHandler=eo,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in Yi))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel="string"==typeof t?Qi[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,Yi.DEBUG,...t),this._logHandler(this,Yi.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,Yi.VERBOSE,...t),this._logHandler(this,Yi.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,Yi.INFO,...t),this._logHandler(this,Yi.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,Yi.WARN,...t),this._logHandler(this,Yi.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,Yi.ERROR,...t),this._logHandler(this,Yi.ERROR,...t)}}let oo,no;const ro=new WeakMap,so=new WeakMap,ao=new WeakMap,lo=new WeakMap,co=new WeakMap;let ho={get(t,e,i){if(t instanceof IDBTransaction){if("done"===e)return so.get(t);if("objectStoreNames"===e)return t.objectStoreNames||ao.get(t);if("store"===e)return i.objectStoreNames[1]?void 0:i.objectStore(i.objectStoreNames[0])}return vo(t[e])},set:(t,e,i)=>(t[e]=i,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function uo(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(no||(no=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(go(this),e),vo(ro.get(this))}:function(...e){return vo(t.apply(go(this),e))}:function(e,...i){const o=t.call(go(this),e,...i);return ao.set(o,e.sort?e.sort():[e]),vo(o)}}function po(t){return"function"==typeof t?uo(t):(t instanceof IDBTransaction&&function(t){if(so.has(t))return;const e=new Promise(((e,i)=>{const o=()=>{t.removeEventListener("complete",n),t.removeEventListener("error",r),t.removeEventListener("abort",r)},n=()=>{e(),o()},r=()=>{i(t.error||new DOMException("AbortError","AbortError")),o()};t.addEventListener("complete",n),t.addEventListener("error",r),t.addEventListener("abort",r)}));so.set(t,e)}(t),e=t,(oo||(oo=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((t=>e instanceof t))?new Proxy(t,ho):t);var e}function vo(t){if(t instanceof IDBRequest)return function(t){const e=new Promise(((e,i)=>{const o=()=>{t.removeEventListener("success",n),t.removeEventListener("error",r)},n=()=>{e(vo(t.result)),o()},r=()=>{i(t.error),o()};t.addEventListener("success",n),t.addEventListener("error",r)}));return e.then((e=>{e instanceof IDBCursor&&ro.set(e,t)})).catch((()=>{})),co.set(e,t),e}(t);if(lo.has(t))return lo.get(t);const e=po(t);return e!==t&&(lo.set(t,e),co.set(e,t)),e}const go=t=>co.get(t);const fo=["get","getKey","getAll","getAllKeys","count"],mo=["put","add","delete","clear"],wo=new Map;function yo(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(wo.get(e))return wo.get(e);const i=e.replace(/FromIndex$/,""),o=e!==i,n=mo.includes(i);if(!(i in(o?IDBIndex:IDBObjectStore).prototype)||!n&&!fo.includes(i))return;const r=async function(t,...e){const r=this.transaction(t,n?"readwrite":"readonly");let s=r.store;return o&&(s=s.index(e.shift())),(await Promise.all([s[i](...e),n&&r.done]))[0]};return wo.set(e,r),r}ho=(t=>({...t,get:(e,i,o)=>yo(e,i)||t.get(e,i,o),has:(e,i)=>!!yo(e,i)||t.has(e,i)}))(ho);
251
251
  /**
252
252
  * @license
253
253
  * Copyright 2019 Google LLC
@@ -264,7 +264,7 @@ class Ri{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new P
264
264
  * See the License for the specific language governing permissions and
265
265
  * limitations under the License.
266
266
  */
267
- class yo{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map((t=>{if(function(t){const e=t.getComponent();return"VERSION"===(null==e?void 0:e.type)}(t)){const e=t.getImmediate();return`${e.library}/${e.version}`}return null})).filter((t=>t)).join(" ")}}const bo="@firebase/app",Co="0.11.4",xo=new eo("@firebase/app"),Eo="@firebase/app-compat",ko="@firebase/analytics-compat",So="@firebase/analytics",Mo="@firebase/app-check-compat",Ao="@firebase/app-check",To="@firebase/auth",Io="@firebase/auth-compat",_o="@firebase/database",$o="@firebase/data-connect",No="@firebase/database-compat",Oo="@firebase/functions",Lo="@firebase/functions-compat",Ro="@firebase/installations",Do="@firebase/installations-compat",Fo="@firebase/messaging",Po="@firebase/messaging-compat",jo="@firebase/performance",Vo="@firebase/performance-compat",Uo="@firebase/remote-config",Bo="@firebase/remote-config-compat",zo="@firebase/storage",Ho="@firebase/storage-compat",Go="@firebase/firestore",Wo="@firebase/vertexai",qo="@firebase/firestore-compat",Zo="firebase",Ko="[DEFAULT]",Jo={[bo]:"fire-core",[Eo]:"fire-core-compat",[So]:"fire-analytics",[ko]:"fire-analytics-compat",[Ao]:"fire-app-check",[Mo]:"fire-app-check-compat",[To]:"fire-auth",[Io]:"fire-auth-compat",[_o]:"fire-rtdb",[$o]:"fire-data-connect",[No]:"fire-rtdb-compat",[Oo]:"fire-fn",[Lo]:"fire-fn-compat",[Ro]:"fire-iid",[Do]:"fire-iid-compat",[Fo]:"fire-fcm",[Po]:"fire-fcm-compat",[jo]:"fire-perf",[Vo]:"fire-perf-compat",[Uo]:"fire-rc",[Bo]:"fire-rc-compat",[zo]:"fire-gcs",[Ho]:"fire-gcs-compat",[Go]:"fire-fst",[qo]:"fire-fst-compat",[Wo]:"fire-vertex","fire-js":"fire-js",[Zo]:"fire-js-all"},Yo=new Map,Qo=new Map,Xo=new Map;function tn(t,e){try{t.container.addComponent(e)}catch(i){xo.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,i)}}function en(t){const e=t.name;if(Xo.has(e))return xo.debug(`There were multiple attempts to register component ${e}.`),!1;Xo.set(e,t);for(const e of Yo.values())tn(e,t);for(const e of Qo.values())tn(e,t);return!0}function on(t,e){const i=t.container.getProvider("heartbeat").getImmediate({optional:!0});return i&&i.triggerHeartbeat(),t.container.getProvider(e)}function nn(t){return null!=t&&void 0!==t.settings}
267
+ class bo{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map((t=>{if(function(t){const e=t.getComponent();return"VERSION"===(null==e?void 0:e.type)}(t)){const e=t.getImmediate();return`${e.library}/${e.version}`}return null})).filter((t=>t)).join(" ")}}const Co="@firebase/app",xo="0.11.4",Eo=new io("@firebase/app"),ko="@firebase/app-compat",So="@firebase/analytics-compat",Ao="@firebase/analytics",Mo="@firebase/app-check-compat",To="@firebase/app-check",Io="@firebase/auth",_o="@firebase/auth-compat",$o="@firebase/database",No="@firebase/data-connect",Oo="@firebase/database-compat",Lo="@firebase/functions",Ro="@firebase/functions-compat",Do="@firebase/installations",Fo="@firebase/installations-compat",Po="@firebase/messaging",jo="@firebase/messaging-compat",Vo="@firebase/performance",Uo="@firebase/performance-compat",Bo="@firebase/remote-config",zo="@firebase/remote-config-compat",Ho="@firebase/storage",Go="@firebase/storage-compat",Wo="@firebase/firestore",qo="@firebase/vertexai",Zo="@firebase/firestore-compat",Ko="firebase",Jo="[DEFAULT]",Yo={[Co]:"fire-core",[ko]:"fire-core-compat",[Ao]:"fire-analytics",[So]:"fire-analytics-compat",[To]:"fire-app-check",[Mo]:"fire-app-check-compat",[Io]:"fire-auth",[_o]:"fire-auth-compat",[$o]:"fire-rtdb",[No]:"fire-data-connect",[Oo]:"fire-rtdb-compat",[Lo]:"fire-fn",[Ro]:"fire-fn-compat",[Do]:"fire-iid",[Fo]:"fire-iid-compat",[Po]:"fire-fcm",[jo]:"fire-fcm-compat",[Vo]:"fire-perf",[Uo]:"fire-perf-compat",[Bo]:"fire-rc",[zo]:"fire-rc-compat",[Ho]:"fire-gcs",[Go]:"fire-gcs-compat",[Wo]:"fire-fst",[Zo]:"fire-fst-compat",[qo]:"fire-vertex","fire-js":"fire-js",[Ko]:"fire-js-all"},Qo=new Map,Xo=new Map,tn=new Map;function en(t,e){try{t.container.addComponent(e)}catch(i){Eo.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,i)}}function on(t){const e=t.name;if(tn.has(e))return Eo.debug(`There were multiple attempts to register component ${e}.`),!1;tn.set(e,t);for(const e of Qo.values())en(e,t);for(const e of Xo.values())en(e,t);return!0}function nn(t,e){const i=t.container.getProvider("heartbeat").getImmediate({optional:!0});return i&&i.triggerHeartbeat(),t.container.getProvider(e)}function rn(t){return null!=t&&void 0!==t.settings}
268
268
  /**
269
269
  * @license
270
270
  * Copyright 2019 Google LLC
@@ -280,7 +280,7 @@ class yo{constructor(t){this.container=t}getPlatformInfoString(){return this.con
280
280
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
281
281
  * See the License for the specific language governing permissions and
282
282
  * limitations under the License.
283
- */const rn=new Pi("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."});
283
+ */const sn=new ji("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."});
284
284
  /**
285
285
  * @license
286
286
  * Copyright 2019 Google LLC
@@ -297,7 +297,7 @@ class yo{constructor(t){this.container=t}getPlatformInfoString(){return this.con
297
297
  * See the License for the specific language governing permissions and
298
298
  * limitations under the License.
299
299
  */
300
- class sn{constructor(t,e,i){this._isDeleted=!1,this._options=Object.assign({},t),this._config=Object.assign({},e),this._name=e.name,this._automaticDataCollectionEnabled=e.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new Wi("app",(()=>this),"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw rn.create("app-deleted",{appName:this._name})}}
300
+ class an{constructor(t,e,i){this._isDeleted=!1,this._options=Object.assign({},t),this._config=Object.assign({},e),this._name=e.name,this._automaticDataCollectionEnabled=e.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new qi("app",(()=>this),"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw sn.create("app-deleted",{appName:this._name})}}
301
301
  /**
302
302
  * @license
303
303
  * Copyright 2019 Google LLC
@@ -313,7 +313,7 @@ class sn{constructor(t,e,i){this._isDeleted=!1,this._options=Object.assign({},t)
313
313
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
314
314
  * See the License for the specific language governing permissions and
315
315
  * limitations under the License.
316
- */const an="11.6.0";function ln(t,e={}){let i=t;if("object"!=typeof e){e={name:e}}const o=Object.assign({name:Ko,automaticDataCollectionEnabled:!1},e),n=o.name;if("string"!=typeof n||!n)throw rn.create("bad-app-name",{appName:String(n)});if(i||(i=Oi()),!i)throw rn.create("no-options");const r=Yo.get(n);if(r){if(Vi(i,r.options)&&Vi(o,r.config))return r;throw rn.create("duplicate-app",{appName:n})}const s=new Ki(n);for(const t of Xo.values())s.addComponent(t);const a=new sn(i,o,s);return Yo.set(n,a),a}function cn(t=Ko){const e=Yo.get(t);if(!e&&t===Ko&&Oi())return ln();if(!e)throw rn.create("no-app",{appName:t});return e}function dn(t,e,i){var o;let n=null!==(o=Jo[t])&&void 0!==o?o:t;i&&(n+=`-${i}`);const r=n.match(/\s|\//),s=e.match(/\s|\//);if(r||s){const t=[`Unable to register library "${n}" with version "${e}":`];return r&&t.push(`library name "${n}" contains illegal characters (whitespace or "/")`),r&&s&&t.push("and"),s&&t.push(`version name "${e}" contains illegal characters (whitespace or "/")`),void xo.warn(t.join(" "))}en(new Wi(`${n}-version`,(()=>({library:n,version:e})),"VERSION"))}
316
+ */const ln="11.6.0";function cn(t,e={}){let i=t;if("object"!=typeof e){e={name:e}}const o=Object.assign({name:Jo,automaticDataCollectionEnabled:!1},e),n=o.name;if("string"!=typeof n||!n)throw sn.create("bad-app-name",{appName:String(n)});if(i||(i=Li()),!i)throw sn.create("no-options");const r=Qo.get(n);if(r){if(Ui(i,r.options)&&Ui(o,r.config))return r;throw sn.create("duplicate-app",{appName:n})}const s=new Ji(n);for(const t of tn.values())s.addComponent(t);const a=new an(i,o,s);return Qo.set(n,a),a}function dn(t=Jo){const e=Qo.get(t);if(!e&&t===Jo&&Li())return cn();if(!e)throw sn.create("no-app",{appName:t});return e}function hn(t,e,i){var o;let n=null!==(o=Yo[t])&&void 0!==o?o:t;i&&(n+=`-${i}`);const r=n.match(/\s|\//),s=e.match(/\s|\//);if(r||s){const t=[`Unable to register library "${n}" with version "${e}":`];return r&&t.push(`library name "${n}" contains illegal characters (whitespace or "/")`),r&&s&&t.push("and"),s&&t.push(`version name "${e}" contains illegal characters (whitespace or "/")`),void Eo.warn(t.join(" "))}on(new qi(`${n}-version`,(()=>({library:n,version:e})),"VERSION"))}
317
317
  /**
318
318
  * @license
319
319
  * Copyright 2021 Google LLC
@@ -329,7 +329,7 @@ class sn{constructor(t,e,i){this._isDeleted=!1,this._options=Object.assign({},t)
329
329
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
330
330
  * See the License for the specific language governing permissions and
331
331
  * limitations under the License.
332
- */const hn="firebase-heartbeat-store";let un=null;function pn(){return un||(un=function(t,e,{blocked:i,upgrade:o,blocking:n,terminated:r}={}){const s=indexedDB.open(t,e),a=po(s);return o&&s.addEventListener("upgradeneeded",(t=>{o(po(s.result),t.oldVersion,t.newVersion,po(s.transaction),t)})),i&&s.addEventListener("blocked",(t=>i(t.oldVersion,t.newVersion,t))),a.then((t=>{r&&t.addEventListener("close",(()=>r())),n&&t.addEventListener("versionchange",(t=>n(t.oldVersion,t.newVersion,t)))})).catch((()=>{})),a}("firebase-heartbeat-database",1,{upgrade:(t,e)=>{if(0===e)try{t.createObjectStore(hn)}catch(t){console.warn(t)}}}).catch((t=>{throw rn.create("idb-open",{originalErrorMessage:t.message})}))),un}async function vn(t,e){try{const i=(await pn()).transaction(hn,"readwrite"),o=i.objectStore(hn);await o.put(e,gn(t)),await i.done}catch(t){if(t instanceof Fi)xo.warn(t.message);else{const e=rn.create("idb-set",{originalErrorMessage:null==t?void 0:t.message});xo.warn(e.message)}}}function gn(t){return`${t.name}!${t.options.appId}`}
332
+ */const un="firebase-heartbeat-store";let pn=null;function vn(){return pn||(pn=function(t,e,{blocked:i,upgrade:o,blocking:n,terminated:r}={}){const s=indexedDB.open(t,e),a=vo(s);return o&&s.addEventListener("upgradeneeded",(t=>{o(vo(s.result),t.oldVersion,t.newVersion,vo(s.transaction),t)})),i&&s.addEventListener("blocked",(t=>i(t.oldVersion,t.newVersion,t))),a.then((t=>{r&&t.addEventListener("close",(()=>r())),n&&t.addEventListener("versionchange",(t=>n(t.oldVersion,t.newVersion,t)))})).catch((()=>{})),a}("firebase-heartbeat-database",1,{upgrade:(t,e)=>{if(0===e)try{t.createObjectStore(un)}catch(t){console.warn(t)}}}).catch((t=>{throw sn.create("idb-open",{originalErrorMessage:t.message})}))),pn}async function gn(t,e){try{const i=(await vn()).transaction(un,"readwrite"),o=i.objectStore(un);await o.put(e,fn(t)),await i.done}catch(t){if(t instanceof Pi)Eo.warn(t.message);else{const e=sn.create("idb-set",{originalErrorMessage:null==t?void 0:t.message});Eo.warn(e.message)}}}function fn(t){return`${t.name}!${t.options.appId}`}
333
333
  /**
334
334
  * @license
335
335
  * Copyright 2021 Google LLC
@@ -345,7 +345,7 @@ class sn{constructor(t,e,i){this._isDeleted=!1,this._options=Object.assign({},t)
345
345
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
346
346
  * See the License for the specific language governing permissions and
347
347
  * limitations under the License.
348
- */class fn{constructor(t){this.container=t,this._heartbeatsCache=null;const e=this.container.getProvider("app").getImmediate();this._storage=new wn(e),this._heartbeatsCachePromise=this._storage.read().then((t=>(this._heartbeatsCache=t,t)))}async triggerHeartbeat(){var t,e;try{const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=mn();if(null==(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)))return;if(this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some((t=>t.date===o)))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:i}),this._heartbeatsCache.heartbeats.length>30){const t=function(t){if(0===t.length)return-1;let e=0,i=t[0].date;for(let o=1;o<t.length;o++)t[o].date<i&&(i=t[o].date,e=o);return e}
348
+ */class mn{constructor(t){this.container=t,this._heartbeatsCache=null;const e=this.container.getProvider("app").getImmediate();this._storage=new yn(e),this._heartbeatsCachePromise=this._storage.read().then((t=>(this._heartbeatsCache=t,t)))}async triggerHeartbeat(){var t,e;try{const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=wn();if(null==(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)))return;if(this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some((t=>t.date===o)))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:i}),this._heartbeatsCache.heartbeats.length>30){const t=function(t){if(0===t.length)return-1;let e=0,i=t[0].date;for(let o=1;o<t.length;o++)t[o].date<i&&(i=t[o].date,e=o);return e}
349
349
  /**
350
350
  * @license
351
351
  * Copyright 2019 Google LLC
@@ -361,7 +361,7 @@ class sn{constructor(t,e,i){this._isDeleted=!1,this._options=Object.assign({},t)
361
361
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
362
362
  * See the License for the specific language governing permissions and
363
363
  * limitations under the License.
364
- */(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(t,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(t){xo.warn(t)}}async getHeartbeatsHeader(){var t;try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";const e=mn(),{heartbeatsToSend:i,unsentEntries:o}=function(t,e=1024){const i=[];let o=t.slice();for(const n of t){const t=i.find((t=>t.agent===n.agent));if(t){if(t.dates.push(n.date),yn(i)>e){t.dates.pop();break}}else if(i.push({agent:n.agent,dates:[n.date]}),yn(i)>e){i.pop();break}o=o.slice(1)}return{heartbeatsToSend:i,unsentEntries:o}}(this._heartbeatsCache.heartbeats),n=Ti(JSON.stringify({version:2,heartbeats:i}));return this._heartbeatsCache.lastSentHeartbeatDate=e,o.length>0?(this._heartbeatsCache.heartbeats=o,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),n}catch(t){return xo.warn(t),""}}}function mn(){return(new Date).toISOString().substring(0,10)}class wn{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!function(){try{return"object"==typeof indexedDB}catch(t){return!1}}()&&new Promise(((t,e)=>{try{let i=!0;const o="validate-browser-context-for-indexeddb-analytics-module",n=self.indexedDB.open(o);n.onsuccess=()=>{n.result.close(),i||self.indexedDB.deleteDatabase(o),t(!0)},n.onupgradeneeded=()=>{i=!1},n.onerror=()=>{var t;e((null===(t=n.error)||void 0===t?void 0:t.message)||"")}}catch(t){e(t)}})).then((()=>!0)).catch((()=>!1))}async read(){if(await this._canUseIndexedDBPromise){const t=await async function(t){try{const e=(await pn()).transaction(hn),i=await e.objectStore(hn).get(gn(t));return await e.done,i}catch(t){if(t instanceof Fi)xo.warn(t.message);else{const e=rn.create("idb-get",{originalErrorMessage:null==t?void 0:t.message});xo.warn(e.message)}}}(this.app);return(null==t?void 0:t.heartbeats)?t:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(t){var e;if(await this._canUseIndexedDBPromise){const i=await this.read();return vn(this.app,{lastSentHeartbeatDate:null!==(e=t.lastSentHeartbeatDate)&&void 0!==e?e:i.lastSentHeartbeatDate,heartbeats:t.heartbeats})}}async add(t){var e;if(await this._canUseIndexedDBPromise){const i=await this.read();return vn(this.app,{lastSentHeartbeatDate:null!==(e=t.lastSentHeartbeatDate)&&void 0!==e?e:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...t.heartbeats]})}}}function yn(t){return Ti(JSON.stringify({version:2,heartbeats:t})).length}var bn;bn="",en(new Wi("platform-logger",(t=>new yo(t)),"PRIVATE")),en(new Wi("heartbeat",(t=>new fn(t)),"PRIVATE")),dn(bo,Co,bn),dn(bo,Co,"esm2017"),dn("fire-js","");
364
+ */(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(t,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(t){Eo.warn(t)}}async getHeartbeatsHeader(){var t;try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";const e=wn(),{heartbeatsToSend:i,unsentEntries:o}=function(t,e=1024){const i=[];let o=t.slice();for(const n of t){const t=i.find((t=>t.agent===n.agent));if(t){if(t.dates.push(n.date),bn(i)>e){t.dates.pop();break}}else if(i.push({agent:n.agent,dates:[n.date]}),bn(i)>e){i.pop();break}o=o.slice(1)}return{heartbeatsToSend:i,unsentEntries:o}}(this._heartbeatsCache.heartbeats),n=Ii(JSON.stringify({version:2,heartbeats:i}));return this._heartbeatsCache.lastSentHeartbeatDate=e,o.length>0?(this._heartbeatsCache.heartbeats=o,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),n}catch(t){return Eo.warn(t),""}}}function wn(){return(new Date).toISOString().substring(0,10)}class yn{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!function(){try{return"object"==typeof indexedDB}catch(t){return!1}}()&&new Promise(((t,e)=>{try{let i=!0;const o="validate-browser-context-for-indexeddb-analytics-module",n=self.indexedDB.open(o);n.onsuccess=()=>{n.result.close(),i||self.indexedDB.deleteDatabase(o),t(!0)},n.onupgradeneeded=()=>{i=!1},n.onerror=()=>{var t;e((null===(t=n.error)||void 0===t?void 0:t.message)||"")}}catch(t){e(t)}})).then((()=>!0)).catch((()=>!1))}async read(){if(await this._canUseIndexedDBPromise){const t=await async function(t){try{const e=(await vn()).transaction(un),i=await e.objectStore(un).get(fn(t));return await e.done,i}catch(t){if(t instanceof Pi)Eo.warn(t.message);else{const e=sn.create("idb-get",{originalErrorMessage:null==t?void 0:t.message});Eo.warn(e.message)}}}(this.app);return(null==t?void 0:t.heartbeats)?t:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(t){var e;if(await this._canUseIndexedDBPromise){const i=await this.read();return gn(this.app,{lastSentHeartbeatDate:null!==(e=t.lastSentHeartbeatDate)&&void 0!==e?e:i.lastSentHeartbeatDate,heartbeats:t.heartbeats})}}async add(t){var e;if(await this._canUseIndexedDBPromise){const i=await this.read();return gn(this.app,{lastSentHeartbeatDate:null!==(e=t.lastSentHeartbeatDate)&&void 0!==e?e:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...t.heartbeats]})}}}function bn(t){return Ii(JSON.stringify({version:2,heartbeats:t})).length}var Cn;Cn="",on(new qi("platform-logger",(t=>new bo(t)),"PRIVATE")),on(new qi("heartbeat",(t=>new mn(t)),"PRIVATE")),hn(Co,xo,Cn),hn(Co,xo,"esm2017"),hn("fire-js","");
365
365
  /**
366
366
  * @license
367
367
  * Copyright 2020 Google LLC
@@ -378,7 +378,7 @@ class sn{constructor(t,e,i){this._isDeleted=!1,this._options=Object.assign({},t)
378
378
  * See the License for the specific language governing permissions and
379
379
  * limitations under the License.
380
380
  */
381
- dn("firebase","11.6.0","app");function Cn(t,e){const i={};for(const o in t)t.hasOwnProperty(o)&&(i[o]=e(t[o]));return i}function xn(t){if(null==t)return null;if(t instanceof Number&&(t=t.valueOf()),"number"==typeof t&&isFinite(t))return t;if(!0===t||!1===t)return t;if("[object String]"===Object.prototype.toString.call(t))return t;if(t instanceof Date)return t.toISOString();if(Array.isArray(t))return t.map((t=>xn(t)));if("function"==typeof t||"object"==typeof t)return Cn(t,(t=>xn(t)));throw new Error("Data cannot be encoded in JSON: "+t)}function En(t){if(null==t)return t;if(t["@type"])switch(t["@type"]){case"type.googleapis.com/google.protobuf.Int64Value":case"type.googleapis.com/google.protobuf.UInt64Value":{const e=Number(t.value);if(isNaN(e))throw new Error("Data cannot be decoded from JSON: "+t);return e}default:throw new Error("Data cannot be decoded from JSON: "+t)}return Array.isArray(t)?t.map((t=>En(t))):"function"==typeof t||"object"==typeof t?Cn(t,(t=>En(t))):t}
381
+ hn("firebase","11.6.0","app");function xn(t,e){const i={};for(const o in t)t.hasOwnProperty(o)&&(i[o]=e(t[o]));return i}function En(t){if(null==t)return null;if(t instanceof Number&&(t=t.valueOf()),"number"==typeof t&&isFinite(t))return t;if(!0===t||!1===t)return t;if("[object String]"===Object.prototype.toString.call(t))return t;if(t instanceof Date)return t.toISOString();if(Array.isArray(t))return t.map((t=>En(t)));if("function"==typeof t||"object"==typeof t)return xn(t,(t=>En(t)));throw new Error("Data cannot be encoded in JSON: "+t)}function kn(t){if(null==t)return t;if(t["@type"])switch(t["@type"]){case"type.googleapis.com/google.protobuf.Int64Value":case"type.googleapis.com/google.protobuf.UInt64Value":{const e=Number(t.value);if(isNaN(e))throw new Error("Data cannot be decoded from JSON: "+t);return e}default:throw new Error("Data cannot be decoded from JSON: "+t)}return Array.isArray(t)?t.map((t=>kn(t))):"function"==typeof t||"object"==typeof t?xn(t,(t=>kn(t))):t}
382
382
  /**
383
383
  * @license
384
384
  * Copyright 2020 Google LLC
@@ -394,7 +394,7 @@ dn("firebase","11.6.0","app");function Cn(t,e){const i={};for(const o in t)t.has
394
394
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
395
395
  * See the License for the specific language governing permissions and
396
396
  * limitations under the License.
397
- */const kn="functions",Sn={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};
397
+ */const Sn="functions",An={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};
398
398
  /**
399
399
  * @license
400
400
  * Copyright 2017 Google LLC
@@ -410,7 +410,7 @@ dn("firebase","11.6.0","app");function Cn(t,e){const i={};for(const o in t)t.has
410
410
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
411
411
  * See the License for the specific language governing permissions and
412
412
  * limitations under the License.
413
- */class Mn extends Fi{constructor(t,e,i){super(`${kn}/${t}`,e||""),this.details=i,Object.setPrototypeOf(this,Mn.prototype)}}function An(t,e){let i,o=function(t){if(t>=200&&t<300)return"ok";switch(t){case 0:case 500:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}(t),n=o;try{const t=e&&e.error;if(t){const e=t.status;if("string"==typeof e){if(!Sn[e])return new Mn("internal","internal");o=Sn[e],n=e}const r=t.message;"string"==typeof r&&(n=r),i=t.details,void 0!==i&&(i=En(i))}}catch(t){}return"ok"===o?null:new Mn(o,n,i)}
413
+ */class Mn extends Pi{constructor(t,e,i){super(`${Sn}/${t}`,e||""),this.details=i,Object.setPrototypeOf(this,Mn.prototype)}}function Tn(t,e){let i,o=function(t){if(t>=200&&t<300)return"ok";switch(t){case 0:case 500:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}(t),n=o;try{const t=e&&e.error;if(t){const e=t.status;if("string"==typeof e){if(!An[e])return new Mn("internal","internal");o=An[e],n=e}const r=t.message;"string"==typeof r&&(n=r),i=t.details,void 0!==i&&(i=kn(i))}}catch(t){}return"ok"===o?null:new Mn(o,n,i)}
414
414
  /**
415
415
  * @license
416
416
  * Copyright 2017 Google LLC
@@ -426,7 +426,7 @@ dn("firebase","11.6.0","app");function Cn(t,e){const i={};for(const o in t)t.has
426
426
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
427
427
  * See the License for the specific language governing permissions and
428
428
  * limitations under the License.
429
- */class Tn{constructor(t,e,i,o){this.app=t,this.auth=null,this.messaging=null,this.appCheck=null,this.serverAppAppCheckToken=null,nn(t)&&t.settings.appCheckToken&&(this.serverAppAppCheckToken=t.settings.appCheckToken),this.auth=e.getImmediate({optional:!0}),this.messaging=i.getImmediate({optional:!0}),this.auth||e.get().then((t=>this.auth=t),(()=>{})),this.messaging||i.get().then((t=>this.messaging=t),(()=>{})),this.appCheck||null==o||o.get().then((t=>this.appCheck=t),(()=>{}))}async getAuthToken(){if(this.auth)try{const t=await this.auth.getToken();return null==t?void 0:t.accessToken}catch(t){return}}async getMessagingToken(){if(this.messaging&&"Notification"in self&&"granted"===Notification.permission)try{return await this.messaging.getToken()}catch(t){return}}async getAppCheckToken(t){if(this.serverAppAppCheckToken)return this.serverAppAppCheckToken;if(this.appCheck){const e=t?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return e.error?null:e.token}return null}async getContext(t){return{authToken:await this.getAuthToken(),messagingToken:await this.getMessagingToken(),appCheckToken:await this.getAppCheckToken(t)}}}
429
+ */class In{constructor(t,e,i,o){this.app=t,this.auth=null,this.messaging=null,this.appCheck=null,this.serverAppAppCheckToken=null,rn(t)&&t.settings.appCheckToken&&(this.serverAppAppCheckToken=t.settings.appCheckToken),this.auth=e.getImmediate({optional:!0}),this.messaging=i.getImmediate({optional:!0}),this.auth||e.get().then((t=>this.auth=t),(()=>{})),this.messaging||i.get().then((t=>this.messaging=t),(()=>{})),this.appCheck||null==o||o.get().then((t=>this.appCheck=t),(()=>{}))}async getAuthToken(){if(this.auth)try{const t=await this.auth.getToken();return null==t?void 0:t.accessToken}catch(t){return}}async getMessagingToken(){if(this.messaging&&"Notification"in self&&"granted"===Notification.permission)try{return await this.messaging.getToken()}catch(t){return}}async getAppCheckToken(t){if(this.serverAppAppCheckToken)return this.serverAppAppCheckToken;if(this.appCheck){const e=t?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return e.error?null:e.token}return null}async getContext(t){return{authToken:await this.getAuthToken(),messagingToken:await this.getMessagingToken(),appCheckToken:await this.getAppCheckToken(t)}}}
430
430
  /**
431
431
  * @license
432
432
  * Copyright 2017 Google LLC
@@ -442,7 +442,7 @@ dn("firebase","11.6.0","app");function Cn(t,e){const i={};for(const o in t)t.has
442
442
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
443
443
  * See the License for the specific language governing permissions and
444
444
  * limitations under the License.
445
- */const In="us-central1",_n=/^data: (.*?)(?:\n|$)/;class $n{constructor(t,e,i,o,n=In,r=(...t)=>fetch(...t)){this.app=t,this.fetchImpl=r,this.emulatorOrigin=null,this.contextProvider=new Tn(t,e,i,o),this.cancelAllRequests=new Promise((t=>{this.deleteService=()=>Promise.resolve(t())}));try{const t=new URL(n);this.customDomain=t.origin+("/"===t.pathname?"":t.pathname),this.region=In}catch(t){this.customDomain=null,this.region=n}}_delete(){return this.deleteService()}_url(t){const e=this.app.options.projectId;if(null!==this.emulatorOrigin){return`${this.emulatorOrigin}/${e}/${this.region}/${t}`}return null!==this.customDomain?`${this.customDomain}/${t}`:`https://${this.region}-${e}.cloudfunctions.net/${t}`}}function Nn(t,e,i){const o=o=>async function(t,e,i,o){i=xn(i);const n={data:i},r=await Ln(t,o),s=o.timeout||7e4,a=function(t){let e=null;return{promise:new Promise(((i,o)=>{e=setTimeout((()=>{o(new Mn("deadline-exceeded","deadline-exceeded"))}),t)})),cancel:()=>{e&&clearTimeout(e)}}}(s),l=await Promise.race([On(e,n,r,t.fetchImpl),a.promise,t.cancelAllRequests]);if(a.cancel(),!l)throw new Mn("cancelled","Firebase Functions instance was deleted.");const c=An(l.status,l.json);if(c)throw c;if(!l.json)throw new Mn("internal","Response is not valid JSON object.");let d=l.json.data;void 0===d&&(d=l.json.result);if(void 0===d)throw new Mn("internal","Response is missing data field.");return{data:En(d)}}(t,e,o,i||{});return o.stream=(i,o)=>async function(t,e,i,o){var n;i=xn(i);const r={data:i},s=await Ln(t,o);let a,l,c;s["Content-Type"]="application/json",s.Accept="text/event-stream";try{a=await t.fetchImpl(e,{method:"POST",body:JSON.stringify(r),headers:s,signal:null==o?void 0:o.signal})}catch(t){if(t instanceof Error&&"AbortError"===t.name){const t=new Mn("cancelled","Request was cancelled.");return{data:Promise.reject(t),stream:{[Symbol.asyncIterator]:()=>({next:()=>Promise.reject(t)})}}}const e=An(0,null);return{data:Promise.reject(e),stream:{[Symbol.asyncIterator]:()=>({next:()=>Promise.reject(e)})}}}const d=new Promise(((t,e)=>{l=t,c=e}));null===(n=null==o?void 0:o.signal)||void 0===n||n.addEventListener("abort",(()=>{const t=new Mn("cancelled","Request was cancelled.");c(t)}));const h=function(t,e,i,o){const n=(t,o)=>{const n=t.match(_n);if(!n)return;const r=n[1];try{const t=JSON.parse(r);if("result"in t)return void e(En(t.result));if("message"in t)return void o.enqueue(En(t.message));if("error"in t){const e=An(0,t);return o.error(e),void i(e)}}catch(t){if(t instanceof Mn)return o.error(t),void i(t)}},r=new TextDecoder;return new ReadableStream({start(e){let s="";return a();async function a(){if(null==o?void 0:o.aborted){const t=new Mn("cancelled","Request was cancelled");return e.error(t),i(t),Promise.resolve()}try{const{value:l,done:c}=await t.read();if(c)return s.trim()&&n(s.trim(),e),void e.close();if(null==o?void 0:o.aborted){const o=new Mn("cancelled","Request was cancelled");return e.error(o),i(o),void await t.cancel()}s+=r.decode(l,{stream:!0});const d=s.split("\n");s=d.pop()||"";for(const t of d)t.trim()&&n(t.trim(),e);return a()}catch(t){const o=t instanceof Mn?t:An(0,null);e.error(o),i(o)}}},cancel:()=>t.cancel()})}(a.body.getReader(),l,c,null==o?void 0:o.signal);return{stream:{[Symbol.asyncIterator](){const t=h.getReader();return{async next(){const{value:e,done:i}=await t.read();return{value:e,done:i}},return:async()=>(await t.cancel(),{done:!0,value:void 0})}}},data:d}}(t,e,i,o||{}),o}async function On(t,e,i,o){let n;i["Content-Type"]="application/json";try{n=await o(t,{method:"POST",body:JSON.stringify(e),headers:i})}catch(t){return{status:0,json:null}}let r=null;try{r=await n.json()}catch(t){}return{status:n.status,json:r}}async function Ln(t,e){const i={},o=await t.contextProvider.getContext(e.limitedUseAppCheckTokens);return o.authToken&&(i.Authorization="Bearer "+o.authToken),o.messagingToken&&(i["Firebase-Instance-ID-Token"]=o.messagingToken),null!==o.appCheckToken&&(i["X-Firebase-AppCheck"]=o.appCheckToken),i}const Rn="@firebase/functions",Dn="0.12.3";function Fn(t,e,i){return Nn(Gi(t),e,i)}function Pn(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i}function jn(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}!function(t){en(new Wi(kn,((t,{instanceIdentifier:e})=>{const i=t.getProvider("app").getImmediate(),o=t.getProvider("auth-internal"),n=t.getProvider("messaging-internal"),r=t.getProvider("app-check-internal");return new $n(i,o,n,r,e)}),"PUBLIC").setMultipleInstances(!0)),dn(Rn,Dn,t),dn(Rn,Dn,"esm2017")}
445
+ */const _n="us-central1",$n=/^data: (.*?)(?:\n|$)/;class Nn{constructor(t,e,i,o,n=_n,r=(...t)=>fetch(...t)){this.app=t,this.fetchImpl=r,this.emulatorOrigin=null,this.contextProvider=new In(t,e,i,o),this.cancelAllRequests=new Promise((t=>{this.deleteService=()=>Promise.resolve(t())}));try{const t=new URL(n);this.customDomain=t.origin+("/"===t.pathname?"":t.pathname),this.region=_n}catch(t){this.customDomain=null,this.region=n}}_delete(){return this.deleteService()}_url(t){const e=this.app.options.projectId;if(null!==this.emulatorOrigin){return`${this.emulatorOrigin}/${e}/${this.region}/${t}`}return null!==this.customDomain?`${this.customDomain}/${t}`:`https://${this.region}-${e}.cloudfunctions.net/${t}`}}function On(t,e,i){const o=o=>async function(t,e,i,o){i=En(i);const n={data:i},r=await Rn(t,o),s=o.timeout||7e4,a=function(t){let e=null;return{promise:new Promise(((i,o)=>{e=setTimeout((()=>{o(new Mn("deadline-exceeded","deadline-exceeded"))}),t)})),cancel:()=>{e&&clearTimeout(e)}}}(s),l=await Promise.race([Ln(e,n,r,t.fetchImpl),a.promise,t.cancelAllRequests]);if(a.cancel(),!l)throw new Mn("cancelled","Firebase Functions instance was deleted.");const c=Tn(l.status,l.json);if(c)throw c;if(!l.json)throw new Mn("internal","Response is not valid JSON object.");let d=l.json.data;void 0===d&&(d=l.json.result);if(void 0===d)throw new Mn("internal","Response is missing data field.");return{data:kn(d)}}(t,e,o,i||{});return o.stream=(i,o)=>async function(t,e,i,o){var n;i=En(i);const r={data:i},s=await Rn(t,o);let a,l,c;s["Content-Type"]="application/json",s.Accept="text/event-stream";try{a=await t.fetchImpl(e,{method:"POST",body:JSON.stringify(r),headers:s,signal:null==o?void 0:o.signal})}catch(t){if(t instanceof Error&&"AbortError"===t.name){const t=new Mn("cancelled","Request was cancelled.");return{data:Promise.reject(t),stream:{[Symbol.asyncIterator]:()=>({next:()=>Promise.reject(t)})}}}const e=Tn(0,null);return{data:Promise.reject(e),stream:{[Symbol.asyncIterator]:()=>({next:()=>Promise.reject(e)})}}}const d=new Promise(((t,e)=>{l=t,c=e}));null===(n=null==o?void 0:o.signal)||void 0===n||n.addEventListener("abort",(()=>{const t=new Mn("cancelled","Request was cancelled.");c(t)}));const h=function(t,e,i,o){const n=(t,o)=>{const n=t.match($n);if(!n)return;const r=n[1];try{const t=JSON.parse(r);if("result"in t)return void e(kn(t.result));if("message"in t)return void o.enqueue(kn(t.message));if("error"in t){const e=Tn(0,t);return o.error(e),void i(e)}}catch(t){if(t instanceof Mn)return o.error(t),void i(t)}},r=new TextDecoder;return new ReadableStream({start(e){let s="";return a();async function a(){if(null==o?void 0:o.aborted){const t=new Mn("cancelled","Request was cancelled");return e.error(t),i(t),Promise.resolve()}try{const{value:l,done:c}=await t.read();if(c)return s.trim()&&n(s.trim(),e),void e.close();if(null==o?void 0:o.aborted){const o=new Mn("cancelled","Request was cancelled");return e.error(o),i(o),void await t.cancel()}s+=r.decode(l,{stream:!0});const d=s.split("\n");s=d.pop()||"";for(const t of d)t.trim()&&n(t.trim(),e);return a()}catch(t){const o=t instanceof Mn?t:Tn(0,null);e.error(o),i(o)}}},cancel:()=>t.cancel()})}(a.body.getReader(),l,c,null==o?void 0:o.signal);return{stream:{[Symbol.asyncIterator](){const t=h.getReader();return{async next(){const{value:e,done:i}=await t.read();return{value:e,done:i}},return:async()=>(await t.cancel(),{done:!0,value:void 0})}}},data:d}}(t,e,i,o||{}),o}async function Ln(t,e,i,o){let n;i["Content-Type"]="application/json";try{n=await o(t,{method:"POST",body:JSON.stringify(e),headers:i})}catch(t){return{status:0,json:null}}let r=null;try{r=await n.json()}catch(t){}return{status:n.status,json:r}}async function Rn(t,e){const i={},o=await t.contextProvider.getContext(e.limitedUseAppCheckTokens);return o.authToken&&(i.Authorization="Bearer "+o.authToken),o.messagingToken&&(i["Firebase-Instance-ID-Token"]=o.messagingToken),null!==o.appCheckToken&&(i["X-Firebase-AppCheck"]=o.appCheckToken),i}const Dn="@firebase/functions",Fn="0.12.3";function Pn(t,e,i){return On(Wi(t),e,i)}function jn(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i}function Vn(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}!function(t){on(new qi(Sn,((t,{instanceIdentifier:e})=>{const i=t.getProvider("app").getImmediate(),o=t.getProvider("auth-internal"),n=t.getProvider("messaging-internal"),r=t.getProvider("app-check-internal");return new Nn(i,o,n,r,e)}),"PUBLIC").setMultipleInstances(!0)),hn(Dn,Fn,t),hn(Dn,Fn,"esm2017")}
446
446
  /**
447
447
  * @license
448
448
  * Copyright 2020 Google LLC
@@ -458,7 +458,7 @@ dn("firebase","11.6.0","app");function Cn(t,e){const i={};for(const o in t)t.has
458
458
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
459
459
  * See the License for the specific language governing permissions and
460
460
  * limitations under the License.
461
- */(),"function"==typeof SuppressedError&&SuppressedError;const Vn=jn,Un=new Pi("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),Bn=new eo("@firebase/auth");function zn(t,...e){Bn.logLevel<=Ji.ERROR&&Bn.error(`Auth (${an}): ${t}`,...e)}
461
+ */(),"function"==typeof SuppressedError&&SuppressedError;const Un=Vn,Bn=new ji("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),zn=new io("@firebase/auth");function Hn(t,...e){zn.logLevel<=Yi.ERROR&&zn.error(`Auth (${ln}): ${t}`,...e)}
462
462
  /**
463
463
  * @license
464
464
  * Copyright 2020 Google LLC
@@ -474,7 +474,7 @@ dn("firebase","11.6.0","app");function Cn(t,e){const i={};for(const o in t)t.has
474
474
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
475
475
  * See the License for the specific language governing permissions and
476
476
  * limitations under the License.
477
- */function Hn(t,...e){throw Zn(t,...e)}function Gn(t,...e){return Zn(t,...e)}function Wn(t,e,i){const o=Object.assign(Object.assign({},Vn()),{[e]:i});return new Pi("auth","Firebase",o).create(e,{appName:t.name})}function qn(t){return Wn(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Zn(t,...e){if("string"!=typeof t){const i=e[0],o=[...e.slice(1)];return o[0]&&(o[0].appName=t.name),t._errorFactory.create(i,...o)}return Un.create(t,...e)}function Kn(t,e,...i){if(!t)throw Zn(e,...i)}function Jn(t){const e="INTERNAL ASSERTION FAILED: "+t;throw zn(e),new Error(e)}function Yn(t,e){t||Jn(e)}
477
+ */function Gn(t,...e){throw Kn(t,...e)}function Wn(t,...e){return Kn(t,...e)}function qn(t,e,i){const o=Object.assign(Object.assign({},Un()),{[e]:i});return new ji("auth","Firebase",o).create(e,{appName:t.name})}function Zn(t){return qn(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Kn(t,...e){if("string"!=typeof t){const i=e[0],o=[...e.slice(1)];return o[0]&&(o[0].appName=t.name),t._errorFactory.create(i,...o)}return Bn.create(t,...e)}function Jn(t,e,...i){if(!t)throw Kn(e,...i)}function Yn(t){const e="INTERNAL ASSERTION FAILED: "+t;throw Hn(e),new Error(e)}function Qn(t,e){t||Yn(e)}
478
478
  /**
479
479
  * @license
480
480
  * Copyright 2020 Google LLC
@@ -490,7 +490,7 @@ dn("firebase","11.6.0","app");function Cn(t,e){const i={};for(const o in t)t.has
490
490
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
491
491
  * See the License for the specific language governing permissions and
492
492
  * limitations under the License.
493
- */function Qn(){var t;return"undefined"!=typeof self&&(null===(t=self.location)||void 0===t?void 0:t.href)||""}function Xn(){var t;return"undefined"!=typeof self&&(null===(t=self.location)||void 0===t?void 0:t.protocol)||null}
493
+ */function Xn(){var t;return"undefined"!=typeof self&&(null===(t=self.location)||void 0===t?void 0:t.href)||""}function tr(){var t;return"undefined"!=typeof self&&(null===(t=self.location)||void 0===t?void 0:t.protocol)||null}
494
494
  /**
495
495
  * @license
496
496
  * Copyright 2020 Google LLC
@@ -506,7 +506,7 @@ dn("firebase","11.6.0","app");function Cn(t,e){const i={};for(const o in t)t.has
506
506
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
507
507
  * See the License for the specific language governing permissions and
508
508
  * limitations under the License.
509
- */function tr(){return"undefined"==typeof navigator||!navigator||!("onLine"in navigator)||"boolean"!=typeof navigator.onLine||"http:"!==Xn()&&"https:"!==Xn()&&!function(){const t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id}()&&!("connection"in navigator)||navigator.onLine}
509
+ */function er(){return"undefined"==typeof navigator||!navigator||!("onLine"in navigator)||"boolean"!=typeof navigator.onLine||"http:"!==tr()&&"https:"!==tr()&&!function(){const t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id}()&&!("connection"in navigator)||navigator.onLine}
510
510
  /**
511
511
  * @license
512
512
  * Copyright 2020 Google LLC
@@ -523,7 +523,7 @@ dn("firebase","11.6.0","app");function Cn(t,e){const i={};for(const o in t)t.has
523
523
  * See the License for the specific language governing permissions and
524
524
  * limitations under the License.
525
525
  */
526
- class er{constructor(t,e){this.shortDelay=t,this.longDelay=e,Yn(e>t,"Short delay should be less than long delay!"),this.isMobile="undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Di())||"object"==typeof navigator&&"ReactNative"===navigator.product}get(){return tr()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}
526
+ class ir{constructor(t,e){this.shortDelay=t,this.longDelay=e,Qn(e>t,"Short delay should be less than long delay!"),this.isMobile="undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Fi())||"object"==typeof navigator&&"ReactNative"===navigator.product}get(){return er()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}
527
527
  /**
528
528
  * @license
529
529
  * Copyright 2020 Google LLC
@@ -539,7 +539,7 @@ class er{constructor(t,e){this.shortDelay=t,this.longDelay=e,Yn(e>t,"Short delay
539
539
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
540
540
  * See the License for the specific language governing permissions and
541
541
  * limitations under the License.
542
- */function ir(t,e){Yn(t.emulator,"Emulator should always be set here");const{url:i}=t.emulator;return e?`${i}${e.startsWith("/")?e.slice(1):e}`:i}
542
+ */function or(t,e){Qn(t.emulator,"Emulator should always be set here");const{url:i}=t.emulator;return e?`${i}${e.startsWith("/")?e.slice(1):e}`:i}
543
543
  /**
544
544
  * @license
545
545
  * Copyright 2020 Google LLC
@@ -555,7 +555,7 @@ class er{constructor(t,e){this.shortDelay=t,this.longDelay=e,Yn(e>t,"Short delay
555
555
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
556
556
  * See the License for the specific language governing permissions and
557
557
  * limitations under the License.
558
- */class or{static initialize(t,e,i){this.fetchImpl=t,e&&(this.headersImpl=e),i&&(this.responseImpl=i)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:"undefined"!=typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!=typeof fetch?fetch:void Jn("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:"undefined"!=typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!=typeof Headers?Headers:void Jn("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:"undefined"!=typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!=typeof Response?Response:void Jn("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}
558
+ */class nr{static initialize(t,e,i){this.fetchImpl=t,e&&(this.headersImpl=e),i&&(this.responseImpl=i)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:"undefined"!=typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!=typeof fetch?fetch:void Yn("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:"undefined"!=typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!=typeof Headers?Headers:void Yn("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:"undefined"!=typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!=typeof Response?Response:void Yn("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}
559
559
  /**
560
560
  * @license
561
561
  * Copyright 2020 Google LLC
@@ -571,7 +571,7 @@ class er{constructor(t,e){this.shortDelay=t,this.longDelay=e,Yn(e>t,"Short delay
571
571
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
572
572
  * See the License for the specific language governing permissions and
573
573
  * limitations under the License.
574
- */const nr={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},rr=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],sr=new er(3e4,6e4);
574
+ */const rr={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},sr=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],ar=new ir(3e4,6e4);
575
575
  /**
576
576
  * @license
577
577
  * Copyright 2020 Google LLC
@@ -587,7 +587,7 @@ class er{constructor(t,e){this.shortDelay=t,this.longDelay=e,Yn(e>t,"Short delay
587
587
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
588
588
  * See the License for the specific language governing permissions and
589
589
  * limitations under the License.
590
- */function ar(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function lr(t,e,i,o,n={}){return cr(t,n,(async()=>{let n={},r={};o&&("GET"===e?r=o:n={body:JSON.stringify(o)});const s=Bi(Object.assign({key:t.config.apiKey},r)).slice(1),a=await t._getAdditionalHeaders();a["Content-Type"]="application/json",t.languageCode&&(a["X-Firebase-Locale"]=t.languageCode);const l=Object.assign({method:e,headers:a},n);return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||(l.referrerPolicy="no-referrer"),or.fetch()(await dr(t,t.config.apiHost,i,s),l)}))}async function cr(t,e,i){t._canInitEmulator=!1;const o=Object.assign(Object.assign({},nr),e);try{const e=new hr(t),n=await Promise.race([i(),e.promise]);e.clearNetworkTimeout();const r=await n.json();if("needConfirmation"in r)throw ur(t,"account-exists-with-different-credential",r);if(n.ok&&!("errorMessage"in r))return r;{const e=n.ok?r.errorMessage:r.error.message,[i,s]=e.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===i)throw ur(t,"credential-already-in-use",r);if("EMAIL_EXISTS"===i)throw ur(t,"email-already-in-use",r);if("USER_DISABLED"===i)throw ur(t,"user-disabled",r);const a=o[i]||i.toLowerCase().replace(/[_\s]+/g,"-");if(s)throw Wn(t,a,s);Hn(t,a)}}catch(e){if(e instanceof Fi)throw e;Hn(t,"network-request-failed",{message:String(e)})}}async function dr(t,e,i,o){const n=`${e}${i}?${o}`,r=t,s=r.config.emulator?ir(t.config,n):`${t.config.apiScheme}://${n}`;if(rr.includes(i)&&(await r._persistenceManagerAvailable,"COOKIE"===r._getPersistenceType())){return r._getPersistence()._getFinalTarget(s).toString()}return s}class hr{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise(((t,e)=>{this.timer=setTimeout((()=>e(Gn(this.auth,"network-request-failed"))),sr.get())}))}}function ur(t,e,i){const o={appName:t.name};i.email&&(o.email=i.email),i.phoneNumber&&(o.phoneNumber=i.phoneNumber);const n=Gn(t,e,o);return n.customData._tokenResponse=i,n}
590
+ */function lr(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function cr(t,e,i,o,n={}){return dr(t,n,(async()=>{let n={},r={};o&&("GET"===e?r=o:n={body:JSON.stringify(o)});const s=zi(Object.assign({key:t.config.apiKey},r)).slice(1),a=await t._getAdditionalHeaders();a["Content-Type"]="application/json",t.languageCode&&(a["X-Firebase-Locale"]=t.languageCode);const l=Object.assign({method:e,headers:a},n);return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||(l.referrerPolicy="no-referrer"),nr.fetch()(await hr(t,t.config.apiHost,i,s),l)}))}async function dr(t,e,i){t._canInitEmulator=!1;const o=Object.assign(Object.assign({},rr),e);try{const e=new ur(t),n=await Promise.race([i(),e.promise]);e.clearNetworkTimeout();const r=await n.json();if("needConfirmation"in r)throw pr(t,"account-exists-with-different-credential",r);if(n.ok&&!("errorMessage"in r))return r;{const e=n.ok?r.errorMessage:r.error.message,[i,s]=e.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===i)throw pr(t,"credential-already-in-use",r);if("EMAIL_EXISTS"===i)throw pr(t,"email-already-in-use",r);if("USER_DISABLED"===i)throw pr(t,"user-disabled",r);const a=o[i]||i.toLowerCase().replace(/[_\s]+/g,"-");if(s)throw qn(t,a,s);Gn(t,a)}}catch(e){if(e instanceof Pi)throw e;Gn(t,"network-request-failed",{message:String(e)})}}async function hr(t,e,i,o){const n=`${e}${i}?${o}`,r=t,s=r.config.emulator?or(t.config,n):`${t.config.apiScheme}://${n}`;if(sr.includes(i)&&(await r._persistenceManagerAvailable,"COOKIE"===r._getPersistenceType())){return r._getPersistence()._getFinalTarget(s).toString()}return s}class ur{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise(((t,e)=>{this.timer=setTimeout((()=>e(Wn(this.auth,"network-request-failed"))),ar.get())}))}}function pr(t,e,i){const o={appName:t.name};i.email&&(o.email=i.email),i.phoneNumber&&(o.phoneNumber=i.phoneNumber);const n=Wn(t,e,o);return n.customData._tokenResponse=i,n}
591
591
  /**
592
592
  * @license
593
593
  * Copyright 2020 Google LLC
@@ -603,7 +603,7 @@ class er{constructor(t,e){this.shortDelay=t,this.longDelay=e,Yn(e>t,"Short delay
603
603
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
604
604
  * See the License for the specific language governing permissions and
605
605
  * limitations under the License.
606
- */async function pr(t,e){return lr(t,"POST","/v1/accounts:lookup",e)}
606
+ */async function vr(t,e){return cr(t,"POST","/v1/accounts:lookup",e)}
607
607
  /**
608
608
  * @license
609
609
  * Copyright 2020 Google LLC
@@ -619,7 +619,7 @@ class er{constructor(t,e){this.shortDelay=t,this.longDelay=e,Yn(e>t,"Short delay
619
619
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
620
620
  * See the License for the specific language governing permissions and
621
621
  * limitations under the License.
622
- */function vr(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch(t){}}function gr(t){return 1e3*Number(t)}function fr(t){const[e,i,o]=t.split(".");if(void 0===e||void 0===i||void 0===o)return zn("JWT malformed, contained fewer than 3 sections"),null;try{const t=Ii(i);return t?JSON.parse(t):(zn("Failed to decode base64 JWT payload"),null)}catch(t){return zn("Caught error parsing JWT payload as JSON",null==t?void 0:t.toString()),null}}function mr(t){const e=fr(t);return Kn(e,"internal-error"),Kn(void 0!==e.exp,"internal-error"),Kn(void 0!==e.iat,"internal-error"),Number(e.exp)-Number(e.iat)}
622
+ */function gr(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch(t){}}function fr(t){return 1e3*Number(t)}function mr(t){const[e,i,o]=t.split(".");if(void 0===e||void 0===i||void 0===o)return Hn("JWT malformed, contained fewer than 3 sections"),null;try{const t=_i(i);return t?JSON.parse(t):(Hn("Failed to decode base64 JWT payload"),null)}catch(t){return Hn("Caught error parsing JWT payload as JSON",null==t?void 0:t.toString()),null}}function wr(t){const e=mr(t);return Jn(e,"internal-error"),Jn(void 0!==e.exp,"internal-error"),Jn(void 0!==e.iat,"internal-error"),Number(e.exp)-Number(e.iat)}
623
623
  /**
624
624
  * @license
625
625
  * Copyright 2020 Google LLC
@@ -635,7 +635,7 @@ class er{constructor(t,e){this.shortDelay=t,this.longDelay=e,Yn(e>t,"Short delay
635
635
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
636
636
  * See the License for the specific language governing permissions and
637
637
  * limitations under the License.
638
- */async function wr(t,e,i=!1){if(i)return e;try{return await e}catch(e){throw e instanceof Fi&&function({code:t}){return"auth/user-disabled"===t||"auth/user-token-expired"===t}
638
+ */async function yr(t,e,i=!1){if(i)return e;try{return await e}catch(e){throw e instanceof Pi&&function({code:t}){return"auth/user-disabled"===t||"auth/user-token-expired"===t}
639
639
  /**
640
640
  * @license
641
641
  * Copyright 2020 Google LLC
@@ -651,7 +651,7 @@ class er{constructor(t,e){this.shortDelay=t,this.longDelay=e,Yn(e>t,"Short delay
651
651
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
652
652
  * See the License for the specific language governing permissions and
653
653
  * limitations under the License.
654
- */(e)&&t.auth.currentUser===t&&await t.auth.signOut(),e}}class yr{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(t){var e;if(t){const t=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),t}{this.errorBackoff=3e4;const t=(null!==(e=this.user.stsTokenManager.expirationTime)&&void 0!==e?e:0)-Date.now()-3e5;return Math.max(0,t)}}schedule(t=!1){if(!this.isRunning)return;const e=this.getInterval(t);this.timerId=setTimeout((async()=>{await this.iteration()}),e)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){return void("auth/network-request-failed"===(null==t?void 0:t.code)&&this.schedule(!0))}this.schedule()}}
654
+ */(e)&&t.auth.currentUser===t&&await t.auth.signOut(),e}}class br{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(t){var e;if(t){const t=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),t}{this.errorBackoff=3e4;const t=(null!==(e=this.user.stsTokenManager.expirationTime)&&void 0!==e?e:0)-Date.now()-3e5;return Math.max(0,t)}}schedule(t=!1){if(!this.isRunning)return;const e=this.getInterval(t);this.timerId=setTimeout((async()=>{await this.iteration()}),e)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){return void("auth/network-request-failed"===(null==t?void 0:t.code)&&this.schedule(!0))}this.schedule()}}
655
655
  /**
656
656
  * @license
657
657
  * Copyright 2020 Google LLC
@@ -667,7 +667,7 @@ class er{constructor(t,e){this.shortDelay=t,this.longDelay=e,Yn(e>t,"Short delay
667
667
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
668
668
  * See the License for the specific language governing permissions and
669
669
  * limitations under the License.
670
- */class br{constructor(t,e){this.createdAt=t,this.lastLoginAt=e,this._initializeTime()}_initializeTime(){this.lastSignInTime=vr(this.lastLoginAt),this.creationTime=vr(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}
670
+ */class Cr{constructor(t,e){this.createdAt=t,this.lastLoginAt=e,this._initializeTime()}_initializeTime(){this.lastSignInTime=gr(this.lastLoginAt),this.creationTime=gr(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}
671
671
  /**
672
672
  * @license
673
673
  * Copyright 2019 Google LLC
@@ -683,7 +683,7 @@ class er{constructor(t,e){this.shortDelay=t,this.longDelay=e,Yn(e>t,"Short delay
683
683
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
684
684
  * See the License for the specific language governing permissions and
685
685
  * limitations under the License.
686
- */async function Cr(t){var e;const i=t.auth,o=await t.getIdToken(),n=await wr(t,pr(i,{idToken:o}));Kn(null==n?void 0:n.users.length,i,"internal-error");const r=n.users[0];t._notifyReloadListener(r);const s=(null===(e=r.providerUserInfo)||void 0===e?void 0:e.length)?xr(r.providerUserInfo):[],a=function(t,e){const i=t.filter((t=>!e.some((e=>e.providerId===t.providerId))));return[...i,...e]}(t.providerData,s),l=t.isAnonymous,c=!(t.email&&r.passwordHash||(null==a?void 0:a.length)),d=!!l&&c,h={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:a,metadata:new br(r.createdAt,r.lastLoginAt),isAnonymous:d};Object.assign(t,h)}function xr(t){return t.map((t=>{var{providerId:e}=t,i=Pn(t,["providerId"]);return{providerId:e,uid:i.rawId||"",displayName:i.displayName||null,email:i.email||null,phoneNumber:i.phoneNumber||null,photoURL:i.photoUrl||null}}))}
686
+ */async function xr(t){var e;const i=t.auth,o=await t.getIdToken(),n=await yr(t,vr(i,{idToken:o}));Jn(null==n?void 0:n.users.length,i,"internal-error");const r=n.users[0];t._notifyReloadListener(r);const s=(null===(e=r.providerUserInfo)||void 0===e?void 0:e.length)?Er(r.providerUserInfo):[],a=function(t,e){const i=t.filter((t=>!e.some((e=>e.providerId===t.providerId))));return[...i,...e]}(t.providerData,s),l=t.isAnonymous,c=!(t.email&&r.passwordHash||(null==a?void 0:a.length)),d=!!l&&c,h={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:a,metadata:new Cr(r.createdAt,r.lastLoginAt),isAnonymous:d};Object.assign(t,h)}function Er(t){return t.map((t=>{var{providerId:e}=t,i=jn(t,["providerId"]);return{providerId:e,uid:i.rawId||"",displayName:i.displayName||null,email:i.email||null,phoneNumber:i.phoneNumber||null,photoURL:i.photoUrl||null}}))}
687
687
  /**
688
688
  * @license
689
689
  * Copyright 2020 Google LLC
@@ -716,7 +716,7 @@ class er{constructor(t,e){this.shortDelay=t,this.longDelay=e,Yn(e>t,"Short delay
716
716
  * See the License for the specific language governing permissions and
717
717
  * limitations under the License.
718
718
  */
719
- class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Kn(t.idToken,"internal-error"),Kn(void 0!==t.idToken,"internal-error"),Kn(void 0!==t.refreshToken,"internal-error");const e="expiresIn"in t&&void 0!==t.expiresIn?Number(t.expiresIn):mr(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,e)}updateFromIdToken(t){Kn(0!==t.length,"internal-error");const e=mr(t);this.updateTokensAndExpiration(t,null,e)}async getToken(t,e=!1){return e||!this.accessToken||this.isExpired?(Kn(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null):this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(t,e){const{accessToken:i,refreshToken:o,expiresIn:n}=await async function(t,e){const i=await cr(t,{},(async()=>{const i=Bi({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:o,apiKey:n}=t.config,r=await dr(t,o,"/v1/token",`key=${n}`),s=await t._getAdditionalHeaders();return s["Content-Type"]="application/x-www-form-urlencoded",or.fetch()(r,{method:"POST",headers:s,body:i})}));return{accessToken:i.access_token,expiresIn:i.expires_in,refreshToken:i.refresh_token}}(t,e);this.updateTokensAndExpiration(i,o,Number(n))}updateTokensAndExpiration(t,e,i){this.refreshToken=e||null,this.accessToken=t||null,this.expirationTime=Date.now()+1e3*i}static fromJSON(t,e){const{refreshToken:i,accessToken:o,expirationTime:n}=e,r=new Er;return i&&(Kn("string"==typeof i,"internal-error",{appName:t}),r.refreshToken=i),o&&(Kn("string"==typeof o,"internal-error",{appName:t}),r.accessToken=o),n&&(Kn("number"==typeof n,"internal-error",{appName:t}),r.expirationTime=n),r}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new Er,this.toJSON())}_performRefresh(){return Jn("not implemented")}}
719
+ class kr{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Jn(t.idToken,"internal-error"),Jn(void 0!==t.idToken,"internal-error"),Jn(void 0!==t.refreshToken,"internal-error");const e="expiresIn"in t&&void 0!==t.expiresIn?Number(t.expiresIn):wr(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,e)}updateFromIdToken(t){Jn(0!==t.length,"internal-error");const e=wr(t);this.updateTokensAndExpiration(t,null,e)}async getToken(t,e=!1){return e||!this.accessToken||this.isExpired?(Jn(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null):this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(t,e){const{accessToken:i,refreshToken:o,expiresIn:n}=await async function(t,e){const i=await dr(t,{},(async()=>{const i=zi({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:o,apiKey:n}=t.config,r=await hr(t,o,"/v1/token",`key=${n}`),s=await t._getAdditionalHeaders();return s["Content-Type"]="application/x-www-form-urlencoded",nr.fetch()(r,{method:"POST",headers:s,body:i})}));return{accessToken:i.access_token,expiresIn:i.expires_in,refreshToken:i.refresh_token}}(t,e);this.updateTokensAndExpiration(i,o,Number(n))}updateTokensAndExpiration(t,e,i){this.refreshToken=e||null,this.accessToken=t||null,this.expirationTime=Date.now()+1e3*i}static fromJSON(t,e){const{refreshToken:i,accessToken:o,expirationTime:n}=e,r=new kr;return i&&(Jn("string"==typeof i,"internal-error",{appName:t}),r.refreshToken=i),o&&(Jn("string"==typeof o,"internal-error",{appName:t}),r.accessToken=o),n&&(Jn("number"==typeof n,"internal-error",{appName:t}),r.expirationTime=n),r}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new kr,this.toJSON())}_performRefresh(){return Yn("not implemented")}}
720
720
  /**
721
721
  * @license
722
722
  * Copyright 2020 Google LLC
@@ -732,7 +732,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
732
732
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
733
733
  * See the License for the specific language governing permissions and
734
734
  * limitations under the License.
735
- */function kr(t,e){Kn("string"==typeof t||void 0===t,"internal-error",{appName:e})}class Sr{constructor(t){var{uid:e,auth:i,stsTokenManager:o}=t,n=Pn(t,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new yr(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=i,this.stsTokenManager=o,this.accessToken=o.accessToken,this.displayName=n.displayName||null,this.email=n.email||null,this.emailVerified=n.emailVerified||!1,this.phoneNumber=n.phoneNumber||null,this.photoURL=n.photoURL||null,this.isAnonymous=n.isAnonymous||!1,this.tenantId=n.tenantId||null,this.providerData=n.providerData?[...n.providerData]:[],this.metadata=new br(n.createdAt||void 0,n.lastLoginAt||void 0)}async getIdToken(t){const e=await wr(this,this.stsTokenManager.getToken(this.auth,t));return Kn(e,this.auth,"internal-error"),this.accessToken!==e&&(this.accessToken=e,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),e}getIdTokenResult(t){return async function(t,e=!1){const i=Gi(t),o=await i.getIdToken(e),n=fr(o);Kn(n&&n.exp&&n.auth_time&&n.iat,i.auth,"internal-error");const r="object"==typeof n.firebase?n.firebase:void 0,s=null==r?void 0:r.sign_in_provider;return{claims:n,token:o,authTime:vr(gr(n.auth_time)),issuedAtTime:vr(gr(n.iat)),expirationTime:vr(gr(n.exp)),signInProvider:s||null,signInSecondFactor:(null==r?void 0:r.sign_in_second_factor)||null}}(this,t)}reload(){return async function(t){const e=Gi(t);await Cr(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}(this)}_assign(t){this!==t&&(Kn(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map((t=>Object.assign({},t))),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const e=new Sr(Object.assign(Object.assign({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}));return e.metadata._copy(this.metadata),e}_onReload(t){Kn(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,e=!1){let i=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),i=!0),e&&await Cr(this),await this.auth._persistUserIfCurrent(this),i&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(nn(this.auth.app))return Promise.reject(qn(this.auth));const t=await this.getIdToken();return await wr(this,async function(t,e){return lr(t,"POST","/v1/accounts:delete",e)}(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map((t=>Object.assign({},t))),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,e){var i,o,n,r,s,a,l,c;const d=null!==(i=e.displayName)&&void 0!==i?i:void 0,h=null!==(o=e.email)&&void 0!==o?o:void 0,u=null!==(n=e.phoneNumber)&&void 0!==n?n:void 0,p=null!==(r=e.photoURL)&&void 0!==r?r:void 0,v=null!==(s=e.tenantId)&&void 0!==s?s:void 0,g=null!==(a=e._redirectEventId)&&void 0!==a?a:void 0,f=null!==(l=e.createdAt)&&void 0!==l?l:void 0,m=null!==(c=e.lastLoginAt)&&void 0!==c?c:void 0,{uid:w,emailVerified:y,isAnonymous:b,providerData:C,stsTokenManager:x}=e;Kn(w&&x,t,"internal-error");const E=Er.fromJSON(this.name,x);Kn("string"==typeof w,t,"internal-error"),kr(d,t.name),kr(h,t.name),Kn("boolean"==typeof y,t,"internal-error"),Kn("boolean"==typeof b,t,"internal-error"),kr(u,t.name),kr(p,t.name),kr(v,t.name),kr(g,t.name),kr(f,t.name),kr(m,t.name);const k=new Sr({uid:w,auth:t,email:h,emailVerified:y,displayName:d,isAnonymous:b,photoURL:p,phoneNumber:u,tenantId:v,stsTokenManager:E,createdAt:f,lastLoginAt:m});return C&&Array.isArray(C)&&(k.providerData=C.map((t=>Object.assign({},t)))),g&&(k._redirectEventId=g),k}static async _fromIdTokenResponse(t,e,i=!1){const o=new Er;o.updateFromServerResponse(e);const n=new Sr({uid:e.localId,auth:t,stsTokenManager:o,isAnonymous:i});return await Cr(n),n}static async _fromGetAccountInfoResponse(t,e,i){const o=e.users[0];Kn(void 0!==o.localId,"internal-error");const n=void 0!==o.providerUserInfo?xr(o.providerUserInfo):[],r=!(o.email&&o.passwordHash||(null==n?void 0:n.length)),s=new Er;s.updateFromIdToken(i);const a=new Sr({uid:o.localId,auth:t,stsTokenManager:s,isAnonymous:r}),l={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:n,metadata:new br(o.createdAt,o.lastLoginAt),isAnonymous:!(o.email&&o.passwordHash||(null==n?void 0:n.length))};return Object.assign(a,l),a}}
735
+ */function Sr(t,e){Jn("string"==typeof t||void 0===t,"internal-error",{appName:e})}class Ar{constructor(t){var{uid:e,auth:i,stsTokenManager:o}=t,n=jn(t,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new br(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=i,this.stsTokenManager=o,this.accessToken=o.accessToken,this.displayName=n.displayName||null,this.email=n.email||null,this.emailVerified=n.emailVerified||!1,this.phoneNumber=n.phoneNumber||null,this.photoURL=n.photoURL||null,this.isAnonymous=n.isAnonymous||!1,this.tenantId=n.tenantId||null,this.providerData=n.providerData?[...n.providerData]:[],this.metadata=new Cr(n.createdAt||void 0,n.lastLoginAt||void 0)}async getIdToken(t){const e=await yr(this,this.stsTokenManager.getToken(this.auth,t));return Jn(e,this.auth,"internal-error"),this.accessToken!==e&&(this.accessToken=e,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),e}getIdTokenResult(t){return async function(t,e=!1){const i=Wi(t),o=await i.getIdToken(e),n=mr(o);Jn(n&&n.exp&&n.auth_time&&n.iat,i.auth,"internal-error");const r="object"==typeof n.firebase?n.firebase:void 0,s=null==r?void 0:r.sign_in_provider;return{claims:n,token:o,authTime:gr(fr(n.auth_time)),issuedAtTime:gr(fr(n.iat)),expirationTime:gr(fr(n.exp)),signInProvider:s||null,signInSecondFactor:(null==r?void 0:r.sign_in_second_factor)||null}}(this,t)}reload(){return async function(t){const e=Wi(t);await xr(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}(this)}_assign(t){this!==t&&(Jn(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map((t=>Object.assign({},t))),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const e=new Ar(Object.assign(Object.assign({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}));return e.metadata._copy(this.metadata),e}_onReload(t){Jn(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,e=!1){let i=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),i=!0),e&&await xr(this),await this.auth._persistUserIfCurrent(this),i&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(rn(this.auth.app))return Promise.reject(Zn(this.auth));const t=await this.getIdToken();return await yr(this,async function(t,e){return cr(t,"POST","/v1/accounts:delete",e)}(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map((t=>Object.assign({},t))),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,e){var i,o,n,r,s,a,l,c;const d=null!==(i=e.displayName)&&void 0!==i?i:void 0,h=null!==(o=e.email)&&void 0!==o?o:void 0,u=null!==(n=e.phoneNumber)&&void 0!==n?n:void 0,p=null!==(r=e.photoURL)&&void 0!==r?r:void 0,v=null!==(s=e.tenantId)&&void 0!==s?s:void 0,g=null!==(a=e._redirectEventId)&&void 0!==a?a:void 0,f=null!==(l=e.createdAt)&&void 0!==l?l:void 0,m=null!==(c=e.lastLoginAt)&&void 0!==c?c:void 0,{uid:w,emailVerified:y,isAnonymous:b,providerData:C,stsTokenManager:x}=e;Jn(w&&x,t,"internal-error");const E=kr.fromJSON(this.name,x);Jn("string"==typeof w,t,"internal-error"),Sr(d,t.name),Sr(h,t.name),Jn("boolean"==typeof y,t,"internal-error"),Jn("boolean"==typeof b,t,"internal-error"),Sr(u,t.name),Sr(p,t.name),Sr(v,t.name),Sr(g,t.name),Sr(f,t.name),Sr(m,t.name);const k=new Ar({uid:w,auth:t,email:h,emailVerified:y,displayName:d,isAnonymous:b,photoURL:p,phoneNumber:u,tenantId:v,stsTokenManager:E,createdAt:f,lastLoginAt:m});return C&&Array.isArray(C)&&(k.providerData=C.map((t=>Object.assign({},t)))),g&&(k._redirectEventId=g),k}static async _fromIdTokenResponse(t,e,i=!1){const o=new kr;o.updateFromServerResponse(e);const n=new Ar({uid:e.localId,auth:t,stsTokenManager:o,isAnonymous:i});return await xr(n),n}static async _fromGetAccountInfoResponse(t,e,i){const o=e.users[0];Jn(void 0!==o.localId,"internal-error");const n=void 0!==o.providerUserInfo?Er(o.providerUserInfo):[],r=!(o.email&&o.passwordHash||(null==n?void 0:n.length)),s=new kr;s.updateFromIdToken(i);const a=new Ar({uid:o.localId,auth:t,stsTokenManager:s,isAnonymous:r}),l={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:n,metadata:new Cr(o.createdAt,o.lastLoginAt),isAnonymous:!(o.email&&o.passwordHash||(null==n?void 0:n.length))};return Object.assign(a,l),a}}
736
736
  /**
737
737
  * @license
738
738
  * Copyright 2020 Google LLC
@@ -748,7 +748,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
748
748
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
749
749
  * See the License for the specific language governing permissions and
750
750
  * limitations under the License.
751
- */const Mr=new Map;function Ar(t){Yn(t instanceof Function,"Expected a class definition");let e=Mr.get(t);return e?(Yn(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,Mr.set(t,e),e)}
751
+ */const Mr=new Map;function Tr(t){Qn(t instanceof Function,"Expected a class definition");let e=Mr.get(t);return e?(Qn(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,Mr.set(t,e),e)}
752
752
  /**
753
753
  * @license
754
754
  * Copyright 2019 Google LLC
@@ -764,7 +764,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
764
764
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
765
765
  * See the License for the specific language governing permissions and
766
766
  * limitations under the License.
767
- */class Tr{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,e){this.storage[t]=e}async _get(t){const e=this.storage[t];return void 0===e?null:e}async _remove(t){delete this.storage[t]}_addListener(t,e){}_removeListener(t,e){}}Tr.type="NONE";const Ir=Tr;
767
+ */class Ir{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,e){this.storage[t]=e}async _get(t){const e=this.storage[t];return void 0===e?null:e}async _remove(t){delete this.storage[t]}_addListener(t,e){}_removeListener(t,e){}}Ir.type="NONE";const _r=Ir;
768
768
  /**
769
769
  * @license
770
770
  * Copyright 2019 Google LLC
@@ -780,7 +780,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
780
780
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
781
781
  * See the License for the specific language governing permissions and
782
782
  * limitations under the License.
783
- */function _r(t,e,i){return`firebase:${t}:${e}:${i}`}class $r{constructor(t,e,i){this.persistence=t,this.auth=e,this.userKey=i;const{config:o,name:n}=this.auth;this.fullUserKey=_r(this.userKey,o.apiKey,n),this.fullPersistenceKey=_r("persistence",o.apiKey,n),this.boundEventHandler=e._onStorageEvent.bind(e),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);if(!t)return null;if("string"==typeof t){const e=await pr(this.auth,{idToken:t}).catch((()=>{}));return e?Sr._fromGetAccountInfoResponse(this.auth,e,t):null}return Sr._fromJSON(this.auth,t)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const e=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=t,e?this.setCurrentUser(e):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,e,i="authUser"){if(!e.length)return new $r(Ar(Ir),t,i);const o=(await Promise.all(e.map((async t=>{if(await t._isAvailable())return t})))).filter((t=>t));let n=o[0]||Ar(Ir);const r=_r(i,t.config.apiKey,t.name);let s=null;for(const i of e)try{const e=await i._get(r);if(e){let o;if("string"==typeof e){const i=await pr(t,{idToken:e}).catch((()=>{}));if(!i)break;o=await Sr._fromGetAccountInfoResponse(t,i,e)}else o=Sr._fromJSON(t,e);i!==n&&(s=o),n=i;break}}catch(t){}const a=o.filter((t=>t._shouldAllowMigration));return n._shouldAllowMigration&&a.length?(n=a[0],s&&await n._set(r,s.toJSON()),await Promise.all(e.map((async t=>{if(t!==n)try{await t._remove(r)}catch(t){}}))),new $r(n,t,i)):new $r(n,t,i)}}
783
+ */function $r(t,e,i){return`firebase:${t}:${e}:${i}`}class Nr{constructor(t,e,i){this.persistence=t,this.auth=e,this.userKey=i;const{config:o,name:n}=this.auth;this.fullUserKey=$r(this.userKey,o.apiKey,n),this.fullPersistenceKey=$r("persistence",o.apiKey,n),this.boundEventHandler=e._onStorageEvent.bind(e),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);if(!t)return null;if("string"==typeof t){const e=await vr(this.auth,{idToken:t}).catch((()=>{}));return e?Ar._fromGetAccountInfoResponse(this.auth,e,t):null}return Ar._fromJSON(this.auth,t)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const e=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=t,e?this.setCurrentUser(e):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,e,i="authUser"){if(!e.length)return new Nr(Tr(_r),t,i);const o=(await Promise.all(e.map((async t=>{if(await t._isAvailable())return t})))).filter((t=>t));let n=o[0]||Tr(_r);const r=$r(i,t.config.apiKey,t.name);let s=null;for(const i of e)try{const e=await i._get(r);if(e){let o;if("string"==typeof e){const i=await vr(t,{idToken:e}).catch((()=>{}));if(!i)break;o=await Ar._fromGetAccountInfoResponse(t,i,e)}else o=Ar._fromJSON(t,e);i!==n&&(s=o),n=i;break}}catch(t){}const a=o.filter((t=>t._shouldAllowMigration));return n._shouldAllowMigration&&a.length?(n=a[0],s&&await n._set(r,s.toJSON()),await Promise.all(e.map((async t=>{if(t!==n)try{await t._remove(r)}catch(t){}}))),new Nr(n,t,i)):new Nr(n,t,i)}}
784
784
  /**
785
785
  * @license
786
786
  * Copyright 2020 Google LLC
@@ -796,7 +796,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
796
796
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
797
797
  * See the License for the specific language governing permissions and
798
798
  * limitations under the License.
799
- */function Nr(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Dr(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Or(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(Pr(e))return"Blackberry";if(jr(e))return"Webos";if(Lr(e))return"Safari";if((e.includes("chrome/")||Rr(e))&&!e.includes("edge/"))return"Chrome";if(Fr(e))return"Android";{const e=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,i=t.match(e);if(2===(null==i?void 0:i.length))return i[1]}return"Other"}function Or(t=Di()){return/firefox\//i.test(t)}function Lr(t=Di()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Rr(t=Di()){return/crios\//i.test(t)}function Dr(t=Di()){return/iemobile/i.test(t)}function Fr(t=Di()){return/android/i.test(t)}function Pr(t=Di()){return/blackberry/i.test(t)}function jr(t=Di()){return/webos/i.test(t)}function Vr(t=Di()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function Ur(){return function(){const t=Di();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}()&&10===document.documentMode}function Br(t=Di()){return Vr(t)||Fr(t)||jr(t)||Pr(t)||/windows phone/i.test(t)||Dr(t)}
799
+ */function Or(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Fr(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Lr(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(jr(e))return"Blackberry";if(Vr(e))return"Webos";if(Rr(e))return"Safari";if((e.includes("chrome/")||Dr(e))&&!e.includes("edge/"))return"Chrome";if(Pr(e))return"Android";{const e=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,i=t.match(e);if(2===(null==i?void 0:i.length))return i[1]}return"Other"}function Lr(t=Fi()){return/firefox\//i.test(t)}function Rr(t=Fi()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Dr(t=Fi()){return/crios\//i.test(t)}function Fr(t=Fi()){return/iemobile/i.test(t)}function Pr(t=Fi()){return/android/i.test(t)}function jr(t=Fi()){return/blackberry/i.test(t)}function Vr(t=Fi()){return/webos/i.test(t)}function Ur(t=Fi()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function Br(){return function(){const t=Fi();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}()&&10===document.documentMode}function zr(t=Fi()){return Ur(t)||Pr(t)||Vr(t)||jr(t)||/windows phone/i.test(t)||Fr(t)}
800
800
  /**
801
801
  * @license
802
802
  * Copyright 2020 Google LLC
@@ -812,7 +812,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
812
812
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
813
813
  * See the License for the specific language governing permissions and
814
814
  * limitations under the License.
815
- */function zr(t,e=[]){let i;switch(t){case"Browser":i=Nr(Di());break;case"Worker":i=`${Nr(Di())}-${t}`;break;default:i=t}const o=e.length?e.join(","):"FirebaseCore-web";return`${i}/JsCore/${an}/${o}`}
815
+ */function Hr(t,e=[]){let i;switch(t){case"Browser":i=Or(Fi());break;case"Worker":i=`${Or(Fi())}-${t}`;break;default:i=t}const o=e.length?e.join(","):"FirebaseCore-web";return`${i}/JsCore/${ln}/${o}`}
816
816
  /**
817
817
  * @license
818
818
  * Copyright 2022 Google LLC
@@ -828,7 +828,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
828
828
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
829
829
  * See the License for the specific language governing permissions and
830
830
  * limitations under the License.
831
- */class Hr{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,e){const i=e=>new Promise(((i,o)=>{try{i(t(e))}catch(t){o(t)}}));i.onAbort=e,this.queue.push(i);const o=this.queue.length-1;return()=>{this.queue[o]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const e=[];try{for(const i of this.queue)await i(t),i.onAbort&&e.push(i.onAbort)}catch(t){e.reverse();for(const t of e)try{t()}catch(t){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null==t?void 0:t.message})}}}
831
+ */class Gr{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,e){const i=e=>new Promise(((i,o)=>{try{i(t(e))}catch(t){o(t)}}));i.onAbort=e,this.queue.push(i);const o=this.queue.length-1;return()=>{this.queue[o]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const e=[];try{for(const i of this.queue)await i(t),i.onAbort&&e.push(i.onAbort)}catch(t){e.reverse();for(const t of e)try{t()}catch(t){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null==t?void 0:t.message})}}}
832
832
  /**
833
833
  * @license
834
834
  * Copyright 2023 Google LLC
@@ -844,7 +844,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
844
844
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
845
845
  * See the License for the specific language governing permissions and
846
846
  * limitations under the License.
847
- */class Gr{constructor(t){var e,i,o,n;const r=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(e=r.minPasswordLength)&&void 0!==e?e:6,r.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=r.maxPasswordLength),void 0!==r.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=r.containsLowercaseCharacter),void 0!==r.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=r.containsUppercaseCharacter),void 0!==r.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=r.containsNumericCharacter),void 0!==r.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=r.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(o=null===(i=t.allowedNonAlphanumericCharacters)||void 0===i?void 0:i.join(""))&&void 0!==o?o:"",this.forceUpgradeOnSignin=null!==(n=t.forceUpgradeOnSignin)&&void 0!==n&&n,this.schemaVersion=t.schemaVersion}validatePassword(t){var e,i,o,n,r,s;const a={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,a),this.validatePasswordCharacterOptions(t,a),a.isValid&&(a.isValid=null===(e=a.meetsMinPasswordLength)||void 0===e||e),a.isValid&&(a.isValid=null===(i=a.meetsMaxPasswordLength)||void 0===i||i),a.isValid&&(a.isValid=null===(o=a.containsLowercaseLetter)||void 0===o||o),a.isValid&&(a.isValid=null===(n=a.containsUppercaseLetter)||void 0===n||n),a.isValid&&(a.isValid=null===(r=a.containsNumericCharacter)||void 0===r||r),a.isValid&&(a.isValid=null===(s=a.containsNonAlphanumericCharacter)||void 0===s||s),a}validatePasswordLengthOptions(t,e){const i=this.customStrengthOptions.minPasswordLength,o=this.customStrengthOptions.maxPasswordLength;i&&(e.meetsMinPasswordLength=t.length>=i),o&&(e.meetsMaxPasswordLength=t.length<=o)}validatePasswordCharacterOptions(t,e){let i;this.updatePasswordCharacterOptionsStatuses(e,!1,!1,!1,!1);for(let o=0;o<t.length;o++)i=t.charAt(o),this.updatePasswordCharacterOptionsStatuses(e,i>="a"&&i<="z",i>="A"&&i<="Z",i>="0"&&i<="9",this.allowedNonAlphanumericCharacters.includes(i))}updatePasswordCharacterOptionsStatuses(t,e,i,o,n){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=e)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=i)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=o)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=n))}}
847
+ */class Wr{constructor(t){var e,i,o,n;const r=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(e=r.minPasswordLength)&&void 0!==e?e:6,r.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=r.maxPasswordLength),void 0!==r.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=r.containsLowercaseCharacter),void 0!==r.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=r.containsUppercaseCharacter),void 0!==r.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=r.containsNumericCharacter),void 0!==r.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=r.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(o=null===(i=t.allowedNonAlphanumericCharacters)||void 0===i?void 0:i.join(""))&&void 0!==o?o:"",this.forceUpgradeOnSignin=null!==(n=t.forceUpgradeOnSignin)&&void 0!==n&&n,this.schemaVersion=t.schemaVersion}validatePassword(t){var e,i,o,n,r,s;const a={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,a),this.validatePasswordCharacterOptions(t,a),a.isValid&&(a.isValid=null===(e=a.meetsMinPasswordLength)||void 0===e||e),a.isValid&&(a.isValid=null===(i=a.meetsMaxPasswordLength)||void 0===i||i),a.isValid&&(a.isValid=null===(o=a.containsLowercaseLetter)||void 0===o||o),a.isValid&&(a.isValid=null===(n=a.containsUppercaseLetter)||void 0===n||n),a.isValid&&(a.isValid=null===(r=a.containsNumericCharacter)||void 0===r||r),a.isValid&&(a.isValid=null===(s=a.containsNonAlphanumericCharacter)||void 0===s||s),a}validatePasswordLengthOptions(t,e){const i=this.customStrengthOptions.minPasswordLength,o=this.customStrengthOptions.maxPasswordLength;i&&(e.meetsMinPasswordLength=t.length>=i),o&&(e.meetsMaxPasswordLength=t.length<=o)}validatePasswordCharacterOptions(t,e){let i;this.updatePasswordCharacterOptionsStatuses(e,!1,!1,!1,!1);for(let o=0;o<t.length;o++)i=t.charAt(o),this.updatePasswordCharacterOptionsStatuses(e,i>="a"&&i<="z",i>="A"&&i<="Z",i>="0"&&i<="9",this.allowedNonAlphanumericCharacters.includes(i))}updatePasswordCharacterOptionsStatuses(t,e,i,o,n){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=e)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=i)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=o)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=n))}}
848
848
  /**
849
849
  * @license
850
850
  * Copyright 2020 Google LLC
@@ -860,7 +860,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
860
860
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
861
861
  * See the License for the specific language governing permissions and
862
862
  * limitations under the License.
863
- */class Wr{constructor(t,e,i,o){this.app=t,this.heartbeatServiceProvider=e,this.appCheckServiceProvider=i,this.config=o,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Zr(this),this.idTokenSubscription=new Zr(this),this.beforeStateQueue=new Hr(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Un,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=o.sdkClientVersion,this._persistenceManagerAvailable=new Promise((t=>this._resolvePersistenceManagerAvailable=t))}_initializeWithPersistence(t,e){return e&&(this._popupRedirectResolver=Ar(e)),this._initializationPromise=this.queue((async()=>{var i,o,n;if(!this._deleted&&(this.persistenceManager=await $r.create(this,t),null===(i=this._resolvePersistenceManagerAvailable)||void 0===i||i.call(this),!this._deleted)){if(null===(o=this._popupRedirectResolver)||void 0===o?void 0:o._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(t){}await this.initializeCurrentUser(e),this.lastNotifiedUid=(null===(n=this.currentUser)||void 0===n?void 0:n.uid)||null,this._deleted||(this._isInitialized=!0)}})),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();return this.currentUser||t?this.currentUser&&t&&this.currentUser.uid===t.uid?(this._currentUser._assign(t),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(t,!0):void 0}async initializeCurrentUserFromIdToken(t){try{const e=await pr(this,{idToken:t}),i=await Sr._fromGetAccountInfoResponse(this,e,t);await this.directlySetCurrentUser(i)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var e;if(nn(this.app)){const t=this.app.settings.authIdToken;return t?new Promise((e=>{setTimeout((()=>this.initializeCurrentUserFromIdToken(t).then(e,e)))})):this.directlySetCurrentUser(null)}const i=await this.assertedPersistence.getCurrentUser();let o=i,n=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const i=null===(e=this.redirectUser)||void 0===e?void 0:e._redirectEventId,r=null==o?void 0:o._redirectEventId,s=await this.tryRedirectSignIn(t);i&&i!==r||!(null==s?void 0:s.user)||(o=s.user,n=!0)}if(!o)return this.directlySetCurrentUser(null);if(!o._redirectEventId){if(n)try{await this.beforeStateQueue.runMiddleware(o)}catch(t){o=i,this._popupRedirectResolver._overrideRedirectResult(this,(()=>Promise.reject(t)))}return o?this.reloadAndSetCurrentUserOrClear(o):this.directlySetCurrentUser(null)}return Kn(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===o._redirectEventId?this.directlySetCurrentUser(o):this.reloadAndSetCurrentUserOrClear(o)}async tryRedirectSignIn(t){let e=null;try{e=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch(t){await this._setRedirectUser(null)}return e}async reloadAndSetCurrentUserOrClear(t){try{await Cr(t)}catch(t){if("auth/network-request-failed"!==(null==t?void 0:t.code))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(nn(this.app))return Promise.reject(qn(this));const e=t?Gi(t):null;return e&&Kn(e.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(e&&e._clone(this))}async _updateCurrentUser(t,e=!1){if(!this._deleted)return t&&Kn(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),e||await this.beforeStateQueue.runMiddleware(t),this.queue((async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()}))}async signOut(){return nn(this.app)?Promise.reject(qn(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return nn(this.app)?Promise.reject(qn(this)):this.queue((async()=>{await this.assertedPersistence.setPersistence(Ar(t))}))}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const e=this._getPasswordPolicyInternal();return e.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):e.validatePassword(t)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await async function(t,e={}){return lr(t,"GET","/v2/passwordPolicy",ar(t,e))}
863
+ */class qr{constructor(t,e,i,o){this.app=t,this.heartbeatServiceProvider=e,this.appCheckServiceProvider=i,this.config=o,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Kr(this),this.idTokenSubscription=new Kr(this),this.beforeStateQueue=new Gr(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Bn,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=o.sdkClientVersion,this._persistenceManagerAvailable=new Promise((t=>this._resolvePersistenceManagerAvailable=t))}_initializeWithPersistence(t,e){return e&&(this._popupRedirectResolver=Tr(e)),this._initializationPromise=this.queue((async()=>{var i,o,n;if(!this._deleted&&(this.persistenceManager=await Nr.create(this,t),null===(i=this._resolvePersistenceManagerAvailable)||void 0===i||i.call(this),!this._deleted)){if(null===(o=this._popupRedirectResolver)||void 0===o?void 0:o._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(t){}await this.initializeCurrentUser(e),this.lastNotifiedUid=(null===(n=this.currentUser)||void 0===n?void 0:n.uid)||null,this._deleted||(this._isInitialized=!0)}})),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();return this.currentUser||t?this.currentUser&&t&&this.currentUser.uid===t.uid?(this._currentUser._assign(t),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(t,!0):void 0}async initializeCurrentUserFromIdToken(t){try{const e=await vr(this,{idToken:t}),i=await Ar._fromGetAccountInfoResponse(this,e,t);await this.directlySetCurrentUser(i)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var e;if(rn(this.app)){const t=this.app.settings.authIdToken;return t?new Promise((e=>{setTimeout((()=>this.initializeCurrentUserFromIdToken(t).then(e,e)))})):this.directlySetCurrentUser(null)}const i=await this.assertedPersistence.getCurrentUser();let o=i,n=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const i=null===(e=this.redirectUser)||void 0===e?void 0:e._redirectEventId,r=null==o?void 0:o._redirectEventId,s=await this.tryRedirectSignIn(t);i&&i!==r||!(null==s?void 0:s.user)||(o=s.user,n=!0)}if(!o)return this.directlySetCurrentUser(null);if(!o._redirectEventId){if(n)try{await this.beforeStateQueue.runMiddleware(o)}catch(t){o=i,this._popupRedirectResolver._overrideRedirectResult(this,(()=>Promise.reject(t)))}return o?this.reloadAndSetCurrentUserOrClear(o):this.directlySetCurrentUser(null)}return Jn(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===o._redirectEventId?this.directlySetCurrentUser(o):this.reloadAndSetCurrentUserOrClear(o)}async tryRedirectSignIn(t){let e=null;try{e=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch(t){await this._setRedirectUser(null)}return e}async reloadAndSetCurrentUserOrClear(t){try{await xr(t)}catch(t){if("auth/network-request-failed"!==(null==t?void 0:t.code))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(rn(this.app))return Promise.reject(Zn(this));const e=t?Wi(t):null;return e&&Jn(e.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(e&&e._clone(this))}async _updateCurrentUser(t,e=!1){if(!this._deleted)return t&&Jn(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),e||await this.beforeStateQueue.runMiddleware(t),this.queue((async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()}))}async signOut(){return rn(this.app)?Promise.reject(Zn(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return rn(this.app)?Promise.reject(Zn(this)):this.queue((async()=>{await this.assertedPersistence.setPersistence(Tr(t))}))}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const e=this._getPasswordPolicyInternal();return e.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):e.validatePassword(t)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await async function(t,e={}){return cr(t,"GET","/v2/passwordPolicy",lr(t,e))}
864
864
  /**
865
865
  * @license
866
866
  * Copyright 2023 Google LLC
@@ -876,7 +876,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
876
876
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
877
877
  * See the License for the specific language governing permissions and
878
878
  * limitations under the License.
879
- */(this),e=new Gr(t);null===this.tenantId?this._projectPasswordPolicy=e:this._tenantPasswordPolicies[this.tenantId]=e}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(t){this._errorFactory=new Pi("auth","Firebase",t())}onAuthStateChanged(t,e,i){return this.registerStateListener(this.authStateSubscription,t,e,i)}beforeAuthStateChanged(t,e){return this.beforeStateQueue.pushCallback(t,e)}onIdTokenChanged(t,e,i){return this.registerStateListener(this.idTokenSubscription,t,e,i)}authStateReady(){return new Promise(((t,e)=>{if(this.currentUser)t();else{const i=this.onAuthStateChanged((()=>{i(),t()}),e)}}))}async revokeAccessToken(t){if(this.currentUser){const e={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(e.tenantId=this.tenantId),await async function(t,e){return lr(t,"POST","/v2/accounts:revokeToken",ar(t,e))}(this,e)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(t=this._currentUser)||void 0===t?void 0:t.toJSON()}}async _setRedirectUser(t,e){const i=await this.getOrInitRedirectPersistenceManager(e);return null===t?i.removeCurrentUser():i.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const e=t&&Ar(t)||this._popupRedirectResolver;Kn(e,this,"argument-error"),this.redirectPersistenceManager=await $r.create(this,[Ar(e._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var e,i;return this._isInitialized&&await this.queue((async()=>{})),(null===(e=this._currentUser)||void 0===e?void 0:e._redirectEventId)===t?this._currentUser:(null===(i=this.redirectUser)||void 0===i?void 0:i._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue((async()=>this.directlySetCurrentUser(t)))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var t,e;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const i=null!==(e=null===(t=this.currentUser)||void 0===t?void 0:t.uid)&&void 0!==e?e:null;this.lastNotifiedUid!==i&&(this.lastNotifiedUid=i,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,e,i,o){if(this._deleted)return()=>{};const n="function"==typeof e?e:e.next.bind(e);let r=!1;const s=this._isInitialized?Promise.resolve():this._initializationPromise;if(Kn(s,this,"internal-error"),s.then((()=>{r||n(this.currentUser)})),"function"==typeof e){const n=t.addObserver(e,i,o);return()=>{r=!0,n()}}{const i=t.addObserver(e);return()=>{r=!0,i()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Kn(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){t&&!this.frameworks.includes(t)&&(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=zr(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var t;const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const i=await(null===(t=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getHeartbeatsHeader());i&&(e["X-Firebase-Client"]=i);const o=await this._getAppCheckToken();return o&&(e["X-Firebase-AppCheck"]=o),e}async _getAppCheckToken(){var t;if(nn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await(null===(t=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getToken());return(null==e?void 0:e.error)&&function(t,...e){Bn.logLevel<=Ji.WARN&&Bn.warn(`Auth (${an}): ${t}`,...e)}(`Error while retrieving App Check token: ${e.error}`),null==e?void 0:e.token}}function qr(t){return Gi(t)}class Zr{constructor(t){this.auth=t,this.observer=null,this.addObserver=function(t,e){const i=new zi(t,e);return i.subscribe.bind(i)}((t=>this.observer=t))}get next(){return Kn(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}
879
+ */(this),e=new Wr(t);null===this.tenantId?this._projectPasswordPolicy=e:this._tenantPasswordPolicies[this.tenantId]=e}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(t){this._errorFactory=new ji("auth","Firebase",t())}onAuthStateChanged(t,e,i){return this.registerStateListener(this.authStateSubscription,t,e,i)}beforeAuthStateChanged(t,e){return this.beforeStateQueue.pushCallback(t,e)}onIdTokenChanged(t,e,i){return this.registerStateListener(this.idTokenSubscription,t,e,i)}authStateReady(){return new Promise(((t,e)=>{if(this.currentUser)t();else{const i=this.onAuthStateChanged((()=>{i(),t()}),e)}}))}async revokeAccessToken(t){if(this.currentUser){const e={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(e.tenantId=this.tenantId),await async function(t,e){return cr(t,"POST","/v2/accounts:revokeToken",lr(t,e))}(this,e)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(t=this._currentUser)||void 0===t?void 0:t.toJSON()}}async _setRedirectUser(t,e){const i=await this.getOrInitRedirectPersistenceManager(e);return null===t?i.removeCurrentUser():i.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const e=t&&Tr(t)||this._popupRedirectResolver;Jn(e,this,"argument-error"),this.redirectPersistenceManager=await Nr.create(this,[Tr(e._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var e,i;return this._isInitialized&&await this.queue((async()=>{})),(null===(e=this._currentUser)||void 0===e?void 0:e._redirectEventId)===t?this._currentUser:(null===(i=this.redirectUser)||void 0===i?void 0:i._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue((async()=>this.directlySetCurrentUser(t)))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var t,e;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const i=null!==(e=null===(t=this.currentUser)||void 0===t?void 0:t.uid)&&void 0!==e?e:null;this.lastNotifiedUid!==i&&(this.lastNotifiedUid=i,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,e,i,o){if(this._deleted)return()=>{};const n="function"==typeof e?e:e.next.bind(e);let r=!1;const s=this._isInitialized?Promise.resolve():this._initializationPromise;if(Jn(s,this,"internal-error"),s.then((()=>{r||n(this.currentUser)})),"function"==typeof e){const n=t.addObserver(e,i,o);return()=>{r=!0,n()}}{const i=t.addObserver(e);return()=>{r=!0,i()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Jn(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){t&&!this.frameworks.includes(t)&&(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=Hr(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var t;const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const i=await(null===(t=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getHeartbeatsHeader());i&&(e["X-Firebase-Client"]=i);const o=await this._getAppCheckToken();return o&&(e["X-Firebase-AppCheck"]=o),e}async _getAppCheckToken(){var t;if(rn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await(null===(t=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getToken());return(null==e?void 0:e.error)&&function(t,...e){zn.logLevel<=Yi.WARN&&zn.warn(`Auth (${ln}): ${t}`,...e)}(`Error while retrieving App Check token: ${e.error}`),null==e?void 0:e.token}}function Zr(t){return Wi(t)}class Kr{constructor(t){this.auth=t,this.observer=null,this.addObserver=function(t,e){const i=new Hi(t,e);return i.subscribe.bind(i)}((t=>this.observer=t))}get next(){return Jn(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}
880
880
  /**
881
881
  * @license
882
882
  * Copyright 2020 Google LLC
@@ -892,7 +892,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
892
892
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
893
893
  * See the License for the specific language governing permissions and
894
894
  * limitations under the License.
895
- */let Kr={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Jr(t,e,i){const o=qr(t);Kn(/^https?:\/\//.test(e),o,"invalid-emulator-scheme");const n=Yr(e),{host:r,port:s}=function(t){const e=Yr(t),i=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!i)return{host:"",port:null};const o=i[2].split("@").pop()||"",n=/^(\[[^\]]+\])(:|$)/.exec(o);if(n){const t=n[1];return{host:t,port:Qr(o.substr(t.length+1))}}{const[t,e]=o.split(":");return{host:t,port:Qr(e)}}}(e),a={url:`${n}//${r}${null===s?"":`:${s}`}/`},l=Object.freeze({host:r,port:s,protocol:n.replace(":",""),options:Object.freeze({disableWarnings:!1})});if(!o._canInitEmulator)return Kn(o.config.emulator&&o.emulatorConfig,o,"emulator-config-failed"),void Kn(Vi(a,o.config.emulator)&&Vi(l,o.emulatorConfig),o,"emulator-config-failed");o.config.emulator=a,o.emulatorConfig=l,o.settings.appVerificationDisabledForTesting=!0,function(){function t(){const t=document.createElement("p"),e=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",e.position="fixed",e.width="100%",e.backgroundColor="#ffffff",e.border=".1em solid #000000",e.color="#b50000",e.bottom="0px",e.left="0px",e.margin="0px",e.zIndex="10000",e.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}"undefined"!=typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials.");"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",t):t())}
895
+ */let Jr={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Yr(t,e,i){const o=Zr(t);Jn(/^https?:\/\//.test(e),o,"invalid-emulator-scheme");const n=Qr(e),{host:r,port:s}=function(t){const e=Qr(t),i=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!i)return{host:"",port:null};const o=i[2].split("@").pop()||"",n=/^(\[[^\]]+\])(:|$)/.exec(o);if(n){const t=n[1];return{host:t,port:Xr(o.substr(t.length+1))}}{const[t,e]=o.split(":");return{host:t,port:Xr(e)}}}(e),a={url:`${n}//${r}${null===s?"":`:${s}`}/`},l=Object.freeze({host:r,port:s,protocol:n.replace(":",""),options:Object.freeze({disableWarnings:!1})});if(!o._canInitEmulator)return Jn(o.config.emulator&&o.emulatorConfig,o,"emulator-config-failed"),void Jn(Ui(a,o.config.emulator)&&Ui(l,o.emulatorConfig),o,"emulator-config-failed");o.config.emulator=a,o.emulatorConfig=l,o.settings.appVerificationDisabledForTesting=!0,function(){function t(){const t=document.createElement("p"),e=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",e.position="fixed",e.width="100%",e.backgroundColor="#ffffff",e.border=".1em solid #000000",e.color="#b50000",e.bottom="0px",e.left="0px",e.margin="0px",e.zIndex="10000",e.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}"undefined"!=typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials.");"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",t):t())}
896
896
  /**
897
897
  * @license
898
898
  * Copyright 2020 Google LLC
@@ -908,7 +908,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
908
908
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
909
909
  * See the License for the specific language governing permissions and
910
910
  * limitations under the License.
911
- */()}function Yr(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function Qr(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}class Xr{constructor(t,e){this.providerId=t,this.signInMethod=e}toJSON(){return Jn("not implemented")}_getIdTokenResponse(t){return Jn("not implemented")}_linkToIdToken(t,e){return Jn("not implemented")}_getReauthenticationResolver(t){return Jn("not implemented")}}
911
+ */()}function Qr(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function Xr(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}class ts{constructor(t,e){this.providerId=t,this.signInMethod=e}toJSON(){return Yn("not implemented")}_getIdTokenResponse(t){return Yn("not implemented")}_linkToIdToken(t,e){return Yn("not implemented")}_getReauthenticationResolver(t){return Yn("not implemented")}}
912
912
  /**
913
913
  * @license
914
914
  * Copyright 2020 Google LLC
@@ -924,7 +924,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
924
924
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
925
925
  * See the License for the specific language governing permissions and
926
926
  * limitations under the License.
927
- */async function ts(t,e){return async function(t,e,i,o,n={}){const r=await lr(t,e,i,o,n);return"mfaPendingCredential"in r&&Hn(t,"multi-factor-auth-required",{_serverResponse:r}),r}(t,"POST","/v1/accounts:signInWithIdp",ar(t,e))}
927
+ */async function es(t,e){return async function(t,e,i,o,n={}){const r=await cr(t,e,i,o,n);return"mfaPendingCredential"in r&&Gn(t,"multi-factor-auth-required",{_serverResponse:r}),r}(t,"POST","/v1/accounts:signInWithIdp",lr(t,e))}
928
928
  /**
929
929
  * @license
930
930
  * Copyright 2020 Google LLC
@@ -940,7 +940,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
940
940
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
941
941
  * See the License for the specific language governing permissions and
942
942
  * limitations under the License.
943
- */class es extends Xr{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const e=new es(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(e.idToken=t.idToken),t.accessToken&&(e.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(e.nonce=t.nonce),t.pendingToken&&(e.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(e.accessToken=t.oauthToken,e.secret=t.oauthTokenSecret):Hn("argument-error"),e}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const e="string"==typeof t?JSON.parse(t):t,{providerId:i,signInMethod:o}=e,n=Pn(e,["providerId","signInMethod"]);if(!i||!o)return null;const r=new es(i,o);return r.idToken=n.idToken||void 0,r.accessToken=n.accessToken||void 0,r.secret=n.secret,r.nonce=n.nonce,r.pendingToken=n.pendingToken||null,r}_getIdTokenResponse(t){return ts(t,this.buildRequest())}_linkToIdToken(t,e){const i=this.buildRequest();return i.idToken=e,ts(t,i)}_getReauthenticationResolver(t){const e=this.buildRequest();return e.autoCreate=!1,ts(t,e)}buildRequest(){const t={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const e={};this.idToken&&(e.id_token=this.idToken),this.accessToken&&(e.access_token=this.accessToken),this.secret&&(e.oauth_token_secret=this.secret),e.providerId=this.providerId,this.nonce&&!this.pendingToken&&(e.nonce=this.nonce),t.postBody=Bi(e)}return t}}
943
+ */class is extends ts{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const e=new is(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(e.idToken=t.idToken),t.accessToken&&(e.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(e.nonce=t.nonce),t.pendingToken&&(e.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(e.accessToken=t.oauthToken,e.secret=t.oauthTokenSecret):Gn("argument-error"),e}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const e="string"==typeof t?JSON.parse(t):t,{providerId:i,signInMethod:o}=e,n=jn(e,["providerId","signInMethod"]);if(!i||!o)return null;const r=new is(i,o);return r.idToken=n.idToken||void 0,r.accessToken=n.accessToken||void 0,r.secret=n.secret,r.nonce=n.nonce,r.pendingToken=n.pendingToken||null,r}_getIdTokenResponse(t){return es(t,this.buildRequest())}_linkToIdToken(t,e){const i=this.buildRequest();return i.idToken=e,es(t,i)}_getReauthenticationResolver(t){const e=this.buildRequest();return e.autoCreate=!1,es(t,e)}buildRequest(){const t={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const e={};this.idToken&&(e.id_token=this.idToken),this.accessToken&&(e.access_token=this.accessToken),this.secret&&(e.oauth_token_secret=this.secret),e.providerId=this.providerId,this.nonce&&!this.pendingToken&&(e.nonce=this.nonce),t.postBody=zi(e)}return t}}
944
944
  /**
945
945
  * @license
946
946
  * Copyright 2020 Google LLC
@@ -956,7 +956,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
956
956
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
957
957
  * See the License for the specific language governing permissions and
958
958
  * limitations under the License.
959
- */class is{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}
959
+ */class os{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}
960
960
  /**
961
961
  * @license
962
962
  * Copyright 2019 Google LLC
@@ -972,7 +972,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
972
972
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
973
973
  * See the License for the specific language governing permissions and
974
974
  * limitations under the License.
975
- */class os extends is{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}
975
+ */class ns extends os{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}
976
976
  /**
977
977
  * @license
978
978
  * Copyright 2020 Google LLC
@@ -988,7 +988,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
988
988
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
989
989
  * See the License for the specific language governing permissions and
990
990
  * limitations under the License.
991
- */class ns extends os{constructor(){super("facebook.com")}static credential(t){return es._fromParams({providerId:ns.PROVIDER_ID,signInMethod:ns.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return ns.credentialFromTaggedObject(t)}static credentialFromError(t){return ns.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return ns.credential(t.oauthAccessToken)}catch(t){return null}}}ns.FACEBOOK_SIGN_IN_METHOD="facebook.com",ns.PROVIDER_ID="facebook.com";
991
+ */class rs extends ns{constructor(){super("facebook.com")}static credential(t){return is._fromParams({providerId:rs.PROVIDER_ID,signInMethod:rs.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return rs.credentialFromTaggedObject(t)}static credentialFromError(t){return rs.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return rs.credential(t.oauthAccessToken)}catch(t){return null}}}rs.FACEBOOK_SIGN_IN_METHOD="facebook.com",rs.PROVIDER_ID="facebook.com";
992
992
  /**
993
993
  * @license
994
994
  * Copyright 2020 Google LLC
@@ -1005,7 +1005,7 @@ class Er{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
1005
1005
  * See the License for the specific language governing permissions and
1006
1006
  * limitations under the License.
1007
1007
  */
1008
- class rs extends os{constructor(){super("google.com"),this.addScope("profile")}static credential(t,e){return es._fromParams({providerId:rs.PROVIDER_ID,signInMethod:rs.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:e})}static credentialFromResult(t){return rs.credentialFromTaggedObject(t)}static credentialFromError(t){return rs.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:e,oauthAccessToken:i}=t;if(!e&&!i)return null;try{return rs.credential(e,i)}catch(t){return null}}}rs.GOOGLE_SIGN_IN_METHOD="google.com",rs.PROVIDER_ID="google.com";
1008
+ class ss extends ns{constructor(){super("google.com"),this.addScope("profile")}static credential(t,e){return is._fromParams({providerId:ss.PROVIDER_ID,signInMethod:ss.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:e})}static credentialFromResult(t){return ss.credentialFromTaggedObject(t)}static credentialFromError(t){return ss.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:e,oauthAccessToken:i}=t;if(!e&&!i)return null;try{return ss.credential(e,i)}catch(t){return null}}}ss.GOOGLE_SIGN_IN_METHOD="google.com",ss.PROVIDER_ID="google.com";
1009
1009
  /**
1010
1010
  * @license
1011
1011
  * Copyright 2020 Google LLC
@@ -1022,7 +1022,7 @@ class rs extends os{constructor(){super("google.com"),this.addScope("profile")}s
1022
1022
  * See the License for the specific language governing permissions and
1023
1023
  * limitations under the License.
1024
1024
  */
1025
- class ss extends os{constructor(){super("github.com")}static credential(t){return es._fromParams({providerId:ss.PROVIDER_ID,signInMethod:ss.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return ss.credentialFromTaggedObject(t)}static credentialFromError(t){return ss.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return ss.credential(t.oauthAccessToken)}catch(t){return null}}}ss.GITHUB_SIGN_IN_METHOD="github.com",ss.PROVIDER_ID="github.com";
1025
+ class as extends ns{constructor(){super("github.com")}static credential(t){return is._fromParams({providerId:as.PROVIDER_ID,signInMethod:as.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return as.credentialFromTaggedObject(t)}static credentialFromError(t){return as.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return as.credential(t.oauthAccessToken)}catch(t){return null}}}as.GITHUB_SIGN_IN_METHOD="github.com",as.PROVIDER_ID="github.com";
1026
1026
  /**
1027
1027
  * @license
1028
1028
  * Copyright 2020 Google LLC
@@ -1039,7 +1039,7 @@ class ss extends os{constructor(){super("github.com")}static credential(t){retur
1039
1039
  * See the License for the specific language governing permissions and
1040
1040
  * limitations under the License.
1041
1041
  */
1042
- class as extends os{constructor(){super("twitter.com")}static credential(t,e){return es._fromParams({providerId:as.PROVIDER_ID,signInMethod:as.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:e})}static credentialFromResult(t){return as.credentialFromTaggedObject(t)}static credentialFromError(t){return as.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:e,oauthTokenSecret:i}=t;if(!e||!i)return null;try{return as.credential(e,i)}catch(t){return null}}}as.TWITTER_SIGN_IN_METHOD="twitter.com",as.PROVIDER_ID="twitter.com";
1042
+ class ls extends ns{constructor(){super("twitter.com")}static credential(t,e){return is._fromParams({providerId:ls.PROVIDER_ID,signInMethod:ls.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:e})}static credentialFromResult(t){return ls.credentialFromTaggedObject(t)}static credentialFromError(t){return ls.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:e,oauthTokenSecret:i}=t;if(!e||!i)return null;try{return ls.credential(e,i)}catch(t){return null}}}ls.TWITTER_SIGN_IN_METHOD="twitter.com",ls.PROVIDER_ID="twitter.com";
1043
1043
  /**
1044
1044
  * @license
1045
1045
  * Copyright 2020 Google LLC
@@ -1056,7 +1056,7 @@ class as extends os{constructor(){super("twitter.com")}static credential(t,e){re
1056
1056
  * See the License for the specific language governing permissions and
1057
1057
  * limitations under the License.
1058
1058
  */
1059
- class ls{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,e,i,o=!1){const n=await Sr._fromIdTokenResponse(t,i,o),r=cs(i);return new ls({user:n,providerId:r,_tokenResponse:i,operationType:e})}static async _forOperation(t,e,i){await t._updateTokensIfNecessary(i,!0);const o=cs(i);return new ls({user:t,providerId:o,_tokenResponse:i,operationType:e})}}function cs(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}
1059
+ class cs{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,e,i,o=!1){const n=await Ar._fromIdTokenResponse(t,i,o),r=ds(i);return new cs({user:n,providerId:r,_tokenResponse:i,operationType:e})}static async _forOperation(t,e,i){await t._updateTokensIfNecessary(i,!0);const o=ds(i);return new cs({user:t,providerId:o,_tokenResponse:i,operationType:e})}}function ds(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}
1060
1060
  /**
1061
1061
  * @license
1062
1062
  * Copyright 2020 Google LLC
@@ -1072,7 +1072,7 @@ class ls{constructor(t){this.user=t.user,this.providerId=t.providerId,this._toke
1072
1072
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1073
1073
  * See the License for the specific language governing permissions and
1074
1074
  * limitations under the License.
1075
- */class ds extends Fi{constructor(t,e,i,o){var n;super(e.code,e.message),this.operationType=i,this.user=o,Object.setPrototypeOf(this,ds.prototype),this.customData={appName:t.name,tenantId:null!==(n=t.tenantId)&&void 0!==n?n:void 0,_serverResponse:e.customData._serverResponse,operationType:i}}static _fromErrorAndOperation(t,e,i,o){return new ds(t,e,i,o)}}function hs(t,e,i,o){return("reauthenticate"===e?i._getReauthenticationResolver(t):i._getIdTokenResponse(t)).catch((i=>{if("auth/multi-factor-auth-required"===i.code)throw ds._fromErrorAndOperation(t,i,e,o);throw i}))}const us="__sak";
1075
+ */class hs extends Pi{constructor(t,e,i,o){var n;super(e.code,e.message),this.operationType=i,this.user=o,Object.setPrototypeOf(this,hs.prototype),this.customData={appName:t.name,tenantId:null!==(n=t.tenantId)&&void 0!==n?n:void 0,_serverResponse:e.customData._serverResponse,operationType:i}}static _fromErrorAndOperation(t,e,i,o){return new hs(t,e,i,o)}}function us(t,e,i,o){return("reauthenticate"===e?i._getReauthenticationResolver(t):i._getIdTokenResponse(t)).catch((i=>{if("auth/multi-factor-auth-required"===i.code)throw hs._fromErrorAndOperation(t,i,e,o);throw i}))}const ps="__sak";
1076
1076
  /**
1077
1077
  * @license
1078
1078
  * Copyright 2019 Google LLC
@@ -1088,7 +1088,7 @@ class ls{constructor(t){this.user=t.user,this.providerId=t.providerId,this._toke
1088
1088
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1089
1089
  * See the License for the specific language governing permissions and
1090
1090
  * limitations under the License.
1091
- */class ps{constructor(t,e){this.storageRetriever=t,this.type=e}_isAvailable(){try{return this.storage?(this.storage.setItem(us,"1"),this.storage.removeItem(us),Promise.resolve(!0)):Promise.resolve(!1)}catch(t){return Promise.resolve(!1)}}_set(t,e){return this.storage.setItem(t,JSON.stringify(e)),Promise.resolve()}_get(t){const e=this.storage.getItem(t);return Promise.resolve(e?JSON.parse(e):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}
1091
+ */class vs{constructor(t,e){this.storageRetriever=t,this.type=e}_isAvailable(){try{return this.storage?(this.storage.setItem(ps,"1"),this.storage.removeItem(ps),Promise.resolve(!0)):Promise.resolve(!1)}catch(t){return Promise.resolve(!1)}}_set(t,e){return this.storage.setItem(t,JSON.stringify(e)),Promise.resolve()}_get(t){const e=this.storage.getItem(t);return Promise.resolve(e?JSON.parse(e):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}
1092
1092
  /**
1093
1093
  * @license
1094
1094
  * Copyright 2020 Google LLC
@@ -1104,7 +1104,7 @@ class ls{constructor(t){this.user=t.user,this.providerId=t.providerId,this._toke
1104
1104
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1105
1105
  * See the License for the specific language governing permissions and
1106
1106
  * limitations under the License.
1107
- */class vs extends ps{constructor(){super((()=>window.localStorage),"LOCAL"),this.boundEventHandler=(t,e)=>this.onStorageEvent(t,e),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Br(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const e of Object.keys(this.listeners)){const i=this.storage.getItem(e),o=this.localCache[e];i!==o&&t(e,o,i)}}onStorageEvent(t,e=!1){if(!t.key)return void this.forAllChangedKeys(((t,e,i)=>{this.notifyListeners(t,i)}));const i=t.key;e?this.detachListener():this.stopPolling();const o=()=>{const t=this.storage.getItem(i);(e||this.localCache[i]!==t)&&this.notifyListeners(i,t)},n=this.storage.getItem(i);Ur()&&n!==t.newValue&&t.newValue!==t.oldValue?setTimeout(o,10):o()}notifyListeners(t,e){this.localCache[t]=e;const i=this.listeners[t];if(i)for(const t of Array.from(i))t(e?JSON.parse(e):e)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((()=>{this.forAllChangedKeys(((t,e,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:e,newValue:i}),!0)}))}),1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,e){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(e)}_removeListener(t,e){this.listeners[t]&&(this.listeners[t].delete(e),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(t,e){await super._set(t,e),this.localCache[t]=JSON.stringify(e)}async _get(t){const e=await super._get(t);return this.localCache[t]=JSON.stringify(e),e}async _remove(t){await super._remove(t),delete this.localCache[t]}}vs.type="LOCAL";const gs=vs;
1107
+ */class gs extends vs{constructor(){super((()=>window.localStorage),"LOCAL"),this.boundEventHandler=(t,e)=>this.onStorageEvent(t,e),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=zr(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const e of Object.keys(this.listeners)){const i=this.storage.getItem(e),o=this.localCache[e];i!==o&&t(e,o,i)}}onStorageEvent(t,e=!1){if(!t.key)return void this.forAllChangedKeys(((t,e,i)=>{this.notifyListeners(t,i)}));const i=t.key;e?this.detachListener():this.stopPolling();const o=()=>{const t=this.storage.getItem(i);(e||this.localCache[i]!==t)&&this.notifyListeners(i,t)},n=this.storage.getItem(i);Br()&&n!==t.newValue&&t.newValue!==t.oldValue?setTimeout(o,10):o()}notifyListeners(t,e){this.localCache[t]=e;const i=this.listeners[t];if(i)for(const t of Array.from(i))t(e?JSON.parse(e):e)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((()=>{this.forAllChangedKeys(((t,e,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:e,newValue:i}),!0)}))}),1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,e){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(e)}_removeListener(t,e){this.listeners[t]&&(this.listeners[t].delete(e),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(t,e){await super._set(t,e),this.localCache[t]=JSON.stringify(e)}async _get(t){const e=await super._get(t);return this.localCache[t]=JSON.stringify(e),e}async _remove(t){await super._remove(t),delete this.localCache[t]}}gs.type="LOCAL";const fs=gs;
1108
1108
  /**
1109
1109
  * @license
1110
1110
  * Copyright 2020 Google LLC
@@ -1120,7 +1120,7 @@ class ls{constructor(t){this.user=t.user,this.providerId=t.providerId,this._toke
1120
1120
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1121
1121
  * See the License for the specific language governing permissions and
1122
1122
  * limitations under the License.
1123
- */class fs extends ps{constructor(){super((()=>window.sessionStorage),"SESSION")}_addListener(t,e){}_removeListener(t,e){}}fs.type="SESSION";const ms=fs;
1123
+ */class ms extends vs{constructor(){super((()=>window.sessionStorage),"SESSION")}_addListener(t,e){}_removeListener(t,e){}}ms.type="SESSION";const ws=ms;
1124
1124
  /**
1125
1125
  * @license
1126
1126
  * Copyright 2019 Google LLC
@@ -1153,7 +1153,7 @@ class ls{constructor(t){this.user=t.user,this.providerId=t.providerId,this._toke
1153
1153
  * See the License for the specific language governing permissions and
1154
1154
  * limitations under the License.
1155
1155
  */
1156
- class ws{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const e=this.receivers.find((e=>e.isListeningto(t)));if(e)return e;const i=new ws(t);return this.receivers.push(i),i}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const e=t,{eventId:i,eventType:o,data:n}=e.data,r=this.handlersMap[o];if(!(null==r?void 0:r.size))return;e.ports[0].postMessage({status:"ack",eventId:i,eventType:o});const s=Array.from(r).map((async t=>t(e.origin,n))),a=await function(t){return Promise.all(t.map((async t=>{try{return{fulfilled:!0,value:await t}}catch(t){return{fulfilled:!1,reason:t}}})))}(s);e.ports[0].postMessage({status:"done",eventId:i,eventType:o,response:a})}_subscribe(t,e){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(e)}_unsubscribe(t,e){this.handlersMap[t]&&e&&this.handlersMap[t].delete(e),e&&0!==this.handlersMap[t].size||delete this.handlersMap[t],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}
1156
+ class ys{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const e=this.receivers.find((e=>e.isListeningto(t)));if(e)return e;const i=new ys(t);return this.receivers.push(i),i}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const e=t,{eventId:i,eventType:o,data:n}=e.data,r=this.handlersMap[o];if(!(null==r?void 0:r.size))return;e.ports[0].postMessage({status:"ack",eventId:i,eventType:o});const s=Array.from(r).map((async t=>t(e.origin,n))),a=await function(t){return Promise.all(t.map((async t=>{try{return{fulfilled:!0,value:await t}}catch(t){return{fulfilled:!1,reason:t}}})))}(s);e.ports[0].postMessage({status:"done",eventId:i,eventType:o,response:a})}_subscribe(t,e){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(e)}_unsubscribe(t,e){this.handlersMap[t]&&e&&this.handlersMap[t].delete(e),e&&0!==this.handlersMap[t].size||delete this.handlersMap[t],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}
1157
1157
  /**
1158
1158
  * @license
1159
1159
  * Copyright 2020 Google LLC
@@ -1170,7 +1170,7 @@ class ws{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHa
1170
1170
  * See the License for the specific language governing permissions and
1171
1171
  * limitations under the License.
1172
1172
  */
1173
- function ys(t="",e=10){let i="";for(let t=0;t<e;t++)i+=Math.floor(10*Math.random());return t+i}
1173
+ function bs(t="",e=10){let i="";for(let t=0;t<e;t++)i+=Math.floor(10*Math.random());return t+i}
1174
1174
  /**
1175
1175
  * @license
1176
1176
  * Copyright 2019 Google LLC
@@ -1186,7 +1186,7 @@ function ys(t="",e=10){let i="";for(let t=0;t<e;t++)i+=Math.floor(10*Math.random
1186
1186
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1187
1187
  * See the License for the specific language governing permissions and
1188
1188
  * limitations under the License.
1189
- */ws.receivers=[];class bs{constructor(t){this.target=t,this.handlers=new Set}removeMessageHandler(t){t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)}async _send(t,e,i=50){const o="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!o)throw new Error("connection_unavailable");let n,r;return new Promise(((s,a)=>{const l=ys("",20);o.port1.start();const c=setTimeout((()=>{a(new Error("unsupported_event"))}),i);r={messageChannel:o,onMessage(t){const e=t;if(e.data.eventId===l)switch(e.data.status){case"ack":clearTimeout(c),n=setTimeout((()=>{a(new Error("timeout"))}),3e3);break;case"done":clearTimeout(n),s(e.data.response);break;default:clearTimeout(c),clearTimeout(n),a(new Error("invalid_response"))}}},this.handlers.add(r),o.port1.addEventListener("message",r.onMessage),this.target.postMessage({eventType:t,eventId:l,data:e},[o.port2])})).finally((()=>{r&&this.removeMessageHandler(r)}))}}
1189
+ */ys.receivers=[];class Cs{constructor(t){this.target=t,this.handlers=new Set}removeMessageHandler(t){t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)}async _send(t,e,i=50){const o="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!o)throw new Error("connection_unavailable");let n,r;return new Promise(((s,a)=>{const l=bs("",20);o.port1.start();const c=setTimeout((()=>{a(new Error("unsupported_event"))}),i);r={messageChannel:o,onMessage(t){const e=t;if(e.data.eventId===l)switch(e.data.status){case"ack":clearTimeout(c),n=setTimeout((()=>{a(new Error("timeout"))}),3e3);break;case"done":clearTimeout(n),s(e.data.response);break;default:clearTimeout(c),clearTimeout(n),a(new Error("invalid_response"))}}},this.handlers.add(r),o.port1.addEventListener("message",r.onMessage),this.target.postMessage({eventType:t,eventId:l,data:e},[o.port2])})).finally((()=>{r&&this.removeMessageHandler(r)}))}}
1190
1190
  /**
1191
1191
  * @license
1192
1192
  * Copyright 2020 Google LLC
@@ -1202,7 +1202,7 @@ function ys(t="",e=10){let i="";for(let t=0;t<e;t++)i+=Math.floor(10*Math.random
1202
1202
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1203
1203
  * See the License for the specific language governing permissions and
1204
1204
  * limitations under the License.
1205
- */function Cs(){return window}
1205
+ */function xs(){return window}
1206
1206
  /**
1207
1207
  * @license
1208
1208
  * Copyright 2020 Google LLC.
@@ -1219,7 +1219,7 @@ function ys(t="",e=10){let i="";for(let t=0;t<e;t++)i+=Math.floor(10*Math.random
1219
1219
  * See the License for the specific language governing permissions and
1220
1220
  * limitations under the License.
1221
1221
  */
1222
- function xs(){return void 0!==Cs().WorkerGlobalScope&&"function"==typeof Cs().importScripts}
1222
+ function Es(){return void 0!==xs().WorkerGlobalScope&&"function"==typeof xs().importScripts}
1223
1223
  /**
1224
1224
  * @license
1225
1225
  * Copyright 2019 Google LLC
@@ -1236,7 +1236,7 @@ function xs(){return void 0!==Cs().WorkerGlobalScope&&"function"==typeof Cs().im
1236
1236
  * See the License for the specific language governing permissions and
1237
1237
  * limitations under the License.
1238
1238
  */
1239
- const Es="firebaseLocalStorageDb",ks="firebaseLocalStorage",Ss="fbase_key";class Ms{constructor(t){this.request=t}toPromise(){return new Promise(((t,e)=>{this.request.addEventListener("success",(()=>{t(this.request.result)})),this.request.addEventListener("error",(()=>{e(this.request.error)}))}))}}function As(t,e){return t.transaction([ks],e?"readwrite":"readonly").objectStore(ks)}function Ts(){const t=indexedDB.open(Es,1);return new Promise(((e,i)=>{t.addEventListener("error",(()=>{i(t.error)})),t.addEventListener("upgradeneeded",(()=>{const e=t.result;try{e.createObjectStore(ks,{keyPath:Ss})}catch(t){i(t)}})),t.addEventListener("success",(async()=>{const i=t.result;i.objectStoreNames.contains(ks)?e(i):(i.close(),await function(){const t=indexedDB.deleteDatabase(Es);return new Ms(t).toPromise()}(),e(await Ts()))}))}))}async function Is(t,e,i){const o=As(t,!0).put({[Ss]:e,value:i});return new Ms(o).toPromise()}function _s(t,e){const i=As(t,!0).delete(e);return new Ms(i).toPromise()}class $s{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then((()=>{}),(()=>{}))}async _openDb(){return this.db||(this.db=await Ts()),this.db}async _withRetries(t){let e=0;for(;;)try{const e=await this._openDb();return await t(e)}catch(t){if(e++>3)throw t;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return xs()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=ws._getInstance(xs()?self:null),this.receiver._subscribe("keyChanged",(async(t,e)=>({keyProcessed:(await this._poll()).includes(e.key)}))),this.receiver._subscribe("ping",(async(t,e)=>["keyChanged"]))}async initializeSender(){var t,e;if(this.activeServiceWorker=await async function(){if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(t){return null}}(),!this.activeServiceWorker)return;this.sender=new bs(this.activeServiceWorker);const i=await this.sender._send("ping",{},800);i&&(null===(t=i[0])||void 0===t?void 0:t.fulfilled)&&(null===(e=i[0])||void 0===e?void 0:e.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){var e;if(this.sender&&this.activeServiceWorker&&((null===(e=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===e?void 0:e.controller)||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch(e){}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await Ts();return await Is(t,us,"1"),await _s(t,us),!0}catch(t){}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,e){return this._withPendingWrite((async()=>(await this._withRetries((i=>Is(i,t,e))),this.localCache[t]=e,this.notifyServiceWorker(t))))}async _get(t){const e=await this._withRetries((e=>async function(t,e){const i=As(t,!1).get(e),o=await new Ms(i).toPromise();return void 0===o?null:o.value}(e,t)));return this.localCache[t]=e,e}async _remove(t){return this._withPendingWrite((async()=>(await this._withRetries((e=>_s(e,t))),delete this.localCache[t],this.notifyServiceWorker(t))))}async _poll(){const t=await this._withRetries((t=>{const e=As(t,!1).getAll();return new Ms(e).toPromise()}));if(!t)return[];if(0!==this.pendingWrites)return[];const e=[],i=new Set;if(0!==t.length)for(const{fbase_key:o,value:n}of t)i.add(o),JSON.stringify(this.localCache[o])!==JSON.stringify(n)&&(this.notifyListeners(o,n),e.push(o));for(const t of Object.keys(this.localCache))this.localCache[t]&&!i.has(t)&&(this.notifyListeners(t,null),e.push(t));return e}notifyListeners(t,e){this.localCache[t]=e;const i=this.listeners[t];if(i)for(const t of Array.from(i))t(e)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((async()=>this._poll()),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,e){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(e)}_removeListener(t,e){this.listeners[t]&&(this.listeners[t].delete(e),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&this.stopPolling()}}$s.type="LOCAL";const Ns=$s;new er(3e4,6e4);
1239
+ const ks="firebaseLocalStorageDb",Ss="firebaseLocalStorage",As="fbase_key";class Ms{constructor(t){this.request=t}toPromise(){return new Promise(((t,e)=>{this.request.addEventListener("success",(()=>{t(this.request.result)})),this.request.addEventListener("error",(()=>{e(this.request.error)}))}))}}function Ts(t,e){return t.transaction([Ss],e?"readwrite":"readonly").objectStore(Ss)}function Is(){const t=indexedDB.open(ks,1);return new Promise(((e,i)=>{t.addEventListener("error",(()=>{i(t.error)})),t.addEventListener("upgradeneeded",(()=>{const e=t.result;try{e.createObjectStore(Ss,{keyPath:As})}catch(t){i(t)}})),t.addEventListener("success",(async()=>{const i=t.result;i.objectStoreNames.contains(Ss)?e(i):(i.close(),await function(){const t=indexedDB.deleteDatabase(ks);return new Ms(t).toPromise()}(),e(await Is()))}))}))}async function _s(t,e,i){const o=Ts(t,!0).put({[As]:e,value:i});return new Ms(o).toPromise()}function $s(t,e){const i=Ts(t,!0).delete(e);return new Ms(i).toPromise()}class Ns{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then((()=>{}),(()=>{}))}async _openDb(){return this.db||(this.db=await Is()),this.db}async _withRetries(t){let e=0;for(;;)try{const e=await this._openDb();return await t(e)}catch(t){if(e++>3)throw t;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Es()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=ys._getInstance(Es()?self:null),this.receiver._subscribe("keyChanged",(async(t,e)=>({keyProcessed:(await this._poll()).includes(e.key)}))),this.receiver._subscribe("ping",(async(t,e)=>["keyChanged"]))}async initializeSender(){var t,e;if(this.activeServiceWorker=await async function(){if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(t){return null}}(),!this.activeServiceWorker)return;this.sender=new Cs(this.activeServiceWorker);const i=await this.sender._send("ping",{},800);i&&(null===(t=i[0])||void 0===t?void 0:t.fulfilled)&&(null===(e=i[0])||void 0===e?void 0:e.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){var e;if(this.sender&&this.activeServiceWorker&&((null===(e=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===e?void 0:e.controller)||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch(e){}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await Is();return await _s(t,ps,"1"),await $s(t,ps),!0}catch(t){}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,e){return this._withPendingWrite((async()=>(await this._withRetries((i=>_s(i,t,e))),this.localCache[t]=e,this.notifyServiceWorker(t))))}async _get(t){const e=await this._withRetries((e=>async function(t,e){const i=Ts(t,!1).get(e),o=await new Ms(i).toPromise();return void 0===o?null:o.value}(e,t)));return this.localCache[t]=e,e}async _remove(t){return this._withPendingWrite((async()=>(await this._withRetries((e=>$s(e,t))),delete this.localCache[t],this.notifyServiceWorker(t))))}async _poll(){const t=await this._withRetries((t=>{const e=Ts(t,!1).getAll();return new Ms(e).toPromise()}));if(!t)return[];if(0!==this.pendingWrites)return[];const e=[],i=new Set;if(0!==t.length)for(const{fbase_key:o,value:n}of t)i.add(o),JSON.stringify(this.localCache[o])!==JSON.stringify(n)&&(this.notifyListeners(o,n),e.push(o));for(const t of Object.keys(this.localCache))this.localCache[t]&&!i.has(t)&&(this.notifyListeners(t,null),e.push(t));return e}notifyListeners(t,e){this.localCache[t]=e;const i=this.listeners[t];if(i)for(const t of Array.from(i))t(e)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((async()=>this._poll()),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,e){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(e)}_removeListener(t,e){this.listeners[t]&&(this.listeners[t].delete(e),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&this.stopPolling()}}Ns.type="LOCAL";const Os=Ns;new ir(3e4,6e4);
1240
1240
  /**
1241
1241
  * @license
1242
1242
  * Copyright 2019 Google LLC
@@ -1253,7 +1253,7 @@ const Es="firebaseLocalStorageDb",ks="firebaseLocalStorage",Ss="fbase_key";class
1253
1253
  * See the License for the specific language governing permissions and
1254
1254
  * limitations under the License.
1255
1255
  */
1256
- class Os extends Xr{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return ts(t,this._buildIdpRequest())}_linkToIdToken(t,e){return ts(t,this._buildIdpRequest(e))}_getReauthenticationResolver(t){return ts(t,this._buildIdpRequest())}_buildIdpRequest(t){const e={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(e.idToken=t),e}}function Ls(t){
1256
+ class Ls extends ts{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return es(t,this._buildIdpRequest())}_linkToIdToken(t,e){return es(t,this._buildIdpRequest(e))}_getReauthenticationResolver(t){return es(t,this._buildIdpRequest())}_buildIdpRequest(t){const e={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(e.idToken=t),e}}function Rs(t){
1257
1257
  /**
1258
1258
  * @license
1259
1259
  * Copyright 2020 Google LLC
@@ -1270,7 +1270,7 @@ class Os extends Xr{constructor(t){super("custom","custom"),this.params=t}_getId
1270
1270
  * See the License for the specific language governing permissions and
1271
1271
  * limitations under the License.
1272
1272
  */
1273
- return async function(t,e,i=!1){if(nn(t.app))return Promise.reject(qn(t));const o="signIn",n=await hs(t,o,e),r=await ls._fromIdTokenResponse(t,o,n);return i||await t._updateCurrentUser(r.user),r}(t.auth,new Os(t),t.bypassAuthState)}function Rs(t){const{auth:e,user:i}=t;return Kn(i,e,"internal-error"),
1273
+ return async function(t,e,i=!1){if(rn(t.app))return Promise.reject(Zn(t));const o="signIn",n=await us(t,o,e),r=await cs._fromIdTokenResponse(t,o,n);return i||await t._updateCurrentUser(r.user),r}(t.auth,new Ls(t),t.bypassAuthState)}function Ds(t){const{auth:e,user:i}=t;return Jn(i,e,"internal-error"),
1274
1274
  /**
1275
1275
  * @license
1276
1276
  * Copyright 2019 Google LLC
@@ -1287,7 +1287,7 @@ return async function(t,e,i=!1){if(nn(t.app))return Promise.reject(qn(t));const
1287
1287
  * See the License for the specific language governing permissions and
1288
1288
  * limitations under the License.
1289
1289
  */
1290
- async function(t,e,i=!1){const{auth:o}=t;if(nn(o.app))return Promise.reject(qn(o));const n="reauthenticate";try{const r=await wr(t,hs(o,n,e,t),i);Kn(r.idToken,o,"internal-error");const s=fr(r.idToken);Kn(s,o,"internal-error");const{sub:a}=s;return Kn(t.uid===a,o,"user-mismatch"),ls._forOperation(t,n,r)}catch(t){throw"auth/user-not-found"===(null==t?void 0:t.code)&&Hn(o,"user-mismatch"),t}}(i,new Os(t),t.bypassAuthState)}async function Ds(t){const{auth:e,user:i}=t;return Kn(i,e,"internal-error"),async function(t,e,i=!1){const o=await wr(t,e._linkToIdToken(t.auth,await t.getIdToken()),i);return ls._forOperation(t,"link",o)}(i,new Os(t),t.bypassAuthState)}
1290
+ async function(t,e,i=!1){const{auth:o}=t;if(rn(o.app))return Promise.reject(Zn(o));const n="reauthenticate";try{const r=await yr(t,us(o,n,e,t),i);Jn(r.idToken,o,"internal-error");const s=mr(r.idToken);Jn(s,o,"internal-error");const{sub:a}=s;return Jn(t.uid===a,o,"user-mismatch"),cs._forOperation(t,n,r)}catch(t){throw"auth/user-not-found"===(null==t?void 0:t.code)&&Gn(o,"user-mismatch"),t}}(i,new Ls(t),t.bypassAuthState)}async function Fs(t){const{auth:e,user:i}=t;return Jn(i,e,"internal-error"),async function(t,e,i=!1){const o=await yr(t,e._linkToIdToken(t.auth,await t.getIdToken()),i);return cs._forOperation(t,"link",o)}(i,new Ls(t),t.bypassAuthState)}
1291
1291
  /**
1292
1292
  * @license
1293
1293
  * Copyright 2020 Google LLC
@@ -1303,7 +1303,7 @@ async function(t,e,i=!1){const{auth:o}=t;if(nn(o.app))return Promise.reject(qn(o
1303
1303
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1304
1304
  * See the License for the specific language governing permissions and
1305
1305
  * limitations under the License.
1306
- */class Fs{constructor(t,e,i,o,n=!1){this.auth=t,this.resolver=i,this.user=o,this.bypassAuthState=n,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(e)?e:[e]}execute(){return new Promise((async(t,e)=>{this.pendingPromise={resolve:t,reject:e};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(t){this.reject(t)}}))}async onAuthEvent(t){const{urlResponse:e,sessionId:i,postBody:o,tenantId:n,error:r,type:s}=t;if(r)return void this.reject(r);const a={auth:this.auth,requestUri:e,sessionId:i,tenantId:n||void 0,postBody:o||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(s)(a))}catch(t){this.reject(t)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return Ls;case"linkViaPopup":case"linkViaRedirect":return Ds;case"reauthViaPopup":case"reauthViaRedirect":return Rs;default:Hn(this.auth,"internal-error")}}resolve(t){Yn(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){Yn(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}
1306
+ */class Ps{constructor(t,e,i,o,n=!1){this.auth=t,this.resolver=i,this.user=o,this.bypassAuthState=n,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(e)?e:[e]}execute(){return new Promise((async(t,e)=>{this.pendingPromise={resolve:t,reject:e};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(t){this.reject(t)}}))}async onAuthEvent(t){const{urlResponse:e,sessionId:i,postBody:o,tenantId:n,error:r,type:s}=t;if(r)return void this.reject(r);const a={auth:this.auth,requestUri:e,sessionId:i,tenantId:n||void 0,postBody:o||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(s)(a))}catch(t){this.reject(t)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return Rs;case"linkViaPopup":case"linkViaRedirect":return Fs;case"reauthViaPopup":case"reauthViaRedirect":return Ds;default:Gn(this.auth,"internal-error")}}resolve(t){Qn(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){Qn(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}
1307
1307
  /**
1308
1308
  * @license
1309
1309
  * Copyright 2020 Google LLC
@@ -1319,7 +1319,7 @@ async function(t,e,i=!1){const{auth:o}=t;if(nn(o.app))return Promise.reject(qn(o
1319
1319
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1320
1320
  * See the License for the specific language governing permissions and
1321
1321
  * limitations under the License.
1322
- */const Ps=new er(2e3,1e4);class js extends Fs{constructor(t,e,i,o,n){super(t,e,o,n),this.provider=i,this.authWindow=null,this.pollId=null,js.currentPopupAction&&js.currentPopupAction.cancel(),js.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Kn(t,this.auth,"internal-error"),t}async onExecution(){Yn(1===this.filter.length,"Popup operations only handle one event");const t=ys();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch((t=>{this.reject(t)})),this.resolver._isIframeWebStorageSupported(this.auth,(t=>{t||this.reject(Gn(this.auth,"web-storage-unsupported"))})),this.pollUserCancellation()}get eventId(){var t;return(null===(t=this.authWindow)||void 0===t?void 0:t.associatedEvent)||null}cancel(){this.reject(Gn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,js.currentPopupAction=null}pollUserCancellation(){const t=()=>{var e,i;(null===(i=null===(e=this.authWindow)||void 0===e?void 0:e.window)||void 0===i?void 0:i.closed)?this.pollId=window.setTimeout((()=>{this.pollId=null,this.reject(Gn(this.auth,"popup-closed-by-user"))}),8e3):this.pollId=window.setTimeout(t,Ps.get())};t()}}js.currentPopupAction=null;
1322
+ */const js=new ir(2e3,1e4);class Vs extends Ps{constructor(t,e,i,o,n){super(t,e,o,n),this.provider=i,this.authWindow=null,this.pollId=null,Vs.currentPopupAction&&Vs.currentPopupAction.cancel(),Vs.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Jn(t,this.auth,"internal-error"),t}async onExecution(){Qn(1===this.filter.length,"Popup operations only handle one event");const t=bs();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch((t=>{this.reject(t)})),this.resolver._isIframeWebStorageSupported(this.auth,(t=>{t||this.reject(Wn(this.auth,"web-storage-unsupported"))})),this.pollUserCancellation()}get eventId(){var t;return(null===(t=this.authWindow)||void 0===t?void 0:t.associatedEvent)||null}cancel(){this.reject(Wn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Vs.currentPopupAction=null}pollUserCancellation(){const t=()=>{var e,i;(null===(i=null===(e=this.authWindow)||void 0===e?void 0:e.window)||void 0===i?void 0:i.closed)?this.pollId=window.setTimeout((()=>{this.pollId=null,this.reject(Wn(this.auth,"popup-closed-by-user"))}),8e3):this.pollId=window.setTimeout(t,js.get())};t()}}Vs.currentPopupAction=null;
1323
1323
  /**
1324
1324
  * @license
1325
1325
  * Copyright 2020 Google LLC
@@ -1336,7 +1336,7 @@ async function(t,e,i=!1){const{auth:o}=t;if(nn(o.app))return Promise.reject(qn(o
1336
1336
  * See the License for the specific language governing permissions and
1337
1337
  * limitations under the License.
1338
1338
  */
1339
- const Vs="pendingRedirect",Us=new Map;class Bs extends Fs{constructor(t,e,i=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],e,void 0,i),this.eventId=null}async execute(){let t=Us.get(this.auth._key());if(!t){try{const e=await async function(t,e){const i=function(t){return _r(Vs,t.config.apiKey,t.name)}(e),o=function(t){return Ar(t._redirectPersistence)}(t);if(!await o._isAvailable())return!1;const n="true"===await o._get(i);return await o._remove(i),n}(this.resolver,this.auth),i=e?await super.execute():null;t=()=>Promise.resolve(i)}catch(e){t=()=>Promise.reject(e)}Us.set(this.auth._key(),t)}return this.bypassAuthState||Us.set(this.auth._key(),(()=>Promise.resolve(null))),t()}async onAuthEvent(t){if("signInViaRedirect"===t.type)return super.onAuthEvent(t);if("unknown"!==t.type){if(t.eventId){const e=await this.auth._redirectUserForId(t.eventId);if(e)return this.user=e,super.onAuthEvent(t);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function zs(t,e){Us.set(t._key(),e)}async function Hs(t,e,i=!1){if(nn(t.app))return Promise.reject(qn(t));const o=qr(t),n=
1339
+ const Us="pendingRedirect",Bs=new Map;class zs extends Ps{constructor(t,e,i=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],e,void 0,i),this.eventId=null}async execute(){let t=Bs.get(this.auth._key());if(!t){try{const e=await async function(t,e){const i=function(t){return $r(Us,t.config.apiKey,t.name)}(e),o=function(t){return Tr(t._redirectPersistence)}(t);if(!await o._isAvailable())return!1;const n="true"===await o._get(i);return await o._remove(i),n}(this.resolver,this.auth),i=e?await super.execute():null;t=()=>Promise.resolve(i)}catch(e){t=()=>Promise.reject(e)}Bs.set(this.auth._key(),t)}return this.bypassAuthState||Bs.set(this.auth._key(),(()=>Promise.resolve(null))),t()}async onAuthEvent(t){if("signInViaRedirect"===t.type)return super.onAuthEvent(t);if("unknown"!==t.type){if(t.eventId){const e=await this.auth._redirectUserForId(t.eventId);if(e)return this.user=e,super.onAuthEvent(t);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function Hs(t,e){Bs.set(t._key(),e)}async function Gs(t,e,i=!1){if(rn(t.app))return Promise.reject(Zn(t));const o=Zr(t),n=
1340
1340
  /**
1341
1341
  * @license
1342
1342
  * Copyright 2021 Google LLC
@@ -1353,7 +1353,7 @@ const Vs="pendingRedirect",Us=new Map;class Bs extends Fs{constructor(t,e,i=!1){
1353
1353
  * See the License for the specific language governing permissions and
1354
1354
  * limitations under the License.
1355
1355
  */
1356
- function(t,e){return e?Ar(e):(Kn(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}(o,e),r=new Bs(o,n,i),s=await r.execute();return s&&!i&&(delete s.user._redirectEventId,await o._persistUserIfCurrent(s.user),await o._setRedirectUser(null,e)),s}
1356
+ function(t,e){return e?Tr(e):(Jn(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}(o,e),r=new zs(o,n,i),s=await r.execute();return s&&!i&&(delete s.user._redirectEventId,await o._persistUserIfCurrent(s.user),await o._setRedirectUser(null,e)),s}
1357
1357
  /**
1358
1358
  * @license
1359
1359
  * Copyright 2020 Google LLC
@@ -1369,7 +1369,7 @@ function(t,e){return e?Ar(e):(Kn(t._popupRedirectResolver,t,"argument-error"),t.
1369
1369
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1370
1370
  * See the License for the specific language governing permissions and
1371
1371
  * limitations under the License.
1372
- */class Gs{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let e=!1;return this.consumers.forEach((i=>{this.isEventForConsumer(t,i)&&(e=!0,this.sendToConsumer(t,i),this.saveEventToCache(t))})),this.hasHandledPotentialRedirect||!function(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return qs(t);default:return!1}}
1372
+ */class Ws{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let e=!1;return this.consumers.forEach((i=>{this.isEventForConsumer(t,i)&&(e=!0,this.sendToConsumer(t,i),this.saveEventToCache(t))})),this.hasHandledPotentialRedirect||!function(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Zs(t);default:return!1}}
1373
1373
  /**
1374
1374
  * @license
1375
1375
  * Copyright 2020 Google LLC
@@ -1385,7 +1385,7 @@ function(t,e){return e?Ar(e):(Kn(t._popupRedirectResolver,t,"argument-error"),t.
1385
1385
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1386
1386
  * See the License for the specific language governing permissions and
1387
1387
  * limitations under the License.
1388
- */(t)||(this.hasHandledPotentialRedirect=!0,e||(this.queuedRedirectEvent=t,e=!0)),e}sendToConsumer(t,e){var i;if(t.error&&!qs(t)){const o=(null===(i=t.error.code)||void 0===i?void 0:i.split("auth/")[1])||"internal-error";e.onError(Gn(this.auth,o))}else e.onAuthEvent(t)}isEventForConsumer(t,e){const i=null===e.eventId||!!t.eventId&&t.eventId===e.eventId;return e.filter.includes(t.type)&&i}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(Ws(t))}saveEventToCache(t){this.cachedEventUids.add(Ws(t)),this.lastProcessedEventTime=Date.now()}}function Ws(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter((t=>t)).join("-")}function qs({type:t,error:e}){return"unknown"===t&&"auth/no-auth-event"===(null==e?void 0:e.code)}
1388
+ */(t)||(this.hasHandledPotentialRedirect=!0,e||(this.queuedRedirectEvent=t,e=!0)),e}sendToConsumer(t,e){var i;if(t.error&&!Zs(t)){const o=(null===(i=t.error.code)||void 0===i?void 0:i.split("auth/")[1])||"internal-error";e.onError(Wn(this.auth,o))}else e.onAuthEvent(t)}isEventForConsumer(t,e){const i=null===e.eventId||!!t.eventId&&t.eventId===e.eventId;return e.filter.includes(t.type)&&i}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(qs(t))}saveEventToCache(t){this.cachedEventUids.add(qs(t)),this.lastProcessedEventTime=Date.now()}}function qs(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter((t=>t)).join("-")}function Zs({type:t,error:e}){return"unknown"===t&&"auth/no-auth-event"===(null==e?void 0:e.code)}
1389
1389
  /**
1390
1390
  * @license
1391
1391
  * Copyright 2020 Google LLC
@@ -1402,7 +1402,7 @@ function(t,e){return e?Ar(e):(Kn(t._popupRedirectResolver,t,"argument-error"),t.
1402
1402
  * See the License for the specific language governing permissions and
1403
1403
  * limitations under the License.
1404
1404
  */
1405
- const Zs=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Ks=/^https?/;async function Js(t){if(t.config.emulator)return;const{authorizedDomains:e}=await async function(t,e={}){return lr(t,"GET","/v1/projects",e)}(t);for(const t of e)try{if(Ys(t))return}catch(t){}Hn(t,"unauthorized-domain")}function Ys(t){const e=Qn(),{protocol:i,hostname:o}=new URL(e);if(t.startsWith("chrome-extension://")){const n=new URL(t);return""===n.hostname&&""===o?"chrome-extension:"===i&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):"chrome-extension:"===i&&n.hostname===o}if(!Ks.test(i))return!1;if(Zs.test(t))return o===t;const n=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+n+"|"+n+")$","i").test(o)}
1405
+ const Ks=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Js=/^https?/;async function Ys(t){if(t.config.emulator)return;const{authorizedDomains:e}=await async function(t,e={}){return cr(t,"GET","/v1/projects",e)}(t);for(const t of e)try{if(Qs(t))return}catch(t){}Gn(t,"unauthorized-domain")}function Qs(t){const e=Xn(),{protocol:i,hostname:o}=new URL(e);if(t.startsWith("chrome-extension://")){const n=new URL(t);return""===n.hostname&&""===o?"chrome-extension:"===i&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):"chrome-extension:"===i&&n.hostname===o}if(!Js.test(i))return!1;if(Ks.test(t))return o===t;const n=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+n+"|"+n+")$","i").test(o)}
1406
1406
  /**
1407
1407
  * @license
1408
1408
  * Copyright 2020 Google LLC.
@@ -1418,7 +1418,7 @@ const Zs=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Ks=/^https?/;async function Js(t
1418
1418
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1419
1419
  * See the License for the specific language governing permissions and
1420
1420
  * limitations under the License.
1421
- */const Qs=new er(3e4,6e4);function Xs(){const t=Cs().i;if(null==t?void 0:t.H)for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let e=0;e<t.CP.length;e++)t.CP[e]=null}function ta(t){return new Promise(((e,i)=>{var o,n,r,s;function a(){Xs(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Xs(),i(Gn(t,"network-request-failed"))},timeout:Qs.get()})}if(null===(n=null===(o=Cs().gapi)||void 0===o?void 0:o.iframes)||void 0===n?void 0:n.Iframe)e(gapi.iframes.getContext());else{if(!(null===(r=Cs().gapi)||void 0===r?void 0:r.load)){const e=`__${"iframefcb"}${Math.floor(1e6*Math.random())}`;return Cs()[e]=()=>{gapi.load?a():i(Gn(t,"network-request-failed"))},(s=`${Kr.gapiScript}?onload=${e}`,Kr.loadJS(s)).catch((t=>i(t)))}a()}})).catch((t=>{throw ea=null,t}))}let ea=null;
1421
+ */const Xs=new ir(3e4,6e4);function ta(){const t=xs().i;if(null==t?void 0:t.H)for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let e=0;e<t.CP.length;e++)t.CP[e]=null}function ea(t){return new Promise(((e,i)=>{var o,n,r,s;function a(){ta(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{ta(),i(Wn(t,"network-request-failed"))},timeout:Xs.get()})}if(null===(n=null===(o=xs().gapi)||void 0===o?void 0:o.iframes)||void 0===n?void 0:n.Iframe)e(gapi.iframes.getContext());else{if(!(null===(r=xs().gapi)||void 0===r?void 0:r.load)){const e=`__${"iframefcb"}${Math.floor(1e6*Math.random())}`;return xs()[e]=()=>{gapi.load?a():i(Wn(t,"network-request-failed"))},(s=`${Jr.gapiScript}?onload=${e}`,Jr.loadJS(s)).catch((t=>i(t)))}a()}})).catch((t=>{throw ia=null,t}))}let ia=null;
1422
1422
  /**
1423
1423
  * @license
1424
1424
  * Copyright 2020 Google LLC.
@@ -1435,7 +1435,7 @@ const Zs=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Ks=/^https?/;async function Js(t
1435
1435
  * See the License for the specific language governing permissions and
1436
1436
  * limitations under the License.
1437
1437
  */
1438
- const ia=new er(5e3,15e3),oa={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},na=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function ra(t){const e=t.config;Kn(e.authDomain,t,"auth-domain-config-required");const i=e.emulator?ir(e,"emulator/auth/iframe"):`https://${t.config.authDomain}/__/auth/iframe`,o={apiKey:e.apiKey,appName:t.name,v:an},n=na.get(t.config.apiHost);n&&(o.eid=n);const r=t._getFrameworks();return r.length&&(o.fw=r.join(",")),`${i}?${Bi(o).slice(1)}`}async function sa(t){const e=await function(t){return ea=ea||ta(t),ea}(t),i=Cs().gapi;return Kn(i,t,"internal-error"),e.open({where:document.body,url:ra(t),messageHandlersFilter:i.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:oa,dontclear:!0},(e=>new Promise((async(i,o)=>{await e.restyle({setHideOnLeave:!1});const n=Gn(t,"network-request-failed"),r=Cs().setTimeout((()=>{o(n)}),ia.get());function s(){Cs().clearTimeout(r),i(e)}e.ping(s).then(s,(()=>{o(n)}))}))))}
1438
+ const oa=new ir(5e3,15e3),na={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},ra=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function sa(t){const e=t.config;Jn(e.authDomain,t,"auth-domain-config-required");const i=e.emulator?or(e,"emulator/auth/iframe"):`https://${t.config.authDomain}/__/auth/iframe`,o={apiKey:e.apiKey,appName:t.name,v:ln},n=ra.get(t.config.apiHost);n&&(o.eid=n);const r=t._getFrameworks();return r.length&&(o.fw=r.join(",")),`${i}?${zi(o).slice(1)}`}async function aa(t){const e=await function(t){return ia=ia||ea(t),ia}(t),i=xs().gapi;return Jn(i,t,"internal-error"),e.open({where:document.body,url:sa(t),messageHandlersFilter:i.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:na,dontclear:!0},(e=>new Promise((async(i,o)=>{await e.restyle({setHideOnLeave:!1});const n=Wn(t,"network-request-failed"),r=xs().setTimeout((()=>{o(n)}),oa.get());function s(){xs().clearTimeout(r),i(e)}e.ping(s).then(s,(()=>{o(n)}))}))))}
1439
1439
  /**
1440
1440
  * @license
1441
1441
  * Copyright 2020 Google LLC.
@@ -1451,7 +1451,7 @@ const ia=new er(5e3,15e3),oa={style:{position:"absolute",top:"-100px",width:"1px
1451
1451
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1452
1452
  * See the License for the specific language governing permissions and
1453
1453
  * limitations under the License.
1454
- */const aa={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class la{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(t){}}}function ca(t,e,i,o=500,n=600){const r=Math.max((window.screen.availHeight-n)/2,0).toString(),s=Math.max((window.screen.availWidth-o)/2,0).toString();let a="";const l=Object.assign(Object.assign({},aa),{width:o.toString(),height:n.toString(),top:r,left:s}),c=Di().toLowerCase();i&&(a=Rr(c)?"_blank":i),Or(c)&&(e=e||"http://localhost",l.scrollbars="yes");const d=Object.entries(l).reduce(((t,[e,i])=>`${t}${e}=${i},`),"");if(function(t=Di()){var e;return Vr(t)&&!!(null===(e=window.navigator)||void 0===e?void 0:e.standalone)}(c)&&"_self"!==a)return function(t,e){const i=document.createElement("a");i.href=t,i.target=e;const o=document.createEvent("MouseEvent");o.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),i.dispatchEvent(o)}
1454
+ */const la={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class ca{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(t){}}}function da(t,e,i,o=500,n=600){const r=Math.max((window.screen.availHeight-n)/2,0).toString(),s=Math.max((window.screen.availWidth-o)/2,0).toString();let a="";const l=Object.assign(Object.assign({},la),{width:o.toString(),height:n.toString(),top:r,left:s}),c=Fi().toLowerCase();i&&(a=Dr(c)?"_blank":i),Lr(c)&&(e=e||"http://localhost",l.scrollbars="yes");const d=Object.entries(l).reduce(((t,[e,i])=>`${t}${e}=${i},`),"");if(function(t=Fi()){var e;return Ur(t)&&!!(null===(e=window.navigator)||void 0===e?void 0:e.standalone)}(c)&&"_self"!==a)return function(t,e){const i=document.createElement("a");i.href=t,i.target=e;const o=document.createEvent("MouseEvent");o.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),i.dispatchEvent(o)}
1455
1455
  /**
1456
1456
  * @license
1457
1457
  * Copyright 2021 Google LLC
@@ -1467,7 +1467,7 @@ const ia=new er(5e3,15e3),oa={style:{position:"absolute",top:"-100px",width:"1px
1467
1467
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1468
1468
  * See the License for the specific language governing permissions and
1469
1469
  * limitations under the License.
1470
- */(e||"",a),new la(null);const h=window.open(e||"",a,d);Kn(h,t,"popup-blocked");try{h.focus()}catch(t){}return new la(h)}const da="__/auth/handler",ha="emulator/auth/handler",ua=encodeURIComponent("fac");async function pa(t,e,i,o,n,r){Kn(t.config.authDomain,t,"auth-domain-config-required"),Kn(t.config.apiKey,t,"invalid-api-key");const s={apiKey:t.config.apiKey,appName:t.name,authType:i,redirectUrl:o,v:an,eventId:n};if(e instanceof is){e.setDefaultLanguage(t.languageCode),s.providerId=e.providerId||"",function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}(e.getCustomParameters())||(s.customParameters=JSON.stringify(e.getCustomParameters()));for(const[t,e]of Object.entries({}))s[t]=e}if(e instanceof os){const t=e.getScopes().filter((t=>""!==t));t.length>0&&(s.scopes=t.join(","))}t.tenantId&&(s.tid=t.tenantId);const a=s;for(const t of Object.keys(a))void 0===a[t]&&delete a[t];const l=await t._getAppCheckToken(),c=l?`#${ua}=${encodeURIComponent(l)}`:"";return`${function({config:t}){if(!t.emulator)return`https://${t.authDomain}/${da}`;return ir(t,ha)}
1470
+ */(e||"",a),new ca(null);const h=window.open(e||"",a,d);Jn(h,t,"popup-blocked");try{h.focus()}catch(t){}return new ca(h)}const ha="__/auth/handler",ua="emulator/auth/handler",pa=encodeURIComponent("fac");async function va(t,e,i,o,n,r){Jn(t.config.authDomain,t,"auth-domain-config-required"),Jn(t.config.apiKey,t,"invalid-api-key");const s={apiKey:t.config.apiKey,appName:t.name,authType:i,redirectUrl:o,v:ln,eventId:n};if(e instanceof os){e.setDefaultLanguage(t.languageCode),s.providerId=e.providerId||"",function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}(e.getCustomParameters())||(s.customParameters=JSON.stringify(e.getCustomParameters()));for(const[t,e]of Object.entries({}))s[t]=e}if(e instanceof ns){const t=e.getScopes().filter((t=>""!==t));t.length>0&&(s.scopes=t.join(","))}t.tenantId&&(s.tid=t.tenantId);const a=s;for(const t of Object.keys(a))void 0===a[t]&&delete a[t];const l=await t._getAppCheckToken(),c=l?`#${pa}=${encodeURIComponent(l)}`:"";return`${function({config:t}){if(!t.emulator)return`https://${t.authDomain}/${ha}`;return or(t,ua)}
1471
1471
  /**
1472
1472
  * @license
1473
1473
  * Copyright 2020 Google LLC
@@ -1483,7 +1483,7 @@ const ia=new er(5e3,15e3),oa={style:{position:"absolute",top:"-100px",width:"1px
1483
1483
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1484
1484
  * See the License for the specific language governing permissions and
1485
1485
  * limitations under the License.
1486
- */(t)}?${Bi(a).slice(1)}${c}`}const va="webStorageSupport";const ga=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ms,this._completeRedirectFn=Hs,this._overrideRedirectResult=zs}async _openPopup(t,e,i,o){var n;Yn(null===(n=this.eventManagers[t._key()])||void 0===n?void 0:n.manager,"_initialize() not called before _openPopup()");return ca(t,await pa(t,e,i,Qn(),o),ys())}async _openRedirect(t,e,i,o){await this._originValidation(t);return function(t){Cs().location.href=t}(await pa(t,e,i,Qn(),o)),new Promise((()=>{}))}_initialize(t){const e=t._key();if(this.eventManagers[e]){const{manager:t,promise:i}=this.eventManagers[e];return t?Promise.resolve(t):(Yn(i,"If manager is not set, promise should be"),i)}const i=this.initAndGetManager(t);return this.eventManagers[e]={promise:i},i.catch((()=>{delete this.eventManagers[e]})),i}async initAndGetManager(t){const e=await sa(t),i=new Gs(t);return e.register("authEvent",(e=>{Kn(null==e?void 0:e.authEvent,t,"invalid-auth-event");return{status:i.onEvent(e.authEvent)?"ACK":"ERROR"}}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:i},this.iframes[t._key()]=e,i}_isIframeWebStorageSupported(t,e){this.iframes[t._key()].send(va,{type:va},(i=>{var o;const n=null===(o=null==i?void 0:i[0])||void 0===o?void 0:o[va];void 0!==n&&e(!!n),Hn(t,"internal-error")}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const e=t._key();return this.originValidationPromises[e]||(this.originValidationPromises[e]=Js(t)),this.originValidationPromises[e]}get _shouldInitProactively(){return Br()||Lr()||Vr()}};var fa="@firebase/auth",ma="1.10.0";
1486
+ */(t)}?${zi(a).slice(1)}${c}`}const ga="webStorageSupport";const fa=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ws,this._completeRedirectFn=Gs,this._overrideRedirectResult=Hs}async _openPopup(t,e,i,o){var n;Qn(null===(n=this.eventManagers[t._key()])||void 0===n?void 0:n.manager,"_initialize() not called before _openPopup()");return da(t,await va(t,e,i,Xn(),o),bs())}async _openRedirect(t,e,i,o){await this._originValidation(t);return function(t){xs().location.href=t}(await va(t,e,i,Xn(),o)),new Promise((()=>{}))}_initialize(t){const e=t._key();if(this.eventManagers[e]){const{manager:t,promise:i}=this.eventManagers[e];return t?Promise.resolve(t):(Qn(i,"If manager is not set, promise should be"),i)}const i=this.initAndGetManager(t);return this.eventManagers[e]={promise:i},i.catch((()=>{delete this.eventManagers[e]})),i}async initAndGetManager(t){const e=await aa(t),i=new Ws(t);return e.register("authEvent",(e=>{Jn(null==e?void 0:e.authEvent,t,"invalid-auth-event");return{status:i.onEvent(e.authEvent)?"ACK":"ERROR"}}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:i},this.iframes[t._key()]=e,i}_isIframeWebStorageSupported(t,e){this.iframes[t._key()].send(ga,{type:ga},(i=>{var o;const n=null===(o=null==i?void 0:i[0])||void 0===o?void 0:o[ga];void 0!==n&&e(!!n),Gn(t,"internal-error")}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const e=t._key();return this.originValidationPromises[e]||(this.originValidationPromises[e]=Ys(t)),this.originValidationPromises[e]}get _shouldInitProactively(){return zr()||Rr()||Ur()}};var ma="@firebase/auth",wa="1.10.0";
1487
1487
  /**
1488
1488
  * @license
1489
1489
  * Copyright 2020 Google LLC
@@ -1500,7 +1500,7 @@ const ia=new er(5e3,15e3),oa={style:{position:"absolute",top:"-100px",width:"1px
1500
1500
  * See the License for the specific language governing permissions and
1501
1501
  * limitations under the License.
1502
1502
  */
1503
- class wa{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var t;return this.assertAuthConfigured(),(null===(t=this.auth.currentUser)||void 0===t?void 0:t.uid)||null}async getToken(t){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(t)}}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const e=this.auth.onIdTokenChanged((e=>{t((null==e?void 0:e.stsTokenManager.accessToken)||null)}));this.internalListeners.set(t,e),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const e=this.internalListeners.get(t);e&&(this.internalListeners.delete(t),e(),this.updateProactiveRefresh())}assertAuthConfigured(){Kn(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}
1503
+ class ya{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var t;return this.assertAuthConfigured(),(null===(t=this.auth.currentUser)||void 0===t?void 0:t.uid)||null}async getToken(t){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(t)}}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const e=this.auth.onIdTokenChanged((e=>{t((null==e?void 0:e.stsTokenManager.accessToken)||null)}));this.internalListeners.set(t,e),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const e=this.internalListeners.get(t);e&&(this.internalListeners.delete(t),e(),this.updateProactiveRefresh())}assertAuthConfigured(){Jn(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}
1504
1504
  /**
1505
1505
  * @license
1506
1506
  * Copyright 2020 Google LLC
@@ -1533,7 +1533,7 @@ class wa{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var
1533
1533
  * See the License for the specific language governing permissions and
1534
1534
  * limitations under the License.
1535
1535
  */
1536
- const ya=Li("authIdTokenMaxAge")||300;let ba=null;function Ca(t=cn()){const e=on(t,"auth");if(e.isInitialized())return e.getImmediate();const i=
1536
+ const ba=Ri("authIdTokenMaxAge")||300;let Ca=null;function xa(t=dn()){const e=nn(t,"auth");if(e.isInitialized())return e.getImmediate();const i=
1537
1537
  /**
1538
1538
  * @license
1539
1539
  * Copyright 2020 Google LLC
@@ -1550,15 +1550,15 @@ const ya=Li("authIdTokenMaxAge")||300;let ba=null;function Ca(t=cn()){const e=on
1550
1550
  * See the License for the specific language governing permissions and
1551
1551
  * limitations under the License.
1552
1552
  */
1553
- function(t,e){const i=on(t,"auth");if(i.isInitialized()){const t=i.getImmediate();if(Vi(i.getOptions(),null!=e?e:{}))return t;Hn(t,"already-initialized")}return i.initialize({options:e})}(t,{popupRedirectResolver:ga,persistence:[Ns,gs,ms]}),o=Li("authTokenSyncURL");if(o&&"boolean"==typeof isSecureContext&&isSecureContext){const t=new URL(o,location.origin);if(location.origin===t.origin){const e=(n=t.toString(),async t=>{const e=t&&await t.getIdTokenResult(),i=e&&((new Date).getTime()-Date.parse(e.issuedAtTime))/1e3;if(i&&i>ya)return;const o=null==e?void 0:e.token;ba!==o&&(ba=o,await fetch(n,{method:o?"POST":"DELETE",headers:o?{Authorization:`Bearer ${o}`}:{}}))});!function(t,e,i){Gi(t).beforeAuthStateChanged(e,i)}(i,e,(()=>e(i.currentUser))),function(t,e,i,o){Gi(t).onIdTokenChanged(e,i,o)}(i,(t=>e(t)))}}var n;const r=Ni("auth");return r&&Jr(i,`http://${r}`),i}var xa;function Ea(...t){(function(){try{return"undefined"!=typeof localStorage&&"true"===localStorage.getItem("sfIdentityDebug")}catch{return!1}})()&&console.log(...t)}!function(t){Kr=t}({loadJS:t=>new Promise(((e,i)=>{const o=document.createElement("script");var n,r;o.setAttribute("src",t),o.onload=e,o.onerror=t=>{const e=Gn("internal-error");e.customData=t,i(e)},o.type="text/javascript",o.charset="UTF-8",(null!==(r=null===(n=document.getElementsByTagName("head"))||void 0===n?void 0:n[0])&&void 0!==r?r:document).appendChild(o)})),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="}),xa="Browser",en(new Wi("auth",((t,{options:e})=>{const i=t.getProvider("app").getImmediate(),o=t.getProvider("heartbeat"),n=t.getProvider("app-check-internal"),{apiKey:r,authDomain:s}=i.options;Kn(r&&!r.includes(":"),"invalid-api-key",{appName:i.name});const a={apiKey:r,authDomain:s,clientPlatform:xa,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:zr(xa)},l=new Wr(i,o,n,a);return function(t,e){const i=(null==e?void 0:e.persistence)||[],o=(Array.isArray(i)?i:[i]).map(Ar);(null==e?void 0:e.errorMap)&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(o,null==e?void 0:e.popupRedirectResolver)}(l,e),l}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback(((t,e,i)=>{t.getProvider("auth-internal").initialize()}))),en(new Wi("auth-internal",(t=>(t=>new wa(t))(qr(t.getProvider("auth").getImmediate()))),"PRIVATE").setInstantiationMode("EXPLICIT")),dn(fa,ma,function(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(xa)),dn(fa,ma,"esm2017");const ka=("undefined"!=typeof globalThis?globalThis:void 0)?.crypto||("undefined"!=typeof global?global:void 0)?.crypto||("undefined"!=typeof window?window:void 0)?.crypto||("undefined"!=typeof self?self:void 0)?.crypto||("undefined"!=typeof frames?frames:void 0)?.[0]?.crypto;let Sa;Sa=ka?t=>{const e=[];for(let i=0;i<t;i+=4)e.push(ka.getRandomValues(new Uint32Array(1))[0]);return new Aa(e,t)}:t=>{const e=[],i=t=>{let e=t,i=987654321;const o=4294967295;return()=>{i=36969*(65535&i)+(i>>16)&o,e=18e3*(65535&e)+(e>>16)&o;let t=(i<<16)+e&o;return t/=4294967296,t+=.5,t*(Math.random()>.5?1:-1)}};for(let o,n=0;n<t;n+=4){const t=i(4294967296*(o||Math.random()));o=987654071*t(),e.push(4294967296*t()|0)}return new Aa(e,t)};class Ma{static create(...t){return new this(...t)}mixIn(t){return Object.assign(this,t)}clone(){const t=new this.constructor;return Object.assign(t,this),t}}class Aa extends Ma{constructor(t=[],e=4*t.length){super();let i=t;if(i instanceof ArrayBuffer&&(i=new Uint8Array(i)),(i instanceof Int8Array||i instanceof Uint8ClampedArray||i instanceof Int16Array||i instanceof Uint16Array||i instanceof Int32Array||i instanceof Uint32Array||i instanceof Float32Array||i instanceof Float64Array)&&(i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength)),i instanceof Uint8Array){const t=i.byteLength,e=[];for(let o=0;o<t;o+=1)e[o>>>2]|=i[o]<<24-o%4*8;this.words=e,this.sigBytes=t}else this.words=t,this.sigBytes=e}static random=Sa;toString(t=Ta){return t.stringify(this)}concat(t){const e=this.words,i=t.words,o=this.sigBytes,n=t.sigBytes;if(this.clamp(),o%4)for(let t=0;t<n;t+=1){const n=i[t>>>2]>>>24-t%4*8&255;e[o+t>>>2]|=n<<24-(o+t)%4*8}else for(let t=0;t<n;t+=4)e[o+t>>>2]=i[t>>>2];return this.sigBytes+=n,this}clamp(){const{words:t,sigBytes:e}=this;t[e>>>2]&=4294967295<<32-e%4*8,t.length=Math.ceil(e/4)}clone(){const t=super.clone.call(this);return t.words=this.words.slice(0),t}}const Ta={stringify(t){const{words:e,sigBytes:i}=t,o=[];for(let t=0;t<i;t+=1){const i=e[t>>>2]>>>24-t%4*8&255;o.push((i>>>4).toString(16)),o.push((15&i).toString(16))}return o.join("")},parse(t){const e=t.length,i=[];for(let o=0;o<e;o+=2)i[o>>>3]|=parseInt(t.substr(o,2),16)<<24-o%8*4;return new Aa(i,e/2)}},Ia={stringify(t){const{words:e,sigBytes:i}=t,o=[];for(let t=0;t<i;t+=1){const i=e[t>>>2]>>>24-t%4*8&255;o.push(String.fromCharCode(i))}return o.join("")},parse(t){const e=t.length,i=[];for(let o=0;o<e;o+=1)i[o>>>2]|=(255&t.charCodeAt(o))<<24-o%4*8;return new Aa(i,e)}},_a={stringify(t){try{return decodeURIComponent(escape(Ia.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:t=>Ia.parse(unescape(encodeURIComponent(t)))};class $a extends Ma{constructor(){super(),this._minBufferSize=0}reset(){this._data=new Aa,this._nDataBytes=0}_append(t){let e=t;"string"==typeof e&&(e=_a.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(t){let e;const{_data:i,blockSize:o}=this,n=i.words,r=i.sigBytes;let s=r/(4*o);s=t?Math.ceil(s):Math.max((0|s)-this._minBufferSize,0);const a=s*o,l=Math.min(4*a,r);if(a){for(let t=0;t<a;t+=o)this._doProcessBlock(n,t);e=n.splice(0,a),i.sigBytes-=l}return new Aa(e,l)}clone(){const t=super.clone.call(this);return t._data=this._data.clone(),t}}class Na extends $a{constructor(t){super(),this.blockSize=16,this.cfg=Object.assign(new Ma,t),this.reset()}static _createHelper(t){return(e,i)=>new t(i).finalize(e)}static _createHmacHelper(t){return(e,i)=>new Oa(t,i).finalize(e)}reset(){super.reset.call(this),this._doReset()}update(t){return this._append(t),this._process(),this}finalize(t){t&&this._append(t);return this._doFinalize()}}class Oa extends Ma{constructor(t,e){super();const i=new t;this._hasher=i;let o=e;"string"==typeof o&&(o=_a.parse(o));const n=i.blockSize,r=4*n;o.sigBytes>r&&(o=i.finalize(e)),o.clamp();const s=o.clone();this._oKey=s;const a=o.clone();this._iKey=a;const l=s.words,c=a.words;for(let t=0;t<n;t+=1)l[t]^=1549556828,c[t]^=909522486;s.sigBytes=r,a.sigBytes=r,this.reset()}reset(){const t=this._hasher;t.reset(),t.update(this._iKey)}update(t){return this._hasher.update(t),this}finalize(t){const e=this._hasher,i=e.finalize(t);e.reset();return e.finalize(this._oKey.clone().concat(i))}}const La=Aa;class Ra extends Ma{constructor(t,e){super(),this.high=t,this.low=e}}class Da extends Ma{constructor(t=[],e=8*t.length){super(),this.words=t,this.sigBytes=e}toX32(){const t=this.words,e=t.length,i=[];for(let o=0;o<e;o+=1){const e=t[o];i.push(e.high),i.push(e.low)}return La.create(i,this.sigBytes)}clone(){const t=super.clone.call(this);t.words=this.words.slice(0);const{words:e}=t,i=e.length;for(let t=0;t<i;t+=1)e[t]=e[t].clone();return t}}const Fa=(t,e,i)=>{const o=[];let n=0;for(let r=0;r<e;r+=1)if(r%4){const e=i[t.charCodeAt(r-1)]<<r%4*2|i[t.charCodeAt(r)]>>>6-r%4*2;o[n>>>2]|=e<<24-n%4*8,n+=1}return Aa.create(o,n)},Pa={stringify(t){const{words:e,sigBytes:i}=t,o=this._map;t.clamp();const n=[];for(let t=0;t<i;t+=3){const r=(e[t>>>2]>>>24-t%4*8&255)<<16|(e[t+1>>>2]>>>24-(t+1)%4*8&255)<<8|e[t+2>>>2]>>>24-(t+2)%4*8&255;for(let e=0;e<4&&t+.75*e<i;e+=1)n.push(o.charAt(r>>>6*(3-e)&63))}const r=o.charAt(64);if(r)for(;n.length%4;)n.push(r);return n.join("")},parse(t){let e=t.length;const i=this._map;let o=this._reverseMap;if(!o){this._reverseMap=[],o=this._reverseMap;for(let t=0;t<i.length;t+=1)o[i.charCodeAt(t)]=t}const n=i.charAt(64);if(n){const i=t.indexOf(n);-1!==i&&(e=i)}return Fa(t,e,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},ja=[];for(let t=0;t<64;t+=1)ja[t]=4294967296*Math.abs(Math.sin(t+1))|0;const Va=(t,e,i,o,n,r,s)=>{const a=t+(e&i|~e&o)+n+s;return(a<<r|a>>>32-r)+e},Ua=(t,e,i,o,n,r,s)=>{const a=t+(e&o|i&~o)+n+s;return(a<<r|a>>>32-r)+e},Ba=(t,e,i,o,n,r,s)=>{const a=t+(e^i^o)+n+s;return(a<<r|a>>>32-r)+e},za=(t,e,i,o,n,r,s)=>{const a=t+(i^(e|~o))+n+s;return(a<<r|a>>>32-r)+e};class Ha extends Na{_doReset(){this._hash=new Aa([1732584193,4023233417,2562383102,271733878])}_doProcessBlock(t,e){const i=t;for(let o=0;o<16;o+=1){const n=e+o,r=t[n];i[n]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}const o=this._hash.words,n=i[e+0],r=i[e+1],s=i[e+2],a=i[e+3],l=i[e+4],c=i[e+5],d=i[e+6],h=i[e+7],u=i[e+8],p=i[e+9],v=i[e+10],g=i[e+11],f=i[e+12],m=i[e+13],w=i[e+14],y=i[e+15];let b=o[0],C=o[1],x=o[2],E=o[3];b=Va(b,C,x,E,n,7,ja[0]),E=Va(E,b,C,x,r,12,ja[1]),x=Va(x,E,b,C,s,17,ja[2]),C=Va(C,x,E,b,a,22,ja[3]),b=Va(b,C,x,E,l,7,ja[4]),E=Va(E,b,C,x,c,12,ja[5]),x=Va(x,E,b,C,d,17,ja[6]),C=Va(C,x,E,b,h,22,ja[7]),b=Va(b,C,x,E,u,7,ja[8]),E=Va(E,b,C,x,p,12,ja[9]),x=Va(x,E,b,C,v,17,ja[10]),C=Va(C,x,E,b,g,22,ja[11]),b=Va(b,C,x,E,f,7,ja[12]),E=Va(E,b,C,x,m,12,ja[13]),x=Va(x,E,b,C,w,17,ja[14]),C=Va(C,x,E,b,y,22,ja[15]),b=Ua(b,C,x,E,r,5,ja[16]),E=Ua(E,b,C,x,d,9,ja[17]),x=Ua(x,E,b,C,g,14,ja[18]),C=Ua(C,x,E,b,n,20,ja[19]),b=Ua(b,C,x,E,c,5,ja[20]),E=Ua(E,b,C,x,v,9,ja[21]),x=Ua(x,E,b,C,y,14,ja[22]),C=Ua(C,x,E,b,l,20,ja[23]),b=Ua(b,C,x,E,p,5,ja[24]),E=Ua(E,b,C,x,w,9,ja[25]),x=Ua(x,E,b,C,a,14,ja[26]),C=Ua(C,x,E,b,u,20,ja[27]),b=Ua(b,C,x,E,m,5,ja[28]),E=Ua(E,b,C,x,s,9,ja[29]),x=Ua(x,E,b,C,h,14,ja[30]),C=Ua(C,x,E,b,f,20,ja[31]),b=Ba(b,C,x,E,c,4,ja[32]),E=Ba(E,b,C,x,u,11,ja[33]),x=Ba(x,E,b,C,g,16,ja[34]),C=Ba(C,x,E,b,w,23,ja[35]),b=Ba(b,C,x,E,r,4,ja[36]),E=Ba(E,b,C,x,l,11,ja[37]),x=Ba(x,E,b,C,h,16,ja[38]),C=Ba(C,x,E,b,v,23,ja[39]),b=Ba(b,C,x,E,m,4,ja[40]),E=Ba(E,b,C,x,n,11,ja[41]),x=Ba(x,E,b,C,a,16,ja[42]),C=Ba(C,x,E,b,d,23,ja[43]),b=Ba(b,C,x,E,p,4,ja[44]),E=Ba(E,b,C,x,f,11,ja[45]),x=Ba(x,E,b,C,y,16,ja[46]),C=Ba(C,x,E,b,s,23,ja[47]),b=za(b,C,x,E,n,6,ja[48]),E=za(E,b,C,x,h,10,ja[49]),x=za(x,E,b,C,w,15,ja[50]),C=za(C,x,E,b,c,21,ja[51]),b=za(b,C,x,E,f,6,ja[52]),E=za(E,b,C,x,a,10,ja[53]),x=za(x,E,b,C,v,15,ja[54]),C=za(C,x,E,b,r,21,ja[55]),b=za(b,C,x,E,u,6,ja[56]),E=za(E,b,C,x,y,10,ja[57]),x=za(x,E,b,C,d,15,ja[58]),C=za(C,x,E,b,m,21,ja[59]),b=za(b,C,x,E,l,6,ja[60]),E=za(E,b,C,x,g,10,ja[61]),x=za(x,E,b,C,s,15,ja[62]),C=za(C,x,E,b,p,21,ja[63]),o[0]=o[0]+b|0,o[1]=o[1]+C|0,o[2]=o[2]+x|0,o[3]=o[3]+E|0}_doFinalize(){const t=this._data,e=t.words,i=8*this._nDataBytes,o=8*t.sigBytes;e[o>>>5]|=128<<24-o%32;const n=Math.floor(i/4294967296),r=i;e[15+(o+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e[14+(o+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();const s=this._hash,a=s.words;for(let t=0;t<4;t+=1){const e=a[t];a[t]=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8)}return s}clone(){const t=super.clone.call(this);return t._hash=this._hash.clone(),t}}const Ga=Na._createHelper(Ha),Wa=Na._createHmacHelper(Ha);class qa extends Ma{constructor(t){super(),this.cfg=Object.assign(new Ma,{keySize:4,hasher:Ha,iterations:1},t)}compute(t,e){let i;const{cfg:o}=this,n=o.hasher.create(),r=Aa.create(),s=r.words,{keySize:a,iterations:l}=o;for(;s.length<a;){i&&n.update(i),i=n.update(t).finalize(e),n.reset();for(let t=1;t<l;t+=1)i=n.finalize(i),n.reset();r.concat(i)}return r.sigBytes=4*a,r}}class Za extends $a{constructor(t,e,i){super(),this.cfg=Object.assign(new Ma,i),this._xformMode=t,this._key=e,this.reset()}static createEncryptor(t,e){return this.create(this._ENC_XFORM_MODE,t,e)}static createDecryptor(t,e){return this.create(this._DEC_XFORM_MODE,t,e)}static _createHelper(t){const e=t=>"string"==typeof t?rl:ol;return{encrypt:(i,o,n)=>e(o).encrypt(t,i,o,n),decrypt:(i,o,n)=>e(o).decrypt(t,i,o,n)}}reset(){super.reset.call(this),this._doReset()}process(t){return this._append(t),this._process()}finalize(t){t&&this._append(t);return this._doFinalize()}}Za._ENC_XFORM_MODE=1,Za._DEC_XFORM_MODE=2,Za.keySize=4,Za.ivSize=4;class Ka extends Za{constructor(...t){super(...t),this.blockSize=1}_doFinalize(){return this._process(!0)}}class Ja extends Ma{constructor(t,e){super(),this._cipher=t,this._iv=e}static createEncryptor(t,e){return this.Encryptor.create(t,e)}static createDecryptor(t,e){return this.Decryptor.create(t,e)}}function Ya(t,e,i){const o=t;let n;const r=this._iv;r?(n=r,this._iv=void 0):n=this._prevBlock;for(let t=0;t<i;t+=1)o[e+t]^=n[t]}class Qa extends Ja{}Qa.Encryptor=class extends Qa{processBlock(t,e){const i=this._cipher,{blockSize:o}=i;Ya.call(this,t,e,o),i.encryptBlock(t,e),this._prevBlock=t.slice(e,e+o)}},Qa.Decryptor=class extends Qa{processBlock(t,e){const i=this._cipher,{blockSize:o}=i,n=t.slice(e,e+o);i.decryptBlock(t,e),Ya.call(this,t,e,o),this._prevBlock=n}};const Xa={pad(t,e){const i=4*e,o=i-t.sigBytes%i,n=o<<24|o<<16|o<<8|o,r=[];for(let t=0;t<o;t+=4)r.push(n);const s=Aa.create(r,o);t.concat(s)},unpad(t){const e=t,i=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=i}};class tl extends Za{constructor(t,e,i){super(t,e,Object.assign({mode:Qa,padding:Xa},i)),this.blockSize=4}reset(){let t;super.reset.call(this);const{cfg:e}=this,{iv:i,mode:o}=e;this._xformMode===this.constructor._ENC_XFORM_MODE?t=o.createEncryptor:(t=o.createDecryptor,this._minBufferSize=1),this._mode=t.call(o,this,i&&i.words),this._mode.u=t}_doProcessBlock(t,e){this._mode.processBlock(t,e)}_doFinalize(){let t;const{padding:e}=this.cfg;return this._xformMode===this.constructor._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t}}class el extends Ma{constructor(t){super(),this.mixIn(t)}toString(t){return(t||this.formatter).stringify(this)}}const il={stringify(t){let e;const{ciphertext:i,salt:o}=t;return e=o?Aa.create([1398893684,1701076831]).concat(o).concat(i):i,e.toString(Pa)},parse(t){let e;const i=Pa.parse(t),o=i.words;return 1398893684===o[0]&&1701076831===o[1]&&(e=Aa.create(o.slice(2,4)),o.splice(0,4),i.sigBytes-=16),el.create({ciphertext:i,salt:e})}};class ol extends Ma{static encrypt(t,e,i,o){const n=Object.assign(new Ma,this.cfg,o),r=t.createEncryptor(i,n),s=r.finalize(e),a=r.cfg;return el.create({ciphertext:s,key:i,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:r.blockSize,formatter:n.format})}static decrypt(t,e,i,o){let n=e;const r=Object.assign(new Ma,this.cfg,o);n=this._parse(n,r.format);return t.createDecryptor(i,r).finalize(n.ciphertext)}static _parse(t,e){return"string"==typeof t?e.parse(t,this):t}}ol.cfg=Object.assign(new Ma,{format:il});const nl={execute(t,e,i,o,n){let r,s=o;s||(s=Aa.random(8)),r=n?qa.create({keySize:e+i,hasher:n}).compute(t,s):qa.create({keySize:e+i}).compute(t,s);const a=Aa.create(r.words.slice(e),4*i);return r.sigBytes=4*e,el.create({key:r,iv:a,salt:s})}};class rl extends ol{static encrypt(t,e,i,o){const n=Object.assign(new Ma,this.cfg,o),r=n.kdf.execute(i,t.keySize,t.ivSize,n.salt,n.hasher);n.iv=r.iv;const s=ol.encrypt.call(this,t,e,r.key,n);return s.mixIn(r),s}static decrypt(t,e,i,o){let n=e;const r=Object.assign(new Ma,this.cfg,o);n=this._parse(n,r.format);const s=r.kdf.execute(i,t.keySize,t.ivSize,n.salt,r.hasher);r.iv=s.iv;return ol.decrypt.call(this,t,n,s.key,r)}}rl.cfg=Object.assign(ol.cfg,{kdf:nl});const sl=t=>t<<8&4278255360|t>>>8&16711935,al={stringify(t){const{words:e,sigBytes:i}=t,o=[];for(let t=0;t<i;t+=2){const i=e[t>>>2]>>>16-t%4*8&65535;o.push(String.fromCharCode(i))}return o.join("")},parse(t){const e=t.length,i=[];for(let o=0;o<e;o+=1)i[o>>>1]|=t.charCodeAt(o)<<16-o%2*16;return Aa.create(i,2*e)}},ll=al,cl={stringify(t){const{words:e,sigBytes:i}=t,o=[];for(let t=0;t<i;t+=2){const i=sl(e[t>>>2]>>>16-t%4*8&65535);o.push(String.fromCharCode(i))}return o.join("")},parse(t){const e=t.length,i=[];for(let o=0;o<e;o+=1)i[o>>>1]|=sl(t.charCodeAt(o)<<16-o%2*16);return Aa.create(i,2*e)}},dl={stringify(t,e=!0){const{words:i,sigBytes:o}=t,n=e?this._safeMap:this._map;t.clamp();const r=[];for(let t=0;t<o;t+=3){const e=(i[t>>>2]>>>24-t%4*8&255)<<16|(i[t+1>>>2]>>>24-(t+1)%4*8&255)<<8|i[t+2>>>2]>>>24-(t+2)%4*8&255;for(let i=0;i<4&&t+.75*i<o;i+=1)r.push(n.charAt(e>>>6*(3-i)&63))}const s=n.charAt(64);if(s)for(;r.length%4;)r.push(s);return r.join("")},parse(t,e=!0){let i=t.length;const o=e?this._safeMap:this._map;let n=this._reverseMap;if(!n){this._reverseMap=[],n=this._reverseMap;for(let t=0;t<o.length;t+=1)n[o.charCodeAt(t)]=t}const r=o.charAt(64);if(r){const e=t.indexOf(r);-1!==e&&(i=e)}return Fa(t,i,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safeMap:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},hl=[];class ul extends Na{_doReset(){this._hash=new Aa([1732584193,4023233417,2562383102,271733878,3285377520])}_doProcessBlock(t,e){const i=this._hash.words;let o=i[0],n=i[1],r=i[2],s=i[3],a=i[4];for(let i=0;i<80;i+=1){if(i<16)hl[i]=0|t[e+i];else{const t=hl[i-3]^hl[i-8]^hl[i-14]^hl[i-16];hl[i]=t<<1|t>>>31}let l=(o<<5|o>>>27)+a+hl[i];l+=i<20?1518500249+(n&r|~n&s):i<40?1859775393+(n^r^s):i<60?(n&r|n&s|r&s)-1894007588:(n^r^s)-899497514,a=s,s=r,r=n<<30|n>>>2,n=o,o=l}i[0]=i[0]+o|0,i[1]=i[1]+n|0,i[2]=i[2]+r|0,i[3]=i[3]+s|0,i[4]=i[4]+a|0}_doFinalize(){const t=this._data,e=t.words,i=8*this._nDataBytes,o=8*t.sigBytes;return e[o>>>5]|=128<<24-o%32,e[14+(o+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(o+64>>>9<<4)]=i,t.sigBytes=4*e.length,this._process(),this._hash}clone(){const t=super.clone.call(this);return t._hash=this._hash.clone(),t}}const pl=Na._createHelper(ul),vl=Na._createHmacHelper(ul),gl=[],fl=[],ml=t=>{const e=Math.sqrt(t);for(let i=2;i<=e;i+=1)if(!(t%i))return!1;return!0},wl=t=>4294967296*(t-(0|t))|0;let yl=2,bl=0;for(;bl<64;)ml(yl)&&(bl<8&&(gl[bl]=wl(yl**.5)),fl[bl]=wl(yl**(1/3)),bl+=1),yl+=1;const Cl=[];class xl extends Na{_doReset(){this._hash=new Aa(gl.slice(0))}_doProcessBlock(t,e){const i=this._hash.words;let o=i[0],n=i[1],r=i[2],s=i[3],a=i[4],l=i[5],c=i[6],d=i[7];for(let i=0;i<64;i+=1){if(i<16)Cl[i]=0|t[e+i];else{const t=Cl[i-15],e=(t<<25|t>>>7)^(t<<14|t>>>18)^t>>>3,o=Cl[i-2],n=(o<<15|o>>>17)^(o<<13|o>>>19)^o>>>10;Cl[i]=e+Cl[i-7]+n+Cl[i-16]}const h=o&n^o&r^n&r,u=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),p=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&c)+fl[i]+Cl[i];d=c,c=l,l=a,a=s+p|0,s=r,r=n,n=o,o=p+(u+h)|0}i[0]=i[0]+o|0,i[1]=i[1]+n|0,i[2]=i[2]+r|0,i[3]=i[3]+s|0,i[4]=i[4]+a|0,i[5]=i[5]+l|0,i[6]=i[6]+c|0,i[7]=i[7]+d|0}_doFinalize(){const t=this._data,e=t.words,i=8*this._nDataBytes,o=8*t.sigBytes;return e[o>>>5]|=128<<24-o%32,e[14+(o+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(o+64>>>9<<4)]=i,t.sigBytes=4*e.length,this._process(),this._hash}clone(){const t=super.clone.call(this);return t._hash=this._hash.clone(),t}}const El=Na._createHelper(xl),kl=Na._createHmacHelper(xl);class Sl extends xl{_doReset(){this._hash=new Aa([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])}_doFinalize(){const t=super._doFinalize.call(this);return t.sigBytes-=4,t}}const Ml=xl._createHelper(Sl),Al=xl._createHmacHelper(Sl),Tl=[new Ra(1116352408,3609767458),new Ra(1899447441,602891725),new Ra(3049323471,3964484399),new Ra(3921009573,2173295548),new Ra(961987163,4081628472),new Ra(1508970993,3053834265),new Ra(2453635748,2937671579),new Ra(2870763221,3664609560),new Ra(3624381080,2734883394),new Ra(310598401,1164996542),new Ra(607225278,1323610764),new Ra(1426881987,3590304994),new Ra(1925078388,4068182383),new Ra(2162078206,991336113),new Ra(2614888103,633803317),new Ra(3248222580,3479774868),new Ra(3835390401,2666613458),new Ra(4022224774,944711139),new Ra(264347078,2341262773),new Ra(604807628,2007800933),new Ra(770255983,1495990901),new Ra(1249150122,1856431235),new Ra(1555081692,3175218132),new Ra(1996064986,2198950837),new Ra(2554220882,3999719339),new Ra(2821834349,766784016),new Ra(2952996808,2566594879),new Ra(3210313671,3203337956),new Ra(3336571891,1034457026),new Ra(3584528711,2466948901),new Ra(113926993,3758326383),new Ra(338241895,168717936),new Ra(666307205,1188179964),new Ra(773529912,1546045734),new Ra(1294757372,1522805485),new Ra(1396182291,2643833823),new Ra(1695183700,2343527390),new Ra(1986661051,1014477480),new Ra(2177026350,1206759142),new Ra(2456956037,344077627),new Ra(2730485921,1290863460),new Ra(2820302411,3158454273),new Ra(3259730800,3505952657),new Ra(3345764771,106217008),new Ra(3516065817,3606008344),new Ra(3600352804,1432725776),new Ra(4094571909,1467031594),new Ra(275423344,851169720),new Ra(430227734,3100823752),new Ra(506948616,1363258195),new Ra(659060556,3750685593),new Ra(883997877,3785050280),new Ra(958139571,3318307427),new Ra(1322822218,3812723403),new Ra(1537002063,2003034995),new Ra(1747873779,3602036899),new Ra(1955562222,1575990012),new Ra(2024104815,1125592928),new Ra(2227730452,2716904306),new Ra(2361852424,442776044),new Ra(2428436474,593698344),new Ra(2756734187,3733110249),new Ra(3204031479,2999351573),new Ra(3329325298,3815920427),new Ra(3391569614,3928383900),new Ra(3515267271,566280711),new Ra(3940187606,3454069534),new Ra(4118630271,4000239992),new Ra(116418474,1914138554),new Ra(174292421,2731055270),new Ra(289380356,3203993006),new Ra(460393269,320620315),new Ra(685471733,587496836),new Ra(852142971,1086792851),new Ra(1017036298,365543100),new Ra(1126000580,2618297676),new Ra(1288033470,3409855158),new Ra(1501505948,4234509866),new Ra(1607167915,987167468),new Ra(1816402316,1246189591)],Il=[];for(let t=0;t<80;t+=1)Il[t]=new Ra;class _l extends Na{constructor(){super(),this.blockSize=32}_doReset(){this._hash=new Da([new Ra(1779033703,4089235720),new Ra(3144134277,2227873595),new Ra(1013904242,4271175723),new Ra(2773480762,1595750129),new Ra(1359893119,2917565137),new Ra(2600822924,725511199),new Ra(528734635,4215389547),new Ra(1541459225,327033209)])}_doProcessBlock(t,e){const i=this._hash.words,o=i[0],n=i[1],r=i[2],s=i[3],a=i[4],l=i[5],c=i[6],d=i[7],h=o.high;let u=o.low;const p=n.high;let v=n.low;const g=r.high;let f=r.low;const m=s.high;let w=s.low;const y=a.high;let b=a.low;const C=l.high;let x=l.low;const E=c.high;let k=c.low;const S=d.high;let M=d.low,A=h,T=u,I=p,_=v,$=g,N=f,O=m,L=w,R=y,D=b,F=C,P=x,j=E,V=k,U=S,B=M;for(let i=0;i<80;i+=1){let o,n;const r=Il[i];if(i<16)r.high=0|t[e+2*i],n=r.high,r.low=0|t[e+2*i+1],o=r.low;else{const t=Il[i-15],e=t.high,s=t.low,a=(e>>>1|s<<31)^(e>>>8|s<<24)^e>>>7,l=(s>>>1|e<<31)^(s>>>8|e<<24)^(s>>>7|e<<25),c=Il[i-2],d=c.high,h=c.low,u=(d>>>19|h<<13)^(d<<3|h>>>29)^d>>>6,p=(h>>>19|d<<13)^(h<<3|d>>>29)^(h>>>6|d<<26),v=Il[i-7],g=v.high,f=v.low,m=Il[i-16],w=m.high,y=m.low;o=l+f,n=a+g+(o>>>0<l>>>0?1:0),o+=p,n=n+u+(o>>>0<p>>>0?1:0),o+=y,n=n+w+(o>>>0<y>>>0?1:0),r.high=n,r.low=o}const s=R&F^~R&j,a=D&P^~D&V,l=A&I^A&$^I&$,c=T&_^T&N^_&N,d=(A>>>28|T<<4)^(A<<30|T>>>2)^(A<<25|T>>>7),h=(T>>>28|A<<4)^(T<<30|A>>>2)^(T<<25|A>>>7),u=(R>>>14|D<<18)^(R>>>18|D<<14)^(R<<23|D>>>9),p=(D>>>14|R<<18)^(D>>>18|R<<14)^(D<<23|R>>>9),v=Tl[i],g=v.high,f=v.low;let m=B+p,w=U+u+(m>>>0<B>>>0?1:0);m+=a,w=w+s+(m>>>0<a>>>0?1:0),m+=f,w=w+g+(m>>>0<f>>>0?1:0),m+=o,w=w+n+(m>>>0<o>>>0?1:0);const y=h+c;U=j,B=V,j=F,V=P,F=R,P=D,D=L+m|0,R=O+w+(D>>>0<L>>>0?1:0)|0,O=$,L=N,$=I,N=_,I=A,_=T,T=m+y|0,A=w+(d+l+(y>>>0<h>>>0?1:0))+(T>>>0<m>>>0?1:0)|0}o.low=u+T,u=o.low,o.high=h+A+(u>>>0<T>>>0?1:0),n.low=v+_,v=n.low,n.high=p+I+(v>>>0<_>>>0?1:0),r.low=f+N,f=r.low,r.high=g+$+(f>>>0<N>>>0?1:0),s.low=w+L,w=s.low,s.high=m+O+(w>>>0<L>>>0?1:0),a.low=b+D,b=a.low,a.high=y+R+(b>>>0<D>>>0?1:0),l.low=x+P,x=l.low,l.high=C+F+(x>>>0<P>>>0?1:0),c.low=k+V,k=c.low,c.high=E+j+(k>>>0<V>>>0?1:0),d.low=M+B,M=d.low,d.high=S+U+(M>>>0<B>>>0?1:0)}_doFinalize(){const t=this._data,e=t.words,i=8*this._nDataBytes,o=8*t.sigBytes;e[o>>>5]|=128<<24-o%32,e[30+(o+128>>>10<<5)]=Math.floor(i/4294967296),e[31+(o+128>>>10<<5)]=i,t.sigBytes=4*e.length,this._process();return this._hash.toX32()}clone(){const t=super.clone.call(this);return t._hash=this._hash.clone(),t}}const $l=Na._createHelper(_l),Nl=Na._createHmacHelper(_l);class Ol extends _l{_doReset(){this._hash=new Da([new Ra(3418070365,3238371032),new Ra(1654270250,914150663),new Ra(2438529370,812702999),new Ra(355462360,4144912697),new Ra(1731405415,4290775857),new Ra(2394180231,1750603025),new Ra(3675008525,1694076839),new Ra(1203062813,3204075428)])}_doFinalize(){const t=super._doFinalize.call(this);return t.sigBytes-=16,t}}const Ll=_l._createHelper(Ol),Rl=_l._createHmacHelper(Ol),Dl=[],Fl=[],Pl=[];let jl=1,Vl=0;for(let t=0;t<24;t+=1){Dl[jl+5*Vl]=(t+1)*(t+2)/2%64;const e=(2*jl+3*Vl)%5;jl=Vl%5,Vl=e}for(let t=0;t<5;t+=1)for(let e=0;e<5;e+=1)Fl[t+5*e]=e+(2*t+3*e)%5*5;let Ul=1;for(let t=0;t<24;t+=1){let e=0,i=0;for(let t=0;t<7;t+=1){if(1&Ul){const o=(1<<t)-1;o<32?i^=1<<o:e^=1<<o-32}128&Ul?Ul=Ul<<1^113:Ul<<=1}Pl[t]=Ra.create(e,i)}const Bl=[];for(let t=0;t<25;t+=1)Bl[t]=Ra.create();class zl extends Na{constructor(t){super(Object.assign({outputLength:512},t))}_doReset(){this._state=[];const t=this._state;for(let e=0;e<25;e+=1)t[e]=new Ra;this.blockSize=(1600-2*this.cfg.outputLength)/32}_doProcessBlock(t,e){const i=this._state,o=this.blockSize/2;for(let n=0;n<o;n+=1){let o=t[e+2*n],r=t[e+2*n+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8);const s=i[n];s.high^=r,s.low^=o}for(let t=0;t<24;t+=1){for(let t=0;t<5;t+=1){let e=0,o=0;for(let n=0;n<5;n+=1){const r=i[t+5*n];e^=r.high,o^=r.low}const n=Bl[t];n.high=e,n.low=o}for(let t=0;t<5;t+=1){const e=Bl[(t+4)%5],o=Bl[(t+1)%5],n=o.high,r=o.low,s=e.high^(n<<1|r>>>31),a=e.low^(r<<1|n>>>31);for(let e=0;e<5;e+=1){const o=i[t+5*e];o.high^=s,o.low^=a}}for(let t=1;t<25;t+=1){let e,o;const n=i[t],r=n.high,s=n.low,a=Dl[t];a<32?(e=r<<a|s>>>32-a,o=s<<a|r>>>32-a):(e=s<<a-32|r>>>64-a,o=r<<a-32|s>>>64-a);const l=Bl[Fl[t]];l.high=e,l.low=o}const e=Bl[0],o=i[0];e.high=o.high,e.low=o.low;for(let t=0;t<5;t+=1)for(let e=0;e<5;e+=1){const o=t+5*e,n=i[o],r=Bl[o],s=Bl[(t+1)%5+5*e],a=Bl[(t+2)%5+5*e];n.high=r.high^~s.high&a.high,n.low=r.low^~s.low&a.low}const n=i[0],r=Pl[t];n.high^=r.high,n.low^=r.low}}_doFinalize(){const t=this._data,e=t.words,i=8*t.sigBytes,o=32*this.blockSize;e[i>>>5]|=1<<24-i%32,e[(Math.ceil((i+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*e.length,this._process();const n=this._state,r=this.cfg.outputLength/8,s=r/8,a=[];for(let t=0;t<s;t+=1){const e=n[t];let i=e.high,o=e.low;i=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),a.push(o),a.push(i)}return new Aa(a,r)}clone(){const t=super.clone.call(this);t._state=this._state.slice(0);const e=t._state;for(let t=0;t<25;t+=1)e[t]=e[t].clone();return t}}const Hl=Na._createHelper(zl),Gl=Na._createHmacHelper(zl),Wl=Aa.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),ql=Aa.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),Zl=Aa.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),Kl=Aa.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),Jl=Aa.create([0,1518500249,1859775393,2400959708,2840853838]),Yl=Aa.create([1352829926,1548603684,1836072691,2053994217,0]),Ql=(t,e,i)=>t^e^i,Xl=(t,e,i)=>t&e|~t&i,tc=(t,e,i)=>(t|~e)^i,ec=(t,e,i)=>t&i|e&~i,ic=(t,e,i)=>t^(e|~i),oc=(t,e)=>t<<e|t>>>32-e;class nc extends Na{_doReset(){this._hash=Aa.create([1732584193,4023233417,2562383102,271733878,3285377520])}_doProcessBlock(t,e){const i=t;for(let t=0;t<16;t+=1){const o=e+t,n=i[o];i[o]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}const o=this._hash.words,n=Jl.words,r=Yl.words,s=Wl.words,a=ql.words,l=Zl.words,c=Kl.words;let d,h=o[0],u=o[1],p=o[2],v=o[3],g=o[4],f=o[0],m=o[1],w=o[2],y=o[3],b=o[4];for(let t=0;t<80;t+=1)d=h+i[e+s[t]]|0,d+=t<16?Ql(u,p,v)+n[0]:t<32?Xl(u,p,v)+n[1]:t<48?tc(u,p,v)+n[2]:t<64?ec(u,p,v)+n[3]:ic(u,p,v)+n[4],d|=0,d=oc(d,l[t]),d=d+g|0,h=g,g=v,v=oc(p,10),p=u,u=d,d=f+i[e+a[t]]|0,d+=t<16?ic(m,w,y)+r[0]:t<32?ec(m,w,y)+r[1]:t<48?tc(m,w,y)+r[2]:t<64?Xl(m,w,y)+r[3]:Ql(m,w,y)+r[4],d|=0,d=oc(d,c[t]),d=d+b|0,f=b,b=y,y=oc(w,10),w=m,m=d;d=o[1]+p+y|0,o[1]=o[2]+v+b|0,o[2]=o[3]+g+f|0,o[3]=o[4]+h+m|0,o[4]=o[0]+u+w|0,o[0]=d}_doFinalize(){const t=this._data,e=t.words,i=8*this._nDataBytes,o=8*t.sigBytes;e[o>>>5]|=128<<24-o%32,e[14+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(e.length+1),this._process();const n=this._hash,r=n.words;for(let t=0;t<5;t+=1){const e=r[t];r[t]=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8)}return n}clone(){const t=super.clone.call(this);return t._hash=this._hash.clone(),t}}const rc=Na._createHelper(nc),sc=Na._createHmacHelper(nc);class ac extends Ma{constructor(t){super(),this.cfg=Object.assign(new Ma,{keySize:4,hasher:xl,iterations:25e4},t)}compute(t,e){const{cfg:i}=this,o=Oa.create(i.hasher,t),n=Aa.create(),r=Aa.create([1]),s=n.words,a=r.words,{keySize:l,iterations:c}=i;for(;s.length<l;){const t=o.update(e).finalize(r);o.reset();const i=t.words,s=i.length;let l=t;for(let t=1;t<c;t+=1){l=o.finalize(l),o.reset();const t=l.words;for(let e=0;e<s;e+=1)i[e]^=t[e]}n.concat(t),a[0]+=1}return n.sigBytes=4*l,n}}const lc=[],cc=[],dc=[],hc=[],uc=[],pc=[],vc=[],gc=[],fc=[],mc=[],wc=[];for(let t=0;t<256;t+=1)wc[t]=t<128?t<<1:t<<1^283;let yc=0,bc=0;for(let t=0;t<256;t+=1){let t=bc^bc<<1^bc<<2^bc<<3^bc<<4;t=t>>>8^255&t^99,lc[yc]=t,cc[t]=yc;const e=wc[yc],i=wc[e],o=wc[i];let n=257*wc[t]^16843008*t;dc[yc]=n<<24|n>>>8,hc[yc]=n<<16|n>>>16,uc[yc]=n<<8|n>>>24,pc[yc]=n,n=16843009*o^65537*i^257*e^16843008*yc,vc[t]=n<<24|n>>>8,gc[t]=n<<16|n>>>16,fc[t]=n<<8|n>>>24,mc[t]=n,yc?(yc=e^wc[wc[wc[o^e]]],bc^=wc[wc[bc]]):(bc=1,yc=bc)}const Cc=[0,1,2,4,8,16,32,64,128,27,54];class xc extends tl{_doReset(){let t;if(this._nRounds&&this._keyPriorReset===this._key)return;this._keyPriorReset=this._key;const e=this._keyPriorReset,i=e.words,o=e.sigBytes/4;this._nRounds=o+6;const n=4*(this._nRounds+1);this._keySchedule=[];const r=this._keySchedule;for(let e=0;e<n;e+=1)e<o?r[e]=i[e]:(t=r[e-1],e%o?o>6&&e%o==4&&(t=lc[t>>>24]<<24|lc[t>>>16&255]<<16|lc[t>>>8&255]<<8|lc[255&t]):(t=t<<8|t>>>24,t=lc[t>>>24]<<24|lc[t>>>16&255]<<16|lc[t>>>8&255]<<8|lc[255&t],t^=Cc[e/o|0]<<24),r[e]=r[e-o]^t);this._invKeySchedule=[];const s=this._invKeySchedule;for(let e=0;e<n;e+=1){const i=n-e;t=e%4?r[i]:r[i-4],s[e]=e<4||i<=4?t:vc[lc[t>>>24]]^gc[lc[t>>>16&255]]^fc[lc[t>>>8&255]]^mc[lc[255&t]]}}encryptBlock(t,e){this._doCryptBlock(t,e,this._keySchedule,dc,hc,uc,pc,lc)}decryptBlock(t,e){const i=t;let o=i[e+1];i[e+1]=i[e+3],i[e+3]=o,this._doCryptBlock(i,e,this._invKeySchedule,vc,gc,fc,mc,cc),o=i[e+1],i[e+1]=i[e+3],i[e+3]=o}_doCryptBlock(t,e,i,o,n,r,s,a){const l=t,c=this._nRounds;let d=l[e]^i[0],h=l[e+1]^i[1],u=l[e+2]^i[2],p=l[e+3]^i[3],v=4;for(let t=1;t<c;t+=1){const t=o[d>>>24]^n[h>>>16&255]^r[u>>>8&255]^s[255&p]^i[v];v+=1;const e=o[h>>>24]^n[u>>>16&255]^r[p>>>8&255]^s[255&d]^i[v];v+=1;const a=o[u>>>24]^n[p>>>16&255]^r[d>>>8&255]^s[255&h]^i[v];v+=1;const l=o[p>>>24]^n[d>>>16&255]^r[h>>>8&255]^s[255&u]^i[v];v+=1,d=t,h=e,u=a,p=l}const g=(a[d>>>24]<<24|a[h>>>16&255]<<16|a[u>>>8&255]<<8|a[255&p])^i[v];v+=1;const f=(a[h>>>24]<<24|a[u>>>16&255]<<16|a[p>>>8&255]<<8|a[255&d])^i[v];v+=1;const m=(a[u>>>24]<<24|a[p>>>16&255]<<16|a[d>>>8&255]<<8|a[255&h])^i[v];v+=1;const w=(a[p>>>24]<<24|a[d>>>16&255]<<16|a[h>>>8&255]<<8|a[255&u])^i[v];v+=1,l[e]=g,l[e+1]=f,l[e+2]=m,l[e+3]=w}}xc.keySize=8;const Ec=tl._createHelper(xc),kc=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],Sc=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],Mc=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],Ac=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],Tc=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679];function Ic(t,e){const i=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=i,this._lBlock^=i<<t}function _c(t,e){const i=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=i,this._rBlock^=i<<t}class $c extends tl{constructor(t,e,i){super(t,e,i),this.blockSize=2}_doReset(){const t=this._key.words,e=[];for(let i=0;i<56;i+=1){const o=kc[i]-1;e[i]=t[o>>>5]>>>31-o%32&1}this._subKeys=[];const i=this._subKeys;for(let t=0;t<16;t+=1){i[t]=[];const o=i[t],n=Mc[t];for(let t=0;t<24;t+=1)o[t/6|0]|=e[(Sc[t]-1+n)%28]<<31-t%6,o[4+(t/6|0)]|=e[28+(Sc[t+24]-1+n)%28]<<31-t%6;o[0]=o[0]<<1|o[0]>>>31;for(let t=1;t<7;t+=1)o[t]>>>=4*(t-1)+3;o[7]=o[7]<<5|o[7]>>>27}this._invSubKeys=[];const o=this._invSubKeys;for(let t=0;t<16;t+=1)o[t]=i[15-t]}encryptBlock(t,e){this._doCryptBlock(t,e,this._subKeys)}decryptBlock(t,e){this._doCryptBlock(t,e,this._invSubKeys)}_doCryptBlock(t,e,i){const o=t;this._lBlock=t[e],this._rBlock=t[e+1],Ic.call(this,4,252645135),Ic.call(this,16,65535),_c.call(this,2,858993459),_c.call(this,8,16711935),Ic.call(this,1,1431655765);for(let t=0;t<16;t+=1){const e=i[t],o=this._lBlock,n=this._rBlock;let r=0;for(let t=0;t<8;t+=1)r|=Ac[t][((n^e[t])&Tc[t])>>>0];this._lBlock=n,this._rBlock=o^r}const n=this._lBlock;this._lBlock=this._rBlock,this._rBlock=n,Ic.call(this,1,1431655765),_c.call(this,8,16711935),_c.call(this,2,858993459),Ic.call(this,16,65535),Ic.call(this,4,252645135),o[e]=this._lBlock,o[e+1]=this._rBlock}}$c.keySize=2,$c.ivSize=2;const Nc=tl._createHelper($c);class Oc extends tl{_doReset(){const t=this._key.words;if(2!==t.length&&4!==t.length&&t.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");const e=t.slice(0,2),i=t.length<4?t.slice(0,2):t.slice(2,4),o=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=$c.createEncryptor(Aa.create(e)),this._des2=$c.createEncryptor(Aa.create(i)),this._des3=$c.createEncryptor(Aa.create(o))}encryptBlock(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)}decryptBlock(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)}}Oc.keySize=6,Oc.ivSize=2;const Lc=tl._createHelper(Oc),Rc=[],Dc=[],Fc=[];function Pc(){const t=this._X,e=this._C;for(let t=0;t<8;t+=1)Dc[t]=e[t];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<Dc[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<Dc[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<Dc[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<Dc[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<Dc[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<Dc[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<Dc[6]>>>0?1:0)|0,this._b=e[7]>>>0<Dc[7]>>>0?1:0;for(let i=0;i<8;i+=1){const o=t[i]+e[i],n=65535&o,r=o>>>16,s=((n*n>>>17)+n*r>>>15)+r*r,a=((4294901760&o)*o|0)+((65535&o)*o|0);Fc[i]=s^a}t[0]=Fc[0]+(Fc[7]<<16|Fc[7]>>>16)+(Fc[6]<<16|Fc[6]>>>16)|0,t[1]=Fc[1]+(Fc[0]<<8|Fc[0]>>>24)+Fc[7]|0,t[2]=Fc[2]+(Fc[1]<<16|Fc[1]>>>16)+(Fc[0]<<16|Fc[0]>>>16)|0,t[3]=Fc[3]+(Fc[2]<<8|Fc[2]>>>24)+Fc[1]|0,t[4]=Fc[4]+(Fc[3]<<16|Fc[3]>>>16)+(Fc[2]<<16|Fc[2]>>>16)|0,t[5]=Fc[5]+(Fc[4]<<8|Fc[4]>>>24)+Fc[3]|0,t[6]=Fc[6]+(Fc[5]<<16|Fc[5]>>>16)+(Fc[4]<<16|Fc[4]>>>16)|0,t[7]=Fc[7]+(Fc[6]<<8|Fc[6]>>>24)+Fc[5]|0}class jc extends Ka{constructor(...t){super(...t),this.blockSize=4,this.ivSize=2}_doReset(){const t=this._key.words,{iv:e}=this.cfg;for(let e=0;e<4;e+=1)t[e]=16711935&(t[e]<<8|t[e]>>>24)|4278255360&(t[e]<<24|t[e]>>>8);this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16];const i=this._X;this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];const o=this._C;this._b=0;for(let t=0;t<4;t+=1)Pc.call(this);for(let t=0;t<8;t+=1)o[t]^=i[t+4&7];if(e){const t=e.words,i=t[0],n=t[1],r=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),s=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),a=r>>>16|4294901760&s,l=s<<16|65535&r;o[0]^=r,o[1]^=a,o[2]^=s,o[3]^=l,o[4]^=r,o[5]^=a,o[6]^=s,o[7]^=l;for(let t=0;t<4;t+=1)Pc.call(this)}}_doProcessBlock(t,e){const i=t,o=this._X;Pc.call(this),Rc[0]=o[0]^o[5]>>>16^o[3]<<16,Rc[1]=o[2]^o[7]>>>16^o[5]<<16,Rc[2]=o[4]^o[1]>>>16^o[7]<<16,Rc[3]=o[6]^o[3]>>>16^o[1]<<16;for(let t=0;t<4;t+=1)Rc[t]=16711935&(Rc[t]<<8|Rc[t]>>>24)|4278255360&(Rc[t]<<24|Rc[t]>>>8),i[e+t]^=Rc[t]}}const Vc=Ka._createHelper(jc),Uc=[],Bc=[],zc=[];function Hc(){const t=this._X,e=this._C;for(let t=0;t<8;t+=1)Bc[t]=e[t];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<Bc[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<Bc[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<Bc[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<Bc[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<Bc[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<Bc[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<Bc[6]>>>0?1:0)|0,this._b=e[7]>>>0<Bc[7]>>>0?1:0;for(let i=0;i<8;i+=1){const o=t[i]+e[i],n=65535&o,r=o>>>16,s=((n*n>>>17)+n*r>>>15)+r*r,a=((4294901760&o)*o|0)+((65535&o)*o|0);zc[i]=s^a}t[0]=zc[0]+(zc[7]<<16|zc[7]>>>16)+(zc[6]<<16|zc[6]>>>16)|0,t[1]=zc[1]+(zc[0]<<8|zc[0]>>>24)+zc[7]|0,t[2]=zc[2]+(zc[1]<<16|zc[1]>>>16)+(zc[0]<<16|zc[0]>>>16)|0,t[3]=zc[3]+(zc[2]<<8|zc[2]>>>24)+zc[1]|0,t[4]=zc[4]+(zc[3]<<16|zc[3]>>>16)+(zc[2]<<16|zc[2]>>>16)|0,t[5]=zc[5]+(zc[4]<<8|zc[4]>>>24)+zc[3]|0,t[6]=zc[6]+(zc[5]<<16|zc[5]>>>16)+(zc[4]<<16|zc[4]>>>16)|0,t[7]=zc[7]+(zc[6]<<8|zc[6]>>>24)+zc[5]|0}class Gc extends Ka{constructor(...t){super(...t),this.blockSize=4,this.ivSize=2}_doReset(){const t=this._key.words,{iv:e}=this.cfg;this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16];const i=this._X;this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];const o=this._C;this._b=0;for(let t=0;t<4;t+=1)Hc.call(this);for(let t=0;t<8;t+=1)o[t]^=i[t+4&7];if(e){const t=e.words,i=t[0],n=t[1],r=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),s=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),a=r>>>16|4294901760&s,l=s<<16|65535&r;o[0]^=r,o[1]^=a,o[2]^=s,o[3]^=l,o[4]^=r,o[5]^=a,o[6]^=s,o[7]^=l;for(let t=0;t<4;t+=1)Hc.call(this)}}_doProcessBlock(t,e){const i=t,o=this._X;Hc.call(this),Uc[0]=o[0]^o[5]>>>16^o[3]<<16,Uc[1]=o[2]^o[7]>>>16^o[5]<<16,Uc[2]=o[4]^o[1]>>>16^o[7]<<16,Uc[3]=o[6]^o[3]>>>16^o[1]<<16;for(let t=0;t<4;t+=1)Uc[t]=16711935&(Uc[t]<<8|Uc[t]>>>24)|4278255360&(Uc[t]<<24|Uc[t]>>>8),i[e+t]^=Uc[t]}}const Wc=Ka._createHelper(Gc);function qc(){const t=this._S;let e=this._i,i=this._j,o=0;for(let n=0;n<4;n+=1){e=(e+1)%256,i=(i+t[e])%256;const r=t[e];t[e]=t[i],t[i]=r,o|=t[(t[e]+t[i])%256]<<24-8*n}return this._i=e,this._j=i,o}class Zc extends Ka{_doReset(){const t=this._key,e=t.words,i=t.sigBytes;this._S=[];const o=this._S;for(let t=0;t<256;t+=1)o[t]=t;for(let t=0,n=0;t<256;t+=1){const r=t%i,s=e[r>>>2]>>>24-r%4*8&255;n=(n+o[t]+s)%256;const a=o[t];o[t]=o[n],o[n]=a}this._j=0,this._i=this._j}_doProcessBlock(t,e){t[e]^=qc.call(this)}}Zc.keySize=8,Zc.ivSize=0;const Kc=Ka._createHelper(Zc);class Jc extends Zc{constructor(...t){super(...t),Object.assign(this.cfg,{drop:192})}_doReset(){super._doReset.call(this);for(let t=this.cfg.drop;t>0;t-=1)qc.call(this)}}const Yc=Ka._createHelper(Jc),Qc=16,Xc=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],td=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],ed={pbox:[],sbox:[]};function id(t,e){const i=e>>24&255,o=e>>16&255,n=e>>8&255,r=255&e;let s=t.sbox[0][i]+t.sbox[1][o];return s^=t.sbox[2][n],s+=t.sbox[3][r],s}function od(t,e,i){let o,n=e,r=i;for(let e=0;e<Qc;++e)n^=t.pbox[e],r=id(t,n)^r,o=n,n=r,r=o;return o=n,n=r,r=o,r^=t.pbox[Qc],n^=t.pbox[17],{left:n,right:r}}class nd extends tl{constructor(t,e,i){super(t,e,i),this.blockSize=2}_doReset(){if(this._keyPriorReset===this._key)return;const t=this._keyPriorReset=this._key,e=t.words,i=t.sigBytes/4;!function(t,e,i){for(let e=0;e<4;e++){t.sbox[e]=[];for(let i=0;i<256;i++)t.sbox[e][i]=td[e][i]}let o=0;for(let n=0;n<18;n++)t.pbox[n]=Xc[n]^e[o],o++,o>=i&&(o=0);let n=0,r=0,s=0;for(let e=0;e<18;e+=2)s=od(t,n,r),n=s.left,r=s.right,t.pbox[e]=n,t.pbox[e+1]=r;for(let e=0;e<4;e++)for(let i=0;i<256;i+=2)s=od(t,n,r),n=s.left,r=s.right,t.sbox[e][i]=n,t.sbox[e][i+1]=r}(ed,e,i)}encryptBlock(t,e){const i=od(ed,t[e],t[e+1]);t[e]=i.left,t[e+1]=i.right}decryptBlock(t,e){const i=function(t,e,i){let o,n=e,r=i;for(let e=17;e>1;--e)n^=t.pbox[e],r=id(t,n)^r,o=n,n=r,r=o;return o=n,n=r,r=o,r^=t.pbox[1],n^=t.pbox[0],{left:n,right:r}}(ed,t[e],t[e+1]);t[e]=i.left,t[e+1]=i.right}}nd.keySize=4,nd.ivSize=2;const rd=tl._createHelper(nd);function sd(t,e,i,o){const n=t;let r;const s=this._iv;s?(r=s.slice(0),this._iv=void 0):r=this._prevBlock,o.encryptBlock(r,0);for(let t=0;t<i;t+=1)n[e+t]^=r[t]}class ad extends Ja{}ad.Encryptor=class extends ad{processBlock(t,e){const i=this._cipher,{blockSize:o}=i;sd.call(this,t,e,o,i),this._prevBlock=t.slice(e,e+o)}},ad.Decryptor=class extends ad{processBlock(t,e){const i=this._cipher,{blockSize:o}=i,n=t.slice(e,e+o);sd.call(this,t,e,o,i),this._prevBlock=n}};class ld extends Ja{}ld.Encryptor=class extends ld{processBlock(t,e){const i=t,o=this._cipher,{blockSize:n}=o,r=this._iv;let s=this._counter;r&&(this._counter=r.slice(0),s=this._counter,this._iv=void 0);const a=s.slice(0);o.encryptBlock(a,0),s[n-1]=s[n-1]+1|0;for(let t=0;t<n;t+=1)i[e+t]^=a[t]}},ld.Decryptor=ld.Encryptor;const cd=t=>{let e=t;if(255&~(t>>24))e+=1<<24;else{let i=t>>16&255,o=t>>8&255,n=255&t;255===i?(i=0,255===o?(o=0,255===n?n=0:n+=1):o+=1):i+=1,e=0,e+=i<<16,e+=o<<8,e+=n}return e};
1553
+ function(t,e){const i=nn(t,"auth");if(i.isInitialized()){const t=i.getImmediate();if(Ui(i.getOptions(),null!=e?e:{}))return t;Gn(t,"already-initialized")}return i.initialize({options:e})}(t,{popupRedirectResolver:fa,persistence:[Os,fs,ws]}),o=Ri("authTokenSyncURL");if(o&&"boolean"==typeof isSecureContext&&isSecureContext){const t=new URL(o,location.origin);if(location.origin===t.origin){const e=(n=t.toString(),async t=>{const e=t&&await t.getIdTokenResult(),i=e&&((new Date).getTime()-Date.parse(e.issuedAtTime))/1e3;if(i&&i>ba)return;const o=null==e?void 0:e.token;Ca!==o&&(Ca=o,await fetch(n,{method:o?"POST":"DELETE",headers:o?{Authorization:`Bearer ${o}`}:{}}))});!function(t,e,i){Wi(t).beforeAuthStateChanged(e,i)}(i,e,(()=>e(i.currentUser))),function(t,e,i,o){Wi(t).onIdTokenChanged(e,i,o)}(i,(t=>e(t)))}}var n;const r=Oi("auth");return r&&Yr(i,`http://${r}`),i}var Ea;function ka(...t){(function(){try{return"undefined"!=typeof localStorage&&"true"===localStorage.getItem("sfIdentityDebug")}catch{return!1}})()&&console.log(...t)}!function(t){Jr=t}({loadJS:t=>new Promise(((e,i)=>{const o=document.createElement("script");var n,r;o.setAttribute("src",t),o.onload=e,o.onerror=t=>{const e=Wn("internal-error");e.customData=t,i(e)},o.type="text/javascript",o.charset="UTF-8",(null!==(r=null===(n=document.getElementsByTagName("head"))||void 0===n?void 0:n[0])&&void 0!==r?r:document).appendChild(o)})),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="}),Ea="Browser",on(new qi("auth",((t,{options:e})=>{const i=t.getProvider("app").getImmediate(),o=t.getProvider("heartbeat"),n=t.getProvider("app-check-internal"),{apiKey:r,authDomain:s}=i.options;Jn(r&&!r.includes(":"),"invalid-api-key",{appName:i.name});const a={apiKey:r,authDomain:s,clientPlatform:Ea,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Hr(Ea)},l=new qr(i,o,n,a);return function(t,e){const i=(null==e?void 0:e.persistence)||[],o=(Array.isArray(i)?i:[i]).map(Tr);(null==e?void 0:e.errorMap)&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(o,null==e?void 0:e.popupRedirectResolver)}(l,e),l}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback(((t,e,i)=>{t.getProvider("auth-internal").initialize()}))),on(new qi("auth-internal",(t=>(t=>new ya(t))(Zr(t.getProvider("auth").getImmediate()))),"PRIVATE").setInstantiationMode("EXPLICIT")),hn(ma,wa,function(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(Ea)),hn(ma,wa,"esm2017");const Sa=("undefined"!=typeof globalThis?globalThis:void 0)?.crypto||("undefined"!=typeof global?global:void 0)?.crypto||("undefined"!=typeof window?window:void 0)?.crypto||("undefined"!=typeof self?self:void 0)?.crypto||("undefined"!=typeof frames?frames:void 0)?.[0]?.crypto;let Aa;Aa=Sa?t=>{const e=[];for(let i=0;i<t;i+=4)e.push(Sa.getRandomValues(new Uint32Array(1))[0]);return new Ta(e,t)}:t=>{const e=[],i=t=>{let e=t,i=987654321;const o=4294967295;return()=>{i=36969*(65535&i)+(i>>16)&o,e=18e3*(65535&e)+(e>>16)&o;let t=(i<<16)+e&o;return t/=4294967296,t+=.5,t*(Math.random()>.5?1:-1)}};for(let o,n=0;n<t;n+=4){const t=i(4294967296*(o||Math.random()));o=987654071*t(),e.push(4294967296*t()|0)}return new Ta(e,t)};class Ma{static create(...t){return new this(...t)}mixIn(t){return Object.assign(this,t)}clone(){const t=new this.constructor;return Object.assign(t,this),t}}class Ta extends Ma{constructor(t=[],e=4*t.length){super();let i=t;if(i instanceof ArrayBuffer&&(i=new Uint8Array(i)),(i instanceof Int8Array||i instanceof Uint8ClampedArray||i instanceof Int16Array||i instanceof Uint16Array||i instanceof Int32Array||i instanceof Uint32Array||i instanceof Float32Array||i instanceof Float64Array)&&(i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength)),i instanceof Uint8Array){const t=i.byteLength,e=[];for(let o=0;o<t;o+=1)e[o>>>2]|=i[o]<<24-o%4*8;this.words=e,this.sigBytes=t}else this.words=t,this.sigBytes=e}static random=Aa;toString(t=Ia){return t.stringify(this)}concat(t){const e=this.words,i=t.words,o=this.sigBytes,n=t.sigBytes;if(this.clamp(),o%4)for(let t=0;t<n;t+=1){const n=i[t>>>2]>>>24-t%4*8&255;e[o+t>>>2]|=n<<24-(o+t)%4*8}else for(let t=0;t<n;t+=4)e[o+t>>>2]=i[t>>>2];return this.sigBytes+=n,this}clamp(){const{words:t,sigBytes:e}=this;t[e>>>2]&=4294967295<<32-e%4*8,t.length=Math.ceil(e/4)}clone(){const t=super.clone.call(this);return t.words=this.words.slice(0),t}}const Ia={stringify(t){const{words:e,sigBytes:i}=t,o=[];for(let t=0;t<i;t+=1){const i=e[t>>>2]>>>24-t%4*8&255;o.push((i>>>4).toString(16)),o.push((15&i).toString(16))}return o.join("")},parse(t){const e=t.length,i=[];for(let o=0;o<e;o+=2)i[o>>>3]|=parseInt(t.substr(o,2),16)<<24-o%8*4;return new Ta(i,e/2)}},_a={stringify(t){const{words:e,sigBytes:i}=t,o=[];for(let t=0;t<i;t+=1){const i=e[t>>>2]>>>24-t%4*8&255;o.push(String.fromCharCode(i))}return o.join("")},parse(t){const e=t.length,i=[];for(let o=0;o<e;o+=1)i[o>>>2]|=(255&t.charCodeAt(o))<<24-o%4*8;return new Ta(i,e)}},$a={stringify(t){try{return decodeURIComponent(escape(_a.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:t=>_a.parse(unescape(encodeURIComponent(t)))};class Na extends Ma{constructor(){super(),this._minBufferSize=0}reset(){this._data=new Ta,this._nDataBytes=0}_append(t){let e=t;"string"==typeof e&&(e=$a.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(t){let e;const{_data:i,blockSize:o}=this,n=i.words,r=i.sigBytes;let s=r/(4*o);s=t?Math.ceil(s):Math.max((0|s)-this._minBufferSize,0);const a=s*o,l=Math.min(4*a,r);if(a){for(let t=0;t<a;t+=o)this._doProcessBlock(n,t);e=n.splice(0,a),i.sigBytes-=l}return new Ta(e,l)}clone(){const t=super.clone.call(this);return t._data=this._data.clone(),t}}class Oa extends Na{constructor(t){super(),this.blockSize=16,this.cfg=Object.assign(new Ma,t),this.reset()}static _createHelper(t){return(e,i)=>new t(i).finalize(e)}static _createHmacHelper(t){return(e,i)=>new La(t,i).finalize(e)}reset(){super.reset.call(this),this._doReset()}update(t){return this._append(t),this._process(),this}finalize(t){t&&this._append(t);return this._doFinalize()}}class La extends Ma{constructor(t,e){super();const i=new t;this._hasher=i;let o=e;"string"==typeof o&&(o=$a.parse(o));const n=i.blockSize,r=4*n;o.sigBytes>r&&(o=i.finalize(e)),o.clamp();const s=o.clone();this._oKey=s;const a=o.clone();this._iKey=a;const l=s.words,c=a.words;for(let t=0;t<n;t+=1)l[t]^=1549556828,c[t]^=909522486;s.sigBytes=r,a.sigBytes=r,this.reset()}reset(){const t=this._hasher;t.reset(),t.update(this._iKey)}update(t){return this._hasher.update(t),this}finalize(t){const e=this._hasher,i=e.finalize(t);e.reset();return e.finalize(this._oKey.clone().concat(i))}}const Ra=Ta;class Da extends Ma{constructor(t,e){super(),this.high=t,this.low=e}}class Fa extends Ma{constructor(t=[],e=8*t.length){super(),this.words=t,this.sigBytes=e}toX32(){const t=this.words,e=t.length,i=[];for(let o=0;o<e;o+=1){const e=t[o];i.push(e.high),i.push(e.low)}return Ra.create(i,this.sigBytes)}clone(){const t=super.clone.call(this);t.words=this.words.slice(0);const{words:e}=t,i=e.length;for(let t=0;t<i;t+=1)e[t]=e[t].clone();return t}}const Pa=(t,e,i)=>{const o=[];let n=0;for(let r=0;r<e;r+=1)if(r%4){const e=i[t.charCodeAt(r-1)]<<r%4*2|i[t.charCodeAt(r)]>>>6-r%4*2;o[n>>>2]|=e<<24-n%4*8,n+=1}return Ta.create(o,n)},ja={stringify(t){const{words:e,sigBytes:i}=t,o=this._map;t.clamp();const n=[];for(let t=0;t<i;t+=3){const r=(e[t>>>2]>>>24-t%4*8&255)<<16|(e[t+1>>>2]>>>24-(t+1)%4*8&255)<<8|e[t+2>>>2]>>>24-(t+2)%4*8&255;for(let e=0;e<4&&t+.75*e<i;e+=1)n.push(o.charAt(r>>>6*(3-e)&63))}const r=o.charAt(64);if(r)for(;n.length%4;)n.push(r);return n.join("")},parse(t){let e=t.length;const i=this._map;let o=this._reverseMap;if(!o){this._reverseMap=[],o=this._reverseMap;for(let t=0;t<i.length;t+=1)o[i.charCodeAt(t)]=t}const n=i.charAt(64);if(n){const i=t.indexOf(n);-1!==i&&(e=i)}return Pa(t,e,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},Va=[];for(let t=0;t<64;t+=1)Va[t]=4294967296*Math.abs(Math.sin(t+1))|0;const Ua=(t,e,i,o,n,r,s)=>{const a=t+(e&i|~e&o)+n+s;return(a<<r|a>>>32-r)+e},Ba=(t,e,i,o,n,r,s)=>{const a=t+(e&o|i&~o)+n+s;return(a<<r|a>>>32-r)+e},za=(t,e,i,o,n,r,s)=>{const a=t+(e^i^o)+n+s;return(a<<r|a>>>32-r)+e},Ha=(t,e,i,o,n,r,s)=>{const a=t+(i^(e|~o))+n+s;return(a<<r|a>>>32-r)+e};class Ga extends Oa{_doReset(){this._hash=new Ta([1732584193,4023233417,2562383102,271733878])}_doProcessBlock(t,e){const i=t;for(let o=0;o<16;o+=1){const n=e+o,r=t[n];i[n]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}const o=this._hash.words,n=i[e+0],r=i[e+1],s=i[e+2],a=i[e+3],l=i[e+4],c=i[e+5],d=i[e+6],h=i[e+7],u=i[e+8],p=i[e+9],v=i[e+10],g=i[e+11],f=i[e+12],m=i[e+13],w=i[e+14],y=i[e+15];let b=o[0],C=o[1],x=o[2],E=o[3];b=Ua(b,C,x,E,n,7,Va[0]),E=Ua(E,b,C,x,r,12,Va[1]),x=Ua(x,E,b,C,s,17,Va[2]),C=Ua(C,x,E,b,a,22,Va[3]),b=Ua(b,C,x,E,l,7,Va[4]),E=Ua(E,b,C,x,c,12,Va[5]),x=Ua(x,E,b,C,d,17,Va[6]),C=Ua(C,x,E,b,h,22,Va[7]),b=Ua(b,C,x,E,u,7,Va[8]),E=Ua(E,b,C,x,p,12,Va[9]),x=Ua(x,E,b,C,v,17,Va[10]),C=Ua(C,x,E,b,g,22,Va[11]),b=Ua(b,C,x,E,f,7,Va[12]),E=Ua(E,b,C,x,m,12,Va[13]),x=Ua(x,E,b,C,w,17,Va[14]),C=Ua(C,x,E,b,y,22,Va[15]),b=Ba(b,C,x,E,r,5,Va[16]),E=Ba(E,b,C,x,d,9,Va[17]),x=Ba(x,E,b,C,g,14,Va[18]),C=Ba(C,x,E,b,n,20,Va[19]),b=Ba(b,C,x,E,c,5,Va[20]),E=Ba(E,b,C,x,v,9,Va[21]),x=Ba(x,E,b,C,y,14,Va[22]),C=Ba(C,x,E,b,l,20,Va[23]),b=Ba(b,C,x,E,p,5,Va[24]),E=Ba(E,b,C,x,w,9,Va[25]),x=Ba(x,E,b,C,a,14,Va[26]),C=Ba(C,x,E,b,u,20,Va[27]),b=Ba(b,C,x,E,m,5,Va[28]),E=Ba(E,b,C,x,s,9,Va[29]),x=Ba(x,E,b,C,h,14,Va[30]),C=Ba(C,x,E,b,f,20,Va[31]),b=za(b,C,x,E,c,4,Va[32]),E=za(E,b,C,x,u,11,Va[33]),x=za(x,E,b,C,g,16,Va[34]),C=za(C,x,E,b,w,23,Va[35]),b=za(b,C,x,E,r,4,Va[36]),E=za(E,b,C,x,l,11,Va[37]),x=za(x,E,b,C,h,16,Va[38]),C=za(C,x,E,b,v,23,Va[39]),b=za(b,C,x,E,m,4,Va[40]),E=za(E,b,C,x,n,11,Va[41]),x=za(x,E,b,C,a,16,Va[42]),C=za(C,x,E,b,d,23,Va[43]),b=za(b,C,x,E,p,4,Va[44]),E=za(E,b,C,x,f,11,Va[45]),x=za(x,E,b,C,y,16,Va[46]),C=za(C,x,E,b,s,23,Va[47]),b=Ha(b,C,x,E,n,6,Va[48]),E=Ha(E,b,C,x,h,10,Va[49]),x=Ha(x,E,b,C,w,15,Va[50]),C=Ha(C,x,E,b,c,21,Va[51]),b=Ha(b,C,x,E,f,6,Va[52]),E=Ha(E,b,C,x,a,10,Va[53]),x=Ha(x,E,b,C,v,15,Va[54]),C=Ha(C,x,E,b,r,21,Va[55]),b=Ha(b,C,x,E,u,6,Va[56]),E=Ha(E,b,C,x,y,10,Va[57]),x=Ha(x,E,b,C,d,15,Va[58]),C=Ha(C,x,E,b,m,21,Va[59]),b=Ha(b,C,x,E,l,6,Va[60]),E=Ha(E,b,C,x,g,10,Va[61]),x=Ha(x,E,b,C,s,15,Va[62]),C=Ha(C,x,E,b,p,21,Va[63]),o[0]=o[0]+b|0,o[1]=o[1]+C|0,o[2]=o[2]+x|0,o[3]=o[3]+E|0}_doFinalize(){const t=this._data,e=t.words,i=8*this._nDataBytes,o=8*t.sigBytes;e[o>>>5]|=128<<24-o%32;const n=Math.floor(i/4294967296),r=i;e[15+(o+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e[14+(o+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();const s=this._hash,a=s.words;for(let t=0;t<4;t+=1){const e=a[t];a[t]=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8)}return s}clone(){const t=super.clone.call(this);return t._hash=this._hash.clone(),t}}const Wa=Oa._createHelper(Ga),qa=Oa._createHmacHelper(Ga);class Za extends Ma{constructor(t){super(),this.cfg=Object.assign(new Ma,{keySize:4,hasher:Ga,iterations:1},t)}compute(t,e){let i;const{cfg:o}=this,n=o.hasher.create(),r=Ta.create(),s=r.words,{keySize:a,iterations:l}=o;for(;s.length<a;){i&&n.update(i),i=n.update(t).finalize(e),n.reset();for(let t=1;t<l;t+=1)i=n.finalize(i),n.reset();r.concat(i)}return r.sigBytes=4*a,r}}class Ka extends Na{constructor(t,e,i){super(),this.cfg=Object.assign(new Ma,i),this._xformMode=t,this._key=e,this.reset()}static createEncryptor(t,e){return this.create(this._ENC_XFORM_MODE,t,e)}static createDecryptor(t,e){return this.create(this._DEC_XFORM_MODE,t,e)}static _createHelper(t){const e=t=>"string"==typeof t?sl:nl;return{encrypt:(i,o,n)=>e(o).encrypt(t,i,o,n),decrypt:(i,o,n)=>e(o).decrypt(t,i,o,n)}}reset(){super.reset.call(this),this._doReset()}process(t){return this._append(t),this._process()}finalize(t){t&&this._append(t);return this._doFinalize()}}Ka._ENC_XFORM_MODE=1,Ka._DEC_XFORM_MODE=2,Ka.keySize=4,Ka.ivSize=4;class Ja extends Ka{constructor(...t){super(...t),this.blockSize=1}_doFinalize(){return this._process(!0)}}class Ya extends Ma{constructor(t,e){super(),this._cipher=t,this._iv=e}static createEncryptor(t,e){return this.Encryptor.create(t,e)}static createDecryptor(t,e){return this.Decryptor.create(t,e)}}function Qa(t,e,i){const o=t;let n;const r=this._iv;r?(n=r,this._iv=void 0):n=this._prevBlock;for(let t=0;t<i;t+=1)o[e+t]^=n[t]}class Xa extends Ya{}Xa.Encryptor=class extends Xa{processBlock(t,e){const i=this._cipher,{blockSize:o}=i;Qa.call(this,t,e,o),i.encryptBlock(t,e),this._prevBlock=t.slice(e,e+o)}},Xa.Decryptor=class extends Xa{processBlock(t,e){const i=this._cipher,{blockSize:o}=i,n=t.slice(e,e+o);i.decryptBlock(t,e),Qa.call(this,t,e,o),this._prevBlock=n}};const tl={pad(t,e){const i=4*e,o=i-t.sigBytes%i,n=o<<24|o<<16|o<<8|o,r=[];for(let t=0;t<o;t+=4)r.push(n);const s=Ta.create(r,o);t.concat(s)},unpad(t){const e=t,i=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=i}};class el extends Ka{constructor(t,e,i){super(t,e,Object.assign({mode:Xa,padding:tl},i)),this.blockSize=4}reset(){let t;super.reset.call(this);const{cfg:e}=this,{iv:i,mode:o}=e;this._xformMode===this.constructor._ENC_XFORM_MODE?t=o.createEncryptor:(t=o.createDecryptor,this._minBufferSize=1),this._mode=t.call(o,this,i&&i.words),this._mode.u=t}_doProcessBlock(t,e){this._mode.processBlock(t,e)}_doFinalize(){let t;const{padding:e}=this.cfg;return this._xformMode===this.constructor._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t}}class il extends Ma{constructor(t){super(),this.mixIn(t)}toString(t){return(t||this.formatter).stringify(this)}}const ol={stringify(t){let e;const{ciphertext:i,salt:o}=t;return e=o?Ta.create([1398893684,1701076831]).concat(o).concat(i):i,e.toString(ja)},parse(t){let e;const i=ja.parse(t),o=i.words;return 1398893684===o[0]&&1701076831===o[1]&&(e=Ta.create(o.slice(2,4)),o.splice(0,4),i.sigBytes-=16),il.create({ciphertext:i,salt:e})}};class nl extends Ma{static encrypt(t,e,i,o){const n=Object.assign(new Ma,this.cfg,o),r=t.createEncryptor(i,n),s=r.finalize(e),a=r.cfg;return il.create({ciphertext:s,key:i,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:r.blockSize,formatter:n.format})}static decrypt(t,e,i,o){let n=e;const r=Object.assign(new Ma,this.cfg,o);n=this._parse(n,r.format);return t.createDecryptor(i,r).finalize(n.ciphertext)}static _parse(t,e){return"string"==typeof t?e.parse(t,this):t}}nl.cfg=Object.assign(new Ma,{format:ol});const rl={execute(t,e,i,o,n){let r,s=o;s||(s=Ta.random(8)),r=n?Za.create({keySize:e+i,hasher:n}).compute(t,s):Za.create({keySize:e+i}).compute(t,s);const a=Ta.create(r.words.slice(e),4*i);return r.sigBytes=4*e,il.create({key:r,iv:a,salt:s})}};class sl extends nl{static encrypt(t,e,i,o){const n=Object.assign(new Ma,this.cfg,o),r=n.kdf.execute(i,t.keySize,t.ivSize,n.salt,n.hasher);n.iv=r.iv;const s=nl.encrypt.call(this,t,e,r.key,n);return s.mixIn(r),s}static decrypt(t,e,i,o){let n=e;const r=Object.assign(new Ma,this.cfg,o);n=this._parse(n,r.format);const s=r.kdf.execute(i,t.keySize,t.ivSize,n.salt,r.hasher);r.iv=s.iv;return nl.decrypt.call(this,t,n,s.key,r)}}sl.cfg=Object.assign(nl.cfg,{kdf:rl});const al=t=>t<<8&4278255360|t>>>8&16711935,ll={stringify(t){const{words:e,sigBytes:i}=t,o=[];for(let t=0;t<i;t+=2){const i=e[t>>>2]>>>16-t%4*8&65535;o.push(String.fromCharCode(i))}return o.join("")},parse(t){const e=t.length,i=[];for(let o=0;o<e;o+=1)i[o>>>1]|=t.charCodeAt(o)<<16-o%2*16;return Ta.create(i,2*e)}},cl=ll,dl={stringify(t){const{words:e,sigBytes:i}=t,o=[];for(let t=0;t<i;t+=2){const i=al(e[t>>>2]>>>16-t%4*8&65535);o.push(String.fromCharCode(i))}return o.join("")},parse(t){const e=t.length,i=[];for(let o=0;o<e;o+=1)i[o>>>1]|=al(t.charCodeAt(o)<<16-o%2*16);return Ta.create(i,2*e)}},hl={stringify(t,e=!0){const{words:i,sigBytes:o}=t,n=e?this._safeMap:this._map;t.clamp();const r=[];for(let t=0;t<o;t+=3){const e=(i[t>>>2]>>>24-t%4*8&255)<<16|(i[t+1>>>2]>>>24-(t+1)%4*8&255)<<8|i[t+2>>>2]>>>24-(t+2)%4*8&255;for(let i=0;i<4&&t+.75*i<o;i+=1)r.push(n.charAt(e>>>6*(3-i)&63))}const s=n.charAt(64);if(s)for(;r.length%4;)r.push(s);return r.join("")},parse(t,e=!0){let i=t.length;const o=e?this._safeMap:this._map;let n=this._reverseMap;if(!n){this._reverseMap=[],n=this._reverseMap;for(let t=0;t<o.length;t+=1)n[o.charCodeAt(t)]=t}const r=o.charAt(64);if(r){const e=t.indexOf(r);-1!==e&&(i=e)}return Pa(t,i,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safeMap:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},ul=[];class pl extends Oa{_doReset(){this._hash=new Ta([1732584193,4023233417,2562383102,271733878,3285377520])}_doProcessBlock(t,e){const i=this._hash.words;let o=i[0],n=i[1],r=i[2],s=i[3],a=i[4];for(let i=0;i<80;i+=1){if(i<16)ul[i]=0|t[e+i];else{const t=ul[i-3]^ul[i-8]^ul[i-14]^ul[i-16];ul[i]=t<<1|t>>>31}let l=(o<<5|o>>>27)+a+ul[i];l+=i<20?1518500249+(n&r|~n&s):i<40?1859775393+(n^r^s):i<60?(n&r|n&s|r&s)-1894007588:(n^r^s)-899497514,a=s,s=r,r=n<<30|n>>>2,n=o,o=l}i[0]=i[0]+o|0,i[1]=i[1]+n|0,i[2]=i[2]+r|0,i[3]=i[3]+s|0,i[4]=i[4]+a|0}_doFinalize(){const t=this._data,e=t.words,i=8*this._nDataBytes,o=8*t.sigBytes;return e[o>>>5]|=128<<24-o%32,e[14+(o+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(o+64>>>9<<4)]=i,t.sigBytes=4*e.length,this._process(),this._hash}clone(){const t=super.clone.call(this);return t._hash=this._hash.clone(),t}}const vl=Oa._createHelper(pl),gl=Oa._createHmacHelper(pl),fl=[],ml=[],wl=t=>{const e=Math.sqrt(t);for(let i=2;i<=e;i+=1)if(!(t%i))return!1;return!0},yl=t=>4294967296*(t-(0|t))|0;let bl=2,Cl=0;for(;Cl<64;)wl(bl)&&(Cl<8&&(fl[Cl]=yl(bl**.5)),ml[Cl]=yl(bl**(1/3)),Cl+=1),bl+=1;const xl=[];class El extends Oa{_doReset(){this._hash=new Ta(fl.slice(0))}_doProcessBlock(t,e){const i=this._hash.words;let o=i[0],n=i[1],r=i[2],s=i[3],a=i[4],l=i[5],c=i[6],d=i[7];for(let i=0;i<64;i+=1){if(i<16)xl[i]=0|t[e+i];else{const t=xl[i-15],e=(t<<25|t>>>7)^(t<<14|t>>>18)^t>>>3,o=xl[i-2],n=(o<<15|o>>>17)^(o<<13|o>>>19)^o>>>10;xl[i]=e+xl[i-7]+n+xl[i-16]}const h=o&n^o&r^n&r,u=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),p=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&c)+ml[i]+xl[i];d=c,c=l,l=a,a=s+p|0,s=r,r=n,n=o,o=p+(u+h)|0}i[0]=i[0]+o|0,i[1]=i[1]+n|0,i[2]=i[2]+r|0,i[3]=i[3]+s|0,i[4]=i[4]+a|0,i[5]=i[5]+l|0,i[6]=i[6]+c|0,i[7]=i[7]+d|0}_doFinalize(){const t=this._data,e=t.words,i=8*this._nDataBytes,o=8*t.sigBytes;return e[o>>>5]|=128<<24-o%32,e[14+(o+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(o+64>>>9<<4)]=i,t.sigBytes=4*e.length,this._process(),this._hash}clone(){const t=super.clone.call(this);return t._hash=this._hash.clone(),t}}const kl=Oa._createHelper(El),Sl=Oa._createHmacHelper(El);class Al extends El{_doReset(){this._hash=new Ta([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])}_doFinalize(){const t=super._doFinalize.call(this);return t.sigBytes-=4,t}}const Ml=El._createHelper(Al),Tl=El._createHmacHelper(Al),Il=[new Da(1116352408,3609767458),new Da(1899447441,602891725),new Da(3049323471,3964484399),new Da(3921009573,2173295548),new Da(961987163,4081628472),new Da(1508970993,3053834265),new Da(2453635748,2937671579),new Da(2870763221,3664609560),new Da(3624381080,2734883394),new Da(310598401,1164996542),new Da(607225278,1323610764),new Da(1426881987,3590304994),new Da(1925078388,4068182383),new Da(2162078206,991336113),new Da(2614888103,633803317),new Da(3248222580,3479774868),new Da(3835390401,2666613458),new Da(4022224774,944711139),new Da(264347078,2341262773),new Da(604807628,2007800933),new Da(770255983,1495990901),new Da(1249150122,1856431235),new Da(1555081692,3175218132),new Da(1996064986,2198950837),new Da(2554220882,3999719339),new Da(2821834349,766784016),new Da(2952996808,2566594879),new Da(3210313671,3203337956),new Da(3336571891,1034457026),new Da(3584528711,2466948901),new Da(113926993,3758326383),new Da(338241895,168717936),new Da(666307205,1188179964),new Da(773529912,1546045734),new Da(1294757372,1522805485),new Da(1396182291,2643833823),new Da(1695183700,2343527390),new Da(1986661051,1014477480),new Da(2177026350,1206759142),new Da(2456956037,344077627),new Da(2730485921,1290863460),new Da(2820302411,3158454273),new Da(3259730800,3505952657),new Da(3345764771,106217008),new Da(3516065817,3606008344),new Da(3600352804,1432725776),new Da(4094571909,1467031594),new Da(275423344,851169720),new Da(430227734,3100823752),new Da(506948616,1363258195),new Da(659060556,3750685593),new Da(883997877,3785050280),new Da(958139571,3318307427),new Da(1322822218,3812723403),new Da(1537002063,2003034995),new Da(1747873779,3602036899),new Da(1955562222,1575990012),new Da(2024104815,1125592928),new Da(2227730452,2716904306),new Da(2361852424,442776044),new Da(2428436474,593698344),new Da(2756734187,3733110249),new Da(3204031479,2999351573),new Da(3329325298,3815920427),new Da(3391569614,3928383900),new Da(3515267271,566280711),new Da(3940187606,3454069534),new Da(4118630271,4000239992),new Da(116418474,1914138554),new Da(174292421,2731055270),new Da(289380356,3203993006),new Da(460393269,320620315),new Da(685471733,587496836),new Da(852142971,1086792851),new Da(1017036298,365543100),new Da(1126000580,2618297676),new Da(1288033470,3409855158),new Da(1501505948,4234509866),new Da(1607167915,987167468),new Da(1816402316,1246189591)],_l=[];for(let t=0;t<80;t+=1)_l[t]=new Da;class $l extends Oa{constructor(){super(),this.blockSize=32}_doReset(){this._hash=new Fa([new Da(1779033703,4089235720),new Da(3144134277,2227873595),new Da(1013904242,4271175723),new Da(2773480762,1595750129),new Da(1359893119,2917565137),new Da(2600822924,725511199),new Da(528734635,4215389547),new Da(1541459225,327033209)])}_doProcessBlock(t,e){const i=this._hash.words,o=i[0],n=i[1],r=i[2],s=i[3],a=i[4],l=i[5],c=i[6],d=i[7],h=o.high;let u=o.low;const p=n.high;let v=n.low;const g=r.high;let f=r.low;const m=s.high;let w=s.low;const y=a.high;let b=a.low;const C=l.high;let x=l.low;const E=c.high;let k=c.low;const S=d.high;let A=d.low,M=h,T=u,I=p,_=v,$=g,N=f,O=m,L=w,R=y,D=b,F=C,P=x,j=E,V=k,U=S,B=A;for(let i=0;i<80;i+=1){let o,n;const r=_l[i];if(i<16)r.high=0|t[e+2*i],n=r.high,r.low=0|t[e+2*i+1],o=r.low;else{const t=_l[i-15],e=t.high,s=t.low,a=(e>>>1|s<<31)^(e>>>8|s<<24)^e>>>7,l=(s>>>1|e<<31)^(s>>>8|e<<24)^(s>>>7|e<<25),c=_l[i-2],d=c.high,h=c.low,u=(d>>>19|h<<13)^(d<<3|h>>>29)^d>>>6,p=(h>>>19|d<<13)^(h<<3|d>>>29)^(h>>>6|d<<26),v=_l[i-7],g=v.high,f=v.low,m=_l[i-16],w=m.high,y=m.low;o=l+f,n=a+g+(o>>>0<l>>>0?1:0),o+=p,n=n+u+(o>>>0<p>>>0?1:0),o+=y,n=n+w+(o>>>0<y>>>0?1:0),r.high=n,r.low=o}const s=R&F^~R&j,a=D&P^~D&V,l=M&I^M&$^I&$,c=T&_^T&N^_&N,d=(M>>>28|T<<4)^(M<<30|T>>>2)^(M<<25|T>>>7),h=(T>>>28|M<<4)^(T<<30|M>>>2)^(T<<25|M>>>7),u=(R>>>14|D<<18)^(R>>>18|D<<14)^(R<<23|D>>>9),p=(D>>>14|R<<18)^(D>>>18|R<<14)^(D<<23|R>>>9),v=Il[i],g=v.high,f=v.low;let m=B+p,w=U+u+(m>>>0<B>>>0?1:0);m+=a,w=w+s+(m>>>0<a>>>0?1:0),m+=f,w=w+g+(m>>>0<f>>>0?1:0),m+=o,w=w+n+(m>>>0<o>>>0?1:0);const y=h+c;U=j,B=V,j=F,V=P,F=R,P=D,D=L+m|0,R=O+w+(D>>>0<L>>>0?1:0)|0,O=$,L=N,$=I,N=_,I=M,_=T,T=m+y|0,M=w+(d+l+(y>>>0<h>>>0?1:0))+(T>>>0<m>>>0?1:0)|0}o.low=u+T,u=o.low,o.high=h+M+(u>>>0<T>>>0?1:0),n.low=v+_,v=n.low,n.high=p+I+(v>>>0<_>>>0?1:0),r.low=f+N,f=r.low,r.high=g+$+(f>>>0<N>>>0?1:0),s.low=w+L,w=s.low,s.high=m+O+(w>>>0<L>>>0?1:0),a.low=b+D,b=a.low,a.high=y+R+(b>>>0<D>>>0?1:0),l.low=x+P,x=l.low,l.high=C+F+(x>>>0<P>>>0?1:0),c.low=k+V,k=c.low,c.high=E+j+(k>>>0<V>>>0?1:0),d.low=A+B,A=d.low,d.high=S+U+(A>>>0<B>>>0?1:0)}_doFinalize(){const t=this._data,e=t.words,i=8*this._nDataBytes,o=8*t.sigBytes;e[o>>>5]|=128<<24-o%32,e[30+(o+128>>>10<<5)]=Math.floor(i/4294967296),e[31+(o+128>>>10<<5)]=i,t.sigBytes=4*e.length,this._process();return this._hash.toX32()}clone(){const t=super.clone.call(this);return t._hash=this._hash.clone(),t}}const Nl=Oa._createHelper($l),Ol=Oa._createHmacHelper($l);class Ll extends $l{_doReset(){this._hash=new Fa([new Da(3418070365,3238371032),new Da(1654270250,914150663),new Da(2438529370,812702999),new Da(355462360,4144912697),new Da(1731405415,4290775857),new Da(2394180231,1750603025),new Da(3675008525,1694076839),new Da(1203062813,3204075428)])}_doFinalize(){const t=super._doFinalize.call(this);return t.sigBytes-=16,t}}const Rl=$l._createHelper(Ll),Dl=$l._createHmacHelper(Ll),Fl=[],Pl=[],jl=[];let Vl=1,Ul=0;for(let t=0;t<24;t+=1){Fl[Vl+5*Ul]=(t+1)*(t+2)/2%64;const e=(2*Vl+3*Ul)%5;Vl=Ul%5,Ul=e}for(let t=0;t<5;t+=1)for(let e=0;e<5;e+=1)Pl[t+5*e]=e+(2*t+3*e)%5*5;let Bl=1;for(let t=0;t<24;t+=1){let e=0,i=0;for(let t=0;t<7;t+=1){if(1&Bl){const o=(1<<t)-1;o<32?i^=1<<o:e^=1<<o-32}128&Bl?Bl=Bl<<1^113:Bl<<=1}jl[t]=Da.create(e,i)}const zl=[];for(let t=0;t<25;t+=1)zl[t]=Da.create();class Hl extends Oa{constructor(t){super(Object.assign({outputLength:512},t))}_doReset(){this._state=[];const t=this._state;for(let e=0;e<25;e+=1)t[e]=new Da;this.blockSize=(1600-2*this.cfg.outputLength)/32}_doProcessBlock(t,e){const i=this._state,o=this.blockSize/2;for(let n=0;n<o;n+=1){let o=t[e+2*n],r=t[e+2*n+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8);const s=i[n];s.high^=r,s.low^=o}for(let t=0;t<24;t+=1){for(let t=0;t<5;t+=1){let e=0,o=0;for(let n=0;n<5;n+=1){const r=i[t+5*n];e^=r.high,o^=r.low}const n=zl[t];n.high=e,n.low=o}for(let t=0;t<5;t+=1){const e=zl[(t+4)%5],o=zl[(t+1)%5],n=o.high,r=o.low,s=e.high^(n<<1|r>>>31),a=e.low^(r<<1|n>>>31);for(let e=0;e<5;e+=1){const o=i[t+5*e];o.high^=s,o.low^=a}}for(let t=1;t<25;t+=1){let e,o;const n=i[t],r=n.high,s=n.low,a=Fl[t];a<32?(e=r<<a|s>>>32-a,o=s<<a|r>>>32-a):(e=s<<a-32|r>>>64-a,o=r<<a-32|s>>>64-a);const l=zl[Pl[t]];l.high=e,l.low=o}const e=zl[0],o=i[0];e.high=o.high,e.low=o.low;for(let t=0;t<5;t+=1)for(let e=0;e<5;e+=1){const o=t+5*e,n=i[o],r=zl[o],s=zl[(t+1)%5+5*e],a=zl[(t+2)%5+5*e];n.high=r.high^~s.high&a.high,n.low=r.low^~s.low&a.low}const n=i[0],r=jl[t];n.high^=r.high,n.low^=r.low}}_doFinalize(){const t=this._data,e=t.words,i=8*t.sigBytes,o=32*this.blockSize;e[i>>>5]|=1<<24-i%32,e[(Math.ceil((i+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*e.length,this._process();const n=this._state,r=this.cfg.outputLength/8,s=r/8,a=[];for(let t=0;t<s;t+=1){const e=n[t];let i=e.high,o=e.low;i=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),a.push(o),a.push(i)}return new Ta(a,r)}clone(){const t=super.clone.call(this);t._state=this._state.slice(0);const e=t._state;for(let t=0;t<25;t+=1)e[t]=e[t].clone();return t}}const Gl=Oa._createHelper(Hl),Wl=Oa._createHmacHelper(Hl),ql=Ta.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),Zl=Ta.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),Kl=Ta.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),Jl=Ta.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),Yl=Ta.create([0,1518500249,1859775393,2400959708,2840853838]),Ql=Ta.create([1352829926,1548603684,1836072691,2053994217,0]),Xl=(t,e,i)=>t^e^i,tc=(t,e,i)=>t&e|~t&i,ec=(t,e,i)=>(t|~e)^i,ic=(t,e,i)=>t&i|e&~i,oc=(t,e,i)=>t^(e|~i),nc=(t,e)=>t<<e|t>>>32-e;class rc extends Oa{_doReset(){this._hash=Ta.create([1732584193,4023233417,2562383102,271733878,3285377520])}_doProcessBlock(t,e){const i=t;for(let t=0;t<16;t+=1){const o=e+t,n=i[o];i[o]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}const o=this._hash.words,n=Yl.words,r=Ql.words,s=ql.words,a=Zl.words,l=Kl.words,c=Jl.words;let d,h=o[0],u=o[1],p=o[2],v=o[3],g=o[4],f=o[0],m=o[1],w=o[2],y=o[3],b=o[4];for(let t=0;t<80;t+=1)d=h+i[e+s[t]]|0,d+=t<16?Xl(u,p,v)+n[0]:t<32?tc(u,p,v)+n[1]:t<48?ec(u,p,v)+n[2]:t<64?ic(u,p,v)+n[3]:oc(u,p,v)+n[4],d|=0,d=nc(d,l[t]),d=d+g|0,h=g,g=v,v=nc(p,10),p=u,u=d,d=f+i[e+a[t]]|0,d+=t<16?oc(m,w,y)+r[0]:t<32?ic(m,w,y)+r[1]:t<48?ec(m,w,y)+r[2]:t<64?tc(m,w,y)+r[3]:Xl(m,w,y)+r[4],d|=0,d=nc(d,c[t]),d=d+b|0,f=b,b=y,y=nc(w,10),w=m,m=d;d=o[1]+p+y|0,o[1]=o[2]+v+b|0,o[2]=o[3]+g+f|0,o[3]=o[4]+h+m|0,o[4]=o[0]+u+w|0,o[0]=d}_doFinalize(){const t=this._data,e=t.words,i=8*this._nDataBytes,o=8*t.sigBytes;e[o>>>5]|=128<<24-o%32,e[14+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(e.length+1),this._process();const n=this._hash,r=n.words;for(let t=0;t<5;t+=1){const e=r[t];r[t]=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8)}return n}clone(){const t=super.clone.call(this);return t._hash=this._hash.clone(),t}}const sc=Oa._createHelper(rc),ac=Oa._createHmacHelper(rc);class lc extends Ma{constructor(t){super(),this.cfg=Object.assign(new Ma,{keySize:4,hasher:El,iterations:25e4},t)}compute(t,e){const{cfg:i}=this,o=La.create(i.hasher,t),n=Ta.create(),r=Ta.create([1]),s=n.words,a=r.words,{keySize:l,iterations:c}=i;for(;s.length<l;){const t=o.update(e).finalize(r);o.reset();const i=t.words,s=i.length;let l=t;for(let t=1;t<c;t+=1){l=o.finalize(l),o.reset();const t=l.words;for(let e=0;e<s;e+=1)i[e]^=t[e]}n.concat(t),a[0]+=1}return n.sigBytes=4*l,n}}const cc=[],dc=[],hc=[],uc=[],pc=[],vc=[],gc=[],fc=[],mc=[],wc=[],yc=[];for(let t=0;t<256;t+=1)yc[t]=t<128?t<<1:t<<1^283;let bc=0,Cc=0;for(let t=0;t<256;t+=1){let t=Cc^Cc<<1^Cc<<2^Cc<<3^Cc<<4;t=t>>>8^255&t^99,cc[bc]=t,dc[t]=bc;const e=yc[bc],i=yc[e],o=yc[i];let n=257*yc[t]^16843008*t;hc[bc]=n<<24|n>>>8,uc[bc]=n<<16|n>>>16,pc[bc]=n<<8|n>>>24,vc[bc]=n,n=16843009*o^65537*i^257*e^16843008*bc,gc[t]=n<<24|n>>>8,fc[t]=n<<16|n>>>16,mc[t]=n<<8|n>>>24,wc[t]=n,bc?(bc=e^yc[yc[yc[o^e]]],Cc^=yc[yc[Cc]]):(Cc=1,bc=Cc)}const xc=[0,1,2,4,8,16,32,64,128,27,54];class Ec extends el{_doReset(){let t;if(this._nRounds&&this._keyPriorReset===this._key)return;this._keyPriorReset=this._key;const e=this._keyPriorReset,i=e.words,o=e.sigBytes/4;this._nRounds=o+6;const n=4*(this._nRounds+1);this._keySchedule=[];const r=this._keySchedule;for(let e=0;e<n;e+=1)e<o?r[e]=i[e]:(t=r[e-1],e%o?o>6&&e%o==4&&(t=cc[t>>>24]<<24|cc[t>>>16&255]<<16|cc[t>>>8&255]<<8|cc[255&t]):(t=t<<8|t>>>24,t=cc[t>>>24]<<24|cc[t>>>16&255]<<16|cc[t>>>8&255]<<8|cc[255&t],t^=xc[e/o|0]<<24),r[e]=r[e-o]^t);this._invKeySchedule=[];const s=this._invKeySchedule;for(let e=0;e<n;e+=1){const i=n-e;t=e%4?r[i]:r[i-4],s[e]=e<4||i<=4?t:gc[cc[t>>>24]]^fc[cc[t>>>16&255]]^mc[cc[t>>>8&255]]^wc[cc[255&t]]}}encryptBlock(t,e){this._doCryptBlock(t,e,this._keySchedule,hc,uc,pc,vc,cc)}decryptBlock(t,e){const i=t;let o=i[e+1];i[e+1]=i[e+3],i[e+3]=o,this._doCryptBlock(i,e,this._invKeySchedule,gc,fc,mc,wc,dc),o=i[e+1],i[e+1]=i[e+3],i[e+3]=o}_doCryptBlock(t,e,i,o,n,r,s,a){const l=t,c=this._nRounds;let d=l[e]^i[0],h=l[e+1]^i[1],u=l[e+2]^i[2],p=l[e+3]^i[3],v=4;for(let t=1;t<c;t+=1){const t=o[d>>>24]^n[h>>>16&255]^r[u>>>8&255]^s[255&p]^i[v];v+=1;const e=o[h>>>24]^n[u>>>16&255]^r[p>>>8&255]^s[255&d]^i[v];v+=1;const a=o[u>>>24]^n[p>>>16&255]^r[d>>>8&255]^s[255&h]^i[v];v+=1;const l=o[p>>>24]^n[d>>>16&255]^r[h>>>8&255]^s[255&u]^i[v];v+=1,d=t,h=e,u=a,p=l}const g=(a[d>>>24]<<24|a[h>>>16&255]<<16|a[u>>>8&255]<<8|a[255&p])^i[v];v+=1;const f=(a[h>>>24]<<24|a[u>>>16&255]<<16|a[p>>>8&255]<<8|a[255&d])^i[v];v+=1;const m=(a[u>>>24]<<24|a[p>>>16&255]<<16|a[d>>>8&255]<<8|a[255&h])^i[v];v+=1;const w=(a[p>>>24]<<24|a[d>>>16&255]<<16|a[h>>>8&255]<<8|a[255&u])^i[v];v+=1,l[e]=g,l[e+1]=f,l[e+2]=m,l[e+3]=w}}Ec.keySize=8;const kc=el._createHelper(Ec),Sc=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],Ac=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],Mc=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],Tc=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],Ic=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679];function _c(t,e){const i=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=i,this._lBlock^=i<<t}function $c(t,e){const i=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=i,this._rBlock^=i<<t}class Nc extends el{constructor(t,e,i){super(t,e,i),this.blockSize=2}_doReset(){const t=this._key.words,e=[];for(let i=0;i<56;i+=1){const o=Sc[i]-1;e[i]=t[o>>>5]>>>31-o%32&1}this._subKeys=[];const i=this._subKeys;for(let t=0;t<16;t+=1){i[t]=[];const o=i[t],n=Mc[t];for(let t=0;t<24;t+=1)o[t/6|0]|=e[(Ac[t]-1+n)%28]<<31-t%6,o[4+(t/6|0)]|=e[28+(Ac[t+24]-1+n)%28]<<31-t%6;o[0]=o[0]<<1|o[0]>>>31;for(let t=1;t<7;t+=1)o[t]>>>=4*(t-1)+3;o[7]=o[7]<<5|o[7]>>>27}this._invSubKeys=[];const o=this._invSubKeys;for(let t=0;t<16;t+=1)o[t]=i[15-t]}encryptBlock(t,e){this._doCryptBlock(t,e,this._subKeys)}decryptBlock(t,e){this._doCryptBlock(t,e,this._invSubKeys)}_doCryptBlock(t,e,i){const o=t;this._lBlock=t[e],this._rBlock=t[e+1],_c.call(this,4,252645135),_c.call(this,16,65535),$c.call(this,2,858993459),$c.call(this,8,16711935),_c.call(this,1,1431655765);for(let t=0;t<16;t+=1){const e=i[t],o=this._lBlock,n=this._rBlock;let r=0;for(let t=0;t<8;t+=1)r|=Tc[t][((n^e[t])&Ic[t])>>>0];this._lBlock=n,this._rBlock=o^r}const n=this._lBlock;this._lBlock=this._rBlock,this._rBlock=n,_c.call(this,1,1431655765),$c.call(this,8,16711935),$c.call(this,2,858993459),_c.call(this,16,65535),_c.call(this,4,252645135),o[e]=this._lBlock,o[e+1]=this._rBlock}}Nc.keySize=2,Nc.ivSize=2;const Oc=el._createHelper(Nc);class Lc extends el{_doReset(){const t=this._key.words;if(2!==t.length&&4!==t.length&&t.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");const e=t.slice(0,2),i=t.length<4?t.slice(0,2):t.slice(2,4),o=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=Nc.createEncryptor(Ta.create(e)),this._des2=Nc.createEncryptor(Ta.create(i)),this._des3=Nc.createEncryptor(Ta.create(o))}encryptBlock(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)}decryptBlock(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)}}Lc.keySize=6,Lc.ivSize=2;const Rc=el._createHelper(Lc),Dc=[],Fc=[],Pc=[];function jc(){const t=this._X,e=this._C;for(let t=0;t<8;t+=1)Fc[t]=e[t];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<Fc[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<Fc[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<Fc[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<Fc[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<Fc[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<Fc[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<Fc[6]>>>0?1:0)|0,this._b=e[7]>>>0<Fc[7]>>>0?1:0;for(let i=0;i<8;i+=1){const o=t[i]+e[i],n=65535&o,r=o>>>16,s=((n*n>>>17)+n*r>>>15)+r*r,a=((4294901760&o)*o|0)+((65535&o)*o|0);Pc[i]=s^a}t[0]=Pc[0]+(Pc[7]<<16|Pc[7]>>>16)+(Pc[6]<<16|Pc[6]>>>16)|0,t[1]=Pc[1]+(Pc[0]<<8|Pc[0]>>>24)+Pc[7]|0,t[2]=Pc[2]+(Pc[1]<<16|Pc[1]>>>16)+(Pc[0]<<16|Pc[0]>>>16)|0,t[3]=Pc[3]+(Pc[2]<<8|Pc[2]>>>24)+Pc[1]|0,t[4]=Pc[4]+(Pc[3]<<16|Pc[3]>>>16)+(Pc[2]<<16|Pc[2]>>>16)|0,t[5]=Pc[5]+(Pc[4]<<8|Pc[4]>>>24)+Pc[3]|0,t[6]=Pc[6]+(Pc[5]<<16|Pc[5]>>>16)+(Pc[4]<<16|Pc[4]>>>16)|0,t[7]=Pc[7]+(Pc[6]<<8|Pc[6]>>>24)+Pc[5]|0}class Vc extends Ja{constructor(...t){super(...t),this.blockSize=4,this.ivSize=2}_doReset(){const t=this._key.words,{iv:e}=this.cfg;for(let e=0;e<4;e+=1)t[e]=16711935&(t[e]<<8|t[e]>>>24)|4278255360&(t[e]<<24|t[e]>>>8);this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16];const i=this._X;this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];const o=this._C;this._b=0;for(let t=0;t<4;t+=1)jc.call(this);for(let t=0;t<8;t+=1)o[t]^=i[t+4&7];if(e){const t=e.words,i=t[0],n=t[1],r=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),s=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),a=r>>>16|4294901760&s,l=s<<16|65535&r;o[0]^=r,o[1]^=a,o[2]^=s,o[3]^=l,o[4]^=r,o[5]^=a,o[6]^=s,o[7]^=l;for(let t=0;t<4;t+=1)jc.call(this)}}_doProcessBlock(t,e){const i=t,o=this._X;jc.call(this),Dc[0]=o[0]^o[5]>>>16^o[3]<<16,Dc[1]=o[2]^o[7]>>>16^o[5]<<16,Dc[2]=o[4]^o[1]>>>16^o[7]<<16,Dc[3]=o[6]^o[3]>>>16^o[1]<<16;for(let t=0;t<4;t+=1)Dc[t]=16711935&(Dc[t]<<8|Dc[t]>>>24)|4278255360&(Dc[t]<<24|Dc[t]>>>8),i[e+t]^=Dc[t]}}const Uc=Ja._createHelper(Vc),Bc=[],zc=[],Hc=[];function Gc(){const t=this._X,e=this._C;for(let t=0;t<8;t+=1)zc[t]=e[t];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<zc[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<zc[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<zc[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<zc[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<zc[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<zc[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<zc[6]>>>0?1:0)|0,this._b=e[7]>>>0<zc[7]>>>0?1:0;for(let i=0;i<8;i+=1){const o=t[i]+e[i],n=65535&o,r=o>>>16,s=((n*n>>>17)+n*r>>>15)+r*r,a=((4294901760&o)*o|0)+((65535&o)*o|0);Hc[i]=s^a}t[0]=Hc[0]+(Hc[7]<<16|Hc[7]>>>16)+(Hc[6]<<16|Hc[6]>>>16)|0,t[1]=Hc[1]+(Hc[0]<<8|Hc[0]>>>24)+Hc[7]|0,t[2]=Hc[2]+(Hc[1]<<16|Hc[1]>>>16)+(Hc[0]<<16|Hc[0]>>>16)|0,t[3]=Hc[3]+(Hc[2]<<8|Hc[2]>>>24)+Hc[1]|0,t[4]=Hc[4]+(Hc[3]<<16|Hc[3]>>>16)+(Hc[2]<<16|Hc[2]>>>16)|0,t[5]=Hc[5]+(Hc[4]<<8|Hc[4]>>>24)+Hc[3]|0,t[6]=Hc[6]+(Hc[5]<<16|Hc[5]>>>16)+(Hc[4]<<16|Hc[4]>>>16)|0,t[7]=Hc[7]+(Hc[6]<<8|Hc[6]>>>24)+Hc[5]|0}class Wc extends Ja{constructor(...t){super(...t),this.blockSize=4,this.ivSize=2}_doReset(){const t=this._key.words,{iv:e}=this.cfg;this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16];const i=this._X;this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];const o=this._C;this._b=0;for(let t=0;t<4;t+=1)Gc.call(this);for(let t=0;t<8;t+=1)o[t]^=i[t+4&7];if(e){const t=e.words,i=t[0],n=t[1],r=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),s=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),a=r>>>16|4294901760&s,l=s<<16|65535&r;o[0]^=r,o[1]^=a,o[2]^=s,o[3]^=l,o[4]^=r,o[5]^=a,o[6]^=s,o[7]^=l;for(let t=0;t<4;t+=1)Gc.call(this)}}_doProcessBlock(t,e){const i=t,o=this._X;Gc.call(this),Bc[0]=o[0]^o[5]>>>16^o[3]<<16,Bc[1]=o[2]^o[7]>>>16^o[5]<<16,Bc[2]=o[4]^o[1]>>>16^o[7]<<16,Bc[3]=o[6]^o[3]>>>16^o[1]<<16;for(let t=0;t<4;t+=1)Bc[t]=16711935&(Bc[t]<<8|Bc[t]>>>24)|4278255360&(Bc[t]<<24|Bc[t]>>>8),i[e+t]^=Bc[t]}}const qc=Ja._createHelper(Wc);function Zc(){const t=this._S;let e=this._i,i=this._j,o=0;for(let n=0;n<4;n+=1){e=(e+1)%256,i=(i+t[e])%256;const r=t[e];t[e]=t[i],t[i]=r,o|=t[(t[e]+t[i])%256]<<24-8*n}return this._i=e,this._j=i,o}class Kc extends Ja{_doReset(){const t=this._key,e=t.words,i=t.sigBytes;this._S=[];const o=this._S;for(let t=0;t<256;t+=1)o[t]=t;for(let t=0,n=0;t<256;t+=1){const r=t%i,s=e[r>>>2]>>>24-r%4*8&255;n=(n+o[t]+s)%256;const a=o[t];o[t]=o[n],o[n]=a}this._j=0,this._i=this._j}_doProcessBlock(t,e){t[e]^=Zc.call(this)}}Kc.keySize=8,Kc.ivSize=0;const Jc=Ja._createHelper(Kc);class Yc extends Kc{constructor(...t){super(...t),Object.assign(this.cfg,{drop:192})}_doReset(){super._doReset.call(this);for(let t=this.cfg.drop;t>0;t-=1)Zc.call(this)}}const Qc=Ja._createHelper(Yc),Xc=16,td=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],ed=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],id={pbox:[],sbox:[]};function od(t,e){const i=e>>24&255,o=e>>16&255,n=e>>8&255,r=255&e;let s=t.sbox[0][i]+t.sbox[1][o];return s^=t.sbox[2][n],s+=t.sbox[3][r],s}function nd(t,e,i){let o,n=e,r=i;for(let e=0;e<Xc;++e)n^=t.pbox[e],r=od(t,n)^r,o=n,n=r,r=o;return o=n,n=r,r=o,r^=t.pbox[Xc],n^=t.pbox[17],{left:n,right:r}}class rd extends el{constructor(t,e,i){super(t,e,i),this.blockSize=2}_doReset(){if(this._keyPriorReset===this._key)return;const t=this._keyPriorReset=this._key,e=t.words,i=t.sigBytes/4;!function(t,e,i){for(let e=0;e<4;e++){t.sbox[e]=[];for(let i=0;i<256;i++)t.sbox[e][i]=ed[e][i]}let o=0;for(let n=0;n<18;n++)t.pbox[n]=td[n]^e[o],o++,o>=i&&(o=0);let n=0,r=0,s=0;for(let e=0;e<18;e+=2)s=nd(t,n,r),n=s.left,r=s.right,t.pbox[e]=n,t.pbox[e+1]=r;for(let e=0;e<4;e++)for(let i=0;i<256;i+=2)s=nd(t,n,r),n=s.left,r=s.right,t.sbox[e][i]=n,t.sbox[e][i+1]=r}(id,e,i)}encryptBlock(t,e){const i=nd(id,t[e],t[e+1]);t[e]=i.left,t[e+1]=i.right}decryptBlock(t,e){const i=function(t,e,i){let o,n=e,r=i;for(let e=17;e>1;--e)n^=t.pbox[e],r=od(t,n)^r,o=n,n=r,r=o;return o=n,n=r,r=o,r^=t.pbox[1],n^=t.pbox[0],{left:n,right:r}}(id,t[e],t[e+1]);t[e]=i.left,t[e+1]=i.right}}rd.keySize=4,rd.ivSize=2;const sd=el._createHelper(rd);function ad(t,e,i,o){const n=t;let r;const s=this._iv;s?(r=s.slice(0),this._iv=void 0):r=this._prevBlock,o.encryptBlock(r,0);for(let t=0;t<i;t+=1)n[e+t]^=r[t]}class ld extends Ya{}ld.Encryptor=class extends ld{processBlock(t,e){const i=this._cipher,{blockSize:o}=i;ad.call(this,t,e,o,i),this._prevBlock=t.slice(e,e+o)}},ld.Decryptor=class extends ld{processBlock(t,e){const i=this._cipher,{blockSize:o}=i,n=t.slice(e,e+o);ad.call(this,t,e,o,i),this._prevBlock=n}};class cd extends Ya{}cd.Encryptor=class extends cd{processBlock(t,e){const i=t,o=this._cipher,{blockSize:n}=o,r=this._iv;let s=this._counter;r&&(this._counter=r.slice(0),s=this._counter,this._iv=void 0);const a=s.slice(0);o.encryptBlock(a,0),s[n-1]=s[n-1]+1|0;for(let t=0;t<n;t+=1)i[e+t]^=a[t]}},cd.Decryptor=cd.Encryptor;const dd=t=>{let e=t;if(255&~(t>>24))e+=1<<24;else{let i=t>>16&255,o=t>>8&255,n=255&t;255===i?(i=0,255===o?(o=0,255===n?n=0:n+=1):o+=1):i+=1,e=0,e+=i<<16,e+=o<<8,e+=n}return e};
1554
1554
  /** @preserve
1555
1555
  * Counter block mode compatible with Dr Brian Gladman fileenc.c
1556
1556
  * derived from CryptoJS.mode.CTR
1557
1557
  * Jan Hruby jhruby.web@gmail.com
1558
1558
  */
1559
- class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o=this._cipher,{blockSize:n}=o,r=this._iv;let s=this._counter;r&&(this._counter=r.slice(0),s=this._counter,this._iv=void 0),(t=>{const e=t;e[0]=cd(e[0]),0===e[0]&&(e[1]=cd(e[1]))})(s);const a=s.slice(0);o.encryptBlock(a,0);for(let t=0;t<n;t+=1)i[e+t]^=a[t]}},dd.Decryptor=dd.Encryptor;class hd extends Ja{}hd.Encryptor=class extends hd{processBlock(t,e){this._cipher.encryptBlock(t,e)}},hd.Decryptor=class extends hd{processBlock(t,e){this._cipher.decryptBlock(t,e)}};class ud extends Ja{}ud.Encryptor=class extends ud{processBlock(t,e){const i=t,o=this._cipher,{blockSize:n}=o,r=this._iv;let s=this._keystream;r&&(this._keystream=r.slice(0),s=this._keystream,this._iv=void 0),o.encryptBlock(s,0);for(let t=0;t<n;t+=1)i[e+t]^=s[t]}},ud.Decryptor=ud.Encryptor;const pd={pad(t,e){const i=t,o=i.sigBytes,n=4*e,r=n-o%n,s=o+r-1;i.clamp(),i.words[s>>>2]|=r<<24-s%4*8,i.sigBytes+=r},unpad(t){const e=t,i=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=i}},vd={pad(t,e){const i=4*e,o=i-t.sigBytes%i;t.concat(Aa.random(o-1)).concat(Aa.create([o<<24],1))},unpad(t){const e=t,i=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=i}},gd={pad(t,e){const i=t,o=4*e;i.clamp(),i.sigBytes+=o-(t.sigBytes%o||o)},unpad(t){const e=t,i=e.words;for(let t=e.sigBytes-1;t>=0;t-=1)if(i[t>>>2]>>>24-t%4*8&255){e.sigBytes=t+1;break}}},fd={pad(t,e){t.concat(Aa.create([2147483648],1)),gd.pad(t,e)},unpad(t){const e=t;gd.unpad(e),e.sigBytes-=1}},md={pad(){},unpad(){}},wd={stringify:t=>t.ciphertext.toString(Ta),parse(t){const e=Ta.parse(t);return el.create({ciphertext:e})}};var yd={lib:{Base:Ma,WordArray:Aa,BufferedBlockAlgorithm:$a,Hasher:Na,Cipher:Za,StreamCipher:Ka,BlockCipherMode:Ja,BlockCipher:tl,CipherParams:el,SerializableCipher:ol,PasswordBasedCipher:rl},x64:{Word:Ra,WordArray:Da},enc:{Hex:Ta,Latin1:Ia,Utf8:_a,Utf16:ll,Utf16BE:al,Utf16LE:cl,Base64:Pa,Base64url:dl},algo:{HMAC:Oa,MD5:Ha,SHA1:ul,SHA224:Sl,SHA256:xl,SHA384:Ol,SHA512:_l,SHA3:zl,RIPEMD160:nc,PBKDF2:ac,EvpKDF:qa,AES:xc,DES:$c,TripleDES:Oc,Rabbit:jc,RabbitLegacy:Gc,RC4:Zc,RC4Drop:Jc,Blowfish:nd},mode:{CBC:Qa,CFB:ad,CTR:ld,CTRGladman:dd,ECB:hd,OFB:ud},pad:{Pkcs7:Xa,AnsiX923:pd,Iso10126:vd,Iso97971:fd,NoPadding:md,ZeroPadding:gd},format:{OpenSSL:il,Hex:wd},kdf:{OpenSSL:nl},MD5:Ga,HmacMD5:Wa,SHA1:pl,HmacSHA1:vl,SHA224:Ml,HmacSHA224:Al,SHA256:El,HmacSHA256:kl,SHA384:Ll,HmacSHA384:Rl,SHA512:$l,HmacSHA512:Nl,SHA3:Hl,HmacSHA3:Gl,RIPEMD160:rc,HmacRIPEMD160:sc,PBKDF2:(t,e,i)=>ac.create(i).compute(t,e),EvpKDF:(t,e,i)=>qa.create(i).compute(t,e),AES:Ec,DES:Nc,TripleDES:Lc,Rabbit:Vc,RabbitLegacy:Wc,RC4:Kc,RC4Drop:Yc,Blowfish:rd};const bd=(t,e=0)=>{try{let i=3735928559^e,o=1103547991^e;for(let e,n=0;n<t.length;n++)e=t.charCodeAt(n),i=Math.imul(i^e,2654435761),o=Math.imul(o^e,1597334677);return i=Math.imul(i^i>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),4294967296*(2097151&o)+(i>>>0)}catch(t){return console.warn("Error in cyrb53: ",t),oh("Error in cyrb53: ",t),0}},Cd=t=>{try{return"object"!=typeof t?Object.assign({},...Object.keys(t).sort().map((e=>({[e]:t[e]&&"object"==typeof t[e]?Cd(t[e]):t[e]})))):t}catch(e){return t}},xd=t=>{let e;return e=t.includes("http")?new URL(t):new URL("http://"+t),e.hostname.replace("www.","")},Ed=t=>{try{const e=Cd(t);return bd(JSON.stringify(e))}catch(t){return}};function kd(t){try{const e=localStorage.getItem(t);if(!e)return null;try{return JSON.parse(e)}catch(t){return e}}catch(t){return console.warn("Error in getLocalStorage: ",t),null}}const Sd=(t,e,i=!1,o="localStorage")=>{try{const n=i?btoa(e):e;"localStorage"===o?localStorage.setItem(t,n):sessionStorage.setItem(t,n)}catch(t){console.warn("Error in setLocalStorage: ",t),oh("Error in setLocalStorage: ",t)}},Md=(t,e=!1,i="localStorage")=>{try{let o=null;return o="localStorage"===i?localStorage.getItem(t):sessionStorage.getItem(t),o&&e?atob(o):o}catch(t){return console.warn("Error in getLocalStorage: ",t),oh("Error in getLocalStorage: ",t),null}},Ad=(t,e="localStorage")=>{try{"localStorage"===e?localStorage.removeItem(t):sessionStorage.removeItem(t)}catch(t){console.warn("Error in removeLocalStorageData: ",t),oh("Error in removeLocalStorageData: ",t)}},Td=(...t)=>{if(t)switch(t.length){case 1:return l`calc(${t[0]}rem * var(--velt-base-rem-unit, 1))`;case 2:return l`calc(${t[0]}rem * var(--velt-base-rem-unit, 1)) calc(${t[1]}rem * var(--velt-base-rem-unit, 1))`;case 3:return l`calc(${t[0]}rem * var(--velt-base-rem-unit, 1)) calc(${t[1]}rem * var(--velt-base-rem-unit, 1))
1559
+ class hd extends Ya{}hd.Encryptor=class extends hd{processBlock(t,e){const i=t,o=this._cipher,{blockSize:n}=o,r=this._iv;let s=this._counter;r&&(this._counter=r.slice(0),s=this._counter,this._iv=void 0),(t=>{const e=t;e[0]=dd(e[0]),0===e[0]&&(e[1]=dd(e[1]))})(s);const a=s.slice(0);o.encryptBlock(a,0);for(let t=0;t<n;t+=1)i[e+t]^=a[t]}},hd.Decryptor=hd.Encryptor;class ud extends Ya{}ud.Encryptor=class extends ud{processBlock(t,e){this._cipher.encryptBlock(t,e)}},ud.Decryptor=class extends ud{processBlock(t,e){this._cipher.decryptBlock(t,e)}};class pd extends Ya{}pd.Encryptor=class extends pd{processBlock(t,e){const i=t,o=this._cipher,{blockSize:n}=o,r=this._iv;let s=this._keystream;r&&(this._keystream=r.slice(0),s=this._keystream,this._iv=void 0),o.encryptBlock(s,0);for(let t=0;t<n;t+=1)i[e+t]^=s[t]}},pd.Decryptor=pd.Encryptor;const vd={pad(t,e){const i=t,o=i.sigBytes,n=4*e,r=n-o%n,s=o+r-1;i.clamp(),i.words[s>>>2]|=r<<24-s%4*8,i.sigBytes+=r},unpad(t){const e=t,i=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=i}},gd={pad(t,e){const i=4*e,o=i-t.sigBytes%i;t.concat(Ta.random(o-1)).concat(Ta.create([o<<24],1))},unpad(t){const e=t,i=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=i}},fd={pad(t,e){const i=t,o=4*e;i.clamp(),i.sigBytes+=o-(t.sigBytes%o||o)},unpad(t){const e=t,i=e.words;for(let t=e.sigBytes-1;t>=0;t-=1)if(i[t>>>2]>>>24-t%4*8&255){e.sigBytes=t+1;break}}},md={pad(t,e){t.concat(Ta.create([2147483648],1)),fd.pad(t,e)},unpad(t){const e=t;fd.unpad(e),e.sigBytes-=1}},wd={pad(){},unpad(){}},yd={stringify:t=>t.ciphertext.toString(Ia),parse(t){const e=Ia.parse(t);return il.create({ciphertext:e})}};var bd={lib:{Base:Ma,WordArray:Ta,BufferedBlockAlgorithm:Na,Hasher:Oa,Cipher:Ka,StreamCipher:Ja,BlockCipherMode:Ya,BlockCipher:el,CipherParams:il,SerializableCipher:nl,PasswordBasedCipher:sl},x64:{Word:Da,WordArray:Fa},enc:{Hex:Ia,Latin1:_a,Utf8:$a,Utf16:cl,Utf16BE:ll,Utf16LE:dl,Base64:ja,Base64url:hl},algo:{HMAC:La,MD5:Ga,SHA1:pl,SHA224:Al,SHA256:El,SHA384:Ll,SHA512:$l,SHA3:Hl,RIPEMD160:rc,PBKDF2:lc,EvpKDF:Za,AES:Ec,DES:Nc,TripleDES:Lc,Rabbit:Vc,RabbitLegacy:Wc,RC4:Kc,RC4Drop:Yc,Blowfish:rd},mode:{CBC:Xa,CFB:ld,CTR:cd,CTRGladman:hd,ECB:ud,OFB:pd},pad:{Pkcs7:tl,AnsiX923:vd,Iso10126:gd,Iso97971:md,NoPadding:wd,ZeroPadding:fd},format:{OpenSSL:ol,Hex:yd},kdf:{OpenSSL:rl},MD5:Wa,HmacMD5:qa,SHA1:vl,HmacSHA1:gl,SHA224:Ml,HmacSHA224:Tl,SHA256:kl,HmacSHA256:Sl,SHA384:Rl,HmacSHA384:Dl,SHA512:Nl,HmacSHA512:Ol,SHA3:Gl,HmacSHA3:Wl,RIPEMD160:sc,HmacRIPEMD160:ac,PBKDF2:(t,e,i)=>lc.create(i).compute(t,e),EvpKDF:(t,e,i)=>Za.create(i).compute(t,e),AES:kc,DES:Oc,TripleDES:Rc,Rabbit:Uc,RabbitLegacy:qc,RC4:Jc,RC4Drop:Qc,Blowfish:sd};const Cd=(t,e=0)=>{try{let i=3735928559^e,o=1103547991^e;for(let e,n=0;n<t.length;n++)e=t.charCodeAt(n),i=Math.imul(i^e,2654435761),o=Math.imul(o^e,1597334677);return i=Math.imul(i^i>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),4294967296*(2097151&o)+(i>>>0)}catch(t){return console.warn("Error in cyrb53: ",t),nh("Error in cyrb53: ",t),0}},xd=t=>{try{return"object"!=typeof t?Object.assign({},...Object.keys(t).sort().map((e=>({[e]:t[e]&&"object"==typeof t[e]?xd(t[e]):t[e]})))):t}catch(e){return t}},Ed=t=>{let e;return e=t.includes("http")?new URL(t):new URL("http://"+t),e.hostname.replace("www.","")},kd=t=>{try{const e=xd(t);return Cd(JSON.stringify(e))}catch(t){return}};function Sd(t){try{const e=localStorage.getItem(t);if(!e)return null;try{return JSON.parse(e)}catch(t){return e}}catch(t){return console.warn("Error in getLocalStorage: ",t),null}}const Ad=(t,e,i=!1,o="localStorage")=>{try{const n=i?btoa(e):e;"localStorage"===o?localStorage.setItem(t,n):sessionStorage.setItem(t,n)}catch(t){console.warn("Error in setLocalStorage: ",t),nh("Error in setLocalStorage: ",t)}},Md=(t,e=!1,i="localStorage")=>{try{let o=null;return o="localStorage"===i?localStorage.getItem(t):sessionStorage.getItem(t),o&&e?atob(o):o}catch(t){return console.warn("Error in getLocalStorage: ",t),nh("Error in getLocalStorage: ",t),null}},Td=(t,e="localStorage")=>{try{"localStorage"===e?localStorage.removeItem(t):sessionStorage.removeItem(t)}catch(t){console.warn("Error in removeLocalStorageData: ",t),nh("Error in removeLocalStorageData: ",t)}},Id=(...t)=>{if(t)switch(t.length){case 1:return l`calc(${t[0]}rem * var(--velt-base-rem-unit, 1))`;case 2:return l`calc(${t[0]}rem * var(--velt-base-rem-unit, 1)) calc(${t[1]}rem * var(--velt-base-rem-unit, 1))`;case 3:return l`calc(${t[0]}rem * var(--velt-base-rem-unit, 1)) calc(${t[1]}rem * var(--velt-base-rem-unit, 1))
1560
1560
  calc(${t[2]}rem * var(--velt-base-rem-unit, 1))`;case 4:return l`calc(${t[0]}rem * var(--velt-base-rem-unit, 1)) calc(${t[1]}rem * var(--velt-base-rem-unit, 1))
1561
- calc(${t[2]}rem * var(--velt-base-rem-unit, 1)) calc(${t[3]}rem * var(--velt-base-rem-unit, 1))`}return l`0`},Id=(t,e,i)=>{try{const o=yd.enc.Utf8.parse(e),n=yd.enc.Utf8.parse(i);return yd.AES.encrypt(yd.enc.Utf8.parse(t),o,{keySize:32,iv:n,mode:yd.mode.CBC,padding:yd.pad.Pkcs7}).toString()}catch(e){return console.warn("Error in encrypt: ",e),oh("Error in encrypt: ",e),t}},_d=(t,e,i)=>{try{const o=yd.enc.Utf8.parse(e),n=yd.enc.Utf8.parse(i);return yd.AES.decrypt(t,o,{keySize:32,iv:n,mode:yd.mode.CBC,padding:yd.pad.Pkcs7}).toString(yd.enc.Utf8)}catch(t){return console.warn("Error in decrypt: ",t),oh("Error in decrypt: ",t),null}},$d=()=>{try{const t=Md(Qt,!0);if(t){const e=_d(t,Ye,Qe);if(e)return JSON.parse(e);console.warn("Error in getUserFromToken: ","Invalid token."),Ad(Qt),Ud()}else{const t=Md(Jt,!0);if(t)return Nd(),JSON.parse(t)}return null}catch(t){return console.warn("Error in getUserFromToken: ",t),oh("Error in getUserFromToken: ",t),null}},Nd=()=>{try{const t=Md(Jt,!0);if(t){const e=Id(t,Ye,Qe);Sd(Qt,e,!0)}Ad(Jt)}catch(t){console.warn("Error in moveSnippylyUserToST: ",t),oh("Error in moveSnippylyUserToST: ",t)}},Od=(t=!0,e)=>{try{const i=Md(te,!0);if(i){const t=_d(i,Ye,Qe);return t?JSON.parse(t):null}if(t){const t=De,i=t[Math.floor(Math.random()*t.length)],o=i.name,n=i.photoUrl,r={name:o,email:"guest@usesuperflow.com",userId:Math.floor(1e9*Math.random())+"",photoUrl:n,isGuest:!0,organizationId:e},s=JSON.stringify(r),a=Id(s,Ye,Qe);return Sd(te,a,!0),r}return null}catch(t){return console.warn("Error in getGuestUser: ",t),oh("Error in getGuestUser: ",t),null}},Ld=(t,e)=>{try{return Object.prototype.toString.call(t)===Object.prototype.toString.call(e)&&("[object Object]"===Object.prototype.toString.call(t)||"[object Array]"===Object.prototype.toString.call(t)?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).every((i=>Ld(t[i],e[i]))):t===e)}catch(t){return console.error("Error in deepCompare: ",t),!1}},Rd=["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"],Dd=(t,e,i=!0)=>{try{return!e&&(!!i&&!(t=>{var e;try{return!t||"not-found"!==t.status&&("error"===t.status||!1!==(null===(e=t.config)||void 0===e?void 0:e.isValidProject))}catch(t){return!0}})(t))}catch(t){return!1}},Fd=t=>{try{return"https:"===(null==t?void 0:t.protocol)&&(t=>{try{const e=(t||"").toLowerCase().replace(/\.$/,"");return Ht.some((t=>e.endsWith(`.${t}`)&&Gt.test(e.slice(0,-(t.length+1)))))}catch(t){return console.warn("Error in isLivePreviewHost: ",t),!1}})((null==t?void 0:t.hostname)||"")}catch(t){return console.warn("Error in isLivePreviewLocation: ",t),!1}},Pd=t=>{try{if(!t)return null;const e=new URL(t);if(Fd(e))return e.pathname||"/";return zt.some((({hostSuffix:t,pathPrefix:i})=>(e.hostname===t||e.hostname.endsWith(`.${t}`))&&e.pathname.startsWith(i)))?e.searchParams.get("spath"):null}catch(t){return console.warn("Error in extractPreviewProxyPath: ",t),null}},jd=({loc:t=window.location,win:e=window,now:i=Date.now()}={})=>{try{if(!Fd(t))return null;const o=null==e?void 0:e[He],n=null==o?void 0:o.token,r=null==o?void 0:o.user,s=null==r?void 0:r.userId;if("string"!=typeof n||!n||"string"!=typeof s||!s)return null;const a=Number(null==o?void 0:o.expiresAt);if(!Number.isFinite(a)||a<=i)return null;const l=t=>"string"==typeof t?t:"";return{token:n,expiresAt:a,user:{userId:s,name:l(null==r?void 0:r.name)||l(null==r?void 0:r.email)||"Guest",email:l(null==r?void 0:r.email),...l(null==r?void 0:r.photoUrl)?{photoUrl:l(null==r?void 0:r.photoUrl)}:{},...!0===(null==r?void 0:r.isGuest)?{isGuest:!0}:{}}}}catch(t){return console.warn("Error in readLivePreviewSignIn: ",t),null}},Vd=({userId:t,now:e=Date.now()}={})=>{try{const i=Md(Xt,!0);if("string"!=typeof i||!i)return null;const o=(t=>{try{const e="string"==typeof t?t.split("."):[];if(3!==e.length||!e[1])return null;const i=e[1].replace(/-/g,"+").replace(/_/g,"/"),o=i+"=".repeat((4-i.length%4)%4),n=Uint8Array.from(atob(o),(t=>t.charCodeAt(0))),r=JSON.parse((new TextDecoder).decode(n));return r&&"object"==typeof r&&!Array.isArray(r)?r:null}catch(t){return console.warn("Error in decodeJwtPayload: ",t),null}})(i),n="number"==typeof(null==o?void 0:o.exp)&&1e3*o.exp<=e+6e4,r=void 0!==t&&(null==o?void 0:o.uid)!==t;return!o||n||r?(Ud(),null):i}catch(t){return console.warn("Error in getStoredUserCredential: ",t),null}},Ud=()=>{try{Ad(Xt)}catch(t){console.warn("Error in clearStoredUserCredential: ",t)}},Bd="Request a change",zd="Requests",Hd="Sign out",Gd="Signed in as";function Wd(t){try{const e=t&&"object"==typeof t?t:{},i="string"==typeof e.maintenanceRequestsLabel?e.maintenanceRequestsLabel.trim():"";return{enabled:!0===e.maintenanceRequests,label:i}}catch(t){return console.warn("Error in readMaintenanceRequests: ",t),{enabled:!1,label:""}}}const qd="[superflow request mode] notifyRequest";const Zd=ln({apiKey:"AIzaSyAzcW2n1JhY_zhkXmuFcwe550AkwmYeJ0w",projectId:"snipply-sdk-staging",messagingSenderId:"877538579326",appId:"1:877538579326:web:f793f73f2b7dc770c4992f"}),Kd=function(t=cn(),e=In){const i=on(Gi(t),kn).getImmediate({identifier:e}),o=(t=>{const e=Ni(t);if(!e)return;const i=e.lastIndexOf(":");if(i<=0||i+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const o=parseInt(e.substring(i+1),10);return"["===e[0]?[e.substring(1,i-1),o]:[e.substring(0,i),o]})("functions");return o&&function(t,e,i){!function(t,e,i){t.emulatorOrigin=`http://${e}:${i}`}(Gi(t),e,i)}(i,...o),i}(Zd);let Jd,Yd={sourcePlatform:"superflowToolbar"},Qd={};const Xd=()=>new Promise(((t,e)=>{const i=Ca(Zd).onAuthStateChanged((o=>{i(),o?t(o):e("No user is currently signed in.")}),e)})),th=(t={})=>{Yd={...Yd,...t}},eh=t=>{Jd=t},ih=t=>{var e,i,o,n,r,s,a,l,c,d,h,u;const p={properties:{apiKey:null!==(e=null==Yd?void 0:Yd.apiKey)&&void 0!==e?e:"",name:null!==(i=null==t?void 0:t.name)&&void 0!==i?i:"",firstName:(null==t?void 0:t.name)?null===(o=null==t?void 0:t.name)||void 0===o?void 0:o.split(" ")[0]:"",lastName:(null==t?void 0:t.name)?null===(n=null==t?void 0:t.name)||void 0===n?void 0:n.split(" ")[1]:"",email:null!==(r=null==t?void 0:t.email)&&void 0!==r?r:"",clientUserId:null!==(s=null==t?void 0:t.userId)&&void 0!==s?s:"",snippylyUserId:null!==(a=null==t?void 0:t.userSnippylyId)&&void 0!==a?a:"",groupId:null!==(l=null==t?void 0:t.groupId)&&void 0!==l?l:"",isOwner:"",plan:"",sdkVersion:null!==(c=null==Yd?void 0:Yd.sdkVersion)&&void 0!==c?c:"",sdkType:null!==(d=null==Yd?void 0:Yd.sdkType)&&void 0!==d?d:"",sourcePlatform:null!==(h=null==Yd?void 0:Yd.sourcePlatform)&&void 0!==h?h:"",website:null===(u=null===window||void 0===window?void 0:window.location)||void 0===u?void 0:u.href},context:{userAgent:null===navigator||void 0===navigator?void 0:navigator.userAgent},userId:null==t?void 0:t.userSnippylyId,sf:!0};rh("identify",p)},oh=(t,e,i={})=>{const o={error:t,message:(null==e?void 0:e.message)||e||t,...i};nh("error",o)},nh=(t,e={},i=!0)=>{try{if(null==Jd?void 0:Jd.userSnippylyId){e=i?{...Yd,...e}:e,e={...e};const o={userId:null==Jd?void 0:Jd.userSnippylyId,event:t,properties:e,sf:!0};rh("track",o)}else console.warn("Untracked event: ",t,e)}catch(t){console.warn("Error in trackEvent: ",t)}},rh=(t,e)=>{try{Fn(Kd,Xe,{timeout:12e5})({type:t,data:e})}catch(t){console.warn("Error in setAnalytics: ",t)}},sh=async(t,e)=>{try{const i=Fn(Kd,ti,{timeout:12e5});await i({eventType:"checkDomainWhitelisted",apiKey:t,projectId:e})}catch(t){console.warn("Error in checkDomainWhitelisted: ",t)}},ah=async(t,e,i,o)=>{try{Ea("[Superflow][iam] request",{eventType:"iam",apiKey:t,projectId:e,email:i,userId:o});const n=Fn(Kd,ti,{timeout:12e5}),r=await n({eventType:"iam",apiKey:t,projectId:e,email:i,userId:o});return Ea("[Superflow][iam] response",null==r?void 0:r.data),null==r?void 0:r.data}catch(t){return console.warn("Error in iam: ",t),null}},lh=async(t,e)=>{var i;try{const o=Fn(Kd,ti,{timeout:12e5}),n=await o({eventType:"getProjectConfig",apiKey:t,projectId:e});return{status:"ok",config:null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data}}catch(t){return(t=>{try{const e="string"==typeof(null==t?void 0:t.code)?t.code.toLowerCase():"";return"functions/not-found"===e||"not-found"===e}catch(t){return!1}})(t)?(console.warn("getProjectConfig: project document not found for projectId: ",e),{status:"not-found"}):(console.warn("Error in getProjectConfig: ",t),{status:"error"})}},ch=async(t,e,i)=>{var o;try{const n=Fn(Kd,ti,{timeout:12e5}),r=await n({eventType:"validatePassword",apiKey:t,projectId:e,password:i});return null===(o=null==r?void 0:r.data)||void 0===o?void 0:o.data}catch(t){return console.warn("Error in validatePassword: ",t),null}},dh=async(t,e,i)=>{var o;try{const n=Fn(Kd,ti,{timeout:12e5}),r=await n({eventType:"checkToolbarEnabled",apiKey:t,projectId:e,url:i});return null===(o=null==r?void 0:r.data)||void 0===o?void 0:o.data}catch(t){return console.warn("Error in checkToolbarEnabled: ",t),null}},hh=async t=>{try{const e=Fn(Kd,ti,{timeout:12e5}),i=await e({eventType:"getCustomerMetadata",apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}},uh=async t=>{try{const e=Fn(Kd,ti,{timeout:12e5}),i=await e({eventType:"customStatus",subEventType:"getOrgStatuses",apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getOrgStatuses: ",t),null}},ph=async(t,e,i,o)=>{var n,r;try{const s=Fn(Kd,ti,{timeout:12e5}),a=await s({eventType:"generateSuperflowAuthToken",apiKey:t,userId:e,userProperties:i,...o?{credential:o}:{}}),l=null===(n=null==a?void 0:a.data)||void 0===n?void 0:n.data;return{token:null!==(r=null==l?void 0:l.token)&&void 0!==r?r:null,..."boolean"==typeof(null==l?void 0:l.isAdmin)?{isAdmin:l.isAdmin}:{}}}catch(t){return console.warn("Error in generateSuperflowAuthToken: ",t),{token:null}}},vh=async(t,e,i,o,n,r)=>{try{const s=Fn(Kd,ti,{timeout:12e5}),a=await s({eventType:"userMigration",apiKey:t,projectId:e,oldUser:i,newUser:o,deleteGuestUserFlag:n,...r?{credential:r}:{}});return null==a?void 0:a.data}catch(t){return console.warn("Error in usermigration: ",t),null}},gh=t=>Fn(Kd,ti,{timeout:12e5})({eventType:"customLoginEnabled",apiKey:t}),fh=async t=>{var e;try{const i=Fn(Kd,ti,{timeout:12e5}),o=await i({eventType:"saml",samlEventType:"getPublicConfig",apiKey:t});return null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.publicConfig}catch(t){return console.warn("Error in getSamlPublicConfig: ",t),null}},mh=async(t,e)=>{var i;try{const o=await Xd();if(!o)throw new Error("User must be authenticated to create admin users");const n=window.Velt?await(null===(i=window.Velt)||void 0===i?void 0:i.getUser()):null,r=(null==o?void 0:o.displayName)||(null==n?void 0:n.name)||(null==n?void 0:n.email)||"",s=Fn(Kd,ti,{timeout:12e5}),a=await s({eventType:"createAdminUser",apiKey:t,users:e,inviterName:r});return null==a?void 0:a.data}catch(t){throw console.warn("Error in createAdminUser: ",t),t}},wh=async(t,e,i)=>{var o;try{const n=await Xd();if(!n)throw new Error("User must be authenticated to create project users");const r=window.Velt?await(null===(o=window.Velt)||void 0===o?void 0:o.getUser()):null,s=(null==n?void 0:n.displayName)||(null==r?void 0:r.name)||(null==r?void 0:r.email)||"",a=Fn(Kd,ti,{timeout:12e5}),l=await a({eventType:"createProjectUser",apiKey:t,documentId:e,users:i,inviterName:s});return null==l?void 0:l.data}catch(t){throw console.warn("Error in createProjectUser: ",t),t}},yh=async(t,e,i,o,n,r)=>{try{const s=Fn(Kd,ti,{timeout:12e5}),a=await s({eventType:"checkDocumentUserAndCreate",apiKey:t,documentId:e,userId:i,name:o,email:n,...r?{credential:r}:{}});return null==a?void 0:a.data}catch(t){throw console.warn("Error in checkDocumentUserAndCreate: ",t),t}};var bh;!function(t){t.WorkspaceUserSeats="workspaceUserSeats",t.Storage="storage",t.Agents="agents",t.WorkspacePrivateComments="privateComments"}(bh||(bh={}));const Ch=async t=>{var e,i;try{const o=Fn(Kd,ti,{timeout:12e5}),n=await o({eventType:"getFeatureAccess",apiKey:t});return{status:"ok",featureAccess:null!==(i=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.data)&&void 0!==i?i:null}}catch(t){return console.warn("Error in getFeatureAccess: ",t),{status:"error"}}},xh=async t=>{var e;try{const i=Fn(Kd,ti,{timeout:12e5}),o=await i({eventType:"getQrCode",text:t}),n=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.qrcode;return n?{status:"ok",qrcode:n}:{status:"error"}}catch(t){return console.warn("Error in fetchQRCode: ",t),{status:"error"}}},Eh=async(t,e,i,o,n,r)=>{try{const s=Fn(Kd,ti,{timeout:12e5}),a=await s({eventType:"acceptAgentSuggestion",apiKey:t,organizationId:e,documentId:i,annotationId:o,user:n,...r?{credential:r}:{}});return null==a?void 0:a.data}catch(t){return console.warn("Error in acceptAgentSuggestion: ",t),oh("Error in acceptAgentSuggestion: ",t),null}},kh=async({apiKey:t,documentId:e,user:i,comment:o})=>{try{const n=Fn(Kd,ti,{timeout:12e5}),r=await n({eventType:"approveProject",apiKey:t,documentId:e,user:i,...o?{comment:o}:{}}),s=null==r?void 0:r.data;return(null==s?void 0:s.success)&&(null==s?void 0:s.data)?s.data:null}catch(t){return console.warn("Error in approveProject: ",t),oh("Error in approveProject: ",t),null}},Sh=async({apiKey:t,documentId:e,annotationId:i,user:o})=>{try{const n=Fn(Kd,ti,{timeout:6e4}),r=await n({eventType:"notifyRequest",apiKey:t,documentId:e,annotationId:i,user:o});return function(t){try{const e=t&&"object"==typeof t?t:null;if(!e)return{kind:"transport"};const i=e.data&&"object"==typeof e.data&&"notified"in e.data?e.data:e;return"notified"in i?{kind:"ok",notified:!0===i.notified,reason:"string"==typeof i.reason?i.reason:null}:{kind:"transport"}}catch(t){return console.warn("Error in readNotifyRequestAnswer: ",t),{kind:"transport"}}}(null==r?void 0:r.data)}catch(t){const e=function(t){try{const e=t&&"object"==typeof t?t.code:void 0;return"string"==typeof e&&e?e.replace(/^functions\//,""):null}catch(t){return null}}(t);return e?{kind:"error",code:e}:{kind:"transport"}}},Mh=async(t,e,i)=>{var o;try{try{await Xd()}catch{return{success:!1,error:je}}const n=Fn(Kd,ti,{timeout:12e5}),r=await n({eventType:Fe,subEventType:Pe,message:t,digest:e,bundle:i});return null!==(o=null==r?void 0:r.data)&&void 0!==o?o:{success:!1,error:"No response from server"}}catch(t){return console.warn("Error in submitBugReport: ",t),{success:!1,error:(null==t?void 0:t.message)||"Failed to submit bug report"}}};var Ah=Object.freeze({__proto__:null,get BillableMetricTypes(){return bh},acceptAgentSuggestion:Eh,approveProject:kh,checkDocumentUserAndCreate:yh,checkDomainWhitelisted:sh,checkGuestMode:async(t,e)=>{try{const i=Fn(Kd,ti,{timeout:12e5}),o=await i({eventType:"checkGuestMode",apiKey:t,projectId:e});return null==o?void 0:o.data}catch(t){return console.warn("Error in checkGuestMode: ",t),null}},checkToolbarEnabled:dh,createAdminUser:mh,createProjectUser:wh,detectCustomLoginEnabled:gh,fetchQRCode:xh,generateSuperflowAuthToken:ph,getAgents:async t=>{var e,i,o;try{const n=Fn(Kd,ti,{timeout:12e5}),r=await n({eventType:"getAgents",apiKey:t});return null!==(o=null===(i=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.data)||void 0===i?void 0:i.agents)&&void 0!==o?o:[]}catch(t){return console.warn("Error in getAgents: ",t),[]}},getAnonymousId:()=>{let t=localStorage.getItem("sAnonymousId");if(!t){const e=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);t=bd(e)+"",localStorage.setItem("sAnonymousId",t)}return t},getCurrentUser:Xd,getCurrentUserClaims:async()=>{try{const t=await Xd(),e=await(null==t?void 0:t.getIdTokenResult());return(null==e?void 0:e.claims)||{}}catch(t){return console.warn("Error in getCurrentUserClaims: ",t),{}}},getCustomerMetadata:hh,getFeatureAccess:Ch,getOrgStatuses:uh,getProjectConfig:lh,getSamlPublicConfig:fh,iam:ah,identifyTraits:t=>{const e=JSON.parse(JSON.stringify(Qd||{}));Qd={...Qd,...t},Ld(e,Qd)||rh("identify",{properties:Qd})},notifyRequest:Sh,setDefaultProperties:th,setUser:eh,submitBugReport:Mh,trackErrorEvent:oh,trackEvent:nh,trackIdentifyEvent:ih,userMigration:vh,validatePassword:ch});navigator.language.split("-")[0];const Th=new Map;Th.set("es",{"Show Comments on Page":"Mostrar comentarios en la página",Comment:"Comentario","Commenting is disabled. Contact admin.":"Los comentarios están deshabilitados. Póngase en contacto con el administrador.","Arrow feature is disabled. Contact admin.":"La función de flecha está desactivada. Póngase en contacto con el administrador.","All Comments":"Todos los comentarios","Signing In":"Iniciando sesión","Sign in again!":"¡Inicia sesión de nuevo!","Sign in to comment":"Inicia sesión para comentar",Superflow:"Superflujo","Sign in to comment on this page.":"Inicia sesión para comentar en esta página.","Join Community":"Únete a la comunidad","Open in Mobile":"Abrir en móvil","Exit Review Mode":"Salir del modo de revisión","Sign in":"Iniciar sesión","Try Superflow using the toolbar below.":"Prueba Superflujo usando la barra de herramientas de abajo.","Get ready to drop your first comment!":"¡Prepárate para dejar tu primer comentario!","But before you do that, you definitely deserve a high five!":"¡Pero antes de eso, definitivamente mereces un choca esos cinco!",Done:"Hecho","Sign in on the toolbar below and add":"Inicia sesión en la barra de herramientas de abajo y añade","comments on the design flaws.":"comentarios sobre los defectos de diseño.","Click to add comments on this page.":"Haz clic para añadir comentarios en esta página.",Ok:"Ok",Arrow:"Flecha","Live Huddle":"Encuentro en vivo",Recording:"Grabación","Open Comments":"Abrir comentarios",Views:"Vistas",Internal:"Interno",External:"Externo",All:"Todos",Upgrade:"Actualizar","You don't have access.":"No tienes acceso.","Reach out to the admin of this project.":"Contacta al administrador de este proyecto.","Your plan has expired! Please upgrade.":"¡Tu plan ha caducado! Por favor, actualiza.","Your plan has expired!":"¡Tu plan ha caducado!","Please contact the admin.":"Por favor, contacta al administrador.",Share:"Compartir","Add comments & recordings on this page.":"Añade comentarios y grabaciones en esta página.","Learn more":"Aprender más","View project":"Ver proyecto","Sign Out":"Cerrar sesión","You’re a SuperFlow installation wizard!":"¡Eres un mago de la instalación de Superflujo!",Next:"Siguiente","This workspace is over its plan limits. Comments are paused until the plan is updated.":"Este espacio de trabajo ha superado los límites de su plan. Los comentarios están pausados hasta que se actualice el plan.","Ask your workspace admin to update the plan.":"Pide al administrador de tu espacio de trabajo que actualice el plan.","Limit Reached":"Límite alcanzado","Project not found":"Proyecto no encontrado","This project no longer exists in Superflow. It may have been deleted.":"Este proyecto ya no existe en Superflow. Es posible que haya sido eliminado.","Open Superflow":"Abrir Superflow",Approve:"Aprobar","Approving...":"Aprobando...","Approved. Thank you.":"Aprobado. Gracias.","Could not approve. Try again.":"No se pudo aprobar. Inténtalo de nuevo.",Approved:"Aprobado","Approved by {name} on {date}":"Aprobado por {name} el {date}","Approved on {date}":"Aprobado el {date}","QR code to open this page on your phone":"Código QR para abrir esta página en tu teléfono"}),Th.set("fr",{"Show Comments on Page":"Afficher les commentaires sur la page",Comment:"Commentaire","Commenting is disabled. Contact admin.":"Les commentaires sont désactivés. Contactez l'administrateur.","Arrow feature is disabled. Contact admin.":"La fonction flèche est désactivée. Contactez l'administrateur.","All Comments":"Tous les commentaires","Signing In":"Connexion en cours","Sign in again!":"Connectez-vous à nouveau!","Sign in to comment":"Connectez-vous pour commenter",Superflow:"Superflux","Sign in to comment on this page.":"Connectez-vous pour commenter sur cette page.","Join Community":"Rejoindre la communauté","Open in Mobile":"Ouvrir sur mobile","Exit Review Mode":"Quitter le mode de révision","Sign in":"Se connecter","Try Superflow using the toolbar below.":"Essayez Superflux en utilisant la barre d'outils ci-dessous.","Get ready to drop your first comment!":"Préparez-vous à laisser votre premier commentaire!","But before you do that, you definitely deserve a high five!":"Mais avant cela, vous méritez certainement un tope-là!",Done:"Terminé","Sign in on the toolbar below and add":"Connectez-vous sur la barre d'outils ci-dessous et ajoutez","comments on the design flaws.":"des commentaires sur les défauts de conception.","Click to add comments on this page.":"Cliquez pour ajouter des commentaires sur cette page.",Ok:"Ok",Arrow:"Flèche","Live Huddle":"Discussion en direct",Recording:"Enregistrement","Open Comments":"Ouvrir les commentaires",Views:"Vues",Internal:"Interne",External:"Externe",All:"Tous",Upgrade:"Mettre à jour","You don't have access.":"Vous n'avez pas accès.","Reach out to the admin of this project.":"Contactez l'administrateur de ce projet.","Your plan has expired! Please upgrade.":"Votre plan a expiré! Veuillez mettre à jour.","Your plan has expired!":"Votre plan a expiré!","Please contact the admin.":"Veuillez contacter l'administrateur.",Share:"Partager","Add comments & recordings on this page.":"Ajoutez des commentaires et des enregistrements sur cette page.","Learn more":"En savoir plus","View project":"Voir le projet","Sign Out":"Se déconnecter","You’re a SuperFlow installation wizard!":"Vous êtes un sorcier d'installation de Superflux!",Next:"Suivant","This workspace is over its plan limits. Comments are paused until the plan is updated.":"Cet espace de travail dépasse les limites de son forfait. Les commentaires sont suspendus jusqu'à la mise à jour du forfait.","Ask your workspace admin to update the plan.":"Demandez à l'administrateur de votre espace de travail de mettre à jour le forfait.","Limit Reached":"Limite atteinte","Project not found":"Projet introuvable","This project no longer exists in Superflow. It may have been deleted.":"Ce projet n'existe plus dans Superflow. Il a peut-être été supprimé.","Open Superflow":"Ouvrir Superflow",Approve:"Approuver","Approving...":"Approbation...","Approved. Thank you.":"Approuvé. Merci.","Could not approve. Try again.":"Impossible d'approuver. Réessayez.",Approved:"Approuvé","Approved by {name} on {date}":"Approuvé par {name} le {date}","Approved on {date}":"Approuvé le {date}","QR code to open this page on your phone":"Code QR pour ouvrir cette page sur votre téléphone"}),Th.set("hi",{"Show Comments on Page":"पृष्ठ पर टिप्पणियाँ दिखाएँ",Comment:"टिप्पणी","Commenting is disabled. Contact admin.":"टिप्पणी करना अक्षम है. व्यवस्थापक से संपर्क करें.","Arrow feature is disabled. Contact admin.":"तीर सुविधा अक्षम है. व्यवस्थापक से संपर्क करें.","All Comments":"सभी टिप्पणियाँ","Signing In":"साइन इन कर रहा है","Sign in again!":"फिर से साइन इन करें!","Sign in to comment":"टिप्पणी करने के लिए साइन इन करें",Superflow:"सुपरफ्लो","Sign in to comment on this page.":"इस पृष्ठ पर टिप्पणी करने के लिए साइन इन करें।","Join Community":"समुदाय में शामिल हों","Open in Mobile":"मोबाइल में खोलें","Exit Review Mode":"समीक्षा मोड से बाहर निकलें","Sign in":"साइन इन करें","Try Superflow using the toolbar below.":"टूलबार का उपयोग करके सुपरफ्लो का प्रयास करें।","Get ready to drop your first comment!":"अपनी पहली टिप्पणी डालने के लिए तैयार हो जाओ!","But before you do that, you definitely deserve a high five!":"लेकिन इससे पहले, आपको निश्चित रूप से एक उच्च पांच मिलता है!",Done:"किया हुआ","Sign in on the toolbar below and add":"टूलबार पर साइन इन करें और जोड़ें","comments on the design flaws.":"डिज़ाइन की खामियों पर टिप्पणियाँ।","Click to add comments on this page.":"इस पृष्ठ पर टिप्पणियाँ जोड़ने के लिए क्लिक करें।",Ok:"ठीक",Arrow:"तीर","Live Huddle":"लाइव हडल",Recording:"रेकॉर्डिंग","Open Comments":"टिप्पणियाँ खोलें",Views:"दृश्य",Internal:"आंतरिक",External:"बाहरी",All:"सब",Upgrade:"अपग्रेड","You don't have access.":"आपके पास पहुंच नहीं है।","Reach out to the admin of this project.":"इस परियोजना के व्यवस्थापक से संपर्क करें।","Your plan has expired! Please upgrade.":"आपकी योजना समाप्त हो गई है! कृपया अपग्रेड करें।","Your plan has expired!":"आपकी योजना समाप्त हो गई है!","Please contact the admin.":"कृपया व्यवस्थापक से संपर्क करें।",Share:"शेयर","Add comments & recordings on this page.":"इस पृष्ठ पर टिप्पणियाँ और रिकॉर्डिंग जोड़ें।","Learn more":"और अधिक जानें","View project":"परियोजना देखें","Sign Out":"साइन आउट","You’re a SuperFlow installation wizard!":"आप एक सुपरफ्लो स्थापना विज़ार्ड हैं!",Next:"आगामी","This workspace is over its plan limits. Comments are paused until the plan is updated.":"यह वर्कस्पेस अपनी योजना की सीमा से अधिक हो गया है। योजना अपडेट होने तक टिप्पणियाँ रोक दी गई हैं।","Ask your workspace admin to update the plan.":"अपने वर्कस्पेस व्यवस्थापक से योजना अपडेट करने के लिए कहें।","Limit Reached":"सीमा समाप्त","Project not found":"प्रोजेक्ट नहीं मिला","This project no longer exists in Superflow. It may have been deleted.":"यह प्रोजेक्ट अब Superflow में मौजूद नहीं है। इसे हटा दिया गया हो सकता है।","Open Superflow":"Superflow खोलें",Approve:"स्वीकृत करें","Approving...":"स्वीकृत किया जा रहा है...","Approved. Thank you.":"स्वीकृत। धन्यवाद।","Could not approve. Try again.":"स्वीकृत नहीं किया जा सका। फिर से प्रयास करें।",Approved:"स्वीकृत","Approved by {name} on {date}":"{name} द्वारा {date} को स्वीकृत","Approved on {date}":"{date} को स्वीकृत","QR code to open this page on your phone":"इस पेज को अपने फ़ोन पर खोलने के लिए QR कोड"}),Th.set("it",{"Show Comments on Page":"Mostra i commenti sulla pagina",Comment:"Commento","Commenting is disabled. Contact admin.":"I commenti sono disabilitati. Contatta l'amministratore.","Arrow feature is disabled. Contact admin.":"La funzione freccia è disabilitata. Contatta l'amministratore.","All Comments":"Tutti i commenti","Signing In":"Accesso in corso","Sign in again!":"Accedi di nuovo!","Sign in to comment":"Accedi per commentare",Superflow:"Superflusso","Sign in to comment on this page.":"Accedi per commentare su questa pagina.","Join Community":"Unisciti alla comunità","Open in Mobile":"Apri su mobile","Exit Review Mode":"Esci dalla modalità di revisione","Sign in":"Accedi","Try Superflow using the toolbar below.":"Prova Superflusso utilizzando la barra degli strumenti qui sotto.","Get ready to drop your first comment!":"Preparati a lasciare il tuo primo commento!","But before you do that, you definitely deserve a high five!":"Ma prima di farlo, meriti sicuramente un cinque in alto!",Done:"Fatto","Sign in on the toolbar below and add":"Accedi alla barra degli strumenti qui sotto e aggiungi","comments on the design flaws.":"commenti sui difetti di progettazione.","Click to add comments on this page.":"Clicca per aggiungere commenti su questa pagina.",Ok:"Ok",Arrow:"Freccia","Live Huddle":"Riunione dal vivo",Recording:"Registrazione","Open Comments":"Apri commenti",Views:"Visualizzazioni",Internal:"Interno",External:"Esterno",All:"Tutti",Upgrade:"Aggiorna","You don't have access.":"Non hai accesso.","Reach out to the admin of this project.":"Contatta l'amministratore di questo progetto.","Your plan has expired! Please upgrade.":"Il tuo piano è scaduto! Si prega di aggiornare.","Your plan has expired!":"Il tuo piano è scaduto!","Please contact the admin.":"Si prega di contattare l'amministratore.",Share:"Condividi","Add comments & recordings on this page.":"Aggiungi commenti e registrazioni su questa pagina.","Learn more":"Scopri di più","View project":"Visualizza progetto","Sign Out":"Disconnetti","You’re a SuperFlow installation wizard!":"Sei un mago dell'installazione di Superflusso!",Next:"Avanti","This workspace is over its plan limits. Comments are paused until the plan is updated.":"Questo spazio di lavoro ha superato i limiti del suo piano. I commenti sono sospesi finché il piano non viene aggiornato.","Ask your workspace admin to update the plan.":"Chiedi all'amministratore del tuo spazio di lavoro di aggiornare il piano.","Limit Reached":"Limite raggiunto","Project not found":"Progetto non trovato","This project no longer exists in Superflow. It may have been deleted.":"Questo progetto non esiste più in Superflow. Potrebbe essere stato eliminato.","Open Superflow":"Apri Superflow",Approve:"Approva","Approving...":"Approvazione...","Approved. Thank you.":"Approvato. Grazie.","Could not approve. Try again.":"Impossibile approvare. Riprova.",Approved:"Approvato","Approved by {name} on {date}":"Approvato da {name} il {date}","Approved on {date}":"Approvato il {date}","QR code to open this page on your phone":"Codice QR per aprire questa pagina sul tuo telefono"}),Th.set("ru",{"Show Comments on Page":"Показывать комментарии на странице",Comment:"Комментарий","Commenting is disabled. Contact admin.":"Комментирование отключено. Свяжитесь с админом.","Arrow feature is disabled. Contact admin.":"Функция стрелки отключена. Свяжитесь с администратором.","All Comments":"Все комментарии","Signing In":"Вход в систему","Sign in again!":"Войдите снова!","Sign in to comment":"Войдите, чтобы оставить комментарий",Superflow:"Суперпоток","Sign in to comment on this page.":"Войдите, чтобы оставить комментарий на этой странице.","Join Community":"Присоединиться к сообществу","Open in Mobile":"Открыть на мобильном","Exit Review Mode":"Выйти из режима обзора","Sign in":"Войти","Try Superflow using the toolbar below.":"Попробуйте Суперпоток, используя панель инструментов ниже.","Get ready to drop your first comment!":"Приготовьтесь оставить свой первый комментарий!","But before you do that, you definitely deserve a high five!":"Но перед этим вы определенно заслуживаете пять!",Done:"Сделано","Sign in on the toolbar below and add":"Войдите на панели инструментов ниже и добавьте","comments on the design flaws.":"комментарии об ошибках в дизайне.","Click to add comments on this page.":"Нажмите, чтобы добавить комментарии на этой странице.",Ok:"Ок",Arrow:"Стрелка","Live Huddle":"Прямой сбор",Recording:"Запись","Open Comments":"Открыть комментарии",Views:"Просмотры",Internal:"Внутренний",External:"Внешний",All:"Все",Upgrade:"Обновить","You don't have access.":"У вас нет доступа.","Reach out to the admin of this project.":"Обратитесь к администратору этого проекта.","Your plan has expired! Please upgrade.":"Ваш план истек! Пожалуйста, обновите.","Your plan has expired!":"Ваш план истек!","Please contact the admin.":"Пожалуйста, свяжитесь с администратором.",Share:"Поделиться","Add comments & recordings on this page.":"Добавьте комментарии и записи на этой странице.","Learn more":"Узнать больше","View project":"Посмотреть проект","Sign Out":"Выйти","You’re a SuperFlow installation wizard!":"Вы волшебник установки Суперпотока!",Next:"Далее","This workspace is over its plan limits. Comments are paused until the plan is updated.":"Это рабочее пространство превысило лимиты тарифа. Комментарии приостановлены до обновления тарифа.","Ask your workspace admin to update the plan.":"Попросите администратора рабочего пространства обновить тариф.","Limit Reached":"Лимит исчерпан","Project not found":"Проект не найден","This project no longer exists in Superflow. It may have been deleted.":"Этот проект больше не существует в Superflow. Возможно, он был удалён.","Open Superflow":"Открыть Superflow",Approve:"Одобрить","Approving...":"Одобрение...","Approved. Thank you.":"Одобрено. Спасибо.","Could not approve. Try again.":"Не удалось одобрить. Попробуйте ещё раз.",Approved:"Одобрено","Approved by {name} on {date}":"Одобрено: {name}, {date}","Approved on {date}":"Одобрено {date}","QR code to open this page on your phone":"QR-код, чтобы открыть эту страницу на телефоне"}),Th.set("uk",{"Show Comments on Page":"Показувати коментарі на сторінці",Comment:"Коментар","Commenting is disabled. Contact admin.":"Коментування вимкнено. Зв'язатися з адміном.","Arrow feature is disabled. Contact admin.":"Функція стрілки вимкнена. Зв'язатися з адміном.","All Comments":"Всі коментарі","Signing In":"Увійти в систему","Sign in again!":"Увійдіть знову!","Sign in to comment":"Увійдіть, щоб залишити коментар",Superflow:"Суперпотік","Sign in to comment on this page.":"Увійдіть, щоб залишити коментар на цій сторінці.","Join Community":"Приєднатися до спільноти","Open in Mobile":"Відкрити на мобільному","Exit Review Mode":"Вийти з режиму огляду","Sign in":"Увійти","Try Superflow using the toolbar below.":"Спробуйте Суперпотік, використовуючи панель інструментів нижче.","Get ready to drop your first comment!":"Приготуйтеся залишити свій перший коментар!","But before you do that, you definitely deserve a high five!":"Але перед тим, як ви це зробите, ви точно заслуговуєте на високу п'ятірку!",Done:"Готово","Sign in on the toolbar below and add":"Увійдіть в панель інструментів нижче і додайте","comments on the design flaws.":"коментарі про помилки в дизайні.","Click to add comments on this page.":"Натисніть, щоб додати коментарі на цій сторінці.",Ok:"Добре",Arrow:"Стрілка","Live Huddle":"Пряма група",Recording:"Запис","Open Comments":"Відкрити коментарі",Views:"Перегляди",Internal:"Внутрішній",External:"Зовнішній",All:"Все",Upgrade:"Оновити","You don't have access.":"У вас немає доступу.","Reach out to the admin of this project.":"Зверніться до адміністратора цього проекту.","Your plan has expired! Please upgrade.":"Термін дії вашого плану закінчився! Будь ласка, оновіть.","Your plan has expired!":"Термін дії вашого плану закінчився!","Please contact the admin.":"Будь ласка, зв'яжіться з адміністратором.",Share:"Поділитися","Add comments & recordings on this page.":"Додайте коментарі та записи на цій сторінці.","Learn more":"Дізнатися більше","View project":"Переглянути проект","Sign Out":"Вийти","You’re a SuperFlow installation wizard!":"Ви чарівник встановлення Суперпотоку!",Next:"Далі","This workspace is over its plan limits. Comments are paused until the plan is updated.":"Цей робочий простір перевищив ліміти тарифу. Коментарі призупинено до оновлення тарифу.","Ask your workspace admin to update the plan.":"Попросіть адміністратора робочого простору оновити тариф.","Limit Reached":"Ліміт вичерпано","Project not found":"Проєкт не знайдено","This project no longer exists in Superflow. It may have been deleted.":"Цей проєкт більше не існує в Superflow. Можливо, його було видалено.","Open Superflow":"Відкрити Superflow",Approve:"Схвалити","Approving...":"Схвалення...","Approved. Thank you.":"Схвалено. Дякуємо.","Could not approve. Try again.":"Не вдалося схвалити. Спробуйте ще раз.",Approved:"Схвалено","Approved by {name} on {date}":"Схвалено: {name}, {date}","Approved on {date}":"Схвалено {date}","QR code to open this page on your phone":"QR-код, щоб відкрити цю сторінку на телефоні"});const Ih=t=>{try{return t}catch(e){return t}},_h=l`
1561
+ calc(${t[2]}rem * var(--velt-base-rem-unit, 1)) calc(${t[3]}rem * var(--velt-base-rem-unit, 1))`}return l`0`},_d=(t,e,i)=>{try{const o=bd.enc.Utf8.parse(e),n=bd.enc.Utf8.parse(i);return bd.AES.encrypt(bd.enc.Utf8.parse(t),o,{keySize:32,iv:n,mode:bd.mode.CBC,padding:bd.pad.Pkcs7}).toString()}catch(e){return console.warn("Error in encrypt: ",e),nh("Error in encrypt: ",e),t}},$d=(t,e,i)=>{try{const o=bd.enc.Utf8.parse(e),n=bd.enc.Utf8.parse(i);return bd.AES.decrypt(t,o,{keySize:32,iv:n,mode:bd.mode.CBC,padding:bd.pad.Pkcs7}).toString(bd.enc.Utf8)}catch(t){return console.warn("Error in decrypt: ",t),nh("Error in decrypt: ",t),null}},Nd=()=>{try{const t=Md(Qt,!0);if(t){const e=$d(t,Qe,Xe);if(e)return JSON.parse(e);console.warn("Error in getUserFromToken: ","Invalid token."),Td(Qt),Bd()}else{const t=Md(Jt,!0);if(t)return Od(),JSON.parse(t)}return null}catch(t){return console.warn("Error in getUserFromToken: ",t),nh("Error in getUserFromToken: ",t),null}},Od=()=>{try{const t=Md(Jt,!0);if(t){const e=_d(t,Qe,Xe);Ad(Qt,e,!0)}Td(Jt)}catch(t){console.warn("Error in moveSnippylyUserToST: ",t),nh("Error in moveSnippylyUserToST: ",t)}},Ld=(t=!0,e)=>{try{const i=Md(ee,!0);if(i){const t=$d(i,Qe,Xe);return t?JSON.parse(t):null}if(t){const t=Fe,i=t[Math.floor(Math.random()*t.length)],o=i.name,n=i.photoUrl,r={name:o,email:"guest@usesuperflow.com",userId:Math.floor(1e9*Math.random())+"",photoUrl:n,isGuest:!0,organizationId:e},s=JSON.stringify(r),a=_d(s,Qe,Xe);return Ad(ee,a,!0),r}return null}catch(t){return console.warn("Error in getGuestUser: ",t),nh("Error in getGuestUser: ",t),null}},Rd=(t,e)=>{try{return Object.prototype.toString.call(t)===Object.prototype.toString.call(e)&&("[object Object]"===Object.prototype.toString.call(t)||"[object Array]"===Object.prototype.toString.call(t)?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).every((i=>Rd(t[i],e[i]))):t===e)}catch(t){return console.error("Error in deepCompare: ",t),!1}},Dd=["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"],Fd=(t,e,i=!0)=>{try{return!e&&(!!i&&!(t=>{var e;try{return!t||"not-found"!==t.status&&("error"===t.status||!1!==(null===(e=t.config)||void 0===e?void 0:e.isValidProject))}catch(t){return!0}})(t))}catch(t){return!1}},Pd=t=>{try{return"https:"===(null==t?void 0:t.protocol)&&(t=>{try{const e=(t||"").toLowerCase().replace(/\.$/,"");return Ht.some((t=>e.endsWith(`.${t}`)&&Gt.test(e.slice(0,-(t.length+1)))))}catch(t){return console.warn("Error in isLivePreviewHost: ",t),!1}})((null==t?void 0:t.hostname)||"")}catch(t){return console.warn("Error in isLivePreviewLocation: ",t),!1}},jd=t=>{try{if(!t)return null;const e=new URL(t);if(Pd(e))return e.pathname||"/";return zt.some((({hostSuffix:t,pathPrefix:i})=>(e.hostname===t||e.hostname.endsWith(`.${t}`))&&e.pathname.startsWith(i)))?e.searchParams.get("spath"):null}catch(t){return console.warn("Error in extractPreviewProxyPath: ",t),null}},Vd=({loc:t=window.location,win:e=window,now:i=Date.now()}={})=>{try{if(!Pd(t))return null;const o=null==e?void 0:e[Ge],n=null==o?void 0:o.token,r=null==o?void 0:o.user,s=null==r?void 0:r.userId;if("string"!=typeof n||!n||"string"!=typeof s||!s)return null;const a=Number(null==o?void 0:o.expiresAt);if(!Number.isFinite(a)||a<=i+te)return null;const l=t=>"string"==typeof t?t:"";return{token:n,expiresAt:a,user:{userId:s,name:l(null==r?void 0:r.name)||l(null==r?void 0:r.email)||"Guest",email:l(null==r?void 0:r.email),...l(null==r?void 0:r.photoUrl)?{photoUrl:l(null==r?void 0:r.photoUrl)}:{},...!0===(null==r?void 0:r.isGuest)?{isGuest:!0}:{}}}}catch(t){return console.warn("Error in readLivePreviewSignIn: ",t),null}},Ud=({userId:t,now:e=Date.now()}={})=>{try{const i=Md(Xt,!0);if("string"!=typeof i||!i)return null;const o=(t=>{try{const e="string"==typeof t?t.split("."):[];if(3!==e.length||!e[1])return null;const i=e[1].replace(/-/g,"+").replace(/_/g,"/"),o=i+"=".repeat((4-i.length%4)%4),n=Uint8Array.from(atob(o),(t=>t.charCodeAt(0))),r=JSON.parse((new TextDecoder).decode(n));return r&&"object"==typeof r&&!Array.isArray(r)?r:null}catch(t){return console.warn("Error in decodeJwtPayload: ",t),null}})(i),n="number"==typeof(null==o?void 0:o.exp)&&1e3*o.exp<=e+te,r=void 0!==t&&(null==o?void 0:o.uid)!==t;return!o||n||r?(Bd(),null):i}catch(t){return console.warn("Error in getStoredUserCredential: ",t),null}},Bd=()=>{try{Td(Xt)}catch(t){console.warn("Error in clearStoredUserCredential: ",t)}},zd="Request a change",Hd="Requests",Gd="Sign out",Wd="Signed in as";function qd(t){try{const e=t&&"object"==typeof t?t:{},i="string"==typeof e.maintenanceRequestsLabel?e.maintenanceRequestsLabel.trim():"";return{enabled:!0===e.maintenanceRequests,label:i}}catch(t){return console.warn("Error in readMaintenanceRequests: ",t),{enabled:!1,label:""}}}const Zd="[superflow request mode] notifyRequest";const Kd=cn({apiKey:"AIzaSyAzcW2n1JhY_zhkXmuFcwe550AkwmYeJ0w",projectId:"snipply-sdk-staging",messagingSenderId:"877538579326",appId:"1:877538579326:web:f793f73f2b7dc770c4992f"}),Jd=function(t=dn(),e=_n){const i=nn(Wi(t),Sn).getImmediate({identifier:e}),o=(t=>{const e=Oi(t);if(!e)return;const i=e.lastIndexOf(":");if(i<=0||i+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const o=parseInt(e.substring(i+1),10);return"["===e[0]?[e.substring(1,i-1),o]:[e.substring(0,i),o]})("functions");return o&&function(t,e,i){!function(t,e,i){t.emulatorOrigin=`http://${e}:${i}`}(Wi(t),e,i)}(i,...o),i}(Kd);let Yd,Qd={sourcePlatform:"superflowToolbar"},Xd={};const th=()=>new Promise(((t,e)=>{const i=xa(Kd).onAuthStateChanged((o=>{i(),o?t(o):e("No user is currently signed in.")}),e)})),eh=(t={})=>{Qd={...Qd,...t}},ih=t=>{Yd=t},oh=t=>{var e,i,o,n,r,s,a,l,c,d,h,u;const p={properties:{apiKey:null!==(e=null==Qd?void 0:Qd.apiKey)&&void 0!==e?e:"",name:null!==(i=null==t?void 0:t.name)&&void 0!==i?i:"",firstName:(null==t?void 0:t.name)?null===(o=null==t?void 0:t.name)||void 0===o?void 0:o.split(" ")[0]:"",lastName:(null==t?void 0:t.name)?null===(n=null==t?void 0:t.name)||void 0===n?void 0:n.split(" ")[1]:"",email:null!==(r=null==t?void 0:t.email)&&void 0!==r?r:"",clientUserId:null!==(s=null==t?void 0:t.userId)&&void 0!==s?s:"",snippylyUserId:null!==(a=null==t?void 0:t.userSnippylyId)&&void 0!==a?a:"",groupId:null!==(l=null==t?void 0:t.groupId)&&void 0!==l?l:"",isOwner:"",plan:"",sdkVersion:null!==(c=null==Qd?void 0:Qd.sdkVersion)&&void 0!==c?c:"",sdkType:null!==(d=null==Qd?void 0:Qd.sdkType)&&void 0!==d?d:"",sourcePlatform:null!==(h=null==Qd?void 0:Qd.sourcePlatform)&&void 0!==h?h:"",website:null===(u=null===window||void 0===window?void 0:window.location)||void 0===u?void 0:u.href},context:{userAgent:null===navigator||void 0===navigator?void 0:navigator.userAgent},userId:null==t?void 0:t.userSnippylyId,sf:!0};sh("identify",p)},nh=(t,e,i={})=>{const o={error:t,message:(null==e?void 0:e.message)||e||t,...i};rh("error",o)},rh=(t,e={},i=!0)=>{try{if(null==Yd?void 0:Yd.userSnippylyId){e=i?{...Qd,...e}:e,e={...e};const o={userId:null==Yd?void 0:Yd.userSnippylyId,event:t,properties:e,sf:!0};sh("track",o)}else console.warn("Untracked event: ",t,e)}catch(t){console.warn("Error in trackEvent: ",t)}},sh=(t,e)=>{try{Pn(Jd,ti,{timeout:12e5})({type:t,data:e})}catch(t){console.warn("Error in setAnalytics: ",t)}},ah=async(t,e)=>{try{const i=Pn(Jd,ei,{timeout:12e5});await i({eventType:"checkDomainWhitelisted",apiKey:t,projectId:e})}catch(t){console.warn("Error in checkDomainWhitelisted: ",t)}},lh=async(t,e,i,o)=>{try{ka("[Superflow][iam] request",{eventType:"iam",apiKey:t,projectId:e,email:i,userId:o});const n=Pn(Jd,ei,{timeout:12e5}),r=await n({eventType:"iam",apiKey:t,projectId:e,email:i,userId:o});return ka("[Superflow][iam] response",null==r?void 0:r.data),null==r?void 0:r.data}catch(t){return console.warn("Error in iam: ",t),null}},ch=async(t,e)=>{var i;try{const o=Pn(Jd,ei,{timeout:12e5}),n=await o({eventType:"getProjectConfig",apiKey:t,projectId:e});return{status:"ok",config:null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data}}catch(t){return(t=>{try{const e="string"==typeof(null==t?void 0:t.code)?t.code.toLowerCase():"";return"functions/not-found"===e||"not-found"===e}catch(t){return!1}})(t)?(console.warn("getProjectConfig: project document not found for projectId: ",e),{status:"not-found"}):(console.warn("Error in getProjectConfig: ",t),{status:"error"})}},dh=async(t,e,i)=>{var o;try{const n=Pn(Jd,ei,{timeout:12e5}),r=await n({eventType:"validatePassword",apiKey:t,projectId:e,password:i});return null===(o=null==r?void 0:r.data)||void 0===o?void 0:o.data}catch(t){return console.warn("Error in validatePassword: ",t),null}},hh=async(t,e,i)=>{var o;try{const n=Pn(Jd,ei,{timeout:12e5}),r=await n({eventType:"checkToolbarEnabled",apiKey:t,projectId:e,url:i});return null===(o=null==r?void 0:r.data)||void 0===o?void 0:o.data}catch(t){return console.warn("Error in checkToolbarEnabled: ",t),null}},uh=async t=>{try{const e=Pn(Jd,ei,{timeout:12e5}),i=await e({eventType:"getCustomerMetadata",apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}},ph=async t=>{try{const e=Pn(Jd,ei,{timeout:12e5}),i=await e({eventType:"customStatus",subEventType:"getOrgStatuses",apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getOrgStatuses: ",t),null}},vh=async(t,e,i,o)=>{var n,r;try{const s=Pn(Jd,ei,{timeout:12e5}),a=await s({eventType:"generateSuperflowAuthToken",apiKey:t,userId:e,userProperties:i,...o?{credential:o}:{}}),l=null===(n=null==a?void 0:a.data)||void 0===n?void 0:n.data;return{token:null!==(r=null==l?void 0:l.token)&&void 0!==r?r:null,..."boolean"==typeof(null==l?void 0:l.isAdmin)?{isAdmin:l.isAdmin}:{}}}catch(t){return console.warn("Error in generateSuperflowAuthToken: ",t),{token:null}}},gh=async(t,e,i,o,n,r)=>{try{const s=Pn(Jd,ei,{timeout:12e5}),a=await s({eventType:"userMigration",apiKey:t,projectId:e,oldUser:i,newUser:o,deleteGuestUserFlag:n,...r?{credential:r}:{}});return null==a?void 0:a.data}catch(t){return console.warn("Error in usermigration: ",t),null}},fh=t=>Pn(Jd,ei,{timeout:12e5})({eventType:"customLoginEnabled",apiKey:t}),mh=async t=>{var e;try{const i=Pn(Jd,ei,{timeout:12e5}),o=await i({eventType:"saml",samlEventType:"getPublicConfig",apiKey:t});return null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.publicConfig}catch(t){return console.warn("Error in getSamlPublicConfig: ",t),null}},wh=async(t,e)=>{var i;try{const o=await th();if(!o)throw new Error("User must be authenticated to create admin users");const n=window.Velt?await(null===(i=window.Velt)||void 0===i?void 0:i.getUser()):null,r=(null==o?void 0:o.displayName)||(null==n?void 0:n.name)||(null==n?void 0:n.email)||"",s=Pn(Jd,ei,{timeout:12e5}),a=await s({eventType:"createAdminUser",apiKey:t,users:e,inviterName:r});return null==a?void 0:a.data}catch(t){throw console.warn("Error in createAdminUser: ",t),t}},yh=async(t,e,i)=>{var o;try{const n=await th();if(!n)throw new Error("User must be authenticated to create project users");const r=window.Velt?await(null===(o=window.Velt)||void 0===o?void 0:o.getUser()):null,s=(null==n?void 0:n.displayName)||(null==r?void 0:r.name)||(null==r?void 0:r.email)||"",a=Pn(Jd,ei,{timeout:12e5}),l=await a({eventType:"createProjectUser",apiKey:t,documentId:e,users:i,inviterName:s});return null==l?void 0:l.data}catch(t){throw console.warn("Error in createProjectUser: ",t),t}},bh=async(t,e,i,o,n,r)=>{try{const s=Pn(Jd,ei,{timeout:12e5}),a=await s({eventType:"checkDocumentUserAndCreate",apiKey:t,documentId:e,userId:i,name:o,email:n,...r?{credential:r}:{}});return null==a?void 0:a.data}catch(t){throw console.warn("Error in checkDocumentUserAndCreate: ",t),t}};var Ch;!function(t){t.WorkspaceUserSeats="workspaceUserSeats",t.Storage="storage",t.Agents="agents",t.WorkspacePrivateComments="privateComments"}(Ch||(Ch={}));const xh=async t=>{var e,i;try{const o=Pn(Jd,ei,{timeout:12e5}),n=await o({eventType:"getFeatureAccess",apiKey:t});return{status:"ok",featureAccess:null!==(i=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.data)&&void 0!==i?i:null}}catch(t){return console.warn("Error in getFeatureAccess: ",t),{status:"error"}}},Eh=async t=>{var e;try{const i=Pn(Jd,ei,{timeout:12e5}),o=await i({eventType:"getQrCode",text:t}),n=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.qrcode;return n?{status:"ok",qrcode:n}:{status:"error"}}catch(t){return console.warn("Error in fetchQRCode: ",t),{status:"error"}}},kh=async(t,e,i,o,n,r)=>{try{const s=Pn(Jd,ei,{timeout:12e5}),a=await s({eventType:"acceptAgentSuggestion",apiKey:t,organizationId:e,documentId:i,annotationId:o,user:n,...r?{credential:r}:{}});return null==a?void 0:a.data}catch(t){return console.warn("Error in acceptAgentSuggestion: ",t),nh("Error in acceptAgentSuggestion: ",t),null}},Sh=async({apiKey:t,documentId:e,user:i,comment:o})=>{try{const n=Pn(Jd,ei,{timeout:12e5}),r=await n({eventType:"approveProject",apiKey:t,documentId:e,user:i,...o?{comment:o}:{}}),s=null==r?void 0:r.data;return(null==s?void 0:s.success)&&(null==s?void 0:s.data)?s.data:null}catch(t){return console.warn("Error in approveProject: ",t),nh("Error in approveProject: ",t),null}},Ah=async({apiKey:t,documentId:e,annotationId:i,user:o})=>{try{const n=Pn(Jd,ei,{timeout:6e4}),r=await n({eventType:"notifyRequest",apiKey:t,documentId:e,annotationId:i,user:o});return function(t){try{const e=t&&"object"==typeof t?t:null;if(!e)return{kind:"transport"};const i=e.data&&"object"==typeof e.data&&"notified"in e.data?e.data:e;return"notified"in i?{kind:"ok",notified:!0===i.notified,reason:"string"==typeof i.reason?i.reason:null}:{kind:"transport"}}catch(t){return console.warn("Error in readNotifyRequestAnswer: ",t),{kind:"transport"}}}(null==r?void 0:r.data)}catch(t){const e=function(t){try{const e=t&&"object"==typeof t?t.code:void 0;return"string"==typeof e&&e?e.replace(/^functions\//,""):null}catch(t){return null}}(t);return e?{kind:"error",code:e}:{kind:"transport"}}},Mh=async(t,e,i)=>{var o;try{try{await th()}catch{return{success:!1,error:Ve}}const n=Pn(Jd,ei,{timeout:12e5}),r=await n({eventType:Pe,subEventType:je,message:t,digest:e,bundle:i});return null!==(o=null==r?void 0:r.data)&&void 0!==o?o:{success:!1,error:"No response from server"}}catch(t){return console.warn("Error in submitBugReport: ",t),{success:!1,error:(null==t?void 0:t.message)||"Failed to submit bug report"}}};var Th=Object.freeze({__proto__:null,get BillableMetricTypes(){return Ch},acceptAgentSuggestion:kh,approveProject:Sh,checkDocumentUserAndCreate:bh,checkDomainWhitelisted:ah,checkGuestMode:async(t,e)=>{try{const i=Pn(Jd,ei,{timeout:12e5}),o=await i({eventType:"checkGuestMode",apiKey:t,projectId:e});return null==o?void 0:o.data}catch(t){return console.warn("Error in checkGuestMode: ",t),null}},checkToolbarEnabled:hh,createAdminUser:wh,createProjectUser:yh,detectCustomLoginEnabled:fh,fetchQRCode:Eh,generateSuperflowAuthToken:vh,getAgents:async t=>{var e,i,o;try{const n=Pn(Jd,ei,{timeout:12e5}),r=await n({eventType:"getAgents",apiKey:t});return null!==(o=null===(i=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.data)||void 0===i?void 0:i.agents)&&void 0!==o?o:[]}catch(t){return console.warn("Error in getAgents: ",t),[]}},getAnonymousId:()=>{let t=localStorage.getItem("sAnonymousId");if(!t){const e=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);t=Cd(e)+"",localStorage.setItem("sAnonymousId",t)}return t},getCurrentUser:th,getCurrentUserClaims:async()=>{try{const t=await th(),e=await(null==t?void 0:t.getIdTokenResult());return(null==e?void 0:e.claims)||{}}catch(t){return console.warn("Error in getCurrentUserClaims: ",t),{}}},getCustomerMetadata:uh,getFeatureAccess:xh,getOrgStatuses:ph,getProjectConfig:ch,getSamlPublicConfig:mh,iam:lh,identifyTraits:t=>{const e=JSON.parse(JSON.stringify(Xd||{}));Xd={...Xd,...t},Rd(e,Xd)||sh("identify",{properties:Xd})},notifyRequest:Ah,setDefaultProperties:eh,setUser:ih,submitBugReport:Mh,trackErrorEvent:nh,trackEvent:rh,trackIdentifyEvent:oh,userMigration:gh,validatePassword:dh});navigator.language.split("-")[0];const Ih=new Map;Ih.set("es",{"Show Comments on Page":"Mostrar comentarios en la página",Comment:"Comentario","Commenting is disabled. Contact admin.":"Los comentarios están deshabilitados. Póngase en contacto con el administrador.","Arrow feature is disabled. Contact admin.":"La función de flecha está desactivada. Póngase en contacto con el administrador.","All Comments":"Todos los comentarios","Signing In":"Iniciando sesión","Sign in again!":"¡Inicia sesión de nuevo!","Sign in to comment":"Inicia sesión para comentar",Superflow:"Superflujo","Sign in to comment on this page.":"Inicia sesión para comentar en esta página.","Join Community":"Únete a la comunidad","Open in Mobile":"Abrir en móvil","Exit Review Mode":"Salir del modo de revisión","Sign in":"Iniciar sesión","Try Superflow using the toolbar below.":"Prueba Superflujo usando la barra de herramientas de abajo.","Get ready to drop your first comment!":"¡Prepárate para dejar tu primer comentario!","But before you do that, you definitely deserve a high five!":"¡Pero antes de eso, definitivamente mereces un choca esos cinco!",Done:"Hecho","Sign in on the toolbar below and add":"Inicia sesión en la barra de herramientas de abajo y añade","comments on the design flaws.":"comentarios sobre los defectos de diseño.","Click to add comments on this page.":"Haz clic para añadir comentarios en esta página.",Ok:"Ok",Arrow:"Flecha","Live Huddle":"Encuentro en vivo",Recording:"Grabación","Open Comments":"Abrir comentarios",Views:"Vistas",Internal:"Interno",External:"Externo",All:"Todos",Upgrade:"Actualizar","You don't have access.":"No tienes acceso.","Reach out to the admin of this project.":"Contacta al administrador de este proyecto.","Your plan has expired! Please upgrade.":"¡Tu plan ha caducado! Por favor, actualiza.","Your plan has expired!":"¡Tu plan ha caducado!","Please contact the admin.":"Por favor, contacta al administrador.",Share:"Compartir","Add comments & recordings on this page.":"Añade comentarios y grabaciones en esta página.","Learn more":"Aprender más","View project":"Ver proyecto","Sign Out":"Cerrar sesión","You’re a SuperFlow installation wizard!":"¡Eres un mago de la instalación de Superflujo!",Next:"Siguiente","This workspace is over its plan limits. Comments are paused until the plan is updated.":"Este espacio de trabajo ha superado los límites de su plan. Los comentarios están pausados hasta que se actualice el plan.","Ask your workspace admin to update the plan.":"Pide al administrador de tu espacio de trabajo que actualice el plan.","Limit Reached":"Límite alcanzado","Project not found":"Proyecto no encontrado","This project no longer exists in Superflow. It may have been deleted.":"Este proyecto ya no existe en Superflow. Es posible que haya sido eliminado.","Open Superflow":"Abrir Superflow",Approve:"Aprobar","Approving...":"Aprobando...","Approved. Thank you.":"Aprobado. Gracias.","Could not approve. Try again.":"No se pudo aprobar. Inténtalo de nuevo.",Approved:"Aprobado","Approved by {name} on {date}":"Aprobado por {name} el {date}","Approved on {date}":"Aprobado el {date}","QR code to open this page on your phone":"Código QR para abrir esta página en tu teléfono"}),Ih.set("fr",{"Show Comments on Page":"Afficher les commentaires sur la page",Comment:"Commentaire","Commenting is disabled. Contact admin.":"Les commentaires sont désactivés. Contactez l'administrateur.","Arrow feature is disabled. Contact admin.":"La fonction flèche est désactivée. Contactez l'administrateur.","All Comments":"Tous les commentaires","Signing In":"Connexion en cours","Sign in again!":"Connectez-vous à nouveau!","Sign in to comment":"Connectez-vous pour commenter",Superflow:"Superflux","Sign in to comment on this page.":"Connectez-vous pour commenter sur cette page.","Join Community":"Rejoindre la communauté","Open in Mobile":"Ouvrir sur mobile","Exit Review Mode":"Quitter le mode de révision","Sign in":"Se connecter","Try Superflow using the toolbar below.":"Essayez Superflux en utilisant la barre d'outils ci-dessous.","Get ready to drop your first comment!":"Préparez-vous à laisser votre premier commentaire!","But before you do that, you definitely deserve a high five!":"Mais avant cela, vous méritez certainement un tope-là!",Done:"Terminé","Sign in on the toolbar below and add":"Connectez-vous sur la barre d'outils ci-dessous et ajoutez","comments on the design flaws.":"des commentaires sur les défauts de conception.","Click to add comments on this page.":"Cliquez pour ajouter des commentaires sur cette page.",Ok:"Ok",Arrow:"Flèche","Live Huddle":"Discussion en direct",Recording:"Enregistrement","Open Comments":"Ouvrir les commentaires",Views:"Vues",Internal:"Interne",External:"Externe",All:"Tous",Upgrade:"Mettre à jour","You don't have access.":"Vous n'avez pas accès.","Reach out to the admin of this project.":"Contactez l'administrateur de ce projet.","Your plan has expired! Please upgrade.":"Votre plan a expiré! Veuillez mettre à jour.","Your plan has expired!":"Votre plan a expiré!","Please contact the admin.":"Veuillez contacter l'administrateur.",Share:"Partager","Add comments & recordings on this page.":"Ajoutez des commentaires et des enregistrements sur cette page.","Learn more":"En savoir plus","View project":"Voir le projet","Sign Out":"Se déconnecter","You’re a SuperFlow installation wizard!":"Vous êtes un sorcier d'installation de Superflux!",Next:"Suivant","This workspace is over its plan limits. Comments are paused until the plan is updated.":"Cet espace de travail dépasse les limites de son forfait. Les commentaires sont suspendus jusqu'à la mise à jour du forfait.","Ask your workspace admin to update the plan.":"Demandez à l'administrateur de votre espace de travail de mettre à jour le forfait.","Limit Reached":"Limite atteinte","Project not found":"Projet introuvable","This project no longer exists in Superflow. It may have been deleted.":"Ce projet n'existe plus dans Superflow. Il a peut-être été supprimé.","Open Superflow":"Ouvrir Superflow",Approve:"Approuver","Approving...":"Approbation...","Approved. Thank you.":"Approuvé. Merci.","Could not approve. Try again.":"Impossible d'approuver. Réessayez.",Approved:"Approuvé","Approved by {name} on {date}":"Approuvé par {name} le {date}","Approved on {date}":"Approuvé le {date}","QR code to open this page on your phone":"Code QR pour ouvrir cette page sur votre téléphone"}),Ih.set("hi",{"Show Comments on Page":"पृष्ठ पर टिप्पणियाँ दिखाएँ",Comment:"टिप्पणी","Commenting is disabled. Contact admin.":"टिप्पणी करना अक्षम है. व्यवस्थापक से संपर्क करें.","Arrow feature is disabled. Contact admin.":"तीर सुविधा अक्षम है. व्यवस्थापक से संपर्क करें.","All Comments":"सभी टिप्पणियाँ","Signing In":"साइन इन कर रहा है","Sign in again!":"फिर से साइन इन करें!","Sign in to comment":"टिप्पणी करने के लिए साइन इन करें",Superflow:"सुपरफ्लो","Sign in to comment on this page.":"इस पृष्ठ पर टिप्पणी करने के लिए साइन इन करें।","Join Community":"समुदाय में शामिल हों","Open in Mobile":"मोबाइल में खोलें","Exit Review Mode":"समीक्षा मोड से बाहर निकलें","Sign in":"साइन इन करें","Try Superflow using the toolbar below.":"टूलबार का उपयोग करके सुपरफ्लो का प्रयास करें।","Get ready to drop your first comment!":"अपनी पहली टिप्पणी डालने के लिए तैयार हो जाओ!","But before you do that, you definitely deserve a high five!":"लेकिन इससे पहले, आपको निश्चित रूप से एक उच्च पांच मिलता है!",Done:"किया हुआ","Sign in on the toolbar below and add":"टूलबार पर साइन इन करें और जोड़ें","comments on the design flaws.":"डिज़ाइन की खामियों पर टिप्पणियाँ।","Click to add comments on this page.":"इस पृष्ठ पर टिप्पणियाँ जोड़ने के लिए क्लिक करें।",Ok:"ठीक",Arrow:"तीर","Live Huddle":"लाइव हडल",Recording:"रेकॉर्डिंग","Open Comments":"टिप्पणियाँ खोलें",Views:"दृश्य",Internal:"आंतरिक",External:"बाहरी",All:"सब",Upgrade:"अपग्रेड","You don't have access.":"आपके पास पहुंच नहीं है।","Reach out to the admin of this project.":"इस परियोजना के व्यवस्थापक से संपर्क करें।","Your plan has expired! Please upgrade.":"आपकी योजना समाप्त हो गई है! कृपया अपग्रेड करें।","Your plan has expired!":"आपकी योजना समाप्त हो गई है!","Please contact the admin.":"कृपया व्यवस्थापक से संपर्क करें।",Share:"शेयर","Add comments & recordings on this page.":"इस पृष्ठ पर टिप्पणियाँ और रिकॉर्डिंग जोड़ें।","Learn more":"और अधिक जानें","View project":"परियोजना देखें","Sign Out":"साइन आउट","You’re a SuperFlow installation wizard!":"आप एक सुपरफ्लो स्थापना विज़ार्ड हैं!",Next:"आगामी","This workspace is over its plan limits. Comments are paused until the plan is updated.":"यह वर्कस्पेस अपनी योजना की सीमा से अधिक हो गया है। योजना अपडेट होने तक टिप्पणियाँ रोक दी गई हैं।","Ask your workspace admin to update the plan.":"अपने वर्कस्पेस व्यवस्थापक से योजना अपडेट करने के लिए कहें।","Limit Reached":"सीमा समाप्त","Project not found":"प्रोजेक्ट नहीं मिला","This project no longer exists in Superflow. It may have been deleted.":"यह प्रोजेक्ट अब Superflow में मौजूद नहीं है। इसे हटा दिया गया हो सकता है।","Open Superflow":"Superflow खोलें",Approve:"स्वीकृत करें","Approving...":"स्वीकृत किया जा रहा है...","Approved. Thank you.":"स्वीकृत। धन्यवाद।","Could not approve. Try again.":"स्वीकृत नहीं किया जा सका। फिर से प्रयास करें।",Approved:"स्वीकृत","Approved by {name} on {date}":"{name} द्वारा {date} को स्वीकृत","Approved on {date}":"{date} को स्वीकृत","QR code to open this page on your phone":"इस पेज को अपने फ़ोन पर खोलने के लिए QR कोड"}),Ih.set("it",{"Show Comments on Page":"Mostra i commenti sulla pagina",Comment:"Commento","Commenting is disabled. Contact admin.":"I commenti sono disabilitati. Contatta l'amministratore.","Arrow feature is disabled. Contact admin.":"La funzione freccia è disabilitata. Contatta l'amministratore.","All Comments":"Tutti i commenti","Signing In":"Accesso in corso","Sign in again!":"Accedi di nuovo!","Sign in to comment":"Accedi per commentare",Superflow:"Superflusso","Sign in to comment on this page.":"Accedi per commentare su questa pagina.","Join Community":"Unisciti alla comunità","Open in Mobile":"Apri su mobile","Exit Review Mode":"Esci dalla modalità di revisione","Sign in":"Accedi","Try Superflow using the toolbar below.":"Prova Superflusso utilizzando la barra degli strumenti qui sotto.","Get ready to drop your first comment!":"Preparati a lasciare il tuo primo commento!","But before you do that, you definitely deserve a high five!":"Ma prima di farlo, meriti sicuramente un cinque in alto!",Done:"Fatto","Sign in on the toolbar below and add":"Accedi alla barra degli strumenti qui sotto e aggiungi","comments on the design flaws.":"commenti sui difetti di progettazione.","Click to add comments on this page.":"Clicca per aggiungere commenti su questa pagina.",Ok:"Ok",Arrow:"Freccia","Live Huddle":"Riunione dal vivo",Recording:"Registrazione","Open Comments":"Apri commenti",Views:"Visualizzazioni",Internal:"Interno",External:"Esterno",All:"Tutti",Upgrade:"Aggiorna","You don't have access.":"Non hai accesso.","Reach out to the admin of this project.":"Contatta l'amministratore di questo progetto.","Your plan has expired! Please upgrade.":"Il tuo piano è scaduto! Si prega di aggiornare.","Your plan has expired!":"Il tuo piano è scaduto!","Please contact the admin.":"Si prega di contattare l'amministratore.",Share:"Condividi","Add comments & recordings on this page.":"Aggiungi commenti e registrazioni su questa pagina.","Learn more":"Scopri di più","View project":"Visualizza progetto","Sign Out":"Disconnetti","You’re a SuperFlow installation wizard!":"Sei un mago dell'installazione di Superflusso!",Next:"Avanti","This workspace is over its plan limits. Comments are paused until the plan is updated.":"Questo spazio di lavoro ha superato i limiti del suo piano. I commenti sono sospesi finché il piano non viene aggiornato.","Ask your workspace admin to update the plan.":"Chiedi all'amministratore del tuo spazio di lavoro di aggiornare il piano.","Limit Reached":"Limite raggiunto","Project not found":"Progetto non trovato","This project no longer exists in Superflow. It may have been deleted.":"Questo progetto non esiste più in Superflow. Potrebbe essere stato eliminato.","Open Superflow":"Apri Superflow",Approve:"Approva","Approving...":"Approvazione...","Approved. Thank you.":"Approvato. Grazie.","Could not approve. Try again.":"Impossibile approvare. Riprova.",Approved:"Approvato","Approved by {name} on {date}":"Approvato da {name} il {date}","Approved on {date}":"Approvato il {date}","QR code to open this page on your phone":"Codice QR per aprire questa pagina sul tuo telefono"}),Ih.set("ru",{"Show Comments on Page":"Показывать комментарии на странице",Comment:"Комментарий","Commenting is disabled. Contact admin.":"Комментирование отключено. Свяжитесь с админом.","Arrow feature is disabled. Contact admin.":"Функция стрелки отключена. Свяжитесь с администратором.","All Comments":"Все комментарии","Signing In":"Вход в систему","Sign in again!":"Войдите снова!","Sign in to comment":"Войдите, чтобы оставить комментарий",Superflow:"Суперпоток","Sign in to comment on this page.":"Войдите, чтобы оставить комментарий на этой странице.","Join Community":"Присоединиться к сообществу","Open in Mobile":"Открыть на мобильном","Exit Review Mode":"Выйти из режима обзора","Sign in":"Войти","Try Superflow using the toolbar below.":"Попробуйте Суперпоток, используя панель инструментов ниже.","Get ready to drop your first comment!":"Приготовьтесь оставить свой первый комментарий!","But before you do that, you definitely deserve a high five!":"Но перед этим вы определенно заслуживаете пять!",Done:"Сделано","Sign in on the toolbar below and add":"Войдите на панели инструментов ниже и добавьте","comments on the design flaws.":"комментарии об ошибках в дизайне.","Click to add comments on this page.":"Нажмите, чтобы добавить комментарии на этой странице.",Ok:"Ок",Arrow:"Стрелка","Live Huddle":"Прямой сбор",Recording:"Запись","Open Comments":"Открыть комментарии",Views:"Просмотры",Internal:"Внутренний",External:"Внешний",All:"Все",Upgrade:"Обновить","You don't have access.":"У вас нет доступа.","Reach out to the admin of this project.":"Обратитесь к администратору этого проекта.","Your plan has expired! Please upgrade.":"Ваш план истек! Пожалуйста, обновите.","Your plan has expired!":"Ваш план истек!","Please contact the admin.":"Пожалуйста, свяжитесь с администратором.",Share:"Поделиться","Add comments & recordings on this page.":"Добавьте комментарии и записи на этой странице.","Learn more":"Узнать больше","View project":"Посмотреть проект","Sign Out":"Выйти","You’re a SuperFlow installation wizard!":"Вы волшебник установки Суперпотока!",Next:"Далее","This workspace is over its plan limits. Comments are paused until the plan is updated.":"Это рабочее пространство превысило лимиты тарифа. Комментарии приостановлены до обновления тарифа.","Ask your workspace admin to update the plan.":"Попросите администратора рабочего пространства обновить тариф.","Limit Reached":"Лимит исчерпан","Project not found":"Проект не найден","This project no longer exists in Superflow. It may have been deleted.":"Этот проект больше не существует в Superflow. Возможно, он был удалён.","Open Superflow":"Открыть Superflow",Approve:"Одобрить","Approving...":"Одобрение...","Approved. Thank you.":"Одобрено. Спасибо.","Could not approve. Try again.":"Не удалось одобрить. Попробуйте ещё раз.",Approved:"Одобрено","Approved by {name} on {date}":"Одобрено: {name}, {date}","Approved on {date}":"Одобрено {date}","QR code to open this page on your phone":"QR-код, чтобы открыть эту страницу на телефоне"}),Ih.set("uk",{"Show Comments on Page":"Показувати коментарі на сторінці",Comment:"Коментар","Commenting is disabled. Contact admin.":"Коментування вимкнено. Зв'язатися з адміном.","Arrow feature is disabled. Contact admin.":"Функція стрілки вимкнена. Зв'язатися з адміном.","All Comments":"Всі коментарі","Signing In":"Увійти в систему","Sign in again!":"Увійдіть знову!","Sign in to comment":"Увійдіть, щоб залишити коментар",Superflow:"Суперпотік","Sign in to comment on this page.":"Увійдіть, щоб залишити коментар на цій сторінці.","Join Community":"Приєднатися до спільноти","Open in Mobile":"Відкрити на мобільному","Exit Review Mode":"Вийти з режиму огляду","Sign in":"Увійти","Try Superflow using the toolbar below.":"Спробуйте Суперпотік, використовуючи панель інструментів нижче.","Get ready to drop your first comment!":"Приготуйтеся залишити свій перший коментар!","But before you do that, you definitely deserve a high five!":"Але перед тим, як ви це зробите, ви точно заслуговуєте на високу п'ятірку!",Done:"Готово","Sign in on the toolbar below and add":"Увійдіть в панель інструментів нижче і додайте","comments on the design flaws.":"коментарі про помилки в дизайні.","Click to add comments on this page.":"Натисніть, щоб додати коментарі на цій сторінці.",Ok:"Добре",Arrow:"Стрілка","Live Huddle":"Пряма група",Recording:"Запис","Open Comments":"Відкрити коментарі",Views:"Перегляди",Internal:"Внутрішній",External:"Зовнішній",All:"Все",Upgrade:"Оновити","You don't have access.":"У вас немає доступу.","Reach out to the admin of this project.":"Зверніться до адміністратора цього проекту.","Your plan has expired! Please upgrade.":"Термін дії вашого плану закінчився! Будь ласка, оновіть.","Your plan has expired!":"Термін дії вашого плану закінчився!","Please contact the admin.":"Будь ласка, зв'яжіться з адміністратором.",Share:"Поділитися","Add comments & recordings on this page.":"Додайте коментарі та записи на цій сторінці.","Learn more":"Дізнатися більше","View project":"Переглянути проект","Sign Out":"Вийти","You’re a SuperFlow installation wizard!":"Ви чарівник встановлення Суперпотоку!",Next:"Далі","This workspace is over its plan limits. Comments are paused until the plan is updated.":"Цей робочий простір перевищив ліміти тарифу. Коментарі призупинено до оновлення тарифу.","Ask your workspace admin to update the plan.":"Попросіть адміністратора робочого простору оновити тариф.","Limit Reached":"Ліміт вичерпано","Project not found":"Проєкт не знайдено","This project no longer exists in Superflow. It may have been deleted.":"Цей проєкт більше не існує в Superflow. Можливо, його було видалено.","Open Superflow":"Відкрити Superflow",Approve:"Схвалити","Approving...":"Схвалення...","Approved. Thank you.":"Схвалено. Дякуємо.","Could not approve. Try again.":"Не вдалося схвалити. Спробуйте ще раз.",Approved:"Схвалено","Approved by {name} on {date}":"Схвалено: {name}, {date}","Approved on {date}":"Схвалено {date}","QR code to open this page on your phone":"QR-код, щоб відкрити цю сторінку на телефоні"});const _h=t=>{try{return t}catch(e){return t}},$h=l`
1562
1562
 
1563
1563
  .wrap {
1564
1564
  padding: 32px;
@@ -2176,7 +2176,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
2176
2176
  line-height: 2em;
2177
2177
  display: flex;
2178
2178
  flex-direction: column;
2179
- gap: ${Td(.4)};
2179
+ gap: ${Id(.4)};
2180
2180
 
2181
2181
  /* Position the tooltip text - see examples below! */
2182
2182
  position: absolute;
@@ -2292,7 +2292,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
2292
2292
  align-self: end;
2293
2293
  cursor: pointer;
2294
2294
  }
2295
- `,$h=l`
2295
+ `,Nh=l`
2296
2296
  @import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
2297
2297
 
2298
2298
  * {
@@ -2304,8 +2304,8 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
2304
2304
  bottom: 0;
2305
2305
  right: 0;
2306
2306
  z-index: 2147483577;
2307
- margin: ${Td(1.5)};
2308
- margin-bottom: ${Td(3)}; // Added to prevent overlap between plugin UI and webflow badge
2307
+ margin: ${Id(1.5)};
2308
+ margin-bottom: ${Id(3)}; // Added to prevent overlap between plugin UI and webflow badge
2309
2309
  max-width: 100vw !important;
2310
2310
  box-sizing: border-box;
2311
2311
 
@@ -2734,7 +2734,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
2734
2734
  }
2735
2735
 
2736
2736
  .s-presence-avatar-image-small {
2737
- width: ${Td(1.6)};
2737
+ width: ${Id(1.6)};
2738
2738
  height: auto;
2739
2739
  display: block;
2740
2740
  }
@@ -2855,7 +2855,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
2855
2855
 
2856
2856
  .s-user-avatar-initial {
2857
2857
  color: black !important;
2858
- font-size: ${Td(.8)} !important;
2858
+ font-size: ${Id(.8)} !important;
2859
2859
  position: relative !important;
2860
2860
  }
2861
2861
 
@@ -2888,8 +2888,8 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
2888
2888
  flex-direction: column;
2889
2889
  width: max-content;
2890
2890
  border-radius: 16px;
2891
- padding: ${Td(3)};
2892
- font-size: ${Td(.8)};
2891
+ padding: ${Id(3)};
2892
+ font-size: ${Id(.8)};
2893
2893
  color: #4c5366;
2894
2894
  box-sizing: border-box;
2895
2895
  }
@@ -2904,8 +2904,8 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
2904
2904
  }
2905
2905
 
2906
2906
  .s-modal img {
2907
- padding: ${Td(2,1,0,1)};
2908
- width: ${Td(8)};
2907
+ padding: ${Id(2,1,0,1)};
2908
+ width: ${Id(8)};
2909
2909
  }
2910
2910
 
2911
2911
  .s-modal-text h1 {
@@ -2914,7 +2914,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
2914
2914
  line-height: 32px;
2915
2915
  color: #4C5366;
2916
2916
  font-style: normal;
2917
- margin-bottom: ${Td(1)};
2917
+ margin-bottom: ${Id(1)};
2918
2918
  }
2919
2919
 
2920
2920
  .s-modal-text p {
@@ -2930,9 +2930,9 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
2930
2930
  display: flex;
2931
2931
  align-items: center;
2932
2932
  justify-content: center;
2933
- padding: ${Td(1,2.5)};
2934
- border-radius: ${Td(.8)};
2935
- font-size: ${Td(.8)};
2933
+ padding: ${Id(1,2.5)};
2934
+ border-radius: ${Id(.8)};
2935
+ font-size: ${Id(.8)};
2936
2936
  transition: 0.1s ease;
2937
2937
  cursor: pointer;
2938
2938
  }
@@ -2945,8 +2945,8 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
2945
2945
  }
2946
2946
 
2947
2947
  .s-modal-text {
2948
- gap: ${Td(.2)};
2949
- max-width: ${Td(30)};
2948
+ gap: ${Id(.2)};
2949
+ max-width: ${Id(30)};
2950
2950
  text-align: center;
2951
2951
  padding-left: 0px;
2952
2952
  padding-right: 0px;
@@ -3000,7 +3000,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
3000
3000
  .s-user-request-tool-button {
3001
3001
  display: flex;
3002
3002
  align-items: center;
3003
- gap: ${Td(1)};
3003
+ gap: ${Id(1)};
3004
3004
  }
3005
3005
 
3006
3006
  .s-user-request-tool-button svg {
@@ -3013,7 +3013,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
3013
3013
  .s-more-menu hr {
3014
3014
  width: 90%;
3015
3015
  border: 0;
3016
- border-top: ${Td(.01)} solid #D4D6DF;
3016
+ border-top: ${Id(.01)} solid #D4D6DF;
3017
3017
  margin: 8px auto;
3018
3018
  }
3019
3019
 
@@ -3091,8 +3091,8 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
3091
3091
  .dropdown-content .menu-point {
3092
3092
  display: flex;
3093
3093
  align-items: center;
3094
- gap: ${Td(.6)};
3095
- padding: ${Td(.6)};
3094
+ gap: ${Id(.6)};
3095
+ padding: ${Id(.6)};
3096
3096
  color: #ababb5;
3097
3097
  text-align: left;
3098
3098
  font-style: normal;
@@ -3131,7 +3131,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
3131
3131
  color: #FFCB00;
3132
3132
  display: flex;
3133
3133
  align-items: center;
3134
- gap: ${Td(.25)};
3134
+ gap: ${Id(.25)};
3135
3135
  font-size: 12px;
3136
3136
  color: grey;
3137
3137
  text-decoration: none;
@@ -3146,25 +3146,25 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
3146
3146
  }
3147
3147
 
3148
3148
  .menu-point.header {
3149
- gap: ${Td(.5)};
3149
+ gap: ${Id(.5)};
3150
3150
  }
3151
3151
 
3152
3152
  .menu-point-wrap {
3153
3153
  display: flex;
3154
3154
  flex-direction: column;
3155
3155
  color: #ababb5;
3156
- font-size: ${Td(.9)};
3157
- padding: ${Td(0,1,.25,1)};
3158
- gap: ${Td(.5)};
3156
+ font-size: ${Id(.9)};
3157
+ padding: ${Id(0,1,.25,1)};
3158
+ gap: ${Id(.5)};
3159
3159
  align-items: flex-start;
3160
3160
  width: 100%;
3161
- line-height: ${Td(1.4)};
3161
+ line-height: ${Id(1.4)};
3162
3162
 
3163
3163
  color: #4C5366;
3164
3164
  }
3165
3165
 
3166
3166
  .user-profile-section {
3167
- margin-left: ${Td(.5)};
3167
+ margin-left: ${Id(.5)};
3168
3168
  }
3169
3169
 
3170
3170
  .user-invite-tool-container {
@@ -3889,7 +3889,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
3889
3889
  display: none;
3890
3890
  }
3891
3891
  }
3892
- `,Nh=l`
3892
+ `,Oh=l`
3893
3893
  :host {
3894
3894
  display: flex;
3895
3895
  justify-content: center;
@@ -4404,7 +4404,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
4404
4404
  padding: var(--superflow-spacing-lg, 20px);
4405
4405
  }
4406
4406
  }
4407
- `;var Oh,Lh=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};!function(t){t.Admin="Admin",t.Commenter="Commenter"}(Oh||(Oh={}));let Rh=class extends tt{constructor(){super(...arguments),this.apiKey="",this.documentId="",this.disableInvite=!1,this.hasInviteAccess=!0,this.userSeatsExhausted=!1,this.userType=Oh.Admin,this.showCheckIcon=!1,this.contactListIsHovered=!1,this.invalidEmail=!1,this.isEmailValid=!1,this.inviting=!1,this.searchingUsers=!1,this.emailInput="",this.emailTags=[],this.editingTag=null,this.editingInput="",this.duplicateEmail="",this.filteredContacts=[],this.searchDebounceTimer=null,this.handleOutsideClick=t=>{try{t.target===this&&this.close()}catch(t){console.error("Error in handleOutsideClick:",t)}}}connectedCallback(){try{super.connectedCallback(),document.addEventListener("click",this.handleOutsideClick),this.userSeatsExhausted&&this.userType===Oh.Admin&&(this.userType=Oh.Commenter)}catch(t){console.error("Error in connectedCallback:",t)}}willUpdate(t){t.has("userSeatsExhausted")&&this.userSeatsExhausted&&this.userType===Oh.Admin&&(this.userType=Oh.Commenter)}disconnectedCallback(){try{super.disconnectedCallback(),document.removeEventListener("click",this.handleOutsideClick),this.searchDebounceTimer&&clearTimeout(this.searchDebounceTimer)}catch(t){console.error("Error in disconnectedCallback:",t)}}close(){try{this.dispatchEvent(new CustomEvent("superflow-invite-modal-close",{bubbles:!0,composed:!0}))}catch(t){console.error("Error in close:",t)}}validateEmail(t){try{const e=t.replace(/,/g,"").toLowerCase().trim();if(this.emailTags.some((t=>t.email===e)))return this.duplicateEmail=e,!1;if(this.duplicateEmail="",e.includes(" "))return!1;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}catch(t){return console.error("Error in validateEmail:",t),!1}}async searchUser(t=""){try{if(this.searchDebounceTimer&&clearTimeout(this.searchDebounceTimer),!t.trim())return this.filteredContacts=[],void(this.searchingUsers=!1);this.filteredContacts=[],this.searchingUsers=!1}catch(t){console.error("Error in searchUser:",t),this.searchingUsers=!1}}handleEmailChange(t){try{const e=t.target;this.emailInput=e.value,this.isEmailValid=this.validateEmail(e.value),this.searchUser(e.value)}catch(t){console.error("Error in handleEmailChange:",t)}}handleKeyUp(t){try{if(!this.emailInput)return this.invalidEmail=!1,void(this.isEmailValid=!1);if("Backspace"===t.code)return void(this.invalidEmail=!1);if("Enter"!==t.code&&"Comma"!==t.code)return;const e=this.emailInput.replace(/,/g,"").trim();if(!e)return;this.validateEmail(e)?(this.addEmailTag(e),this.emailInput="",this.invalidEmail=!1):(this.invalidEmail=!0,setTimeout((()=>{this.invalidEmail=!1}),1500))}catch(t){console.error("Error in handleKeyUp:",t)}}handlePaste(t){var e,i;try{t.preventDefault();const o=((null===(e=t.clipboardData)||void 0===e?void 0:e.getData("text"))||"").split(/[,\n|;]/).map((t=>t.trim())).filter((t=>t.length>0));let n=!1;o.forEach((t=>{this.emailTags.some((e=>e.email===t))?(this.duplicateEmail=t,this.emailInput=t,n=!0):this.validateEmail(t)?this.addEmailTag(t):(n=!0,this.emailInput=t)})),n&&(this.invalidEmail=!0,setTimeout((()=>{this.invalidEmail=!1}),1500)),null===(i=this.mainInput)||void 0===i||i.focus()}catch(t){console.error("Error in handlePaste:",t)}}addEmailTag(t){var e;try{if(!t)return;if(!this.validateEmail(t))return void(this.invalidEmail=!this.duplicateEmail);this.emailTags=[...this.emailTags,{name:"",email:t.toLowerCase().trim(),type:this.userType}],this.invalidEmail=!1,this.duplicateEmail="",this.emailInput="",this.contactListIsHovered=!1,null===(e=this.mainInput)||void 0===e||e.focus()}catch(t){console.error("Error in addEmailTag:",t)}}removeTag(t,e){var i;try{e.stopPropagation(),this.emailTags=this.emailTags.filter((e=>e.email!==t.email)),0===this.emailTags.length&&(this.isEmailValid=!1),null===(i=this.mainInput)||void 0===i||i.focus()}catch(e){console.error("Error in removeTag:",e)}}startEditingTag(t,e){try{e.stopPropagation(),this.editingTag=t,this.editingInput=t.email,setTimeout((()=>{var t;null===(t=this.editInput)||void 0===t||t.focus()}),100)}catch(e){console.error("Error in startEditingTag:",e)}}handleEditKeyUp(t){try{if("Enter"!==t.code&&"Escape"!==t.code)return;"Enter"===t.code&&this.editingInput&&this.validateEmail(this.editingInput)?this.updateEmailTag():this.cancelEmailTagEdit()}catch(t){console.error("Error in handleEditKeyUp:",t)}}updateEmailTag(){try{if(!this.editingTag||!this.validateEmail(this.editingInput))return void this.cancelEmailTagEdit();const t=this.emailTags.findIndex((t=>{var e;return t.email===(null===(e=this.editingTag)||void 0===e?void 0:e.email)}));if(-1===t)return void this.cancelEmailTagEdit();this.emailTags=[...this.emailTags.slice(0,t),{...this.editingTag,email:this.editingInput.toLowerCase().trim(),type:this.userType},...this.emailTags.slice(t+1)],this.cancelEmailTagEdit()}catch(t){console.error("Error in updateEmailTag:",t)}}cancelEmailTagEdit(){var t;try{this.editingTag=null,this.editingInput="",null===(t=this.mainInput)||void 0===t||t.focus()}catch(t){console.error("Error in cancelEmailTagEdit:",t)}}async copyReviewLink(){try{let t=window.location.href;const e=new URL(t);e.searchParams.has("review")&&"true"===e.searchParams.get("review")||(e.searchParams.set("review","true"),t=e.toString()),await navigator.clipboard.writeText(t),this.showCheckIcon=!0,setTimeout((()=>{this.showCheckIcon=!1}),2e3)}catch(t){console.error("Error copying review link:",t)}}setUserType(t){try{this.userType=t,this.emailTags=this.emailTags.map((t=>({...t,type:this.userType})))}catch(t){console.error("Error in setUserType:",t)}}async sendInvites(){try{if(this.disableInvite)return void this.dispatchEvent(new CustomEvent("superflow-invite-modal-invite-clicked",{detail:this.emailTags.map((t=>({email:t.email,type:t.type}))),bubbles:!0,composed:!0}));if(""!==this.emailInput.trim()&&this.isEmailValid&&(this.emailTags=[...this.emailTags,{name:"",email:this.emailInput.toLowerCase().trim(),type:this.userType}]),this.emailInput="",this.inviting=!0,this.userType===Oh.Commenter)await this.addCommenter();else{if(this.userType!==Oh.Admin)throw new Error("No User Type Selected");await this.addAdmin()}this.inviting=!1,this.close()}catch(t){console.error("Error sending invites:",t),this.inviting=!1}}async addAdmin(){try{if(0===this.emailTags.length)throw new Error("No email tags");const t=this.emailTags.map((t=>({email:t.email})));if(!await mh(this.apiKey,t))throw new Error("Failed to add admin users");this.dispatchEvent(new CustomEvent("superflow-invite-modal-invite-success",{detail:{users:t,type:"admin"},bubbles:!0,composed:!0}))}catch(t){throw console.error("Error adding admin:",t),t}}async addCommenter(){try{if(!this.emailTags.length)throw new Error("No email tags");const t=this.emailTags.map((t=>({email:t.email})));if(!await wh(this.apiKey,this.documentId,t))throw new Error("Failed to add commenter users");this.dispatchEvent(new CustomEvent("superflow-invite-modal-invite-success",{detail:{users:t,type:"commenter"},bubbles:!0,composed:!0}))}catch(t){throw console.error("Error adding commenter:",t),t}}upgradeToInvite(){try{this.dispatchEvent(new CustomEvent("superflow-invite-modal-upgrade-clicked",{bubbles:!0,composed:!0}))}catch(t){console.error("Error in upgradeToInvite:",t)}}render(){var t;const e=this.emailInput.length>0&&(this.mainInput===(null===(t=this.shadowRoot)||void 0===t?void 0:t.activeElement)||this.contactListIsHovered);return R`
4407
+ `;var Lh,Rh=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};!function(t){t.Admin="Admin",t.Commenter="Commenter"}(Lh||(Lh={}));let Dh=class extends tt{constructor(){super(...arguments),this.apiKey="",this.documentId="",this.disableInvite=!1,this.hasInviteAccess=!0,this.userSeatsExhausted=!1,this.userType=Lh.Admin,this.showCheckIcon=!1,this.contactListIsHovered=!1,this.invalidEmail=!1,this.isEmailValid=!1,this.inviting=!1,this.searchingUsers=!1,this.emailInput="",this.emailTags=[],this.editingTag=null,this.editingInput="",this.duplicateEmail="",this.filteredContacts=[],this.searchDebounceTimer=null,this.handleOutsideClick=t=>{try{t.target===this&&this.close()}catch(t){console.error("Error in handleOutsideClick:",t)}}}connectedCallback(){try{super.connectedCallback(),document.addEventListener("click",this.handleOutsideClick),this.userSeatsExhausted&&this.userType===Lh.Admin&&(this.userType=Lh.Commenter)}catch(t){console.error("Error in connectedCallback:",t)}}willUpdate(t){t.has("userSeatsExhausted")&&this.userSeatsExhausted&&this.userType===Lh.Admin&&(this.userType=Lh.Commenter)}disconnectedCallback(){try{super.disconnectedCallback(),document.removeEventListener("click",this.handleOutsideClick),this.searchDebounceTimer&&clearTimeout(this.searchDebounceTimer)}catch(t){console.error("Error in disconnectedCallback:",t)}}close(){try{this.dispatchEvent(new CustomEvent("superflow-invite-modal-close",{bubbles:!0,composed:!0}))}catch(t){console.error("Error in close:",t)}}validateEmail(t){try{const e=t.replace(/,/g,"").toLowerCase().trim();if(this.emailTags.some((t=>t.email===e)))return this.duplicateEmail=e,!1;if(this.duplicateEmail="",e.includes(" "))return!1;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}catch(t){return console.error("Error in validateEmail:",t),!1}}async searchUser(t=""){try{if(this.searchDebounceTimer&&clearTimeout(this.searchDebounceTimer),!t.trim())return this.filteredContacts=[],void(this.searchingUsers=!1);this.filteredContacts=[],this.searchingUsers=!1}catch(t){console.error("Error in searchUser:",t),this.searchingUsers=!1}}handleEmailChange(t){try{const e=t.target;this.emailInput=e.value,this.isEmailValid=this.validateEmail(e.value),this.searchUser(e.value)}catch(t){console.error("Error in handleEmailChange:",t)}}handleKeyUp(t){try{if(!this.emailInput)return this.invalidEmail=!1,void(this.isEmailValid=!1);if("Backspace"===t.code)return void(this.invalidEmail=!1);if("Enter"!==t.code&&"Comma"!==t.code)return;const e=this.emailInput.replace(/,/g,"").trim();if(!e)return;this.validateEmail(e)?(this.addEmailTag(e),this.emailInput="",this.invalidEmail=!1):(this.invalidEmail=!0,setTimeout((()=>{this.invalidEmail=!1}),1500))}catch(t){console.error("Error in handleKeyUp:",t)}}handlePaste(t){var e,i;try{t.preventDefault();const o=((null===(e=t.clipboardData)||void 0===e?void 0:e.getData("text"))||"").split(/[,\n|;]/).map((t=>t.trim())).filter((t=>t.length>0));let n=!1;o.forEach((t=>{this.emailTags.some((e=>e.email===t))?(this.duplicateEmail=t,this.emailInput=t,n=!0):this.validateEmail(t)?this.addEmailTag(t):(n=!0,this.emailInput=t)})),n&&(this.invalidEmail=!0,setTimeout((()=>{this.invalidEmail=!1}),1500)),null===(i=this.mainInput)||void 0===i||i.focus()}catch(t){console.error("Error in handlePaste:",t)}}addEmailTag(t){var e;try{if(!t)return;if(!this.validateEmail(t))return void(this.invalidEmail=!this.duplicateEmail);this.emailTags=[...this.emailTags,{name:"",email:t.toLowerCase().trim(),type:this.userType}],this.invalidEmail=!1,this.duplicateEmail="",this.emailInput="",this.contactListIsHovered=!1,null===(e=this.mainInput)||void 0===e||e.focus()}catch(t){console.error("Error in addEmailTag:",t)}}removeTag(t,e){var i;try{e.stopPropagation(),this.emailTags=this.emailTags.filter((e=>e.email!==t.email)),0===this.emailTags.length&&(this.isEmailValid=!1),null===(i=this.mainInput)||void 0===i||i.focus()}catch(e){console.error("Error in removeTag:",e)}}startEditingTag(t,e){try{e.stopPropagation(),this.editingTag=t,this.editingInput=t.email,setTimeout((()=>{var t;null===(t=this.editInput)||void 0===t||t.focus()}),100)}catch(e){console.error("Error in startEditingTag:",e)}}handleEditKeyUp(t){try{if("Enter"!==t.code&&"Escape"!==t.code)return;"Enter"===t.code&&this.editingInput&&this.validateEmail(this.editingInput)?this.updateEmailTag():this.cancelEmailTagEdit()}catch(t){console.error("Error in handleEditKeyUp:",t)}}updateEmailTag(){try{if(!this.editingTag||!this.validateEmail(this.editingInput))return void this.cancelEmailTagEdit();const t=this.emailTags.findIndex((t=>{var e;return t.email===(null===(e=this.editingTag)||void 0===e?void 0:e.email)}));if(-1===t)return void this.cancelEmailTagEdit();this.emailTags=[...this.emailTags.slice(0,t),{...this.editingTag,email:this.editingInput.toLowerCase().trim(),type:this.userType},...this.emailTags.slice(t+1)],this.cancelEmailTagEdit()}catch(t){console.error("Error in updateEmailTag:",t)}}cancelEmailTagEdit(){var t;try{this.editingTag=null,this.editingInput="",null===(t=this.mainInput)||void 0===t||t.focus()}catch(t){console.error("Error in cancelEmailTagEdit:",t)}}async copyReviewLink(){try{let t=window.location.href;const e=new URL(t);e.searchParams.has("review")&&"true"===e.searchParams.get("review")||(e.searchParams.set("review","true"),t=e.toString()),await navigator.clipboard.writeText(t),this.showCheckIcon=!0,setTimeout((()=>{this.showCheckIcon=!1}),2e3)}catch(t){console.error("Error copying review link:",t)}}setUserType(t){try{this.userType=t,this.emailTags=this.emailTags.map((t=>({...t,type:this.userType})))}catch(t){console.error("Error in setUserType:",t)}}async sendInvites(){try{if(this.disableInvite)return void this.dispatchEvent(new CustomEvent("superflow-invite-modal-invite-clicked",{detail:this.emailTags.map((t=>({email:t.email,type:t.type}))),bubbles:!0,composed:!0}));if(""!==this.emailInput.trim()&&this.isEmailValid&&(this.emailTags=[...this.emailTags,{name:"",email:this.emailInput.toLowerCase().trim(),type:this.userType}]),this.emailInput="",this.inviting=!0,this.userType===Lh.Commenter)await this.addCommenter();else{if(this.userType!==Lh.Admin)throw new Error("No User Type Selected");await this.addAdmin()}this.inviting=!1,this.close()}catch(t){console.error("Error sending invites:",t),this.inviting=!1}}async addAdmin(){try{if(0===this.emailTags.length)throw new Error("No email tags");const t=this.emailTags.map((t=>({email:t.email})));if(!await wh(this.apiKey,t))throw new Error("Failed to add admin users");this.dispatchEvent(new CustomEvent("superflow-invite-modal-invite-success",{detail:{users:t,type:"admin"},bubbles:!0,composed:!0}))}catch(t){throw console.error("Error adding admin:",t),t}}async addCommenter(){try{if(!this.emailTags.length)throw new Error("No email tags");const t=this.emailTags.map((t=>({email:t.email})));if(!await yh(this.apiKey,this.documentId,t))throw new Error("Failed to add commenter users");this.dispatchEvent(new CustomEvent("superflow-invite-modal-invite-success",{detail:{users:t,type:"commenter"},bubbles:!0,composed:!0}))}catch(t){throw console.error("Error adding commenter:",t),t}}upgradeToInvite(){try{this.dispatchEvent(new CustomEvent("superflow-invite-modal-upgrade-clicked",{bubbles:!0,composed:!0}))}catch(t){console.error("Error in upgradeToInvite:",t)}}render(){var t;const e=this.emailInput.length>0&&(this.mainInput===(null===(t=this.shadowRoot)||void 0===t?void 0:t.activeElement)||this.contactListIsHovered);return R`
4408
4408
  <div class="share-modal">
4409
4409
  <div class="share-modal-content">
4410
4410
  <div class="share-modal-header ${ut({locked:!this.hasInviteAccess})}">
@@ -4421,7 +4421,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
4421
4421
  d="M8 11v-4a4 4 0 1 1 8 0v4" />
4422
4422
  </svg>
4423
4423
  `}
4424
- <h2>${Ih("Invite Users")}</h2>
4424
+ <h2>${_h("Invite Users")}</h2>
4425
4425
  </div>
4426
4426
  ${this.hasInviteAccess?"":R`
4427
4427
  <p class="share-modal-header-description">Upgrade to invite more users</p>
@@ -4522,8 +4522,8 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
4522
4522
  .value=${this.userType}
4523
4523
  @change=${t=>this.setUserType(t.target.value)}
4524
4524
  >
4525
- ${this.userSeatsExhausted?"":R`<option value="${Oh.Admin}">Admin</option>`}
4526
- <option value="${Oh.Commenter}">Guest</option>
4525
+ ${this.userSeatsExhausted?"":R`<option value="${Lh.Admin}">Admin</option>`}
4526
+ <option value="${Lh.Commenter}">Guest</option>
4527
4527
  </select>
4528
4528
  </div>
4529
4529
  </div>
@@ -4575,7 +4575,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
4575
4575
  </div>
4576
4576
  </div>
4577
4577
  </div>
4578
- `}};var Dh;Rh.styles=Nh,Lh([nt({type:String})],Rh.prototype,"apiKey",void 0),Lh([nt({type:String})],Rh.prototype,"documentId",void 0),Lh([nt({type:Boolean})],Rh.prototype,"disableInvite",void 0),Lh([nt({type:Boolean})],Rh.prototype,"hasInviteAccess",void 0),Lh([nt({type:Boolean})],Rh.prototype,"userSeatsExhausted",void 0),Lh([rt()],Rh.prototype,"userType",void 0),Lh([rt()],Rh.prototype,"showCheckIcon",void 0),Lh([rt()],Rh.prototype,"contactListIsHovered",void 0),Lh([rt()],Rh.prototype,"invalidEmail",void 0),Lh([rt()],Rh.prototype,"isEmailValid",void 0),Lh([rt()],Rh.prototype,"inviting",void 0),Lh([rt()],Rh.prototype,"searchingUsers",void 0),Lh([rt()],Rh.prototype,"emailInput",void 0),Lh([rt()],Rh.prototype,"emailTags",void 0),Lh([rt()],Rh.prototype,"editingTag",void 0),Lh([rt()],Rh.prototype,"editingInput",void 0),Lh([rt()],Rh.prototype,"duplicateEmail",void 0),Lh([rt()],Rh.prototype,"filteredContacts",void 0),Lh([st("#mainInput")],Rh.prototype,"mainInput",void 0),Lh([st("#editInput")],Rh.prototype,"editInput",void 0),Rh=Lh([it("superflow-invite-modal")],Rh),function(t){t.LOG="log",t.INFO="info",t.WARN="warn",t.ERROR="error",t.DEBUG="debug"}(Dh||(Dh={}));const Fh=new class{constructor(){this.consoleBuffer=[],this.errorBuffer=[],this.networkBuffer=[],this.environmentSnapshot=null,this.installed=!1,this.capturing=!1,this.nativeConsoleMethods={},this.nativeConsoleError=()=>{},this.originalFetch=null,this.originalXhrOpen=null,this.originalXhrSend=null,this.handleWindowError=t=>{try{const e=(null==t?void 0:t.error)instanceof Error?t.error:null==t?void 0:t.message;this.captureErrorEntry(this.describeErrorMessage(e),this.extractStackFrames(null==t?void 0:t.error),"error")}catch(t){this.logInternalError("handleWindowError",t)}},this.handleUnhandledRejection=t=>{try{const e=null==t?void 0:t.reason;this.captureErrorEntry(this.describeErrorMessage(e),this.extractStackFrames(e),"unhandledrejection")}catch(t){this.logInternalError("handleUnhandledRejection",t)}}}install(){try{if(this.installed)return;this.installed=!0,this.captureEnvironmentSnapshot(),this.installConsolePatch(),this.installErrorListeners(),this.installNetworkPatch()}catch(t){this.logInternalError("install",t)}}teardown(){try{this.restoreConsolePatch(),this.removeErrorListeners(),this.restoreNetworkPatch(),this.installed=!1}catch(t){this.logInternalError("teardown",t)}}buildDigest(t){var e;try{const i={schemaVersion:1,capturedAt:Date.now(),route:t.route,env:null!==(e=this.environmentSnapshot)&&void 0!==e?e:this.buildFallbackEnvironment(),workspaceId:null,projectId:t.projectId,userId:t.userId,userEmail:t.userEmail,sentryEventId:null,counts:{console:this.consoleBuffer.length,errors:this.errorBuffer.length,networkFailures:this.networkBuffer.length,navigations:0,interactions:0},topErrors:this.buildTopErrors(),recentNetworkFailures:this.takeMostRecent(this.networkBuffer,Be.digestListSize),recentNavigations:[],truncated:!1};return this.shrinkDigestToFit(i)}catch(t){throw this.logInternalError("buildDigest",t),t}}buildBundle(){var t;try{const e={schemaVersion:1,capturedAt:Date.now(),env:null!==(t=this.environmentSnapshot)&&void 0!==t?t:this.buildFallbackEnvironment(),console:[...this.consoleBuffer],errors:[...this.errorBuffer],network:[...this.networkBuffer],navigation:[],interactions:[],truncated:!1};return this.shrinkBundleToFit(e)}catch(t){throw this.logInternalError("buildBundle",t),t}}captureEnvironmentSnapshot(){var t,e,i,o,n;try{const r=window.navigator;this.environmentSnapshot={release:"",environmentName:"",userAgent:null!==(t=null==r?void 0:r.userAgent)&&void 0!==t?t:"",viewport:`${window.innerWidth}x${window.innerHeight}`,devicePixelRatio:window.devicePixelRatio||1,language:null!==(e=null==r?void 0:r.language)&&void 0!==e?e:"",timezone:null!==(i=Intl.DateTimeFormat().resolvedOptions().timeZone)&&void 0!==i?i:"",connection:null!==(n=null===(o=null==r?void 0:r.connection)||void 0===o?void 0:o.effectiveType)&&void 0!==n?n:null,deviceMemoryGb:"number"==typeof(null==r?void 0:r.deviceMemory)?r.deviceMemory:null}}catch(t){this.logInternalError("captureEnvironmentSnapshot",t),this.environmentSnapshot=this.buildFallbackEnvironment()}}buildFallbackEnvironment(){try{return{release:"",environmentName:"",userAgent:"",viewport:"",devicePixelRatio:1,language:"",timezone:"",connection:null,deviceMemoryGb:null}}catch(t){throw this.logInternalError("buildFallbackEnvironment",t),t}}setEnvironmentContext(t,e){try{this.environmentSnapshot||this.captureEnvironmentSnapshot(),this.environmentSnapshot&&(this.environmentSnapshot.release=null!=t?t:"",this.environmentSnapshot.environmentName=null!=e?e:"")}catch(t){this.logInternalError("setEnvironmentContext",t)}}installConsolePatch(){var t;try{const e=window.console,i=[Dh.LOG,Dh.INFO,Dh.WARN,Dh.ERROR,Dh.DEBUG];for(const t of i){const i=e[t];"function"==typeof i&&(this.nativeConsoleMethods[t]=i,e[t]=this.wrapNativeConsoleMethod(t,i))}this.nativeConsoleError=null!==(t=this.nativeConsoleMethods[Dh.ERROR])&&void 0!==t?t:()=>{}}catch(t){this.logInternalError("installConsolePatch",t)}}restoreConsolePatch(){try{const t=window.console;for(const[e,i]of Object.entries(this.nativeConsoleMethods))"function"==typeof i&&(t[e]=i);this.nativeConsoleMethods={}}catch(t){this.logInternalError("restoreConsolePatch",t)}}wrapNativeConsoleMethod(t,e){try{return(...i)=>{try{if(!this.capturing){this.capturing=!0;try{this.captureConsoleEntry(t,i)}finally{this.capturing=!1}}}catch(t){this.logInternalError("wrapNativeConsoleMethod capture",t)}finally{try{e.apply(window.console,i)}catch{}}}}catch(t){return this.logInternalError("wrapNativeConsoleMethod",t),e}}captureConsoleEntry(t,e){try{const i=this.truncate(this.redact(this.serialiseConsoleArgs(e))),o={ts:Date.now(),level:t,message:i};this.pushBounded(this.consoleBuffer,o,Ue.console)}catch(t){this.logInternalError("captureConsoleEntry",t)}}installErrorListeners(){try{window.addEventListener("error",this.handleWindowError),window.addEventListener("unhandledrejection",this.handleUnhandledRejection)}catch(t){this.logInternalError("installErrorListeners",t)}}removeErrorListeners(){try{window.removeEventListener("error",this.handleWindowError),window.removeEventListener("unhandledrejection",this.handleUnhandledRejection)}catch(t){this.logInternalError("removeErrorListeners",t)}}captureErrorEntry(t,e,i){try{const o={ts:Date.now(),message:this.truncate(this.redact(t)),source:i,stack:e};this.pushBounded(this.errorBuffer,o,Ue.errors)}catch(t){this.logInternalError("captureErrorEntry",t)}}describeErrorMessage(t){try{return t instanceof Error?t.message||t.name||"Unknown error":"string"==typeof t?t:this.safeStringify(t)}catch(t){return this.logInternalError("describeErrorMessage",t),"Unknown error"}}extractStackFrames(t){try{return t instanceof Error&&"string"==typeof t.stack?t.stack.split("\n").slice(1,1+Be.maxStackFrames).map((t=>this.redact(t.trim()))).filter((t=>t.length>0)):[]}catch(t){return this.logInternalError("extractStackFrames",t),[]}}installNetworkPatch(){try{this.installFetchPatch(),this.installXhrPatch()}catch(t){this.logInternalError("installNetworkPatch",t)}}restoreNetworkPatch(){try{this.originalFetch&&(window.fetch=this.originalFetch,this.originalFetch=null),this.originalXhrOpen&&(XMLHttpRequest.prototype.open=this.originalXhrOpen,this.originalXhrOpen=null),this.originalXhrSend&&(XMLHttpRequest.prototype.send=this.originalXhrSend,this.originalXhrSend=null)}catch(t){this.logInternalError("restoreNetworkPatch",t)}}installFetchPatch(){try{if("function"!=typeof window.fetch)return;this.originalFetch=window.fetch;const t=this.originalFetch;window.fetch=(...e)=>this.dispatchFetch(t,e)}catch(t){this.logInternalError("installFetchPatch",t)}}dispatchFetch(t,e){const i=Date.now(),o=e[0],n=e[1];return t.apply(window,e).then((t=>{try{t.ok||this.captureNetworkEntry(this.resolveRequestMethod(o,n),this.resolveRequestUrl(o),t.status,Date.now()-i)}catch(t){this.logInternalError("dispatchFetch success handler",t)}return t})).catch((t=>{try{this.captureNetworkEntry(this.resolveRequestMethod(o,n),this.resolveRequestUrl(o),0,Date.now()-i)}catch(t){this.logInternalError("dispatchFetch failure handler",t)}throw t}))}resolveRequestUrl(t){try{const e=t instanceof Request?t.url:String(t);return this.sanitiseUrl(e)}catch(t){return this.logInternalError("resolveRequestUrl",t),""}}resolveRequestMethod(t,e){try{return(null==e?void 0:e.method)?e.method.toUpperCase():t instanceof Request&&t.method?t.method.toUpperCase():"GET"}catch(t){return this.logInternalError("resolveRequestMethod",t),"GET"}}sanitiseUrl(t){try{const e=new URL(t,window.location.origin);return`${e.origin}${e.pathname}`}catch(t){return this.logInternalError("sanitiseUrl",t),""}}installXhrPatch(){try{const t=XMLHttpRequest.prototype.open,e=XMLHttpRequest.prototype.send;this.originalXhrOpen=t,this.originalXhrSend=e;const i=(t,e)=>this.handleXhrLoadEnd(t,e);XMLHttpRequest.prototype.open=function(e,i,...o){return this.A=e,this.I=String(i),t.call(this,e,i,...o)},XMLHttpRequest.prototype.send=function(...t){const o=Date.now();return this.addEventListener("loadend",(()=>{try{i(this,o)}catch(t){console.warn("Error in BugTelemetry xhr loadend handler: ",t)}})),e.apply(this,t)}}catch(t){this.logInternalError("installXhrPatch",t)}}handleXhrLoadEnd(t,e){var i,o;try{const n=t.status;if(!(0===n||n>=400))return;this.captureNetworkEntry((null!==(i=t.A)&&void 0!==i?i:"GET").toUpperCase(),this.sanitiseUrl(null!==(o=t.I)&&void 0!==o?o:""),n,Date.now()-e)}catch(t){this.logInternalError("handleXhrLoadEnd",t)}}captureNetworkEntry(t,e,i,o){try{const n={ts:Date.now(),method:t,url:e,status:i,durationMs:o};this.pushBounded(this.networkBuffer,n,Ue.network)}catch(t){this.logInternalError("captureNetworkEntry",t)}}redact(t){try{let e=t;for(const t of ze)t.replacement,e=e.replace(t.pattern,t.replacement);return e}catch(e){return this.logInternalError("redact",e),t}}truncate(t){try{return t.length<=Be.maxEntryChars?t:`${t.slice(0,Be.maxEntryChars-3)}...`}catch(e){return this.logInternalError("truncate",e),t}}serialiseConsoleArgs(t){try{return t.map((t=>"string"==typeof t?t:this.safeStringify(t))).join(" ")}catch(t){return this.logInternalError("serialiseConsoleArgs",t),"[unserialisable console arguments]"}}safeStringify(t){try{if("string"==typeof t)return t;if(t instanceof Error)return`${t.name}: ${t.message}`;if("undefined"!=typeof Node&&t instanceof Node)return this.describeDomNode(t);const e=new WeakSet,i=JSON.stringify(t,((t,i)=>this.replaceForSerialisation(i,e)));return null!=i?i:this.stringifyFallback(t)}catch(e){return this.logInternalError("safeStringify",e),this.stringifyFallback(t)}}replaceForSerialisation(t,e){try{if("object"==typeof t&&null!==t){if(e.has(t))return"[Circular]";e.add(t)}return t instanceof Error?`${t.name}: ${t.message}`:"undefined"!=typeof Node&&t instanceof Node?this.describeDomNode(t):t}catch{return"[Unserialisable]"}}describeDomNode(t){try{const e=t;return`<${(null==e?void 0:e.tagName)?e.tagName.toLowerCase():t.nodeName}>`}catch(t){return this.logInternalError("describeDomNode",t),"[DOMNode]"}}stringifyFallback(t){try{return String(t)}catch(t){return this.logInternalError("stringifyFallback",t),"[Unserialisable]"}}buildTopErrors(){try{const t=new Map;for(const e of this.errorBuffer)this.mergeErrorIntoSummaries(t,e);return Array.from(t.values()).sort(((t,e)=>e.lastSeenTs-t.lastSeenTs)).slice(0,Be.digestListSize)}catch(t){return this.logInternalError("buildTopErrors",t),[]}}mergeErrorIntoSummaries(t,e){try{const i=this.normaliseErrorMessage(e.message),o=t.get(i);if(o)return o.count+=1,o.firstSeenTs=Math.min(o.firstSeenTs,e.ts),void(o.lastSeenTs=Math.max(o.lastSeenTs,e.ts));t.set(i,{message:e.message,count:1,firstSeenTs:e.ts,lastSeenTs:e.ts})}catch(t){this.logInternalError("mergeErrorIntoSummaries",t)}}normaliseErrorMessage(t){try{return t.toLowerCase().replace(/\d/g,"0").replace(/\s+/g," ").trim()}catch(e){return this.logInternalError("normaliseErrorMessage",e),t}}shrinkDigestToFit(t){try{if(this.byteSize(t)<=Be.maxDigestBytes)return t;let e={...t,recentNavigations:[],truncated:!0};return this.byteSize(e)<=Be.maxDigestBytes?e:(e={...e,recentNetworkFailures:[]},this.byteSize(e)<=Be.maxDigestBytes?e:this.shrinkTopErrors(e))}catch(t){throw this.logInternalError("shrinkDigestToFit",t),t}}shrinkTopErrors(t){try{let e=[...t.topErrors],i={...t,topErrors:e};for(;e.length>1&&this.byteSize(i)>Be.maxDigestBytes;)e=e.slice(0,-1),i={...i,topErrors:e};return this.byteSize(i)<=Be.maxDigestBytes?i:this.truncateTopErrorMessages(i)}catch(e){return this.logInternalError("shrinkTopErrors",e),{...t,topErrors:[],truncated:!0}}}truncateTopErrorMessages(t){try{let e=200;for(;e>=10;){const i=t.topErrors.map((t=>({...t,message:t.message.slice(0,e)}))),o={...t,topErrors:i,truncated:!0};if(this.byteSize(o)<=Be.maxDigestBytes)return o;e=Math.floor(e/2)}return{...t,topErrors:[],truncated:!0}}catch(e){return this.logInternalError("truncateTopErrorMessages",e),{...t,topErrors:[],truncated:!0}}}shrinkBundleToFit(t){try{if(this.byteSize(t)<=Be.maxBundleBytes)return t;const e={...t,console:[...t.console],errors:[...t.errors],network:[...t.network],navigation:[],interactions:[],truncated:!0};for(;this.byteSize(e)>Be.maxBundleBytes;){const t=this.findOldestNonEmptySection(e);if(!t)break;e[t].shift()}return e}catch(t){throw this.logInternalError("shrinkBundleToFit",t),t}}findOldestNonEmptySection(t){try{const e=["console","errors","network"];let i=null,o=Number.POSITIVE_INFINITY;for(const n of e){const e=t[n];0!==e.length&&(e[0].ts<o&&(o=e[0].ts,i=n))}return i}catch(t){return this.logInternalError("findOldestNonEmptySection",t),null}}byteSize(t){try{return(new TextEncoder).encode(JSON.stringify(t)).length}catch(t){return this.logInternalError("byteSize",t),Number.MAX_SAFE_INTEGER}}pushBounded(t,e,i){try{for(t.push(e);t.length>i;)t.shift()}catch(t){this.logInternalError("pushBounded",t)}}takeMostRecent(t,e){try{return t.slice(-e).reverse()}catch(t){return this.logInternalError("takeMostRecent",t),[]}}logInternalError(t,e){var i;try{const o=this.nativeConsoleError||(null===(i=window.console)||void 0===i?void 0:i.error);null==o||o.apply(window.console,[`Error in BugTelemetry ${t}: `,e])}catch{}}};var Ph=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const jh=l`
4578
+ `}};var Fh;Dh.styles=Oh,Rh([nt({type:String})],Dh.prototype,"apiKey",void 0),Rh([nt({type:String})],Dh.prototype,"documentId",void 0),Rh([nt({type:Boolean})],Dh.prototype,"disableInvite",void 0),Rh([nt({type:Boolean})],Dh.prototype,"hasInviteAccess",void 0),Rh([nt({type:Boolean})],Dh.prototype,"userSeatsExhausted",void 0),Rh([rt()],Dh.prototype,"userType",void 0),Rh([rt()],Dh.prototype,"showCheckIcon",void 0),Rh([rt()],Dh.prototype,"contactListIsHovered",void 0),Rh([rt()],Dh.prototype,"invalidEmail",void 0),Rh([rt()],Dh.prototype,"isEmailValid",void 0),Rh([rt()],Dh.prototype,"inviting",void 0),Rh([rt()],Dh.prototype,"searchingUsers",void 0),Rh([rt()],Dh.prototype,"emailInput",void 0),Rh([rt()],Dh.prototype,"emailTags",void 0),Rh([rt()],Dh.prototype,"editingTag",void 0),Rh([rt()],Dh.prototype,"editingInput",void 0),Rh([rt()],Dh.prototype,"duplicateEmail",void 0),Rh([rt()],Dh.prototype,"filteredContacts",void 0),Rh([st("#mainInput")],Dh.prototype,"mainInput",void 0),Rh([st("#editInput")],Dh.prototype,"editInput",void 0),Dh=Rh([it("superflow-invite-modal")],Dh),function(t){t.LOG="log",t.INFO="info",t.WARN="warn",t.ERROR="error",t.DEBUG="debug"}(Fh||(Fh={}));const Ph=new class{constructor(){this.consoleBuffer=[],this.errorBuffer=[],this.networkBuffer=[],this.environmentSnapshot=null,this.installed=!1,this.capturing=!1,this.nativeConsoleMethods={},this.nativeConsoleError=()=>{},this.originalFetch=null,this.originalXhrOpen=null,this.originalXhrSend=null,this.handleWindowError=t=>{try{const e=(null==t?void 0:t.error)instanceof Error?t.error:null==t?void 0:t.message;this.captureErrorEntry(this.describeErrorMessage(e),this.extractStackFrames(null==t?void 0:t.error),"error")}catch(t){this.logInternalError("handleWindowError",t)}},this.handleUnhandledRejection=t=>{try{const e=null==t?void 0:t.reason;this.captureErrorEntry(this.describeErrorMessage(e),this.extractStackFrames(e),"unhandledrejection")}catch(t){this.logInternalError("handleUnhandledRejection",t)}}}install(){try{if(this.installed)return;this.installed=!0,this.captureEnvironmentSnapshot(),this.installConsolePatch(),this.installErrorListeners(),this.installNetworkPatch()}catch(t){this.logInternalError("install",t)}}teardown(){try{this.restoreConsolePatch(),this.removeErrorListeners(),this.restoreNetworkPatch(),this.installed=!1}catch(t){this.logInternalError("teardown",t)}}buildDigest(t){var e;try{const i={schemaVersion:1,capturedAt:Date.now(),route:t.route,env:null!==(e=this.environmentSnapshot)&&void 0!==e?e:this.buildFallbackEnvironment(),workspaceId:null,projectId:t.projectId,userId:t.userId,userEmail:t.userEmail,sentryEventId:null,counts:{console:this.consoleBuffer.length,errors:this.errorBuffer.length,networkFailures:this.networkBuffer.length,navigations:0,interactions:0},topErrors:this.buildTopErrors(),recentNetworkFailures:this.takeMostRecent(this.networkBuffer,ze.digestListSize),recentNavigations:[],truncated:!1};return this.shrinkDigestToFit(i)}catch(t){throw this.logInternalError("buildDigest",t),t}}buildBundle(){var t;try{const e={schemaVersion:1,capturedAt:Date.now(),env:null!==(t=this.environmentSnapshot)&&void 0!==t?t:this.buildFallbackEnvironment(),console:[...this.consoleBuffer],errors:[...this.errorBuffer],network:[...this.networkBuffer],navigation:[],interactions:[],truncated:!1};return this.shrinkBundleToFit(e)}catch(t){throw this.logInternalError("buildBundle",t),t}}captureEnvironmentSnapshot(){var t,e,i,o,n;try{const r=window.navigator;this.environmentSnapshot={release:"",environmentName:"",userAgent:null!==(t=null==r?void 0:r.userAgent)&&void 0!==t?t:"",viewport:`${window.innerWidth}x${window.innerHeight}`,devicePixelRatio:window.devicePixelRatio||1,language:null!==(e=null==r?void 0:r.language)&&void 0!==e?e:"",timezone:null!==(i=Intl.DateTimeFormat().resolvedOptions().timeZone)&&void 0!==i?i:"",connection:null!==(n=null===(o=null==r?void 0:r.connection)||void 0===o?void 0:o.effectiveType)&&void 0!==n?n:null,deviceMemoryGb:"number"==typeof(null==r?void 0:r.deviceMemory)?r.deviceMemory:null}}catch(t){this.logInternalError("captureEnvironmentSnapshot",t),this.environmentSnapshot=this.buildFallbackEnvironment()}}buildFallbackEnvironment(){try{return{release:"",environmentName:"",userAgent:"",viewport:"",devicePixelRatio:1,language:"",timezone:"",connection:null,deviceMemoryGb:null}}catch(t){throw this.logInternalError("buildFallbackEnvironment",t),t}}setEnvironmentContext(t,e){try{this.environmentSnapshot||this.captureEnvironmentSnapshot(),this.environmentSnapshot&&(this.environmentSnapshot.release=null!=t?t:"",this.environmentSnapshot.environmentName=null!=e?e:"")}catch(t){this.logInternalError("setEnvironmentContext",t)}}installConsolePatch(){var t;try{const e=window.console,i=[Fh.LOG,Fh.INFO,Fh.WARN,Fh.ERROR,Fh.DEBUG];for(const t of i){const i=e[t];"function"==typeof i&&(this.nativeConsoleMethods[t]=i,e[t]=this.wrapNativeConsoleMethod(t,i))}this.nativeConsoleError=null!==(t=this.nativeConsoleMethods[Fh.ERROR])&&void 0!==t?t:()=>{}}catch(t){this.logInternalError("installConsolePatch",t)}}restoreConsolePatch(){try{const t=window.console;for(const[e,i]of Object.entries(this.nativeConsoleMethods))"function"==typeof i&&(t[e]=i);this.nativeConsoleMethods={}}catch(t){this.logInternalError("restoreConsolePatch",t)}}wrapNativeConsoleMethod(t,e){try{return(...i)=>{try{if(!this.capturing){this.capturing=!0;try{this.captureConsoleEntry(t,i)}finally{this.capturing=!1}}}catch(t){this.logInternalError("wrapNativeConsoleMethod capture",t)}finally{try{e.apply(window.console,i)}catch{}}}}catch(t){return this.logInternalError("wrapNativeConsoleMethod",t),e}}captureConsoleEntry(t,e){try{const i=this.truncate(this.redact(this.serialiseConsoleArgs(e))),o={ts:Date.now(),level:t,message:i};this.pushBounded(this.consoleBuffer,o,Be.console)}catch(t){this.logInternalError("captureConsoleEntry",t)}}installErrorListeners(){try{window.addEventListener("error",this.handleWindowError),window.addEventListener("unhandledrejection",this.handleUnhandledRejection)}catch(t){this.logInternalError("installErrorListeners",t)}}removeErrorListeners(){try{window.removeEventListener("error",this.handleWindowError),window.removeEventListener("unhandledrejection",this.handleUnhandledRejection)}catch(t){this.logInternalError("removeErrorListeners",t)}}captureErrorEntry(t,e,i){try{const o={ts:Date.now(),message:this.truncate(this.redact(t)),source:i,stack:e};this.pushBounded(this.errorBuffer,o,Be.errors)}catch(t){this.logInternalError("captureErrorEntry",t)}}describeErrorMessage(t){try{return t instanceof Error?t.message||t.name||"Unknown error":"string"==typeof t?t:this.safeStringify(t)}catch(t){return this.logInternalError("describeErrorMessage",t),"Unknown error"}}extractStackFrames(t){try{return t instanceof Error&&"string"==typeof t.stack?t.stack.split("\n").slice(1,1+ze.maxStackFrames).map((t=>this.redact(t.trim()))).filter((t=>t.length>0)):[]}catch(t){return this.logInternalError("extractStackFrames",t),[]}}installNetworkPatch(){try{this.installFetchPatch(),this.installXhrPatch()}catch(t){this.logInternalError("installNetworkPatch",t)}}restoreNetworkPatch(){try{this.originalFetch&&(window.fetch=this.originalFetch,this.originalFetch=null),this.originalXhrOpen&&(XMLHttpRequest.prototype.open=this.originalXhrOpen,this.originalXhrOpen=null),this.originalXhrSend&&(XMLHttpRequest.prototype.send=this.originalXhrSend,this.originalXhrSend=null)}catch(t){this.logInternalError("restoreNetworkPatch",t)}}installFetchPatch(){try{if("function"!=typeof window.fetch)return;this.originalFetch=window.fetch;const t=this.originalFetch;window.fetch=(...e)=>this.dispatchFetch(t,e)}catch(t){this.logInternalError("installFetchPatch",t)}}dispatchFetch(t,e){const i=Date.now(),o=e[0],n=e[1];return t.apply(window,e).then((t=>{try{t.ok||this.captureNetworkEntry(this.resolveRequestMethod(o,n),this.resolveRequestUrl(o),t.status,Date.now()-i)}catch(t){this.logInternalError("dispatchFetch success handler",t)}return t})).catch((t=>{try{this.captureNetworkEntry(this.resolveRequestMethod(o,n),this.resolveRequestUrl(o),0,Date.now()-i)}catch(t){this.logInternalError("dispatchFetch failure handler",t)}throw t}))}resolveRequestUrl(t){try{const e=t instanceof Request?t.url:String(t);return this.sanitiseUrl(e)}catch(t){return this.logInternalError("resolveRequestUrl",t),""}}resolveRequestMethod(t,e){try{return(null==e?void 0:e.method)?e.method.toUpperCase():t instanceof Request&&t.method?t.method.toUpperCase():"GET"}catch(t){return this.logInternalError("resolveRequestMethod",t),"GET"}}sanitiseUrl(t){try{const e=new URL(t,window.location.origin);return`${e.origin}${e.pathname}`}catch(t){return this.logInternalError("sanitiseUrl",t),""}}installXhrPatch(){try{const t=XMLHttpRequest.prototype.open,e=XMLHttpRequest.prototype.send;this.originalXhrOpen=t,this.originalXhrSend=e;const i=(t,e)=>this.handleXhrLoadEnd(t,e);XMLHttpRequest.prototype.open=function(e,i,...o){return this.A=e,this.I=String(i),t.call(this,e,i,...o)},XMLHttpRequest.prototype.send=function(...t){const o=Date.now();return this.addEventListener("loadend",(()=>{try{i(this,o)}catch(t){console.warn("Error in BugTelemetry xhr loadend handler: ",t)}})),e.apply(this,t)}}catch(t){this.logInternalError("installXhrPatch",t)}}handleXhrLoadEnd(t,e){var i,o;try{const n=t.status;if(!(0===n||n>=400))return;this.captureNetworkEntry((null!==(i=t.A)&&void 0!==i?i:"GET").toUpperCase(),this.sanitiseUrl(null!==(o=t.I)&&void 0!==o?o:""),n,Date.now()-e)}catch(t){this.logInternalError("handleXhrLoadEnd",t)}}captureNetworkEntry(t,e,i,o){try{const n={ts:Date.now(),method:t,url:e,status:i,durationMs:o};this.pushBounded(this.networkBuffer,n,Be.network)}catch(t){this.logInternalError("captureNetworkEntry",t)}}redact(t){try{let e=t;for(const t of He)t.replacement,e=e.replace(t.pattern,t.replacement);return e}catch(e){return this.logInternalError("redact",e),t}}truncate(t){try{return t.length<=ze.maxEntryChars?t:`${t.slice(0,ze.maxEntryChars-3)}...`}catch(e){return this.logInternalError("truncate",e),t}}serialiseConsoleArgs(t){try{return t.map((t=>"string"==typeof t?t:this.safeStringify(t))).join(" ")}catch(t){return this.logInternalError("serialiseConsoleArgs",t),"[unserialisable console arguments]"}}safeStringify(t){try{if("string"==typeof t)return t;if(t instanceof Error)return`${t.name}: ${t.message}`;if("undefined"!=typeof Node&&t instanceof Node)return this.describeDomNode(t);const e=new WeakSet,i=JSON.stringify(t,((t,i)=>this.replaceForSerialisation(i,e)));return null!=i?i:this.stringifyFallback(t)}catch(e){return this.logInternalError("safeStringify",e),this.stringifyFallback(t)}}replaceForSerialisation(t,e){try{if("object"==typeof t&&null!==t){if(e.has(t))return"[Circular]";e.add(t)}return t instanceof Error?`${t.name}: ${t.message}`:"undefined"!=typeof Node&&t instanceof Node?this.describeDomNode(t):t}catch{return"[Unserialisable]"}}describeDomNode(t){try{const e=t;return`<${(null==e?void 0:e.tagName)?e.tagName.toLowerCase():t.nodeName}>`}catch(t){return this.logInternalError("describeDomNode",t),"[DOMNode]"}}stringifyFallback(t){try{return String(t)}catch(t){return this.logInternalError("stringifyFallback",t),"[Unserialisable]"}}buildTopErrors(){try{const t=new Map;for(const e of this.errorBuffer)this.mergeErrorIntoSummaries(t,e);return Array.from(t.values()).sort(((t,e)=>e.lastSeenTs-t.lastSeenTs)).slice(0,ze.digestListSize)}catch(t){return this.logInternalError("buildTopErrors",t),[]}}mergeErrorIntoSummaries(t,e){try{const i=this.normaliseErrorMessage(e.message),o=t.get(i);if(o)return o.count+=1,o.firstSeenTs=Math.min(o.firstSeenTs,e.ts),void(o.lastSeenTs=Math.max(o.lastSeenTs,e.ts));t.set(i,{message:e.message,count:1,firstSeenTs:e.ts,lastSeenTs:e.ts})}catch(t){this.logInternalError("mergeErrorIntoSummaries",t)}}normaliseErrorMessage(t){try{return t.toLowerCase().replace(/\d/g,"0").replace(/\s+/g," ").trim()}catch(e){return this.logInternalError("normaliseErrorMessage",e),t}}shrinkDigestToFit(t){try{if(this.byteSize(t)<=ze.maxDigestBytes)return t;let e={...t,recentNavigations:[],truncated:!0};return this.byteSize(e)<=ze.maxDigestBytes?e:(e={...e,recentNetworkFailures:[]},this.byteSize(e)<=ze.maxDigestBytes?e:this.shrinkTopErrors(e))}catch(t){throw this.logInternalError("shrinkDigestToFit",t),t}}shrinkTopErrors(t){try{let e=[...t.topErrors],i={...t,topErrors:e};for(;e.length>1&&this.byteSize(i)>ze.maxDigestBytes;)e=e.slice(0,-1),i={...i,topErrors:e};return this.byteSize(i)<=ze.maxDigestBytes?i:this.truncateTopErrorMessages(i)}catch(e){return this.logInternalError("shrinkTopErrors",e),{...t,topErrors:[],truncated:!0}}}truncateTopErrorMessages(t){try{let e=200;for(;e>=10;){const i=t.topErrors.map((t=>({...t,message:t.message.slice(0,e)}))),o={...t,topErrors:i,truncated:!0};if(this.byteSize(o)<=ze.maxDigestBytes)return o;e=Math.floor(e/2)}return{...t,topErrors:[],truncated:!0}}catch(e){return this.logInternalError("truncateTopErrorMessages",e),{...t,topErrors:[],truncated:!0}}}shrinkBundleToFit(t){try{if(this.byteSize(t)<=ze.maxBundleBytes)return t;const e={...t,console:[...t.console],errors:[...t.errors],network:[...t.network],navigation:[],interactions:[],truncated:!0};for(;this.byteSize(e)>ze.maxBundleBytes;){const t=this.findOldestNonEmptySection(e);if(!t)break;e[t].shift()}return e}catch(t){throw this.logInternalError("shrinkBundleToFit",t),t}}findOldestNonEmptySection(t){try{const e=["console","errors","network"];let i=null,o=Number.POSITIVE_INFINITY;for(const n of e){const e=t[n];0!==e.length&&(e[0].ts<o&&(o=e[0].ts,i=n))}return i}catch(t){return this.logInternalError("findOldestNonEmptySection",t),null}}byteSize(t){try{return(new TextEncoder).encode(JSON.stringify(t)).length}catch(t){return this.logInternalError("byteSize",t),Number.MAX_SAFE_INTEGER}}pushBounded(t,e,i){try{for(t.push(e);t.length>i;)t.shift()}catch(t){this.logInternalError("pushBounded",t)}}takeMostRecent(t,e){try{return t.slice(-e).reverse()}catch(t){return this.logInternalError("takeMostRecent",t),[]}}logInternalError(t,e){var i;try{const o=this.nativeConsoleError||(null===(i=window.console)||void 0===i?void 0:i.error);null==o||o.apply(window.console,[`Error in BugTelemetry ${t}: `,e])}catch{}}};var jh=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const Vh=l`
4579
4579
  .s-bug-report-container .s-modal {
4580
4580
  width: 460px;
4581
4581
  padding: 52px 40px 40px 40px;
@@ -4613,7 +4613,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
4613
4613
  color: var(--primary-6, #625DF5);
4614
4614
  text-align: center;
4615
4615
  }
4616
- `;let Vh=class extends tt{constructor(){super(...arguments),this.apiKey="",this.projectId="",this.userId="",this.userEmail="",this.message="",this.submitting=!1,this.errorMessage="",this.success=!1,this.close=()=>{try{this.dispatchEvent(new CustomEvent("superflow-bug-report-modal-close",{bubbles:!0,composed:!0}))}catch(t){console.warn("Error in BugReportModal close: ",t)}},this.handleKeydown=t=>{try{"Escape"===(null==t?void 0:t.key)&&this.close()}catch(t){console.warn("Error in BugReportModal handleKeydown: ",t)}},this.stopPropagation=t=>{try{null==t||t.stopPropagation()}catch(t){console.warn("Error in BugReportModal stopPropagation: ",t)}},this.handleMessageInput=t=>{var e;try{const i=null==t?void 0:t.target;this.message=null!==(e=null==i?void 0:i.value)&&void 0!==e?e:""}catch(t){console.warn("Error in BugReportModal handleMessageInput: ",t)}},this.handleSend=async()=>{var t,e,i;try{const o=null===(t=this.message)||void 0===t?void 0:t.trim();if(!o||this.submitting)return;this.submitting=!0,this.errorMessage="";const n=Fh.buildDigest({route:null!==(i=null===(e=window.location)||void 0===e?void 0:e.pathname)&&void 0!==i?i:"",apiKey:this.apiKey||null,projectId:this.projectId||null,userId:this.userId||null,userEmail:this.userEmail||null}),r=Fh.buildBundle(),s=await Mh(o.slice(0,Be.maxMessageChars),n,r);if(null==s?void 0:s.success)return this.success=!0,this.submitting=!1,nh(gt.Events.REPORT_BUG_SUBMITTED),this.dispatchEvent(new CustomEvent("superflow-bug-report-modal-submit-success",{bubbles:!0,composed:!0})),void setTimeout((()=>this.close()),1500);this.errorMessage=(null==s?void 0:s.error)||Ve,this.submitting=!1}catch(t){console.warn("Error in BugReportModal handleSend: ",t),oh("Error in BugReportModal handleSend: ",t),this.errorMessage=Ve,this.submitting=!1}}}connectedCallback(){try{super.connectedCallback(),document.addEventListener("keydown",this.handleKeydown)}catch(t){console.warn("Error in BugReportModal connectedCallback: ",t)}}disconnectedCallback(){try{super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeydown)}catch(t){console.warn("Error in BugReportModal disconnectedCallback: ",t)}}firstUpdated(){var t;try{null===(t=this.messageInput)||void 0===t||t.focus()}catch(t){console.warn("Error in BugReportModal firstUpdated: ",t)}}render(){var t;const e=!(null===(t=this.message)||void 0===t?void 0:t.trim())||this.submitting;return R`
4616
+ `;let Uh=class extends tt{constructor(){super(...arguments),this.apiKey="",this.projectId="",this.userId="",this.userEmail="",this.message="",this.submitting=!1,this.errorMessage="",this.success=!1,this.close=()=>{try{this.dispatchEvent(new CustomEvent("superflow-bug-report-modal-close",{bubbles:!0,composed:!0}))}catch(t){console.warn("Error in BugReportModal close: ",t)}},this.handleKeydown=t=>{try{"Escape"===(null==t?void 0:t.key)&&this.close()}catch(t){console.warn("Error in BugReportModal handleKeydown: ",t)}},this.stopPropagation=t=>{try{null==t||t.stopPropagation()}catch(t){console.warn("Error in BugReportModal stopPropagation: ",t)}},this.handleMessageInput=t=>{var e;try{const i=null==t?void 0:t.target;this.message=null!==(e=null==i?void 0:i.value)&&void 0!==e?e:""}catch(t){console.warn("Error in BugReportModal handleMessageInput: ",t)}},this.handleSend=async()=>{var t,e,i;try{const o=null===(t=this.message)||void 0===t?void 0:t.trim();if(!o||this.submitting)return;this.submitting=!0,this.errorMessage="";const n=Ph.buildDigest({route:null!==(i=null===(e=window.location)||void 0===e?void 0:e.pathname)&&void 0!==i?i:"",apiKey:this.apiKey||null,projectId:this.projectId||null,userId:this.userId||null,userEmail:this.userEmail||null}),r=Ph.buildBundle(),s=await Mh(o.slice(0,ze.maxMessageChars),n,r);if(null==s?void 0:s.success)return this.success=!0,this.submitting=!1,rh(gt.Events.REPORT_BUG_SUBMITTED),this.dispatchEvent(new CustomEvent("superflow-bug-report-modal-submit-success",{bubbles:!0,composed:!0})),void setTimeout((()=>this.close()),1500);this.errorMessage=(null==s?void 0:s.error)||Ue,this.submitting=!1}catch(t){console.warn("Error in BugReportModal handleSend: ",t),nh("Error in BugReportModal handleSend: ",t),this.errorMessage=Ue,this.submitting=!1}}}connectedCallback(){try{super.connectedCallback(),document.addEventListener("keydown",this.handleKeydown)}catch(t){console.warn("Error in BugReportModal connectedCallback: ",t)}}disconnectedCallback(){try{super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeydown)}catch(t){console.warn("Error in BugReportModal disconnectedCallback: ",t)}}firstUpdated(){var t;try{null===(t=this.messageInput)||void 0===t||t.focus()}catch(t){console.warn("Error in BugReportModal firstUpdated: ",t)}}render(){var t;const e=!(null===(t=this.message)||void 0===t?void 0:t.trim())||this.submitting;return R`
4617
4617
  <div class="snippyly-plugin-modal-container s-guest-mode-signin-modal-container s-bug-report-container" @click=${this.close}>
4618
4618
  <div class="s-modal" @click=${this.stopPropagation}>
4619
4619
  <div class="s-modal-close-button" @click=${this.close}>
@@ -4622,21 +4622,21 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
4622
4622
  <path d="M4.5 4.5L13.5 13.5" stroke="#B1B5C3" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4623
4623
  </svg>
4624
4624
  </div>
4625
- <div class="s-modal-secondary-subtitle">${Ih("Report a bug")}</div>
4625
+ <div class="s-modal-secondary-subtitle">${_h("Report a bug")}</div>
4626
4626
  ${this.success?R`
4627
4627
  <div class="s-bug-report-success">
4628
4628
  <svg width="32" height="32" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
4629
4629
  <path d="M5 12L10 17L20 7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
4630
4630
  </svg>
4631
- <p>${Ih("Thanks. Your report was sent.")}</p>
4631
+ <p>${_h("Thanks. Your report was sent.")}</p>
4632
4632
  </div>
4633
4633
  `:R`
4634
4634
  <div class="s-modal-secondary-desc">
4635
- ${Ih("Describe what happened. We include some technical details automatically.")}
4635
+ ${_h("Describe what happened. We include some technical details automatically.")}
4636
4636
  </div>
4637
4637
  <textarea
4638
4638
  id="bugReportMessage"
4639
- placeholder=${Ih("What went wrong?")}
4639
+ placeholder=${_h("What went wrong?")}
4640
4640
  .value=${this.message}
4641
4641
  @input=${this.handleMessageInput}
4642
4642
  ?disabled=${this.submitting}
@@ -4663,14 +4663,14 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
4663
4663
  class="s-button s-primary s-modal-secondary-actions-submit ${ut({"s-disabled":e})}"
4664
4664
  @click=${this.handleSend}
4665
4665
  >
4666
- ${this.submitting?Ih("Sending..."):Ih("Send")}
4666
+ ${this.submitting?_h("Sending..."):_h("Send")}
4667
4667
  </div>
4668
- <div class="s-modal-link-text" @click=${this.close}>${Ih("Cancel")}</div>
4668
+ <div class="s-modal-link-text" @click=${this.close}>${_h("Cancel")}</div>
4669
4669
  </div>
4670
4670
  `}
4671
4671
  </div>
4672
4672
  </div>
4673
- `}};Vh.styles=[_h,$h,jh],Ph([nt({type:String})],Vh.prototype,"apiKey",void 0),Ph([nt({type:String})],Vh.prototype,"projectId",void 0),Ph([nt({type:String})],Vh.prototype,"userId",void 0),Ph([nt({type:String})],Vh.prototype,"userEmail",void 0),Ph([rt()],Vh.prototype,"message",void 0),Ph([rt()],Vh.prototype,"submitting",void 0),Ph([rt()],Vh.prototype,"errorMessage",void 0),Ph([rt()],Vh.prototype,"success",void 0),Ph([st("#bugReportMessage")],Vh.prototype,"messageInput",void 0),Vh=Ph([it("superflow-bug-report-modal")],Vh);const Uh=l`
4673
+ `}};Uh.styles=[$h,Nh,Vh],jh([nt({type:String})],Uh.prototype,"apiKey",void 0),jh([nt({type:String})],Uh.prototype,"projectId",void 0),jh([nt({type:String})],Uh.prototype,"userId",void 0),jh([nt({type:String})],Uh.prototype,"userEmail",void 0),jh([rt()],Uh.prototype,"message",void 0),jh([rt()],Uh.prototype,"submitting",void 0),jh([rt()],Uh.prototype,"errorMessage",void 0),jh([rt()],Uh.prototype,"success",void 0),jh([st("#bugReportMessage")],Uh.prototype,"messageInput",void 0),Uh=jh([it("superflow-bug-report-modal")],Uh);const Bh=l`
4674
4674
  :host {
4675
4675
  display: block;
4676
4676
  font-family: 'Poppins', sans-serif;
@@ -5789,20 +5789,20 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
5789
5789
  :host([theme="dark"]) .cws-list::-webkit-scrollbar-thumb:hover {
5790
5790
  background: rgba(255, 255, 255, 0.3);
5791
5791
  }
5792
- `,Bh="dark",zh="Loading findings…",Hh="Running QA Agents",Gh="No agent warnings found.",Wh="running",qh="findings",Zh="clean",Kh="unavailable",Jh="Couldn't finish this check",Yh="#FFD978",Qh="cws-spinner-gradient",Xh=["critical","high","medium","low","info"],tu={critical:{tone:"red",label:"Critical"},high:{tone:"yellow",label:"High"},medium:{tone:"yellow",label:"Medium"},low:{tone:"purple",label:"Low"},info:{tone:"purple",label:"Info"}},eu={tone:"grey",label:"No"},iu="__site__",ou=t=>null===t||"object"!=typeof t||Array.isArray(t)?null:t,nu=t=>"string"==typeof t?t.trim():"",ru=t=>{const e=ou(t),i=(null==e?void 0:e.annotationId)||(null==e?void 0:e.id);return"string"==typeof i?i:""},su=t=>{var e,i;const o=ou(t);return null!==(e=ou(null==o?void 0:o.checkInfo))&&void 0!==e?e:ou(null===(i=ou(null==o?void 0:o.context))||void 0===i?void 0:i.check)},au=t=>{try{return null!==su(t)}catch{return!1}},lu=Object.freeze([{id:"critical",name:"Critical",color:"#C22C3A",lightColor:"#FBE6E8"},{id:"high",name:"High",color:"#C9601A",lightColor:"#FCEBDD"},{id:"medium",name:"Medium",color:"#A07C08",lightColor:"#FBF1DC"},{id:"low",name:"Low",color:"#5F6B86",lightColor:"#EEF0F5"}]),cu=t=>{switch(nu(t).toLowerCase()){case"critical":return"critical";case"high":case"serious":return"high";case"medium":return"medium";case"low":case"info":return"low";default:return}},du="OPEN",hu="IN_PROGRESS",uu="RESOLVED",pu=Object.freeze([{id:du,name:"Open",type:"default",color:"#625DF5",lightColor:"#F2F2FE",svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>'},{id:hu,name:"In Progress",type:"ongoing",color:"#ECB000",lightColor:"#FDF7E6",svg:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M8.00016 13.3333C10.9457 13.3333 13.3335 10.9455 13.3335 8.00001C13.3335 5.05449 10.9457 2.66668 8.00016 2.66668C5.05464 2.66668 2.66683 5.05449 2.66683 8.00001C2.66683 10.9455 5.05464 13.3333 8.00016 13.3333ZM8.00016 14.6667C11.6821 14.6667 14.6668 11.6819 14.6668 8.00001C14.6668 4.31811 11.6821 1.33334 8.00016 1.33334C4.31826 1.33334 1.3335 4.31811 1.3335 8.00001C1.3335 11.6819 4.31826 14.6667 8.00016 14.6667Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M8.00016 4C8.36835 4 8.66683 4.29848 8.66683 4.66667V7.72386L10.1382 9.19526C10.3986 9.45561 10.3986 9.87772 10.1382 10.1381C9.87788 10.3984 9.45577 10.3984 9.19542 10.1381L7.52876 8.4714C7.40373 8.34638 7.3335 8.17681 7.3335 8V4.66667C7.3335 4.29848 7.63197 4 8.00016 4Z" fill="currentColor"/>\n </svg>'},{id:uu,name:"Resolved",type:"terminal",color:"#198F65",lightColor:"#EDF6F3",svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M9 12L11 14L15 10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>'}]),vu=t=>{var e,i;try{return"terminal"===(null===(i=ou(null===(e=ou(t))||void 0===e?void 0:e.status))||void 0===i?void 0:i.type)||(t=>{var e,i;try{return"rejected"===(null===(i=ou(null===(e=ou(t))||void 0===e?void 0:e.suggestion))||void 0===i?void 0:i.status)}catch{return!1}})(t)}catch{return!1}},gu=["scan","user","mcp","suggestion"],fu=t=>"string"==typeof t&&t?t:void 0,mu=t=>{var e,i;try{const o=su(t);if(!o)return null;const n="site"===o.scope?"site":"page"===o.scope?"page":null;if(!n)return null;const r="element"===o.locationType||"source"===o.locationType||"none"===o.locationType?o.locationType:void 0,s=Array.isArray(o.pages)?o.pages.filter((t=>"string"==typeof t&&""!==t.trim())):[],a="number"==typeof o.pageCount&&Number.isFinite(o.pageCount)&&o.pageCount>=0?Math.floor(o.pageCount):void 0,l=(t=>{const e={};if(Array.isArray(t.pageVersionList)){for(const i of t.pageVersionList){const t=ou(i),o=null==t?void 0:t.page,n=null==t?void 0:t.versionId;"string"==typeof o&&o&&"string"==typeof n&&n&&(e[o]=n)}if(Object.keys(e).length>0)return e}const i=ou(t.pageVersions);if(i)for(const[t,o]of Object.entries(i))"string"==typeof o&&o&&(e[t]=o);return e})(o),c=gu.find((t=>t===o.resolvedBy));return{ruleKey:"string"==typeof o.ruleKey?o.ruleKey:"",evidence:"string"==typeof o.evidence?o.evidence:"",scope:n,locationType:r,pages:s,pageCount:a,allPagesMatched:!0===o.allPagesMatched,pageVersions:l,firstSeenRunId:null!==(e=fu(o.firstSeenRunId))&&void 0!==e?e:fu(o.firstRunId),lastSeenRunId:null!==(i=fu(o.lastSeenRunId))&&void 0!==i?i:fu(o.lastRunId),resolvedBy:c}}catch{return null}},wu=t=>{var e;try{return"site"===(null===(e=su(t))||void 0===e?void 0:e.scope)}catch{return!1}},yu=t=>{var e,i;return null!==(i=null===(e=mu(t))||void 0===e?void 0:e.pages)&&void 0!==i?i:[]},bu=t=>{var e,i,o,n,r,s,a;try{const l=ou(t);return null!==(s=null!==(n=null!==(i=cu(null===(e=ou(null==l?void 0:l.checkInfo))||void 0===e?void 0:e.severity))&&void 0!==i?i:cu(null===(o=ou(null==l?void 0:l.context))||void 0===o?void 0:o.severity))&&void 0!==n?n:cu(null===(r=ou(null==l?void 0:l.priority))||void 0===r?void 0:r.id))&&void 0!==s?s:cu(null===(a=(t=>{var e,i;const o=ou(t),n=ou(null===(e=ou(null==o?void 0:o.agent))||void 0===e?void 0:e.reason);if(n)return n;const r=null==o?void 0:o.comments,s=Array.isArray(r)?ou(r[0]):null;return ou(null===(i=ou(null==s?void 0:s.agent))||void 0===i?void 0:i.reason)})(t))||void 0===a?void 0:a.severity)}catch{return}},Cu=t=>{let e=nu(t);if(!e)return"";try{if(/^[a-z][a-z0-9+.-]*:\/\//i.test(e)){const t=new URL(e);e=`${t.pathname||"/"}${t.search}`}}catch{}const i=e.indexOf("#");-1!==i&&(e=e.slice(0,i));const o=e.indexOf("?");let n=-1===o?e:e.slice(0,o);const r=-1===o?"":e.slice(o);return n.startsWith("/")||(n=`/${n}`),n.length>1&&(n=n.replace(/\/+$/,"")||"/"),`${n}${"?"===r?"":r}`},xu=(t,e,i="next")=>{const o=new Set,n=[];for(const e of Array.isArray(t)?t:[]){const t=Cu(e);t&&!o.has(t)&&(o.add(t),n.push({raw:nu(e),key:t}))}if(0===n.length)return null;const r=((t,e)=>{const i=Cu(e);if(!i)return-1;const o=t.indexOf(i);if(-1!==o)return o;const n=t=>t.split("?")[0],r=n(i);return t.findIndex((t=>n(t)===r))})(n.map((t=>t.key)),e);if(-1===r)return"next"===i?n[0].raw:n[n.length-1].raw;if(1===n.length)return null;return n[(r+("next"===i?1:-1)+n.length)%n.length].raw};function Eu(){try{return R`
5792
+ `,zh="dark",Hh="Loading findings…",Gh="Running QA Agents",Wh="No agent warnings found.",qh="running",Zh="findings",Kh="clean",Jh="unavailable",Yh="Couldn't finish this check",Qh="#FFD978",Xh="cws-spinner-gradient",tu=["critical","high","medium","low","info"],eu={critical:{tone:"red",label:"Critical"},high:{tone:"yellow",label:"High"},medium:{tone:"yellow",label:"Medium"},low:{tone:"purple",label:"Low"},info:{tone:"purple",label:"Info"}},iu={tone:"grey",label:"No"},ou="__site__",nu=t=>null===t||"object"!=typeof t||Array.isArray(t)?null:t,ru=t=>"string"==typeof t?t.trim():"",su=t=>{const e=nu(t),i=(null==e?void 0:e.annotationId)||(null==e?void 0:e.id);return"string"==typeof i?i:""},au=t=>{var e,i;const o=nu(t);return null!==(e=nu(null==o?void 0:o.checkInfo))&&void 0!==e?e:nu(null===(i=nu(null==o?void 0:o.context))||void 0===i?void 0:i.check)},lu=t=>{try{return null!==au(t)}catch{return!1}},cu=Object.freeze([{id:"critical",name:"Critical",color:"#C22C3A",lightColor:"#FBE6E8"},{id:"high",name:"High",color:"#C9601A",lightColor:"#FCEBDD"},{id:"medium",name:"Medium",color:"#A07C08",lightColor:"#FBF1DC"},{id:"low",name:"Low",color:"#5F6B86",lightColor:"#EEF0F5"}]),du=t=>{switch(ru(t).toLowerCase()){case"critical":return"critical";case"high":case"serious":return"high";case"medium":return"medium";case"low":case"info":return"low";default:return}},hu="OPEN",uu="IN_PROGRESS",pu="RESOLVED",vu=Object.freeze([{id:hu,name:"Open",type:"default",color:"#625DF5",lightColor:"#F2F2FE",svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>'},{id:uu,name:"In Progress",type:"ongoing",color:"#ECB000",lightColor:"#FDF7E6",svg:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M8.00016 13.3333C10.9457 13.3333 13.3335 10.9455 13.3335 8.00001C13.3335 5.05449 10.9457 2.66668 8.00016 2.66668C5.05464 2.66668 2.66683 5.05449 2.66683 8.00001C2.66683 10.9455 5.05464 13.3333 8.00016 13.3333ZM8.00016 14.6667C11.6821 14.6667 14.6668 11.6819 14.6668 8.00001C14.6668 4.31811 11.6821 1.33334 8.00016 1.33334C4.31826 1.33334 1.3335 4.31811 1.3335 8.00001C1.3335 11.6819 4.31826 14.6667 8.00016 14.6667Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M8.00016 4C8.36835 4 8.66683 4.29848 8.66683 4.66667V7.72386L10.1382 9.19526C10.3986 9.45561 10.3986 9.87772 10.1382 10.1381C9.87788 10.3984 9.45577 10.3984 9.19542 10.1381L7.52876 8.4714C7.40373 8.34638 7.3335 8.17681 7.3335 8V4.66667C7.3335 4.29848 7.63197 4 8.00016 4Z" fill="currentColor"/>\n </svg>'},{id:pu,name:"Resolved",type:"terminal",color:"#198F65",lightColor:"#EDF6F3",svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M9 12L11 14L15 10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>'}]),gu=t=>{var e,i;try{return"terminal"===(null===(i=nu(null===(e=nu(t))||void 0===e?void 0:e.status))||void 0===i?void 0:i.type)||(t=>{var e,i;try{return"rejected"===(null===(i=nu(null===(e=nu(t))||void 0===e?void 0:e.suggestion))||void 0===i?void 0:i.status)}catch{return!1}})(t)}catch{return!1}},fu=["scan","user","mcp","suggestion"],mu=t=>"string"==typeof t&&t?t:void 0,wu=t=>{var e,i;try{const o=au(t);if(!o)return null;const n="site"===o.scope?"site":"page"===o.scope?"page":null;if(!n)return null;const r="element"===o.locationType||"source"===o.locationType||"none"===o.locationType?o.locationType:void 0,s=Array.isArray(o.pages)?o.pages.filter((t=>"string"==typeof t&&""!==t.trim())):[],a="number"==typeof o.pageCount&&Number.isFinite(o.pageCount)&&o.pageCount>=0?Math.floor(o.pageCount):void 0,l=(t=>{const e={};if(Array.isArray(t.pageVersionList)){for(const i of t.pageVersionList){const t=nu(i),o=null==t?void 0:t.page,n=null==t?void 0:t.versionId;"string"==typeof o&&o&&"string"==typeof n&&n&&(e[o]=n)}if(Object.keys(e).length>0)return e}const i=nu(t.pageVersions);if(i)for(const[t,o]of Object.entries(i))"string"==typeof o&&o&&(e[t]=o);return e})(o),c=fu.find((t=>t===o.resolvedBy));return{ruleKey:"string"==typeof o.ruleKey?o.ruleKey:"",evidence:"string"==typeof o.evidence?o.evidence:"",scope:n,locationType:r,pages:s,pageCount:a,allPagesMatched:!0===o.allPagesMatched,pageVersions:l,firstSeenRunId:null!==(e=mu(o.firstSeenRunId))&&void 0!==e?e:mu(o.firstRunId),lastSeenRunId:null!==(i=mu(o.lastSeenRunId))&&void 0!==i?i:mu(o.lastRunId),resolvedBy:c}}catch{return null}},yu=t=>{var e;try{return"site"===(null===(e=au(t))||void 0===e?void 0:e.scope)}catch{return!1}},bu=t=>{var e,i;return null!==(i=null===(e=wu(t))||void 0===e?void 0:e.pages)&&void 0!==i?i:[]},Cu=t=>{var e,i,o,n,r,s,a;try{const l=nu(t);return null!==(s=null!==(n=null!==(i=du(null===(e=nu(null==l?void 0:l.checkInfo))||void 0===e?void 0:e.severity))&&void 0!==i?i:du(null===(o=nu(null==l?void 0:l.context))||void 0===o?void 0:o.severity))&&void 0!==n?n:du(null===(r=nu(null==l?void 0:l.priority))||void 0===r?void 0:r.id))&&void 0!==s?s:du(null===(a=(t=>{var e,i;const o=nu(t),n=nu(null===(e=nu(null==o?void 0:o.agent))||void 0===e?void 0:e.reason);if(n)return n;const r=null==o?void 0:o.comments,s=Array.isArray(r)?nu(r[0]):null;return nu(null===(i=nu(null==s?void 0:s.agent))||void 0===i?void 0:i.reason)})(t))||void 0===a?void 0:a.severity)}catch{return}},xu=t=>{let e=ru(t);if(!e)return"";try{if(/^[a-z][a-z0-9+.-]*:\/\//i.test(e)){const t=new URL(e);e=`${t.pathname||"/"}${t.search}`}}catch{}const i=e.indexOf("#");-1!==i&&(e=e.slice(0,i));const o=e.indexOf("?");let n=-1===o?e:e.slice(0,o);const r=-1===o?"":e.slice(o);return n.startsWith("/")||(n=`/${n}`),n.length>1&&(n=n.replace(/\/+$/,"")||"/"),`${n}${"?"===r?"":r}`},Eu=(t,e,i="next")=>{const o=new Set,n=[];for(const e of Array.isArray(t)?t:[]){const t=xu(e);t&&!o.has(t)&&(o.add(t),n.push({raw:ru(e),key:t}))}if(0===n.length)return null;const r=((t,e)=>{const i=xu(e);if(!i)return-1;const o=t.indexOf(i);if(-1!==o)return o;const n=t=>t.split("?")[0],r=n(i);return t.findIndex((t=>n(t)===r))})(n.map((t=>t.key)),e);if(-1===r)return"next"===i?n[0].raw:n[n.length-1].raw;if(1===n.length)return null;return n[(r+("next"===i?1:-1)+n.length)%n.length].raw};function ku(){try{return R`
5793
5793
  <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
5794
5794
  <g>
5795
5795
  <path opacity="0.12" d="M20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0C15.5228 0 20 4.47715 20 10ZM2 10C2 14.4183 5.58172 18 10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10Z" fill="white"/>
5796
- <path d="M16.364 16.364C16.7545 16.7545 17.3921 16.7574 17.7417 16.3298C18.7755 15.0654 19.4872 13.5627 19.8079 11.9509C20.1937 10.0111 19.9957 8.00043 19.2388 6.17317C18.4819 4.34591 17.2002 2.78412 15.5557 1.6853C14.1893 0.772303 12.6234 0.213005 10.9984 0.0499548C10.4488 -0.00518137 10 0.447715 10 1V1C10 1.55228 10.4494 1.99356 10.9974 2.06242C12.2262 2.21683 13.4072 2.65513 14.4446 3.34824C15.7602 4.22729 16.7855 5.47672 17.391 6.93853C17.9965 8.40034 18.155 10.0089 17.8463 11.5607C17.6029 12.7843 17.0777 13.9293 16.318 14.9074C15.9792 15.3436 15.9734 15.9734 16.364 16.364V16.364Z" fill="${`url(#${Qh})`}"/>
5796
+ <path d="M16.364 16.364C16.7545 16.7545 17.3921 16.7574 17.7417 16.3298C18.7755 15.0654 19.4872 13.5627 19.8079 11.9509C20.1937 10.0111 19.9957 8.00043 19.2388 6.17317C18.4819 4.34591 17.2002 2.78412 15.5557 1.6853C14.1893 0.772303 12.6234 0.213005 10.9984 0.0499548C10.4488 -0.00518137 10 0.447715 10 1V1C10 1.55228 10.4494 1.99356 10.9974 2.06242C12.2262 2.21683 13.4072 2.65513 14.4446 3.34824C15.7602 4.22729 16.7855 5.47672 17.391 6.93853C17.9965 8.40034 18.155 10.0089 17.8463 11.5607C17.6029 12.7843 17.0777 13.9293 16.318 14.9074C15.9792 15.3436 15.9734 15.9734 16.364 16.364V16.364Z" fill="${`url(#${Xh})`}"/>
5797
5797
  </g>
5798
5798
  <defs>
5799
- <linearGradient id="${Qh}" x1="10" y1="0" x2="10" y2="20" gradientUnits="userSpaceOnUse">
5799
+ <linearGradient id="${Xh}" x1="10" y1="0" x2="10" y2="20" gradientUnits="userSpaceOnUse">
5800
5800
  <stop stop-color="#77B5EF"/>
5801
5801
  <stop offset="1" stop-color="#368BDA"/>
5802
5802
  </linearGradient>
5803
5803
  </defs>
5804
5804
  </svg>
5805
- `}catch(t){return console.warn("Error in renderDarkSpinnerIcon: ",t),R``}}const ku=[{keywords:["access"],render:function(t){try{return R`
5805
+ `}catch(t){return console.warn("Error in renderDarkSpinnerIcon: ",t),R``}}const Su=[{keywords:["access"],render:function(t){try{return R`
5806
5806
  <svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="color: ${t}">
5807
5807
  <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5808
5808
  <path d="M10 16.5l2 -3l2 3m-2 -3v-2l3 -1m-6 0l3 1" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
@@ -5839,11 +5839,11 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
5839
5839
  <svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="color: ${t}">
5840
5840
  <path d="M15 8H15.01M3 15.9998L8 10.9998C8.928 10.1068 10.072 10.1068 11 10.9998L16 15.9998M14 13.9998L15 12.9998C15.928 12.1068 17.072 12.1068 18 12.9998L21 15.9998M3 6C3 5.20435 3.31607 4.44129 3.87868 3.87868C4.44129 3.31607 5.20435 3 6 3H18C18.7956 3 19.5587 3.31607 20.1213 3.87868C20.6839 4.44129 21 5.20435 21 6V18C21 18.7956 20.6839 19.5587 20.1213 20.1213C19.5587 20.6839 18.7956 21 18 21H6C5.20435 21 4.44129 20.6839 3.87868 20.1213C3.31607 19.5587 3 18.7956 3 18V6Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5841
5841
  </svg>
5842
- `}catch(t){return console.warn("Error in renderDarkAgentIconImage: ",t),R``}},color:"#4CD97B"}],Su={render:function(t){try{return R`
5842
+ `}catch(t){return console.warn("Error in renderDarkAgentIconImage: ",t),R``}},color:"#4CD97B"}],Au={render:function(t){try{return R`
5843
5843
  <svg width="18" height="18" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" style="color: ${t}">
5844
5844
  <path d="M6.33317 7.33333H6.33984M9.6665 7.33333H9.67317M6.33317 10C6.55042 10.2217 6.80974 10.3979 7.09592 10.5181C7.38211 10.6384 7.68941 10.7003 7.99984 10.7003C8.31026 10.7003 8.61757 10.6384 8.90375 10.5181C9.18994 10.3979 9.44925 10.2217 9.6665 10M4.6665 3.33333H5.33317V2H10.6665V3.33333H11.3332C11.8636 3.33333 12.3723 3.54405 12.7474 3.91912C13.1225 4.29419 13.3332 4.8029 13.3332 5.33333V11.3333C13.3332 11.8638 13.1225 12.3725 12.7474 12.7475C12.3723 13.1226 11.8636 13.3333 11.3332 13.3333V14H4.6665V13.3333C4.13607 13.3333 3.62736 13.1226 3.25229 12.7475C2.87722 12.3725 2.6665 11.8638 2.6665 11.3333V5.33333C2.6665 4.8029 2.87722 4.29419 3.25229 3.91912C3.62736 3.54405 4.13607 3.33333 4.6665 3.33333Z" stroke="currentColor" stroke-width="1.33333" stroke-linecap="round"/>
5845
5845
  </svg>
5846
- `}catch(t){return console.warn("Error in renderDarkAgentIconLego: ",t),R``}},color:"#ffffff"};function Mu(t,e){try{const i=`${null!=t?t:""} ${null!=e?e:""}`.toLowerCase(),o=ku.find((t=>t.keywords.some((t=>i.includes(t)))));return o?{render:o.render,color:o.color}:Su}catch(t){return console.warn("Error in resolveAgentIconInfo: ",t),Su}}var Au=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const Tu="No findings",Iu="This finding isn't pinned on the page yet, so it's shown here in full.",_u="Back to QA agents",$u="Close",Nu=(t,e)=>{var i,o;const n={agentId:t.agentId,agentName:t.agentName,group:e};if(t.isRunning)return{...n,state:Wh,count:0};if(e&&(null!==(i=e.warningCount)&&void 0!==i?i:0)>0)return{...n,state:qh,count:e.warningCount};const r=null!==(o=t.findingsCount)&&void 0!==o?o:0;return r>0&&!e&&!t.findingsResolved?t.findingsUnavailable?{...n,state:Kh,count:0,title:"Couldn't load these findings"}:{...n,state:qh,count:r,pending:!0,title:zh}:t.failed?{...n,state:Kh,count:0,title:Jh}:t.timedOut?{...n,state:Kh,count:0,title:"Status not updating"}:{...n,state:Zh,count:0,resolved:r>0}},Ou=(t,e)=>t?e?Xh.indexOf(t)<=Xh.indexOf(e)?t:e:t:e,Lu=(t,e)=>{var i;try{const o=[],n=new Set,r=Array.isArray(e)?e:[];for(const e of Array.isArray(t)?t:[]){if(!(null==e?void 0:e.agentId))continue;const t=r.find((t=>(null==t?void 0:t.agentId)===e.agentId));n.add(e.agentId),o.push(Nu(e,t))}for(const t of r){if(!(null==t?void 0:t.agentId)||n.has(t.agentId))continue;const e=null!==(i=t.warningCount)&&void 0!==i?i:0;o.push({agentId:t.agentId,agentName:t.agentName,state:e>0?qh:Zh,count:e>0?e:0,group:t})}return o}catch(t){return console.warn("Error in deriveAgentRows: ",t),[]}},Ru=l`
5846
+ `}catch(t){return console.warn("Error in renderDarkAgentIconLego: ",t),R``}},color:"#ffffff"};function Mu(t,e){try{const i=`${null!=t?t:""} ${null!=e?e:""}`.toLowerCase(),o=Su.find((t=>t.keywords.some((t=>i.includes(t)))));return o?{render:o.render,color:o.color}:Au}catch(t){return console.warn("Error in resolveAgentIconInfo: ",t),Au}}var Tu=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const Iu="No findings",_u="This finding isn't pinned on the page yet, so it's shown here in full.",$u="Back to QA agents",Nu="Close",Ou=(t,e)=>{var i,o;const n={agentId:t.agentId,agentName:t.agentName,group:e};if(t.isRunning)return{...n,state:qh,count:0};if(e&&(null!==(i=e.warningCount)&&void 0!==i?i:0)>0)return{...n,state:Zh,count:e.warningCount};const r=null!==(o=t.findingsCount)&&void 0!==o?o:0;return r>0&&!e&&!t.findingsResolved?t.findingsUnavailable?{...n,state:Jh,count:0,title:"Couldn't load these findings"}:{...n,state:Zh,count:r,pending:!0,title:Hh}:t.failed?{...n,state:Jh,count:0,title:Yh}:t.timedOut?{...n,state:Jh,count:0,title:"Status not updating"}:{...n,state:Kh,count:0,resolved:r>0}},Lu=(t,e)=>t?e?tu.indexOf(t)<=tu.indexOf(e)?t:e:t:e,Ru=(t,e)=>{var i;try{const o=[],n=new Set,r=Array.isArray(e)?e:[];for(const e of Array.isArray(t)?t:[]){if(!(null==e?void 0:e.agentId))continue;const t=r.find((t=>(null==t?void 0:t.agentId)===e.agentId));n.add(e.agentId),o.push(Ou(e,t))}for(const t of r){if(!(null==t?void 0:t.agentId)||n.has(t.agentId))continue;const e=null!==(i=t.warningCount)&&void 0!==i?i:0;o.push({agentId:t.agentId,agentName:t.agentName,state:e>0?Zh:Kh,count:e>0?e:0,group:t})}return o}catch(t){return console.warn("Error in deriveAgentRows: ",t),[]}},Du=l`
5847
5847
  .cws-sr-only {
5848
5848
  position: absolute;
5849
5849
  width: 1px;
@@ -5875,12 +5875,12 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
5875
5875
  line-height: 1.4;
5876
5876
  opacity: 0.7;
5877
5877
  }
5878
- `;let Du=class extends tt{constructor(){super(...arguments),this.agentGroups=[],this.currentPageUrl="",this.theme="light",this.agentRunStatuses=[],this.loading=!1,this.unsyncedAnnotationIds=[],this.expandedFindingIds=new Set,this.openAccordions=new Set,this.currentView="agents",this.selectedAgentId="",this.selectedFindingGroup=null,this.userAdjustedAccordions=!1,this.getSelectedAgentGroup=()=>{var t;try{return null===(t=this.agentGroups)||void 0===t?void 0:t.find((t=>(null==t?void 0:t.agentId)===this.selectedAgentId))}catch(t){return void console.warn("Error in getSelectedAgentGroup: ",t)}},this.onAgentClick=t=>{try{this.selectedAgentId=t,this.selectedFindingGroup=null,this.currentView="agent-detail",this.userAdjustedAccordions=!1,this.autoOpenCurrentPageAccordion(t)}catch(t){console.warn("Error in onAgentClick: ",t)}},this.autoOpenCurrentPageAccordion=t=>{var e;try{const i=null===(e=this.agentGroups)||void 0===e?void 0:e.find((e=>(null==e?void 0:e.agentId)===t));if(!i)return;const o=this.groupWarningsByPage(i.warnings),n=null==o?void 0:o.find((t=>null==t?void 0:t.isCurrentPage));this.openAccordions=new Set,(null==n?void 0:n.pageUrl)&&this.openAccordions.add(n.pageUrl)}catch(t){console.warn("Error in autoOpenCurrentPageAccordion: ",t)}},this.onBackClick=()=>{try{if("finding-group"===this.currentView)return this.currentView="agent-detail",void(this.selectedFindingGroup=null);this.userAdjustedAccordions=!1,this.currentView="agents",this.selectedAgentId=""}catch(t){console.warn("Error in onBackClick: ",t)}},this.onWarningRowClick=(t,e="")=>{var i,o,n;try{const r=null===(i=null==t?void 0:t.annotations)||void 0===i?void 0:i[0];if(!r)return;if((null!==(n=null===(o=null==t?void 0:t.annotations)||void 0===o?void 0:o.length)&&void 0!==n?n:0)>1)return void this.openFindingGroup(t,e);if(this.isExpandableWarning(t))return void this.toggleFindingExpanded(t);this.dispatchEvent(new CustomEvent("content-warning-item-click",{bubbles:!0,composed:!0,detail:{annotation:r}}))}catch(t){console.warn("Error in onWarningRowClick: ",t)}},this.openFindingGroup=(t,e)=>{var i,o;try{this.selectedFindingGroup={pageUrl:e,primaryText:null!==(i=null==t?void 0:t.primaryText)&&void 0!==i?i:"",secondaryText:null!==(o=null==t?void 0:t.secondaryText)&&void 0!==o?o:""},this.currentView="finding-group"}catch(t){console.warn("Error in openFindingGroup: ",t)}},this.getSelectedFindingGroup=()=>{var t,e;try{const i=this.selectedFindingGroup,o=this.getSelectedAgentGroup();if(!i||!o)return;const n=null===(t=this.groupWarningsByPage(o.warnings))||void 0===t?void 0:t.find((t=>(null==t?void 0:t.pageUrl)===i.pageUrl));return null===(e=null==n?void 0:n.warnings)||void 0===e?void 0:e.find((t=>(null==t?void 0:t.primaryText)===i.primaryText&&(null==t?void 0:t.secondaryText)===i.secondaryText))}catch(t){return void console.warn("Error in getSelectedFindingGroup: ",t)}},this.onAddAllSuggestions=t=>{try{this.dispatchEvent(new CustomEvent("content-warning-sidebar-add-all",{bubbles:!0,composed:!0,detail:{agentId:t}}))}catch(t){console.warn("Error in onAddAllSuggestions: ",t)}},this.onCloseClick=()=>{try{this.dispatchEvent(new CustomEvent("content-warning-sidebar-close",{bubbles:!0,composed:!0}))}catch(t){console.warn("Error in onCloseClick: ",t)}},this.normalizeUrlForGrouping=t=>{try{if(!t)return"";const e=Pd(t);null!==e&&""!==e&&(t=e);const i="false"!==localStorage.getItem("sfNormalizeParams");let o=t;if(null==t?void 0:t.startsWith("/"))i&&(o=t.split("?")[0].split("#")[0]);else{const e=new URL(t);o=i?(null==e?void 0:e.pathname)||"/":(null==e?void 0:e.pathname)+((null==e?void 0:e.search)||"")+((null==e?void 0:e.hash)||"")}return(null==o?void 0:o.startsWith("/"))?o.substring(1):o}catch{const e=t||"";return(null==e?void 0:e.startsWith("/"))?e.substring(1):e}},this.groupWarningsByPage=t=>{var e,i,o,n,r,s,a,l,c,d;try{const h=new Map,u=[];for(const p of t){const t=null!==(i=null===(e=null==p?void 0:p.annotations)||void 0===e?void 0:e.filter((t=>wu(t))))&&void 0!==i?i:[];t.length>0&&u.push({...p,occurrences:t.length,annotations:t});const v=t.length>0?(null!==(o=null==p?void 0:p.annotations)&&void 0!==o?o:[]).filter((t=>!wu(t))):null!==(n=null==p?void 0:p.annotations)&&void 0!==n?n:[];if(t.length>0&&0===v.length)continue;const g=t.length>0?{...p,occurrences:v.length,annotations:v}:p;if(!(null===(r=null==g?void 0:g.pageUrls)||void 0===r?void 0:r.length)){const t="__unknown__";h.has(t)||h.set(t,{displayUrl:"__unknown__",warnings:[]}),null===(a=null===(s=h.get(t))||void 0===s?void 0:s.warnings)||void 0===a||a.push(g);continue}const f=new Map;for(const t of g.pageUrls){const e=this.normalizeUrlForGrouping(t);f.has(e)||f.set(e,t)}for(const[t,e]of f){const i=(null===(l=g.annotations)||void 0===l?void 0:l.filter((e=>{var i,o,n;const r=(null===(i=null==e?void 0:e.pageInfo)||void 0===i?void 0:i.url)||(null===(o=null==e?void 0:e.location)||void 0===o?void 0:o.url)||(null===(n=null==e?void 0:e.agent)||void 0===n?void 0:n.url)||"";return this.normalizeUrlForGrouping(r)===t})))||[];if(0===i.length)continue;const o={...g,occurrences:i.length,annotations:i};h.has(t)||h.set(t,{displayUrl:e,warnings:[]}),null===(d=null===(c=h.get(t))||void 0===c?void 0:c.warnings)||void 0===d||d.push(o)}}const p=[],v=this.normalizeUrlForGrouping(this.currentPageUrl);for(const[t,{displayUrl:e,warnings:i}]of h){const o="__unknown__"===t?"Unknown":t;p.push({pageUrl:e,pagePath:o,isCurrentPage:t===v&&"__unknown__"!==t,warnings:i})}return p.sort(((t,e)=>{var i;return(null==t?void 0:t.isCurrentPage)?-1:(null==e?void 0:e.isCurrentPage)?1:null===(i=null==t?void 0:t.pagePath)||void 0===i?void 0:i.localeCompare(null==e?void 0:e.pagePath)})),u.length>0&&p.unshift({pageUrl:iu,pagePath:"Site",isCurrentPage:!1,warnings:u,isSite:!0}),p}catch(t){return console.warn("Error in groupWarningsByPage: ",t),[]}},this.toggleAccordion=t=>{try{this.userAdjustedAccordions=!0;const e=new Set(this.openAccordions);e.has(t)?e.delete(t):e.add(t),this.openAccordions=e}catch(t){console.warn("Error in toggleAccordion: ",t)}},this.buildAgentRows=()=>Lu(this.agentRunStatuses,this.agentGroups),this.getAgentRowStatusText=t=>{var e;try{if((null==t?void 0:t.state)===Wh)return"Running";if((null==t?void 0:t.state)===qh){const e=`${t.count} ${1===t.count?"finding":"findings"}`;return t.pending?`${e}. ${zh}`:e}return(null==t?void 0:t.state)===Kh?null!==(e=t.title)&&void 0!==e?e:Jh:(null==t?void 0:t.resolved)?"All findings resolved":Tu}catch(t){return console.warn("Error in getAgentRowStatusText: ",t),""}},this.getRunStatusAnnouncement=()=>{try{const t=this.buildAgentRows();if(0===t.length)return this.loading?Hh:"";const e=t.filter((t=>t.state===Wh)).length;if(e>0)return`Running ${e} of ${t.length} QA ${1===t.length?"agent":"agents"}`;const i=t.filter((t=>t.state===qh)).reduce(((t,e)=>t+e.count),0),o=t.filter((t=>t.state===Kh)).length,n=i>0?`${i} ${1===i?"finding":"findings"}.`:o>0?"":`${Tu}.`;return["QA agents finished.",n,o>0?`${o} ${1===o?"check":"checks"} could not finish.`:""].filter((t=>!!t)).join(" ")}catch(t){return console.warn("Error in getRunStatusAnnouncement: ",t),""}},this.onActivationKey=(t,e)=>{try{"Enter"!==(null==t?void 0:t.key)&&" "!==(null==t?void 0:t.key)&&"Spacebar"!==(null==t?void 0:t.key)||(t.preventDefault(),e())}catch(t){console.warn("Error in onActivationKey: ",t)}},this.isUnsyncedWarning=t=>{var e;try{const i=this.getWarningAnnotationId(t);return!!i&&(null!==(e=this.unsyncedAnnotationIds)&&void 0!==e?e:[]).includes(i)}catch(t){return console.warn("Error in isUnsyncedWarning: ",t),!1}},this.isPageLevelWarning=t=>{var e,i,o;try{return 1===(null!==(i=null===(e=null==t?void 0:t.annotations)||void 0===e?void 0:e.length)&&void 0!==i?i:0)&&!0===(null===(o=t.annotations[0])||void 0===o?void 0:o.isPageAnnotation)}catch(t){return console.warn("Error in isPageLevelWarning: ",t),!1}},this.isExpandableWarning=t=>{var e,i;return 1===(null!==(i=null===(e=null==t?void 0:t.annotations)||void 0===e?void 0:e.length)&&void 0!==i?i:0)},this.canShowOnPage=t=>this.isExpandableWarning(t)&&!this.isPageLevelWarning(t)&&!this.isUnsyncedWarning(t),this.onShowOnPageClick=(t,e)=>{try{t.stopPropagation(),this.dispatchEvent(new CustomEvent("content-warning-item-click",{bubbles:!0,composed:!0,detail:{annotation:e}}))}catch(t){console.warn("Error in onShowOnPageClick: ",t)}},this.getWarningAnnotationId=t=>{var e;const i=null===(e=null==t?void 0:t.annotations)||void 0===e?void 0:e[0];return`${(null==i?void 0:i.annotationId)||(null==i?void 0:i.id)||""}`},this.toggleFindingExpanded=t=>{try{const e=this.getWarningAnnotationId(t);if(!e)return;const i=new Set(this.expandedFindingIds);i.has(e)?i.delete(e):i.add(e),this.expandedFindingIds=i}catch(t){console.warn("Error in toggleFindingExpanded: ",t)}},this.getAgentIconInfo=(t,e)=>{try{return Mu(t,e)}catch(t){return console.warn("Error in getAgentIconInfo: ",t),Mu("","")}},this.onAgentRowClick=t=>{try{(null==t?void 0:t.state)===qh&&(null==t?void 0:t.group)&&this.onAgentClick(t.agentId)}catch(t){console.warn("Error in onAgentRowClick: ",t)}},this.renderWarningIcon=()=>{try{return R`
5878
+ `;let Fu=class extends tt{constructor(){super(...arguments),this.agentGroups=[],this.currentPageUrl="",this.theme="light",this.agentRunStatuses=[],this.loading=!1,this.unsyncedAnnotationIds=[],this.expandedFindingIds=new Set,this.openAccordions=new Set,this.currentView="agents",this.selectedAgentId="",this.selectedFindingGroup=null,this.userAdjustedAccordions=!1,this.getSelectedAgentGroup=()=>{var t;try{return null===(t=this.agentGroups)||void 0===t?void 0:t.find((t=>(null==t?void 0:t.agentId)===this.selectedAgentId))}catch(t){return void console.warn("Error in getSelectedAgentGroup: ",t)}},this.onAgentClick=t=>{try{this.selectedAgentId=t,this.selectedFindingGroup=null,this.currentView="agent-detail",this.userAdjustedAccordions=!1,this.autoOpenCurrentPageAccordion(t)}catch(t){console.warn("Error in onAgentClick: ",t)}},this.autoOpenCurrentPageAccordion=t=>{var e;try{const i=null===(e=this.agentGroups)||void 0===e?void 0:e.find((e=>(null==e?void 0:e.agentId)===t));if(!i)return;const o=this.groupWarningsByPage(i.warnings),n=null==o?void 0:o.find((t=>null==t?void 0:t.isCurrentPage));this.openAccordions=new Set,(null==n?void 0:n.pageUrl)&&this.openAccordions.add(n.pageUrl)}catch(t){console.warn("Error in autoOpenCurrentPageAccordion: ",t)}},this.onBackClick=()=>{try{if("finding-group"===this.currentView)return this.currentView="agent-detail",void(this.selectedFindingGroup=null);this.userAdjustedAccordions=!1,this.currentView="agents",this.selectedAgentId=""}catch(t){console.warn("Error in onBackClick: ",t)}},this.onWarningRowClick=(t,e="")=>{var i,o,n;try{const r=null===(i=null==t?void 0:t.annotations)||void 0===i?void 0:i[0];if(!r)return;if((null!==(n=null===(o=null==t?void 0:t.annotations)||void 0===o?void 0:o.length)&&void 0!==n?n:0)>1)return void this.openFindingGroup(t,e);if(this.isExpandableWarning(t))return void this.toggleFindingExpanded(t);this.dispatchEvent(new CustomEvent("content-warning-item-click",{bubbles:!0,composed:!0,detail:{annotation:r}}))}catch(t){console.warn("Error in onWarningRowClick: ",t)}},this.openFindingGroup=(t,e)=>{var i,o;try{this.selectedFindingGroup={pageUrl:e,primaryText:null!==(i=null==t?void 0:t.primaryText)&&void 0!==i?i:"",secondaryText:null!==(o=null==t?void 0:t.secondaryText)&&void 0!==o?o:""},this.currentView="finding-group"}catch(t){console.warn("Error in openFindingGroup: ",t)}},this.getSelectedFindingGroup=()=>{var t,e;try{const i=this.selectedFindingGroup,o=this.getSelectedAgentGroup();if(!i||!o)return;const n=null===(t=this.groupWarningsByPage(o.warnings))||void 0===t?void 0:t.find((t=>(null==t?void 0:t.pageUrl)===i.pageUrl));return null===(e=null==n?void 0:n.warnings)||void 0===e?void 0:e.find((t=>(null==t?void 0:t.primaryText)===i.primaryText&&(null==t?void 0:t.secondaryText)===i.secondaryText))}catch(t){return void console.warn("Error in getSelectedFindingGroup: ",t)}},this.onAddAllSuggestions=t=>{try{this.dispatchEvent(new CustomEvent("content-warning-sidebar-add-all",{bubbles:!0,composed:!0,detail:{agentId:t}}))}catch(t){console.warn("Error in onAddAllSuggestions: ",t)}},this.onCloseClick=()=>{try{this.dispatchEvent(new CustomEvent("content-warning-sidebar-close",{bubbles:!0,composed:!0}))}catch(t){console.warn("Error in onCloseClick: ",t)}},this.normalizeUrlForGrouping=t=>{try{if(!t)return"";const e=jd(t);null!==e&&""!==e&&(t=e);const i="false"!==localStorage.getItem("sfNormalizeParams");let o=t;if(null==t?void 0:t.startsWith("/"))i&&(o=t.split("?")[0].split("#")[0]);else{const e=new URL(t);o=i?(null==e?void 0:e.pathname)||"/":(null==e?void 0:e.pathname)+((null==e?void 0:e.search)||"")+((null==e?void 0:e.hash)||"")}return(null==o?void 0:o.startsWith("/"))?o.substring(1):o}catch{const e=t||"";return(null==e?void 0:e.startsWith("/"))?e.substring(1):e}},this.groupWarningsByPage=t=>{var e,i,o,n,r,s,a,l,c,d;try{const h=new Map,u=[];for(const p of t){const t=null!==(i=null===(e=null==p?void 0:p.annotations)||void 0===e?void 0:e.filter((t=>yu(t))))&&void 0!==i?i:[];t.length>0&&u.push({...p,occurrences:t.length,annotations:t});const v=t.length>0?(null!==(o=null==p?void 0:p.annotations)&&void 0!==o?o:[]).filter((t=>!yu(t))):null!==(n=null==p?void 0:p.annotations)&&void 0!==n?n:[];if(t.length>0&&0===v.length)continue;const g=t.length>0?{...p,occurrences:v.length,annotations:v}:p;if(!(null===(r=null==g?void 0:g.pageUrls)||void 0===r?void 0:r.length)){const t="__unknown__";h.has(t)||h.set(t,{displayUrl:"__unknown__",warnings:[]}),null===(a=null===(s=h.get(t))||void 0===s?void 0:s.warnings)||void 0===a||a.push(g);continue}const f=new Map;for(const t of g.pageUrls){const e=this.normalizeUrlForGrouping(t);f.has(e)||f.set(e,t)}for(const[t,e]of f){const i=(null===(l=g.annotations)||void 0===l?void 0:l.filter((e=>{var i,o,n;const r=(null===(i=null==e?void 0:e.pageInfo)||void 0===i?void 0:i.url)||(null===(o=null==e?void 0:e.location)||void 0===o?void 0:o.url)||(null===(n=null==e?void 0:e.agent)||void 0===n?void 0:n.url)||"";return this.normalizeUrlForGrouping(r)===t})))||[];if(0===i.length)continue;const o={...g,occurrences:i.length,annotations:i};h.has(t)||h.set(t,{displayUrl:e,warnings:[]}),null===(d=null===(c=h.get(t))||void 0===c?void 0:c.warnings)||void 0===d||d.push(o)}}const p=[],v=this.normalizeUrlForGrouping(this.currentPageUrl);for(const[t,{displayUrl:e,warnings:i}]of h){const o="__unknown__"===t?"Unknown":t;p.push({pageUrl:e,pagePath:o,isCurrentPage:t===v&&"__unknown__"!==t,warnings:i})}return p.sort(((t,e)=>{var i;return(null==t?void 0:t.isCurrentPage)?-1:(null==e?void 0:e.isCurrentPage)?1:null===(i=null==t?void 0:t.pagePath)||void 0===i?void 0:i.localeCompare(null==e?void 0:e.pagePath)})),u.length>0&&p.unshift({pageUrl:ou,pagePath:"Site",isCurrentPage:!1,warnings:u,isSite:!0}),p}catch(t){return console.warn("Error in groupWarningsByPage: ",t),[]}},this.toggleAccordion=t=>{try{this.userAdjustedAccordions=!0;const e=new Set(this.openAccordions);e.has(t)?e.delete(t):e.add(t),this.openAccordions=e}catch(t){console.warn("Error in toggleAccordion: ",t)}},this.buildAgentRows=()=>Ru(this.agentRunStatuses,this.agentGroups),this.getAgentRowStatusText=t=>{var e;try{if((null==t?void 0:t.state)===qh)return"Running";if((null==t?void 0:t.state)===Zh){const e=`${t.count} ${1===t.count?"finding":"findings"}`;return t.pending?`${e}. ${Hh}`:e}return(null==t?void 0:t.state)===Jh?null!==(e=t.title)&&void 0!==e?e:Yh:(null==t?void 0:t.resolved)?"All findings resolved":Iu}catch(t){return console.warn("Error in getAgentRowStatusText: ",t),""}},this.getRunStatusAnnouncement=()=>{try{const t=this.buildAgentRows();if(0===t.length)return this.loading?Gh:"";const e=t.filter((t=>t.state===qh)).length;if(e>0)return`Running ${e} of ${t.length} QA ${1===t.length?"agent":"agents"}`;const i=t.filter((t=>t.state===Zh)).reduce(((t,e)=>t+e.count),0),o=t.filter((t=>t.state===Jh)).length,n=i>0?`${i} ${1===i?"finding":"findings"}.`:o>0?"":`${Iu}.`;return["QA agents finished.",n,o>0?`${o} ${1===o?"check":"checks"} could not finish.`:""].filter((t=>!!t)).join(" ")}catch(t){return console.warn("Error in getRunStatusAnnouncement: ",t),""}},this.onActivationKey=(t,e)=>{try{"Enter"!==(null==t?void 0:t.key)&&" "!==(null==t?void 0:t.key)&&"Spacebar"!==(null==t?void 0:t.key)||(t.preventDefault(),e())}catch(t){console.warn("Error in onActivationKey: ",t)}},this.isUnsyncedWarning=t=>{var e;try{const i=this.getWarningAnnotationId(t);return!!i&&(null!==(e=this.unsyncedAnnotationIds)&&void 0!==e?e:[]).includes(i)}catch(t){return console.warn("Error in isUnsyncedWarning: ",t),!1}},this.isPageLevelWarning=t=>{var e,i,o;try{return 1===(null!==(i=null===(e=null==t?void 0:t.annotations)||void 0===e?void 0:e.length)&&void 0!==i?i:0)&&!0===(null===(o=t.annotations[0])||void 0===o?void 0:o.isPageAnnotation)}catch(t){return console.warn("Error in isPageLevelWarning: ",t),!1}},this.isExpandableWarning=t=>{var e,i;return 1===(null!==(i=null===(e=null==t?void 0:t.annotations)||void 0===e?void 0:e.length)&&void 0!==i?i:0)},this.canShowOnPage=t=>this.isExpandableWarning(t)&&!this.isPageLevelWarning(t)&&!this.isUnsyncedWarning(t),this.onShowOnPageClick=(t,e)=>{try{t.stopPropagation(),this.dispatchEvent(new CustomEvent("content-warning-item-click",{bubbles:!0,composed:!0,detail:{annotation:e}}))}catch(t){console.warn("Error in onShowOnPageClick: ",t)}},this.getWarningAnnotationId=t=>{var e;const i=null===(e=null==t?void 0:t.annotations)||void 0===e?void 0:e[0];return`${(null==i?void 0:i.annotationId)||(null==i?void 0:i.id)||""}`},this.toggleFindingExpanded=t=>{try{const e=this.getWarningAnnotationId(t);if(!e)return;const i=new Set(this.expandedFindingIds);i.has(e)?i.delete(e):i.add(e),this.expandedFindingIds=i}catch(t){console.warn("Error in toggleFindingExpanded: ",t)}},this.getAgentIconInfo=(t,e)=>{try{return Mu(t,e)}catch(t){return console.warn("Error in getAgentIconInfo: ",t),Mu("","")}},this.onAgentRowClick=t=>{try{(null==t?void 0:t.state)===Zh&&(null==t?void 0:t.group)&&this.onAgentClick(t.agentId)}catch(t){console.warn("Error in onAgentRowClick: ",t)}},this.renderWarningIcon=()=>{try{return R`
5879
5879
  <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
5880
5880
  <path d="M12.0003 10.2329V13.8332M12.0003 16.5334H12.0093M10.5268 5.36441L3.23087 17.546C3.08046 17.8064 3.00087 18.1017 3.00001 18.4025C2.99915 18.7033 3.07705 18.999 3.22596 19.2604C3.37487 19.5217 3.5896 19.7395 3.8488 19.8921C4.108 20.0446 4.40263 20.1267 4.70338 20.1301H19.2971C19.5978 20.1266 19.8922 20.0445 20.1513 19.892C20.4104 19.7395 20.625 19.5218 20.7739 19.2606C20.9228 18.9994 21.0007 18.7038 21 18.4032C20.9992 18.1025 20.9198 17.8073 20.7697 17.5469L13.4737 5.36351C13.3202 5.11015 13.1039 4.90064 12.8458 4.75524C12.5877 4.60984 12.2965 4.53345 12.0003 4.53345C11.704 4.53345 11.4128 4.60984 11.1547 4.75524C10.8966 4.90064 10.6803 5.11015 10.5268 5.36351V5.36441Z" stroke="#E69422" stroke-width="1.80014" stroke-linecap="round" stroke-linejoin="round"/>
5881
5881
  </svg>
5882
- `}catch(t){return console.warn("Error in renderWarningIcon: ",t),R``}},this.renderBackIcon=()=>{try{return this.theme===Bh?R`
5883
- <div class="back-icon-wrapper" role="button" tabindex="0" aria-label=${_u}
5882
+ `}catch(t){return console.warn("Error in renderWarningIcon: ",t),R``}},this.renderBackIcon=()=>{try{return this.theme===zh?R`
5883
+ <div class="back-icon-wrapper" role="button" tabindex="0" aria-label=${$u}
5884
5884
  @click=${this.onBackClick}
5885
5885
  @keydown=${t=>this.onActivationKey(t,this.onBackClick)}>
5886
5886
  ${function(){try{return R`
@@ -5890,15 +5890,15 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
5890
5890
  `}catch(t){return console.warn("Error in renderDarkBackChevronIcon: ",t),R``}}()}
5891
5891
  </div>
5892
5892
  `:R`
5893
- <div class="back-icon-wrapper" role="button" tabindex="0" aria-label=${_u}
5893
+ <div class="back-icon-wrapper" role="button" tabindex="0" aria-label=${$u}
5894
5894
  @click=${this.onBackClick}
5895
5895
  @keydown=${t=>this.onActivationKey(t,this.onBackClick)}>
5896
5896
  <svg class="back-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
5897
5897
  <path d="M15 18L9 12L15 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5898
5898
  </svg>
5899
5899
  </div>
5900
- `}catch(t){return console.warn("Error in renderBackIcon: ",t),R``}},this.renderCloseIcon=()=>{try{return this.theme===Bh?R`
5901
- <div class="close-icon-wrapper cws-icon-shell" role="button" tabindex="0" aria-label=${$u}
5900
+ `}catch(t){return console.warn("Error in renderBackIcon: ",t),R``}},this.renderCloseIcon=()=>{try{return this.theme===zh?R`
5901
+ <div class="close-icon-wrapper cws-icon-shell" role="button" tabindex="0" aria-label=${Nu}
5902
5902
  @click=${this.onCloseClick}
5903
5903
  @keydown=${t=>this.onActivationKey(t,this.onCloseClick)}>
5904
5904
  ${function(){try{return R`
@@ -5910,7 +5910,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
5910
5910
  `}catch(t){return console.warn("Error in renderDarkCloseIcon: ",t),R``}}()}
5911
5911
  </div>
5912
5912
  `:R`
5913
- <div class="close-icon-wrapper" role="button" tabindex="0" aria-label=${$u}
5913
+ <div class="close-icon-wrapper" role="button" tabindex="0" aria-label=${Nu}
5914
5914
  @click=${this.onCloseClick}
5915
5915
  @keydown=${t=>this.onActivationKey(t,this.onCloseClick)}>
5916
5916
  <svg class="close-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -5927,11 +5927,11 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
5927
5927
  <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
5928
5928
  <path d="M9 6L15 12L9 18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5929
5929
  </svg>
5930
- `}catch(t){return console.warn("Error in renderChevronRight: ",t),R``}},this.renderRowChevron=()=>{try{return R`<div class="cws-icon-shell cws-row-chevron" aria-hidden="true">${this.theme===Bh?function(){try{return R`
5930
+ `}catch(t){return console.warn("Error in renderChevronRight: ",t),R``}},this.renderRowChevron=()=>{try{return R`<div class="cws-icon-shell cws-row-chevron" aria-hidden="true">${this.theme===zh?function(){try{return R`
5931
5931
  <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
5932
5932
  <path d="M7.5 5L12.5 10L7.5 15" stroke="white" stroke-opacity="0.52" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/>
5933
5933
  </svg>
5934
- `}catch(t){return console.warn("Error in renderDarkChevronRightIcon: ",t),R``}}():this.renderChevronRight()}</div>`}catch(t){return console.warn("Error in renderRowChevron: ",t),R``}},this.renderAccordionChevron=t=>{try{return this.theme===Bh?R`
5934
+ `}catch(t){return console.warn("Error in renderDarkChevronRightIcon: ",t),R``}}():this.renderChevronRight()}</div>`}catch(t){return console.warn("Error in renderRowChevron: ",t),R``}},this.renderAccordionChevron=t=>{try{return this.theme===zh?R`
5935
5935
  <div class="cws-icon-shell">
5936
5936
  ${function(t){try{return R`
5937
5937
  <svg class="cws-accordion-chevron${t?" open":""}" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -5943,7 +5943,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
5943
5943
  <svg class="cws-accordion-chevron ${ut({open:t})}" width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
5944
5944
  <path d="M6 9L12 15L18 9" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5945
5945
  </svg>
5946
- `}catch(t){return console.warn("Error in renderAccordionChevron: ",t),R``}},this.renderGroupedListView=(t,e,i,o,n=Tu)=>{try{const r=this.groupWarningsByPage(e),s="cws-header-title"+(this.theme===Bh?" cws-header-title--detail":"");return R`
5946
+ `}catch(t){return console.warn("Error in renderAccordionChevron: ",t),R``}},this.renderGroupedListView=(t,e,i,o,n=Iu)=>{try{const r=this.groupWarningsByPage(e),s="cws-header-title"+(this.theme===zh?" cws-header-title--detail":"");return R`
5947
5947
  <div class="cws-header">
5948
5948
  <div class="cws-header-left">
5949
5949
  ${this.renderBackIcon()}
@@ -5991,7 +5991,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
5991
5991
  </button>
5992
5992
  </div> -->
5993
5993
  `:""}
5994
- `}catch(t){return console.warn("Error in renderGroupedListView: ",t),R``}},this.renderAgentsView=()=>{var t;try{return this.theme===Bh?this.renderAgentsViewDark():R`
5994
+ `}catch(t){return console.warn("Error in renderGroupedListView: ",t),R``}},this.renderAgentsView=()=>{var t;try{return this.theme===zh?this.renderAgentsViewDark():R`
5995
5995
  <div class="cws-header">
5996
5996
  <div class="cws-header-left">
5997
5997
  ${this.renderWarningIcon()}
@@ -6016,7 +6016,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6016
6016
  ${this.renderChevronRight()}
6017
6017
  </div>
6018
6018
  </div>
6019
- `)):R`<div class="cws-empty-state"><span>${Gh}</span></div>`}
6019
+ `)):R`<div class="cws-empty-state"><span>${Wh}</span></div>`}
6020
6020
  </div>
6021
6021
  `}catch(t){return console.warn("Error in renderAgentsView: ",t),R``}},this.renderAgentsViewDark=()=>{try{const t=this.buildAgentRows();return R`
6022
6022
  <div class="cws-header">
@@ -6029,20 +6029,20 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6029
6029
  </div>
6030
6030
  <div class="cws-divider"></div>
6031
6031
  <div class="cws-category-list">
6032
- ${(null==t?void 0:t.length)>0?t.map((t=>this.renderAgentRow(t))):this.loading?this.renderAgentsLoadingRow():R`<div class="cws-empty-state"><span>${Gh}</span></div>`}
6032
+ ${(null==t?void 0:t.length)>0?t.map((t=>this.renderAgentRow(t))):this.loading?this.renderAgentsLoadingRow():R`<div class="cws-empty-state"><span>${Wh}</span></div>`}
6033
6033
  </div>
6034
6034
  `}catch(t){return console.warn("Error in renderAgentsViewDark: ",t),R``}},this.renderAgentsLoadingRow=()=>{try{return R`
6035
6035
  <div class="cws-agent-row cws-agent-row--loading">
6036
6036
  <div class="cws-agent-row-left cws-agent-row-left--clean">
6037
- <span class="cws-agent-row-name cws-agent-row-name--clean">${Hh}</span>
6037
+ <span class="cws-agent-row-name cws-agent-row-name--clean">${Gh}</span>
6038
6038
  </div>
6039
6039
  <div class="cws-agent-row-right">
6040
6040
  <div class="cws-icon-shell">
6041
- <div class="cws-spinner-icon">${Eu()}</div>
6041
+ <div class="cws-spinner-icon">${ku()}</div>
6042
6042
  </div>
6043
6043
  </div>
6044
6044
  </div>
6045
- `}catch(t){return console.warn("Error in renderAgentsLoadingRow: ",t),R``}},this.renderAgentRow=t=>{var e,i;try{const o=(null==t?void 0:t.state)===Zh,n=(null==t?void 0:t.state)===qh,r=(null==t?void 0:t.state)===Kh,s=n&&!!(null==t?void 0:t.group),a=n&&!(null==t?void 0:t.group),l=o||r,c=this.getAgentIconInfo(null!==(e=null==t?void 0:t.agentId)&&void 0!==e?e:"",null!==(i=null==t?void 0:t.agentName)&&void 0!==i?i:""),d=l?"#ffffff":c.color,h=`cws-agent-row${s?" cws-agent-row--clickable":""}${a?" cws-agent-row--pending":""}${r?" cws-agent-row--unavailable":""}`,u=`cws-agent-row-left${o?" cws-agent-row-left--clean":""}${r?" cws-agent-row-left--unavailable":""}`,p=`cws-agent-row-name${o?" cws-agent-row-name--clean":""}${r?" cws-agent-row-name--unavailable":""}`,v=this.getAgentRowStatusText(t),g=(a||r)&&(null==t?void 0:t.title)||F;return R`
6045
+ `}catch(t){return console.warn("Error in renderAgentsLoadingRow: ",t),R``}},this.renderAgentRow=t=>{var e,i;try{const o=(null==t?void 0:t.state)===Kh,n=(null==t?void 0:t.state)===Zh,r=(null==t?void 0:t.state)===Jh,s=n&&!!(null==t?void 0:t.group),a=n&&!(null==t?void 0:t.group),l=o||r,c=this.getAgentIconInfo(null!==(e=null==t?void 0:t.agentId)&&void 0!==e?e:"",null!==(i=null==t?void 0:t.agentName)&&void 0!==i?i:""),d=l?"#ffffff":c.color,h=`cws-agent-row${s?" cws-agent-row--clickable":""}${a?" cws-agent-row--pending":""}${r?" cws-agent-row--unavailable":""}`,u=`cws-agent-row-left${o?" cws-agent-row-left--clean":""}${r?" cws-agent-row-left--unavailable":""}`,p=`cws-agent-row-name${o?" cws-agent-row-name--clean":""}${r?" cws-agent-row-name--unavailable":""}`,v=this.getAgentRowStatusText(t),g=(a||r)&&(null==t?void 0:t.title)||F;return R`
6046
6046
  <div class="${h}"
6047
6047
  role=${s?"button":F}
6048
6048
  tabindex=${s?"0":F}
@@ -6059,11 +6059,11 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6059
6059
  </div>
6060
6060
  ${s?F:R`<span class="cws-sr-only">${v}</span>`}
6061
6061
  </div>
6062
- `}catch(t){return console.warn("Error in renderAgentRow: ",t),R``}},this.renderAgentRowStatus=t=>{try{return(null==t?void 0:t.state)===Wh?R`
6062
+ `}catch(t){return console.warn("Error in renderAgentRow: ",t),R``}},this.renderAgentRowStatus=t=>{try{return(null==t?void 0:t.state)===qh?R`
6063
6063
  <div class="cws-icon-shell">
6064
- <div class="cws-spinner-icon">${Eu()}</div>
6064
+ <div class="cws-spinner-icon">${ku()}</div>
6065
6065
  </div>
6066
- `:(null==t?void 0:t.state)===qh?R`
6066
+ `:(null==t?void 0:t.state)===Zh?R`
6067
6067
  <div class="cws-findings-pill">
6068
6068
  <span class="cws-findings-count">${null==t?void 0:t.count}</span>
6069
6069
  ${function(){try{return R`
@@ -6073,12 +6073,12 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6073
6073
  </svg>
6074
6074
  `}catch(t){return console.warn("Error in renderDarkAlertIcon: ",t),R``}}()}
6075
6075
  </div>
6076
- `:(null==t?void 0:t.state)===Kh?R`
6076
+ `:(null==t?void 0:t.state)===Jh?R`
6077
6077
  <div class="cws-icon-shell cws-unavailable-icon">${function(){try{return R`
6078
6078
  <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
6079
- <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" stroke="${Yh}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
6080
- <path d="M12 8v4" stroke="${Yh}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
6081
- <path d="M12 16h.01" stroke="${Yh}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
6079
+ <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" stroke="${Qh}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
6080
+ <path d="M12 8v4" stroke="${Qh}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
6081
+ <path d="M12 16h.01" stroke="${Qh}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
6082
6082
  </svg>
6083
6083
  `}catch(t){return console.warn("Error in renderDarkUnavailableIcon: ",t),R``}}()}</div>
6084
6084
  `:R`
@@ -6087,7 +6087,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6087
6087
  <path d="M5.83333 10L10 14.1667L18.3333 5.83333M1.66667 10L5.83333 14.1667M10 10L14.1667 5.83333" stroke="#0DCF82" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/>
6088
6088
  </svg>
6089
6089
  `}catch(t){return console.warn("Error in renderDarkChecksIcon: ",t),R``}}()}</div>
6090
- `}catch(t){return console.warn("Error in renderAgentRowStatus: ",t),R``}},this.renderSeverityDot=t=>{const e=t&&tu[t]||eu;return R`<span class="cws-severity-dot cws-severity-dot--${e.tone}" role="img" aria-label="${e.label} severity"></span>`},this.renderFindingBody=(t,e=!1)=>{var i,o,n,r,s,a,l,c;try{const d=null===(i=null==t?void 0:t.annotations)||void 0===i?void 0:i[0],h=null!==(l=null!==(n=null===(o=null==d?void 0:d.agent)||void 0===o?void 0:o.reason)&&void 0!==n?n:null===(a=null===(s=null===(r=null==d?void 0:d.comments)||void 0===r?void 0:r[0])||void 0===s?void 0:s.agent)||void 0===a?void 0:a.reason)&&void 0!==l?l:{},u="string"==typeof(null==h?void 0:h.suggestion)?h.suggestion.trim():"",p=e?[]:null!==(c=null==t?void 0:t.subItems)&&void 0!==c?c:[],v=!e,g=this.canShowOnPage(t),f=this.canGoToNextPage(d),m=g||f;return u||p.length||m?R`
6090
+ `}catch(t){return console.warn("Error in renderAgentRowStatus: ",t),R``}},this.renderSeverityDot=t=>{const e=t&&eu[t]||iu;return R`<span class="cws-severity-dot cws-severity-dot--${e.tone}" role="img" aria-label="${e.label} severity"></span>`},this.renderFindingBody=(t,e=!1)=>{var i,o,n,r,s,a,l,c;try{const d=null===(i=null==t?void 0:t.annotations)||void 0===i?void 0:i[0],h=null!==(l=null!==(n=null===(o=null==d?void 0:d.agent)||void 0===o?void 0:o.reason)&&void 0!==n?n:null===(a=null===(s=null===(r=null==d?void 0:d.comments)||void 0===r?void 0:r[0])||void 0===s?void 0:s.agent)||void 0===a?void 0:a.reason)&&void 0!==l?l:{},u="string"==typeof(null==h?void 0:h.suggestion)?h.suggestion.trim():"",p=e?[]:null!==(c=null==t?void 0:t.subItems)&&void 0!==c?c:[],v=!e,g=this.canShowOnPage(t),f=this.canGoToNextPage(d),m=g||f;return u||p.length||m?R`
6091
6091
  <div class="cws-finding-body${v?" cws-finding-body--dot":""}">
6092
6092
  ${u?R`<span class="cws-finding-suggestion">${u}</span>`:F}
6093
6093
  ${p.length?R`
@@ -6115,7 +6115,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6115
6115
  </div>
6116
6116
  `:F}
6117
6117
  </div>
6118
- `:F}catch(t){return console.warn("Error in renderFindingBody: ",t),F}},this.canGoToNextPage=t=>{try{return wu(t)&&yu(t).length>1}catch(t){return console.warn("Error in canGoToNextPage: ",t),!1}},this.onNextPageClick=(t,e)=>{try{t.stopPropagation(),this.dispatchEvent(new CustomEvent("content-warning-item-next",{bubbles:!0,composed:!0,detail:{annotation:e}}))}catch(t){console.warn("Error in onNextPageClick: ",t)}},this.getSitePagesLabel=t=>{var e;try{const i=null!==(e=null==t?void 0:t.annotations)&&void 0!==e?e:[],o=i.reduce(((t,e)=>Math.max(t,(t=>{var e;const i=mu(t);return i?Math.max(null!==(e=i.pageCount)&&void 0!==e?e:0,i.pages.length):0})(e))),0),n=i.some((t=>{var e;return!0===(null===(e=mu(t))||void 0===e?void 0:e.allPagesMatched)}));return((t,e=!1)=>{const i=Number.isFinite(t)&&t>0?Math.floor(t):0;return e?i>1?`All ${i.toLocaleString("en-US")} pages`:"All pages":i<=0?"":`${i.toLocaleString("en-US")} ${1===i?"page":"pages"}`})(o,n)}catch(t){return console.warn("Error in getSitePagesLabel: ",t),""}},this.renderGenericRow=(t,e="")=>{var i,o;try{const n=(t=>{var e,i,o,n;const r=null!==(i=null===(e=null==t?void 0:t.annotations)||void 0===e?void 0:e.length)&&void 0!==i?i:0;return r>1?r:1===r&&(null!==(n=null===(o=null==t?void 0:t.subItems)||void 0===o?void 0:o.length)&&void 0!==n?n:0)>1?t.subItems.length:r})(t),r=(null!==(o=null===(i=null==t?void 0:t.annotations)||void 0===i?void 0:i.length)&&void 0!==o?o:0)>1?"findings":"items",s=this.isExpandableWarning(t),a=n>1&&!s,l=s&&this.isUnsyncedWarning(t),c=s&&this.expandedFindingIds.has(this.getWarningAnnotationId(t)),d=e===iu?this.getSitePagesLabel(t):"";return R`
6118
+ `:F}catch(t){return console.warn("Error in renderFindingBody: ",t),F}},this.canGoToNextPage=t=>{try{return yu(t)&&bu(t).length>1}catch(t){return console.warn("Error in canGoToNextPage: ",t),!1}},this.onNextPageClick=(t,e)=>{try{t.stopPropagation(),this.dispatchEvent(new CustomEvent("content-warning-item-next",{bubbles:!0,composed:!0,detail:{annotation:e}}))}catch(t){console.warn("Error in onNextPageClick: ",t)}},this.getSitePagesLabel=t=>{var e;try{const i=null!==(e=null==t?void 0:t.annotations)&&void 0!==e?e:[],o=i.reduce(((t,e)=>Math.max(t,(t=>{var e;const i=wu(t);return i?Math.max(null!==(e=i.pageCount)&&void 0!==e?e:0,i.pages.length):0})(e))),0),n=i.some((t=>{var e;return!0===(null===(e=wu(t))||void 0===e?void 0:e.allPagesMatched)}));return((t,e=!1)=>{const i=Number.isFinite(t)&&t>0?Math.floor(t):0;return e?i>1?`All ${i.toLocaleString("en-US")} pages`:"All pages":i<=0?"":`${i.toLocaleString("en-US")} ${1===i?"page":"pages"}`})(o,n)}catch(t){return console.warn("Error in getSitePagesLabel: ",t),""}},this.renderGenericRow=(t,e="")=>{var i,o;try{const n=(t=>{var e,i,o,n;const r=null!==(i=null===(e=null==t?void 0:t.annotations)||void 0===e?void 0:e.length)&&void 0!==i?i:0;return r>1?r:1===r&&(null!==(n=null===(o=null==t?void 0:t.subItems)||void 0===o?void 0:o.length)&&void 0!==n?n:0)>1?t.subItems.length:r})(t),r=(null!==(o=null===(i=null==t?void 0:t.annotations)||void 0===i?void 0:i.length)&&void 0!==o?o:0)>1?"findings":"items",s=this.isExpandableWarning(t),a=n>1&&!s,l=s&&this.isUnsyncedWarning(t),c=s&&this.expandedFindingIds.has(this.getWarningAnnotationId(t)),d=e===ou?this.getSitePagesLabel(t):"";return R`
6119
6119
  <div class="${`cws-list-row${l?" cws-list-row--unsynced":""}${c?" cws-list-row--expanded":""}`}${a?" cws-list-row--group":""}" role="button" tabindex="0"
6120
6120
  aria-expanded=${s?c?"true":"false":F}
6121
6121
  aria-label=${a?`${null==t?void 0:t.primaryText}, ${n} ${r}`:F}
@@ -6130,7 +6130,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6130
6130
  <span class="cws-generic-secondary cws-site-pages">${d}</span>
6131
6131
  `:""}
6132
6132
  ${c&&l?R`
6133
- <span class="cws-generic-secondary cws-generic-secondary--full cws-finding-note">${Iu}</span>
6133
+ <span class="cws-generic-secondary cws-generic-secondary--full cws-finding-note">${_u}</span>
6134
6134
  `:""}
6135
6135
  </div>
6136
6136
  ${n>1?R`<span class="cws-group-count" aria-hidden="true">${n}</span>`:F}
@@ -6146,13 +6146,13 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6146
6146
  <span class="cws-generic-primary${r?" cws-generic-primary--full":""}" title=${e.label}>${e.label}</span>
6147
6147
  <span class="cws-generic-secondary" title=${e.detail}>${e.detail}</span>
6148
6148
  ${r&&n?R`
6149
- <span class="cws-generic-secondary cws-generic-secondary--full cws-finding-note">${Iu}</span>
6149
+ <span class="cws-generic-secondary cws-generic-secondary--full cws-finding-note">${_u}</span>
6150
6150
  `:""}
6151
6151
  </div>
6152
6152
  ${this.renderRowChevron()}
6153
6153
  </div>
6154
6154
  ${r?this.renderFindingBody(i,!0):F}
6155
- `}catch(t){return console.warn("Error in renderFindingGroupItem: ",t),R``}},this.renderFindingGroupView=t=>{var e,i;try{const o="cws-header-title"+(this.theme===Bh?" cws-header-title--detail":""),n=null!==(i=null===(e=this.getSelectedAgentGroup())||void 0===e?void 0:e.agentName)&&void 0!==i?i:"",r=this.getFindingGroupEntries(t);return R`
6155
+ `}catch(t){return console.warn("Error in renderFindingGroupItem: ",t),R``}},this.renderFindingGroupView=t=>{var e,i;try{const o="cws-header-title"+(this.theme===zh?" cws-header-title--detail":""),n=null!==(i=null===(e=this.getSelectedAgentGroup())||void 0===e?void 0:e.agentName)&&void 0!==i?i:"",r=this.getFindingGroupEntries(t);return R`
6156
6156
  <div class="cws-header">
6157
6157
  <div class="cws-header-left">
6158
6158
  ${this.renderBackIcon()}
@@ -6176,7 +6176,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6176
6176
  </div>
6177
6177
  </div>
6178
6178
  </div>
6179
- `}catch(t){return console.warn("Error in renderFindingGroupView: ",t),R``}},this.renderAgentDetailView=()=>{try{const t=this.getSelectedAgentGroup();if(!t){const t="cws-header-title"+(this.theme===Bh?" cws-header-title--detail":"");return R`
6179
+ `}catch(t){return console.warn("Error in renderFindingGroupView: ",t),R``}},this.renderAgentDetailView=()=>{try{const t=this.getSelectedAgentGroup();if(!t){const t="cws-header-title"+(this.theme===zh?" cws-header-title--detail":"");return R`
6180
6180
  <div class="cws-header">
6181
6181
  <div class="cws-header-left">
6182
6182
  ${this.renderBackIcon()}
@@ -6188,12 +6188,12 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6188
6188
  </div>
6189
6189
  <div class="cws-divider"></div>
6190
6190
  <div class="cws-empty-state"><span>Agent not found.</span></div>
6191
- `}const e=t.agentId,i=this.renderGenericRow;return this.renderGroupedListView(t.agentName,t.warnings,i,e,`${Tu} for ${t.agentName}`)}catch(t){return console.warn("Error in renderAgentDetailView: ",t),R``}},this.renderCurrentView=()=>{var t,e;try{if("agents"===this.currentView)return this.renderAgentsView();if("finding-group"===this.currentView){const i=this.getSelectedFindingGroup();if(i&&(null!==(e=null===(t=i.annotations)||void 0===t?void 0:t.length)&&void 0!==e?e:0)>1)return this.renderFindingGroupView(i)}return this.renderAgentDetailView()}catch(t){return console.warn("Error in renderCurrentView: ",t),R``}}}willUpdate(t){try{"agent-detail"===this.currentView&&this.selectedAgentId&&!this.userAdjustedAccordions&&(t.has("agentGroups")||t.has("currentPageUrl"))&&this.autoOpenCurrentPageAccordion(this.selectedAgentId)}catch(t){console.warn("Error in willUpdate: ",t)}}render(){try{return R`
6191
+ `}const e=t.agentId,i=this.renderGenericRow;return this.renderGroupedListView(t.agentName,t.warnings,i,e,`${Iu} for ${t.agentName}`)}catch(t){return console.warn("Error in renderAgentDetailView: ",t),R``}},this.renderCurrentView=()=>{var t,e;try{if("agents"===this.currentView)return this.renderAgentsView();if("finding-group"===this.currentView){const i=this.getSelectedFindingGroup();if(i&&(null!==(e=null===(t=i.annotations)||void 0===t?void 0:t.length)&&void 0!==e?e:0)>1)return this.renderFindingGroupView(i)}return this.renderAgentDetailView()}catch(t){return console.warn("Error in renderCurrentView: ",t),R``}}}willUpdate(t){try{"agent-detail"===this.currentView&&this.selectedAgentId&&!this.userAdjustedAccordions&&(t.has("agentGroups")||t.has("currentPageUrl"))&&this.autoOpenCurrentPageAccordion(this.selectedAgentId)}catch(t){console.warn("Error in willUpdate: ",t)}}render(){try{return R`
6192
6192
  <div class="cws-panel">
6193
6193
  ${this.renderCurrentView()}
6194
- ${this.theme===Bh?R`<div class="cws-sr-only" role="status" aria-live="polite">${this.getRunStatusAnnouncement()}</div>`:F}
6194
+ ${this.theme===zh?R`<div class="cws-sr-only" role="status" aria-live="polite">${this.getRunStatusAnnouncement()}</div>`:F}
6195
6195
  </div>
6196
- `}catch(t){return console.warn("Error in render: ",t),R``}}};Du.styles=[Uh,Ru],Au([nt({type:Array})],Du.prototype,"agentGroups",void 0),Au([nt({type:String})],Du.prototype,"currentPageUrl",void 0),Au([nt({type:String,reflect:!0})],Du.prototype,"theme",void 0),Au([nt({type:Array})],Du.prototype,"agentRunStatuses",void 0),Au([nt({type:Boolean})],Du.prototype,"loading",void 0),Au([nt({type:Array})],Du.prototype,"unsyncedAnnotationIds",void 0),Au([rt()],Du.prototype,"expandedFindingIds",void 0),Au([rt()],Du.prototype,"openAccordions",void 0),Au([rt()],Du.prototype,"currentView",void 0),Au([rt()],Du.prototype,"selectedAgentId",void 0),Au([rt()],Du.prototype,"selectedFindingGroup",void 0),Du=Au([it("content-warning-sidebar")],Du);function Fu(){try{return"undefined"!=typeof localStorage&&"true"===localStorage.getItem("sfScreenShotDebug")}catch{return!1}}function Pu(t){return new Promise((e=>{let i=Math.max(1,t);const o=()=>{i-=1,i<=0?e():requestAnimationFrame(o)};requestAnimationFrame(o)}))}function ju(t,e,i=600){const o=t.requestVideoFrameCallback;return"function"!=typeof o?Pu(e+2):new Promise((n=>{let r=Math.max(1,e),s=!1;const a=()=>{s||(s=!0,clearTimeout(l),n())},l=setTimeout(a,Math.max(0,i)),c=()=>{s||(r-=1,r<=0?a():o.call(t,c))};o.call(t,c)}))}function Vu(t,e,i,o,n){const r=Math.max(0,Math.round(e)),s=Math.max(0,Math.round(i)),a=Math.max(1,Math.min(Math.round(o),t.width-r)),l=Math.max(1,Math.min(Math.round(n),t.height-s)),c=document.createElement("canvas");c.width=a,c.height=l;const d=c.getContext("2d");if(!d)throw new Error("canvas-crop-failed");return d.drawImage(t,r,s,a,l,0,0,a,l),c}function Uu(t,e){const i=Math.max(t.width,t.height);if(i<=e)return{canvas:t,ratio:1};const o=e/i,n=Math.max(1,Math.round(t.width*o)),r=Math.max(1,Math.round(t.height*o)),s=document.createElement("canvas");s.width=n,s.height=r;const a=s.getContext("2d");return a?(a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high",a.drawImage(t,0,0,n,r),{canvas:s,ratio:o}):{canvas:t,ratio:1}}function Bu(t,e,i){return new Promise((o=>{t.toBlob((t=>o(t)),e,i)}))}async function zu(t,e=.9){const i=await Bu(t,"image/webp",e);if(i&&"image/webp"===i.type)return{blob:i,type:i.type};const o=await Bu(t,"image/png");if(o)return{blob:o,type:"image/png"};throw new Error("canvas-encode-failed")}const Hu=["superflow-toolbar","snippyly-plugin","velt-shadow-dom-internal","snippyly-comment-pin-portal","snippyly-comment-pin","snippyly-area-pin-portal","velt-comment-pin-portal","velt-comment-pin","velt-area-pin-portal","snippyly-recorder-control-panel-internal","snippyly-live-state-sync-overlay",".comment-annotation-number","velt-comments","velt-comments-sidebar","velt-comments-sidebar-v2","velt-comment-tool","velt-cursor","velt-presence","velt-huddle","velt-arrows","velt-areas","velt-recorder-notes","velt-recorder-control-panel","velt-notifications-history-panel","velt-rewriter","velt-toast-popup","velt-root"],Gu=["snippyly-text-highlight","snippyly-comment-text-portal","snippyly-comment-text","velt-comment-text-portal","velt-comment-text"],Wu="sf-capture-hide-widgets",qu="data-sf-capture-keep";let Zu=null,Ku=null,Ju=[],Yu=new WeakSet,Qu=null;function Xu(...t){Fu()&&"undefined"!=typeof console&&console.log("[sf-capture][exclude]",...t)}const tp=new Set(Hu.map((t=>t.toLowerCase())));function ep(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function ip(t){const e=ep(t);return[`snippyly-comment-pin-portal[id="${e}"]`,`velt-comment-pin-portal[id="${e}"]`,`velt-comment-pin-portal[data-velt-id="${e}"]`,`snippyly-area-pin-portal[id="${e}"]`,`velt-area-pin-portal[id="${e}"]`,`velt-area-pin-portal[data-velt-id="${e}"]`,`snippyly-text-highlight[data-velt-id="${e}"]`,`velt-text-highlight[data-velt-id="${e}"]`].join(", ")}function op(t){if(!t)return!1;const e=ep(t);return!!document.querySelector(`snippyly-comment-pin-portal[id="${e}"] snippyly-comment-pin, velt-comment-pin-portal[id="${e}"] velt-comment-pin, velt-comment-pin-portal[data-velt-id="${e}"] velt-comment-pin`)||(!!document.querySelector(`snippyly-text-highlight[data-velt-id="${e}"], velt-text-highlight[data-velt-id="${e}"]`)||!!document.querySelector(`snippyly-area-pin-portal[id="${e}"], velt-area-pin-portal[id="${e}"], velt-area-pin-portal[data-velt-id="${e}"]`))}function np(t){const e=Array.from(document.querySelectorAll(ip(t)));for(const t of e){(i=t).setAttribute(qu,""),i.querySelectorAll("*").forEach((t=>t.setAttribute(qu,"")));let e=t.parentElement;for(;e;)e.setAttribute(qu,""),e=e.parentElement}var i;return e}function rp(t,e){if(!Fu()||!t||"undefined"==typeof document)return;const i=t=>{const e=t.getBoundingClientRect();return[Math.round(e.x),Math.round(e.y),Math.round(e.width),Math.round(e.height)]},o=document.getElementById(Wu),n=document.querySelector(ip(t));if(Xu(`[${e}] hideStyle=${!!o} keptHost=${!!n}`+(n?` keep=${n.hasAttribute(qu)} display=${getComputedStyle(n).display}`:"")),n){Xu(`[${e}] kept host subtree:`,Array.from(n.querySelectorAll("*")).map((t=>{const e=t.shadowRoot;return{tag:t.tagName.toLowerCase(),keep:t.hasAttribute(qu),display:getComputedStyle(t).display,vis:getComputedStyle(t).visibility,rect:i(t),painted:t.getClientRects().length>0,shadowKids:e?e.childElementCount:-1}})))}const r=Array.from(document.querySelectorAll("velt-shadow-dom-internal")).map((t=>({keep:t.hasAttribute(qu),display:getComputedStyle(t).display,rect:i(t)}))).filter((t=>"none"!==t.display));Xu(`[${e}] visible <velt-shadow-dom-internal>: ${r.length}`,r);const s=ep(t),a="snippyly-comment-pin, velt-comment-pin",l=document.querySelector(`snippyly-area-pin-portal[id="${s}"], velt-area-pin-portal[id="${s}"], velt-area-pin-portal[data-velt-id="${s}"]`);if(l){const o=e=>{const i=e.closest("snippyly-area-pin-portal, velt-area-pin-portal");if(i){const e=i.getAttribute("id")||i.getAttribute("data-velt-id")||"";return`area#${e.slice(0,6)}${e===t?"(FOCUSED)":""}`}const o=e.parentElement;return o?o.tagName.toLowerCase():"(detached)"},n=Array.from(document.querySelectorAll(".line")),r=Array.from(document.querySelectorAll(a));Xu(`[${e}] AREA focus: portal kept=${l.hasAttribute(qu)} display=${getComputedStyle(l).display} rect=${JSON.stringify(i(l))} innerLines=${l.querySelectorAll(".line").length} innerPins=${l.querySelectorAll(a).length}`),Xu(`[${e}] AREA .line owners (total ${n.length}):`,Array.from(new Set(n.map(o)))),Xu(`[${e}] AREA <comment-pin> owners (total ${r.length}):`,r.map((t=>({owner:o(t),keep:t.hasAttribute(qu),display:getComputedStyle(t).display,painted:t.getClientRects().length>0}))))}}function sp(){document.querySelectorAll('[style*="cursor"]').forEach((t=>{const e=t.style.getPropertyValue("cursor");if(!e)return;if(Yu.has(t))return void("none"!==e&&t.style.setProperty("cursor","none","important"));if("none"===e)return;const i=t.style.getPropertyPriority("cursor");Ju.push({el:t,value:e,priority:i,isPin:e.includes("url(")&&"important"===i}),Yu.add(t),t.style.setProperty("cursor","none","important")})),Xu(`neutralized inline cursor(s): tracked=${Ju.length}`)}function ap(t){lp();let e=!1;if(t){const o=np(t);e=o.length>0,function(t,e){if(Fu()){Xu("keepAnnotationId =",JSON.stringify(t));for(const t of["snippyly-comment-pin-portal","velt-comment-pin-portal","snippyly-area-pin-portal","velt-area-pin-portal","snippyly-comment-text-portal","velt-comment-text-portal","snippyly-text-highlight","velt-text-highlight","velt-comment-text"]){const e=Array.from(document.querySelectorAll(t));Xu(`candidates <${t}>: ${e.length}`,e.map((t=>({id:t.getAttribute("id"),"data-velt-id":t.getAttribute("data-velt-id")}))))}Xu(`matched kept host(s): ${e.length}`),e.forEach(((t,e)=>{const i=[t.tagName.toLowerCase()];let o=t.parentElement;for(;o;){const t=o.tagName.toLowerCase();i.push(tp.has(t)?`${t}(EXCLUDED-ANCESTOR)`:t),o=o.parentElement}Xu(` match[${e}] chain (self -> root):`,i.join(" > "))})),0===e.length&&Xu("No host matched the annotationId — the marker will be hidden. Compare the annotationId above against the candidate id / data-velt-id values.")}}(t,o),e&&(i=t)&&"undefined"!=typeof MutationObserver&&(Ku=i,Zu=new MutationObserver((()=>{Ku&&np(Ku)})),Zu.observe(document.documentElement,{childList:!0,subtree:!0}))}var i;const o=t=>e?`${t}:not([${qu}])`:t,n=`${Hu.map(o).join(",\n")} { display: none !important; }`,r=`${Gu.map(o).join(",\n")} { display: contents !important; color: inherit !important; -webkit-text-fill-color: inherit !important; background-color: transparent !important; border-bottom-color: transparent !important; text-decoration: none !important; box-shadow: none !important; }`,s=document.createElement("style");s.id=Wu,s.textContent=`${n}\n${r}\n* { cursor: none !important; }`,document.head.appendChild(s),sp(),"undefined"!=typeof MutationObserver&&(Qu=new MutationObserver((()=>sp())),Qu.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:["style"]})),Xu(`injected hide stylesheet (keptAny=${e}, hide=${Hu.length}, neutralize=${Gu.length})`)}function lp(){var t;null===(t=document.getElementById(Wu))||void 0===t||t.remove(),Qu&&(Qu.disconnect(),Qu=null),Ju.forEach((({el:t,value:e,priority:i,isPin:o})=>{o?t.style.removeProperty("cursor"):t.style.setProperty("cursor",e,i)})),Ju=[],Yu=new WeakSet,Zu&&(Zu.disconnect(),Zu=null),Ku=null,document.querySelectorAll(`[${qu}]`).forEach((t=>t.removeAttribute(qu)))}function cp(){var t;const e=null===(t=navigator.userAgentData)||void 0===t?void 0:t.brands;if(e&&e.length)return e.some((t=>/Chromium|Google Chrome|Microsoft Edge/i.test(t.brand)));const i=navigator.userAgent;return/Chrome|Chromium|Edg\//.test(i)&&!/Firefox|FxiOS/.test(i)}function dp(){return!("undefined"==typeof navigator||!navigator.mediaDevices||"function"!=typeof navigator.mediaDevices.getDisplayMedia)&&(cp()||function(){const t=navigator.userAgent;return/Safari/.test(t)&&/Apple/.test(navigator.vendor||"")&&!/Chrome|Chromium|CriOS|Edg\/|FxiOS|Android/.test(t)}())}class hp{constructor(){this.name="native",this.stream=null,this.video=null,this.surface=void 0,this.cropEl=null,this.lastDebug=null,this.initPromise=null,this.onEnded=null}isSupported(){return"undefined"!=typeof navigator&&!!navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia}getCapability(){return cp()?"tab-region":"screen-crop"}isActive(){return!!this.stream&&!!this.video}getSurface(){return this.surface}getDebugInfo(){return this.lastDebug}async init(){if(!this.isSupported())throw new Error("native-not-supported");if(!this.isActive())return this.initPromise||(this.initPromise=this.runInit().finally((()=>{this.initPromise=null}))),this.initPromise}async runInit(){var t;const e=this.getCapability(),i="tab-region"===e?{video:{displaySurface:"browser"},preferCurrentTab:!0,selfBrowserSurface:"include",audio:!1}:{video:!0,audio:!1};let o;try{o=await navigator.mediaDevices.getDisplayMedia(i)}catch(t){throw t&&"object"==typeof t&&(t.sfNativeExpected=!0),t}let n=null;try{const i=o.getVideoTracks()[0];if(!i)throw new Error("native-no-video-track");if(this.surface=i.getSettings().displaySurface,"tab-region"===e){if("browser"!==this.surface){const e=null!==(t=this.surface)&&void 0!==t?t:"screen";throw new Error(`Shared a ${e}; re-init and pick "This tab".`)}await this.applyViewportCrop(i)}if(i.addEventListener("ended",(()=>this.handleEnded())),n=document.createElement("video"),n.srcObject=o,n.muted=!0,n.setAttribute("playsinline",""),n.style.cssText="position:fixed;left:-99999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;",document.body.appendChild(n),await n.play(),"ended"===i.readyState)throw new Error("native-share-ended-during-init");this.stream=o,this.video=n}catch(t){throw o.getTracks().forEach((t=>t.stop())),n&&(n.srcObject=null,n.remove()),this.removeCropEl(),this.surface=void 0,t}}async capture(t={}){if(!this.stream||!this.video)throw new Error("capture-not-initialized");const e=t.focusAnnotationId;Fu()&&"undefined"!=typeof console&&console.log("[sf-capture][native] capture(): focusAnnotationId =",JSON.stringify(e));const i=performance.now(),o=this.video;return"tab-region"===this.getCapability()?this.captureTabRegion(o,i,e):this.captureScreenCrop(o,i,e)}async captureTabRegion(t,e,i){if("browser"!==this.surface)throw new Error("not-sharing-this-tab");const{canvas:o,page:n,frameW:r,frameH:s}=await this.grabFullFrame(t,i);let a=o;const l=n.viewportW*n.dpr;if(l>0&&r>1.5*l)throw new Error("frame-larger-than-viewport");const c=r/n.viewportW,d=Math.min(r,Math.round(n.viewportW*c)),h=Math.round(n.viewportH*c),u=a.height>h+2||a.width>d+2;u&&(a=Vu(a,0,0,d,h)),this.lastDebug={capability:"tab-region",surface:this.surface,cropApplied:!!this.cropEl,frameW:r,frameH:s,viewportW:n.viewportW,viewportH:n.viewportH,dpr:n.dpr,cssToFrame:c,croppedW:a.width,croppedH:a.height,clampedHeight:u},this.logDebug();const p=Uu(a,2560);a=p.canvas;const{blob:v,type:g}=await zu(a,.9),f=performance.now()-e;return{blob:v,width:a.width,height:a.height,mode:this.name,durationMs:f,page:n,scope:"viewport",blobType:g,markerMapping:{scaleX:c*p.ratio,scaleY:c*p.ratio,originXCss:n.scrollX,originYCss:n.scrollY}}}async captureScreenCrop(t,e,i){const{canvas:o,page:n,frameW:r,frameH:s}=await this.grabFullFrame(t,i),a=this.computeScreenCrop(r,s);let l=Vu(o,a.cropX,a.cropY,a.cropW,a.cropH);const c=a.scale;this.lastDebug={capability:"screen-crop",surface:this.surface,cropApplied:!1,frameW:r,frameH:s,viewportW:n.viewportW,viewportH:n.viewportH,dpr:n.dpr,cssToFrame:c,croppedW:l.width,croppedH:l.height,clampedHeight:!0,screenCrop:a},this.logDebug();const d=Uu(l,2560);l=d.canvas;const{blob:h,type:u}=await zu(l,.9),p=performance.now()-e;return{blob:h,width:l.width,height:l.height,mode:this.name,durationMs:p,page:n,scope:"viewport",blobType:u,markerMapping:{scaleX:c*d.ratio,scaleY:c*d.ratio,originXCss:n.scrollX,originYCss:n.scrollY}}}computeScreenCrop(t,e){const i=window.innerWidth,o=window.innerHeight,n=Math.max(0,window.outerHeight-window.innerHeight),r="window"===this.surface,s=r?window.outerWidth:window.screen.width,a=r?window.screenX:0,l=r?window.screenY:0,c=s>0?t/s:1,d=window.screenX-a,h=window.screenY+n-l;let u=Math.round(d*c),p=Math.round(h*c),v=Math.round(i*c),g=Math.round(o*c);return u=Math.max(0,Math.min(u,t-1)),p=Math.max(0,Math.min(p,e-1)),v=Math.max(1,Math.min(v,t-u)),g=Math.max(1,Math.min(g,e-p)),{cropX:u,cropY:p,cropW:v,cropH:g,scale:c,chromeTopCss:n,surfaceWidthCss:s}}async grabFullFrame(t,e){e&&await function(t,e=1200){return!t||op(t)?Promise.resolve(!!t&&op(t)):new Promise((i=>{let o=!1;const n=e=>{o||(o=!0,clearTimeout(s),r.disconnect(),Xu(`waitForAnnotationHost(${JSON.stringify(t)}) -> ${e?"found":"timeout"}`),i(e))},r=new MutationObserver((()=>{op(t)&&n(!0)}));r.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["id","data-velt-id"]});const s=setTimeout((()=>n(!1)),Math.max(0,e))}))}(e),ap(e),rp(e,"post-hide");try{await Pu(2),await ju(t,3),await ju(t,1);const i=function(){const t=document.documentElement;return{scrollX:window.scrollX,scrollY:window.scrollY,viewportW:t.clientWidth,viewportH:t.clientHeight,dpr:window.devicePixelRatio||1}}(),o=t.videoWidth,n=t.videoHeight;if(!o||!n)throw new Error("capture-no-frame");const r=document.createElement("canvas");r.width=o,r.height=n;const s=r.getContext("2d");if(!s)throw new Error("canvas-2d-unavailable");return rp(e,"pre-draw"),s.drawImage(t,0,0),{canvas:r,page:i,frameW:o,frameH:n}}finally{lp()}}logDebug(){Fu()&&"undefined"!=typeof console&&console.info("[sf-capture][native]",this.lastDebug)}dispose(){this.stream&&this.stream.getTracks().forEach((t=>t.stop())),this.video&&(this.video.srcObject=null,this.video.remove()),this.removeCropEl(),this.stream=null,this.video=null,this.surface=void 0}handleEnded(){var t;this.removeCropEl(),this.stream=null,this.video&&(this.video.srcObject=null,this.video.remove()),this.video=null,this.surface=void 0,null===(t=this.onEnded)||void 0===t||t.call(this)}async applyViewportCrop(t){const e=window.CropTarget,i=t;if(e&&"function"==typeof i.cropTo)try{const t=document.createElement("div");t.setAttribute("data-sf-capture-viewport",""),t.style.cssText="position:fixed;inset:0;pointer-events:none;opacity:0;z-index:-1;margin:0;",document.body.appendChild(t),this.cropEl=t;const o=await e.fromElement(t);await i.cropTo(o)}catch{this.removeCropEl()}}removeCropEl(){var t;null===(t=this.cropEl)||void 0===t||t.remove(),this.cropEl=null}}const up=t=>null===t||"object"!=typeof t||Array.isArray(t)?null:t,pp=t=>"string"==typeof t?t.trim():"",vp=t=>{try{const e=up(t),i=up(null==e?void 0:e.agent);if(i)return i;const o=null==e?void 0:e.comments,n=Array.isArray(o)?up(o[0]):null;return up(null==n?void 0:n.agent)}catch{return null}},gp=Object.freeze(["superflow agent"]),fp=t=>{const e=pp(t);return e&&!gp.includes(e.toLowerCase())?e:""},mp=t=>{var e;try{return fp(null===(e=vp(t))||void 0===e?void 0:e.displayName).slice(0,80)}catch{return""}},wp=t=>{var e;const i=null===(e=up(t))||void 0===e?void 0:e.createdAt;return"number"==typeof i&&Number.isFinite(i)?i:0},yp=(t,e)=>{try{return fp(t)||(t=>{let e="",i=-1/0;for(const o of Array.isArray(t)?t:[]){const t=mp(o);if(!t)continue;const n=wp(o);(!e||n>i)&&(e=t,i=n)}return e})(e)}catch{return""}},bp=t=>vp(t)?"square":"round",Cp="agent",xp=Object.freeze({link:{viewBox:"0 0 18 18",strokeWidth:1.5,paths:["M6.75 11.25L11.25 6.75M8.25 4.50005L8.59725 4.09805C9.3006 3.39479 10.2545 2.99975 11.2491 2.99982C12.2438 2.99989 13.1976 3.39507 13.9009 4.09842C14.6041 4.80178 14.9992 5.75569 14.9991 6.75031C14.999 7.74493 14.6039 8.69879 13.9005 9.40205L13.5 9.75005M9.75011 13.5L9.45236 13.9005C8.74079 14.6041 7.78045 14.9988 6.77973 14.9988C5.77902 14.9988 4.81867 14.6041 4.10711 13.9005C3.75637 13.5537 3.47793 13.1408 3.28789 12.6856C3.09785 12.2304 3 11.7421 3 11.2489C3 10.7556 3.09785 10.2673 3.28789 9.81214C3.47793 9.35698 3.75637 8.94405 4.10711 8.59725L4.50011 8.25"]},spell:{viewBox:"0 0 18 18",strokeWidth:1.5,paths:["M10.5 4.5L15.75 9.75L12.75 12.75M3 14.9999L4.326 13.674M4.37072 13.6291C4.56768 13.8261 4.80153 13.9824 5.0589 14.089C5.31627 14.1956 5.59213 14.2505 5.87072 14.2505C6.14931 14.2505 6.42517 14.1956 6.68254 14.089C6.93991 13.9824 7.17376 13.8261 7.37072 13.6291L15.3102 5.68955C15.4496 5.55026 15.5601 5.38487 15.6355 5.20285C15.711 5.02082 15.7498 4.82571 15.7498 4.62868C15.7498 4.43165 15.711 4.23654 15.6355 4.05451C15.5601 3.87249 15.4496 3.7071 15.3102 3.5678L14.432 2.68955C14.2927 2.5502 14.1273 2.43966 13.9453 2.36424C13.7632 2.28882 13.5681 2.25 13.3711 2.25C13.1741 2.25 12.979 2.28882 12.7969 2.36424C12.6149 2.43966 12.4495 2.5502 12.3102 2.68955L4.37072 10.6291C4.1737 10.826 4.01741 11.0599 3.91078 11.3172C3.80415 11.5746 3.74927 11.8505 3.74927 12.1291C3.74927 12.4076 3.80415 12.6835 3.91078 12.9409C4.01741 13.1982 4.1737 13.4321 4.37072 13.6291Z"]},mobile:{viewBox:"0 0 18 18",strokeWidth:1.5,paths:["M8.25 3H9.75M9 12.75V12.7575M4.5 3.75C4.5 3.35218 4.65804 2.97064 4.93934 2.68934C5.22064 2.40804 5.60218 2.25 6 2.25H12C12.3978 2.25 12.7794 2.40804 13.0607 2.68934C13.342 2.97064 13.5 3.35218 13.5 3.75V14.25C13.5 14.6478 13.342 15.0294 13.0607 15.3107C12.7794 15.592 12.3978 15.75 12 15.75H6C5.60218 15.75 5.22064 15.592 4.93934 15.3107C4.65804 15.0294 4.5 14.6478 4.5 14.25V3.75Z"]},image:{viewBox:"0 0 24 24",strokeWidth:2,paths:["M15 8H15.01M3 15.9998L8 10.9998C8.928 10.1068 10.072 10.1068 11 10.9998L16 15.9998M14 13.9998L15 12.9998C15.928 12.1068 17.072 12.1068 18 12.9998L21 15.9998M3 6C3 5.20435 3.31607 4.44129 3.87868 3.87868C4.44129 3.31607 5.20435 3 6 3H18C18.7956 3 19.5587 3.31607 20.1213 3.87868C20.6839 4.44129 21 5.20435 21 6V18C21 18.7956 20.6839 19.5587 20.1213 20.1213C19.5587 20.6839 18.7956 21 18 21H6C5.20435 21 4.44129 20.6839 3.87868 20.1213C3.31607 19.5587 3 18.7956 3 18V6Z"]},consistency:{viewBox:"0 0 20 20",strokeWidth:1.66667,paths:["M12.5 3.33333H13.3333C13.5544 3.33333 13.7663 3.42113 13.9226 3.57741C14.0789 3.73369 14.1667 3.94565 14.1667 4.16667V7.08333M16.6667 5C16.8867 5.09333 17.1 5.18083 17.3067 5.2625C17.5101 5.34882 17.6709 5.51241 17.7537 5.71729C17.8366 5.92217 17.8346 6.15155 17.7483 6.355L15.8333 10.8333M3.00335 5.99751L8.95168 3.40668C9.04984 3.36461 9.15542 3.34261 9.26221 3.34199C9.369 3.34137 9.47483 3.36214 9.57346 3.40307C9.6721 3.444 9.76154 3.50426 9.83652 3.58031C9.91149 3.65635 9.97049 3.74664 10.01 3.84584L14.1134 13.7642C14.1986 13.9653 14.2015 14.1919 14.1214 14.3951C14.0413 14.5984 13.8846 14.762 13.685 14.8508L7.73752 17.4417C7.63932 17.4839 7.53366 17.506 7.42678 17.5067C7.3199 17.5073 7.21396 17.4866 7.11523 17.4457C7.0165 17.4047 6.92697 17.3444 6.85193 17.2683C6.7769 17.1922 6.71787 17.1018 6.67835 17.0025L2.57502 7.08334C2.48973 6.88222 2.48683 6.65565 2.56694 6.45241C2.64705 6.24917 2.80377 6.08634 3.00335 5.99751Z"]},"ai-visibility":{viewBox:"0 0 24 24",strokeWidth:2,paths:["M16 18C16.5304 18 17.0391 18.2107 17.4142 18.5858C17.7893 18.9609 18 19.4696 18 20C18 19.4696 18.2107 18.9609 18.5858 18.5858C18.9609 18.2107 19.4696 18 20 18C19.4696 18 18.9609 17.7893 18.5858 17.4142C18.2107 17.0391 18 16.5304 18 16C18 16.5304 17.7893 17.0391 17.4142 17.4142C17.0391 17.7893 16.5304 18 16 18ZM16 6C16.5304 6 17.0391 6.21071 17.4142 6.58579C17.7893 6.96086 18 7.46957 18 8C18 7.46957 18.2107 6.96086 18.5858 6.58579C18.9609 6.21071 19.4696 6 20 6C19.4696 6 18.9609 5.78929 18.5858 5.41421C18.2107 5.03914 18 4.53043 18 4C18 4.53043 17.7893 5.03914 17.4142 5.41421C17.0391 5.78929 16.5304 6 16 6ZM9 18C9 16.4087 9.63214 14.8826 10.7574 13.7574C11.8826 12.6321 13.4087 12 15 12C13.4087 12 11.8826 11.3679 10.7574 10.2426C9.63214 9.11742 9 7.5913 9 6C9 7.5913 8.36786 9.11742 7.24264 10.2426C6.11742 11.3679 4.5913 12 3 12C4.5913 12 6.11742 12.6321 7.24264 13.7574C8.36786 14.8826 9 16.4087 9 18Z"]},accessibility:{viewBox:"0 0 24 24",strokeWidth:2,paths:["M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0","M10 16.5l2 -3l2 3m-2 -3v-2l3 -1m-6 0l3 1","M12 7.5m-.5 0a.5 .5 0 1 0 1 0a.5 .5 0 1 0 -1 0"]},workspace:{viewBox:"0 0 18 18",strokeWidth:1.5,paths:["M2 1H6C6.26522 1 6.51957 1.10536 6.70711 1.29289C6.89464 1.48043 7 1.73478 7 2V8C7 8.26522 6.89464 8.51957 6.70711 8.70711C6.51957 8.89464 6.26522 9 6 9H2C1.73478 9 1.48043 8.89464 1.29289 8.70711C1.10536 8.51957 1 8.26522 1 8V2C1 1.73478 1.10536 1.48043 1.29289 1.29289C1.48043 1.10536 1.73478 1 2 1Z","M2 13H6C6.26522 13 6.51957 13.1054 6.70711 13.2929C6.89464 13.4804 7 13.7348 7 14V16C7 16.2652 6.89464 16.5196 6.70711 16.7071C6.51957 16.8946 6.26522 17 6 17H2C1.73478 17 1.48043 16.8946 1.29289 16.7071C1.10536 16.5196 1 16.2652 1 16V14C1 13.7348 1.10536 13.4804 1.29289 13.2929C1.48043 13.1054 1.73478 13 2 13Z","M12 9H16C16.2652 9 16.5196 9.10536 16.7071 9.29289C16.8946 9.48043 17 9.73478 17 10V16C17 16.2652 16.8946 16.5196 16.7071 16.7071C16.5196 16.8946 16.2652 17 16 17H12C11.7348 17 11.4804 16.8946 11.2929 16.7071C11.1054 16.5196 11 16.2652 11 16V10C11 9.73478 11.1054 9.48043 11.2929 9.29289C11.4804 9.10536 11.7348 9 12 9Z","M12 1H16C16.2652 1 16.5196 1.10536 16.7071 1.29289C16.8946 1.48043 17 1.73478 17 2V4C17 4.26522 16.8946 4.51957 16.7071 4.70711C16.5196 4.89464 16.2652 5 16 5H12C11.7348 5 11.4804 4.89464 11.2929 4.70711C11.1054 4.51957 11 4.26522 11 4V2C11 1.73478 11.1054 1.48043 11.2929 1.29289C11.4804 1.10536 11.7348 1 12 1Z"]},security:{viewBox:"0 0 24 24",strokeWidth:2,paths:["M12 3a12 12 0 0 0 8.5 3a12 12 0 0 1 -8.5 15a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3","M9 12l2 2l4 -4"]},uptime:{viewBox:"0 0 24 24",strokeWidth:2,paths:["M3 12h4l3 8l4 -16l3 8h4"]},forms:{viewBox:"0 0 24 24",strokeWidth:2,paths:["M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2","M9 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2","M9 12h.01M13 12h2M9 16h.01M13 16h2"]},lighthouse:{viewBox:"0 0 24 24",strokeWidth:2,paths:["M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0","M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M13.41 10.59l2.59 -2.59","M7 12a5 5 0 0 1 5 -5"]},lorem:{viewBox:"0 0 24 24",strokeWidth:2,paths:["M4 6h16M4 12h10M4 18h14"]},[Cp]:{viewBox:"0 0 16 16",strokeWidth:1.33333,paths:["M6.33317 7.33333H6.33984M9.6665 7.33333H9.67317M6.33317 10C6.55042 10.2217 6.80974 10.3979 7.09592 10.5181C7.38211 10.6384 7.68941 10.7003 7.99984 10.7003C8.31026 10.7003 8.61757 10.6384 8.90375 10.5181C9.18994 10.3979 9.44925 10.2217 9.6665 10M4.6665 3.33333H5.33317V2H10.6665V3.33333H11.3332C11.8636 3.33333 12.3723 3.54405 12.7474 3.91912C13.1225 4.29419 13.3332 4.8029 13.3332 5.33333V11.3333C13.3332 11.8638 13.1225 12.3725 12.7474 12.7475C12.3723 13.1226 11.8636 13.3333 11.3332 13.3333V14H4.6665V13.3333C4.13607 13.3333 3.62736 13.1226 3.25229 12.7475C2.87722 12.3725 2.6665 11.8638 2.6665 11.3333V5.33333C2.6665 4.8029 2.87722 4.29419 3.25229 3.91912C3.62736 3.54405 4.13607 3.33333 4.6665 3.33333Z"]}});Object.freeze(Object.keys(xp));const Ep=t=>{var e;try{const i=pp(null===(e=vp(t))||void 0===e?void 0:e.icon).toLowerCase();return i&&Object.prototype.hasOwnProperty.call(xp,i)?i:Cp}catch{return Cp}},kp=t=>`url("data:image/svg+xml,${encodeURIComponent((t=>{const e=Object.prototype.hasOwnProperty.call(xp,t)?xp[t]:xp[Cp],i=e.paths.map((t=>`<path d="${t}"/>`)).join("");return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${e.viewBox}" fill="none" stroke="#FFFFFF" stroke-width="${e.strokeWidth}" stroke-linecap="round" stroke-linejoin="round">${i}</svg>`})(t))}")`,Sp="data-sf-agent-pin",Mp="comment-pin-container-",Ap=`[id^="${Mp}"]`,Tp=Object.freeze(["snippyly-comment-pin-portal","velt-comment-pin-portal","snippyly-area-pin-portal","velt-area-pin-portal"]),Ip=Object.freeze({marker:".velt-comment-pin--marker",avatar:"snippyly-user-avatar",agentIcon:".velt-comment-pin--agent-icon"}),_p=Object.freeze(Object.values(Ip)),$p=Ip.marker,Np=t=>"undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(t):t.replace(/[^a-zA-Z0-9_-]/g,(t=>`\\${t}`)),Op=(t,e=[""])=>{const i=e.length>0?e:[""],o=t=>i.map((e=>e?`${e} ${t}`:t)).join(",\n"),n=$p;return[`${o(n)} { border-radius: 6px !important; background: var(--velt-agent-accent, #4495FF) !important; }`,`${o(`${n} ${Ip.avatar}`)},\n${o(`${n} ${Ip.agentIcon}`)},\n${o(`${n} > svg`)} { display: none !important; }`,`${o(`${n}::before`)} { content: ''; display: block; flex: none; width: 20px; height: 20px; background: ${kp(t)} center / contain no-repeat; }`].join("\n")},Lp=(t,e=3,i=8)=>{const o=[],n=(t,r)=>{if(r>e)return;const s=t instanceof Element?[t]:[];t.querySelectorAll("*").forEach((t=>s.push(t)));for(const t of s){if(o.length>=i)return;const e=t.shadowRoot;e&&!o.includes(e)&&(o.push(e),n(e,r+1))}};try{t&&n(t,1)}catch{}return o},Rp=(t,e)=>{try{let i=t.querySelector(`style[${Sp}]`);if(!e)return void(null==i||i.remove());i||(i=document.createElement("style"),i.setAttribute(Sp,"true"),t.appendChild(i)),i.textContent!==e&&(i.textContent=e)}catch{}},Dp=(t,e=document)=>{try{return t?Array.from(e.querySelectorAll(`#${Np(`${Mp}${t}`)}`)):[]}catch{return[]}},Fp=t=>{const e=t;return e&&1===e.nodeType&&"string"==typeof e.id&&e.id.startsWith(Mp)?e.id.slice(22):""},Pp=Object.freeze(["style","link","script","template"]),jp=(t,e)=>{const i=e>1?`:scope ${"> * ".repeat(e-1)}*`:"*";for(const e of Array.from(t.querySelectorAll(i)))if(!Pp.includes(e.localName))return!0;return!1},Vp=(t,e=Lp(t))=>{try{if((t=>{try{return null!==t.querySelector($p)}catch{return!1}})(t))return"light";if(e.some((t=>null!==t.querySelector(Ip.marker))))return"shadow";return(e.length>0?e.some((t=>jp(t,1))):jp(t,2))?"unrecognised":"pending"}catch{return"pending"}},Up=t=>{for(const e of Lp(t))Rp(e,"")};var Bp=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class zp extends tt{constructor(){super(),this._loadPlugin=!1,this.comments=[],this.addCommentMode=!1,this.showTourCommentTooltip=!1,this.firstCommentNudge=!1,this.allFeatureDisabled=!1,this.planLimitLocked=!1,this.projectDeleted=!1,this.resolvedVeltFeatureGates=[],this.allFeatureRestricted=!1,this.guestMode=!1,this._expanded=!0,this.loading=!0,this._isPlanExpired=null,this.showOnboardingModal=!0,this.embedMode=!1,this.readOnlyMode=!1,this.autoCommentModeRequested=!1,this.autoCommentModeArmedOnce=!1,this.agentCommentsModeRequested=!1,this.previewLocationPath="",this.onboardingMode=!1,this.clientMode=!1,this.clientModeBlocked=!1,this.clientSession=null,this.clientGrant=null,this.clientUser=null,this.clientSessionApi=null,this.clientSessionResolution=null,this.notifiedClientRequests=new Set,this.clientNotifyRetryTimer=(t,e)=>{window.setTimeout(t,e)},this.maintenanceRequests=!1,this.maintenanceRequestsLabel="",this.requestModeApplied=!1,this.requestContextProviderSet=!1,this.requestModeLoadedTracked=!1,this.lastCommentStatuses=null,this.notifyAddedRequest=function(t){const e=new Set,i=(e,o)=>{try{if(!t.isActive())return;t.send(e).then((n=>{var r;"ok"!==n.kind?"error"!==n.kind||"not-found"!==n.code||"first"!==o?"error"===n.kind?t.warn(`${qd} refused (${n.code})`):t.warn(`${qd} could not reach the backend`):t.retryTimer((()=>i(e,"retry")),t.retryDelayMs):n.notified||t.warn(`${qd}: not sent (${null!==(r=n.reason)&&void 0!==r?r:"unknown"})`)})).catch((()=>{t.warn(`${qd} could not reach the backend`)}))}catch(t){console.warn("Error in request notifier attempt: ",t)}};return o=>{try{if(!o||e.has(o)||!t.isActive())return;e.add(o),i(o,"first")}catch(t){console.warn("Error in request notifier: ",t)}}}({send:t=>{var e,i,o;return Sh({apiKey:this.apiKey,documentId:this.projectId||"",annotationId:t,user:{userId:null===(e=this.snippylyUser)||void 0===e?void 0:e.userId,name:null===(i=this.snippylyUser)||void 0===i?void 0:i.name,email:null===(o=this.snippylyUser)||void 0===o?void 0:o.email}})},isActive:()=>this.isRequestMode()&&!!this.apiKey&&!!this.projectId,retryTimer:(t,e)=>this.clientNotifyRetryTimer(t,e),retryDelayMs:zp.CLIENT_NOTIFY_RETRY_MS,warn:t=>console.warn(t)}),this.showLiveDemoModal=!1,this.showFigmaDemoModal=!1,this.showGuestModeSignInModal=!1,this.defaultGuestModeSignInModalConfig={title:"Sign in to notify your team",description:"Notify your team about your latest comments.",closeOnClickOutside:!1,showLeaveCommentButton:!0},this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig)),this.showGuestModeNameModal=!1,this.guestModeSignInBannerVisible=!1,this.guestUserNameInput="",this.guestUserModelOpened=!1,this.guestUserNameUpdated=!1,this.guestUserNameUpdateLoading=!1,this.projectIdSupplied=!1,this.staging=Ze,this._autoLocation=!0,this.copyLinkTooltip="Copy Link",this.approving=!1,this.approvalNotice=null,this.projectApproval=null,this.invalidApiKey=!1,this._isUserGlobalContact=!1,this.showQrCode=!1,this.qrCodeLoading=!1,this.qrCodeError=!1,this.customLoginEnabledLocally=null,this.customLoginEnabled=null,this.exitReviewModeCalled=!1,this.addCommentCount=0,this._privateCommentModeEnabled=!1,this.superflowToolbarMoved=!1,this._darkMode=!1,this.allowGuestModeSignIn=!0,this._queryParamsComments=!1,this._usePageTitleAsLocationName=!1,this.toolbarEnabled=!1,this.toolbarEnabledApiCalled=!1,this.passwordProtected=!1,this.isPasswordValid=!1,this.password="",this.validatingPasswordLoading=!1,this.showPasswordProtectedModal=!1,this.showInvalidPassword=!1,this.skipGuestNameModal=!1,this._totalViews={},this.totalViewsCount=0,this.inviteUrl="",this.showModalOnceCommentIsModeIsOff=!1,this.showInviteModal=!1,this.showBugReportModal=!1,this.featureAccess=null,this.hasAgentAccess=!1,this.hasPrivateCommentsAccess=!1,this.isPrivateCommentsEnabledOnWorkspace=!1,this.visibilityOptionsEnabled=!1,this.hasContentWarnings=!1,this.contentWarningsCount=0,this.showContentWarningSidebar=!1,this.showAgentCommentsInSidebar=!1,this.pageCommentsHidden=!1,this.veltProxyToggleVisible=!1,this.nativeScreenshotEnabled=!1,this.nativeScreenshotDenied=!1,this.capturingScreenshot=!1,this.nativeCapture=new hp,this.screenshotChain=Promise.resolve(),this.pendingScreenshotCount=0,this.nativeScreenshotEnabling=!1,this.addCommentAnnotationSubscribedEl=void 0,this.isSettingSidebarData=!1,this.agentGroups=[],this.agentNameMap=new Map,this.agentNamesFetched=!1,this.agentRunStatuses=[],this.agentRunStatusTimedOut=!1,this.agentRunStatusLastMessageAt=0,this.agentRunStatusSettled=!1,this.agentRunStatusListening=!1,this.agentRunStatusWatchdogTimer=null,this.lastStreamAnnotations=[],this.streamEmissionCount=0,this.lastStreamEmissionAt=0,this.onboardingLastFetchCount=-1,this.onboardingLastFetchError="",this.onboardingFetchedAnnotations=[],this.onboardingFetchedAt=0,this.onboardingFindingsFetchTimer=null,this.onboardingFindingsFetchAttempts=0,this.onboardingFetchAttemptsByAgent=new Map,this.onboardingFindingsFetchInFlight=!1,this.onboardingOpenedAgentIds=new Set,this.onboardingFetchResolvedAgentIds=new Set,this.onboardingRemovedAnnotationIds=new Set,this.onboardingUnsyncedAnnotationIds=[],this.onboardingViewportListening=!1,this.onboardingPanelResizeObserver=null,this.onboardingObservedPanel=null,this.onboardingClampFrame=null,this.locationChangeListenerAttached=!1,this.portalOrigins=null,this.spellingSuggestionPagePathMap=new Map,this.grammarSuggestionPagePathMap=new Map,this.processingAnnotationIds=new Set,this.agentPinTargets=new Map,this.agentPinLightDomIds=new Set,this.agentPinPageCss="",this.agentPinDecoratedContainers=new WeakSet,this.agentPinPendingContainers=new Set,this.agentPinDomObserver=null,this.agentPinFrameCancel=null,this.agentPinUnrecognisedContainers=new Set,this.agentPinMarkupRecheckTimer=null,this.agentPinMarkupReported=!1,this.subscriptions=[],this.bootstrapStubToReplay=null,this.onApiKeyChange=()=>{try{this.apiKey&&(null===window||void 0===window?void 0:window.onSuperflowLoad)&&"function"==typeof window.onSuperflowLoad&&window.onSuperflowLoad()}catch(t){console.warn("Error in onApiKeyChange: ",t),oh("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await gh(this.apiKey);this.customLoginEnabled=!!(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),oh("Error in checkCustomLoginEnabled: ",t)}},this.isRunningUnderPreviewProxy=(t=document.location)=>{try{const e=(null==t?void 0:t.hostname)||"",i=(null==t?void 0:t.pathname)||"";return!!Fd(t)||zt.some((({hostSuffix:t,pathPrefix:o})=>(e===t||e.endsWith(`.${t}`))&&i.startsWith(o)))}catch(t){return console.warn("Error in isRunningUnderPreviewProxy: ",t),!1}},this.isRunningUnderLivePreview=(t=document.location)=>{try{return Fd(t)}catch(t){return console.warn("Error in isRunningUnderLivePreview: ",t),!1}},this.getEffectiveCurrentPageUrl=()=>{try{return this.isRunningUnderPreviewProxy()&&this.previewLocationPath?this.previewLocationPath:window.location.href}catch(t){return console.warn("Error in getEffectiveCurrentPageUrl: ",t),window.location.href}},this.identityCameFromToken=!1,this.identityLiveSignIn=null,this.isLiveShareGuest=()=>{var t,e,i;try{const o=null===(t=this.identityLiveSignIn)||void 0===t?void 0:t.user;return!!(null===(e=this.snippylyUser)||void 0===e?void 0:e.isGuest)&&!!(null==o?void 0:o.isGuest)&&o.userId===(null===(i=this.snippylyUser)||void 0===i?void 0:i.userId)}catch(t){return console.warn("Error in isLiveShareGuest: ",t),!1}},this.liveSignInExpiryHandled=!1,this.fallBackToGuestIfLiveSignInExpired=(t,e=Date.now())=>{var i;try{return!(!t||(null===(i=t.user)||void 0===i?void 0:i.isGuest)||t.expiresAt>e)&&(this.liveSignInExpiryHandled||(this.liveSignInExpiryHandled=!0,console.warn("[CWS Toolbar] The live preview sign-in has expired. Continuing as a guest."),this.signInError=!1,setTimeout((()=>this.identifySnippyly()),0)),!0)}catch(t){return console.warn("Error in fallBackToGuestIfLiveSignInExpired: ",t),!1}},this.readLiveSignIn=()=>{try{return this.isRunningUnderLivePreview()?jd():null}catch(t){return console.warn("Error in readLiveSignIn: ",t),null}},this.credentialFor=(t,e)=>{try{return(({cameFromToken:t,user:e,loc:i=window.location,onLivePreview:o,liveSignIn:n})=>{try{if(null!=o?o:Fd(i)){const t=void 0===n?jd({loc:i}):n;return!t||!e||e.isGuest||e.isAnonymous||e.userId!==t.user.userId?null:t.token}return!t||!(null==e?void 0:e.userId)||e.isGuest||e.isAnonymous?null:Vd({userId:e.userId})}catch(t){return console.warn("Error in credentialForTokenMint: ",t),null}})({cameFromToken:e,user:t,onLivePreview:this.isRunningUnderLivePreview(),liveSignIn:this.readLiveSignIn()})}catch(t){return console.warn("Error in credentialFor: ",t),null}},this.suggestionCredential=()=>{try{return this.credentialFor(this.snippylyUser,this.identityCameFromToken)}catch(t){return console.warn("Error in suggestionCredential: ",t),null}},this.suggestionGuardInstalled=!1,this.suggestionHideStyleObserver=null,this.suggestionHideSweepScheduled=!1,this.suggestionViewerRoleResolved=!1,this.suggestionHideStylesApplied=!1,this.isSuggestionActionsHiddenForViewer=()=>{try{return"Admin"!==this.snippylyUserRole}catch(t){return console.warn("Error in isSuggestionActionsHiddenForViewer: ",t),!1}},this.shouldHideSuggestionActionsOnPage=()=>{try{return this.suggestionViewerRoleResolved&&!!window.Velt&&this.isSuggestionActionsHiddenForViewer()}catch(t){return console.warn("Error in shouldHideSuggestionActionsOnPage: ",t),!1}},this.isSuggestionActionEventPath=t=>{try{return(t||[]).some((t=>{const e="string"==typeof(null==t?void 0:t.tagName)?t.tagName.toLowerCase():"";if(e.startsWith("velt-comment-dialog-suggestion-action")||e.startsWith("velt-comment-dialog-legacy-suggestion-action"))return!0;const i=null==t?void 0:t.classList;return!!(null==i?void 0:i.contains)&&(i.contains("sf-accept-btn")||i.contains("sf-reject-btn")||i.contains("velt-suggestion-actions"))}))}catch(t){return console.warn("Error in isSuggestionActionEventPath: ",t),!1}},this.setupSuggestionActionGuard=()=>{try{if(this.suggestionGuardInstalled)return;this.suggestionGuardInstalled=!0,document.addEventListener("click",(t=>{try{if(!this.isSuggestionActionsHiddenForViewer())return;const e="function"==typeof t.composedPath?t.composedPath():[];this.isSuggestionActionEventPath(e)&&(t.stopImmediatePropagation(),t.preventDefault(),console.warn("[CWS Toolbar] Only workspace members can accept or reject suggestions. Click ignored."))}catch(t){console.warn("Error in suggestion-action click guard: ",t)}}),{capture:!0})}catch(t){console.warn("Error in setupSuggestionActionGuard: ",t),oh("Error in setupSuggestionActionGuard: ",t)}},this.applySuggestionActionStyles=()=>{try{if(!this.shouldHideSuggestionActionsOnPage())return void this.removeSuggestionActionStyles();this.suggestionHideStylesApplied=!0,this.sweepSuggestionActionStyles(),this.suggestionHideStyleObserver||(this.suggestionHideStyleObserver=new MutationObserver((()=>{try{if(this.suggestionHideSweepScheduled)return;this.suggestionHideSweepScheduled=!0,requestAnimationFrame((()=>{this.suggestionHideSweepScheduled=!1,this.shouldHideSuggestionActionsOnPage()&&this.sweepSuggestionActionStyles()}))}catch(t){console.warn("Error in suggestion-action style observer: ",t)}})),this.suggestionHideStyleObserver.observe(document.body,{childList:!0,subtree:!0}))}catch(t){console.warn("Error in applySuggestionActionStyles: ",t),oh("Error in applySuggestionActionStyles: ",t)}},this.sweepSuggestionActionStyles=()=>{try{this.injectSuggestionActionStyle(document.head);const t=e=>{e.querySelectorAll("*").forEach((e=>{var i,o;const n=(null===(o=null===(i=e.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i))||"";if(!n.startsWith("velt-")&&!n.startsWith("snippyly-"))return;const r=e.shadowRoot;r&&(this.injectSuggestionActionStyle(r),t(r))}))};t(document.body)}catch(t){console.warn("Error in sweepSuggestionActionStyles: ",t)}},this.injectSuggestionActionStyle=t=>{try{if(t.querySelector(`style[${zp.SUGGESTION_ACTIONS_HIDDEN_STYLE_ATTR}]`))return;const e=document.createElement("style");e.setAttribute(zp.SUGGESTION_ACTIONS_HIDDEN_STYLE_ATTR,"true"),e.textContent=zp.SUGGESTION_ACTIONS_HIDDEN_CSS,t.appendChild(e)}catch(t){console.warn("Error in injectSuggestionActionStyle: ",t)}},this.removeSuggestionActionStyles=()=>{try{if(!this.suggestionHideStylesApplied)return;this.suggestionHideStylesApplied=!1,this.suggestionHideStyleObserver&&(this.suggestionHideStyleObserver.disconnect(),this.suggestionHideStyleObserver=null);const t=`style[${zp.SUGGESTION_ACTIONS_HIDDEN_STYLE_ATTR}]`;document.querySelectorAll(t).forEach((t=>t.remove()));const e=i=>{i.querySelectorAll("*").forEach((i=>{const o=i.shadowRoot;o&&(o.querySelectorAll(t).forEach((t=>t.remove())),e(o))}))};e(document.body)}catch(t){console.warn("Error in removeSuggestionActionStyles: ",t)}},this.isDriveOrPreviewHost=(t=document.location)=>{try{const e=(null==t?void 0:t.hostname)||"",i=(null==t?void 0:t.pathname)||"";return Ae.some((({hostSuffix:t,pathPrefix:o})=>(e===t||e.endsWith(`.${t}`))&&i.startsWith(o)))||this.isRunningUnderPreviewProxy(t)}catch(t){return console.warn("Error in isDriveOrPreviewHost: ",t),!1}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(Ad(Qt),Ud(),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),oh("Error in loginWithCustomUser: ",t)}},this.addWindowClickEventListener=()=>{try{this.windowClickEventListener||(this.windowClickEventListener=()=>{this.menuOpenedId&&(this.menuOpenedId=void 0)},window.addEventListener("click",this.windowClickEventListener))}catch(t){console.warn("Error in addWindowClickEventListener: ",t),oh("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),oh("Error in removeWindowClickEventListener: ",t)}},this.onWindowLocationChange=()=>{this.checkUrl()},this.setWindowEventListner=()=>{try{if(this.locationChangeListenerAttached)return;window.addEventListener("locationchange",this.onWindowLocationChange),this.locationChangeListenerAttached=!0}catch(t){console.warn("Error in setWindowEventListner: ",t),oh("Error in setWindowEventListner: ",t)}},this.removeWindowLocationChangeListener=()=>{try{window.removeEventListener("locationchange",this.onWindowLocationChange),this.locationChangeListenerAttached=!1}catch(t){console.warn("Error in removeWindowLocationChangeListener: ",t),oh("Error in removeWindowLocationChangeListener: ",t)}},this.urlChangeListener=()=>{try{const t=history.pushState;history.pushState=function(){const e=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),e};const e=history.replaceState;history.replaceState=function(){const t=e.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))}))}catch(t){console.warn("Error in urlChangeListener: ",t),oh("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;this.clientMode=this.detectClientModeFromPage(t.search),e.has(Kt)&&Sd(Mt,"true",!1);let i=!1;for(const t of[Tt,It,_t,$t,Ot]){if(!e.has(t))continue;const o=t!==Ot||this.isFramedByPortal();"true"===e.get(t)&&o?Sd(t,"true",!1,"sessionStorage"):Ad(t,"sessionStorage"),e.delete(t),i=!0}this.embedMode="true"===Md(Tt,!1,"sessionStorage"),this.readOnlyMode="true"===Md(_t,!1,"sessionStorage"),this.autoCommentModeRequested=!this.readOnlyMode&&"true"===Md(It,!1,"sessionStorage"),this.agentCommentsModeRequested="true"===Md($t,!1,"sessionStorage"),this.onboardingMode="true"===Md(Ot,!1,"sessionStorage")&&this.canHonourStoredOnboardingFlag(),this.autoOpenOnboardingSidebar();const o=e.get(Nt);o&&(Sd(Nt,o,!1,"sessionStorage"),e.delete(Nt),i=!0);const n=this.previewLocationPath;if(this.previewLocationPath=this.isRunningUnderLivePreview()?window.location.pathname||"/":Md(Nt,!1,"sessionStorage")||"",this.isRunningUnderLivePreview()&&n&&n!==this.previewLocationPath&&this.setPreviewLocationFromPath(),this.pageCommentsHidden="true"===Md(qt,!1,"sessionStorage"),i&&window.history.replaceState({},document.title,t.href),(null==e?void 0:e.has(re))&&!Md(re)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(se))if(Md(se,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(se),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showLiveDemoModal=!0;else this.showLiveDemoModal=!1;if(null==e?void 0:e.has(ae))if(Md(ae,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(ae),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showFigmaDemoModal=!0;else this.showFigmaDemoModal=!1;const r=this.isRunningUnderLivePreview();if(e.has(Yt)||e.has("snippyly_google_token")){if(r);else if(e.has(Yt)){const t=decodeURIComponent(e.get(Yt)),i=_d(t,Ye,Qe),o=i&&JSON.parse(i);if(o){const t={};t.userId=o.uid,t.name=o.displayName,t.email=o.email,t.photoUrl=null==o?void 0:o.photoURL;const e=JSON.stringify(t),i=Id(e,Ye,Qe);Sd(Qt,i,!0),(t=>{try{const e=null==t?void 0:t.cred;"string"==typeof e&&e?Sd(Xt,e,!0):Ud()}catch(t){console.warn("Error in storeUserCredentialFromSt: ",t)}})(o),Ad(ce)}}else if(e.has("snippyly_google_token")){const t=JSON.parse(atob(e.get("snippyly_google_token"))),i={};i.userId=t.uid,i.name=t.displayName,i.email=t.email,i.photoUrl=null==t?void 0:t.photoURL,Sd(Jt,JSON.stringify(i),!0),Ud()}e.delete(Yt),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(Mt)?(Sd(Mt,"true",!1),Ad(At),e.delete(Mt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(At)||Md(Mt,!1)&&this.loadPluginUI(),e.has(At)?(Sd(At,"true",!1),Ad(Mt),e.delete(At),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(Mt)||Md(At,!1)&&this.loadPluginUI(),this.clientMode&&this.loadPluginUI(),this.setVersionInUrl(),this.startAgentRunStatusListener()}catch(t){console.warn("Error in checkUrl: ",t),oh("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(Mt)||t.searchParams.set(Mt,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),oh("Error in setInviteUrl: ",t)}},this.detectVersion=()=>{try{if(this.projectVersionKey){const t=new URL(document.location).searchParams;if(t.get(this.projectVersionKey))this.projectVersion=t.get(this.projectVersionKey);else if(window.snippylyInitialLoadUrl){const t=new URL(window.snippylyInitialLoadUrl).searchParams;t.get(this.projectVersionKey)&&(this.projectVersion=t.get(this.projectVersionKey))}this.projectVersion&&Sd(oe,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(Mt)||t.has(At))&&t.has(ne)&&(Sd(ie,ne,!1,"sessionStorage"),this.projectVersion=t.get(ne),this.projectVersion&&Sd(oe,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),oh("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||Md(ie,!1,"sessionStorage"),e=this.projectVersion||Md(oe,!1,"sessionStorage");if(t&&e){const i=new URL(document.location),o=i.searchParams;o.get(t)||(o.set(t,e),window.history.replaceState({},document.title,i.href))}}catch(t){console.warn("Error in setVersionInUrl: ",t),oh("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,r,s,a,l;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),this.setLocation(),this.setPreviewLocationFromPath(),void setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}),this.setPreviewLocationFromPath())}}),4e3);if(this.clientMode){if(!await this.resolveClientSession()||!this.clientMode)return}if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;bt.includes(this.apiKey)&&this.listenToDocumentTitleChange();const c=this.clientMode?null:this.isRunningUnderLivePreview()?null===(t=this.readLiveSignIn())||void 0===t?void 0:t.user:$d();(this.clientMode||c&&!(null==c?void 0:c.isAnonymous))&&(this.loading=!0);try{this.customerMetadata=await this.getCustomerMetadata()}catch(t){console.warn("Error in getCustomerMetadata: ",t),oh("Error in getCustomerMetadata: ",t)}kd(ve)&&(this.isPasswordValid=kd(ve));const d=await lh(this.apiKey,this.projectId);"error"===d.status&&console.warn("getProjectConfig failed for projectId (treating project as valid): ",this.projectId),this.projectDeleted=Dd(d,this.isDriveOrPreviewHost(),this.projectIdSupplied),this.applyVeltFeatureGates(),this.projectConfig="ok"===d.status?d.config:null,this.projectApproval=this.readProjectApproval(this.projectConfig);const h=Wd(this.projectConfig);this.maintenanceRequests=h.enabled,this.maintenanceRequestsLabel=h.label,this.guestMode=!!(null===(e=this.projectConfig)||void 0===e?void 0:e.guestMode)||this.guestMode||this.isRunningUnderLivePreview(),this.allowGuestModeSignIn=!!(null===(o=null===(i=this.projectConfig)||void 0===i?void 0:i.guestModeConfig)||void 0===o?void 0:o.allowSignIn),this.queryParamsComments=!!(null===(n=this.projectConfig)||void 0===n?void 0:n.queryParamsComments),this.usePageTitleAsLocationName=!!(null===(r=this.projectConfig)||void 0===r?void 0:r.usePageTitleAsLocationName),(null===(s=this.projectConfig)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=this.projectConfig)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),this.applyVeltFeatureGates(),Sd(de,this.guestMode+"",!0),Sd(me,this.allowGuestModeSignIn+"",!0),Sd(he,this.passwordProtected+"",!0),Sd(ue,this.queryParamsComments+"",!0),Sd(pe,this.usePageTitleAsLocationName+"",!0),this.loadPlugin=!0,this.projectDeleted||this.mountVeltCollaborationElements();try{const t=new URL(document.location),e=t.searchParams;let i=!1;e.has("wireframe")&&"true"===e.get("wireframe")&&(sessionStorage.setItem("velt-wireframe","true"),e.delete("wireframe"),i=!0),e.get("velt-version")&&(sessionStorage.setItem("velt-version",e.get("velt-version")),e.delete("velt-version"),i=!0),e.get("velt-env")&&(sessionStorage.setItem("velt-env",e.get("velt-env")),e.delete("velt-env"),i=!0),i&&window.history.replaceState({},document.title,t.href)}catch(t){}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),oh("Error in loadPluginUI: ",t)}},this.listenToDocumentTitleChange=()=>{try{this.documentTitleChangeInterval||(this.documentTitleChangeInterval=setInterval((()=>{var t,e,i;const o="true"===sessionStorage.getItem("debugDocumentTitleChange");if(o&&(console.log("*** listenToDocumentTitleChange ***"),console.log("usePageTitleAsLocationName: ",this.usePageTitleAsLocationName)),this.usePageTitleAsLocationName){const n=document.title;o&&(console.log("location name: ",null===(t=this.location)||void 0===t?void 0:t.locationName),console.log("title: ",n),console.log("changed: ",(null===(e=this.location)||void 0===e?void 0:e.locationName)!==n)),(null===(i=this.location)||void 0===i?void 0:i.locationName)!==n&&(o&&console.log("%c triggering location update!","color: green; font-weight: bold;"),this.generateLocation(),this.setLocation({forceSetLocation:!0}),this.setPreviewLocationFromPath())}}),2e3))}catch(t){oh("Error in listenToDocumentTitleChange: ",t)}},this.initializeSnippyly=async()=>{var t,e,i,n,r,s,a,l,c,d,h,u,p,v,g,f,m,w,y,b,C,x,E,k,S;try{let M=this.staging?mt:wt;this.veltVersion&&(M=this.veltVersion);let A=this.staging,T=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(M=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(A=!1,T=!0)}this.apiKey;this.veltProxyToggleVisible=!1;const I=void 0;if(await o(this.apiKey,{options:{develop:A,staging:T,version:M,velt:!0,proxyDomain:"https://cdn.velt.dev"},...I?{proxyConfig:I}:{}}),!window.Velt)return;if(this.replayVeltFeatureGates(),this.autoTranslation&&(null===Velt||void 0===Velt?void 0:Velt.enableAutoTranslation)&&(null===Velt||void 0===Velt||Velt.enableAutoTranslation()),this.projectDeleted||this.mountCommentSidebar(),Velt){null===Velt||void 0===Velt||Velt.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Velt))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),(()=>{try{if(!document.getElementById("superflowFontLink3")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/fonts%2Fpoppins%2Fpoppins.css?alt=media&token=5f31a0f2-5f67-4974-bf56-78ae655f2b68",t.id="superflowFontLink3",document.head.appendChild(t)}}catch(t){console.warn("Error in loadPoppinsFont: ",t),oh("Error in loadPoppinsFont: ",t)}})()}if(Velt&&(th({sdkVersion:null===Velt||void 0===Velt?void 0:Velt.version,sdkType:"client"}),console.log(`Velt Version: ${(null===Velt||void 0===Velt?void 0:Velt.version)||"unknown"}`),console.log(`Superflow Toolbar Version: ${ft}`)),this.generateDocumentId(),(null===Velt||void 0===Velt?void 0:Velt.on)&&"function"==typeof(null===Velt||void 0===Velt?void 0:Velt.on)){const i=this.isRunningUnderLivePreview()?null===(t=this.readLiveSignIn())||void 0===t?void 0:t.user:$d(),o="true"===sessionStorage.getItem("debugUserUpdateEvent");this.previousVeltUserId=null!==(e=null==i?void 0:i.userId)&&void 0!==e?e:"default",o&&console.log("[Superflow Debug] Initialized previousVeltUserId:",this.previousVeltUserId),Velt.on("userUpdate").subscribe((async t=>{if(o&&console.log("User from event: UserUpdate",t),t){const e=t.userId;o&&console.log("[Superflow Debug] userUpdate event fired:",{previousVeltUserId:this.previousVeltUserId,currentUserId:e,userChanged:this.previousVeltUserId!==e}),this.previousVeltUserId!==e&&(o&&console.log("[Superflow Debug] User changed, calling setDocumentAndLocation"),await this.setDocumentAndLocation()),this.previousVeltUserId=e}})),o&&console.log("[Superflow Debug] Performing initial setDocumentAndLocation"),await this.setDocumentAndLocation()}else await this.setDocumentAndLocation();if(setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}),this.setPreviewLocationFromPath())}}),4e3),this.commentElement=null===Velt||void 0===Velt?void 0:Velt.getCommentElement(),this.contactElement=null===Velt||void 0===Velt?void 0:Velt.getContactElement(),this.rewriterElement=null===Velt||void 0===Velt?void 0:Velt.getRewriterElement(),this.presenceElement=null===Velt||void 0===Velt?void 0:Velt.getPresenceElement(),this.commentElement){this.readOnlyMode?"function"==typeof this.commentElement.enableTextComments&&this.commentElement.enableTextComments(!1):this.commentElement.enableTextComments(!0),this.isClientRequestsMode()?"function"==typeof this.commentElement.disableSignInButton&&this.commentElement.disableSignInButton():this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(i=this.commentElement)||void 0===i?void 0:i.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(n=this.commentElement)||void 0===n?void 0:n.enableDeviceInfo)&&this.commentElement.enableDeviceInfo(!0),this.commentElement.enableCommentIndex(!0),this.applyPageCommentsVisibility(),this.commentElement.onCommentModeChange&&this.commentElement.onCommentModeChange().subscribe((t=>{if(t&&this.readOnlyMode)return this.disableCommentMode(),void(this.addCommentMode=!1);this.addCommentMode=t,t&&this.unhidePageCommentsIfHidden(),t&&this.autoCommentModeRequested&&(this.autoCommentModeArmedOnce=!0,this.firstCommentNudge&&(this.firstCommentNudge=!1,this.showTourCommentTooltip=!1),Sd(le,"true")),t&&this.promptNativeScreenshotForCommentMode(),this.addCommentMode||this.showModalOnceCommentIsModeIsOff&&(this.addCommentCount>=2&&!Md(we)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),Sd(we,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!Md(be,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),Sd(be,"true",!1,"sessionStorage"),this.showModalOnceCommentIsModeIsOff=!1))})),(null===(r=this.commentElement)||void 0===r?void 0:r.enableOrphanComments)&&this.commentElement.enableOrphanComments(),!this.readOnlyMode&&(null===(s=this.commentElement)||void 0===s?void 0:s.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),this.readOnlyMode||this.showFirstCommentNudge(),(null===(a=this.commentElement)||void 0===a?void 0:a.enableGhostComments)&&this.commentElement.enableGhostComments();const t=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;t&&"object"==typeof t&&this.applyCommentStatuses(Array.isArray(t)?t:Object.values(t)),(null===(l=this.commentElement)||void 0===l?void 0:l.enableMinimap)&&!this.embedMode&&this.commentElement.enableMinimap(),(null===(c=this.commentElement)||void 0===c?void 0:c.setDStrategy)&&(null===(d=this.commentElement)||void 0===d||d.setDStrategy("dynamicId")),(null===(h=this.commentElement)||void 0===h?void 0:h.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableHotkey)&&this.commentElement.enableHotkey(),(null===(p=this.commentElement)||void 0===p?void 0:p.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins(),(null===(v=this.commentElement)||void 0===v?void 0:v.enableLazyLoadResolvedComments)&&this.commentElement.enableLazyLoadResolvedComments(),(null===(g=this.commentElement)||void 0===g?void 0:g.enableDraftConfirmation)&&this.commentElement.enableDraftConfirmation(),this.applyScreenshotSetting(),this.ensureAddCommentAnnotationSubscription(),this.initCommentStatuses(),this.setQueryParamsCommentsInSdk(),this.checkToEnableUpgradeButton(),this.applyClientModeToCommentElement(),this.syncRequestMode(),this.setupSidebarAgentCommentFilter(),this.setupVeltButtonClickListener(),this.maybeApplyVisibilityOptionsToCommentElement()}this.applyStorageFeatureAccess(),this.selectionElement=Velt.getSelectionElement(),this.isClientRequestsMode()||(this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(f=this.rewriterElement)||void 0===f||f.enableRewriter()),this.presenceElement&&(null===(m=this.presenceElement)||void 0===m?void 0:m.enableFlockMode)&&(null===(w=this.presenceElement)||void 0===w||w.enableFlockMode(!0))),(null===Velt||void 0===Velt?void 0:Velt.getDocElement)&&(this.docElement=Velt.getDocElement()),null===(x=(null===(y=this.docElement)||void 0===y?void 0:y.getDocumentMetadata)?null===(b=this.docElement)||void 0===b?void 0:b.getDocumentMetadata():null===(C=null===Velt||void 0===Velt?void 0:Velt.docService)||void 0===C?void 0:C.getDocumentMetadata$())||void 0===x||x.subscribe((t=>{var e,i;const o=(null===(e=null==t?void 0:t.superflow)||void 0===e?void 0:e.versions)?Object.values(null===(i=null==t?void 0:t.superflow)||void 0===i?void 0:i.versions):[],n=new URL(document.location).searchParams.get("version");if(n){const t=o.find((t=>t.id===n));t&&(this.version={id:t.id,name:t.versionName||t.id},this.setLocation())}})),(null===Velt||void 0===Velt?void 0:Velt.getViewsElement)&&(this.viewsElement=Velt.getViewsElement()),(null===(E=this.viewsElement)||void 0===E?void 0:E.getUniqueViewsByUser)&&(null===(S=null===(k=this.viewsElement)||void 0===k?void 0:k.getUniqueViewsByUser())||void 0===S||S.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),oh("Error in initializeSnippyly: ",t)}},this.generateDocumentId=()=>{try{this.documentId=bd(xd(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),this.serverDocumentId=(t=this.documentId+"")?`${bd(t)}`:void 0}catch(t){console.warn("Error in generateDocumentId: ",t),oh("Error in generateDocumentId: ",t)}var t},this.setDocumentAndLocation=async()=>{try{if(this.projectDeleted)return void console.warn("setDocumentAndLocation skipped: project no longer exists");this.generateDocumentId(),this.previousLocation=null,await(null===Velt||void 0===Velt?void 0:Velt.setDocumentId(this.documentId+"")),th({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation(),this.setPreviewLocationFromPath()}catch(t){console.warn("Error in setDocumentAndLocation: ",t),oh("Error in setDocumentAndLocation: ",t)}},this.setPreviewLocationFromPath=()=>{try{if(!(this.agentCommentsModeRequested||this.isRunningUnderLivePreview())||!this.previewLocationPath)return;if(!window.Velt||!(null===Velt||void 0===Velt?void 0:Velt.setLocation))return;const t={url:this.previewLocationPath},e=Ed(JSON.parse(JSON.stringify(t)));e&&(t.id=`${e}`),this.location=t,null===Velt||void 0===Velt||Velt.setLocation(JSON.parse(JSON.stringify(t))),th({clientLocation:t}),this.previousLocation=JSON.parse(JSON.stringify(t)),this.onVeltLocationChange()}catch(t){console.warn("Error in setPreviewLocationFromPath: ",t),oh("Error in setPreviewLocationFromPath: ",t)}},this.checkToEnableUpgradeButton=()=>{var t,e;try{this.isPlanExpired&&this.isUserGlobalContact?(null===(t=this.commentElement)||void 0===t?void 0:t.enableUpgradeButton)&&this.commentElement.enableUpgradeButton():(null===(e=this.commentElement)||void 0===e?void 0:e.disableUpgradeButton)&&this.commentElement.disableUpgradeButton()}catch(t){console.warn("Error in checkToEnableUpgradeButton: ",t),oh("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{const t=await hh(this.apiKey);return(t=>{try{const e=t?JSON.stringify(t):"false";Sd(Ce,e)}catch(t){console.warn("Error in setCustomerMetadataToStorage: ",t),oh("Error in setCustomerMetadataToStorage: ",t)}})(t),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),oh("Error in getCustomerMetadata: ",t);const e=(()=>{try{const t=Md(Ce);return t?"false"===t?JSON.parse(JSON.stringify(Re)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),oh("Error in getCustomerMetadataFromStorage: ",t),null}})();if(e)return e}},this.setCustomStatuses=async()=>{var t;try{const e=await uh(this.apiKey);if((null==e?void 0:e.success)&&(null==e?void 0:e.data)){const i=Object.values(e.data),o=this.sortCustomStatuses(i);if(o.length>0&&"function"==typeof(null===(t=this.commentElement)||void 0===t?void 0:t.setCustomStatus))return void this.applyCommentStatuses(o)}this.hasWindowCustomStatuses()||this.applyDefaultCommentStatuses()}catch(t){console.warn("Error in setCustomStatuses: ",t),oh("Error in setCustomStatuses: ",t)}},this.initCommentStatuses=()=>{var t,e,i;try{(null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.advancedFeatures)||void 0===i?void 0:i.hasCustomStatus)?this.setCustomStatuses():this.hasWindowCustomStatuses()||this.applyDefaultCommentStatuses()}catch(t){console.warn("Error in initCommentStatuses: ",t),oh("Error in initCommentStatuses: ",t)}},this.hasWindowCustomStatuses=()=>{try{const t=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;return!!t&&"object"==typeof t}catch{return!1}},this.applyDefaultCommentStatuses=()=>{try{this.applyCommentStatuses(pu)}catch(t){console.warn("Error in applyDefaultCommentStatuses: ",t),oh("Error in applyDefaultCommentStatuses: ",t)}},this.applyCommentStatuses=t=>{var e;try{if("function"!=typeof(null===(e=this.commentElement)||void 0===e?void 0:e.setCustomStatus)||!Array.isArray(t)||0===t.length)return;this.lastCommentStatuses=t;const i=this.isClientRequestsMode()||this.isRequestMode()?"client":"agency";this.commentElement.setCustomStatus(function(t,e){try{const i=(Array.isArray(t)?t:[]).filter((t=>!!t&&"object"==typeof t&&t.id!==pi.id)).map((t=>({...t})));if("client"===e){for(const t of i)"default"===t.type&&(t.type="ongoing");return[{...pi,type:"default"},...i]}const o={...pi,type:"ongoing"},n=i.findIndex((t=>"terminal"===t.type));return-1===n?i.push(o):i.splice(n,0,o),i}catch(e){return console.warn("[superflow client mode] withClientRequestStatus failed:",e),Array.isArray(t)?t.map((t=>({...t}))):[]}}(t,i))}catch(t){console.warn("Error in applyCommentStatuses: ",t),oh("Error in applyCommentStatuses: ",t)}},this.applyCheckPriorities=()=>{var t;try{if(Ct.includes(this.apiKey))return;if("function"!=typeof(null===(t=this.commentElement)||void 0===t?void 0:t.setCustomPriority))return;this.commentElement.setCustomPriority(lu.map((t=>({...t}))))}catch(t){console.warn("Error in applyCheckPriorities: ",t),oh("Error in applyCheckPriorities: ",t)}},this.sortCustomStatuses=t=>{try{const e=[...t].sort(((t,e)=>("number"==typeof t.order?t.order:Number.MAX_SAFE_INTEGER)-("number"==typeof e.order?e.order:Number.MAX_SAFE_INTEGER)));return e}catch(e){return console.warn("Error in sortCustomStatuses: ",e),oh("Error in sortCustomStatuses: ",e),t}},this.getSamlConfig=async()=>{try{const t=await fh(this.apiKey);return(t=>{try{if(t){const e=JSON.stringify(t);Sd(Me,e,!0)}}catch(t){console.warn("Error in setSamlConfigToStorage: ",t),oh("Error in setSamlConfigToStorage: ",t)}})(t),t}catch(t){console.warn("Error in getSamlConfig: ",t),oh("Error in getSamlConfig: ",t);const e=(()=>{try{const t=Md(Me,!0);return t?JSON.parse(t):null}catch(t){return console.warn("Error in getSamlConfigFromStorage: ",t),oh("Error in getSamlConfigFromStorage: ",t),null}})();if(e)return e}},this.setLogos=()=>{var t,e,i,o,n,r,s,a,l,c,d,h;try{let u="light";this.privateCommentModeEnabled&&(u="dark");const p=null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.customBranding)||void 0===i?void 0:i.logoMark,v=null===(r=null===(n=null===(o=null==qe?void 0:Re)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===r?void 0:r.logoMark,g=null===(l=null===(a=null===(s=this.customerMetadata)||void 0===s?void 0:s.superflow)||void 0===a?void 0:a.customBranding)||void 0===l?void 0:l.wordMark,f=null===(h=null===(d=null===(c=null==qe?void 0:Re)||void 0===c?void 0:c.customBranding)||void 0===d?void 0:d.logo)||void 0===h?void 0:h.wordMark;switch(u){case"light":this.logoMark=(null==p?void 0:p.lightUrl)||(null==p?void 0:p.darkUrl)||(null==v?void 0:v.lightUrl),this.wordMark=(null==g?void 0:g.lightUrl)||(null==g?void 0:g.darkUrl)||(null==f?void 0:f.lightUrl);break;case"dark":this.logoMark=(null==p?void 0:p.darkUrl)||(null==p?void 0:p.lightUrl)||(null==v?void 0:v.darkUrl),this.wordMark=(null==g?void 0:g.darkUrl)||(null==g?void 0:g.lightUrl)||(null==f?void 0:f.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),oh("Error in setLogos: ",t)}},this.getAlertIcon=()=>R`
6196
+ `}catch(t){return console.warn("Error in render: ",t),R``}}};Fu.styles=[Bh,Du],Tu([nt({type:Array})],Fu.prototype,"agentGroups",void 0),Tu([nt({type:String})],Fu.prototype,"currentPageUrl",void 0),Tu([nt({type:String,reflect:!0})],Fu.prototype,"theme",void 0),Tu([nt({type:Array})],Fu.prototype,"agentRunStatuses",void 0),Tu([nt({type:Boolean})],Fu.prototype,"loading",void 0),Tu([nt({type:Array})],Fu.prototype,"unsyncedAnnotationIds",void 0),Tu([rt()],Fu.prototype,"expandedFindingIds",void 0),Tu([rt()],Fu.prototype,"openAccordions",void 0),Tu([rt()],Fu.prototype,"currentView",void 0),Tu([rt()],Fu.prototype,"selectedAgentId",void 0),Tu([rt()],Fu.prototype,"selectedFindingGroup",void 0),Fu=Tu([it("content-warning-sidebar")],Fu);function Pu(){try{return"undefined"!=typeof localStorage&&"true"===localStorage.getItem("sfScreenShotDebug")}catch{return!1}}function ju(t){return new Promise((e=>{let i=Math.max(1,t);const o=()=>{i-=1,i<=0?e():requestAnimationFrame(o)};requestAnimationFrame(o)}))}function Vu(t,e,i=600){const o=t.requestVideoFrameCallback;return"function"!=typeof o?ju(e+2):new Promise((n=>{let r=Math.max(1,e),s=!1;const a=()=>{s||(s=!0,clearTimeout(l),n())},l=setTimeout(a,Math.max(0,i)),c=()=>{s||(r-=1,r<=0?a():o.call(t,c))};o.call(t,c)}))}function Uu(t,e,i,o,n){const r=Math.max(0,Math.round(e)),s=Math.max(0,Math.round(i)),a=Math.max(1,Math.min(Math.round(o),t.width-r)),l=Math.max(1,Math.min(Math.round(n),t.height-s)),c=document.createElement("canvas");c.width=a,c.height=l;const d=c.getContext("2d");if(!d)throw new Error("canvas-crop-failed");return d.drawImage(t,r,s,a,l,0,0,a,l),c}function Bu(t,e){const i=Math.max(t.width,t.height);if(i<=e)return{canvas:t,ratio:1};const o=e/i,n=Math.max(1,Math.round(t.width*o)),r=Math.max(1,Math.round(t.height*o)),s=document.createElement("canvas");s.width=n,s.height=r;const a=s.getContext("2d");return a?(a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high",a.drawImage(t,0,0,n,r),{canvas:s,ratio:o}):{canvas:t,ratio:1}}function zu(t,e,i){return new Promise((o=>{t.toBlob((t=>o(t)),e,i)}))}async function Hu(t,e=.9){const i=await zu(t,"image/webp",e);if(i&&"image/webp"===i.type)return{blob:i,type:i.type};const o=await zu(t,"image/png");if(o)return{blob:o,type:"image/png"};throw new Error("canvas-encode-failed")}const Gu=["superflow-toolbar","snippyly-plugin","velt-shadow-dom-internal","snippyly-comment-pin-portal","snippyly-comment-pin","snippyly-area-pin-portal","velt-comment-pin-portal","velt-comment-pin","velt-area-pin-portal","snippyly-recorder-control-panel-internal","snippyly-live-state-sync-overlay",".comment-annotation-number","velt-comments","velt-comments-sidebar","velt-comments-sidebar-v2","velt-comment-tool","velt-cursor","velt-presence","velt-huddle","velt-arrows","velt-areas","velt-recorder-notes","velt-recorder-control-panel","velt-notifications-history-panel","velt-rewriter","velt-toast-popup","velt-root"],Wu=["snippyly-text-highlight","snippyly-comment-text-portal","snippyly-comment-text","velt-comment-text-portal","velt-comment-text"],qu="sf-capture-hide-widgets",Zu="data-sf-capture-keep";let Ku=null,Ju=null,Yu=[],Qu=new WeakSet,Xu=null;function tp(...t){Pu()&&"undefined"!=typeof console&&console.log("[sf-capture][exclude]",...t)}const ep=new Set(Gu.map((t=>t.toLowerCase())));function ip(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function op(t){const e=ip(t);return[`snippyly-comment-pin-portal[id="${e}"]`,`velt-comment-pin-portal[id="${e}"]`,`velt-comment-pin-portal[data-velt-id="${e}"]`,`snippyly-area-pin-portal[id="${e}"]`,`velt-area-pin-portal[id="${e}"]`,`velt-area-pin-portal[data-velt-id="${e}"]`,`snippyly-text-highlight[data-velt-id="${e}"]`,`velt-text-highlight[data-velt-id="${e}"]`].join(", ")}function np(t){if(!t)return!1;const e=ip(t);return!!document.querySelector(`snippyly-comment-pin-portal[id="${e}"] snippyly-comment-pin, velt-comment-pin-portal[id="${e}"] velt-comment-pin, velt-comment-pin-portal[data-velt-id="${e}"] velt-comment-pin`)||(!!document.querySelector(`snippyly-text-highlight[data-velt-id="${e}"], velt-text-highlight[data-velt-id="${e}"]`)||!!document.querySelector(`snippyly-area-pin-portal[id="${e}"], velt-area-pin-portal[id="${e}"], velt-area-pin-portal[data-velt-id="${e}"]`))}function rp(t){const e=Array.from(document.querySelectorAll(op(t)));for(const t of e){(i=t).setAttribute(Zu,""),i.querySelectorAll("*").forEach((t=>t.setAttribute(Zu,"")));let e=t.parentElement;for(;e;)e.setAttribute(Zu,""),e=e.parentElement}var i;return e}function sp(t,e){if(!Pu()||!t||"undefined"==typeof document)return;const i=t=>{const e=t.getBoundingClientRect();return[Math.round(e.x),Math.round(e.y),Math.round(e.width),Math.round(e.height)]},o=document.getElementById(qu),n=document.querySelector(op(t));if(tp(`[${e}] hideStyle=${!!o} keptHost=${!!n}`+(n?` keep=${n.hasAttribute(Zu)} display=${getComputedStyle(n).display}`:"")),n){tp(`[${e}] kept host subtree:`,Array.from(n.querySelectorAll("*")).map((t=>{const e=t.shadowRoot;return{tag:t.tagName.toLowerCase(),keep:t.hasAttribute(Zu),display:getComputedStyle(t).display,vis:getComputedStyle(t).visibility,rect:i(t),painted:t.getClientRects().length>0,shadowKids:e?e.childElementCount:-1}})))}const r=Array.from(document.querySelectorAll("velt-shadow-dom-internal")).map((t=>({keep:t.hasAttribute(Zu),display:getComputedStyle(t).display,rect:i(t)}))).filter((t=>"none"!==t.display));tp(`[${e}] visible <velt-shadow-dom-internal>: ${r.length}`,r);const s=ip(t),a="snippyly-comment-pin, velt-comment-pin",l=document.querySelector(`snippyly-area-pin-portal[id="${s}"], velt-area-pin-portal[id="${s}"], velt-area-pin-portal[data-velt-id="${s}"]`);if(l){const o=e=>{const i=e.closest("snippyly-area-pin-portal, velt-area-pin-portal");if(i){const e=i.getAttribute("id")||i.getAttribute("data-velt-id")||"";return`area#${e.slice(0,6)}${e===t?"(FOCUSED)":""}`}const o=e.parentElement;return o?o.tagName.toLowerCase():"(detached)"},n=Array.from(document.querySelectorAll(".line")),r=Array.from(document.querySelectorAll(a));tp(`[${e}] AREA focus: portal kept=${l.hasAttribute(Zu)} display=${getComputedStyle(l).display} rect=${JSON.stringify(i(l))} innerLines=${l.querySelectorAll(".line").length} innerPins=${l.querySelectorAll(a).length}`),tp(`[${e}] AREA .line owners (total ${n.length}):`,Array.from(new Set(n.map(o)))),tp(`[${e}] AREA <comment-pin> owners (total ${r.length}):`,r.map((t=>({owner:o(t),keep:t.hasAttribute(Zu),display:getComputedStyle(t).display,painted:t.getClientRects().length>0}))))}}function ap(){document.querySelectorAll('[style*="cursor"]').forEach((t=>{const e=t.style.getPropertyValue("cursor");if(!e)return;if(Qu.has(t))return void("none"!==e&&t.style.setProperty("cursor","none","important"));if("none"===e)return;const i=t.style.getPropertyPriority("cursor");Yu.push({el:t,value:e,priority:i,isPin:e.includes("url(")&&"important"===i}),Qu.add(t),t.style.setProperty("cursor","none","important")})),tp(`neutralized inline cursor(s): tracked=${Yu.length}`)}function lp(t){cp();let e=!1;if(t){const o=rp(t);e=o.length>0,function(t,e){if(Pu()){tp("keepAnnotationId =",JSON.stringify(t));for(const t of["snippyly-comment-pin-portal","velt-comment-pin-portal","snippyly-area-pin-portal","velt-area-pin-portal","snippyly-comment-text-portal","velt-comment-text-portal","snippyly-text-highlight","velt-text-highlight","velt-comment-text"]){const e=Array.from(document.querySelectorAll(t));tp(`candidates <${t}>: ${e.length}`,e.map((t=>({id:t.getAttribute("id"),"data-velt-id":t.getAttribute("data-velt-id")}))))}tp(`matched kept host(s): ${e.length}`),e.forEach(((t,e)=>{const i=[t.tagName.toLowerCase()];let o=t.parentElement;for(;o;){const t=o.tagName.toLowerCase();i.push(ep.has(t)?`${t}(EXCLUDED-ANCESTOR)`:t),o=o.parentElement}tp(` match[${e}] chain (self -> root):`,i.join(" > "))})),0===e.length&&tp("No host matched the annotationId — the marker will be hidden. Compare the annotationId above against the candidate id / data-velt-id values.")}}(t,o),e&&(i=t)&&"undefined"!=typeof MutationObserver&&(Ju=i,Ku=new MutationObserver((()=>{Ju&&rp(Ju)})),Ku.observe(document.documentElement,{childList:!0,subtree:!0}))}var i;const o=t=>e?`${t}:not([${Zu}])`:t,n=`${Gu.map(o).join(",\n")} { display: none !important; }`,r=`${Wu.map(o).join(",\n")} { display: contents !important; color: inherit !important; -webkit-text-fill-color: inherit !important; background-color: transparent !important; border-bottom-color: transparent !important; text-decoration: none !important; box-shadow: none !important; }`,s=document.createElement("style");s.id=qu,s.textContent=`${n}\n${r}\n* { cursor: none !important; }`,document.head.appendChild(s),ap(),"undefined"!=typeof MutationObserver&&(Xu=new MutationObserver((()=>ap())),Xu.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:["style"]})),tp(`injected hide stylesheet (keptAny=${e}, hide=${Gu.length}, neutralize=${Wu.length})`)}function cp(){var t;null===(t=document.getElementById(qu))||void 0===t||t.remove(),Xu&&(Xu.disconnect(),Xu=null),Yu.forEach((({el:t,value:e,priority:i,isPin:o})=>{o?t.style.removeProperty("cursor"):t.style.setProperty("cursor",e,i)})),Yu=[],Qu=new WeakSet,Ku&&(Ku.disconnect(),Ku=null),Ju=null,document.querySelectorAll(`[${Zu}]`).forEach((t=>t.removeAttribute(Zu)))}function dp(){var t;const e=null===(t=navigator.userAgentData)||void 0===t?void 0:t.brands;if(e&&e.length)return e.some((t=>/Chromium|Google Chrome|Microsoft Edge/i.test(t.brand)));const i=navigator.userAgent;return/Chrome|Chromium|Edg\//.test(i)&&!/Firefox|FxiOS/.test(i)}function hp(){return!("undefined"==typeof navigator||!navigator.mediaDevices||"function"!=typeof navigator.mediaDevices.getDisplayMedia)&&(dp()||function(){const t=navigator.userAgent;return/Safari/.test(t)&&/Apple/.test(navigator.vendor||"")&&!/Chrome|Chromium|CriOS|Edg\/|FxiOS|Android/.test(t)}())}class up{constructor(){this.name="native",this.stream=null,this.video=null,this.surface=void 0,this.cropEl=null,this.lastDebug=null,this.initPromise=null,this.onEnded=null}isSupported(){return"undefined"!=typeof navigator&&!!navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia}getCapability(){return dp()?"tab-region":"screen-crop"}isActive(){return!!this.stream&&!!this.video}getSurface(){return this.surface}getDebugInfo(){return this.lastDebug}async init(){if(!this.isSupported())throw new Error("native-not-supported");if(!this.isActive())return this.initPromise||(this.initPromise=this.runInit().finally((()=>{this.initPromise=null}))),this.initPromise}async runInit(){var t;const e=this.getCapability(),i="tab-region"===e?{video:{displaySurface:"browser"},preferCurrentTab:!0,selfBrowserSurface:"include",audio:!1}:{video:!0,audio:!1};let o;try{o=await navigator.mediaDevices.getDisplayMedia(i)}catch(t){throw t&&"object"==typeof t&&(t.sfNativeExpected=!0),t}let n=null;try{const i=o.getVideoTracks()[0];if(!i)throw new Error("native-no-video-track");if(this.surface=i.getSettings().displaySurface,"tab-region"===e){if("browser"!==this.surface){const e=null!==(t=this.surface)&&void 0!==t?t:"screen";throw new Error(`Shared a ${e}; re-init and pick "This tab".`)}await this.applyViewportCrop(i)}if(i.addEventListener("ended",(()=>this.handleEnded())),n=document.createElement("video"),n.srcObject=o,n.muted=!0,n.setAttribute("playsinline",""),n.style.cssText="position:fixed;left:-99999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;",document.body.appendChild(n),await n.play(),"ended"===i.readyState)throw new Error("native-share-ended-during-init");this.stream=o,this.video=n}catch(t){throw o.getTracks().forEach((t=>t.stop())),n&&(n.srcObject=null,n.remove()),this.removeCropEl(),this.surface=void 0,t}}async capture(t={}){if(!this.stream||!this.video)throw new Error("capture-not-initialized");const e=t.focusAnnotationId;Pu()&&"undefined"!=typeof console&&console.log("[sf-capture][native] capture(): focusAnnotationId =",JSON.stringify(e));const i=performance.now(),o=this.video;return"tab-region"===this.getCapability()?this.captureTabRegion(o,i,e):this.captureScreenCrop(o,i,e)}async captureTabRegion(t,e,i){if("browser"!==this.surface)throw new Error("not-sharing-this-tab");const{canvas:o,page:n,frameW:r,frameH:s}=await this.grabFullFrame(t,i);let a=o;const l=n.viewportW*n.dpr;if(l>0&&r>1.5*l)throw new Error("frame-larger-than-viewport");const c=r/n.viewportW,d=Math.min(r,Math.round(n.viewportW*c)),h=Math.round(n.viewportH*c),u=a.height>h+2||a.width>d+2;u&&(a=Uu(a,0,0,d,h)),this.lastDebug={capability:"tab-region",surface:this.surface,cropApplied:!!this.cropEl,frameW:r,frameH:s,viewportW:n.viewportW,viewportH:n.viewportH,dpr:n.dpr,cssToFrame:c,croppedW:a.width,croppedH:a.height,clampedHeight:u},this.logDebug();const p=Bu(a,2560);a=p.canvas;const{blob:v,type:g}=await Hu(a,.9),f=performance.now()-e;return{blob:v,width:a.width,height:a.height,mode:this.name,durationMs:f,page:n,scope:"viewport",blobType:g,markerMapping:{scaleX:c*p.ratio,scaleY:c*p.ratio,originXCss:n.scrollX,originYCss:n.scrollY}}}async captureScreenCrop(t,e,i){const{canvas:o,page:n,frameW:r,frameH:s}=await this.grabFullFrame(t,i),a=this.computeScreenCrop(r,s);let l=Uu(o,a.cropX,a.cropY,a.cropW,a.cropH);const c=a.scale;this.lastDebug={capability:"screen-crop",surface:this.surface,cropApplied:!1,frameW:r,frameH:s,viewportW:n.viewportW,viewportH:n.viewportH,dpr:n.dpr,cssToFrame:c,croppedW:l.width,croppedH:l.height,clampedHeight:!0,screenCrop:a},this.logDebug();const d=Bu(l,2560);l=d.canvas;const{blob:h,type:u}=await Hu(l,.9),p=performance.now()-e;return{blob:h,width:l.width,height:l.height,mode:this.name,durationMs:p,page:n,scope:"viewport",blobType:u,markerMapping:{scaleX:c*d.ratio,scaleY:c*d.ratio,originXCss:n.scrollX,originYCss:n.scrollY}}}computeScreenCrop(t,e){const i=window.innerWidth,o=window.innerHeight,n=Math.max(0,window.outerHeight-window.innerHeight),r="window"===this.surface,s=r?window.outerWidth:window.screen.width,a=r?window.screenX:0,l=r?window.screenY:0,c=s>0?t/s:1,d=window.screenX-a,h=window.screenY+n-l;let u=Math.round(d*c),p=Math.round(h*c),v=Math.round(i*c),g=Math.round(o*c);return u=Math.max(0,Math.min(u,t-1)),p=Math.max(0,Math.min(p,e-1)),v=Math.max(1,Math.min(v,t-u)),g=Math.max(1,Math.min(g,e-p)),{cropX:u,cropY:p,cropW:v,cropH:g,scale:c,chromeTopCss:n,surfaceWidthCss:s}}async grabFullFrame(t,e){e&&await function(t,e=1200){return!t||np(t)?Promise.resolve(!!t&&np(t)):new Promise((i=>{let o=!1;const n=e=>{o||(o=!0,clearTimeout(s),r.disconnect(),tp(`waitForAnnotationHost(${JSON.stringify(t)}) -> ${e?"found":"timeout"}`),i(e))},r=new MutationObserver((()=>{np(t)&&n(!0)}));r.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["id","data-velt-id"]});const s=setTimeout((()=>n(!1)),Math.max(0,e))}))}(e),lp(e),sp(e,"post-hide");try{await ju(2),await Vu(t,3),await Vu(t,1);const i=function(){const t=document.documentElement;return{scrollX:window.scrollX,scrollY:window.scrollY,viewportW:t.clientWidth,viewportH:t.clientHeight,dpr:window.devicePixelRatio||1}}(),o=t.videoWidth,n=t.videoHeight;if(!o||!n)throw new Error("capture-no-frame");const r=document.createElement("canvas");r.width=o,r.height=n;const s=r.getContext("2d");if(!s)throw new Error("canvas-2d-unavailable");return sp(e,"pre-draw"),s.drawImage(t,0,0),{canvas:r,page:i,frameW:o,frameH:n}}finally{cp()}}logDebug(){Pu()&&"undefined"!=typeof console&&console.info("[sf-capture][native]",this.lastDebug)}dispose(){this.stream&&this.stream.getTracks().forEach((t=>t.stop())),this.video&&(this.video.srcObject=null,this.video.remove()),this.removeCropEl(),this.stream=null,this.video=null,this.surface=void 0}handleEnded(){var t;this.removeCropEl(),this.stream=null,this.video&&(this.video.srcObject=null,this.video.remove()),this.video=null,this.surface=void 0,null===(t=this.onEnded)||void 0===t||t.call(this)}async applyViewportCrop(t){const e=window.CropTarget,i=t;if(e&&"function"==typeof i.cropTo)try{const t=document.createElement("div");t.setAttribute("data-sf-capture-viewport",""),t.style.cssText="position:fixed;inset:0;pointer-events:none;opacity:0;z-index:-1;margin:0;",document.body.appendChild(t),this.cropEl=t;const o=await e.fromElement(t);await i.cropTo(o)}catch{this.removeCropEl()}}removeCropEl(){var t;null===(t=this.cropEl)||void 0===t||t.remove(),this.cropEl=null}}const pp=t=>null===t||"object"!=typeof t||Array.isArray(t)?null:t,vp=t=>"string"==typeof t?t.trim():"",gp=t=>{try{const e=pp(t),i=pp(null==e?void 0:e.agent);if(i)return i;const o=null==e?void 0:e.comments,n=Array.isArray(o)?pp(o[0]):null;return pp(null==n?void 0:n.agent)}catch{return null}},fp=Object.freeze(["superflow agent"]),mp=t=>{const e=vp(t);return e&&!fp.includes(e.toLowerCase())?e:""},wp=t=>{var e;try{return mp(null===(e=gp(t))||void 0===e?void 0:e.displayName).slice(0,80)}catch{return""}},yp=t=>{var e;const i=null===(e=pp(t))||void 0===e?void 0:e.createdAt;return"number"==typeof i&&Number.isFinite(i)?i:0},bp=(t,e)=>{try{return mp(t)||(t=>{let e="",i=-1/0;for(const o of Array.isArray(t)?t:[]){const t=wp(o);if(!t)continue;const n=yp(o);(!e||n>i)&&(e=t,i=n)}return e})(e)}catch{return""}},Cp=t=>gp(t)?"square":"round",xp="agent",Ep=Object.freeze({link:{viewBox:"0 0 18 18",strokeWidth:1.5,paths:["M6.75 11.25L11.25 6.75M8.25 4.50005L8.59725 4.09805C9.3006 3.39479 10.2545 2.99975 11.2491 2.99982C12.2438 2.99989 13.1976 3.39507 13.9009 4.09842C14.6041 4.80178 14.9992 5.75569 14.9991 6.75031C14.999 7.74493 14.6039 8.69879 13.9005 9.40205L13.5 9.75005M9.75011 13.5L9.45236 13.9005C8.74079 14.6041 7.78045 14.9988 6.77973 14.9988C5.77902 14.9988 4.81867 14.6041 4.10711 13.9005C3.75637 13.5537 3.47793 13.1408 3.28789 12.6856C3.09785 12.2304 3 11.7421 3 11.2489C3 10.7556 3.09785 10.2673 3.28789 9.81214C3.47793 9.35698 3.75637 8.94405 4.10711 8.59725L4.50011 8.25"]},spell:{viewBox:"0 0 18 18",strokeWidth:1.5,paths:["M10.5 4.5L15.75 9.75L12.75 12.75M3 14.9999L4.326 13.674M4.37072 13.6291C4.56768 13.8261 4.80153 13.9824 5.0589 14.089C5.31627 14.1956 5.59213 14.2505 5.87072 14.2505C6.14931 14.2505 6.42517 14.1956 6.68254 14.089C6.93991 13.9824 7.17376 13.8261 7.37072 13.6291L15.3102 5.68955C15.4496 5.55026 15.5601 5.38487 15.6355 5.20285C15.711 5.02082 15.7498 4.82571 15.7498 4.62868C15.7498 4.43165 15.711 4.23654 15.6355 4.05451C15.5601 3.87249 15.4496 3.7071 15.3102 3.5678L14.432 2.68955C14.2927 2.5502 14.1273 2.43966 13.9453 2.36424C13.7632 2.28882 13.5681 2.25 13.3711 2.25C13.1741 2.25 12.979 2.28882 12.7969 2.36424C12.6149 2.43966 12.4495 2.5502 12.3102 2.68955L4.37072 10.6291C4.1737 10.826 4.01741 11.0599 3.91078 11.3172C3.80415 11.5746 3.74927 11.8505 3.74927 12.1291C3.74927 12.4076 3.80415 12.6835 3.91078 12.9409C4.01741 13.1982 4.1737 13.4321 4.37072 13.6291Z"]},mobile:{viewBox:"0 0 18 18",strokeWidth:1.5,paths:["M8.25 3H9.75M9 12.75V12.7575M4.5 3.75C4.5 3.35218 4.65804 2.97064 4.93934 2.68934C5.22064 2.40804 5.60218 2.25 6 2.25H12C12.3978 2.25 12.7794 2.40804 13.0607 2.68934C13.342 2.97064 13.5 3.35218 13.5 3.75V14.25C13.5 14.6478 13.342 15.0294 13.0607 15.3107C12.7794 15.592 12.3978 15.75 12 15.75H6C5.60218 15.75 5.22064 15.592 4.93934 15.3107C4.65804 15.0294 4.5 14.6478 4.5 14.25V3.75Z"]},image:{viewBox:"0 0 24 24",strokeWidth:2,paths:["M15 8H15.01M3 15.9998L8 10.9998C8.928 10.1068 10.072 10.1068 11 10.9998L16 15.9998M14 13.9998L15 12.9998C15.928 12.1068 17.072 12.1068 18 12.9998L21 15.9998M3 6C3 5.20435 3.31607 4.44129 3.87868 3.87868C4.44129 3.31607 5.20435 3 6 3H18C18.7956 3 19.5587 3.31607 20.1213 3.87868C20.6839 4.44129 21 5.20435 21 6V18C21 18.7956 20.6839 19.5587 20.1213 20.1213C19.5587 20.6839 18.7956 21 18 21H6C5.20435 21 4.44129 20.6839 3.87868 20.1213C3.31607 19.5587 3 18.7956 3 18V6Z"]},consistency:{viewBox:"0 0 20 20",strokeWidth:1.66667,paths:["M12.5 3.33333H13.3333C13.5544 3.33333 13.7663 3.42113 13.9226 3.57741C14.0789 3.73369 14.1667 3.94565 14.1667 4.16667V7.08333M16.6667 5C16.8867 5.09333 17.1 5.18083 17.3067 5.2625C17.5101 5.34882 17.6709 5.51241 17.7537 5.71729C17.8366 5.92217 17.8346 6.15155 17.7483 6.355L15.8333 10.8333M3.00335 5.99751L8.95168 3.40668C9.04984 3.36461 9.15542 3.34261 9.26221 3.34199C9.369 3.34137 9.47483 3.36214 9.57346 3.40307C9.6721 3.444 9.76154 3.50426 9.83652 3.58031C9.91149 3.65635 9.97049 3.74664 10.01 3.84584L14.1134 13.7642C14.1986 13.9653 14.2015 14.1919 14.1214 14.3951C14.0413 14.5984 13.8846 14.762 13.685 14.8508L7.73752 17.4417C7.63932 17.4839 7.53366 17.506 7.42678 17.5067C7.3199 17.5073 7.21396 17.4866 7.11523 17.4457C7.0165 17.4047 6.92697 17.3444 6.85193 17.2683C6.7769 17.1922 6.71787 17.1018 6.67835 17.0025L2.57502 7.08334C2.48973 6.88222 2.48683 6.65565 2.56694 6.45241C2.64705 6.24917 2.80377 6.08634 3.00335 5.99751Z"]},"ai-visibility":{viewBox:"0 0 24 24",strokeWidth:2,paths:["M16 18C16.5304 18 17.0391 18.2107 17.4142 18.5858C17.7893 18.9609 18 19.4696 18 20C18 19.4696 18.2107 18.9609 18.5858 18.5858C18.9609 18.2107 19.4696 18 20 18C19.4696 18 18.9609 17.7893 18.5858 17.4142C18.2107 17.0391 18 16.5304 18 16C18 16.5304 17.7893 17.0391 17.4142 17.4142C17.0391 17.7893 16.5304 18 16 18ZM16 6C16.5304 6 17.0391 6.21071 17.4142 6.58579C17.7893 6.96086 18 7.46957 18 8C18 7.46957 18.2107 6.96086 18.5858 6.58579C18.9609 6.21071 19.4696 6 20 6C19.4696 6 18.9609 5.78929 18.5858 5.41421C18.2107 5.03914 18 4.53043 18 4C18 4.53043 17.7893 5.03914 17.4142 5.41421C17.0391 5.78929 16.5304 6 16 6ZM9 18C9 16.4087 9.63214 14.8826 10.7574 13.7574C11.8826 12.6321 13.4087 12 15 12C13.4087 12 11.8826 11.3679 10.7574 10.2426C9.63214 9.11742 9 7.5913 9 6C9 7.5913 8.36786 9.11742 7.24264 10.2426C6.11742 11.3679 4.5913 12 3 12C4.5913 12 6.11742 12.6321 7.24264 13.7574C8.36786 14.8826 9 16.4087 9 18Z"]},accessibility:{viewBox:"0 0 24 24",strokeWidth:2,paths:["M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0","M10 16.5l2 -3l2 3m-2 -3v-2l3 -1m-6 0l3 1","M12 7.5m-.5 0a.5 .5 0 1 0 1 0a.5 .5 0 1 0 -1 0"]},workspace:{viewBox:"0 0 18 18",strokeWidth:1.5,paths:["M2 1H6C6.26522 1 6.51957 1.10536 6.70711 1.29289C6.89464 1.48043 7 1.73478 7 2V8C7 8.26522 6.89464 8.51957 6.70711 8.70711C6.51957 8.89464 6.26522 9 6 9H2C1.73478 9 1.48043 8.89464 1.29289 8.70711C1.10536 8.51957 1 8.26522 1 8V2C1 1.73478 1.10536 1.48043 1.29289 1.29289C1.48043 1.10536 1.73478 1 2 1Z","M2 13H6C6.26522 13 6.51957 13.1054 6.70711 13.2929C6.89464 13.4804 7 13.7348 7 14V16C7 16.2652 6.89464 16.5196 6.70711 16.7071C6.51957 16.8946 6.26522 17 6 17H2C1.73478 17 1.48043 16.8946 1.29289 16.7071C1.10536 16.5196 1 16.2652 1 16V14C1 13.7348 1.10536 13.4804 1.29289 13.2929C1.48043 13.1054 1.73478 13 2 13Z","M12 9H16C16.2652 9 16.5196 9.10536 16.7071 9.29289C16.8946 9.48043 17 9.73478 17 10V16C17 16.2652 16.8946 16.5196 16.7071 16.7071C16.5196 16.8946 16.2652 17 16 17H12C11.7348 17 11.4804 16.8946 11.2929 16.7071C11.1054 16.5196 11 16.2652 11 16V10C11 9.73478 11.1054 9.48043 11.2929 9.29289C11.4804 9.10536 11.7348 9 12 9Z","M12 1H16C16.2652 1 16.5196 1.10536 16.7071 1.29289C16.8946 1.48043 17 1.73478 17 2V4C17 4.26522 16.8946 4.51957 16.7071 4.70711C16.5196 4.89464 16.2652 5 16 5H12C11.7348 5 11.4804 4.89464 11.2929 4.70711C11.1054 4.51957 11 4.26522 11 4V2C11 1.73478 11.1054 1.48043 11.2929 1.29289C11.4804 1.10536 11.7348 1 12 1Z"]},security:{viewBox:"0 0 24 24",strokeWidth:2,paths:["M12 3a12 12 0 0 0 8.5 3a12 12 0 0 1 -8.5 15a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3","M9 12l2 2l4 -4"]},uptime:{viewBox:"0 0 24 24",strokeWidth:2,paths:["M3 12h4l3 8l4 -16l3 8h4"]},forms:{viewBox:"0 0 24 24",strokeWidth:2,paths:["M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2","M9 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2","M9 12h.01M13 12h2M9 16h.01M13 16h2"]},lighthouse:{viewBox:"0 0 24 24",strokeWidth:2,paths:["M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0","M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M13.41 10.59l2.59 -2.59","M7 12a5 5 0 0 1 5 -5"]},lorem:{viewBox:"0 0 24 24",strokeWidth:2,paths:["M4 6h16M4 12h10M4 18h14"]},[xp]:{viewBox:"0 0 16 16",strokeWidth:1.33333,paths:["M6.33317 7.33333H6.33984M9.6665 7.33333H9.67317M6.33317 10C6.55042 10.2217 6.80974 10.3979 7.09592 10.5181C7.38211 10.6384 7.68941 10.7003 7.99984 10.7003C8.31026 10.7003 8.61757 10.6384 8.90375 10.5181C9.18994 10.3979 9.44925 10.2217 9.6665 10M4.6665 3.33333H5.33317V2H10.6665V3.33333H11.3332C11.8636 3.33333 12.3723 3.54405 12.7474 3.91912C13.1225 4.29419 13.3332 4.8029 13.3332 5.33333V11.3333C13.3332 11.8638 13.1225 12.3725 12.7474 12.7475C12.3723 13.1226 11.8636 13.3333 11.3332 13.3333V14H4.6665V13.3333C4.13607 13.3333 3.62736 13.1226 3.25229 12.7475C2.87722 12.3725 2.6665 11.8638 2.6665 11.3333V5.33333C2.6665 4.8029 2.87722 4.29419 3.25229 3.91912C3.62736 3.54405 4.13607 3.33333 4.6665 3.33333Z"]}});Object.freeze(Object.keys(Ep));const kp=t=>{var e;try{const i=vp(null===(e=gp(t))||void 0===e?void 0:e.icon).toLowerCase();return i&&Object.prototype.hasOwnProperty.call(Ep,i)?i:xp}catch{return xp}},Sp=t=>`url("data:image/svg+xml,${encodeURIComponent((t=>{const e=Object.prototype.hasOwnProperty.call(Ep,t)?Ep[t]:Ep[xp],i=e.paths.map((t=>`<path d="${t}"/>`)).join("");return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${e.viewBox}" fill="none" stroke="#FFFFFF" stroke-width="${e.strokeWidth}" stroke-linecap="round" stroke-linejoin="round">${i}</svg>`})(t))}")`,Ap="data-sf-agent-pin",Mp="comment-pin-container-",Tp=`[id^="${Mp}"]`,Ip=Object.freeze(["snippyly-comment-pin-portal","velt-comment-pin-portal","snippyly-area-pin-portal","velt-area-pin-portal"]),_p=Object.freeze({marker:".velt-comment-pin--marker",avatar:"snippyly-user-avatar",agentIcon:".velt-comment-pin--agent-icon"}),$p=Object.freeze(Object.values(_p)),Np=_p.marker,Op=t=>"undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(t):t.replace(/[^a-zA-Z0-9_-]/g,(t=>`\\${t}`)),Lp=(t,e=[""])=>{const i=e.length>0?e:[""],o=t=>i.map((e=>e?`${e} ${t}`:t)).join(",\n"),n=Np;return[`${o(n)} { border-radius: 6px !important; background: var(--velt-agent-accent, #4495FF) !important; }`,`${o(`${n} ${_p.avatar}`)},\n${o(`${n} ${_p.agentIcon}`)},\n${o(`${n} > svg`)} { display: none !important; }`,`${o(`${n}::before`)} { content: ''; display: block; flex: none; width: 20px; height: 20px; background: ${Sp(t)} center / contain no-repeat; }`].join("\n")},Rp=(t,e=3,i=8)=>{const o=[],n=(t,r)=>{if(r>e)return;const s=t instanceof Element?[t]:[];t.querySelectorAll("*").forEach((t=>s.push(t)));for(const t of s){if(o.length>=i)return;const e=t.shadowRoot;e&&!o.includes(e)&&(o.push(e),n(e,r+1))}};try{t&&n(t,1)}catch{}return o},Dp=(t,e)=>{try{let i=t.querySelector(`style[${Ap}]`);if(!e)return void(null==i||i.remove());i||(i=document.createElement("style"),i.setAttribute(Ap,"true"),t.appendChild(i)),i.textContent!==e&&(i.textContent=e)}catch{}},Fp=(t,e=document)=>{try{return t?Array.from(e.querySelectorAll(`#${Op(`${Mp}${t}`)}`)):[]}catch{return[]}},Pp=t=>{const e=t;return e&&1===e.nodeType&&"string"==typeof e.id&&e.id.startsWith(Mp)?e.id.slice(22):""},jp=Object.freeze(["style","link","script","template"]),Vp=(t,e)=>{const i=e>1?`:scope ${"> * ".repeat(e-1)}*`:"*";for(const e of Array.from(t.querySelectorAll(i)))if(!jp.includes(e.localName))return!0;return!1},Up=(t,e=Rp(t))=>{try{if((t=>{try{return null!==t.querySelector(Np)}catch{return!1}})(t))return"light";if(e.some((t=>null!==t.querySelector(_p.marker))))return"shadow";return(e.length>0?e.some((t=>Vp(t,1))):Vp(t,2))?"unrecognised":"pending"}catch{return"pending"}},Bp=t=>{for(const e of Rp(t))Dp(e,"")};var zp=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class Hp extends tt{constructor(){super(),this._loadPlugin=!1,this.comments=[],this.addCommentMode=!1,this.showTourCommentTooltip=!1,this.firstCommentNudge=!1,this.allFeatureDisabled=!1,this.planLimitLocked=!1,this.projectDeleted=!1,this.resolvedVeltFeatureGates=[],this.allFeatureRestricted=!1,this.guestMode=!1,this._expanded=!0,this.loading=!0,this._isPlanExpired=null,this.showOnboardingModal=!0,this.embedMode=!1,this.readOnlyMode=!1,this.autoCommentModeRequested=!1,this.autoCommentModeArmedOnce=!1,this.agentCommentsModeRequested=!1,this.previewLocationPath="",this.onboardingMode=!1,this.clientMode=!1,this.clientModeBlocked=!1,this.clientSession=null,this.clientGrant=null,this.clientUser=null,this.clientSessionApi=null,this.clientSessionResolution=null,this.notifiedClientRequests=new Set,this.clientNotifyRetryTimer=(t,e)=>{window.setTimeout(t,e)},this.maintenanceRequests=!1,this.maintenanceRequestsLabel="",this.requestModeApplied=!1,this.requestContextProviderSet=!1,this.requestModeLoadedTracked=!1,this.lastCommentStatuses=null,this.notifyAddedRequest=function(t){const e=new Set,i=(e,o)=>{try{if(!t.isActive())return;t.send(e).then((n=>{var r;"ok"!==n.kind?"error"!==n.kind||"not-found"!==n.code||"first"!==o?"error"===n.kind?t.warn(`${Zd} refused (${n.code})`):t.warn(`${Zd} could not reach the backend`):t.retryTimer((()=>i(e,"retry")),t.retryDelayMs):n.notified||t.warn(`${Zd}: not sent (${null!==(r=n.reason)&&void 0!==r?r:"unknown"})`)})).catch((()=>{t.warn(`${Zd} could not reach the backend`)}))}catch(t){console.warn("Error in request notifier attempt: ",t)}};return o=>{try{if(!o||e.has(o)||!t.isActive())return;e.add(o),i(o,"first")}catch(t){console.warn("Error in request notifier: ",t)}}}({send:t=>{var e,i,o;return Ah({apiKey:this.apiKey,documentId:this.projectId||"",annotationId:t,user:{userId:null===(e=this.snippylyUser)||void 0===e?void 0:e.userId,name:null===(i=this.snippylyUser)||void 0===i?void 0:i.name,email:null===(o=this.snippylyUser)||void 0===o?void 0:o.email}})},isActive:()=>this.isRequestMode()&&!!this.apiKey&&!!this.projectId,retryTimer:(t,e)=>this.clientNotifyRetryTimer(t,e),retryDelayMs:Hp.CLIENT_NOTIFY_RETRY_MS,warn:t=>console.warn(t)}),this.showLiveDemoModal=!1,this.showFigmaDemoModal=!1,this.showGuestModeSignInModal=!1,this.defaultGuestModeSignInModalConfig={title:"Sign in to notify your team",description:"Notify your team about your latest comments.",closeOnClickOutside:!1,showLeaveCommentButton:!0},this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig)),this.showGuestModeNameModal=!1,this.guestModeSignInBannerVisible=!1,this.guestUserNameInput="",this.guestUserModelOpened=!1,this.guestUserNameUpdated=!1,this.guestUserNameUpdateLoading=!1,this.projectIdSupplied=!1,this.staging=Ke,this._autoLocation=!0,this.copyLinkTooltip="Copy Link",this.approving=!1,this.approvalNotice=null,this.projectApproval=null,this.invalidApiKey=!1,this._isUserGlobalContact=!1,this.showQrCode=!1,this.qrCodeLoading=!1,this.qrCodeError=!1,this.customLoginEnabledLocally=null,this.customLoginEnabled=null,this.exitReviewModeCalled=!1,this.addCommentCount=0,this._privateCommentModeEnabled=!1,this.superflowToolbarMoved=!1,this._darkMode=!1,this.allowGuestModeSignIn=!0,this._queryParamsComments=!1,this._usePageTitleAsLocationName=!1,this.toolbarEnabled=!1,this.toolbarEnabledApiCalled=!1,this.passwordProtected=!1,this.isPasswordValid=!1,this.password="",this.validatingPasswordLoading=!1,this.showPasswordProtectedModal=!1,this.showInvalidPassword=!1,this.skipGuestNameModal=!1,this._totalViews={},this.totalViewsCount=0,this.inviteUrl="",this.showModalOnceCommentIsModeIsOff=!1,this.showInviteModal=!1,this.showBugReportModal=!1,this.featureAccess=null,this.hasAgentAccess=!1,this.hasPrivateCommentsAccess=!1,this.isPrivateCommentsEnabledOnWorkspace=!1,this.visibilityOptionsEnabled=!1,this.hasContentWarnings=!1,this.contentWarningsCount=0,this.showContentWarningSidebar=!1,this.showAgentCommentsInSidebar=!1,this.pageCommentsHidden=!1,this.veltProxyToggleVisible=!1,this.nativeScreenshotEnabled=!1,this.nativeScreenshotDenied=!1,this.capturingScreenshot=!1,this.nativeCapture=new up,this.screenshotChain=Promise.resolve(),this.pendingScreenshotCount=0,this.nativeScreenshotEnabling=!1,this.addCommentAnnotationSubscribedEl=void 0,this.isSettingSidebarData=!1,this.agentGroups=[],this.agentNameMap=new Map,this.agentNamesFetched=!1,this.agentRunStatuses=[],this.agentRunStatusTimedOut=!1,this.agentRunStatusLastMessageAt=0,this.agentRunStatusSettled=!1,this.agentRunStatusListening=!1,this.agentRunStatusWatchdogTimer=null,this.lastStreamAnnotations=[],this.streamEmissionCount=0,this.lastStreamEmissionAt=0,this.onboardingLastFetchCount=-1,this.onboardingLastFetchError="",this.onboardingFetchedAnnotations=[],this.onboardingFetchedAt=0,this.onboardingFindingsFetchTimer=null,this.onboardingFindingsFetchAttempts=0,this.onboardingFetchAttemptsByAgent=new Map,this.onboardingFindingsFetchInFlight=!1,this.onboardingOpenedAgentIds=new Set,this.onboardingFetchResolvedAgentIds=new Set,this.onboardingRemovedAnnotationIds=new Set,this.onboardingUnsyncedAnnotationIds=[],this.onboardingViewportListening=!1,this.onboardingPanelResizeObserver=null,this.onboardingObservedPanel=null,this.onboardingClampFrame=null,this.locationChangeListenerAttached=!1,this.portalOrigins=null,this.spellingSuggestionPagePathMap=new Map,this.grammarSuggestionPagePathMap=new Map,this.processingAnnotationIds=new Set,this.agentPinTargets=new Map,this.agentPinLightDomIds=new Set,this.agentPinPageCss="",this.agentPinDecoratedContainers=new WeakSet,this.agentPinPendingContainers=new Set,this.agentPinDomObserver=null,this.agentPinFrameCancel=null,this.agentPinUnrecognisedContainers=new Set,this.agentPinMarkupRecheckTimer=null,this.agentPinMarkupReported=!1,this.subscriptions=[],this.bootstrapStubToReplay=null,this.onApiKeyChange=()=>{try{this.apiKey&&(null===window||void 0===window?void 0:window.onSuperflowLoad)&&"function"==typeof window.onSuperflowLoad&&window.onSuperflowLoad()}catch(t){console.warn("Error in onApiKeyChange: ",t),nh("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await fh(this.apiKey);this.customLoginEnabled=!!(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),nh("Error in checkCustomLoginEnabled: ",t)}},this.isRunningUnderPreviewProxy=(t=document.location)=>{try{const e=(null==t?void 0:t.hostname)||"",i=(null==t?void 0:t.pathname)||"";return!!Pd(t)||zt.some((({hostSuffix:t,pathPrefix:o})=>(e===t||e.endsWith(`.${t}`))&&i.startsWith(o)))}catch(t){return console.warn("Error in isRunningUnderPreviewProxy: ",t),!1}},this.isRunningUnderLivePreview=(t=document.location)=>{try{return Pd(t)}catch(t){return console.warn("Error in isRunningUnderLivePreview: ",t),!1}},this.getEffectiveCurrentPageUrl=()=>{try{return this.isRunningUnderPreviewProxy()&&this.previewLocationPath?this.previewLocationPath:window.location.href}catch(t){return console.warn("Error in getEffectiveCurrentPageUrl: ",t),window.location.href}},this.identityCameFromToken=!1,this.identityLiveSignIn=null,this.isLiveShareGuest=()=>{var t,e,i;try{const o=null===(t=this.identityLiveSignIn)||void 0===t?void 0:t.user;return!!(null===(e=this.snippylyUser)||void 0===e?void 0:e.isGuest)&&!!(null==o?void 0:o.isGuest)&&o.userId===(null===(i=this.snippylyUser)||void 0===i?void 0:i.userId)}catch(t){return console.warn("Error in isLiveShareGuest: ",t),!1}},this.liveSignInExpiryHandled=!1,this.fallBackToGuestIfLiveSignInExpired=(t,e=Date.now())=>{var i;try{return!(!t||(null===(i=t.user)||void 0===i?void 0:i.isGuest)||t.expiresAt>e+te)&&(this.liveSignInExpiryHandled||(this.liveSignInExpiryHandled=!0,console.warn("[CWS Toolbar] The live preview sign-in has expired. Continuing as a guest."),this.signInError=!1,setTimeout((()=>this.identifySnippyly()),0)),!0)}catch(t){return console.warn("Error in fallBackToGuestIfLiveSignInExpired: ",t),!1}},this.readLiveSignIn=()=>{try{return this.isRunningUnderLivePreview()?Vd():null}catch(t){return console.warn("Error in readLiveSignIn: ",t),null}},this.credentialFor=(t,e)=>{try{return(({cameFromToken:t,user:e,loc:i=window.location,onLivePreview:o,liveSignIn:n})=>{try{if(null!=o?o:Pd(i)){const t=void 0===n?Vd({loc:i}):n;return!t||!e||e.isGuest||e.isAnonymous||e.userId!==t.user.userId?null:t.token}return!t||!(null==e?void 0:e.userId)||e.isGuest||e.isAnonymous?null:Ud({userId:e.userId})}catch(t){return console.warn("Error in credentialForTokenMint: ",t),null}})({cameFromToken:e,user:t,onLivePreview:this.isRunningUnderLivePreview(),liveSignIn:this.readLiveSignIn()})}catch(t){return console.warn("Error in credentialFor: ",t),null}},this.suggestionCredential=()=>{try{return this.credentialFor(this.snippylyUser,this.identityCameFromToken)}catch(t){return console.warn("Error in suggestionCredential: ",t),null}},this.suggestionGuardInstalled=!1,this.suggestionHideStyleObserver=null,this.suggestionHideSweepScheduled=!1,this.suggestionViewerRoleResolved=!1,this.suggestionHideStylesApplied=!1,this.suggestionRoleLookupFailed=!1,this.isSuggestionActionsHiddenForViewer=()=>{try{return this.suggestionRoleLookupFailed||"Admin"!==this.snippylyUserRole}catch(t){return console.warn("Error in isSuggestionActionsHiddenForViewer: ",t),!1}},this.shouldHideSuggestionActionsOnPage=()=>{try{return this.suggestionViewerRoleResolved&&!!window.Velt&&this.isSuggestionActionsHiddenForViewer()}catch(t){return console.warn("Error in shouldHideSuggestionActionsOnPage: ",t),!1}},this.isSuggestionActionEventPath=t=>{try{return(t||[]).some((t=>{const e="string"==typeof(null==t?void 0:t.tagName)?t.tagName.toLowerCase():"";if(e.startsWith("velt-comment-dialog-suggestion-action")||e.startsWith("velt-comment-dialog-legacy-suggestion-action"))return!0;const i=null==t?void 0:t.classList;return!!(null==i?void 0:i.contains)&&(i.contains("sf-accept-btn")||i.contains("sf-reject-btn")||i.contains("velt-suggestion-actions"))}))}catch(t){return console.warn("Error in isSuggestionActionEventPath: ",t),!1}},this.setupSuggestionActionGuard=()=>{try{if(this.suggestionGuardInstalled)return;this.suggestionGuardInstalled=!0,document.addEventListener("click",(t=>{try{if(!this.isSuggestionActionsHiddenForViewer())return;const e="function"==typeof t.composedPath?t.composedPath():[];this.isSuggestionActionEventPath(e)&&(t.stopImmediatePropagation(),t.preventDefault(),console.warn("[CWS Toolbar] Only workspace members can accept or reject suggestions. Click ignored."))}catch(t){console.warn("Error in suggestion-action click guard: ",t)}}),{capture:!0})}catch(t){console.warn("Error in setupSuggestionActionGuard: ",t),nh("Error in setupSuggestionActionGuard: ",t)}},this.applySuggestionActionStyles=()=>{try{if(!this.shouldHideSuggestionActionsOnPage())return void this.removeSuggestionActionStyles();this.suggestionHideStylesApplied=!0,this.sweepSuggestionActionStyles(),this.suggestionHideStyleObserver||(this.suggestionHideStyleObserver=new MutationObserver((()=>{try{if(this.suggestionHideSweepScheduled)return;this.suggestionHideSweepScheduled=!0,requestAnimationFrame((()=>{this.suggestionHideSweepScheduled=!1,this.shouldHideSuggestionActionsOnPage()&&this.sweepSuggestionActionStyles()}))}catch(t){console.warn("Error in suggestion-action style observer: ",t)}})),this.suggestionHideStyleObserver.observe(document.body,{childList:!0,subtree:!0}))}catch(t){console.warn("Error in applySuggestionActionStyles: ",t),nh("Error in applySuggestionActionStyles: ",t)}},this.sweepSuggestionActionStyles=()=>{try{this.injectSuggestionActionStyle(document.head);const t=e=>{e.querySelectorAll("*").forEach((e=>{var i,o;const n=(null===(o=null===(i=e.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i))||"";if(!n.startsWith("velt-")&&!n.startsWith("snippyly-"))return;const r=e.shadowRoot;r&&(this.injectSuggestionActionStyle(r),t(r))}))};t(document.body)}catch(t){console.warn("Error in sweepSuggestionActionStyles: ",t)}},this.injectSuggestionActionStyle=t=>{try{if(t.querySelector(`style[${Hp.SUGGESTION_ACTIONS_HIDDEN_STYLE_ATTR}]`))return;const e=document.createElement("style");e.setAttribute(Hp.SUGGESTION_ACTIONS_HIDDEN_STYLE_ATTR,"true"),e.textContent=Hp.SUGGESTION_ACTIONS_HIDDEN_CSS,t.appendChild(e)}catch(t){console.warn("Error in injectSuggestionActionStyle: ",t)}},this.removeSuggestionActionStyles=()=>{try{if(!this.suggestionHideStylesApplied)return;this.suggestionHideStylesApplied=!1,this.suggestionHideStyleObserver&&(this.suggestionHideStyleObserver.disconnect(),this.suggestionHideStyleObserver=null);const t=`style[${Hp.SUGGESTION_ACTIONS_HIDDEN_STYLE_ATTR}]`;document.querySelectorAll(t).forEach((t=>t.remove()));const e=i=>{i.querySelectorAll("*").forEach((i=>{const o=i.shadowRoot;o&&(o.querySelectorAll(t).forEach((t=>t.remove())),e(o))}))};e(document.body)}catch(t){console.warn("Error in removeSuggestionActionStyles: ",t)}},this.isDriveOrPreviewHost=(t=document.location)=>{try{const e=(null==t?void 0:t.hostname)||"",i=(null==t?void 0:t.pathname)||"";return Te.some((({hostSuffix:t,pathPrefix:o})=>(e===t||e.endsWith(`.${t}`))&&i.startsWith(o)))||this.isRunningUnderPreviewProxy(t)}catch(t){return console.warn("Error in isDriveOrPreviewHost: ",t),!1}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(Td(Qt),Bd(),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),nh("Error in loginWithCustomUser: ",t)}},this.addWindowClickEventListener=()=>{try{this.windowClickEventListener||(this.windowClickEventListener=()=>{this.menuOpenedId&&(this.menuOpenedId=void 0)},window.addEventListener("click",this.windowClickEventListener))}catch(t){console.warn("Error in addWindowClickEventListener: ",t),nh("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),nh("Error in removeWindowClickEventListener: ",t)}},this.onWindowLocationChange=()=>{this.checkUrl()},this.setWindowEventListner=()=>{try{if(this.locationChangeListenerAttached)return;window.addEventListener("locationchange",this.onWindowLocationChange),this.locationChangeListenerAttached=!0}catch(t){console.warn("Error in setWindowEventListner: ",t),nh("Error in setWindowEventListner: ",t)}},this.removeWindowLocationChangeListener=()=>{try{window.removeEventListener("locationchange",this.onWindowLocationChange),this.locationChangeListenerAttached=!1}catch(t){console.warn("Error in removeWindowLocationChangeListener: ",t),nh("Error in removeWindowLocationChangeListener: ",t)}},this.urlChangeListener=()=>{try{const t=history.pushState;history.pushState=function(){const e=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),e};const e=history.replaceState;history.replaceState=function(){const t=e.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))}))}catch(t){console.warn("Error in urlChangeListener: ",t),nh("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;this.clientMode=this.detectClientModeFromPage(t.search),e.has(Kt)&&Ad(At,"true",!1);let i=!1;for(const t of[Tt,It,_t,$t,Ot]){if(!e.has(t))continue;const o=t!==Ot||this.isFramedByPortal();"true"===e.get(t)&&o?Ad(t,"true",!1,"sessionStorage"):Td(t,"sessionStorage"),e.delete(t),i=!0}this.embedMode="true"===Md(Tt,!1,"sessionStorage"),this.readOnlyMode="true"===Md(_t,!1,"sessionStorage"),this.autoCommentModeRequested=!this.readOnlyMode&&"true"===Md(It,!1,"sessionStorage"),this.agentCommentsModeRequested="true"===Md($t,!1,"sessionStorage"),this.onboardingMode="true"===Md(Ot,!1,"sessionStorage")&&this.canHonourStoredOnboardingFlag(),this.autoOpenOnboardingSidebar();const o=e.get(Nt);o&&(Ad(Nt,o,!1,"sessionStorage"),e.delete(Nt),i=!0);const n=this.previewLocationPath;if(this.previewLocationPath=this.isRunningUnderLivePreview()?window.location.pathname||"/":Md(Nt,!1,"sessionStorage")||"",this.isRunningUnderLivePreview()&&n&&n!==this.previewLocationPath&&this.setPreviewLocationFromPath(),this.pageCommentsHidden="true"===Md(qt,!1,"sessionStorage"),i&&window.history.replaceState({},document.title,t.href),(null==e?void 0:e.has(se))&&!Md(se)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(ae))if(Md(ae,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(ae),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showLiveDemoModal=!0;else this.showLiveDemoModal=!1;if(null==e?void 0:e.has(le))if(Md(le,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(le),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showFigmaDemoModal=!0;else this.showFigmaDemoModal=!1;const r=this.isRunningUnderLivePreview();if(e.has(Yt)||e.has("snippyly_google_token")){if(r);else if(e.has(Yt)){const t=decodeURIComponent(e.get(Yt)),i=$d(t,Qe,Xe),o=i&&JSON.parse(i);if(o){const t={};t.userId=o.uid,t.name=o.displayName,t.email=o.email,t.photoUrl=null==o?void 0:o.photoURL;const e=JSON.stringify(t),i=_d(e,Qe,Xe);Ad(Qt,i,!0),(t=>{try{const e=null==t?void 0:t.cred;"string"==typeof e&&e?Ad(Xt,e,!0):Bd()}catch(t){console.warn("Error in storeUserCredentialFromSt: ",t)}})(o),Td(de)}}else if(e.has("snippyly_google_token")){const t=JSON.parse(atob(e.get("snippyly_google_token"))),i={};i.userId=t.uid,i.name=t.displayName,i.email=t.email,i.photoUrl=null==t?void 0:t.photoURL,Ad(Jt,JSON.stringify(i),!0),Bd()}e.delete(Yt),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(At)?(Ad(At,"true",!1),Td(Mt),e.delete(At),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(Mt)||Md(At,!1)&&this.loadPluginUI(),e.has(Mt)?(Ad(Mt,"true",!1),Td(At),e.delete(Mt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(At)||Md(Mt,!1)&&this.loadPluginUI(),this.clientMode&&this.loadPluginUI(),this.setVersionInUrl(),this.startAgentRunStatusListener()}catch(t){console.warn("Error in checkUrl: ",t),nh("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(At)||t.searchParams.set(At,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),nh("Error in setInviteUrl: ",t)}},this.detectVersion=()=>{try{if(this.projectVersionKey){const t=new URL(document.location).searchParams;if(t.get(this.projectVersionKey))this.projectVersion=t.get(this.projectVersionKey);else if(window.snippylyInitialLoadUrl){const t=new URL(window.snippylyInitialLoadUrl).searchParams;t.get(this.projectVersionKey)&&(this.projectVersion=t.get(this.projectVersionKey))}this.projectVersion&&Ad(ne,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(At)||t.has(Mt))&&t.has(re)&&(Ad(oe,re,!1,"sessionStorage"),this.projectVersion=t.get(re),this.projectVersion&&Ad(ne,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),nh("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||Md(oe,!1,"sessionStorage"),e=this.projectVersion||Md(ne,!1,"sessionStorage");if(t&&e){const i=new URL(document.location),o=i.searchParams;o.get(t)||(o.set(t,e),window.history.replaceState({},document.title,i.href))}}catch(t){console.warn("Error in setVersionInUrl: ",t),nh("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,r,s,a,l;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),this.setLocation(),this.setPreviewLocationFromPath(),void setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}),this.setPreviewLocationFromPath())}}),4e3);if(this.clientMode){if(!await this.resolveClientSession()||!this.clientMode)return}if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;bt.includes(this.apiKey)&&this.listenToDocumentTitleChange();const c=this.clientMode?null:this.isRunningUnderLivePreview()?null===(t=this.readLiveSignIn())||void 0===t?void 0:t.user:Nd();(this.clientMode||c&&!(null==c?void 0:c.isAnonymous))&&(this.loading=!0);try{this.customerMetadata=await this.getCustomerMetadata()}catch(t){console.warn("Error in getCustomerMetadata: ",t),nh("Error in getCustomerMetadata: ",t)}Sd(ge)&&(this.isPasswordValid=Sd(ge));const d=await ch(this.apiKey,this.projectId);"error"===d.status&&console.warn("getProjectConfig failed for projectId (treating project as valid): ",this.projectId),this.projectDeleted=Fd(d,this.isDriveOrPreviewHost(),this.projectIdSupplied),this.applyVeltFeatureGates(),this.projectConfig="ok"===d.status?d.config:null,this.projectApproval=this.readProjectApproval(this.projectConfig);const h=qd(this.projectConfig);this.maintenanceRequests=h.enabled,this.maintenanceRequestsLabel=h.label,this.guestMode=!!(null===(e=this.projectConfig)||void 0===e?void 0:e.guestMode)||this.guestMode||this.isRunningUnderLivePreview(),this.allowGuestModeSignIn=!!(null===(o=null===(i=this.projectConfig)||void 0===i?void 0:i.guestModeConfig)||void 0===o?void 0:o.allowSignIn),this.queryParamsComments=!!(null===(n=this.projectConfig)||void 0===n?void 0:n.queryParamsComments),this.usePageTitleAsLocationName=!!(null===(r=this.projectConfig)||void 0===r?void 0:r.usePageTitleAsLocationName),(null===(s=this.projectConfig)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=this.projectConfig)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),this.applyVeltFeatureGates(),Ad(he,this.guestMode+"",!0),Ad(we,this.allowGuestModeSignIn+"",!0),Ad(ue,this.passwordProtected+"",!0),Ad(pe,this.queryParamsComments+"",!0),Ad(ve,this.usePageTitleAsLocationName+"",!0),this.loadPlugin=!0,this.projectDeleted||this.mountVeltCollaborationElements();try{const t=new URL(document.location),e=t.searchParams;let i=!1;e.has("wireframe")&&"true"===e.get("wireframe")&&(sessionStorage.setItem("velt-wireframe","true"),e.delete("wireframe"),i=!0),e.get("velt-version")&&(sessionStorage.setItem("velt-version",e.get("velt-version")),e.delete("velt-version"),i=!0),e.get("velt-env")&&(sessionStorage.setItem("velt-env",e.get("velt-env")),e.delete("velt-env"),i=!0),i&&window.history.replaceState({},document.title,t.href)}catch(t){}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),nh("Error in loadPluginUI: ",t)}},this.listenToDocumentTitleChange=()=>{try{this.documentTitleChangeInterval||(this.documentTitleChangeInterval=setInterval((()=>{var t,e,i;const o="true"===sessionStorage.getItem("debugDocumentTitleChange");if(o&&(console.log("*** listenToDocumentTitleChange ***"),console.log("usePageTitleAsLocationName: ",this.usePageTitleAsLocationName)),this.usePageTitleAsLocationName){const n=document.title;o&&(console.log("location name: ",null===(t=this.location)||void 0===t?void 0:t.locationName),console.log("title: ",n),console.log("changed: ",(null===(e=this.location)||void 0===e?void 0:e.locationName)!==n)),(null===(i=this.location)||void 0===i?void 0:i.locationName)!==n&&(o&&console.log("%c triggering location update!","color: green; font-weight: bold;"),this.generateLocation(),this.setLocation({forceSetLocation:!0}),this.setPreviewLocationFromPath())}}),2e3))}catch(t){nh("Error in listenToDocumentTitleChange: ",t)}},this.initializeSnippyly=async()=>{var t,e,i,n,r,s,a,l,c,d,h,u,p,v,g,f,m,w,y,b,C,x,E,k,S;try{let A=this.staging?mt:wt;this.veltVersion&&(A=this.veltVersion);let M=this.staging,T=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(A=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(M=!1,T=!0)}this.apiKey;this.veltProxyToggleVisible=!1;const I=void 0;if(await o(this.apiKey,{options:{develop:M,staging:T,version:A,velt:!0,proxyDomain:"https://cdn.velt.dev"},...I?{proxyConfig:I}:{}}),!window.Velt)return;if(this.setupSuggestionActionGuard(),this.replayVeltFeatureGates(),this.autoTranslation&&(null===Velt||void 0===Velt?void 0:Velt.enableAutoTranslation)&&(null===Velt||void 0===Velt||Velt.enableAutoTranslation()),this.projectDeleted||this.mountCommentSidebar(),Velt){null===Velt||void 0===Velt||Velt.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Velt))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),(()=>{try{if(!document.getElementById("superflowFontLink3")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/fonts%2Fpoppins%2Fpoppins.css?alt=media&token=5f31a0f2-5f67-4974-bf56-78ae655f2b68",t.id="superflowFontLink3",document.head.appendChild(t)}}catch(t){console.warn("Error in loadPoppinsFont: ",t),nh("Error in loadPoppinsFont: ",t)}})()}if(Velt&&(eh({sdkVersion:null===Velt||void 0===Velt?void 0:Velt.version,sdkType:"client"}),console.log(`Velt Version: ${(null===Velt||void 0===Velt?void 0:Velt.version)||"unknown"}`),console.log(`Superflow Toolbar Version: ${ft}`)),this.generateDocumentId(),(null===Velt||void 0===Velt?void 0:Velt.on)&&"function"==typeof(null===Velt||void 0===Velt?void 0:Velt.on)){const i=this.isRunningUnderLivePreview()?null===(t=this.readLiveSignIn())||void 0===t?void 0:t.user:Nd(),o="true"===sessionStorage.getItem("debugUserUpdateEvent");this.previousVeltUserId=null!==(e=null==i?void 0:i.userId)&&void 0!==e?e:"default",o&&console.log("[Superflow Debug] Initialized previousVeltUserId:",this.previousVeltUserId),Velt.on("userUpdate").subscribe((async t=>{if(o&&console.log("User from event: UserUpdate",t),t){const e=t.userId;o&&console.log("[Superflow Debug] userUpdate event fired:",{previousVeltUserId:this.previousVeltUserId,currentUserId:e,userChanged:this.previousVeltUserId!==e}),this.previousVeltUserId!==e&&(o&&console.log("[Superflow Debug] User changed, calling setDocumentAndLocation"),await this.setDocumentAndLocation()),this.previousVeltUserId=e}})),o&&console.log("[Superflow Debug] Performing initial setDocumentAndLocation"),await this.setDocumentAndLocation()}else await this.setDocumentAndLocation();if(setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}),this.setPreviewLocationFromPath())}}),4e3),this.commentElement=null===Velt||void 0===Velt?void 0:Velt.getCommentElement(),this.contactElement=null===Velt||void 0===Velt?void 0:Velt.getContactElement(),this.rewriterElement=null===Velt||void 0===Velt?void 0:Velt.getRewriterElement(),this.presenceElement=null===Velt||void 0===Velt?void 0:Velt.getPresenceElement(),this.commentElement){this.readOnlyMode?"function"==typeof this.commentElement.enableTextComments&&this.commentElement.enableTextComments(!1):this.commentElement.enableTextComments(!0),this.isClientRequestsMode()?"function"==typeof this.commentElement.disableSignInButton&&this.commentElement.disableSignInButton():this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(i=this.commentElement)||void 0===i?void 0:i.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(n=this.commentElement)||void 0===n?void 0:n.enableDeviceInfo)&&this.commentElement.enableDeviceInfo(!0),this.commentElement.enableCommentIndex(!0),this.applyPageCommentsVisibility(),this.commentElement.onCommentModeChange&&this.commentElement.onCommentModeChange().subscribe((t=>{if(t&&this.readOnlyMode)return this.disableCommentMode(),void(this.addCommentMode=!1);this.addCommentMode=t,t&&this.unhidePageCommentsIfHidden(),t&&this.autoCommentModeRequested&&(this.autoCommentModeArmedOnce=!0,this.firstCommentNudge&&(this.firstCommentNudge=!1,this.showTourCommentTooltip=!1),Ad(ce,"true")),t&&this.promptNativeScreenshotForCommentMode(),this.addCommentMode||this.showModalOnceCommentIsModeIsOff&&(this.addCommentCount>=2&&!Md(ye)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),Ad(ye,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!Md(Ce,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),Ad(Ce,"true",!1,"sessionStorage"),this.showModalOnceCommentIsModeIsOff=!1))})),(null===(r=this.commentElement)||void 0===r?void 0:r.enableOrphanComments)&&this.commentElement.enableOrphanComments(),!this.readOnlyMode&&(null===(s=this.commentElement)||void 0===s?void 0:s.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),this.readOnlyMode||this.showFirstCommentNudge(),(null===(a=this.commentElement)||void 0===a?void 0:a.enableGhostComments)&&this.commentElement.enableGhostComments();const t=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;t&&"object"==typeof t&&this.applyCommentStatuses(Array.isArray(t)?t:Object.values(t)),(null===(l=this.commentElement)||void 0===l?void 0:l.enableMinimap)&&!this.embedMode&&this.commentElement.enableMinimap(),(null===(c=this.commentElement)||void 0===c?void 0:c.setDStrategy)&&(null===(d=this.commentElement)||void 0===d||d.setDStrategy("dynamicId")),(null===(h=this.commentElement)||void 0===h?void 0:h.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableHotkey)&&this.commentElement.enableHotkey(),(null===(p=this.commentElement)||void 0===p?void 0:p.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins(),(null===(v=this.commentElement)||void 0===v?void 0:v.enableLazyLoadResolvedComments)&&this.commentElement.enableLazyLoadResolvedComments(),(null===(g=this.commentElement)||void 0===g?void 0:g.enableDraftConfirmation)&&this.commentElement.enableDraftConfirmation(),this.applyScreenshotSetting(),this.ensureAddCommentAnnotationSubscription(),this.initCommentStatuses(),this.setQueryParamsCommentsInSdk(),this.checkToEnableUpgradeButton(),this.applyClientModeToCommentElement(),this.syncRequestMode(),this.setupSidebarAgentCommentFilter(),this.setupVeltButtonClickListener(),this.maybeApplyVisibilityOptionsToCommentElement()}this.applyStorageFeatureAccess(),this.selectionElement=Velt.getSelectionElement(),this.isClientRequestsMode()||(this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(f=this.rewriterElement)||void 0===f||f.enableRewriter()),this.presenceElement&&(null===(m=this.presenceElement)||void 0===m?void 0:m.enableFlockMode)&&(null===(w=this.presenceElement)||void 0===w||w.enableFlockMode(!0))),(null===Velt||void 0===Velt?void 0:Velt.getDocElement)&&(this.docElement=Velt.getDocElement()),null===(x=(null===(y=this.docElement)||void 0===y?void 0:y.getDocumentMetadata)?null===(b=this.docElement)||void 0===b?void 0:b.getDocumentMetadata():null===(C=null===Velt||void 0===Velt?void 0:Velt.docService)||void 0===C?void 0:C.getDocumentMetadata$())||void 0===x||x.subscribe((t=>{var e,i;const o=(null===(e=null==t?void 0:t.superflow)||void 0===e?void 0:e.versions)?Object.values(null===(i=null==t?void 0:t.superflow)||void 0===i?void 0:i.versions):[],n=new URL(document.location).searchParams.get("version");if(n){const t=o.find((t=>t.id===n));t&&(this.version={id:t.id,name:t.versionName||t.id},this.setLocation())}})),(null===Velt||void 0===Velt?void 0:Velt.getViewsElement)&&(this.viewsElement=Velt.getViewsElement()),(null===(E=this.viewsElement)||void 0===E?void 0:E.getUniqueViewsByUser)&&(null===(S=null===(k=this.viewsElement)||void 0===k?void 0:k.getUniqueViewsByUser())||void 0===S||S.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),nh("Error in initializeSnippyly: ",t)}},this.generateDocumentId=()=>{try{this.documentId=Cd(Ed(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),this.serverDocumentId=(t=this.documentId+"")?`${Cd(t)}`:void 0}catch(t){console.warn("Error in generateDocumentId: ",t),nh("Error in generateDocumentId: ",t)}var t},this.setDocumentAndLocation=async()=>{try{if(this.projectDeleted)return void console.warn("setDocumentAndLocation skipped: project no longer exists");this.generateDocumentId(),this.previousLocation=null,await(null===Velt||void 0===Velt?void 0:Velt.setDocumentId(this.documentId+"")),eh({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation(),this.setPreviewLocationFromPath()}catch(t){console.warn("Error in setDocumentAndLocation: ",t),nh("Error in setDocumentAndLocation: ",t)}},this.setPreviewLocationFromPath=()=>{try{if(!(this.agentCommentsModeRequested||this.isRunningUnderLivePreview())||!this.previewLocationPath)return;if(!window.Velt||!(null===Velt||void 0===Velt?void 0:Velt.setLocation))return;const t={url:this.previewLocationPath},e=kd(JSON.parse(JSON.stringify(t)));e&&(t.id=`${e}`),this.location=t,null===Velt||void 0===Velt||Velt.setLocation(JSON.parse(JSON.stringify(t))),eh({clientLocation:t}),this.previousLocation=JSON.parse(JSON.stringify(t)),this.onVeltLocationChange()}catch(t){console.warn("Error in setPreviewLocationFromPath: ",t),nh("Error in setPreviewLocationFromPath: ",t)}},this.checkToEnableUpgradeButton=()=>{var t,e;try{this.isPlanExpired&&this.isUserGlobalContact?(null===(t=this.commentElement)||void 0===t?void 0:t.enableUpgradeButton)&&this.commentElement.enableUpgradeButton():(null===(e=this.commentElement)||void 0===e?void 0:e.disableUpgradeButton)&&this.commentElement.disableUpgradeButton()}catch(t){console.warn("Error in checkToEnableUpgradeButton: ",t),nh("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{const t=await uh(this.apiKey);return(t=>{try{const e=t?JSON.stringify(t):"false";Ad(xe,e)}catch(t){console.warn("Error in setCustomerMetadataToStorage: ",t),nh("Error in setCustomerMetadataToStorage: ",t)}})(t),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),nh("Error in getCustomerMetadata: ",t);const e=(()=>{try{const t=Md(xe);return t?"false"===t?JSON.parse(JSON.stringify(De)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),nh("Error in getCustomerMetadataFromStorage: ",t),null}})();if(e)return e}},this.setCustomStatuses=async()=>{var t;try{const e=await ph(this.apiKey);if((null==e?void 0:e.success)&&(null==e?void 0:e.data)){const i=Object.values(e.data),o=this.sortCustomStatuses(i);if(o.length>0&&"function"==typeof(null===(t=this.commentElement)||void 0===t?void 0:t.setCustomStatus))return void this.applyCommentStatuses(o)}this.hasWindowCustomStatuses()||this.applyDefaultCommentStatuses()}catch(t){console.warn("Error in setCustomStatuses: ",t),nh("Error in setCustomStatuses: ",t)}},this.initCommentStatuses=()=>{var t,e,i;try{(null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.advancedFeatures)||void 0===i?void 0:i.hasCustomStatus)?this.setCustomStatuses():this.hasWindowCustomStatuses()||this.applyDefaultCommentStatuses()}catch(t){console.warn("Error in initCommentStatuses: ",t),nh("Error in initCommentStatuses: ",t)}},this.hasWindowCustomStatuses=()=>{try{const t=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;return!!t&&"object"==typeof t}catch{return!1}},this.applyDefaultCommentStatuses=()=>{try{this.applyCommentStatuses(vu)}catch(t){console.warn("Error in applyDefaultCommentStatuses: ",t),nh("Error in applyDefaultCommentStatuses: ",t)}},this.applyCommentStatuses=t=>{var e;try{if("function"!=typeof(null===(e=this.commentElement)||void 0===e?void 0:e.setCustomStatus)||!Array.isArray(t)||0===t.length)return;this.lastCommentStatuses=t;const i=this.isClientRequestsMode()||this.isRequestMode()?"client":"agency";this.commentElement.setCustomStatus(function(t,e){try{const i=(Array.isArray(t)?t:[]).filter((t=>!!t&&"object"==typeof t&&t.id!==vi.id)).map((t=>({...t})));if("client"===e){for(const t of i)"default"===t.type&&(t.type="ongoing");return[{...vi,type:"default"},...i]}const o={...vi,type:"ongoing"},n=i.findIndex((t=>"terminal"===t.type));return-1===n?i.push(o):i.splice(n,0,o),i}catch(e){return console.warn("[superflow client mode] withClientRequestStatus failed:",e),Array.isArray(t)?t.map((t=>({...t}))):[]}}(t,i))}catch(t){console.warn("Error in applyCommentStatuses: ",t),nh("Error in applyCommentStatuses: ",t)}},this.applyCheckPriorities=()=>{var t;try{if(Ct.includes(this.apiKey))return;if("function"!=typeof(null===(t=this.commentElement)||void 0===t?void 0:t.setCustomPriority))return;this.commentElement.setCustomPriority(cu.map((t=>({...t}))))}catch(t){console.warn("Error in applyCheckPriorities: ",t),nh("Error in applyCheckPriorities: ",t)}},this.sortCustomStatuses=t=>{try{const e=[...t].sort(((t,e)=>("number"==typeof t.order?t.order:Number.MAX_SAFE_INTEGER)-("number"==typeof e.order?e.order:Number.MAX_SAFE_INTEGER)));return e}catch(e){return console.warn("Error in sortCustomStatuses: ",e),nh("Error in sortCustomStatuses: ",e),t}},this.getSamlConfig=async()=>{try{const t=await mh(this.apiKey);return(t=>{try{if(t){const e=JSON.stringify(t);Ad(Me,e,!0)}}catch(t){console.warn("Error in setSamlConfigToStorage: ",t),nh("Error in setSamlConfigToStorage: ",t)}})(t),t}catch(t){console.warn("Error in getSamlConfig: ",t),nh("Error in getSamlConfig: ",t);const e=(()=>{try{const t=Md(Me,!0);return t?JSON.parse(t):null}catch(t){return console.warn("Error in getSamlConfigFromStorage: ",t),nh("Error in getSamlConfigFromStorage: ",t),null}})();if(e)return e}},this.setLogos=()=>{var t,e,i,o,n,r,s,a,l,c,d,h;try{let u="light";this.privateCommentModeEnabled&&(u="dark");const p=null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.customBranding)||void 0===i?void 0:i.logoMark,v=null===(r=null===(n=null===(o=null==Ze?void 0:De)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===r?void 0:r.logoMark,g=null===(l=null===(a=null===(s=this.customerMetadata)||void 0===s?void 0:s.superflow)||void 0===a?void 0:a.customBranding)||void 0===l?void 0:l.wordMark,f=null===(h=null===(d=null===(c=null==Ze?void 0:De)||void 0===c?void 0:c.customBranding)||void 0===d?void 0:d.logo)||void 0===h?void 0:h.wordMark;switch(u){case"light":this.logoMark=(null==p?void 0:p.lightUrl)||(null==p?void 0:p.darkUrl)||(null==v?void 0:v.lightUrl),this.wordMark=(null==g?void 0:g.lightUrl)||(null==g?void 0:g.darkUrl)||(null==f?void 0:f.lightUrl);break;case"dark":this.logoMark=(null==p?void 0:p.darkUrl)||(null==p?void 0:p.lightUrl)||(null==v?void 0:v.darkUrl),this.wordMark=(null==g?void 0:g.darkUrl)||(null==g?void 0:g.lightUrl)||(null==f?void 0:f.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),nh("Error in setLogos: ",t)}},this.getAlertIcon=()=>R`
6197
6197
  <svg class="error-icon" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
6198
6198
  <path d="M12 3C10.22 3 8.47991 3.52784 6.99987 4.51677C5.51983 5.50571 4.36628 6.91131 3.68509 8.55585C3.0039 10.2004 2.82567 12.01 3.17294 13.7558C3.5202 15.5016 4.37737 17.1053 5.63604 18.364C6.89471 19.6226 8.49836 20.4798 10.2442 20.8271C11.99 21.1743 13.7996 20.9961 15.4442 20.3149C17.0887 19.6337 18.4943 18.4802 19.4832 17.0001C20.4722 15.5201 21 13.78 21 12C20.9975 9.61382 20.0485 7.3261 18.3612 5.63882C16.6739 3.95154 14.3862 3.00252 12 3ZM12 19.6154C10.4938 19.6154 9.02146 19.1687 7.76912 18.332C6.51678 17.4952 5.5407 16.3058 4.96431 14.9143C4.38792 13.5227 4.23711 11.9916 4.53095 10.5143C4.82479 9.03707 5.55008 7.68014 6.61511 6.61511C7.68014 5.55008 9.03708 4.82478 10.5143 4.53094C11.9916 4.2371 13.5228 4.38791 14.9143 4.9643C16.3058 5.54069 17.4952 6.51677 18.332 7.76912C19.1688 9.02146 19.6154 10.4938 19.6154 12C19.6131 14.019 18.81 15.9547 17.3824 17.3824C15.9547 18.81 14.019 19.6131 12 19.6154ZM11.3077 12.6923V7.84615C11.3077 7.66254 11.3806 7.48645 11.5105 7.35662C11.6403 7.22678 11.8164 7.15385 12 7.15385C12.1836 7.15385 12.3597 7.22678 12.4895 7.35662C12.6194 7.48645 12.6923 7.66254 12.6923 7.84615V12.6923C12.6923 12.8759 12.6194 13.052 12.4895 13.1818C12.3597 13.3117 12.1836 13.3846 12 13.3846C11.8164 13.3846 11.6403 13.3117 11.5105 13.1818C11.3806 13.052 11.3077 12.8759 11.3077 12.6923ZM13.0385 15.8077C13.0385 16.0131 12.9776 16.2139 12.8635 16.3846C12.7493 16.5554 12.5872 16.6885 12.3974 16.7671C12.2076 16.8457 11.9988 16.8663 11.7974 16.8262C11.596 16.7861 11.4109 16.6872 11.2657 16.542C11.1205 16.3968 11.0216 16.2117 10.9815 16.0103C10.9414 15.8088 10.962 15.6 11.0406 15.4103C11.1192 15.2205 11.2523 15.0583 11.4231 14.9442C11.5938 14.8301 11.7946 14.7692 12 14.7692C12.2754 14.7692 12.5396 14.8786 12.7343 15.0734C12.9291 15.2681 13.0385 15.5323 13.0385 15.8077Z" fill="currentColor"/>
6199
6199
  </svg>
@@ -6205,32 +6205,32 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6205
6205
  ${vt(this.wordMark)}
6206
6206
  `:R`
6207
6207
  <img src=${this.wordMark} alt=${this.getLogoAlt()} />
6208
- `}catch(t){return console.warn("Error in getWordMark: ",t),R``}},this.generateLocation=()=>{try{if(this.autoLocation){const t=new URL(document.location).searchParams,e=new URL(document.location);e.searchParams.delete(Mt),e.searchParams.delete(At),e.searchParams.delete(Zt),e.searchParams.delete(Kt),e.searchParams.delete(re),e.searchParams.delete(se);const i=t.get(ne)||this.projectVersion;this.queryParamsComments||(e.search="");let o=(t=>{try{return t.replace(/#.*$/,"")}catch(e){return console.warn("Error in removeHashFromUrl: ",e),oh("Error in removeHashFromUrl: ",e),t}})(e.href);this.projectId&&(o=null==o?void 0:o.replace(window.location.origin,"")),this.location={url:o,version:i}}}catch(t){console.warn("Error in generateLocation: ",t),oh("Error in generateLocation: ",t)}},this.setLocation=t=>{var e,i,o,n;try{if(this.autoLocation&&window.Velt&&(null===Velt||void 0===Velt?void 0:Velt.setLocation)){if(this.version?(this.location||(this.location={}),this.location.version=this.version):this.location&&delete this.location.version,!(null==t?void 0:t.forceSetLocation)&&this.previousLocation&&(null===(e=this.previousLocation)||void 0===e?void 0:e.url)===(null===(i=this.location)||void 0===i?void 0:i.url)&&(null===(o=this.previousLocation)||void 0===o?void 0:o.version)===(null===(n=this.location)||void 0===n?void 0:n.version))return;const r=Ed(JSON.parse(JSON.stringify(this.location)));if(r?this.location.id=`${r}`:delete this.location.id,this.usePageTitleAsLocationName){const t=document.title;t&&(this.location.locationName=t)}null===Velt||void 0===Velt||Velt.setLocation(JSON.parse(JSON.stringify(this.location))),th({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location)),this.onVeltLocationChange()}}catch(t){console.warn("Error in setLocation: ",t),oh("Error in setLocation: ",t)}},this.onVeltLocationChange=()=>{try{window.dispatchEvent(new CustomEvent("veltLocationChange",{detail:this.location}))}catch(t){console.warn("Error in onVeltLocationChange: ",t),oh("Error in onVeltLocationChange: ",t)}},this.applyServerAdminDecision=t=>{try{const e=(({currentRole:t,serverIsAdmin:e})=>{try{return!1===e&&"Admin"===t?"Commenter":t}catch(e){return console.warn("Error in resolveRoleAfterTokenMint: ",e),t}})({currentRole:this.snippylyUserRole,serverIsAdmin:t});e!==this.snippylyUserRole&&(this.snippylyUserRole=e,this.syncRequestMode()),this.suggestionViewerRoleResolved=!0,this.applySuggestionActionStyles()}catch(t){console.warn("Error in applyServerAdminDecision: ",t)}},this.identifySnippyly=async()=>{var t,e,i,o;let n="",r="";try{if(this.invalidApiKey=!1,this.clientMode)return void await this.identifyClient();let o={name:"Default User",email:"default@usesuperflow.com",userId:"default",isAnonymous:!0,organizationId:this.apiKey};const s=this.isRunningUnderLivePreview(),a=s?this.readLiveSignIn():null;let l;l=s?a?{...a.user}:null:this.customLoginEnabled&&this.providedUser?this.providedUser:$d(),Ea("[Superflow][identify] resolved user (pre-iam)",{source:s?a?"liveSignIn":"liveGuest":this.customLoginEnabled&&this.providedUser?"providedUser":"token",email:null==l?void 0:l.email,userId:null==l?void 0:l.userId,name:null==l?void 0:l.name,isAnonymous:null==l?void 0:l.isAnonymous});const c=await this.getSamlConfig(),d=new URL(document.location);if(d.searchParams.has(Yt)&&d.searchParams.delete(Yt),c&&(this.signInUrl=`${Ke}saml/${c.slug}/login?redirect_url=${encodeURIComponent(null==d?void 0:d.toString())}&source=sf`,window.Superflow.signInUrl=this.signInUrl),((null==l?void 0:l.email)||s&&(null==l?void 0:l.userId))&&(o=l),o.isAnonymous)delete o.groupId;else{const t=Velt.getDocumentId()||this.serverDocumentId;t&&(o.groupId=t+"")}if(this.customLoginEnabledLocally||(null===(t=null==o?void 0:o.contacts)||void 0===t?void 0:t.length)&&(o.contacts=[]),n=null==o?void 0:o.email,r=null==o?void 0:o.userId,(null==o?void 0:o.isAnonymous)&&this.projectId&&(this.guestMode||s)){const t=Od(!0,this.apiKey);t&&(o=JSON.parse(JSON.stringify(t)))}(null==o?void 0:o.isAnonymous)||(this.loading=!0);const h={};(null==o?void 0:o.groupId)&&(h.groupId=null==o?void 0:o.groupId),o.organizationId=this.apiKey;const u=await ah(this.apiKey,this.projectId||"",null==o?void 0:o.email,null==o?void 0:o.userId),p=null==u?void 0:u.isAdmin;this.snippylyUserRole=p?"Admin":"Commenter",this.suggestionViewerRoleResolved=!0,this.applySuggestionActionStyles(),Ea("[Superflow][identify] iamResponse",u,{isAdminUser:p,snippylyUserRole:this.snippylyUserRole,email:null==o?void 0:o.email,userId:null==o?void 0:o.userId});const v=!(s||this.customLoginEnabled&&this.providedUser);this.identityCameFromToken=v,this.identityLiveSignIn=a;const g=((t,e)=>!(!e||(null==t?void 0:t.isAnonymous)||(null==t?void 0:t.isGuest)||!(null==t?void 0:t.userId)))(o,v),f=g&&((t,e)=>{try{if(!t||!e)return!1;const i=!!e.name&&e.name!==t.name,o=!!e.photoUrl&&e.photoUrl!==t.photoUrl;return Ea("[Superflow][identity] hasProfileChanged",{nameChanged:i,photoChanged:o,localName:t.name,savedName:e.name,localPhotoUrl:t.photoUrl,savedPhotoUrl:e.photoUrl}),i||o}catch(t){return console.warn("Error in hasProfileChanged: ",t),oh("Error in hasProfileChanged: ",t),!1}})(o,u);if(Ea("[Superflow][identify] enrichment gate",{cameFromToken:v,willEnrichIdentity:g,profileChanged:f,forceReset:f,isAnonymous:null==o?void 0:o.isAnonymous,isGuest:null==o?void 0:o.isGuest,userId:null==o?void 0:o.userId,nameBefore:null==o?void 0:o.name}),g&&(o=((t,e)=>t&&e?{...t,name:e.name||t.name,photoUrl:e.photoUrl||t.photoUrl}:t)(o,u),Ea("[Superflow][identify] enriched user",{nameAfter:null==o?void 0:o.name,photoUrl:null==o?void 0:o.photoUrl})),p&&(h.isAdmin=p,p&&this.allFeatureDisabled&&(this.allFeatureDisabled=!1)),this.restoreContentWarningSidebarState(),!this.projectDeleted&&(null==o?void 0:o.userId)&&!(null==o?void 0:o.isGuest)&&!(null==o?void 0:o.isAnonymous)&&this.documentId)try{await yh(this.apiKey,this.documentId,o.userId,o.name,o.email,this.credentialFor(o,v))}catch(t){oh("checkDocumentUserAndCreateError",t)}Ea("[Superflow][identify] setVeltAuthProvider options",{forceReset:f,profileChanged:f,userName:null==o?void 0:o.name,userId:null==o?void 0:o.userId});const[m]=await Promise.all([Velt.setVeltAuthProvider({user:o,options:{throwError:!0,forceReset:f},retryConfig:{retryCount:3,retryDelay:1e3},generateToken:async()=>{if(this.fallBackToGuestIfLiveSignInExpired(a))return null;const t=this.credentialFor(o,v),e=await ph(this.apiKey,null==o?void 0:o.userId,h,t);return this.applyServerAdminDecision(null==e?void 0:e.isAdmin),null==e?void 0:e.token},onError:t=>{console.log("Error signing to velt - ",t),this.fallBackToGuestIfLiveSignInExpired(a)||(this.invalidApiKey=!0)}}),this.fetchAndApplyFeatureAccess()]);if(this.hasAgentAccess&&this.insertShadowDOM(),this.invalidApiKey)throw"Invalid Api Key - Domain Not Whitelisted";g&&((t=>{try{const e={userId:null==t?void 0:t.userId,name:null==t?void 0:t.name,email:null==t?void 0:t.email,photoUrl:null==t?void 0:t.photoUrl},i=Id(JSON.stringify(e),Ye,Qe);Sd(Qt,i,!0)}catch(t){console.warn("Error in saveUserToken: ",t),oh("Error in saveUserToken: ",t)}})(o),Ea("[Superflow][identify] token rewritten post-signin, re-read",{persistedName:null===(e=$d())||void 0===e?void 0:e.name})),Ea("[Superflow][identify] velt auth response",{name:null==m?void 0:m.name,email:null==m?void 0:m.email,userId:null==m?void 0:m.userId,userSnippylyId:null==m?void 0:m.userSnippylyId,tokenUserProperties:h}),eh(JSON.parse(JSON.stringify(m||{}))),(null==o?void 0:o.isAnonymous)||(this.snippylyUser=JSON.parse(JSON.stringify(o)),Ea("[Superflow][identify] this.snippylyUser (rendered) name",null===(i=this.snippylyUser)||void 0===i?void 0:i.name)),this.syncRequestMode();const w=JSON.parse(JSON.stringify(m||{}));(null==w?void 0:w.userSnippylyId)&&!(null==w?void 0:w.isGuest)&&this.checkToMigrateGuestUser(w,this.credentialFor(w,v)),Velt.getUserRole$().subscribe((t=>{var e;t&&(this.loading=!1,null===(e=this.commentElement)||void 0===e||e.enablePriority(),this.applyCheckPriorities())})),this.contactListSubscription=Velt.getContactElement().getContactList().subscribe((t=>{var e;this.loading=!1,(null===(e=null==t?void 0:t.organizationUsers)||void 0===e?void 0:e.length)>0&&(this.checkPrivateCommentModeFromStorage(),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null))})),this.subscribePlanAndDocumentMetadata(),th({clientUserId:null==o?void 0:o.userId});try{ih(o)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),this.showFirstCommentNudge(),setTimeout((()=>{Md(le)||this.autoCommentModeArmedOnce||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(this.loading=!1,this.signInError=!0,t&&"string"==typeof t&&(null===(o=null==t?void 0:t.toLowerCase())||void 0===o?void 0:o.includes("invalid"))){this.invalidApiKey=!0,nh(gt.Events.DOMAIN_NOT_WHITELISTED),this.projectId&&sh(this.apiKey,this.projectId);if(new URL(document.location).searchParams.has(re))this.isSigningInUserAdmin=!0;else if(Md(ce))this.isSigningInUserAdmin="true"===Md(ce,!0);else{const t=await ah(this.apiKey,this.projectId||"",n,r);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),Sd(ce,this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),oh("Error in identifySnippyly: ",t)}},this.subscribePlanAndDocumentMetadata=()=>{try{if((null===Velt||void 0===Velt?void 0:Velt.isPlanExpired$)&&(null===Velt||void 0===Velt||Velt.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),oh("Error in isPlanExpired$: ",t)}))),null===Velt||void 0===Velt?void 0:Velt.on){let t;null===Velt||void 0===Velt||Velt.on("initUpdate").subscribe((e=>{"setDocumentsSuccess"===e.event&&(t&&(t.unsubscribe(),t=null),t=null===Velt||void 0===Velt?void 0:Velt.getDocumentMetadata().subscribe((async t=>{await this.handleDocumentMetadataUpdate(t)}),(t=>{console.warn("Error in getDocumentMetadata: ",t),oh("Error in getDocumentMetadata: ",t)})))}))}}catch(t){console.warn("Error in subscribePlanAndDocumentMetadata: ",t),oh("Error in subscribePlanAndDocumentMetadata: ",t)}},this.detectClientModeFromPage=t=>{try{return function(t){try{const e=new URLSearchParams(t.search||"");for(const t of ii)if(e.has(t))return!1;if(e.has(si))return!1;for(const e of oi)if(mi(t.local,e))return!1;for(const e of ni)if(mi(t.session||null,e))return!1;return!!vi(t.local)}catch(t){return console.warn("[superflow client mode] detectClientMode failed, not client mode:",t),!1}}({search:t,local:fi((()=>window.localStorage)),session:fi((()=>window.sessionStorage))})}catch(t){return console.warn("Error in detectClientModeFromPage: ",t),!1}},this.getClientSessionApi=()=>(this.clientSessionApi||(this.clientSessionApi=function(t){const e=t.origin;return{validateLiveSession:async i=>{try{const o=await ci(t,"validateLiveSession",{session:i,origin:e});return"ok"!==o.kind?o:function(t){try{const e=t;return!!e&&"object"==typeof e&&!!e.project&&"object"==typeof e.project&&"string"==typeof e.project.documentId&&!!e.client&&"object"==typeof e.client&&"string"==typeof e.client.userId&&e.client.userId.length>0}catch(t){return!1}}(o.result)?{kind:"ok",result:o.result}:(console.warn("[superflow client mode] validateLiveSession answered without a client identity"),{kind:"transport"})}catch(t){return console.warn("[superflow client mode] validateLiveSession failed:",t),{kind:"transport"}}},generateLiveAuthToken:async i=>{try{const o=await ci(t,"generateLiveAuthToken",{session:i,origin:e});return"ok"!==o.kind?o:function(t){try{const e=t;return!!e&&"object"==typeof e&&"string"==typeof e.token&&e.token.length>0&&!!e.user&&"object"==typeof e.user&&"string"==typeof e.user.userId&&e.user.userId.length>0}catch(t){return!1}}(o.result)?{kind:"ok",result:o.result}:(console.warn("[superflow client mode] generateLiveAuthToken answered without a token or a user"),{kind:"transport"})}catch(t){return console.warn("[superflow client mode] generateLiveAuthToken failed:",t),{kind:"transport"}}},notifyLiveRequest:async(i,o)=>{var n,r;try{const s=await ci(t,"notifyLiveRequest",{session:i,origin:e,annotationId:o});if("ok"!==s.kind)return s;const a=null===(n=s.result)||void 0===n?void 0:n.reason;return{kind:"ok",result:{notified:!0===(null===(r=s.result)||void 0===r?void 0:r.notified),reason:"string"==typeof a?a:null}}}catch(t){return console.warn("[superflow client mode] notifyLiveRequest failed:",t),{kind:"transport"}}}}}({fetchFn:(t,e)=>window.fetch(t,e),endpoint:ei,origin:window.location.origin})),this.clientSessionApi),this.resolveClientSession=()=>{try{return this.clientSessionResolution||(this.clientSessionResolution=this.validateClientSession().finally((()=>{this.clientSessionResolution=null}))),this.clientSessionResolution}catch(t){return console.warn("Error in resolveClientSession: ",t),Promise.resolve(!1)}},this.validateClientSession=async()=>{try{const t=fi((()=>window.localStorage)),e=vi(t);if(!e)return this.blockClientMode("no stored session"),!1;const i=await this.getClientSessionApi().validateLiveSession(e);return"error"===i.kind?(gi(t),this.blockClientMode(`session refused (${i.code})`),!1):"transport"===i.kind?(this.blockClientMode("session check failed; kept for the next page view"),!1):(this.clientSession=e,this.clientGrant=i.result,this.clientModeBlocked=!1,!0)}catch(t){return this.blockClientMode("session check threw"),console.warn("Error in validateClientSession: ",t),oh("Error in validateClientSession: ",t),!1}},this.blockClientMode=t=>{try{this.clientModeBlocked=!0,this.loading=!1,console.warn(`[superflow client mode] ${t}`)}catch(t){console.warn("Error in blockClientMode: ",t)}},this.isClientRequestsMode=()=>{var t;try{return this.clientMode&&ki(null===(t=this.clientGrant)||void 0===t?void 0:t.project)}catch(t){return console.warn("Error in isClientRequestsMode: ",t),this.clientMode}},this.isClientDefaultMode=()=>{try{return this.clientMode&&!!this.clientGrant&&!ki(this.clientGrant.project)}catch(t){return console.warn("Error in isClientDefaultMode: ",t),!1}},this.identifyClient=async()=>{try{const t=this.clientSession,e=this.clientGrant;if(!t||!e)return void this.blockClientMode("sign-in without a validated session");const i=this.getClientSessionApi(),o=await i.generateLiveAuthToken(t);if("error"===o.kind)return gi(fi((()=>window.localStorage))),void this.blockClientMode(`token refused (${o.code})`);if("transport"===o.kind)return void this.blockClientMode("token call failed; session kept for the next page view");const n=o.result.user,r=function({api:t,session:e,initialToken:i}){let o=i;return async()=>{try{if(o){const t=o;return o=null,t}const i=await t.generateLiveAuthToken(e);return"ok"===i.kind?i.result.token:null}catch(t){return console.warn("[superflow client mode] generateToken failed:",t),null}}}({api:i,session:t,initialToken:o.result.token});this.loading=!0;const[s]=await Promise.all([Velt.setVeltAuthProvider({user:n,options:{throwError:!0,forceReset:!1},retryConfig:{retryCount:3,retryDelay:1e3},generateToken:r,onError:t=>{console.warn("Error signing the client in to velt - ",t),this.invalidApiKey=!0}}),this.fetchAndApplyFeatureAccess()]);if(this.invalidApiKey)throw"Invalid Api Key - Domain Not Whitelisted";this.clientUser=n,this.guestUserNameUpdated=!0,this.snippylyUserRole="Commenter",eh(JSON.parse(JSON.stringify(s||{}))),this.snippylyUser=JSON.parse(JSON.stringify(n)),this.loading=!1,n.userId!==e.client.userId&&this.applyClientSidebarFilter(n.userId),(null===Velt||void 0===Velt?void 0:Velt.getUserRole$)&&Velt.getUserRole$().subscribe((t=>{t&&(this.loading=!1)})),this.subscribePlanAndDocumentMetadata(),th({clientUserId:n.userId}),nh(gt.Events.CLIENT_MODE_LOADED,{projectId:this.projectId,side:Ei(e.project),hasTitle:!!xi(e.project),requestsEnabled:ki(e.project)})}catch(t){this.loading=!1,this.signInError=!0,this.blockClientMode("sign-in failed"),console.warn("Error in identifyClient: ",t),oh("Error in identifyClient: ",t)}},this.applyClientModeToCommentElement=()=>{var t,e,i;try{if(!this.isClientRequestsMode()||!this.commentElement)return;"function"==typeof this.commentElement.setContextProvider&&this.commentElement.setContextProvider((()=>yi(window.location.href))),"function"==typeof this.commentElement.enablePrivateMode&&this.commentElement.enablePrivateMode({type:fe});const o=(null===(t=this.clientUser)||void 0===t?void 0:t.userId)||(null===(i=null===(e=this.clientGrant)||void 0===e?void 0:e.client)||void 0===i?void 0:i.userId);o&&this.applyClientSidebarFilter(o)}catch(t){console.warn("Error in applyClientModeToCommentElement: ",t),oh("Error in applyClientModeToCommentElement: ",t)}},this.applyClientSidebarFilter=t=>{try{if(!this.commentElement||!t)return;"function"==typeof this.commentElement.setCommentSidebarFilters&&this.commentElement.setCommentSidebarFilters(function(t){return{people:[{userId:t}]}}(t)),"function"==typeof this.commentElement.enableFilterCommentsOnDom&&this.commentElement.enableFilterCommentsOnDom()}catch(t){console.warn("Error in applyClientSidebarFilter: ",t),oh("Error in applyClientSidebarFilter: ",t)}},this.setupClientSidebarFilter=()=>{try{if(!this.commentElement||"function"!=typeof this.commentElement.on)return;this.commentElement.on("commentSidebarDataInit").subscribe((t=>{this.filterClientCommentsInSidebar(t)})),this.commentElement.on("commentSidebarDataUpdate").subscribe((t=>{this.filterClientCommentsInSidebar(t)}))}catch(t){console.warn("Error in setupClientSidebarFilter: ",t),oh("Error in setupClientSidebarFilter: ",t)}},this.filterClientCommentsInSidebar=t=>{var e,i,o;try{if(this.isSettingSidebarData||!t||!this.commentElement||this.sidebarV2Enabled)return;const n=(null===(e=this.clientUser)||void 0===e?void 0:e.userId)||(null===(o=null===(i=this.clientGrant)||void 0===i?void 0:i.client)||void 0===o?void 0:o.userId);if(!n||!Array.isArray(t.commentAnnotations))return;const r="/"+this.normalizePagePath(new URL(window.location.href).pathname),s=bi(t.commentAnnotations,n,r);this.isSettingSidebarData=!0,this.commentElement.setCommentSidebarData(s,{grouping:!0}),this.isSettingSidebarData=!1}catch(t){this.isSettingSidebarData=!1,console.warn("Error in filterClientCommentsInSidebar: ",t),oh("Error in filterClientCommentsInSidebar: ",t)}},this.trackClientRequestAdded=()=>{try{if(!this.isClientRequestsMode())return;nh(gt.Events.CLIENT_REQUEST_ADDED,{projectId:this.projectId})}catch(t){console.warn("Error in trackClientRequestAdded: ",t)}},this.notifyClientRequest=t=>{try{if(!this.isClientRequestsMode()||!this.clientSession)return;const e=wi(t);if(!e||this.notifiedClientRequests.has(e))return;this.notifiedClientRequests.add(e),this.sendClientNotify(e,"first")}catch(t){console.warn("Error in notifyClientRequest: ",t)}},this.sendClientNotify=(t,e)=>{try{const i=this.clientSession;if(!this.isClientRequestsMode()||!i)return;this.getClientSessionApi().notifyLiveRequest(i,t).then((i=>{var o;"ok"!==i.kind?"error"!==i.kind||"not-found"!==i.code||"first"!==e?"error"===i.kind?console.warn(`[superflow client mode] notifyLiveRequest refused (${i.code})`):console.warn("[superflow client mode] notifyLiveRequest could not reach the backend"):this.clientNotifyRetryTimer((()=>this.sendClientNotify(t,"retry")),zp.CLIENT_NOTIFY_RETRY_MS):i.result.notified||console.warn(`[superflow client mode] notifyLiveRequest: not sent (${null!==(o=i.result.reason)&&void 0!==o?o:"unknown"})`)})).catch((t=>{console.warn("Error in notifyLiveRequest: ",t)}))}catch(t){console.warn("Error in sendClientNotify: ",t)}},this.onClientSignInClick=()=>{try{try{nh(gt.Events.CLIENT_MODE_SIGN_IN_CLICKED,{projectId:this.projectId})}catch(t){console.warn("Error tracking clientModeSignInClicked: ",t)}if(Sd(Mt,"true",!1),this.customLoginEnabledLocally)return void this.reloadPage();this.loginWithGoogle()}catch(t){console.warn("Error in onClientSignInClick: ",t),oh("Error in onClientSignInClick: ",t)}},this.reloadPage=()=>{try{window.location.reload()}catch(t){console.warn("Error in reloadPage: ",t)}},this.onClientRequestsClick=()=>{var t,e,i;try{if(this.commentElement&&"function"==typeof this.commentElement.toggleCommentSidebar)return void this.commentElement.toggleCommentSidebar();const o=null===(e=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector)||void 0===e?void 0:e.call(t,"velt-sidebar-button");null===(i=(null==o?void 0:o.querySelector("button"))||o)||void 0===i||i.click()}catch(t){console.warn("Error in onClientRequestsClick: ",t),oh("Error in onClientRequestsClick: ",t)}},this.isRequestMode=()=>{try{return function(t){try{if(!t||!0!==t.maintenanceRequests)return!1;if(t.clientMode||t.embedMode||t.readOnlyMode||t.onboardingMode||t.passwordPending)return!1;const e=t.user;return!(!e||"object"!=typeof e||!0===e.isAnonymous||!0===e.isGuest)&&"string"==typeof t.role&&""!==t.role&&"Admin"!==t.role}catch(t){return console.warn("Error in decideRequestMode: ",t),!1}}({maintenanceRequests:this.maintenanceRequests,user:this.snippylyUser,role:this.snippylyUserRole,clientMode:this.clientMode,embedMode:this.embedMode,readOnlyMode:this.readOnlyMode,onboardingMode:this.onboardingMode,passwordPending:this.passwordProtected&&!this.isPasswordValid})}catch(t){return console.warn("Error in isRequestMode: ",t),!1}},this.syncRequestMode=()=>{try{const t=this.isRequestMode();if(t===this.requestModeApplied||!this.commentElement)return;this.requestModeApplied=t,t&&(this.applyRequestModeToCommentElement(),this.requestModeLoadedTracked||(this.requestModeLoadedTracked=!0,nh(gt.Events.REQUEST_MODE_LOADED,{projectId:this.projectId}))),this.lastCommentStatuses&&this.applyCommentStatuses(this.lastCommentStatuses)}catch(t){console.warn("Error in syncRequestMode: ",t),oh("Error in syncRequestMode: ",t)}},this.applyRequestModeToCommentElement=()=>{try{if(this.requestContextProviderSet||!this.commentElement||"function"!=typeof this.commentElement.setContextProvider)return;this.requestContextProviderSet=!0,this.commentElement.setContextProvider((()=>this.isRequestMode()?yi(window.location.href):void 0))}catch(t){console.warn("Error in applyRequestModeToCommentElement: ",t),oh("Error in applyRequestModeToCommentElement: ",t)}},this.onRequestModeCommentAdd=t=>{try{if(!this.isRequestMode())return;try{nh(gt.Events.REQUEST_ADDED,{projectId:this.projectId})}catch(t){console.warn("Error tracking requestAdded: ",t)}this.notifyAddedRequest(wi(t))}catch(t){console.warn("Error in onRequestModeCommentAdd: ",t)}},this.handleDocumentMetadataUpdate=async t=>{try{if(!t)return;const e=await lh(this.apiKey,null==t?void 0:t.clientDocumentId);Dd(e,this.isDriveOrPreviewHost(),this.projectIdSupplied)&&this.lockForDeletedProject(),this.setProjectConfigVariables("ok"===e.status?e.config:null),await this.fetchAndApplyFeatureAccess()}catch(t){console.warn("Error in handleDocumentMetadataUpdate: ",t),oh("Error in handleDocumentMetadataUpdate: ",t)}},this.lockForDeletedProject=()=>{this.projectDeleted=!0,this.applyVeltFeatureGates(),this.unmountVeltCollaborationElements()},this.fetchAndApplyFeatureAccess=async()=>{var t,e;try{const i=await Ch(this.apiKey);if("error"===i.status||!i.featureAccess)return void console.warn("getFeatureAccess failed or returned no data; keeping the last known feature access");this.featureAccess=i.featureAccess,this.planLimitLocked=(t=>{var e;try{return!0===(null===(e=null==t?void 0:t.planStatus)||void 0===e?void 0:e.isOverPlanLimits)}catch(t){return!1}})(this.featureAccess),this.applyVeltFeatureGates(),this.applyStorageFeatureAccess();const o=null===(t=this.featureAccess)||void 0===t?void 0:t[bh.Agents];this.hasAgentAccess=!0===(null==o?void 0:o.hasAccess);const n=null===(e=this.featureAccess)||void 0===e?void 0:e[bh.WorkspacePrivateComments];this.hasPrivateCommentsAccess=!0===(null==n?void 0:n.hasAccess),this.isPrivateCommentsEnabledOnWorkspace=!0===(null==n?void 0:n.isPrivateCommentsEnabled),!this.canShowPrivateCommentToggle&&this.privateCommentModeEnabled&&(this.disablePrivateCommentModeOnCommentElement(),this.privateCommentModeEnabled=!1,Sd(ge,"false")),this.maybeApplyVisibilityOptionsToCommentElement()}catch(t){console.warn("Error in fetchAndApplyFeatureAccess: ",t),oh("Error in fetchAndApplyFeatureAccess: ",t)}},this.insertShadowDOM=()=>{try{if(document.querySelector("velt-wireframe"))return;const t=document.querySelector("velt-comments");t&&t.setAttribute("shadow-dom","true");const e=document.querySelector(`${Ne.VELT_COMMENTS_SIDEBAR_LEGACY}, ${Ne.VELT_COMMENTS_SIDEBAR_V2}`);e&&e.setAttribute("shadow-dom","true")}catch(t){console.warn("Error in insertShadowDOM: ",t),oh("Error in insertShadowDOM: ",t)}},this.applyStorageFeatureAccess=()=>{try{if(!this.featureAccess||!this.commentElement)return;const t=this.featureAccess[bh.Storage];(null==t?void 0:t.hasUsageExhausted)&&(this.commentElement.disableAttachments(),this.commentElement.setRecordings("none"))}catch(t){oh("Error in applyStorageFeatureAccess: ",t)}},this.checkToMigrateGuestUser=async(t,e)=>{try{const i=Od(!1,this.apiKey);if(i){const o=`${ee}:${i.userId}`,n=Md(o,!1,"sessionStorage");if("with-credential"===n||"without-credential"===n&&!e)return;const r=await vh(this.apiKey,this.projectId||"",i,t,!0,e);if(!1===(null==r?void 0:r.success))return console.warn("[CWS Toolbar] Guest migration refused; keeping the guest user:",null==r?void 0:r.reason),void Sd(o,e?"with-credential":"without-credential",!1,"sessionStorage");Ad(o,"sessionStorage"),Ad(te)}}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),oh("Error in checkToMigrationGuestUser: ",t)}},this.getComments=()=>{try{this.commentElement&&this.commentSubscription&&this.commentSubscription.unsubscribe()}catch(t){console.warn("Error in getComments: ",t),oh("Error in getComments: ",t)}},this.handleCommentSelection=t=>{var e,i,o,n,r,s,a,l,c,d,h;try{if(!1===(null==t?void 0:t.selected))return void(null===(e=null===Velt||void 0===Velt?void 0:Velt.setUiState)||void 0===e||e.call(Velt,{showButtons:!1}));const u=null==t?void 0:t.annotation;if(!u||!this.isAgentAnnotation(u))return void(null===(i=null===Velt||void 0===Velt?void 0:Velt.setUiState)||void 0===i||i.call(Velt,{showButtons:!1}));const p=this.resolveFullAnnotation(u);if(wu(p))return void(null===(o=null===Velt||void 0===Velt?void 0:Velt.setUiState)||void 0===o||o.call(Velt,{showButtons:yu(p).length>1,warningType:"site"}));const v=null===(r=null===(n=null==u?void 0:u.agent)||void 0===n?void 0:n.result)||void 0===r?void 0:r.incorrectWord,g=(null===(s=null==u?void 0:u.pageInfo)||void 0===s?void 0:s.path)||(null===(a=null==u?void 0:u.location)||void 0===a?void 0:a.path)||(null===(l=null==u?void 0:u.agent)||void 0===l?void 0:l.path);if(!v||!g)return void(null===(c=null===Velt||void 0===Velt?void 0:Velt.setUiState)||void 0===c||c.call(Velt,{showButtons:!1}));const f=this.normalizePagePath(g),m=v,w=null===(h=null===(d=null==u?void 0:u.agent)||void 0===d?void 0:d.result)||void 0===h?void 0:h.type;let y,b="";"grammar"===w?(y=this.grammarSuggestionPagePathMap,b="grammar"):(y=this.spellingSuggestionPagePathMap,b="spelling");const C=null==y?void 0:y.get(m);((null==C?void 0:C.get(f))||0)<=1?Velt.setUiState({showButtons:!1,warningType:b}):Velt.setUiState({showButtons:!0,warningType:b})}catch(t){console.warn("Error in handleCommentSelection: ",t),oh("Error in handleCommentSelection: ",t)}},this.processAgentComments=t=>{var e,i,o;try{const n=Array.isArray(t)?t:[];this.trackAgentPins(n),n.length&&!this.agentNamesFetched&&this.apiKey&&this.fetchAgentNames();const r=n.filter((t=>this.isAgentAnnotation(t)&&!vu(t)));if(this.sidebarV2Enabled&&!this.showAgentCommentsInSidebar&&0===r.length&&this.agentGroups.length>0){const t=new Set(this.agentGroups.flatMap((t=>{var e;return null!==(e=null==t?void 0:t.annotations)&&void 0!==e?e:[]})).map(ru));for(const e of n){const i=ru(e);i&&t.has(i)&&vu(e)&&this.removeAnnotationFromWarnings(i)}return}if(0===r.length)return this.hasContentWarnings=!1,this.contentWarningsCount=0,this.agentGroups=[],this.spellingSuggestionPagePathMap=new Map,void(this.grammarSuggestionPagePathMap=new Map);const s=new Map;for(const t of r){const i=this.extractAgentId((null===(e=null==t?void 0:t.agent)||void 0===e?void 0:e.agentFields)||[]);if(!i)continue;const o=s.get(i);o?o.push(t):s.set(i,[t])}const a=[],l=new Map,c=new Map;for(const[t,e]of s){const n=this.isCustomAgent((null===(o=null===(i=e[0])||void 0===i?void 0:i.agent)||void 0===o?void 0:o.agentFields)||[]),r=this.resolveAgentGroupName(t,e),{warnings:s,warningCount:d}=this.buildAgentWarnings(t,e,l,c);a.push({agentId:t,agentName:r,isCustom:n,warningCount:d,warnings:s,annotations:e})}if(a.sort(((t,e)=>e.warningCount-t.warningCount)),this.agentGroups=a,this.onboardingMode)for(const t of a)this.onboardingOpenedAgentIds.add(t.agentId);const d=a.reduce(((t,e)=>t+e.warningCount),0);this.contentWarningsCount=d,this.hasContentWarnings=d>0,this.spellingSuggestionPagePathMap=l,this.grammarSuggestionPagePathMap=c}catch(t){console.warn("Error in processAgentComments: ",t),oh("Error in processAgentComments: ",t)}},this.extractAgentId=t=>{try{if(!Array.isArray(t)||0===t.length)return null;for(const e of t)if(null==e?void 0:e.startsWith(_e.AGENT))return e.substring(_e.AGENT.length);return null}catch(t){return console.warn("Error in extractAgentId: ",t),null}},this.isCustomAgent=t=>{try{return!!Array.isArray(t)&&t.includes(_e.AGENT_TYPE_CUSTOM)}catch(t){return console.warn("Error in isCustomAgent: ",t),!1}},this.resolveAgentGroupName=(t,e)=>{var i;try{return yp(null===(i=this.agentNameMap)||void 0===i?void 0:i.get(t),e)||this.getAgentNameFromId(t)}catch(e){return console.warn("Error in resolveAgentGroupName: ",e),oh("Error in resolveAgentGroupName: ",e),this.getAgentNameFromId(t)}},this.resolveAgentDisplayName=t=>{var e,i;try{return null!==(i=null===(e=this.agentNameMap)||void 0===e?void 0:e.get(t))&&void 0!==i?i:this.getAgentNameFromId(t)}catch(t){return console.warn("Error in resolveAgentDisplayName: ",t),Bt}},this.getAgentNameFromId=t=>{try{return t&&/^[a-z]+(-[a-z]+)*$/.test(t)?t.split("-").map((t=>`${t.charAt(0).toUpperCase()}${t.slice(1)}`)).join(" "):Bt}catch(t){return console.warn("Error in getAgentNameFromId: ",t),Bt}},this.fetchAgentNames=async()=>{var t,e,i;try{this.agentNamesFetched=!0;const{getAgents:o}=await Promise.resolve().then((function(){return Ah})),n=await o(this.apiKey),r=new Map;for(const i of n){const o=null!==(t=null==i?void 0:i.id)&&void 0!==t?t:"",n=null!==(e=null==i?void 0:i.name)&&void 0!==e?e:"";o&&n&&r.set(o,n)}if(this.agentNameMap=r,(null===(i=this.agentGroups)||void 0===i?void 0:i.length)>0){const t=this.agentGroups.map((t=>({...t,agentName:this.resolveAgentGroupName(t.agentId,t.annotations)})));this.agentGroups=t}}catch(t){this.agentNamesFetched=!1,console.warn("Error in fetchAgentNames: ",t)}},this.sanitiseAgentRunStatusRows=t=>{try{const e=[],i=Array.isArray(t)?t.slice(0,50):[];for(const t of i){const i=null==t?void 0:t.agentId;if("string"!=typeof i||0===i.length)continue;const o=("string"==typeof(null==t?void 0:t.name)&&t.name.length>0?t.name:this.resolveAgentDisplayName(i)).slice(0,80),n="string"==typeof(null==t?void 0:t.status)&&jt.includes(t.status),r=!0!==(null==t?void 0:t.terminal)&&!n,s=null==t?void 0:t.findings,a="number"==typeof s&&Number.isFinite(s)&&s>=0?Math.floor(s):0;e.push(n?{agentId:i,agentName:o,isRunning:r,findingsCount:a,failed:!0}:{agentId:i,agentName:o,isRunning:r,findingsCount:a})}return e}catch(t){return console.warn("Error in sanitiseAgentRunStatusRows: ",t),oh("Error in sanitiseAgentRunStatusRows: ",t),[]}},this.getPortalOrigins=()=>{try{if(this.portalOrigins)return this.portalOrigins;const t=new Set;for(const e of[Ke,Je])try{const{origin:i,hostname:o,protocol:n}=new URL(e);t.add(i),o.endsWith(".firebaseapp.com")?t.add(`${n}//${o.replace(/\.firebaseapp\.com$/,".web.app")}`):o.endsWith(".web.app")&&t.add(`${n}//${o.replace(/\.web\.app$/,".firebaseapp.com")}`)}catch{}return this.portalOrigins=[...t],this.portalOrigins}catch(t){return console.warn("Error in getPortalOrigins: ",t),oh("Error in getPortalOrigins: ",t),[]}},this.isAllowedPortalOrigin=t=>{try{if("string"!=typeof t||0===t.length||"null"===t)return!1;if(this.getPortalOrigins().includes(t))return!0;const{protocol:e,hostname:i}=new URL(t);return!("http:"!==e&&"https:"!==e||"localhost"!==i&&"127.0.0.1"!==i)}catch{return!1}},this.readAncestorOrigins=()=>{var t;try{const e=null===(t=window.location)||void 0===t?void 0:t.ancestorOrigins;return e?Array.from(e):null}catch{return null}},this.readDocumentReferrer=()=>{try{return document.referrer||""}catch{return""}},this.getParentFrameOrigin=()=>{try{if(!window.parent||window.parent===window)return null;const t=this.readAncestorOrigins();if(t)return t[0]||null;const e=this.readDocumentReferrer();return e?new URL(e).origin:null}catch{return null}},this.isFramedByPortal=()=>{try{return this.isAllowedPortalOrigin(this.getParentFrameOrigin())}catch(t){return console.warn("Error in isFramedByPortal: ",t),oh("Error in isFramedByPortal: ",t),!1}},this.canHonourStoredOnboardingFlag=()=>{try{if(!window.parent||window.parent===window)return!1;const t=this.readAncestorOrigins();return!t||this.isAllowedPortalOrigin(t[0])}catch(t){return console.warn("Error in canHonourStoredOnboardingFlag: ",t),oh("Error in canHonourStoredOnboardingFlag: ",t),!1}},this.getPortalTargetOrigin=()=>{try{const t=this.getParentFrameOrigin();return t&&this.isAllowedPortalOrigin(t)?t:"*"}catch{return"*"}},this.startAgentRunStatusListener=()=>{try{if(!this.onboardingMode||!this.isConnected)return void this.stopAgentRunStatusListener();if(this.agentRunStatusListening)return;if(!window.parent||window.parent===window)return void(this.agentRunStatusSettled=!0);if(window.addEventListener("message",this.onAgentRunStatusMessage),this.agentRunStatusListening=!0,this.startOnboardingViewportListener(),window.parent.postMessage({type:Rt},this.getPortalTargetOrigin()),this.agentRunStatusSettled){if(this.agentRunStatuses.some((t=>null==t?void 0:t.isRunning))){const t=this.agentRunStatusLastMessageAt>0?Date.now()-this.agentRunStatusLastMessageAt:0;this.armAgentRunStatusWatchdog(Math.max(0,Pt-t))}}else this.armAgentRunStatusWatchdog(2e4);this.ensureOnboardingFindingsLoaded()}catch(t){console.warn("Error in startAgentRunStatusListener: ",t),oh("Error in startAgentRunStatusListener: ",t)}},this.stopAgentRunStatusListener=()=>{try{window.removeEventListener("message",this.onAgentRunStatusMessage),this.agentRunStatusListening=!1,this.clearAgentRunStatusWatchdog(),this.clearOnboardingFindingsFetch(),this.stopOnboardingViewportListener()}catch(t){console.warn("Error in stopAgentRunStatusListener: ",t),oh("Error in stopAgentRunStatusListener: ",t)}},this.onAgentRunStatusMessage=t=>{try{if(!this.onboardingMode)return;if(!window.parent||window.parent===window||(null==t?void 0:t.source)!==window.parent)return;if(!this.isAllowedPortalOrigin(null==t?void 0:t.origin))return;const e=null==t?void 0:t.data;if((null==e?void 0:e.type)===Dt)return void this.postOnboardingDiagnostics(t.origin);if((null==e?void 0:e.type)!==Lt||!Array.isArray(null==e?void 0:e.agents))return;this.agentRunStatuses=this.sanitiseAgentRunStatusRows(e.agents),this.agentRunStatusTimedOut=!1,this.agentRunStatusLastMessageAt=Date.now();const i=!0===(null==e?void 0:e.allTerminal);(this.agentRunStatuses.length>0||i)&&(this.agentRunStatusSettled=!0);this.agentRunStatuses.some((t=>null==t?void 0:t.isRunning))?this.armAgentRunStatusWatchdog(Pt):this.agentRunStatusSettled&&this.clearAgentRunStatusWatchdog(),this.ensureOnboardingFindingsLoaded()}catch(t){console.warn("Error in onAgentRunStatusMessage: ",t),oh("Error in onAgentRunStatusMessage: ",t)}},this.postOnboardingDiagnostics=t=>{var e,i,o,n,r,s;try{if(!this.onboardingMode||!window.parent||window.parent===window||!this.isAllowedPortalOrigin(t))return;const a=(null!==(e=this.lastStreamAnnotations)&&void 0!==e?e:[]).filter((t=>this.isAgentAnnotation(t))).length;window.parent.postMessage({type:Ft,at:(new Date).toISOString(),version:ft,identity:{hasUser:!!this.snippylyUser,isGuest:!!(null===(i=this.snippylyUser)||void 0===i?void 0:i.isGuest),isAnonymous:!!(null===(o=this.snippylyUser)||void 0===o?void 0:o.isAnonymous),hasRole:!!this.snippylyUserRole,loading:this.loading},sdk:{hasCommentElement:!!this.commentElement,hasDocumentId:!!this.documentId,hasLocationPath:!!this.previewLocationPath,sidebarV2:this.sidebarV2Enabled,showAgentCommentsInSidebar:this.showAgentCommentsInSidebar,agentCommentsModeRequested:this.agentCommentsModeRequested,privateCommentsEnabled:this.isPrivateCommentsEnabledOnWorkspace,hasPrivateCommentsAccess:this.hasPrivateCommentsAccess},stream:{emissions:this.streamEmissionCount,lastEmissionAt:this.lastStreamEmissionAt?new Date(this.lastStreamEmissionAt).toISOString():null,lastSize:(null!==(n=this.lastStreamAnnotations)&&void 0!==n?n:[]).length,agentAnnotations:a},fetch:{attempts:this.onboardingFindingsFetchAttempts,inFlight:this.onboardingFindingsFetchInFlight,pending:null!==this.onboardingFindingsFetchTimer,lastCount:this.onboardingLastFetchCount,lastError:this.onboardingLastFetchError,fetchedAt:this.onboardingFetchedAt?new Date(this.onboardingFetchedAt).toISOString():null,unsynced:this.onboardingUnsyncedAnnotationIds.length},groups:(null!==(r=this.agentGroups)&&void 0!==r?r:[]).map((t=>({agentId:null==t?void 0:t.agentId,count:null==t?void 0:t.warningCount}))),statuses:(null!==(s=this.agentRunStatuses)&&void 0!==s?s:[]).map((t=>({agentId:null==t?void 0:t.agentId,isRunning:null==t?void 0:t.isRunning,findingsCount:null==t?void 0:t.findingsCount,failed:!!(null==t?void 0:t.failed),timedOut:!!(null==t?void 0:t.timedOut)}))),missing:this.getAgentIdsMissingFindings(),sidebarOpen:this.showContentWarningSidebar,settled:this.agentRunStatusSettled},t)}catch(t){console.warn("Error in postOnboardingDiagnostics: ",t),oh("Error in postOnboardingDiagnostics: ",t)}},this.isOnboardingAgentResolved=t=>{try{return this.onboardingOpenedAgentIds.has(t)||this.onboardingFetchResolvedAgentIds.has(t)}catch(t){return console.warn("Error in isOnboardingAgentResolved: ",t),!1}},this.getAgentIdsMissingFindings=()=>{var t,e;try{const i=new Set((null!==(t=this.agentGroups)&&void 0!==t?t:[]).map((t=>null==t?void 0:t.agentId)));return(null!==(e=this.agentRunStatuses)&&void 0!==e?e:[]).filter((t=>{var e;return!(null==t?void 0:t.isRunning)&&(null!==(e=null==t?void 0:t.findingsCount)&&void 0!==e?e:0)>0})).map((t=>null==t?void 0:t.agentId)).filter((t=>!!t&&!i.has(t)&&!this.isOnboardingAgentResolved(t)))}catch(t){return console.warn("Error in getAgentIdsMissingFindings: ",t),oh("Error in getAgentIdsMissingFindings: ",t),[]}},this.getFetchableMissingAgentIds=()=>{try{return this.onboardingFindingsFetchAttempts>=30?[]:this.getAgentIdsMissingFindings().filter((t=>{var e;return(null!==(e=this.onboardingFetchAttemptsByAgent.get(t))&&void 0!==e?e:0)<10}))}catch(t){return console.warn("Error in getFetchableMissingAgentIds: ",t),oh("Error in getFetchableMissingAgentIds: ",t),[]}},this.isOnboardingFindingsLoadExhausted=t=>{var e;try{return null===this.onboardingFindingsFetchTimer&&!this.onboardingFindingsFetchInFlight&&((null!==(e=this.onboardingFetchAttemptsByAgent.get(t))&&void 0!==e?e:0)>=10||this.onboardingFindingsFetchAttempts>=30)}catch(t){return console.warn("Error in isOnboardingFindingsLoadExhausted: ",t),!1}},this.getDisplayAgentRunStatuses=()=>{var t,e;try{if(!this.onboardingMode)return this.agentRunStatuses;const i=new Set((null!==(t=this.agentGroups)&&void 0!==t?t:[]).map((t=>null==t?void 0:t.agentId)));return(null!==(e=this.agentRunStatuses)&&void 0!==e?e:[]).map((t=>{var e;return(null==t?void 0:t.isRunning)||0===(null!==(e=null==t?void 0:t.findingsCount)&&void 0!==e?e:0)||i.has(null==t?void 0:t.agentId)?t:this.isOnboardingAgentResolved(t.agentId)?{...t,findingsResolved:!0}:this.isOnboardingFindingsLoadExhausted(t.agentId)?{...t,findingsUnavailable:!0}:t}))}catch(t){return console.warn("Error in getDisplayAgentRunStatuses: ",t),oh("Error in getDisplayAgentRunStatuses: ",t),this.agentRunStatuses}},this.ensureOnboardingFindingsLoaded=()=>{try{if(!this.onboardingMode||!this.agentRunStatusListening)return;if(null!==this.onboardingFindingsFetchTimer||this.onboardingFindingsFetchInFlight)return;if(0===this.getFetchableMissingAgentIds().length)return;this.onboardingFindingsFetchTimer=setTimeout((()=>this.fetchOnboardingFindings()),3e3)}catch(t){console.warn("Error in ensureOnboardingFindingsLoaded: ",t),oh("Error in ensureOnboardingFindingsLoaded: ",t)}},this.clearOnboardingFindingsFetch=()=>{try{null!==this.onboardingFindingsFetchTimer&&(clearTimeout(this.onboardingFindingsFetchTimer),this.onboardingFindingsFetchTimer=null)}catch(t){console.warn("Error in clearOnboardingFindingsFetch: ",t),oh("Error in clearOnboardingFindingsFetch: ",t)}},this.countOnboardingFetchAttempt=t=>{var e;this.onboardingFindingsFetchAttempts+=1;for(const i of t)this.onboardingFetchAttemptsByAgent.set(i,(null!==(e=this.onboardingFetchAttemptsByAgent.get(i))&&void 0!==e?e:0)+1)},this.fetchOnboardingFindings=async()=>{var t;try{if(this.onboardingFindingsFetchTimer=null,!this.onboardingMode)return;const e=this.getFetchableMissingAgentIds();if(0===e.length)return;if(this.countOnboardingFetchAttempt(e),"function"!=typeof(null===(t=this.commentElement)||void 0===t?void 0:t.fetchCommentAnnotations)||!this.documentId)return this.onboardingLastFetchError=Vt.SDK_NOT_READY,this.ensureOnboardingFindingsLoaded(),void this.requestUpdate();this.onboardingFindingsFetchInFlight=!0;const i=await this.commentElement.fetchCommentAnnotations({documentIds:[`${this.documentId}`]});if(this.onboardingFindingsFetchInFlight=!1,!this.onboardingMode)return;if(null===(null==i?void 0:i.data)||void 0===(null==i?void 0:i.data))this.onboardingLastFetchCount=0,this.onboardingLastFetchError=Vt.SDK_RETURNED_NULL;else{const t=this.flattenFetchedAnnotations(i);this.onboardingLastFetchCount=t.length,this.onboardingLastFetchError="",this.applyOnboardingFetchResult(t)}this.ensureOnboardingFindingsLoaded(),this.requestUpdate()}catch(t){this.onboardingFindingsFetchInFlight=!1,this.onboardingLastFetchError=Vt.FETCH_THREW,console.warn("Error in fetchOnboardingFindings: ",t),oh("Error in fetchOnboardingFindings: ",t),this.ensureOnboardingFindingsLoaded(),this.requestUpdate()}},this.applyOnboardingFetchResult=t=>{var e,i;try{const o=(Array.isArray(t)?t:[]).filter((t=>{const e=null==t?void 0:t.annotationId;return!!e&&!this.onboardingRemovedAnnotationIds.has(e)&&this.isAgentAnnotation(t)})),n=new Map;for(const t of o){const o=this.extractAgentId((null===(e=null==t?void 0:t.agent)||void 0===e?void 0:e.agentFields)||[]);if(!o)continue;const r=!vu(t);n.set(o,null!==(i=n.get(o))&&void 0!==i&&i||r)}for(const[t,e]of n)e?this.onboardingFetchResolvedAgentIds.delete(t):this.onboardingFetchResolvedAgentIds.add(t);this.onboardingFetchedAnnotations=o,this.onboardingFetchedAt=Date.now(),this.processAgentComments(this.mergeOnboardingFetchedAnnotations(this.lastStreamAnnotations))}catch(t){console.warn("Error in applyOnboardingFetchResult: ",t),oh("Error in applyOnboardingFetchResult: ",t)}},this.flattenFetchedAnnotations=t=>{try{const e=null==t?void 0:t.data;if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];const i=[];for(const t of Object.values(e))Array.isArray(t)&&i.push(...t);return i}catch(t){return console.warn("Error in flattenFetchedAnnotations: ",t),oh("Error in flattenFetchedAnnotations: ",t),[]}},this.mergeOnboardingFetchedAnnotations=t=>{var e;try{const i=Array.isArray(t)?t:[];if(!this.onboardingMode)return i;if(0===this.onboardingFetchedAnnotations.length)return this.setOnboardingUnsyncedAnnotationIds([]),i;const o=new Set(i.map((t=>null==t?void 0:t.annotationId)));if(this.sidebarV2Enabled&&!this.showAgentCommentsInSidebar){const t=new Map,n=(null!==(e=this.agentGroups)&&void 0!==e?e:[]).flatMap((t=>{var e;return null!==(e=null==t?void 0:t.annotations)&&void 0!==e?e:[]}));for(const e of[...n,...this.onboardingFetchedAnnotations]){const i=null==e?void 0:e.annotationId;!i||o.has(i)||t.has(i)||this.onboardingRemovedAnnotationIds.has(i)||t.set(i,e)}return t.size>0?[...i,...t.values()]:i}return this.onboardingFetchedAnnotations=this.onboardingFetchedAnnotations.filter((t=>{const e=null==t?void 0:t.annotationId;return!!e&&!o.has(e)&&!this.onboardingRemovedAnnotationIds.has(e)})),this.setOnboardingUnsyncedAnnotationIds(this.onboardingFetchedAnnotations.map((t=>t.annotationId))),this.onboardingFetchedAnnotations.length>0?[...i,...this.onboardingFetchedAnnotations]:i}catch(e){return console.warn("Error in mergeOnboardingFetchedAnnotations: ",e),oh("Error in mergeOnboardingFetchedAnnotations: ",e),Array.isArray(t)?t:[]}},this.setOnboardingUnsyncedAnnotationIds=t=>{try{const e=[...t].sort();e.join("\n")!==this.onboardingUnsyncedAnnotationIds.join("\n")&&(this.onboardingUnsyncedAnnotationIds=e)}catch(t){console.warn("Error in setOnboardingUnsyncedAnnotationIds: ",t)}},this.armAgentRunStatusWatchdog=t=>{try{this.clearAgentRunStatusWatchdog(),this.agentRunStatusWatchdogTimer=setTimeout((()=>this.applyAgentRunStatusTimeout()),t)}catch(t){console.warn("Error in armAgentRunStatusWatchdog: ",t),oh("Error in armAgentRunStatusWatchdog: ",t)}},this.clearAgentRunStatusWatchdog=()=>{try{null!==this.agentRunStatusWatchdogTimer&&(clearTimeout(this.agentRunStatusWatchdogTimer),this.agentRunStatusWatchdogTimer=null)}catch(t){console.warn("Error in clearAgentRunStatusWatchdog: ",t),oh("Error in clearAgentRunStatusWatchdog: ",t)}},this.applyAgentRunStatusTimeout=()=>{try{this.agentRunStatusWatchdogTimer=null,this.agentRunStatuses.some((t=>null==t?void 0:t.isRunning))&&(this.agentRunStatuses=this.agentRunStatuses.map((t=>(null==t?void 0:t.isRunning)?{...t,isRunning:!1,timedOut:!0}:t)),this.agentRunStatusTimedOut=!0),this.agentRunStatusSettled=!0}catch(t){console.warn("Error in applyAgentRunStatusTimeout: ",t),oh("Error in applyAgentRunStatusTimeout: ",t)}},this.startOnboardingViewportListener=()=>{try{if(this.onboardingViewportListening)return;window.addEventListener("resize",this.scheduleOnboardingViewportClamp),this.onboardingViewportListening=!0}catch(t){console.warn("Error in startOnboardingViewportListener: ",t),oh("Error in startOnboardingViewportListener: ",t)}},this.stopOnboardingViewportListener=()=>{var t;try{window.removeEventListener("resize",this.scheduleOnboardingViewportClamp),this.onboardingViewportListening=!1,null===(t=this.onboardingPanelResizeObserver)||void 0===t||t.disconnect(),this.onboardingPanelResizeObserver=null,this.onboardingObservedPanel=null,null!==this.onboardingClampFrame&&(cancelAnimationFrame(this.onboardingClampFrame),this.onboardingClampFrame=null)}catch(t){console.warn("Error in stopOnboardingViewportListener: ",t),oh("Error in stopOnboardingViewportListener: ",t)}},this.observeOnboardingPanel=()=>{var t,e,i;try{if(!this.agentRunStatusListening||"undefined"==typeof ResizeObserver)return;const o=null!==(e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".onboarding-container content-warning-sidebar"))&&void 0!==e?e:null;if(o===this.onboardingObservedPanel)return;if(null===(i=this.onboardingPanelResizeObserver)||void 0===i||i.disconnect(),this.onboardingObservedPanel=o,!o)return;this.onboardingPanelResizeObserver||(this.onboardingPanelResizeObserver=new ResizeObserver((()=>this.scheduleOnboardingViewportClamp()))),this.onboardingPanelResizeObserver.observe(o)}catch(t){console.warn("Error in observeOnboardingPanel: ",t),oh("Error in observeOnboardingPanel: ",t)}},this.scheduleOnboardingViewportClamp=()=>{try{if(!this.onboardingMode||null!==this.onboardingClampFrame)return;this.onboardingClampFrame=requestAnimationFrame((()=>{this.onboardingClampFrame=null,this.clampOnboardingPanelToViewport()}))}catch(t){console.warn("Error in scheduleOnboardingViewportClamp: ",t),oh("Error in scheduleOnboardingViewportClamp: ",t)}},this.getOnboardingViewportClampOffset=(t,e,i)=>{let o=0,n=0;return t.right>e-8&&(o=e-8-t.right),t.left+o<8&&(o=8-t.left),t.bottom>i-8&&(n=i-8-t.bottom),t.top+n<8&&(n=8-t.top),{dx:o,dy:n}},this.readTranslate=t=>{var e;try{const i=window.getComputedStyle(t).transform;if(!i||"none"===i)return{x:0,y:0};const o=new(null!==(e=window.DOMMatrixReadOnly)&&void 0!==e?e:window.WebKitCSSMatrix)(i);return{x:Number(o.m41)||0,y:Number(o.m42)||0}}catch{return{x:0,y:0}}},this.clampOnboardingPanelToViewport=t=>{var e;try{const i=null!=t?t:null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".snippyly-plugin-container.onboarding-container");if(!i)return;const o=[i.getBoundingClientRect()],n=i.querySelector("content-warning-sidebar");n&&o.push(n.getBoundingClientRect());const r=o.filter((t=>t.width>0||t.height>0));if(0===r.length)return;const s={left:Math.min(...r.map((t=>t.left))),top:Math.min(...r.map((t=>t.top))),right:Math.max(...r.map((t=>t.right))),bottom:Math.max(...r.map((t=>t.bottom)))},{dx:a,dy:l}=this.getOnboardingViewportClampOffset(s,window.innerWidth,window.innerHeight);if(Math.abs(a)<.5&&Math.abs(l)<.5)return;const{x:c,y:d}=this.readTranslate(i);i.style.transform=`translate(${Math.round(c+a)}px, ${Math.round(d+l)}px)`}catch(t){console.warn("Error in clampOnboardingPanelToViewport: ",t),oh("Error in clampOnboardingPanelToViewport: ",t)}},this.buildAgentWarnings=(t,e,i,o)=>{try{return t===$e.BROKEN_LINKS?this.buildBrokenLinkWarnings(e):t===$e.SPELL_CHECK||t===$e.GRAMMAR_CHECK?this.buildSpellCheckWarnings(e,i,o):this.buildGenericWarnings(e)}catch(t){return console.warn("Error in buildAgentWarnings: ",t),{warnings:[],warningCount:0}}},this.buildBrokenLinkWarnings=t=>{var e,i,o,n,r,s,a,l,c,d,h,u,p;try{const v=new Map;for(const g of t){const t=(null===(e=null==g?void 0:g.pageInfo)||void 0===e?void 0:e.url)||(null===(i=null==g?void 0:g.location)||void 0===i?void 0:i.url)||(null===(o=null==g?void 0:g.agent)||void 0===o?void 0:o.url)||"",f=(null===(n=null==g?void 0:g.agent)||void 0===n?void 0:n.reason)||{},m=f.url||(null===(r=null==g?void 0:g.targetTextRange)||void 0===r?void 0:r.text)||(null===(a=null===(s=null==g?void 0:g.agent)||void 0===s?void 0:s.result)||void 0===a?void 0:a.url)||(null===(c=null===(l=null==g?void 0:g.agent)||void 0===l?void 0:l.result)||void 0===c?void 0:c.link)||t,w=f.issue||f.description||(null===(h=null===(d=null==g?void 0:g.agent)||void 0===d?void 0:d.result)||void 0===h?void 0:h.statusCode)||(null===(p=null===(u=null==g?void 0:g.agent)||void 0===u?void 0:u.result)||void 0===p?void 0:p.status)||"",y=(null==m?void 0:m.toLowerCase())||"",b=mu(g)?bu(g):void 0;if(v.has(y)){const e=v.get(y);e.occurrences+=1,t&&!e.pageUrls.includes(t)&&e.pageUrls.push(t),e.annotations.push(g),b&&(e.severity=Ou(e.severity,b))}else v.set(y,{primaryText:m||"",secondaryText:String(w),occurrences:1,pageUrls:t?[t]:[],annotations:[g],...b?{severity:b}:{}})}const g=Array.from(v.values());return{warnings:g,warningCount:g.length}}catch(t){return console.warn("Error in buildBrokenLinkWarnings: ",t),{warnings:[],warningCount:0}}},this.buildSpellCheckWarnings=(t,e,i)=>{var o,n,r,s,a,l,c,d,h,u,p,v,g,f,m,w,y,b,C;try{const x=new Map;for(const E of t){const t=(null===(o=null==E?void 0:E.pageInfo)||void 0===o?void 0:o.url)||(null===(n=null==E?void 0:E.location)||void 0===n?void 0:n.url)||(null===(r=null==E?void 0:E.agent)||void 0===r?void 0:r.url)||"",k=(null===(s=null==E?void 0:E.pageInfo)||void 0===s?void 0:s.path)||(null===(a=null==E?void 0:E.location)||void 0===a?void 0:a.path)||(null===(l=null==E?void 0:E.agent)||void 0===l?void 0:l.path)||"",S=this.normalizePagePath(k),M=null!==(d=null!==(c=null==E?void 0:E.comments)&&void 0!==c?c:null==E?void 0:E.commentData)&&void 0!==d?d:[],A=null!==(p=null===(u=null===(h=null==M?void 0:M[0])||void 0===h?void 0:h.commentText)||void 0===u?void 0:u.trim())&&void 0!==p?p:"",T=(null===(g=null===(v=null==E?void 0:E.agent)||void 0===v?void 0:v.result)||void 0===g?void 0:g.incorrectWord)||(null===(f=null==E?void 0:E.targetElement)||void 0===f?void 0:f.targetText)||A||"",I=(null===(w=null===(m=null==E?void 0:E.agent)||void 0===m?void 0:m.result)||void 0===w?void 0:w.suggestions)||[],_=Array.isArray(I)?I[0]||"":I||"",$=null===(b=null===(y=null==E?void 0:E.agent)||void 0===y?void 0:y.result)||void 0===b?void 0:b.type,N=T||"";T||console.warn("[CWS] Spell check annotation missing incorrectWord. agent.result:",null===(C=null==E?void 0:E.agent)||void 0===C?void 0:C.result,"targetElement:",null==E?void 0:E.targetElement,"comments:",M);const O="grammar"===$?i:e;O.has(N)||O.set(N,new Map);const L=O.get(N),R=L.get(S)||0;L.set(S,R+1);const D=mu(E)?bu(E):void 0;if(x.has(N)){const e=x.get(N);e.occurrences+=1,t&&!e.pageUrls.includes(t)&&e.pageUrls.push(t),e.annotations.push(E),D&&(e.severity=Ou(e.severity,D))}else x.set(N,{primaryText:T||"",secondaryText:_||"",occurrences:1,pageUrls:t?[t]:[],annotations:[E],...D?{severity:D}:{}})}const E=Array.from(x.values());return{warnings:E,warningCount:E.length}}catch(t){return console.warn("Error in buildSpellCheckWarnings: ",t),{warnings:[],warningCount:0}}},this.splitFindingHeading=t=>{var e;try{if("string"!=typeof t||!t.trim())return null;const i=document.createElement("template");i.innerHTML=t;const o=Array.from(i.content.childNodes).filter((t=>{var e;return!(t.nodeType===Node.TEXT_NODE&&!(null===(e=t.textContent)||void 0===e?void 0:e.trim()))})),n=o[0];if(!n||!["B","STRONG"].includes(n.nodeName))return null;const r=(null===(e=n.textContent)||void 0===e?void 0:e.replace(/\s+/g," ").trim())||"";if(!r)return null;let s="";for(const t of o.slice(1))s+="BR"===t.nodeName?"\n":t.textContent||"";return{title:r,detail:s.split("\n").map((t=>t.replace(/\s+/g," ").trim())).find(Boolean)||""}}catch(t){return console.warn("Error in splitFindingHeading: ",t),null}},this.buildFindingSubItems=t=>{try{return(Array.isArray(null==t?void 0:t.missing)?t.missing:[]).map((t=>{const e="string"==typeof(null==t?void 0:t.text)?t.text.replace(/\s+/g," ").trim():"";if(!e)return null;const i="heading"===(null==t?void 0:t.kind)?"Section":"Link",o="string"==typeof(null==t?void 0:t.href)?t.href.trim().replace(/^https?:\/\//i,"").replace(/^www\./i,"").replace(/\/$/,""):"",n=o.length>40?`${o.slice(0,39)}…`:o;return{label:e,detail:n?`${i} · ${n}`:i}})).filter(Boolean)}catch(t){return console.warn("Error in buildFindingSubItems: ",t),[]}},this.buildGenericWarnings=t=>{var e,i,o,n,r,s,a,l,c,d,h,u,p,v,g,f,m,w,y,b,C,x,E,k;try{const S=new Map;for(const M of t){const t=(null===(e=null==M?void 0:M.pageInfo)||void 0===e?void 0:e.url)||(null===(i=null==M?void 0:M.location)||void 0===i?void 0:i.url)||(null===(o=null==M?void 0:M.agent)||void 0===o?void 0:o.url)||"",A=null!==(r=null!==(n=null==M?void 0:M.comments)&&void 0!==n?n:null==M?void 0:M.commentData)&&void 0!==r?r:[],T=null==A?void 0:A[0],I=null!==(p=null!==(d=null!==(a=null===(s=null==T?void 0:T.commentText)||void 0===s?void 0:s.trim())&&void 0!==a?a:null===(c=null===(l=null==M?void 0:M.agent)||void 0===l?void 0:l.result)||void 0===c?void 0:c.incorrectWord)&&void 0!==d?d:null===(u=null===(h=null==M?void 0:M.targetElement)||void 0===h?void 0:h.targetText)||void 0===u?void 0:u.trim())&&void 0!==p?p:"",_=null!==(b=null!==(m=null===(f=null===(g=null===(v=null==M?void 0:M.agent)||void 0===v?void 0:v.result)||void 0===g?void 0:g.suggestions)||void 0===f?void 0:f[0])&&void 0!==m?m:null===(y=null===(w=null==M?void 0:M.agent)||void 0===w?void 0:w.result)||void 0===y?void 0:y.suggestion)&&void 0!==b?b:"",$=null!==(k=null!==(x=null===(C=null==M?void 0:M.agent)||void 0===C?void 0:C.reason)&&void 0!==x?x:null===(E=null==T?void 0:T.agent)||void 0===E?void 0:E.reason)&&void 0!==k?k:{},N="string"==typeof(null==$?void 0:$.title)?$.title.trim():"",O="string"==typeof(null==$?void 0:$.description)?$.description.trim():"",L=N?null:this.splitFindingHeading(null==T?void 0:T.commentHtml),R=N||(null==L?void 0:L.title)||I,D=_||(N?O:null==L?void 0:L.detail)||"",F=this.resolveWarningSeverity(M,$),P=this.buildFindingSubItems($),j=I||(null==M?void 0:M.annotationId)||(null==M?void 0:M.id)||"";if(S.has(j)){const e=S.get(j);e.occurrences+=1,t&&!e.pageUrls.includes(t)&&e.pageUrls.push(t),e.annotations.push(M),e.severity=Ou(e.severity,F)}else S.set(j,{primaryText:R||"No text",secondaryText:D||"",occurrences:1,pageUrls:t?[t]:[],annotations:[M],...F?{severity:F}:{},...P.length>1?{subItems:P}:{}})}const M=Array.from(S.values());return{warnings:M,warningCount:M.length}}catch(t){return console.warn("Error in buildGenericWarnings: ",t),{warnings:[],warningCount:0}}},this.resolveWarningSeverity=(t,e)=>{try{return mu(t)?bu(t):(t=>{if("string"!=typeof t)return;const e=t.trim().toLowerCase();return Xh.includes(e)?e:void 0})(null==e?void 0:e.severity)}catch(t){return console.warn("Error in resolveWarningSeverity: ",t),void oh("Error in resolveWarningSeverity: ",t)}},this.normalizePagePath=t=>{try{return t?(null==t?void 0:t.startsWith("/"))?t.substring(1):t:""}catch(e){return console.warn("Error in normalizePagePath: ",e),t||""}},this.setQueryParamsCommentsInSdk=()=>{var t,e,i,o,n;try{const r="true"===sessionStorage.getItem("debugQueryParamsComments");r&&console.log("setQueryParamsCommentsInSdk commentElement",this.commentElement),this.commentElement&&(r&&console.log("setQueryParamsCommentsInSdk queryParamsComments",this.queryParamsComments),this.queryParamsComments&&(null===(t=this.commentElement)||void 0===t?void 0:t.enableQueryParamsComments)?(r&&console.log("enableQueryParamsComments this.commentElement?.enableQueryParamsComments",null===(e=this.commentElement)||void 0===e?void 0:e.enableQueryParamsComments),null===(i=this.commentElement)||void 0===i||i.enableQueryParamsComments()):!this.queryParamsComments&&(null===(o=this.commentElement)||void 0===o?void 0:o.disableQueryParamsComments)&&(r&&console.log("disableQueryParamsComments"),null===(n=this.commentElement)||void 0===n||n.disableQueryParamsComments()))}catch(t){console.warn("Error in setQueryParamsCommentsInSdk: ",t),oh("Error in setQueryParamsCommentsInSdk: ",t)}},this.checkGlobalUserContact=()=>{try{this.contactElement&&this.contactElement.isUserGlobalContact().subscribe((t=>{this.isUserGlobalContact=t}))}catch(t){console.warn("Error in checkGlobalUserContact: ",t),oh("Error in checkGlobalUserContact: ",t)}},this.applyVeltFeatureGates=()=>{try{const t=(t=>{try{return(null==t?void 0:t.passwordGateActive)||(null==t?void 0:t.planLimitLocked)||(null==t?void 0:t.planExpired)||(null==t?void 0:t.projectDeleted)?[...Rd]:[]}catch(t){return[]}})({passwordGateActive:this.passwordProtected&&!this.isPasswordValid,planLimitLocked:this.planLimitLocked,planExpired:!0===this.isPlanExpired,projectDeleted:this.projectDeleted});this.resolvedVeltFeatureGates=t,this.pushVeltFeatureGates(t)}catch(t){console.warn("Error in applyVeltFeatureGates: ",t),oh("Error in applyVeltFeatureGates: ",t)}},this.pushVeltFeatureGates=t=>{const e=globalThis.Velt;e&&"function"==typeof e.disableFeatures&&e.disableFeatures(t)},this.replayVeltFeatureGates=()=>{try{this.pushVeltFeatureGates(this.resolvedVeltFeatureGates)}catch(t){console.warn("Error in replayVeltFeatureGates: ",t),oh("Error in replayVeltFeatureGates: ",t)}},this.setProjectConfigVariables=t=>{var e,i,o,n;try{const r="Admin"===this.snippylyUserRole;this.allFeatureDisabled=!r&&(null!==(e=null==t?void 0:t.disabled)&&void 0!==e&&e),this.allFeatureRestricted=null!==(i=null==t?void 0:t.restricted)&&void 0!==i&&i,this.guestMode=null!==(o=null==t?void 0:t.guestMode)&&void 0!==o&&o||this.isRunningUnderLivePreview(),this.allowGuestModeSignIn=!!(null===(n=null==t?void 0:t.guestModeConfig)||void 0===n?void 0:n.allowSignIn),(null==t?void 0:t.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.guestMode&&nh(gt.Events.GUEST_MODE_PRESENT),this.passwordProtected=!1,this.queryParamsComments=!!(null==t?void 0:t.queryParamsComments),this.usePageTitleAsLocationName=!!(null==t?void 0:t.usePageTitleAsLocationName);const s=this.readProjectApproval(t);if(s&&(this.projectApproval=s),function(t){try{return!!t&&"object"==typeof t&&"boolean"==typeof t.maintenanceRequests}catch(t){return console.warn("Error in hasMaintenanceRequestsField: ",t),!1}}(t)){const e=Wd(t);this.maintenanceRequests=e.enabled,this.maintenanceRequestsLabel=e.label,this.syncRequestMode()}this.applyVeltFeatureGates(),Sd(de,this.guestMode+"",!0),Sd(me,this.allowGuestModeSignIn+"",!0),Sd(he,this.passwordProtected+"",!0),Sd(ue,this.queryParamsComments+"",!0),Sd(pe,this.usePageTitleAsLocationName+"",!0)}catch(t){console.warn("Error in setProjectConfigVariables: ",t),oh("Error in setProjectConfigVariables: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?nh(gt.Events.TOOLBAR_EXPANDED):nh(gt.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),oh("Error in toggleSnippylyPluginToolbar: ",t)}},this.enablePrivateCommentModeOnCommentElement=()=>{try{if(!this.commentElement||"function"!=typeof this.commentElement.enablePrivateMode)return;this.commentElement.enablePrivateMode({type:fe})}catch(t){console.warn("Error in enablePrivateCommentModeOnCommentElement: ",t),oh("Error in enablePrivateCommentModeOnCommentElement: ",t)}},this.disablePrivateCommentModeOnCommentElement=()=>{try{if(!this.commentElement||"function"!=typeof this.commentElement.disablePrivateMode)return;this.commentElement.disablePrivateMode()}catch(t){console.warn("Error in disablePrivateCommentModeOnCommentElement: ",t),oh("Error in disablePrivateCommentModeOnCommentElement: ",t)}},this.enableVisibilityOptionsOnCommentElement=()=>{try{if(this.visibilityOptionsEnabled)return;if(!this.commentElement||"function"!=typeof this.commentElement.enableVisibilityOptions)return;this.commentElement.enableVisibilityOptions(),this.visibilityOptionsEnabled=!0,nh(gt.Events.VISIBILITY_OPTIONS_ENABLED)}catch(t){console.warn("Error in enableVisibilityOptionsOnCommentElement: ",t),oh("Error in enableVisibilityOptionsOnCommentElement: ",t)}},this.disableVisibilityOptionsOnCommentElement=()=>{try{if(!this.visibilityOptionsEnabled)return;if(!this.commentElement||"function"!=typeof this.commentElement.disableVisibilityOptions)return void(this.visibilityOptionsEnabled=!1);this.commentElement.disableVisibilityOptions(),this.visibilityOptionsEnabled=!1,nh(gt.Events.VISIBILITY_OPTIONS_DISABLED)}catch(t){console.warn("Error in disableVisibilityOptionsOnCommentElement: ",t),oh("Error in disableVisibilityOptionsOnCommentElement: ",t)}},this.maybeApplyVisibilityOptionsToCommentElement=()=>{!this.clientMode&&"Admin"===this.snippylyUserRole&&this.canShowPrivateCommentToggle?this.enableVisibilityOptionsOnCommentElement():this.disableVisibilityOptionsOnCommentElement()},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.disablePrivateCommentModeOnCommentElement(),this.privateCommentModeEnabled=!1,nh(gt.Events.PRIVATE_MODE_DISABLED)):(this.enablePrivateCommentModeOnCommentElement(),this.privateCommentModeEnabled=!0,nh(gt.Events.PRIVATE_MODE_ENABLED)),Sd(ge,this.privateCommentModeEnabled.toString()))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),oh("Error in togglePrivateCommentMode: ",t)}},this.checkPrivateCommentModeFromStorage=()=>{try{!this.allFeatureDisabled&&"Admin"===this.snippylyUserRole&&this.canShowPrivateCommentToggle&&Md(ge)&&(this.privateCommentModeEnabled="true"===Md(ge),this.privateCommentModeEnabled&&this.enablePrivateCommentModeOnCommentElement())}catch(t){console.warn("Error in checkPrivateCommentModeFromStorage: ",t),oh("Error in checkPrivateCommentModeFromStorage: ",t)}},this.loginWithGoogle=()=>{try{if(nh(gt.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;this.clientMode&&Sd(Mt,"true",!1);const t=this.buildSignInUrlWithParams(this.signInUrl||"");window.open(t,this.signInWindowTarget())}catch(t){console.warn("Error in loginWithGoogle: ",t),oh("Error in loginWithGoogle: ",t)}},this.signInWindowTarget=()=>{try{return this.isRunningUnderPreviewProxy()&&this.isInFrame()?"_blank":"_self"}catch(t){return console.warn("Error in signInWindowTarget: ",t),"_self"}},this.isInFrame=()=>{try{return window.top!==window.self}catch(t){return console.warn("Error in isInFrame: ",t),!0}},this.buildSignInUrlWithParams=t=>{try{const e=new URL(t);return this.apiKey&&e.searchParams.set("apiKey",this.apiKey),this.projectId&&e.searchParams.set("projectId",this.projectId),e.toString()}catch(e){return console.warn("Error in buildSignInUrlWithParams: ",e),oh("Error in buildSignInUrlWithParams: ",e),t}},this.getQRCode=async()=>{if(!this.qrCodeLoading)try{this.qrCodeLoading=!0,this.qrCodeError=!1;const t=new URL(window.location.href);null==t||t.searchParams.set("review","true");const e=null==t?void 0:t.toString();if(!e)return void(this.qrCodeError=!0);const i=Id(e,Ye,Qe),o=await xh(i);"ok"===o.status?this.qrCode=o.qrcode:this.qrCodeError=!0}catch(t){this.qrCodeError=!0,console.warn("Error in getQRCode: ",t),oh("Error in getQRCode: ",t)}finally{this.qrCodeLoading=!1}},this.retryQRCode=async()=>{try{this.qrCodeError=!1,await this.getQRCode()}catch(t){console.warn("Error in retryQRCode: ",t),oh("Error in retryQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{if(nh(gt.Events.OPEN_MOBILE_CLICKED),this.showQrCode&&this.qrCodeLoading)return;this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),oh("Error in toggleQRCodeVisibility: ",t)}},this.onUserInviteToolClick=()=>{var t;(null===(t=this.snippylyUser)||void 0===t?void 0:t.isGuest)?(this.guestModeSignInModalConfig.title="Sign in to invite others.",this.guestModeSignInModalConfig.description="Invite team members to comment on this project.",this.guestModeSignInModalConfig.showLeaveCommentButton=!1,this.guestModeSignInModalConfig.closeOnClickOutside=!0,this.openGuestModeSignInModal()):this.openInviteModal()},this.openInviteModal=()=>{this.showInviteModal=!0,nh(gt.Events.INVITE_MODAL_OPENED)},this.closeInviteModal=()=>{this.showInviteModal=!1},this.onInviteSuccess=()=>{this.closeInviteModal(),nh(gt.Events.INVITE_SENT)},this.removeSnippyly=async()=>{try{nh(gt.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,Ad(Mt),Ad(At),Ad(Zt),Ad(ie,"sessionStorage"),Ad(oe,"sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete(Zt),e.delete(Mt),e.delete(Kt),e.delete(At),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete(ne),e.delete(re),e.delete(se),this.projectVersion=void 0,this.projectVersionKey=void 0,delete window.snippylyInitialLoadUrl,window.history.replaceState({},document.title,t.href),window.location.reload()}catch(t){console.warn("Error in removeSnippyly: ",t),oh("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{nh(gt.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null),await Velt.signOutUser(),Ad(Jt),Ad(Qt),Ud(),Ad(ce),Ad(ge),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),oh("Error in signOutUser: ",t)}},this.toggleMenu=(t,e)=>{try{t.stopPropagation(),this.menuOpenedId===e?this.menuOpenedId=void 0:this.menuOpenedId=e}catch(t){console.warn("Error in toggleMenu: ",t),oh("Error in toggleMenu: ",t)}},this.copyLink=()=>{try{navigator.clipboard.writeText(window.location.href),this.copyLinkTooltip="Link copied!",setTimeout((()=>{this.copyLinkTooltip="Copy Link"}),2e3)}catch(t){console.warn("Error in copyLink: ",t),oh("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${Ke}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${Ke}/dashboard/project/comment/${this.apiKey}/${this.serverDocumentId}`),nh(gt.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),oh("Error in goToAdminPortal: ",t)}},this.openBugReportModal=()=>{try{this.showBugReportModal=!0,nh(gt.Events.REPORT_BUG_CLICKED)}catch(t){console.warn("Error in openBugReportModal: ",t),oh("Error in openBugReportModal: ",t)}},this.closeBugReportModal=()=>{try{this.showBugReportModal=!1}catch(t){console.warn("Error in closeBugReportModal: ",t),oh("Error in closeBugReportModal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${Ke}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${Ke}/dashboard`),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),oh("Error in goToAdminPortalDashboard: ",t)}},this.joinCommunity=()=>{try{window.open("https://join.slack.com/t/superflowusers/shared_invite/zt-1q3jzsddt-NEb~uu9RXscLfxOIDGQXJw","_blank")}catch(t){console.warn("Error in joinCommunity: ",t),oh("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,Sd(re,"true");const t=new URL(document.location);t.searchParams.delete(re),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onboardingNextClick: ",t),oh("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,Sd(se,"true",!1,"sessionStorage");const t=new URL(document.location);t.searchParams.delete(se),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onLiveDemoModalNextClick: ",t),oh("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(ae),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),oh("Error in onFigmaDemoModalNextClick: ",t)}},this.onUpgradePlanClick=()=>{try{window.open(Je,"_blank")}catch(t){console.warn("Error in onUpgradePlanClick: ",t),oh("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,Sd(le,"true"),this.firstCommentNudge&&(this.firstCommentNudge=!1,this.autoCommentModeArmedOnce=!0)}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),oh("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{nh(gt.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),oh("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,nh(gt.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),oh("Error in openGuestModeSignInModal: ",t)}},this.closeGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!1,this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig))}catch(t){console.warn("Error in closeGuestModeSignInModal: ",t),oh("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{nh(gt.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),oh("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{if(this.clientMode)return;t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,nh(gt.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),oh("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),oh("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{nh(gt.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),oh("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{nh(gt.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),oh("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{nh(gt.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),oh("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,nh(gt.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),oh("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),oh("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{nh(gt.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),oh("Error in onGuestModeBannerSignInButtonClick: ",t)}},this.updateGuestUserName=async()=>{var t;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;const e=Od(!0,this.apiKey);if(e){const t=JSON.parse(JSON.stringify(e));e.name=this.guestUserNameInput,e.photoUrl=null,this.guestUserNameUpdateLoading=!0,(t=>{try{const e=JSON.stringify(t),i=Id(e,Ye,Qe);Sd(te,i,!0)}catch(t){console.warn("Error in updateGuestUser: ",t),oh("Error in updateGuestUser: ",t)}})(e),await Velt.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await vh(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,Sd(ye,"true"),nh(gt.Events.GUEST_MODE_NAME_ADDED,{oldName:null==t?void 0:t.name,newName:null==e?void 0:e.name})}this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateGuestUserName: ",t),oh("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(nh(gt.Events.REVIEW_PASSWORD_ADDED),!(null===(t=this.password)||void 0===t?void 0:t.trim()))return;if(this.validatingPasswordLoading)return;this.validatingPasswordLoading=!0,this.isPasswordValid=await ch(this.apiKey,this.projectId,this.password),function(t,e){try{const i="object"==typeof e?JSON.stringify(e):e;localStorage.setItem(t,i)}catch(t){console.warn("Error in setLocalStorage: ",t)}}(ve,this.isPasswordValid),this.isPasswordValid?(this.password="",this.onPasswordProtectedModalCloseButtonClick(),this.showInvalidPassword=!1,this.applyVeltFeatureGates(),nh(gt.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,nh(gt.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),oh("Error in submitPassword: ",t)}},this.updateUserName=async()=>{var t,e;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;this.guestUserNameUpdateLoading=!0;const i=JSON.parse(JSON.stringify(this.snippylyUser)),o=JSON.parse(JSON.stringify(this.snippylyUser));o.name=this.guestUserNameInput;const n=this.readLiveSignIn(),r=n&&(null===(e=n.user)||void 0===e?void 0:e.userId)===(null==i?void 0:i.userId)?n.token:null,s=this.isLiveShareGuest()?r:this.credentialFor(i,this.identityCameFromToken),a=await vh(this.apiKey,this.projectId||"",i,o,!1,s);if(!1===(null==a?void 0:a.success))return console.warn("[CWS Toolbar] Name change refused; keeping the old name:",null==a?void 0:a.reason),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",void this.closeGuestModeNameModel();await Velt.updateUser(o),this.snippylyUser=JSON.parse(JSON.stringify(o));const l=this.identityCameFromToken?$d():null;if(l){l.name=o.name;const t=JSON.stringify(l),e=Id(t,Ye,Qe);Sd(Qt,e,!0)}o.isGuest&&(this.guestUserNameUpdated=!0,Sd(ye,"true")),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),oh("Error in updateUserName: ",t)}},this.isAgentAnnotation=t=>{var e;try{const i=null!==this.extractAgentId((null===(e=null==t?void 0:t.agent)||void 0===e?void 0:e.agentFields)||[]),o=(null==t?void 0:t.type)===Ie,n=(null==t?void 0:t.commentType)===Ie;return i||o||n}catch(t){return console.warn("Error in isAgentAnnotation: ",t),!1}},this.getSidebarGroupExpansionMap=()=>{var t,e,i,o,n;try{const r=document.querySelector(Ne.VELT_COMMENTS_SIDEBAR_LEGACY),s=null===(n=null===(o=null===(i=null===(e=null===(t=null==r?void 0:r._ngElementStrategy)||void 0===t?void 0:t.componentRef)||void 0===e?void 0:e.instance)||void 0===i?void 0:i.componentConfigSignal)||void 0===o?void 0:o.call(i))||void 0===n?void 0:n.virtualScrollData;if(!Array.isArray(s))return;const a=new Map;return s.forEach((t=>{var e,i;if("group"!==(null==t?void 0:t.type))return;const o=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.displayName,n=null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.isExpanded;"string"==typeof o&&"boolean"==typeof n&&a.set(o,n)})),a}catch(t){return void console.warn("Error in getSidebarGroupExpansionMap: ",t)}},this.filterAgentCommentsFromSidebar=(t,e)=>{try{if(this.isSettingSidebarData)return;if(!t||!this.commentElement)return;const i=t.commentAnnotations;if(!Array.isArray(i))return;if(this.processAgentComments(this.mergeOnboardingFetchedAnnotations(i)),this.ensureOnboardingFindingsLoaded(),this.sidebarV2Enabled)return;if(this.showAgentCommentsInSidebar)return;const o=Array.isArray(null==t?void 0:t.systemFilteredAnnotations)?t.systemFilteredAnnotations:[],n=new Set(o.map((t=>(null==t?void 0:t.annotationId)||(null==t?void 0:t.id))).filter((t=>Boolean(t)))),r=[];i.forEach((t=>{if(this.isAgentAnnotation(t))return;const e=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id);e&&n.has(e)&&r.push(t)}));const s=new Map;r.forEach((t=>{var e,i,o,n;const r=(null===(e=null==t?void 0:t.pageInfo)||void 0===e?void 0:e.path)||(null===(i=null==t?void 0:t.pageInfo)||void 0===i?void 0:i.url)||(null===(o=null==t?void 0:t.location)||void 0===o?void 0:o.path)||"/";s.has(r)||s.set(r,[]),null===(n=s.get(r))||void 0===n||n.push(t)}));const a=[],l=new URL(window.location.href).pathname,c="/"+this.normalizePagePath(l);s.forEach(((t,i)=>{const o=null==e?void 0:e.get(i);a.push({groupId:i,groupName:i,isExpanded:"boolean"==typeof o?o:i===c,annotations:t})})),this.isSettingSidebarData=!0,this.commentElement.setCommentSidebarData(a,{grouping:!0}),this.isSettingSidebarData=!1}catch(t){this.isSettingSidebarData=!1,console.warn("Error in filterAgentCommentsFromSidebar: ",t),oh("Error in filterAgentCommentsFromSidebar: ",t)}},this.mountVeltCollaborationElements=()=>{if(!document.querySelector(Ne.VELT_COMMENTS)){const t=document.createElement(Ne.VELT_COMMENTS);t.setAttribute("filter-comments-on-dom","true"),t.setAttribute("shadow-dom","true"),null==t||t.addEventListener("onSignIn",(()=>{this.loginWithGoogle()})),null==t||t.addEventListener("onUpgrade",(()=>{this.onUpgradePlanClick()})),t.addEventListener("onCommentAdd",(t=>{this.addCommentCount++,this.trackClientRequestAdded(),this.notifyClientRequest(null==t?void 0:t.detail),this.onRequestModeCommentAdd(null==t?void 0:t.detail)})),t.addEventListener("onCommentUpdate",(t=>{var e,i;(null===(e=this.snippylyUser)||void 0===e?void 0:e.isGuest)&&"newlyAdded"===(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.type)&&(this.addCommentCount>=2&&(this.showModalOnceCommentIsModeIsOff=!0),this.addCommentCount>=5&&!this.showModalOnceCommentIsModeIsOff&&(this.showModalOnceCommentIsModeIsOff=!0))})),window.document.body.appendChild(t)}if(!this.isClientRequestsMode()){if(!document.querySelector(Ne.VELT_CURSOR)){const t=document.createElement(Ne.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Ne.VELT_HUDDLE)){const t=document.createElement(Ne.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Ne.VELT_RECORDER_NOTES)){const t=document.createElement(Ne.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Ne.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Ne.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Ne.VELT_ARROWS)){const t=document.createElement(Ne.VELT_ARROWS);window.document.body.appendChild(t)}}},this.unmountVeltCollaborationElements=()=>{try{document.querySelectorAll(zp.COLLABORATION_TAGS.join(", ")).forEach((t=>t.remove()))}catch(t){console.warn("Error in unmountVeltCollaborationElements: ",t),oh("Error in unmountVeltCollaborationElements: ",t)}},this.mountCommentSidebar=()=>{const t=this.sidebarV2Enabled,e=t?Ne.VELT_COMMENTS_SIDEBAR_V2:Ne.VELT_COMMENTS_SIDEBAR_LEGACY,i=t?Ne.VELT_COMMENTS_SIDEBAR_LEGACY:Ne.VELT_COMMENTS_SIDEBAR_V2;if(document.querySelectorAll(i).forEach((t=>t.remove())),!document.querySelector(e)){const i=document.createElement(e);i.setAttribute("shadow-dom","true"),i.setAttribute(t?Oe.URL_NAVIGATION:Oe.ENABLE_URL_NAVIGATION,"true"),i.setAttribute(Oe.CURRENT_LOCATION_SUFFIX,"true"),e===Ne.VELT_COMMENTS_SIDEBAR_LEGACY&&(i.setAttribute(Oe.SIDEBAR_BUTTON_COUNT_TYPE,Le),i.setAttribute(Oe.CUSTOM_ACTIONS,"true")),window.document.body.appendChild(i)}},this.setCommentSidebarVisibility=t=>{var e,i,o,n,r,s,a,l;try{if(t===this.showAgentCommentsInSidebar)return;if(this.sidebarV2Enabled)return t?null===(i=null===(e=this.commentElement)||void 0===e?void 0:e.disableFilterCommentsOnDom)||void 0===i||i.call(e):null===(n=null===(o=this.commentElement)||void 0===o?void 0:o.enableFilterCommentsOnDom)||void 0===n||n.call(o),void(this.showAgentCommentsInSidebar=t);const c=document.querySelector(Ne.VELT_COMMENTS_SIDEBAR_LEGACY);if(!c)return;t?(c.removeAttribute(Oe.SIDEBAR_BUTTON_COUNT_TYPE),c.removeAttribute(Oe.CUSTOM_ACTIONS),null===(s=null===(r=this.commentElement)||void 0===r?void 0:r.disableFilterCommentsOnDom)||void 0===s||s.call(r)):(c.setAttribute(Oe.SIDEBAR_BUTTON_COUNT_TYPE,Le),c.setAttribute(Oe.CUSTOM_ACTIONS,"true"),null===(l=null===(a=this.commentElement)||void 0===a?void 0:a.enableFilterCommentsOnDom)||void 0===l||l.call(a)),this.showAgentCommentsInSidebar=t}catch(t){console.warn("Error in setCommentSidebarVisibility: ",t),oh("Error in setCommentSidebarVisibility: ",t)}},this.toggleCommentSidebarVisibility=()=>{try{this.setCommentSidebarVisibility(!this.showAgentCommentsInSidebar),this.menuOpenedId=void 0}catch(t){console.warn("Error in toggleCommentSidebarVisibility: ",t),oh("Error in toggleCommentSidebarVisibility: ",t)}},this.applyPageCommentsVisibility=()=>{try{const t=this.commentElement;if(!t)return;this.pageCommentsHidden?"function"==typeof t.hideCommentsOnDom&&t.hideCommentsOnDom():"function"==typeof t.showCommentsOnDom&&t.showCommentsOnDom()}catch(t){console.warn("Error in applyPageCommentsVisibility: ",t),oh("Error in applyPageCommentsVisibility: ",t)}},this.togglePageCommentsVisibility=()=>{try{this.pageCommentsHidden=!this.pageCommentsHidden,this.pageCommentsHidden?Sd(qt,"true",!1,"sessionStorage"):Ad(qt,"sessionStorage"),this.applyPageCommentsVisibility(),this.menuOpenedId=void 0}catch(t){console.warn("Error in togglePageCommentsVisibility: ",t),oh("Error in togglePageCommentsVisibility: ",t)}},this.unhidePageCommentsIfHidden=()=>{try{if(!this.pageCommentsHidden)return;this.pageCommentsHidden=!1,Ad(qt,"sessionStorage"),this.applyPageCommentsVisibility()}catch(t){console.warn("Error in unhidePageCommentsIfHidden: ",t)}},this.toggleSidebarV2=()=>{try{Sd(xt,this.sidebarV2Enabled?"false":"true",!1,"sessionStorage"),window.location.reload()}catch(t){console.warn("Error in toggleSidebarV2: ",t),oh("Error in toggleSidebarV2: ",t)}},this.toggleVeltProxy=()=>{try{if(!this.veltProxyToggleVisible)return;t=!this.veltProxyEnabled,Sd(Et,t?"true":"false"),window.location.reload()}catch(t){console.warn("Error in toggleVeltProxy: ",t),oh("Error in toggleVeltProxy: ",t)}var t},this.isScreenshotDisabledHost=()=>{try{return Te.includes(window.location.hostname)}catch{return!1}},this.getScreenshotMode=()=>{var t,e,i;return"local"===(null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.advancedFeatures)||void 0===i?void 0:i.screenshotMode)?"local":"basic"},this.logCaptureTrigger=(...t)=>{Fu()&&"undefined"!=typeof console&&console.warn("[sf-capture][trigger]",...t)},this.ensureAddCommentAnnotationSubscription=()=>{var t,e,i;this.commentElement&&"function"==typeof this.commentElement.on?this.addCommentAnnotationSubscription&&this.addCommentAnnotationSubscribedEl===this.commentElement?this.logCaptureTrigger("addCommentAnnotation subscription already attached"):(this.addCommentAnnotationSubscription&&(null===(i=(e=this.addCommentAnnotationSubscription).unsubscribe)||void 0===i||i.call(e),this.addCommentAnnotationSubscription=void 0,this.logCaptureTrigger("addCommentAnnotation re-subscribing: comment element changed")),this.addCommentAnnotationSubscription=this.commentElement.on("addCommentAnnotation").subscribe((t=>this.onAddCommentAnnotation(t))),this.addCommentAnnotationSubscribedEl=this.commentElement,this.logCaptureTrigger("addCommentAnnotation subscription attached")):this.logCaptureTrigger("addCommentAnnotation subscription NOT attached: commentElement.on unavailable",{hasCommentElement:!!this.commentElement,hasOn:"function"==typeof(null===(t=this.commentElement)||void 0===t?void 0:t.on)})},this.applyScreenshotSetting=()=>{var t,e,i,o,n,r,s,a,l,c,d,h,u;if(this.commentElement)return this.isScreenshotDisabledHost()?(null===(e=(t=this.commentElement).disableScreenshot)||void 0===e||e.call(t),void(this.nativeScreenshotEnabled&&(this.nativeScreenshotEnabled=!1,this.nativeCapture.dispose()))):void(this.nativeScreenshotEnabled?null===(o=(i=this.commentElement).disableScreenshot)||void 0===o||o.call(i):(null===(s=null===(r=null===(n=this.customerMetadata)||void 0===n?void 0:n.superflow)||void 0===r?void 0:r.advancedFeatures)||void 0===s?void 0:s.takeScreenshotOnComments)?"local"!==this.getScreenshotMode()?null===(u=(h=this.commentElement).enableScreenshot)||void 0===u||u.call(h):null===(d=(c=this.commentElement).disableScreenshot)||void 0===d||d.call(c):null===(l=(a=this.commentElement).disableScreenshot)||void 0===l||l.call(a))},this.canUseNativeScreenshot=()=>{var t,e,i;return!this.isScreenshotDisabledHost()&&(dp()&&"local"===this.getScreenshotMode()&&!!(null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.advancedFeatures)||void 0===i?void 0:i.takeScreenshotOnComments))},this.getNativeScreenshotPermission=()=>{const t=Md(Se,!1,"sessionStorage");return"granted"===t||"denied"===t?t:null},this.setNativeScreenshotPermission=t=>{Sd(Se,t,!1,"sessionStorage"),this.nativeScreenshotDenied="denied"===t},this.clearNativeScreenshotPermission=()=>{Ad(Se,"sessionStorage"),this.nativeScreenshotDenied=!1},this.promptNativeScreenshotForCommentMode=()=>{this.nativeScreenshotEnabled||this.nativeScreenshotEnabling||!this.canUseNativeScreenshot()||(this.logCaptureTrigger("commentMode enter: requesting screen share"),this.enableNativeScreenshot())},this.toggleNativeScreenshot=async()=>{try{if(!this.canUseNativeScreenshot())return;this.nativeScreenshotEnabled?(this.disableNativeScreenshot(),this.setNativeScreenshotPermission("denied")):(this.clearNativeScreenshotPermission(),await this.enableNativeScreenshot()),this.menuOpenedId=void 0}catch(t){console.warn("Error in toggleNativeScreenshot: ",t),oh("Error in toggleNativeScreenshot: ",t)}},this.enableNativeScreenshot=()=>(this.nativeScreenshotEnabling&&this.nativeScreenshotEnablingPromise||(this.nativeScreenshotEnabling=!0,this.nativeScreenshotEnablingPromise=this.performEnableNativeScreenshot()),this.nativeScreenshotEnablingPromise),this.performEnableNativeScreenshot=async()=>{var t,e;try{if(await this.nativeCapture.init(),!this.nativeCapture.isActive())return this.nativeScreenshotEnabled=!1,void this.nativeCapture.dispose();this.nativeScreenshotEnabled=!0,this.setNativeScreenshotPermission("granted"),null===(e=null===(t=this.commentElement)||void 0===t?void 0:t.disableScreenshot)||void 0===e||e.call(t),this.ensureAddCommentAnnotationSubscription()}catch(t){this.nativeScreenshotEnabled=!1,this.nativeCapture.dispose(),!function(t){var e;const i=t,o=null!==(e=null==i?void 0:i.message)&&void 0!==e?e:"";return!0===(null==i?void 0:i.sfNativeExpected)||"native-share-ended-during-init"===o||"native-not-supported"===o}(t)?console.warn("Native screenshot enable failed/cancelled: ",t):(this.setNativeScreenshotPermission("denied"),Fu()&&"undefined"!=typeof console&&console.info("[sf-capture][native] enable skipped (expected):",t))}finally{this.nativeScreenshotEnabling=!1,this.nativeScreenshotEnablingPromise=void 0}},this.disableNativeScreenshot=()=>{try{this.nativeScreenshotEnabled=!1,this.nativeCapture.dispose(),this.restoreSdkScreenshot()}catch(t){console.warn("Error in disableNativeScreenshot: ",t),oh("Error in disableNativeScreenshot: ",t)}},this.handleNativeScreenshotStreamEnded=()=>{try{const t=this.nativeScreenshotEnabled;if(this.nativeScreenshotEnabled=!1,!t)return;this.setNativeScreenshotPermission("denied"),this.restoreSdkScreenshot(),this.requestUpdate()}catch(t){console.warn("Error in handleNativeScreenshotStreamEnded: ",t),oh("Error in handleNativeScreenshotStreamEnded: ",t)}},this.restoreSdkScreenshot=()=>{var t,e,i,o,n;this.isScreenshotDisabledHost()||"basic"===this.getScreenshotMode()&&(null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.advancedFeatures)||void 0===i?void 0:i.takeScreenshotOnComments)&&(null===(n=null===(o=this.commentElement)||void 0===o?void 0:o.enableScreenshot)||void 0===n||n.call(o))},this.onAddCommentAnnotation=async t=>{var e,i,o,n,r,s,a,l,c;try{if(this.logCaptureTrigger("addCommentAnnotation event",{nativeScreenshotEnabled:this.nativeScreenshotEnabled,captureActive:this.nativeCapture.isActive(),dataKeys:t?Object.keys(t):null,commentAnnotationKeys:(null==t?void 0:t.commentAnnotation)?Object.keys(t.commentAnnotation):null}),!this.nativeScreenshotEnabled&&!this.canUseNativeScreenshot())return void this.logCaptureTrigger("skip: native screenshot unavailable");if(!this.nativeScreenshotEnabled){const t=this.nativeScreenshotEnabling&&!!this.nativeScreenshotEnablingPromise;if(!t&&null!==this.getNativeScreenshotPermission())return void this.logCaptureTrigger("skip: native screenshot not enabled (share decision recorded, no prompt in flight)");if(this.logCaptureTrigger(t?"comment add: share prompt already in flight, awaiting its outcome":"comment add: share never requested this session, prompting"),await this.enableNativeScreenshot(),!this.nativeScreenshotEnabled)return void this.logCaptureTrigger("skip: screen share not granted")}const d=null!==(o=null!==(e=null==t?void 0:t.annotationId)&&void 0!==e?e:null===(i=null==t?void 0:t.commentAnnotation)||void 0===i?void 0:i.annotationId)&&void 0!==o?o:null==t?void 0:t.id,h=null!==(l=null!==(a=null!==(r=null===(n=null==t?void 0:t.commentAnnotation)||void 0===n?void 0:n.comments)&&void 0!==r?r:null===(s=null==t?void 0:t.commentAnnotation)||void 0===s?void 0:s.commentData)&&void 0!==a?a:null==t?void 0:t.comments)&&void 0!==l?l:null==t?void 0:t.commentData,u=null===(c=null==h?void 0:h[0])||void 0===c?void 0:c.commentId;if(!d||!u)return void this.logCaptureTrigger("skip: missing ids",{annotationId:d,commentId:u,data:t});this.captureAndAttachScreenshot(d,u)}catch(t){console.warn("Error in onAddCommentAnnotation: ",t),oh("Error in onAddCommentAnnotation: ",t)}},this.captureAndAttachScreenshot=(t,e)=>this.nativeCapture.isActive()?(this.pendingScreenshotCount+=1,this.capturingScreenshot=!0,this.screenshotChain=this.screenshotChain.catch((()=>{})).then((()=>this.runCaptureAndAttach(t,e))).finally((()=>{this.pendingScreenshotCount=Math.max(0,this.pendingScreenshotCount-1),0===this.pendingScreenshotCount&&(this.capturingScreenshot=!1)})),this.screenshotChain):(this.logCaptureTrigger("skip: native capture not active",{annotationId:t,commentId:e}),Promise.resolve()),this.runCaptureAndAttach=async(t,e)=>{var i,o,n,r;try{this.logCaptureTrigger("capture start",{annotationId:t,commentId:e});const s=await this.nativeCapture.capture({focusAnnotationId:t}),a="image/webp"===s.blobType?"webp":"png",l=new File([s.blob],`screenshot-${t}.${a}`,{type:s.blobType}),c=await(null===(o=null===(i=this.commentElement)||void 0===i?void 0:i.addAttachment)||void 0===o?void 0:o.call(i,{annotationId:t,commentId:e,files:[l]}));if(c&&Array.isArray(c)&&c.length>0&&(null===(n=c[0])||void 0===n?void 0:n.valid)){const i=null===(r=c[0])||void 0===r?void 0:r.attachment;await this.commentElement.updateComment({annotationId:t,comment:{commentId:e,attachments:[i]},merge:!0}),this.logCaptureTrigger("capture attached",{annotationId:t,commentId:e})}else console.warn("Invalid screenshot file")}catch(t){console.warn("Native screenshot capture/attach failed: ",t),oh("Native screenshot capture/attach failed: ",t)}},this.setupSidebarAgentCommentFilter=()=>{var t,e,i,o,n,r;try{if(!this.commentElement)return;if(this.isClientRequestsMode())return void this.setupClientSidebarFilter();if("function"==typeof this.commentElement.on&&(this.commentElement.on("commentSidebarDataInit").subscribe((t=>{this.filterAgentCommentsFromSidebar(t)})),this.commentElement.on("commentSidebarDataUpdate").subscribe((t=>{const e=this.getSidebarGroupExpansionMap();this.filterAgentCommentsFromSidebar(t,e)}))),this.setupAgentWarningsHydration(),this.agentCommentsModeRequested)return this.setCommentSidebarVisibility(!0),void(this.showAgentCommentsInSidebar||(null===(e=null===(t=this.commentElement)||void 0===t?void 0:t.disableFilterCommentsOnDom)||void 0===e||e.call(t),this.showAgentCommentsInSidebar=!0));this.sidebarV2Enabled&&(this.showAgentCommentsInSidebar?null===(o=null===(i=this.commentElement)||void 0===i?void 0:i.disableFilterCommentsOnDom)||void 0===o||o.call(i):null===(r=null===(n=this.commentElement)||void 0===n?void 0:n.enableFilterCommentsOnDom)||void 0===r||r.call(n))}catch(t){console.warn("Error in setupSidebarAgentCommentFilter: ",t),oh("Error in setupSidebarAgentCommentFilter: ",t)}},this.setupAgentWarningsHydration=()=>{try{if(!this.commentElement||"function"!=typeof this.commentElement.getAllCommentAnnotations||!this.documentId)return;const t=this.commentElement.getAllCommentAnnotations(this.documentId+"");if(!t||"function"!=typeof t.subscribe)return;const e=t.subscribe((t=>{try{if(this.streamEmissionCount+=1,this.lastStreamEmissionAt=Date.now(),!this.sidebarV2Enabled&&!this.showAgentCommentsInSidebar)return;this.lastStreamAnnotations=Array.isArray(t)?t:[],this.processAgentComments(this.mergeOnboardingFetchedAnnotations(this.lastStreamAnnotations)),this.ensureOnboardingFindingsLoaded()}catch(t){console.warn("Error in agent-warnings hydration subscription: ",t),oh("Error in agent-warnings hydration subscription: ",t)}}));this.subscriptions.push(e)}catch(t){console.warn("Error in setupAgentWarningsHydration: ",t),oh("Error in setupAgentWarningsHydration: ",t)}},this.getContentWarningsDisplayCount=()=>{try{return this.contentWarningsCount>99?"99+":`${this.contentWarningsCount}`}catch(t){return console.warn("Error in getContentWarningsDisplayCount: ",t),"0"}},this.onContentWarningsButtonClick=()=>{try{this.showContentWarningSidebar=!this.showContentWarningSidebar}catch(t){console.warn("Error in onContentWarningsButtonClick: ",t),oh("Error in onContentWarningsButtonClick: ",t)}},this.onContentWarningSidebarClose=()=>{try{this.showContentWarningSidebar=!1}catch(t){console.warn("Error in onContentWarningSidebarClose: ",t)}},this.getOnboardingDismissedProjectIds=()=>{try{const t=Md(Ut,!1,"sessionStorage");if(!t)return[];try{const e=JSON.parse(t);if(Array.isArray(e))return e.filter((t=>"string"==typeof t&&t.length>0))}catch{}return[t]}catch(t){return console.warn("Error in getOnboardingDismissedProjectIds: ",t),oh("Error in getOnboardingDismissedProjectIds: ",t),[]}},this.setOnboardingDismissedProjectIds=t=>{try{const e=t.slice(-20);if(0===e.length)return void Ad(Ut,"sessionStorage");Sd(Ut,JSON.stringify(e),!1,"sessionStorage")}catch(t){console.warn("Error in setOnboardingDismissedProjectIds: ",t),oh("Error in setOnboardingDismissedProjectIds: ",t)}},this.recordOnboardingSidebarDismissal=()=>{try{if(!this.projectId)return;const t=`${this.projectId}`,e=this.getOnboardingDismissedProjectIds().filter((e=>e!==t));this.setOnboardingDismissedProjectIds([...e,t])}catch(t){console.warn("Error in recordOnboardingSidebarDismissal: ",t),oh("Error in recordOnboardingSidebarDismissal: ",t)}},this.clearOnboardingSidebarDismissal=()=>{try{if(!this.projectId)return;const t=`${this.projectId}`,e=this.getOnboardingDismissedProjectIds();if(!e.includes(t))return;this.setOnboardingDismissedProjectIds(e.filter((e=>e!==t)))}catch(t){console.warn("Error in clearOnboardingSidebarDismissal: ",t),oh("Error in clearOnboardingSidebarDismissal: ",t)}},this.canShowTourCommentTooltip=()=>{try{return!(this.allFeatureDisabled||this.readOnlyMode||!this.showTourCommentTooltip)&&!(this.onboardingMode&&this.showContentWarningSidebar)}catch(t){return console.warn("Error in canShowTourCommentTooltip: ",t),oh("Error in canShowTourCommentTooltip: ",t),!1}},this.autoOpenOnboardingSidebar=()=>{try{if(!this.onboardingMode||this.allFeatureDisabled)return;if(!this.projectId)return;if(this.getOnboardingDismissedProjectIds().includes(`${this.projectId}`))return;this.showContentWarningSidebar=!0}catch(t){console.warn("Error in autoOpenOnboardingSidebar: ",t),oh("Error in autoOpenOnboardingSidebar: ",t)}},this.restoreContentWarningSidebarState=()=>{var t,e;try{if(this.onboardingMode)return this.autoOpenOnboardingSidebar(),void(this.showContentWarningSidebar&&(this.showAgentCommentsInSidebar?null===(e=null===(t=this.commentElement)||void 0===t?void 0:t.disableFilterCommentsOnDom)||void 0===e||e.call(t):this.setCommentSidebarVisibility(!0)));const i="true"===Md(xe,!1,"sessionStorage"),o=new URL(window.location.href).searchParams.has(Kt);if(!i)return;if(!o)return;if(this.allFeatureDisabled||"Admin"!==this.snippylyUserRole)return;this.showContentWarningSidebar=!0}catch(t){console.warn("Error in restoreContentWarningSidebarState: ",t),oh("Error in restoreContentWarningSidebarState: ",t)}},this.navigateTo=t=>{try{window.location.href=t}catch(t){console.warn("Error in navigateTo: ",t),oh("Error in navigateTo: ",t)}},this.onContentWarningSidebarAddAll=()=>{},this.onContentWarningItemClick=t=>{var e,i;try{const o=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.annotation;if(!(null==o?void 0:o.annotationId)&&!(null==o?void 0:o.id))return;const n=(null==o?void 0:o.annotationId)||(null==o?void 0:o.id),r=null===(i=null==o?void 0:o.pageInfo)||void 0===i?void 0:i.url;if(wu(o))return void this.selectAnnotationOnPage(n);if(r&&!this.isCurrentPageUrl(r)){if(this.showContentWarningSidebar&&Sd(xe,"true",!1,"sessionStorage"),this.isRunningUnderLivePreview()){const t=new URL(r),e=Fd(t)?null:Pd(r),i=null!=e?e:t.pathname,o=null===e?t.search:"",s=this.buildLivePreviewNavigationUrl(`${i}${o}`,n);return void(s&&this.navigateTo(s))}if(this.isRunningUnderPreviewProxy()){return void(!(null!==Pd(r))&&window.parent&&window.parent!==window&&window.parent.postMessage({type:Wt,url:r,annotationId:n},"*"))}const t=new URL(r);return t.searchParams.set(Kt,n),void this.navigateTo(t.toString())}this.selectAnnotationOnPage(n)}catch(t){console.warn("Error in onContentWarningItemClick: ",t),oh("Error in onContentWarningItemClick: ",t)}},this.buildLivePreviewNavigationUrl=(t,e)=>{try{const i=new URL(t,window.location.origin);return i.origin!==window.location.origin?(console.warn("[CWS Toolbar] Refusing a live preview navigation off this origin:",t),null):(i.searchParams.delete(Ge),i.searchParams.set(Kt,e),i.toString())}catch(t){return console.warn("Error in buildLivePreviewNavigationUrl: ",t),null}},this.selectAnnotationOnPage=t=>{var e;try{(null===(e=this.commentElement)||void 0===e?void 0:e.selectCommentByAnnotationId)&&this.commentElement.selectCommentByAnnotationId(t),setTimeout((()=>{var e;(null===(e=this.commentElement)||void 0===e?void 0:e.scrollToCommentByAnnotationId)&&this.commentElement.scrollToCommentByAnnotationId(t)}),150)}catch(t){console.warn("Error in selectAnnotationOnPage: ",t),oh("Error in selectAnnotationOnPage: ",t)}},this.onContentWarningItemNext=t=>{var e;try{const i=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.annotation;if(!i)return;this.navigateToCheckPage(this.resolveFullAnnotation(i),"next")}catch(t){console.warn("Error in onContentWarningItemNext: ",t),oh("Error in onContentWarningItemNext: ",t)}},this.getCurrentCheckPageKey=()=>{var t;try{if(this.isRunningUnderPreviewProxy())return this.previewLocationPath||"/";if(this.autoLocation&&"string"==typeof(null===(t=this.location)||void 0===t?void 0:t.url)&&this.location.url)return this.location.url;const e=new URL(window.location.href);for(const t of[Mt,At,Zt,Kt,re,se])e.searchParams.delete(t);return`${e.pathname}${this.queryParamsComments?e.search:""}`}catch(t){return console.warn("Error in getCurrentCheckPageKey: ",t),oh("Error in getCurrentCheckPageKey: ",t),window.location.pathname}},this.navigateToCheckPage=(t,e="next")=>{try{const i=yu(t);if(i.length<2)return!1;const o=xu(i,this.getCurrentCheckPageKey(),e);return!!o&&this.navigateToCheckPageKey(t,o)}catch(t){return console.warn("Error in navigateToCheckPage: ",t),oh("Error in navigateToCheckPage: ",t),!1}},this.navigateToCheckPageKey=(t,e)=>{var i;try{const o=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id);if(!o||!e)return!1;if(this.showContentWarningSidebar&&Sd(xe,"true",!1,"sessionStorage"),this.isRunningUnderLivePreview()){const t=this.buildLivePreviewNavigationUrl(e,o);return!!t&&(this.navigateTo(t),!0)}if(this.isRunningUnderPreviewProxy()){const n=null===(i=null==t?void 0:t.pageInfo)||void 0===i?void 0:i.url;if("string"!=typeof n||!n||null!==Pd(n))return!1;if(!window.parent||window.parent===window)return!1;const r=new URL(e,new URL(n).origin);return window.parent.postMessage({type:Wt,url:r.toString(),annotationId:o},"*"),!0}const n=new URL(e,window.location.origin);return n.searchParams.set(Kt,o),this.navigateTo(n.toString()),!0}catch(t){return console.warn("Error in navigateToCheckPageKey: ",t),oh("Error in navigateToCheckPageKey: ",t),!1}},this.resolveFullAnnotation=t=>{var e;try{if(!t||au(t))return t;const i=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id);if(!i)return t;const o=t=>((null==t?void 0:t.annotationId)||(null==t?void 0:t.id))===i,n=this.lastStreamAnnotations.find(o);if(au(n))return n;for(const t of this.agentGroups){const i=null===(e=null==t?void 0:t.annotations)||void 0===e?void 0:e.find(o);if(au(i))return i}return t}catch(e){return console.warn("Error in resolveFullAnnotation: ",e),oh("Error in resolveFullAnnotation: ",e),t}},this.isCurrentPageUrl=t=>{var e;try{const i=null!==(e=Pd(t))&&void 0!==e?e:new URL(t).pathname;let o=window.location.pathname;return!this.isRunningUnderLivePreview()&&this.isRunningUnderPreviewProxy()&&(o=this.previewLocationPath||"/"),i===o}catch{return!1}},this.setupVeltButtonClickListener=()=>{try{if(!(null===Velt||void 0===Velt?void 0:Velt.on))return void console.warn("[CWS Toolbar] Velt.on not available for button click listener");Velt.on("veltButtonClick").subscribe((t=>{var e;try{if(!t)return;const i=null===(e=null==t?void 0:t.buttonContext)||void 0===e?void 0:e.clickedButtonId,o=null==t?void 0:t.commentAnnotation,n=(null==o?void 0:o.annotationId)||(null==o?void 0:o.id),r="accept-suggestion"===i||"reject-suggestion"===i;if(r&&n&&this.processingAnnotationIds.has(n))return;if(r&&this.isSuggestionActionsHiddenForViewer())return void console.warn("[CWS Toolbar] Only workspace members can accept or reject suggestions. Ignoring:",i);if("prev-suggestion"===i||"next-suggestion"===i){const t="next-suggestion"===i?"next":"prev",e=this.resolveFullAnnotation(o);wu(e)&&yu(e).length>1?this.navigateToCheckPage(e,t):this.navigateSuggestion(o,t)}else"accept-suggestion"===i&&this.handleAcceptSuggestion(o)}catch(t){console.warn("Error in veltButtonClick handler: ",t)}})),this.commentElement.onCommentSelectionChange().subscribe((t=>{this.handleCommentSelection(t)}))}catch(t){console.warn("Error in setupVeltButtonClickListener: ",t),oh("Error in setupVeltButtonClickListener: ",t)}},this.navigateSuggestion=(t,e)=>{var i,o,n,r,s;try{if(!t)return void console.warn("[CWS Toolbar] No annotation provided for navigation");const a=null===(o=null===(i=null==t?void 0:t.agent)||void 0===i?void 0:i.result)||void 0===o?void 0:o.incorrectWord;if(!a)return void console.warn("[CWS Toolbar] No incorrectWord found on annotation");const l=this.findMatchingWarning(a);if(!l)return void console.warn("[CWS Toolbar] No matching warning found for word:",a);const c=null===(n=null==t?void 0:t.pageInfo)||void 0===n?void 0:n.path,d=this.normalizePagePath(c),h=null===(r=null==l?void 0:l.annotations)||void 0===r?void 0:r.filter((t=>{var e;const i=null===(e=null==t?void 0:t.pageInfo)||void 0===e?void 0:e.path;return this.normalizePagePath(i)===d}));if(!(null==h?void 0:h.length)||h.length<=1)return;const u=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id),p=h.findIndex((t=>((null==t?void 0:t.annotationId)||(null==t?void 0:t.id))===u));if(-1===p)return void console.warn("[CWS Toolbar] Current annotation not found in warning group");let v;v="next"===e?(p+1)%h.length:(p-1+h.length)%h.length;const g=h[v],f=(null==g?void 0:g.annotationId)||(null==g?void 0:g.id);f&&((null===(s=this.commentElement)||void 0===s?void 0:s.selectCommentByAnnotationId)&&this.commentElement.selectCommentByAnnotationId(f),setTimeout((()=>{var t;(null===(t=this.commentElement)||void 0===t?void 0:t.scrollToCommentByAnnotationId)&&this.commentElement.scrollToCommentByAnnotationId(f)}),150))}catch(t){console.warn("Error in navigateSuggestion: ",t),oh("Error in navigateSuggestion: ",t)}},this.findMatchingWarning=t=>{var e;try{for(const i of this.agentGroups){const o=null===(e=null==i?void 0:i.warnings)||void 0===e?void 0:e.find((e=>(null==e?void 0:e.primaryText)===t));if(o)return o}return null}catch(t){return console.warn("Error in findMatchingWarning: ",t),null}},this.removeAnnotationFromWarnings=t=>{var e,i,o;try{if(!t)return;const n=e=>{var i,o,n,r;for(const s of e){const e=null===(i=null==s?void 0:s.annotations)||void 0===i?void 0:i.find((e=>((null==e?void 0:e.annotationId)||(null==e?void 0:e.id))===t));if(e){const t="grammar"===(null===(n=null===(o=null==e?void 0:e.agent)||void 0===o?void 0:o.result)||void 0===n?void 0:n.type)?this.grammarSuggestionPagePathMap:this.spellingSuggestionPagePathMap,i=(null==s?void 0:s.primaryText)||"",a=null===(r=null==e?void 0:e.pageInfo)||void 0===r?void 0:r.path,l=this.normalizePagePath(a);if(i&&l&&t.has(i)){const e=t.get(i),o=e.get(l)||0;o>1?e.set(l,o-1):(e.delete(l),0===e.size&&t.delete(i))}return}}};for(const t of this.agentGroups)(null==t?void 0:t.agentId)!==$e.SPELL_CHECK&&(null==t?void 0:t.agentId)!==$e.GRAMMAR_CHECK||n(t.warnings);const r=null!==(o=null===(i=null===(e=this.agentGroups)||void 0===e?void 0:e.map((e=>{var i,o,n,r,s;const a=null!==(n=null===(o=null===(i=null==e?void 0:e.warnings)||void 0===i?void 0:i.map((e=>{var i;const o=null===(i=null==e?void 0:e.annotations)||void 0===i?void 0:i.filter((e=>((null==e?void 0:e.annotationId)||(null==e?void 0:e.id))!==t));return o&&0!==o.length?{...e,annotations:o,occurrences:o.length}:null})))||void 0===o?void 0:o.filter((t=>null!==t)))&&void 0!==n?n:[],l=null!==(s=null===(r=null==e?void 0:e.annotations)||void 0===r?void 0:r.filter((e=>((null==e?void 0:e.annotationId)||(null==e?void 0:e.id))!==t)))&&void 0!==s?s:[];return 0===a.length?null:{...e,warnings:a,warningCount:a.length,annotations:l}})))||void 0===i?void 0:i.filter((t=>null!==t)))&&void 0!==o?o:[];this.agentGroups=r;const s=r.reduce(((t,e)=>t+e.warningCount),0);this.contentWarningsCount=s,this.hasContentWarnings=s>0,this.onboardingFetchedAnnotations=this.onboardingFetchedAnnotations.filter((e=>((null==e?void 0:e.annotationId)||(null==e?void 0:e.id))!==t)),this.onboardingMode&&(this.onboardingRemovedAnnotationIds.add(t),this.setOnboardingUnsyncedAnnotationIds(this.onboardingFetchedAnnotations.map((t=>null==t?void 0:t.annotationId))))}catch(t){console.warn("Error in removeAnnotationFromWarnings: ",t)}},this.setSuggestionButtonsLoading=(t,e,i)=>{try{const o=i||document.querySelector(".velt-comment-dialog.selected");if(!o)return;const n=o.querySelector(".sf-accept-btn"),r=o.querySelector(".sf-reject-btn");if(e){const e="accept"===t?n:r,i="accept"===t?r:n;null==e||e.classList.add("sf-btn-loading"),null==i||i.classList.add("sf-btn-disabled")}else null==n||n.classList.remove("sf-btn-loading","sf-btn-disabled"),null==r||r.classList.remove("sf-btn-loading","sf-btn-disabled")}catch(t){console.warn("Error in setSuggestionButtonsLoading: ",t)}},this.handleAcceptSuggestion=async t=>{var e,i,o;try{const n=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id);if(!n)return void console.warn("[CWS Toolbar] handleAcceptSuggestion: No annotationId found",t);if(this.processingAnnotationIds.has(n))return;const r=(null===(e=this.snippylyUser)||void 0===e?void 0:e.userId)||(null===(i=this.snippylyUser)||void 0===i?void 0:i.uid),s=(null===(o=this.snippylyUser)||void 0===o?void 0:o.email)||"";if(!r)return void console.warn("[CWS Toolbar] handleAcceptSuggestion: No user available");if(!this.documentId)return void console.warn("[CWS Toolbar] handleAcceptSuggestion: No documentId available");this.processingAnnotationIds.add(n);const a=document.querySelector(".velt-comment-dialog.selected");this.setSuggestionButtonsLoading("accept",!0,a);try{await Eh(this.apiKey,this.apiKey,this.documentId+"",n,{userId:r,email:s},this.suggestionCredential()),this.removeAnnotationFromWarnings(n)}finally{this.processingAnnotationIds.delete(n),this.setSuggestionButtonsLoading("accept",!1,a)}}catch(t){console.warn("Error in handleAcceptSuggestion: ",t),oh("Error in handleAcceptSuggestion: ",t)}},this.trackAgentPins=t=>{try{const e=this.agentPinTargets;if(this.agentPinTargets=new Map((t=>{const e=[],i=new Set;for(const o of Array.isArray(t)?t:[]){if("square"!==bp(o))continue;const t=ru(o);t&&!i.has(t)&&(i.add(t),e.push({id:t,icon:Ep(o)}))}return e})(t).map((t=>[t.id,t]))),!this.isConnected)return;for(const t of e.keys())if(!this.agentPinTargets.has(t))for(const e of Dp(t))Up(e),this.agentPinDecoratedContainers.delete(e);this.decorateAgentPins(),this.syncAgentPinDomObserver()}catch(t){console.warn("Error in trackAgentPins: ",t),oh("Error in trackAgentPins: ",t)}},this.resyncAgentPins=()=>{try{if(!this.isConnected||0===this.agentPinTargets.size)return;this.decorateAgentPins(),this.syncAgentPinDomObserver()}catch(t){console.warn("Error in resyncAgentPins: ",t),oh("Error in resyncAgentPins: ",t)}},this.decorateAgentPins=()=>{try{if(!this.isConnected)return;const t=new Set,e=new Map;for(const i of this.agentPinTargets.values())for(const o of Dp(i.id))"light"===this.decorateAgentPinContainer(o,i,e)&&t.add(i.id);this.agentPinLightDomIds=t,this.writeAgentPinPageCss()}catch(t){console.warn("Error in decorateAgentPins: ",t),oh("Error in decorateAgentPins: ",t)}},this.decorateAgentPinContainer=(t,e,i)=>{let o=i.get(e.icon);void 0===o&&(o=Op(e.icon),i.set(e.icon,o));const n=Lp(t);for(const t of n)Rp(t,o);this.agentPinDecoratedContainers.add(t);const r=Vp(t,n);return"unrecognised"===r&&this.noteUnrecognisedAgentPin(t),r},this.noteUnrecognisedAgentPin=t=>{try{if(this.agentPinMarkupReported)return;this.agentPinUnrecognisedContainers.add(t),null===this.agentPinMarkupRecheckTimer&&(this.agentPinMarkupRecheckTimer=setTimeout((()=>this.checkUnrecognisedAgentPins()),zp.AGENT_PIN_MARKUP_RECHECK_MS))}catch(t){console.warn("Error in noteUnrecognisedAgentPin: ",t)}},this.checkUnrecognisedAgentPins=()=>{try{null!==this.agentPinMarkupRecheckTimer&&(clearTimeout(this.agentPinMarkupRecheckTimer),this.agentPinMarkupRecheckTimer=null);const t=Array.from(this.agentPinUnrecognisedContainers);if(this.agentPinUnrecognisedContainers.clear(),this.agentPinMarkupReported||!this.isConnected)return;for(const e of t){const t=Fp(e);if(!e.isConnected||!this.agentPinTargets.has(t)||"unrecognised"!==Vp(e))continue;this.agentPinMarkupReported=!0;const i=_p.join(" ");return console.warn(`[Superflow] Agent pin not squared: the SDK rendered pin ${t} with none of the SDK pin internals (${i}). Update SDK_PIN_INTERNALS for this SDK version.`),void oh("Agent pin SDK markup not recognised","SDK pin internals changed",{annotationId:t,selectors:i})}}catch(t){console.warn("Error in checkUnrecognisedAgentPins: ",t)}},this.decoratePendingAgentPins=()=>{try{const t=Array.from(this.agentPinPendingContainers);if(this.agentPinPendingContainers.clear(),!this.isConnected)return;const e=new Map;let i=!1;for(const o of t){if(!o.isConnected||this.agentPinDecoratedContainers.has(o))continue;const t=this.agentPinTargets.get(Fp(o));t&&("light"!==this.decorateAgentPinContainer(o,t,e)||this.agentPinLightDomIds.has(t.id)||(this.agentPinLightDomIds.add(t.id),i=!0))}i&&this.writeAgentPinPageCss()}catch(t){console.warn("Error in decoratePendingAgentPins: ",t),oh("Error in decoratePendingAgentPins: ",t)}},this.writeAgentPinPageCss=()=>{const t=[];for(const e of this.agentPinLightDomIds){const i=this.agentPinTargets.get(e);i&&t.push(i)}const e=(t=>{var e;const i=new Map;for(const o of Array.isArray(t)?t:[]){if(!(null==o?void 0:o.id))continue;const t=null!==(e=i.get(o.icon))&&void 0!==e?e:[];t.push(`#${Mp}${Np(o.id)}`),i.set(o.icon,t)}return Array.from(i.entries()).map((([t,e])=>Op(t,e))).join("\n")})(t);e!==this.agentPinPageCss&&(this.agentPinPageCss=e,document.head&&Rp(document.head,e))},this.scheduleAgentPinDecorate=()=>{try{if(!this.isConnected||0===this.agentPinTargets.size||null!==this.agentPinFrameCancel)return;const t=()=>{this.agentPinFrameCancel=null,this.decoratePendingAgentPins()};if("function"==typeof requestAnimationFrame){const e=requestAnimationFrame(t);this.agentPinFrameCancel=()=>cancelAnimationFrame(e)}else{const e=setTimeout(t,16);this.agentPinFrameCancel=()=>clearTimeout(e)}}catch(t){console.warn("Error in scheduleAgentPinDecorate: ",t),oh("Error in scheduleAgentPinDecorate: ",t)}},this.onAgentPinMutations=t=>{try{if(0===this.agentPinTargets.size)return;const{added:e,changed:i}=(t=>{const e=new Set,i=new Set;try{for(const o of Array.isArray(t)?t:[]){const t=null==o?void 0:o.addedNodes;if(!t||0===t.length)continue;let n=!1;for(let i=0;i<t.length;i+=1){const o=t[i];if(1!==o.nodeType)continue;n=!0;const r=o;Fp(r)?e.add(r):Tp.includes(r.localName)&&r.querySelectorAll(Ap).forEach((t=>e.add(t)))}const r=o.target;if(!n||!r||1!==r.nodeType)continue;const s=r.closest(Ap);s&&i.add(s)}}catch{}return{added:Array.from(e),changed:Array.from(i)}})(t);let o=!1;for(const t of i)this.agentPinTargets.has(Fp(t))&&(this.agentPinDecoratedContainers.delete(t),this.agentPinPendingContainers.add(t),o=!0);for(const t of e)!this.agentPinDecoratedContainers.has(t)&&this.agentPinTargets.has(Fp(t))&&(this.agentPinPendingContainers.add(t),o=!0);o&&this.scheduleAgentPinDecorate()}catch(t){console.warn("Error in onAgentPinMutations: ",t),oh("Error in onAgentPinMutations: ",t)}},this.syncAgentPinDomObserver=()=>{var t;try{if(!this.isConnected||0===this.agentPinTargets.size)return null===(t=this.agentPinDomObserver)||void 0===t||t.disconnect(),void(this.agentPinDomObserver=null);if(this.agentPinDomObserver||"undefined"==typeof MutationObserver||!document.body)return;this.agentPinDomObserver=new MutationObserver((t=>this.onAgentPinMutations(t))),this.agentPinDomObserver.observe(document.body,{childList:!0,subtree:!0})}catch(t){console.warn("Error in syncAgentPinDomObserver: ",t),oh("Error in syncAgentPinDomObserver: ",t)}},this.teardownAgentPins=()=>{var t,e;try{null===(t=this.agentPinDomObserver)||void 0===t||t.disconnect(),this.agentPinDomObserver=null,null===(e=this.agentPinFrameCancel)||void 0===e||e.call(this),this.agentPinFrameCancel=null,this.agentPinPendingContainers.clear(),null!==this.agentPinMarkupRecheckTimer&&(clearTimeout(this.agentPinMarkupRecheckTimer),this.agentPinMarkupRecheckTimer=null),this.agentPinUnrecognisedContainers.clear(),this.agentPinLightDomIds=new Set,this.agentPinPageCss="",document.head&&Rp(document.head,"");for(const t of this.agentPinTargets.values())for(const e of Dp(t.id))Up(e);this.agentPinDecoratedContainers=new WeakSet}catch(t){console.warn("Error in teardownAgentPins: ",t),oh("Error in teardownAgentPins: ",t)}},this.showFirstCommentNudge=()=>{try{if(!this.autoCommentModeRequested||this.autoCommentModeArmedOnce||this.addCommentMode)return;this.firstCommentNudge=!0,this.showTourCommentTooltip=!0}catch(t){console.warn("Error in showFirstCommentNudge: ",t),oh("Error in showFirstCommentNudge: ",t)}},this.disableCommentMode=()=>{var t;try{(null===(t=this.commentElement)||void 0===t?void 0:t.disableCommentMode)&&this.commentElement.disableCommentMode()}catch(t){console.warn("Error in disableAddCommentMode: ",t),oh("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?R`
6208
+ `}catch(t){return console.warn("Error in getWordMark: ",t),R``}},this.generateLocation=()=>{try{if(this.autoLocation){const t=new URL(document.location).searchParams,e=new URL(document.location);e.searchParams.delete(At),e.searchParams.delete(Mt),e.searchParams.delete(Zt),e.searchParams.delete(Kt),e.searchParams.delete(se),e.searchParams.delete(ae);const i=t.get(re)||this.projectVersion;this.queryParamsComments||(e.search="");let o=(t=>{try{return t.replace(/#.*$/,"")}catch(e){return console.warn("Error in removeHashFromUrl: ",e),nh("Error in removeHashFromUrl: ",e),t}})(e.href);this.projectId&&(o=null==o?void 0:o.replace(window.location.origin,"")),this.location={url:o,version:i}}}catch(t){console.warn("Error in generateLocation: ",t),nh("Error in generateLocation: ",t)}},this.setLocation=t=>{var e,i,o,n;try{if(this.autoLocation&&window.Velt&&(null===Velt||void 0===Velt?void 0:Velt.setLocation)){if(this.version?(this.location||(this.location={}),this.location.version=this.version):this.location&&delete this.location.version,!(null==t?void 0:t.forceSetLocation)&&this.previousLocation&&(null===(e=this.previousLocation)||void 0===e?void 0:e.url)===(null===(i=this.location)||void 0===i?void 0:i.url)&&(null===(o=this.previousLocation)||void 0===o?void 0:o.version)===(null===(n=this.location)||void 0===n?void 0:n.version))return;const r=kd(JSON.parse(JSON.stringify(this.location)));if(r?this.location.id=`${r}`:delete this.location.id,this.usePageTitleAsLocationName){const t=document.title;t&&(this.location.locationName=t)}null===Velt||void 0===Velt||Velt.setLocation(JSON.parse(JSON.stringify(this.location))),eh({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location)),this.onVeltLocationChange()}}catch(t){console.warn("Error in setLocation: ",t),nh("Error in setLocation: ",t)}},this.onVeltLocationChange=()=>{try{window.dispatchEvent(new CustomEvent("veltLocationChange",{detail:this.location}))}catch(t){console.warn("Error in onVeltLocationChange: ",t),nh("Error in onVeltLocationChange: ",t)}},this.applyServerAdminDecision=t=>{try{const e=(({currentRole:t,serverIsAdmin:e,roleLookupFailed:i=!1})=>{try{return!0===e&&i?"Admin":!1===e&&"Admin"===t?"Commenter":t}catch(e){return console.warn("Error in resolveRoleAfterTokenMint: ",e),t}})({currentRole:this.snippylyUserRole,serverIsAdmin:t,roleLookupFailed:this.suggestionRoleLookupFailed});e!==this.snippylyUserRole&&(this.snippylyUserRole=e,this.syncRequestMode()),"boolean"==typeof t&&(this.suggestionRoleLookupFailed=!1),this.suggestionViewerRoleResolved=!0,this.applySuggestionActionStyles()}catch(t){console.warn("Error in applyServerAdminDecision: ",t)}},this.resolveSuggestionRoleAsLookupFailed=()=>{try{this.suggestionRoleLookupFailed=!0,this.suggestionViewerRoleResolved=!0,this.applySuggestionActionStyles()}catch(t){console.warn("Error in resolveSuggestionRoleAsLookupFailed: ",t),nh("Error in resolveSuggestionRoleAsLookupFailed: ",t)}},this.identifySnippyly=async()=>{var t,e,i,o;let n="",r="",s=!1;try{if(this.invalidApiKey=!1,this.clientMode)return void await this.identifyClient();let o={name:"Default User",email:"default@usesuperflow.com",userId:"default",isAnonymous:!0,organizationId:this.apiKey};const a=this.isRunningUnderLivePreview(),l=a?this.readLiveSignIn():null;let c;c=a?l?{...l.user}:null:this.customLoginEnabled&&this.providedUser?this.providedUser:Nd(),ka("[Superflow][identify] resolved user (pre-iam)",{source:a?l?"liveSignIn":"liveGuest":this.customLoginEnabled&&this.providedUser?"providedUser":"token",email:null==c?void 0:c.email,userId:null==c?void 0:c.userId,name:null==c?void 0:c.name,isAnonymous:null==c?void 0:c.isAnonymous});const d=await this.getSamlConfig(),h=new URL(document.location);if(h.searchParams.has(Yt)&&h.searchParams.delete(Yt),d&&(this.signInUrl=`${Je}saml/${d.slug}/login?redirect_url=${encodeURIComponent(null==h?void 0:h.toString())}&source=sf`,window.Superflow.signInUrl=this.signInUrl),((null==c?void 0:c.email)||a&&(null==c?void 0:c.userId))&&(o=c),o.isAnonymous)delete o.groupId;else{const t=Velt.getDocumentId()||this.serverDocumentId;t&&(o.groupId=t+"")}if(this.customLoginEnabledLocally||(null===(t=null==o?void 0:o.contacts)||void 0===t?void 0:t.length)&&(o.contacts=[]),n=null==o?void 0:o.email,r=null==o?void 0:o.userId,(null==o?void 0:o.isAnonymous)&&this.projectId&&(this.guestMode||a)){const t=Ld(!0,this.apiKey);t&&(o=JSON.parse(JSON.stringify(t)))}(null==o?void 0:o.isAnonymous)||(this.loading=!0);const u={};(null==o?void 0:o.groupId)&&(u.groupId=null==o?void 0:o.groupId),o.organizationId=this.apiKey;const p=await lh(this.apiKey,this.projectId||"",null==o?void 0:o.email,null==o?void 0:o.userId),v=null==p?void 0:p.isAdmin;this.snippylyUserRole=v?"Admin":"Commenter",this.suggestionRoleLookupFailed="boolean"!=typeof v,this.suggestionViewerRoleResolved=!0,s=!0,this.applySuggestionActionStyles(),ka("[Superflow][identify] iamResponse",p,{isAdminUser:v,snippylyUserRole:this.snippylyUserRole,email:null==o?void 0:o.email,userId:null==o?void 0:o.userId});const g=!(a||this.customLoginEnabled&&this.providedUser);this.identityCameFromToken=g,this.identityLiveSignIn=l;const f=((t,e)=>!(!e||(null==t?void 0:t.isAnonymous)||(null==t?void 0:t.isGuest)||!(null==t?void 0:t.userId)))(o,g),m=f&&((t,e)=>{try{if(!t||!e)return!1;const i=!!e.name&&e.name!==t.name,o=!!e.photoUrl&&e.photoUrl!==t.photoUrl;return ka("[Superflow][identity] hasProfileChanged",{nameChanged:i,photoChanged:o,localName:t.name,savedName:e.name,localPhotoUrl:t.photoUrl,savedPhotoUrl:e.photoUrl}),i||o}catch(t){return console.warn("Error in hasProfileChanged: ",t),nh("Error in hasProfileChanged: ",t),!1}})(o,p);if(ka("[Superflow][identify] enrichment gate",{cameFromToken:g,willEnrichIdentity:f,profileChanged:m,forceReset:m,isAnonymous:null==o?void 0:o.isAnonymous,isGuest:null==o?void 0:o.isGuest,userId:null==o?void 0:o.userId,nameBefore:null==o?void 0:o.name}),f&&(o=((t,e)=>t&&e?{...t,name:e.name||t.name,photoUrl:e.photoUrl||t.photoUrl}:t)(o,p),ka("[Superflow][identify] enriched user",{nameAfter:null==o?void 0:o.name,photoUrl:null==o?void 0:o.photoUrl})),v&&(u.isAdmin=v,v&&this.allFeatureDisabled&&(this.allFeatureDisabled=!1)),this.restoreContentWarningSidebarState(),!this.projectDeleted&&(null==o?void 0:o.userId)&&!(null==o?void 0:o.isGuest)&&!(null==o?void 0:o.isAnonymous)&&this.documentId)try{await bh(this.apiKey,this.documentId,o.userId,o.name,o.email,this.credentialFor(o,g))}catch(t){nh("checkDocumentUserAndCreateError",t)}ka("[Superflow][identify] setVeltAuthProvider options",{forceReset:m,profileChanged:m,userName:null==o?void 0:o.name,userId:null==o?void 0:o.userId});const[w]=await Promise.all([Velt.setVeltAuthProvider({user:o,options:{throwError:!0,forceReset:m},retryConfig:{retryCount:3,retryDelay:1e3},generateToken:async()=>{if(this.fallBackToGuestIfLiveSignInExpired(l))return null;const t=this.credentialFor(o,g),e=await vh(this.apiKey,null==o?void 0:o.userId,u,t);return this.applyServerAdminDecision(null==e?void 0:e.isAdmin),null==e?void 0:e.token},onError:t=>{console.log("Error signing to velt - ",t),this.fallBackToGuestIfLiveSignInExpired(l)||(this.invalidApiKey=!0)}}),this.fetchAndApplyFeatureAccess()]);if(this.hasAgentAccess&&this.insertShadowDOM(),this.invalidApiKey)throw"Invalid Api Key - Domain Not Whitelisted";f&&((t=>{try{const e={userId:null==t?void 0:t.userId,name:null==t?void 0:t.name,email:null==t?void 0:t.email,photoUrl:null==t?void 0:t.photoUrl},i=_d(JSON.stringify(e),Qe,Xe);Ad(Qt,i,!0)}catch(t){console.warn("Error in saveUserToken: ",t),nh("Error in saveUserToken: ",t)}})(o),ka("[Superflow][identify] token rewritten post-signin, re-read",{persistedName:null===(e=Nd())||void 0===e?void 0:e.name})),ka("[Superflow][identify] velt auth response",{name:null==w?void 0:w.name,email:null==w?void 0:w.email,userId:null==w?void 0:w.userId,userSnippylyId:null==w?void 0:w.userSnippylyId,tokenUserProperties:u}),ih(JSON.parse(JSON.stringify(w||{}))),(null==o?void 0:o.isAnonymous)||(this.snippylyUser=JSON.parse(JSON.stringify(o)),ka("[Superflow][identify] this.snippylyUser (rendered) name",null===(i=this.snippylyUser)||void 0===i?void 0:i.name)),this.syncRequestMode();const y=JSON.parse(JSON.stringify(w||{}));(null==y?void 0:y.userSnippylyId)&&!(null==y?void 0:y.isGuest)&&this.checkToMigrateGuestUser(y,this.credentialFor(y,g)),Velt.getUserRole$().subscribe((t=>{var e;t&&(this.loading=!1,null===(e=this.commentElement)||void 0===e||e.enablePriority(),this.applyCheckPriorities())})),this.contactListSubscription=Velt.getContactElement().getContactList().subscribe((t=>{var e;this.loading=!1,(null===(e=null==t?void 0:t.organizationUsers)||void 0===e?void 0:e.length)>0&&(this.checkPrivateCommentModeFromStorage(),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null))})),this.subscribePlanAndDocumentMetadata(),eh({clientUserId:null==o?void 0:o.userId});try{oh(o)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),this.showFirstCommentNudge(),setTimeout((()=>{Md(ce)||this.autoCommentModeArmedOnce||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(this.loading=!1,this.signInError=!0,s||this.resolveSuggestionRoleAsLookupFailed(),t&&"string"==typeof t&&(null===(o=null==t?void 0:t.toLowerCase())||void 0===o?void 0:o.includes("invalid"))){this.invalidApiKey=!0,rh(gt.Events.DOMAIN_NOT_WHITELISTED),this.projectId&&ah(this.apiKey,this.projectId);if(new URL(document.location).searchParams.has(se))this.isSigningInUserAdmin=!0;else if(Md(de))this.isSigningInUserAdmin="true"===Md(de,!0);else{const t=await lh(this.apiKey,this.projectId||"",n,r);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),Ad(de,this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),nh("Error in identifySnippyly: ",t)}},this.subscribePlanAndDocumentMetadata=()=>{try{if((null===Velt||void 0===Velt?void 0:Velt.isPlanExpired$)&&(null===Velt||void 0===Velt||Velt.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),nh("Error in isPlanExpired$: ",t)}))),null===Velt||void 0===Velt?void 0:Velt.on){let t;null===Velt||void 0===Velt||Velt.on("initUpdate").subscribe((e=>{"setDocumentsSuccess"===e.event&&(t&&(t.unsubscribe(),t=null),t=null===Velt||void 0===Velt?void 0:Velt.getDocumentMetadata().subscribe((async t=>{await this.handleDocumentMetadataUpdate(t)}),(t=>{console.warn("Error in getDocumentMetadata: ",t),nh("Error in getDocumentMetadata: ",t)})))}))}}catch(t){console.warn("Error in subscribePlanAndDocumentMetadata: ",t),nh("Error in subscribePlanAndDocumentMetadata: ",t)}},this.detectClientModeFromPage=t=>{try{return function(t){try{const e=new URLSearchParams(t.search||"");for(const t of oi)if(e.has(t))return!1;if(e.has(ai))return!1;for(const e of ni)if(wi(t.local,e))return!1;for(const e of ri)if(wi(t.session||null,e))return!1;return!!gi(t.local)}catch(t){return console.warn("[superflow client mode] detectClientMode failed, not client mode:",t),!1}}({search:t,local:mi((()=>window.localStorage)),session:mi((()=>window.sessionStorage))})}catch(t){return console.warn("Error in detectClientModeFromPage: ",t),!1}},this.getClientSessionApi=()=>(this.clientSessionApi||(this.clientSessionApi=function(t){const e=t.origin;return{validateLiveSession:async i=>{try{const o=await di(t,"validateLiveSession",{session:i,origin:e});return"ok"!==o.kind?o:function(t){try{const e=t;return!!e&&"object"==typeof e&&!!e.project&&"object"==typeof e.project&&"string"==typeof e.project.documentId&&!!e.client&&"object"==typeof e.client&&"string"==typeof e.client.userId&&e.client.userId.length>0}catch(t){return!1}}(o.result)?{kind:"ok",result:o.result}:(console.warn("[superflow client mode] validateLiveSession answered without a client identity"),{kind:"transport"})}catch(t){return console.warn("[superflow client mode] validateLiveSession failed:",t),{kind:"transport"}}},generateLiveAuthToken:async i=>{try{const o=await di(t,"generateLiveAuthToken",{session:i,origin:e});return"ok"!==o.kind?o:function(t){try{const e=t;return!!e&&"object"==typeof e&&"string"==typeof e.token&&e.token.length>0&&!!e.user&&"object"==typeof e.user&&"string"==typeof e.user.userId&&e.user.userId.length>0}catch(t){return!1}}(o.result)?{kind:"ok",result:o.result}:(console.warn("[superflow client mode] generateLiveAuthToken answered without a token or a user"),{kind:"transport"})}catch(t){return console.warn("[superflow client mode] generateLiveAuthToken failed:",t),{kind:"transport"}}},notifyLiveRequest:async(i,o)=>{var n,r;try{const s=await di(t,"notifyLiveRequest",{session:i,origin:e,annotationId:o});if("ok"!==s.kind)return s;const a=null===(n=s.result)||void 0===n?void 0:n.reason;return{kind:"ok",result:{notified:!0===(null===(r=s.result)||void 0===r?void 0:r.notified),reason:"string"==typeof a?a:null}}}catch(t){return console.warn("[superflow client mode] notifyLiveRequest failed:",t),{kind:"transport"}}}}}({fetchFn:(t,e)=>window.fetch(t,e),endpoint:ii,origin:window.location.origin})),this.clientSessionApi),this.resolveClientSession=()=>{try{return this.clientSessionResolution||(this.clientSessionResolution=this.validateClientSession().finally((()=>{this.clientSessionResolution=null}))),this.clientSessionResolution}catch(t){return console.warn("Error in resolveClientSession: ",t),Promise.resolve(!1)}},this.validateClientSession=async()=>{try{const t=mi((()=>window.localStorage)),e=gi(t);if(!e)return this.blockClientMode("no stored session"),!1;const i=await this.getClientSessionApi().validateLiveSession(e);return"error"===i.kind?(fi(t),this.blockClientMode(`session refused (${i.code})`),!1):"transport"===i.kind?(this.blockClientMode("session check failed; kept for the next page view"),!1):(this.clientSession=e,this.clientGrant=i.result,this.clientModeBlocked=!1,!0)}catch(t){return this.blockClientMode("session check threw"),console.warn("Error in validateClientSession: ",t),nh("Error in validateClientSession: ",t),!1}},this.blockClientMode=t=>{try{this.clientModeBlocked=!0,this.loading=!1,console.warn(`[superflow client mode] ${t}`)}catch(t){console.warn("Error in blockClientMode: ",t)}},this.isClientRequestsMode=()=>{var t;try{return this.clientMode&&Si(null===(t=this.clientGrant)||void 0===t?void 0:t.project)}catch(t){return console.warn("Error in isClientRequestsMode: ",t),this.clientMode}},this.isClientDefaultMode=()=>{try{return this.clientMode&&!!this.clientGrant&&!Si(this.clientGrant.project)}catch(t){return console.warn("Error in isClientDefaultMode: ",t),!1}},this.identifyClient=async()=>{try{const t=this.clientSession,e=this.clientGrant;if(!t||!e)return void this.blockClientMode("sign-in without a validated session");const i=this.getClientSessionApi(),o=await i.generateLiveAuthToken(t);if("error"===o.kind)return fi(mi((()=>window.localStorage))),void this.blockClientMode(`token refused (${o.code})`);if("transport"===o.kind)return void this.blockClientMode("token call failed; session kept for the next page view");const n=o.result.user,r=function({api:t,session:e,initialToken:i}){let o=i;return async()=>{try{if(o){const t=o;return o=null,t}const i=await t.generateLiveAuthToken(e);return"ok"===i.kind?i.result.token:null}catch(t){return console.warn("[superflow client mode] generateToken failed:",t),null}}}({api:i,session:t,initialToken:o.result.token});this.loading=!0;const[s]=await Promise.all([Velt.setVeltAuthProvider({user:n,options:{throwError:!0,forceReset:!1},retryConfig:{retryCount:3,retryDelay:1e3},generateToken:r,onError:t=>{console.warn("Error signing the client in to velt - ",t),this.invalidApiKey=!0}}),this.fetchAndApplyFeatureAccess()]);if(this.invalidApiKey)throw"Invalid Api Key - Domain Not Whitelisted";this.clientUser=n,this.guestUserNameUpdated=!0,this.snippylyUserRole="Commenter",ih(JSON.parse(JSON.stringify(s||{}))),this.snippylyUser=JSON.parse(JSON.stringify(n)),this.loading=!1,n.userId!==e.client.userId&&this.applyClientSidebarFilter(n.userId),(null===Velt||void 0===Velt?void 0:Velt.getUserRole$)&&Velt.getUserRole$().subscribe((t=>{t&&(this.loading=!1)})),this.subscribePlanAndDocumentMetadata(),eh({clientUserId:n.userId}),rh(gt.Events.CLIENT_MODE_LOADED,{projectId:this.projectId,side:ki(e.project),hasTitle:!!Ei(e.project),requestsEnabled:Si(e.project)})}catch(t){this.loading=!1,this.signInError=!0,this.blockClientMode("sign-in failed"),console.warn("Error in identifyClient: ",t),nh("Error in identifyClient: ",t)}},this.applyClientModeToCommentElement=()=>{var t,e,i;try{if(!this.isClientRequestsMode()||!this.commentElement)return;"function"==typeof this.commentElement.setContextProvider&&this.commentElement.setContextProvider((()=>bi(window.location.href))),"function"==typeof this.commentElement.enablePrivateMode&&this.commentElement.enablePrivateMode({type:me});const o=(null===(t=this.clientUser)||void 0===t?void 0:t.userId)||(null===(i=null===(e=this.clientGrant)||void 0===e?void 0:e.client)||void 0===i?void 0:i.userId);o&&this.applyClientSidebarFilter(o)}catch(t){console.warn("Error in applyClientModeToCommentElement: ",t),nh("Error in applyClientModeToCommentElement: ",t)}},this.applyClientSidebarFilter=t=>{try{if(!this.commentElement||!t)return;"function"==typeof this.commentElement.setCommentSidebarFilters&&this.commentElement.setCommentSidebarFilters(function(t){return{people:[{userId:t}]}}(t)),"function"==typeof this.commentElement.enableFilterCommentsOnDom&&this.commentElement.enableFilterCommentsOnDom()}catch(t){console.warn("Error in applyClientSidebarFilter: ",t),nh("Error in applyClientSidebarFilter: ",t)}},this.setupClientSidebarFilter=()=>{try{if(!this.commentElement||"function"!=typeof this.commentElement.on)return;this.commentElement.on("commentSidebarDataInit").subscribe((t=>{this.filterClientCommentsInSidebar(t)})),this.commentElement.on("commentSidebarDataUpdate").subscribe((t=>{this.filterClientCommentsInSidebar(t)}))}catch(t){console.warn("Error in setupClientSidebarFilter: ",t),nh("Error in setupClientSidebarFilter: ",t)}},this.filterClientCommentsInSidebar=t=>{var e,i,o;try{if(this.isSettingSidebarData||!t||!this.commentElement||this.sidebarV2Enabled)return;const n=(null===(e=this.clientUser)||void 0===e?void 0:e.userId)||(null===(o=null===(i=this.clientGrant)||void 0===i?void 0:i.client)||void 0===o?void 0:o.userId);if(!n||!Array.isArray(t.commentAnnotations))return;const r="/"+this.normalizePagePath(new URL(window.location.href).pathname),s=Ci(t.commentAnnotations,n,r);this.isSettingSidebarData=!0,this.commentElement.setCommentSidebarData(s,{grouping:!0}),this.isSettingSidebarData=!1}catch(t){this.isSettingSidebarData=!1,console.warn("Error in filterClientCommentsInSidebar: ",t),nh("Error in filterClientCommentsInSidebar: ",t)}},this.trackClientRequestAdded=()=>{try{if(!this.isClientRequestsMode())return;rh(gt.Events.CLIENT_REQUEST_ADDED,{projectId:this.projectId})}catch(t){console.warn("Error in trackClientRequestAdded: ",t)}},this.notifyClientRequest=t=>{try{if(!this.isClientRequestsMode()||!this.clientSession)return;const e=yi(t);if(!e||this.notifiedClientRequests.has(e))return;this.notifiedClientRequests.add(e),this.sendClientNotify(e,"first")}catch(t){console.warn("Error in notifyClientRequest: ",t)}},this.sendClientNotify=(t,e)=>{try{const i=this.clientSession;if(!this.isClientRequestsMode()||!i)return;this.getClientSessionApi().notifyLiveRequest(i,t).then((i=>{var o;"ok"!==i.kind?"error"!==i.kind||"not-found"!==i.code||"first"!==e?"error"===i.kind?console.warn(`[superflow client mode] notifyLiveRequest refused (${i.code})`):console.warn("[superflow client mode] notifyLiveRequest could not reach the backend"):this.clientNotifyRetryTimer((()=>this.sendClientNotify(t,"retry")),Hp.CLIENT_NOTIFY_RETRY_MS):i.result.notified||console.warn(`[superflow client mode] notifyLiveRequest: not sent (${null!==(o=i.result.reason)&&void 0!==o?o:"unknown"})`)})).catch((t=>{console.warn("Error in notifyLiveRequest: ",t)}))}catch(t){console.warn("Error in sendClientNotify: ",t)}},this.onClientSignInClick=()=>{try{try{rh(gt.Events.CLIENT_MODE_SIGN_IN_CLICKED,{projectId:this.projectId})}catch(t){console.warn("Error tracking clientModeSignInClicked: ",t)}if(Ad(At,"true",!1),this.customLoginEnabledLocally)return void this.reloadPage();this.loginWithGoogle()}catch(t){console.warn("Error in onClientSignInClick: ",t),nh("Error in onClientSignInClick: ",t)}},this.reloadPage=()=>{try{window.location.reload()}catch(t){console.warn("Error in reloadPage: ",t)}},this.onClientRequestsClick=()=>{var t,e,i;try{if(this.commentElement&&"function"==typeof this.commentElement.toggleCommentSidebar)return void this.commentElement.toggleCommentSidebar();const o=null===(e=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector)||void 0===e?void 0:e.call(t,"velt-sidebar-button");null===(i=(null==o?void 0:o.querySelector("button"))||o)||void 0===i||i.click()}catch(t){console.warn("Error in onClientRequestsClick: ",t),nh("Error in onClientRequestsClick: ",t)}},this.isRequestMode=()=>{try{return function(t){try{if(!t||!0!==t.maintenanceRequests)return!1;if(t.clientMode||t.embedMode||t.readOnlyMode||t.onboardingMode||t.passwordPending)return!1;const e=t.user;return!(!e||"object"!=typeof e||!0===e.isAnonymous||!0===e.isGuest)&&"string"==typeof t.role&&""!==t.role&&"Admin"!==t.role}catch(t){return console.warn("Error in decideRequestMode: ",t),!1}}({maintenanceRequests:this.maintenanceRequests,user:this.snippylyUser,role:this.snippylyUserRole,clientMode:this.clientMode,embedMode:this.embedMode,readOnlyMode:this.readOnlyMode,onboardingMode:this.onboardingMode,passwordPending:this.passwordProtected&&!this.isPasswordValid})}catch(t){return console.warn("Error in isRequestMode: ",t),!1}},this.syncRequestMode=()=>{try{const t=this.isRequestMode();if(t===this.requestModeApplied||!this.commentElement)return;this.requestModeApplied=t,t&&(this.applyRequestModeToCommentElement(),this.requestModeLoadedTracked||(this.requestModeLoadedTracked=!0,rh(gt.Events.REQUEST_MODE_LOADED,{projectId:this.projectId}))),this.lastCommentStatuses&&this.applyCommentStatuses(this.lastCommentStatuses)}catch(t){console.warn("Error in syncRequestMode: ",t),nh("Error in syncRequestMode: ",t)}},this.applyRequestModeToCommentElement=()=>{try{if(this.requestContextProviderSet||!this.commentElement||"function"!=typeof this.commentElement.setContextProvider)return;this.requestContextProviderSet=!0,this.commentElement.setContextProvider((()=>this.isRequestMode()?bi(window.location.href):void 0))}catch(t){console.warn("Error in applyRequestModeToCommentElement: ",t),nh("Error in applyRequestModeToCommentElement: ",t)}},this.onRequestModeCommentAdd=t=>{try{if(!this.isRequestMode())return;try{rh(gt.Events.REQUEST_ADDED,{projectId:this.projectId})}catch(t){console.warn("Error tracking requestAdded: ",t)}this.notifyAddedRequest(yi(t))}catch(t){console.warn("Error in onRequestModeCommentAdd: ",t)}},this.handleDocumentMetadataUpdate=async t=>{try{if(!t)return;const e=await ch(this.apiKey,null==t?void 0:t.clientDocumentId);Fd(e,this.isDriveOrPreviewHost(),this.projectIdSupplied)&&this.lockForDeletedProject(),this.setProjectConfigVariables("ok"===e.status?e.config:null),await this.fetchAndApplyFeatureAccess()}catch(t){console.warn("Error in handleDocumentMetadataUpdate: ",t),nh("Error in handleDocumentMetadataUpdate: ",t)}},this.lockForDeletedProject=()=>{this.projectDeleted=!0,this.applyVeltFeatureGates(),this.unmountVeltCollaborationElements()},this.fetchAndApplyFeatureAccess=async()=>{var t,e;try{const i=await xh(this.apiKey);if("error"===i.status||!i.featureAccess)return void console.warn("getFeatureAccess failed or returned no data; keeping the last known feature access");this.featureAccess=i.featureAccess,this.planLimitLocked=(t=>{var e;try{return!0===(null===(e=null==t?void 0:t.planStatus)||void 0===e?void 0:e.isOverPlanLimits)}catch(t){return!1}})(this.featureAccess),this.applyVeltFeatureGates(),this.applyStorageFeatureAccess();const o=null===(t=this.featureAccess)||void 0===t?void 0:t[Ch.Agents];this.hasAgentAccess=!0===(null==o?void 0:o.hasAccess);const n=null===(e=this.featureAccess)||void 0===e?void 0:e[Ch.WorkspacePrivateComments];this.hasPrivateCommentsAccess=!0===(null==n?void 0:n.hasAccess),this.isPrivateCommentsEnabledOnWorkspace=!0===(null==n?void 0:n.isPrivateCommentsEnabled),!this.canShowPrivateCommentToggle&&this.privateCommentModeEnabled&&(this.disablePrivateCommentModeOnCommentElement(),this.privateCommentModeEnabled=!1,Ad(fe,"false")),this.maybeApplyVisibilityOptionsToCommentElement()}catch(t){console.warn("Error in fetchAndApplyFeatureAccess: ",t),nh("Error in fetchAndApplyFeatureAccess: ",t)}},this.insertShadowDOM=()=>{try{if(document.querySelector("velt-wireframe"))return;const t=document.querySelector("velt-comments");t&&t.setAttribute("shadow-dom","true");const e=document.querySelector(`${Oe.VELT_COMMENTS_SIDEBAR_LEGACY}, ${Oe.VELT_COMMENTS_SIDEBAR_V2}`);e&&e.setAttribute("shadow-dom","true")}catch(t){console.warn("Error in insertShadowDOM: ",t),nh("Error in insertShadowDOM: ",t)}},this.applyStorageFeatureAccess=()=>{try{if(!this.featureAccess||!this.commentElement)return;const t=this.featureAccess[Ch.Storage];(null==t?void 0:t.hasUsageExhausted)&&(this.commentElement.disableAttachments(),this.commentElement.setRecordings("none"))}catch(t){nh("Error in applyStorageFeatureAccess: ",t)}},this.checkToMigrateGuestUser=async(t,e)=>{try{const i=Ld(!1,this.apiKey);if(i){const o=`${ie}:${i.userId}:${null==t?void 0:t.userId}`,n=Md(o,!1,"sessionStorage");if("with-credential"===n||"without-credential"===n&&!e)return;const r=await gh(this.apiKey,this.projectId||"",i,t,!0,e);if(!1===(null==r?void 0:r.success))return console.warn("[CWS Toolbar] Guest migration refused; keeping the guest user:",null==r?void 0:r.reason),void Ad(o,e?"with-credential":"without-credential",!1,"sessionStorage");Td(o,"sessionStorage"),Td(ee)}}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),nh("Error in checkToMigrationGuestUser: ",t)}},this.getComments=()=>{try{this.commentElement&&this.commentSubscription&&this.commentSubscription.unsubscribe()}catch(t){console.warn("Error in getComments: ",t),nh("Error in getComments: ",t)}},this.handleCommentSelection=t=>{var e,i,o,n,r,s,a,l,c,d,h;try{if(!1===(null==t?void 0:t.selected))return void(null===(e=null===Velt||void 0===Velt?void 0:Velt.setUiState)||void 0===e||e.call(Velt,{showButtons:!1}));const u=null==t?void 0:t.annotation;if(!u||!this.isAgentAnnotation(u))return void(null===(i=null===Velt||void 0===Velt?void 0:Velt.setUiState)||void 0===i||i.call(Velt,{showButtons:!1}));const p=this.resolveFullAnnotation(u);if(yu(p))return void(null===(o=null===Velt||void 0===Velt?void 0:Velt.setUiState)||void 0===o||o.call(Velt,{showButtons:bu(p).length>1,warningType:"site"}));const v=null===(r=null===(n=null==u?void 0:u.agent)||void 0===n?void 0:n.result)||void 0===r?void 0:r.incorrectWord,g=(null===(s=null==u?void 0:u.pageInfo)||void 0===s?void 0:s.path)||(null===(a=null==u?void 0:u.location)||void 0===a?void 0:a.path)||(null===(l=null==u?void 0:u.agent)||void 0===l?void 0:l.path);if(!v||!g)return void(null===(c=null===Velt||void 0===Velt?void 0:Velt.setUiState)||void 0===c||c.call(Velt,{showButtons:!1}));const f=this.normalizePagePath(g),m=v,w=null===(h=null===(d=null==u?void 0:u.agent)||void 0===d?void 0:d.result)||void 0===h?void 0:h.type;let y,b="";"grammar"===w?(y=this.grammarSuggestionPagePathMap,b="grammar"):(y=this.spellingSuggestionPagePathMap,b="spelling");const C=null==y?void 0:y.get(m);((null==C?void 0:C.get(f))||0)<=1?Velt.setUiState({showButtons:!1,warningType:b}):Velt.setUiState({showButtons:!0,warningType:b})}catch(t){console.warn("Error in handleCommentSelection: ",t),nh("Error in handleCommentSelection: ",t)}},this.processAgentComments=t=>{var e,i,o;try{const n=Array.isArray(t)?t:[];this.trackAgentPins(n),n.length&&!this.agentNamesFetched&&this.apiKey&&this.fetchAgentNames();const r=n.filter((t=>this.isAgentAnnotation(t)&&!gu(t)));if(this.sidebarV2Enabled&&!this.showAgentCommentsInSidebar&&0===r.length&&this.agentGroups.length>0){const t=new Set(this.agentGroups.flatMap((t=>{var e;return null!==(e=null==t?void 0:t.annotations)&&void 0!==e?e:[]})).map(su));for(const e of n){const i=su(e);i&&t.has(i)&&gu(e)&&this.removeAnnotationFromWarnings(i)}return}if(0===r.length)return this.hasContentWarnings=!1,this.contentWarningsCount=0,this.agentGroups=[],this.spellingSuggestionPagePathMap=new Map,void(this.grammarSuggestionPagePathMap=new Map);const s=new Map;for(const t of r){const i=this.extractAgentId((null===(e=null==t?void 0:t.agent)||void 0===e?void 0:e.agentFields)||[]);if(!i)continue;const o=s.get(i);o?o.push(t):s.set(i,[t])}const a=[],l=new Map,c=new Map;for(const[t,e]of s){const n=this.isCustomAgent((null===(o=null===(i=e[0])||void 0===i?void 0:i.agent)||void 0===o?void 0:o.agentFields)||[]),r=this.resolveAgentGroupName(t,e),{warnings:s,warningCount:d}=this.buildAgentWarnings(t,e,l,c);a.push({agentId:t,agentName:r,isCustom:n,warningCount:d,warnings:s,annotations:e})}if(a.sort(((t,e)=>e.warningCount-t.warningCount)),this.agentGroups=a,this.onboardingMode)for(const t of a)this.onboardingOpenedAgentIds.add(t.agentId);const d=a.reduce(((t,e)=>t+e.warningCount),0);this.contentWarningsCount=d,this.hasContentWarnings=d>0,this.spellingSuggestionPagePathMap=l,this.grammarSuggestionPagePathMap=c}catch(t){console.warn("Error in processAgentComments: ",t),nh("Error in processAgentComments: ",t)}},this.extractAgentId=t=>{try{if(!Array.isArray(t)||0===t.length)return null;for(const e of t)if(null==e?void 0:e.startsWith($e.AGENT))return e.substring($e.AGENT.length);return null}catch(t){return console.warn("Error in extractAgentId: ",t),null}},this.isCustomAgent=t=>{try{return!!Array.isArray(t)&&t.includes($e.AGENT_TYPE_CUSTOM)}catch(t){return console.warn("Error in isCustomAgent: ",t),!1}},this.resolveAgentGroupName=(t,e)=>{var i;try{return bp(null===(i=this.agentNameMap)||void 0===i?void 0:i.get(t),e)||this.getAgentNameFromId(t)}catch(e){return console.warn("Error in resolveAgentGroupName: ",e),nh("Error in resolveAgentGroupName: ",e),this.getAgentNameFromId(t)}},this.resolveAgentDisplayName=t=>{var e,i;try{return null!==(i=null===(e=this.agentNameMap)||void 0===e?void 0:e.get(t))&&void 0!==i?i:this.getAgentNameFromId(t)}catch(t){return console.warn("Error in resolveAgentDisplayName: ",t),Bt}},this.getAgentNameFromId=t=>{try{return t&&/^[a-z]+(-[a-z]+)*$/.test(t)?t.split("-").map((t=>`${t.charAt(0).toUpperCase()}${t.slice(1)}`)).join(" "):Bt}catch(t){return console.warn("Error in getAgentNameFromId: ",t),Bt}},this.fetchAgentNames=async()=>{var t,e,i;try{this.agentNamesFetched=!0;const{getAgents:o}=await Promise.resolve().then((function(){return Th})),n=await o(this.apiKey),r=new Map;for(const i of n){const o=null!==(t=null==i?void 0:i.id)&&void 0!==t?t:"",n=null!==(e=null==i?void 0:i.name)&&void 0!==e?e:"";o&&n&&r.set(o,n)}if(this.agentNameMap=r,(null===(i=this.agentGroups)||void 0===i?void 0:i.length)>0){const t=this.agentGroups.map((t=>({...t,agentName:this.resolveAgentGroupName(t.agentId,t.annotations)})));this.agentGroups=t}}catch(t){this.agentNamesFetched=!1,console.warn("Error in fetchAgentNames: ",t)}},this.sanitiseAgentRunStatusRows=t=>{try{const e=[],i=Array.isArray(t)?t.slice(0,50):[];for(const t of i){const i=null==t?void 0:t.agentId;if("string"!=typeof i||0===i.length)continue;const o=("string"==typeof(null==t?void 0:t.name)&&t.name.length>0?t.name:this.resolveAgentDisplayName(i)).slice(0,80),n="string"==typeof(null==t?void 0:t.status)&&jt.includes(t.status),r=!0!==(null==t?void 0:t.terminal)&&!n,s=null==t?void 0:t.findings,a="number"==typeof s&&Number.isFinite(s)&&s>=0?Math.floor(s):0;e.push(n?{agentId:i,agentName:o,isRunning:r,findingsCount:a,failed:!0}:{agentId:i,agentName:o,isRunning:r,findingsCount:a})}return e}catch(t){return console.warn("Error in sanitiseAgentRunStatusRows: ",t),nh("Error in sanitiseAgentRunStatusRows: ",t),[]}},this.getPortalOrigins=()=>{try{if(this.portalOrigins)return this.portalOrigins;const t=new Set;for(const e of[Je,Ye])try{const{origin:i,hostname:o,protocol:n}=new URL(e);t.add(i),o.endsWith(".firebaseapp.com")?t.add(`${n}//${o.replace(/\.firebaseapp\.com$/,".web.app")}`):o.endsWith(".web.app")&&t.add(`${n}//${o.replace(/\.web\.app$/,".firebaseapp.com")}`)}catch{}return this.portalOrigins=[...t],this.portalOrigins}catch(t){return console.warn("Error in getPortalOrigins: ",t),nh("Error in getPortalOrigins: ",t),[]}},this.isAllowedPortalOrigin=t=>{try{if("string"!=typeof t||0===t.length||"null"===t)return!1;if(this.getPortalOrigins().includes(t))return!0;const{protocol:e,hostname:i}=new URL(t);return!("http:"!==e&&"https:"!==e||"localhost"!==i&&"127.0.0.1"!==i)}catch{return!1}},this.readAncestorOrigins=()=>{var t;try{const e=null===(t=window.location)||void 0===t?void 0:t.ancestorOrigins;return e?Array.from(e):null}catch{return null}},this.readDocumentReferrer=()=>{try{return document.referrer||""}catch{return""}},this.getParentFrameOrigin=()=>{try{if(!window.parent||window.parent===window)return null;const t=this.readAncestorOrigins();if(t)return t[0]||null;const e=this.readDocumentReferrer();return e?new URL(e).origin:null}catch{return null}},this.isFramedByPortal=()=>{try{return this.isAllowedPortalOrigin(this.getParentFrameOrigin())}catch(t){return console.warn("Error in isFramedByPortal: ",t),nh("Error in isFramedByPortal: ",t),!1}},this.canHonourStoredOnboardingFlag=()=>{try{if(!window.parent||window.parent===window)return!1;const t=this.readAncestorOrigins();return!t||this.isAllowedPortalOrigin(t[0])}catch(t){return console.warn("Error in canHonourStoredOnboardingFlag: ",t),nh("Error in canHonourStoredOnboardingFlag: ",t),!1}},this.getPortalTargetOrigin=()=>{try{const t=this.getParentFrameOrigin();return t&&this.isAllowedPortalOrigin(t)?t:"*"}catch{return"*"}},this.startAgentRunStatusListener=()=>{try{if(!this.onboardingMode||!this.isConnected)return void this.stopAgentRunStatusListener();if(this.agentRunStatusListening)return;if(!window.parent||window.parent===window)return void(this.agentRunStatusSettled=!0);if(window.addEventListener("message",this.onAgentRunStatusMessage),this.agentRunStatusListening=!0,this.startOnboardingViewportListener(),window.parent.postMessage({type:Rt},this.getPortalTargetOrigin()),this.agentRunStatusSettled){if(this.agentRunStatuses.some((t=>null==t?void 0:t.isRunning))){const t=this.agentRunStatusLastMessageAt>0?Date.now()-this.agentRunStatusLastMessageAt:0;this.armAgentRunStatusWatchdog(Math.max(0,Pt-t))}}else this.armAgentRunStatusWatchdog(2e4);this.ensureOnboardingFindingsLoaded()}catch(t){console.warn("Error in startAgentRunStatusListener: ",t),nh("Error in startAgentRunStatusListener: ",t)}},this.stopAgentRunStatusListener=()=>{try{window.removeEventListener("message",this.onAgentRunStatusMessage),this.agentRunStatusListening=!1,this.clearAgentRunStatusWatchdog(),this.clearOnboardingFindingsFetch(),this.stopOnboardingViewportListener()}catch(t){console.warn("Error in stopAgentRunStatusListener: ",t),nh("Error in stopAgentRunStatusListener: ",t)}},this.onAgentRunStatusMessage=t=>{try{if(!this.onboardingMode)return;if(!window.parent||window.parent===window||(null==t?void 0:t.source)!==window.parent)return;if(!this.isAllowedPortalOrigin(null==t?void 0:t.origin))return;const e=null==t?void 0:t.data;if((null==e?void 0:e.type)===Dt)return void this.postOnboardingDiagnostics(t.origin);if((null==e?void 0:e.type)!==Lt||!Array.isArray(null==e?void 0:e.agents))return;this.agentRunStatuses=this.sanitiseAgentRunStatusRows(e.agents),this.agentRunStatusTimedOut=!1,this.agentRunStatusLastMessageAt=Date.now();const i=!0===(null==e?void 0:e.allTerminal);(this.agentRunStatuses.length>0||i)&&(this.agentRunStatusSettled=!0);this.agentRunStatuses.some((t=>null==t?void 0:t.isRunning))?this.armAgentRunStatusWatchdog(Pt):this.agentRunStatusSettled&&this.clearAgentRunStatusWatchdog(),this.ensureOnboardingFindingsLoaded()}catch(t){console.warn("Error in onAgentRunStatusMessage: ",t),nh("Error in onAgentRunStatusMessage: ",t)}},this.postOnboardingDiagnostics=t=>{var e,i,o,n,r,s;try{if(!this.onboardingMode||!window.parent||window.parent===window||!this.isAllowedPortalOrigin(t))return;const a=(null!==(e=this.lastStreamAnnotations)&&void 0!==e?e:[]).filter((t=>this.isAgentAnnotation(t))).length;window.parent.postMessage({type:Ft,at:(new Date).toISOString(),version:ft,identity:{hasUser:!!this.snippylyUser,isGuest:!!(null===(i=this.snippylyUser)||void 0===i?void 0:i.isGuest),isAnonymous:!!(null===(o=this.snippylyUser)||void 0===o?void 0:o.isAnonymous),hasRole:!!this.snippylyUserRole,loading:this.loading},sdk:{hasCommentElement:!!this.commentElement,hasDocumentId:!!this.documentId,hasLocationPath:!!this.previewLocationPath,sidebarV2:this.sidebarV2Enabled,showAgentCommentsInSidebar:this.showAgentCommentsInSidebar,agentCommentsModeRequested:this.agentCommentsModeRequested,privateCommentsEnabled:this.isPrivateCommentsEnabledOnWorkspace,hasPrivateCommentsAccess:this.hasPrivateCommentsAccess},stream:{emissions:this.streamEmissionCount,lastEmissionAt:this.lastStreamEmissionAt?new Date(this.lastStreamEmissionAt).toISOString():null,lastSize:(null!==(n=this.lastStreamAnnotations)&&void 0!==n?n:[]).length,agentAnnotations:a},fetch:{attempts:this.onboardingFindingsFetchAttempts,inFlight:this.onboardingFindingsFetchInFlight,pending:null!==this.onboardingFindingsFetchTimer,lastCount:this.onboardingLastFetchCount,lastError:this.onboardingLastFetchError,fetchedAt:this.onboardingFetchedAt?new Date(this.onboardingFetchedAt).toISOString():null,unsynced:this.onboardingUnsyncedAnnotationIds.length},groups:(null!==(r=this.agentGroups)&&void 0!==r?r:[]).map((t=>({agentId:null==t?void 0:t.agentId,count:null==t?void 0:t.warningCount}))),statuses:(null!==(s=this.agentRunStatuses)&&void 0!==s?s:[]).map((t=>({agentId:null==t?void 0:t.agentId,isRunning:null==t?void 0:t.isRunning,findingsCount:null==t?void 0:t.findingsCount,failed:!!(null==t?void 0:t.failed),timedOut:!!(null==t?void 0:t.timedOut)}))),missing:this.getAgentIdsMissingFindings(),sidebarOpen:this.showContentWarningSidebar,settled:this.agentRunStatusSettled},t)}catch(t){console.warn("Error in postOnboardingDiagnostics: ",t),nh("Error in postOnboardingDiagnostics: ",t)}},this.isOnboardingAgentResolved=t=>{try{return this.onboardingOpenedAgentIds.has(t)||this.onboardingFetchResolvedAgentIds.has(t)}catch(t){return console.warn("Error in isOnboardingAgentResolved: ",t),!1}},this.getAgentIdsMissingFindings=()=>{var t,e;try{const i=new Set((null!==(t=this.agentGroups)&&void 0!==t?t:[]).map((t=>null==t?void 0:t.agentId)));return(null!==(e=this.agentRunStatuses)&&void 0!==e?e:[]).filter((t=>{var e;return!(null==t?void 0:t.isRunning)&&(null!==(e=null==t?void 0:t.findingsCount)&&void 0!==e?e:0)>0})).map((t=>null==t?void 0:t.agentId)).filter((t=>!!t&&!i.has(t)&&!this.isOnboardingAgentResolved(t)))}catch(t){return console.warn("Error in getAgentIdsMissingFindings: ",t),nh("Error in getAgentIdsMissingFindings: ",t),[]}},this.getFetchableMissingAgentIds=()=>{try{return this.onboardingFindingsFetchAttempts>=30?[]:this.getAgentIdsMissingFindings().filter((t=>{var e;return(null!==(e=this.onboardingFetchAttemptsByAgent.get(t))&&void 0!==e?e:0)<10}))}catch(t){return console.warn("Error in getFetchableMissingAgentIds: ",t),nh("Error in getFetchableMissingAgentIds: ",t),[]}},this.isOnboardingFindingsLoadExhausted=t=>{var e;try{return null===this.onboardingFindingsFetchTimer&&!this.onboardingFindingsFetchInFlight&&((null!==(e=this.onboardingFetchAttemptsByAgent.get(t))&&void 0!==e?e:0)>=10||this.onboardingFindingsFetchAttempts>=30)}catch(t){return console.warn("Error in isOnboardingFindingsLoadExhausted: ",t),!1}},this.getDisplayAgentRunStatuses=()=>{var t,e;try{if(!this.onboardingMode)return this.agentRunStatuses;const i=new Set((null!==(t=this.agentGroups)&&void 0!==t?t:[]).map((t=>null==t?void 0:t.agentId)));return(null!==(e=this.agentRunStatuses)&&void 0!==e?e:[]).map((t=>{var e;return(null==t?void 0:t.isRunning)||0===(null!==(e=null==t?void 0:t.findingsCount)&&void 0!==e?e:0)||i.has(null==t?void 0:t.agentId)?t:this.isOnboardingAgentResolved(t.agentId)?{...t,findingsResolved:!0}:this.isOnboardingFindingsLoadExhausted(t.agentId)?{...t,findingsUnavailable:!0}:t}))}catch(t){return console.warn("Error in getDisplayAgentRunStatuses: ",t),nh("Error in getDisplayAgentRunStatuses: ",t),this.agentRunStatuses}},this.ensureOnboardingFindingsLoaded=()=>{try{if(!this.onboardingMode||!this.agentRunStatusListening)return;if(null!==this.onboardingFindingsFetchTimer||this.onboardingFindingsFetchInFlight)return;if(0===this.getFetchableMissingAgentIds().length)return;this.onboardingFindingsFetchTimer=setTimeout((()=>this.fetchOnboardingFindings()),3e3)}catch(t){console.warn("Error in ensureOnboardingFindingsLoaded: ",t),nh("Error in ensureOnboardingFindingsLoaded: ",t)}},this.clearOnboardingFindingsFetch=()=>{try{null!==this.onboardingFindingsFetchTimer&&(clearTimeout(this.onboardingFindingsFetchTimer),this.onboardingFindingsFetchTimer=null)}catch(t){console.warn("Error in clearOnboardingFindingsFetch: ",t),nh("Error in clearOnboardingFindingsFetch: ",t)}},this.countOnboardingFetchAttempt=t=>{var e;this.onboardingFindingsFetchAttempts+=1;for(const i of t)this.onboardingFetchAttemptsByAgent.set(i,(null!==(e=this.onboardingFetchAttemptsByAgent.get(i))&&void 0!==e?e:0)+1)},this.fetchOnboardingFindings=async()=>{var t;try{if(this.onboardingFindingsFetchTimer=null,!this.onboardingMode)return;const e=this.getFetchableMissingAgentIds();if(0===e.length)return;if(this.countOnboardingFetchAttempt(e),"function"!=typeof(null===(t=this.commentElement)||void 0===t?void 0:t.fetchCommentAnnotations)||!this.documentId)return this.onboardingLastFetchError=Vt.SDK_NOT_READY,this.ensureOnboardingFindingsLoaded(),void this.requestUpdate();this.onboardingFindingsFetchInFlight=!0;const i=await this.commentElement.fetchCommentAnnotations({documentIds:[`${this.documentId}`]});if(this.onboardingFindingsFetchInFlight=!1,!this.onboardingMode)return;if(null===(null==i?void 0:i.data)||void 0===(null==i?void 0:i.data))this.onboardingLastFetchCount=0,this.onboardingLastFetchError=Vt.SDK_RETURNED_NULL;else{const t=this.flattenFetchedAnnotations(i);this.onboardingLastFetchCount=t.length,this.onboardingLastFetchError="",this.applyOnboardingFetchResult(t)}this.ensureOnboardingFindingsLoaded(),this.requestUpdate()}catch(t){this.onboardingFindingsFetchInFlight=!1,this.onboardingLastFetchError=Vt.FETCH_THREW,console.warn("Error in fetchOnboardingFindings: ",t),nh("Error in fetchOnboardingFindings: ",t),this.ensureOnboardingFindingsLoaded(),this.requestUpdate()}},this.applyOnboardingFetchResult=t=>{var e,i;try{const o=(Array.isArray(t)?t:[]).filter((t=>{const e=null==t?void 0:t.annotationId;return!!e&&!this.onboardingRemovedAnnotationIds.has(e)&&this.isAgentAnnotation(t)})),n=new Map;for(const t of o){const o=this.extractAgentId((null===(e=null==t?void 0:t.agent)||void 0===e?void 0:e.agentFields)||[]);if(!o)continue;const r=!gu(t);n.set(o,null!==(i=n.get(o))&&void 0!==i&&i||r)}for(const[t,e]of n)e?this.onboardingFetchResolvedAgentIds.delete(t):this.onboardingFetchResolvedAgentIds.add(t);this.onboardingFetchedAnnotations=o,this.onboardingFetchedAt=Date.now(),this.processAgentComments(this.mergeOnboardingFetchedAnnotations(this.lastStreamAnnotations))}catch(t){console.warn("Error in applyOnboardingFetchResult: ",t),nh("Error in applyOnboardingFetchResult: ",t)}},this.flattenFetchedAnnotations=t=>{try{const e=null==t?void 0:t.data;if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];const i=[];for(const t of Object.values(e))Array.isArray(t)&&i.push(...t);return i}catch(t){return console.warn("Error in flattenFetchedAnnotations: ",t),nh("Error in flattenFetchedAnnotations: ",t),[]}},this.mergeOnboardingFetchedAnnotations=t=>{var e;try{const i=Array.isArray(t)?t:[];if(!this.onboardingMode)return i;if(0===this.onboardingFetchedAnnotations.length)return this.setOnboardingUnsyncedAnnotationIds([]),i;const o=new Set(i.map((t=>null==t?void 0:t.annotationId)));if(this.sidebarV2Enabled&&!this.showAgentCommentsInSidebar){const t=new Map,n=(null!==(e=this.agentGroups)&&void 0!==e?e:[]).flatMap((t=>{var e;return null!==(e=null==t?void 0:t.annotations)&&void 0!==e?e:[]}));for(const e of[...n,...this.onboardingFetchedAnnotations]){const i=null==e?void 0:e.annotationId;!i||o.has(i)||t.has(i)||this.onboardingRemovedAnnotationIds.has(i)||t.set(i,e)}return t.size>0?[...i,...t.values()]:i}return this.onboardingFetchedAnnotations=this.onboardingFetchedAnnotations.filter((t=>{const e=null==t?void 0:t.annotationId;return!!e&&!o.has(e)&&!this.onboardingRemovedAnnotationIds.has(e)})),this.setOnboardingUnsyncedAnnotationIds(this.onboardingFetchedAnnotations.map((t=>t.annotationId))),this.onboardingFetchedAnnotations.length>0?[...i,...this.onboardingFetchedAnnotations]:i}catch(e){return console.warn("Error in mergeOnboardingFetchedAnnotations: ",e),nh("Error in mergeOnboardingFetchedAnnotations: ",e),Array.isArray(t)?t:[]}},this.setOnboardingUnsyncedAnnotationIds=t=>{try{const e=[...t].sort();e.join("\n")!==this.onboardingUnsyncedAnnotationIds.join("\n")&&(this.onboardingUnsyncedAnnotationIds=e)}catch(t){console.warn("Error in setOnboardingUnsyncedAnnotationIds: ",t)}},this.armAgentRunStatusWatchdog=t=>{try{this.clearAgentRunStatusWatchdog(),this.agentRunStatusWatchdogTimer=setTimeout((()=>this.applyAgentRunStatusTimeout()),t)}catch(t){console.warn("Error in armAgentRunStatusWatchdog: ",t),nh("Error in armAgentRunStatusWatchdog: ",t)}},this.clearAgentRunStatusWatchdog=()=>{try{null!==this.agentRunStatusWatchdogTimer&&(clearTimeout(this.agentRunStatusWatchdogTimer),this.agentRunStatusWatchdogTimer=null)}catch(t){console.warn("Error in clearAgentRunStatusWatchdog: ",t),nh("Error in clearAgentRunStatusWatchdog: ",t)}},this.applyAgentRunStatusTimeout=()=>{try{this.agentRunStatusWatchdogTimer=null,this.agentRunStatuses.some((t=>null==t?void 0:t.isRunning))&&(this.agentRunStatuses=this.agentRunStatuses.map((t=>(null==t?void 0:t.isRunning)?{...t,isRunning:!1,timedOut:!0}:t)),this.agentRunStatusTimedOut=!0),this.agentRunStatusSettled=!0}catch(t){console.warn("Error in applyAgentRunStatusTimeout: ",t),nh("Error in applyAgentRunStatusTimeout: ",t)}},this.startOnboardingViewportListener=()=>{try{if(this.onboardingViewportListening)return;window.addEventListener("resize",this.scheduleOnboardingViewportClamp),this.onboardingViewportListening=!0}catch(t){console.warn("Error in startOnboardingViewportListener: ",t),nh("Error in startOnboardingViewportListener: ",t)}},this.stopOnboardingViewportListener=()=>{var t;try{window.removeEventListener("resize",this.scheduleOnboardingViewportClamp),this.onboardingViewportListening=!1,null===(t=this.onboardingPanelResizeObserver)||void 0===t||t.disconnect(),this.onboardingPanelResizeObserver=null,this.onboardingObservedPanel=null,null!==this.onboardingClampFrame&&(cancelAnimationFrame(this.onboardingClampFrame),this.onboardingClampFrame=null)}catch(t){console.warn("Error in stopOnboardingViewportListener: ",t),nh("Error in stopOnboardingViewportListener: ",t)}},this.observeOnboardingPanel=()=>{var t,e,i;try{if(!this.agentRunStatusListening||"undefined"==typeof ResizeObserver)return;const o=null!==(e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".onboarding-container content-warning-sidebar"))&&void 0!==e?e:null;if(o===this.onboardingObservedPanel)return;if(null===(i=this.onboardingPanelResizeObserver)||void 0===i||i.disconnect(),this.onboardingObservedPanel=o,!o)return;this.onboardingPanelResizeObserver||(this.onboardingPanelResizeObserver=new ResizeObserver((()=>this.scheduleOnboardingViewportClamp()))),this.onboardingPanelResizeObserver.observe(o)}catch(t){console.warn("Error in observeOnboardingPanel: ",t),nh("Error in observeOnboardingPanel: ",t)}},this.scheduleOnboardingViewportClamp=()=>{try{if(!this.onboardingMode||null!==this.onboardingClampFrame)return;this.onboardingClampFrame=requestAnimationFrame((()=>{this.onboardingClampFrame=null,this.clampOnboardingPanelToViewport()}))}catch(t){console.warn("Error in scheduleOnboardingViewportClamp: ",t),nh("Error in scheduleOnboardingViewportClamp: ",t)}},this.getOnboardingViewportClampOffset=(t,e,i)=>{let o=0,n=0;return t.right>e-8&&(o=e-8-t.right),t.left+o<8&&(o=8-t.left),t.bottom>i-8&&(n=i-8-t.bottom),t.top+n<8&&(n=8-t.top),{dx:o,dy:n}},this.readTranslate=t=>{var e;try{const i=window.getComputedStyle(t).transform;if(!i||"none"===i)return{x:0,y:0};const o=new(null!==(e=window.DOMMatrixReadOnly)&&void 0!==e?e:window.WebKitCSSMatrix)(i);return{x:Number(o.m41)||0,y:Number(o.m42)||0}}catch{return{x:0,y:0}}},this.clampOnboardingPanelToViewport=t=>{var e;try{const i=null!=t?t:null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".snippyly-plugin-container.onboarding-container");if(!i)return;const o=[i.getBoundingClientRect()],n=i.querySelector("content-warning-sidebar");n&&o.push(n.getBoundingClientRect());const r=o.filter((t=>t.width>0||t.height>0));if(0===r.length)return;const s={left:Math.min(...r.map((t=>t.left))),top:Math.min(...r.map((t=>t.top))),right:Math.max(...r.map((t=>t.right))),bottom:Math.max(...r.map((t=>t.bottom)))},{dx:a,dy:l}=this.getOnboardingViewportClampOffset(s,window.innerWidth,window.innerHeight);if(Math.abs(a)<.5&&Math.abs(l)<.5)return;const{x:c,y:d}=this.readTranslate(i);i.style.transform=`translate(${Math.round(c+a)}px, ${Math.round(d+l)}px)`}catch(t){console.warn("Error in clampOnboardingPanelToViewport: ",t),nh("Error in clampOnboardingPanelToViewport: ",t)}},this.buildAgentWarnings=(t,e,i,o)=>{try{return t===Ne.BROKEN_LINKS?this.buildBrokenLinkWarnings(e):t===Ne.SPELL_CHECK||t===Ne.GRAMMAR_CHECK?this.buildSpellCheckWarnings(e,i,o):this.buildGenericWarnings(e)}catch(t){return console.warn("Error in buildAgentWarnings: ",t),{warnings:[],warningCount:0}}},this.buildBrokenLinkWarnings=t=>{var e,i,o,n,r,s,a,l,c,d,h,u,p;try{const v=new Map;for(const g of t){const t=(null===(e=null==g?void 0:g.pageInfo)||void 0===e?void 0:e.url)||(null===(i=null==g?void 0:g.location)||void 0===i?void 0:i.url)||(null===(o=null==g?void 0:g.agent)||void 0===o?void 0:o.url)||"",f=(null===(n=null==g?void 0:g.agent)||void 0===n?void 0:n.reason)||{},m=f.url||(null===(r=null==g?void 0:g.targetTextRange)||void 0===r?void 0:r.text)||(null===(a=null===(s=null==g?void 0:g.agent)||void 0===s?void 0:s.result)||void 0===a?void 0:a.url)||(null===(c=null===(l=null==g?void 0:g.agent)||void 0===l?void 0:l.result)||void 0===c?void 0:c.link)||t,w=f.issue||f.description||(null===(h=null===(d=null==g?void 0:g.agent)||void 0===d?void 0:d.result)||void 0===h?void 0:h.statusCode)||(null===(p=null===(u=null==g?void 0:g.agent)||void 0===u?void 0:u.result)||void 0===p?void 0:p.status)||"",y=(null==m?void 0:m.toLowerCase())||"",b=wu(g)?Cu(g):void 0;if(v.has(y)){const e=v.get(y);e.occurrences+=1,t&&!e.pageUrls.includes(t)&&e.pageUrls.push(t),e.annotations.push(g),b&&(e.severity=Lu(e.severity,b))}else v.set(y,{primaryText:m||"",secondaryText:String(w),occurrences:1,pageUrls:t?[t]:[],annotations:[g],...b?{severity:b}:{}})}const g=Array.from(v.values());return{warnings:g,warningCount:g.length}}catch(t){return console.warn("Error in buildBrokenLinkWarnings: ",t),{warnings:[],warningCount:0}}},this.buildSpellCheckWarnings=(t,e,i)=>{var o,n,r,s,a,l,c,d,h,u,p,v,g,f,m,w,y,b,C;try{const x=new Map;for(const E of t){const t=(null===(o=null==E?void 0:E.pageInfo)||void 0===o?void 0:o.url)||(null===(n=null==E?void 0:E.location)||void 0===n?void 0:n.url)||(null===(r=null==E?void 0:E.agent)||void 0===r?void 0:r.url)||"",k=(null===(s=null==E?void 0:E.pageInfo)||void 0===s?void 0:s.path)||(null===(a=null==E?void 0:E.location)||void 0===a?void 0:a.path)||(null===(l=null==E?void 0:E.agent)||void 0===l?void 0:l.path)||"",S=this.normalizePagePath(k),A=null!==(d=null!==(c=null==E?void 0:E.comments)&&void 0!==c?c:null==E?void 0:E.commentData)&&void 0!==d?d:[],M=null!==(p=null===(u=null===(h=null==A?void 0:A[0])||void 0===h?void 0:h.commentText)||void 0===u?void 0:u.trim())&&void 0!==p?p:"",T=(null===(g=null===(v=null==E?void 0:E.agent)||void 0===v?void 0:v.result)||void 0===g?void 0:g.incorrectWord)||(null===(f=null==E?void 0:E.targetElement)||void 0===f?void 0:f.targetText)||M||"",I=(null===(w=null===(m=null==E?void 0:E.agent)||void 0===m?void 0:m.result)||void 0===w?void 0:w.suggestions)||[],_=Array.isArray(I)?I[0]||"":I||"",$=null===(b=null===(y=null==E?void 0:E.agent)||void 0===y?void 0:y.result)||void 0===b?void 0:b.type,N=T||"";T||console.warn("[CWS] Spell check annotation missing incorrectWord. agent.result:",null===(C=null==E?void 0:E.agent)||void 0===C?void 0:C.result,"targetElement:",null==E?void 0:E.targetElement,"comments:",A);const O="grammar"===$?i:e;O.has(N)||O.set(N,new Map);const L=O.get(N),R=L.get(S)||0;L.set(S,R+1);const D=wu(E)?Cu(E):void 0;if(x.has(N)){const e=x.get(N);e.occurrences+=1,t&&!e.pageUrls.includes(t)&&e.pageUrls.push(t),e.annotations.push(E),D&&(e.severity=Lu(e.severity,D))}else x.set(N,{primaryText:T||"",secondaryText:_||"",occurrences:1,pageUrls:t?[t]:[],annotations:[E],...D?{severity:D}:{}})}const E=Array.from(x.values());return{warnings:E,warningCount:E.length}}catch(t){return console.warn("Error in buildSpellCheckWarnings: ",t),{warnings:[],warningCount:0}}},this.splitFindingHeading=t=>{var e;try{if("string"!=typeof t||!t.trim())return null;const i=document.createElement("template");i.innerHTML=t;const o=Array.from(i.content.childNodes).filter((t=>{var e;return!(t.nodeType===Node.TEXT_NODE&&!(null===(e=t.textContent)||void 0===e?void 0:e.trim()))})),n=o[0];if(!n||!["B","STRONG"].includes(n.nodeName))return null;const r=(null===(e=n.textContent)||void 0===e?void 0:e.replace(/\s+/g," ").trim())||"";if(!r)return null;let s="";for(const t of o.slice(1))s+="BR"===t.nodeName?"\n":t.textContent||"";return{title:r,detail:s.split("\n").map((t=>t.replace(/\s+/g," ").trim())).find(Boolean)||""}}catch(t){return console.warn("Error in splitFindingHeading: ",t),null}},this.buildFindingSubItems=t=>{try{return(Array.isArray(null==t?void 0:t.missing)?t.missing:[]).map((t=>{const e="string"==typeof(null==t?void 0:t.text)?t.text.replace(/\s+/g," ").trim():"";if(!e)return null;const i="heading"===(null==t?void 0:t.kind)?"Section":"Link",o="string"==typeof(null==t?void 0:t.href)?t.href.trim().replace(/^https?:\/\//i,"").replace(/^www\./i,"").replace(/\/$/,""):"",n=o.length>40?`${o.slice(0,39)}…`:o;return{label:e,detail:n?`${i} · ${n}`:i}})).filter(Boolean)}catch(t){return console.warn("Error in buildFindingSubItems: ",t),[]}},this.buildGenericWarnings=t=>{var e,i,o,n,r,s,a,l,c,d,h,u,p,v,g,f,m,w,y,b,C,x,E,k;try{const S=new Map;for(const A of t){const t=(null===(e=null==A?void 0:A.pageInfo)||void 0===e?void 0:e.url)||(null===(i=null==A?void 0:A.location)||void 0===i?void 0:i.url)||(null===(o=null==A?void 0:A.agent)||void 0===o?void 0:o.url)||"",M=null!==(r=null!==(n=null==A?void 0:A.comments)&&void 0!==n?n:null==A?void 0:A.commentData)&&void 0!==r?r:[],T=null==M?void 0:M[0],I=null!==(p=null!==(d=null!==(a=null===(s=null==T?void 0:T.commentText)||void 0===s?void 0:s.trim())&&void 0!==a?a:null===(c=null===(l=null==A?void 0:A.agent)||void 0===l?void 0:l.result)||void 0===c?void 0:c.incorrectWord)&&void 0!==d?d:null===(u=null===(h=null==A?void 0:A.targetElement)||void 0===h?void 0:h.targetText)||void 0===u?void 0:u.trim())&&void 0!==p?p:"",_=null!==(b=null!==(m=null===(f=null===(g=null===(v=null==A?void 0:A.agent)||void 0===v?void 0:v.result)||void 0===g?void 0:g.suggestions)||void 0===f?void 0:f[0])&&void 0!==m?m:null===(y=null===(w=null==A?void 0:A.agent)||void 0===w?void 0:w.result)||void 0===y?void 0:y.suggestion)&&void 0!==b?b:"",$=null!==(k=null!==(x=null===(C=null==A?void 0:A.agent)||void 0===C?void 0:C.reason)&&void 0!==x?x:null===(E=null==T?void 0:T.agent)||void 0===E?void 0:E.reason)&&void 0!==k?k:{},N="string"==typeof(null==$?void 0:$.title)?$.title.trim():"",O="string"==typeof(null==$?void 0:$.description)?$.description.trim():"",L=N?null:this.splitFindingHeading(null==T?void 0:T.commentHtml),R=N||(null==L?void 0:L.title)||I,D=_||(N?O:null==L?void 0:L.detail)||"",F=this.resolveWarningSeverity(A,$),P=this.buildFindingSubItems($),j=I||(null==A?void 0:A.annotationId)||(null==A?void 0:A.id)||"";if(S.has(j)){const e=S.get(j);e.occurrences+=1,t&&!e.pageUrls.includes(t)&&e.pageUrls.push(t),e.annotations.push(A),e.severity=Lu(e.severity,F)}else S.set(j,{primaryText:R||"No text",secondaryText:D||"",occurrences:1,pageUrls:t?[t]:[],annotations:[A],...F?{severity:F}:{},...P.length>1?{subItems:P}:{}})}const A=Array.from(S.values());return{warnings:A,warningCount:A.length}}catch(t){return console.warn("Error in buildGenericWarnings: ",t),{warnings:[],warningCount:0}}},this.resolveWarningSeverity=(t,e)=>{try{return wu(t)?Cu(t):(t=>{if("string"!=typeof t)return;const e=t.trim().toLowerCase();return tu.includes(e)?e:void 0})(null==e?void 0:e.severity)}catch(t){return console.warn("Error in resolveWarningSeverity: ",t),void nh("Error in resolveWarningSeverity: ",t)}},this.normalizePagePath=t=>{try{return t?(null==t?void 0:t.startsWith("/"))?t.substring(1):t:""}catch(e){return console.warn("Error in normalizePagePath: ",e),t||""}},this.setQueryParamsCommentsInSdk=()=>{var t,e,i,o,n;try{const r="true"===sessionStorage.getItem("debugQueryParamsComments");r&&console.log("setQueryParamsCommentsInSdk commentElement",this.commentElement),this.commentElement&&(r&&console.log("setQueryParamsCommentsInSdk queryParamsComments",this.queryParamsComments),this.queryParamsComments&&(null===(t=this.commentElement)||void 0===t?void 0:t.enableQueryParamsComments)?(r&&console.log("enableQueryParamsComments this.commentElement?.enableQueryParamsComments",null===(e=this.commentElement)||void 0===e?void 0:e.enableQueryParamsComments),null===(i=this.commentElement)||void 0===i||i.enableQueryParamsComments()):!this.queryParamsComments&&(null===(o=this.commentElement)||void 0===o?void 0:o.disableQueryParamsComments)&&(r&&console.log("disableQueryParamsComments"),null===(n=this.commentElement)||void 0===n||n.disableQueryParamsComments()))}catch(t){console.warn("Error in setQueryParamsCommentsInSdk: ",t),nh("Error in setQueryParamsCommentsInSdk: ",t)}},this.checkGlobalUserContact=()=>{try{this.contactElement&&this.contactElement.isUserGlobalContact().subscribe((t=>{this.isUserGlobalContact=t}))}catch(t){console.warn("Error in checkGlobalUserContact: ",t),nh("Error in checkGlobalUserContact: ",t)}},this.applyVeltFeatureGates=()=>{try{const t=(t=>{try{return(null==t?void 0:t.passwordGateActive)||(null==t?void 0:t.planLimitLocked)||(null==t?void 0:t.planExpired)||(null==t?void 0:t.projectDeleted)?[...Dd]:[]}catch(t){return[]}})({passwordGateActive:this.passwordProtected&&!this.isPasswordValid,planLimitLocked:this.planLimitLocked,planExpired:!0===this.isPlanExpired,projectDeleted:this.projectDeleted});this.resolvedVeltFeatureGates=t,this.pushVeltFeatureGates(t)}catch(t){console.warn("Error in applyVeltFeatureGates: ",t),nh("Error in applyVeltFeatureGates: ",t)}},this.pushVeltFeatureGates=t=>{const e=globalThis.Velt;e&&"function"==typeof e.disableFeatures&&e.disableFeatures(t)},this.replayVeltFeatureGates=()=>{try{this.pushVeltFeatureGates(this.resolvedVeltFeatureGates)}catch(t){console.warn("Error in replayVeltFeatureGates: ",t),nh("Error in replayVeltFeatureGates: ",t)}},this.setProjectConfigVariables=t=>{var e,i,o,n;try{const r="Admin"===this.snippylyUserRole;this.allFeatureDisabled=!r&&(null!==(e=null==t?void 0:t.disabled)&&void 0!==e&&e),this.allFeatureRestricted=null!==(i=null==t?void 0:t.restricted)&&void 0!==i&&i,this.guestMode=null!==(o=null==t?void 0:t.guestMode)&&void 0!==o&&o||this.isRunningUnderLivePreview(),this.allowGuestModeSignIn=!!(null===(n=null==t?void 0:t.guestModeConfig)||void 0===n?void 0:n.allowSignIn),(null==t?void 0:t.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.guestMode&&rh(gt.Events.GUEST_MODE_PRESENT),this.passwordProtected=!1,this.queryParamsComments=!!(null==t?void 0:t.queryParamsComments),this.usePageTitleAsLocationName=!!(null==t?void 0:t.usePageTitleAsLocationName);const s=this.readProjectApproval(t);if(s&&(this.projectApproval=s),function(t){try{return!!t&&"object"==typeof t&&"boolean"==typeof t.maintenanceRequests}catch(t){return console.warn("Error in hasMaintenanceRequestsField: ",t),!1}}(t)){const e=qd(t);this.maintenanceRequests=e.enabled,this.maintenanceRequestsLabel=e.label,this.syncRequestMode()}this.applyVeltFeatureGates(),Ad(he,this.guestMode+"",!0),Ad(we,this.allowGuestModeSignIn+"",!0),Ad(ue,this.passwordProtected+"",!0),Ad(pe,this.queryParamsComments+"",!0),Ad(ve,this.usePageTitleAsLocationName+"",!0)}catch(t){console.warn("Error in setProjectConfigVariables: ",t),nh("Error in setProjectConfigVariables: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?rh(gt.Events.TOOLBAR_EXPANDED):rh(gt.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),nh("Error in toggleSnippylyPluginToolbar: ",t)}},this.enablePrivateCommentModeOnCommentElement=()=>{try{if(!this.commentElement||"function"!=typeof this.commentElement.enablePrivateMode)return;this.commentElement.enablePrivateMode({type:me})}catch(t){console.warn("Error in enablePrivateCommentModeOnCommentElement: ",t),nh("Error in enablePrivateCommentModeOnCommentElement: ",t)}},this.disablePrivateCommentModeOnCommentElement=()=>{try{if(!this.commentElement||"function"!=typeof this.commentElement.disablePrivateMode)return;this.commentElement.disablePrivateMode()}catch(t){console.warn("Error in disablePrivateCommentModeOnCommentElement: ",t),nh("Error in disablePrivateCommentModeOnCommentElement: ",t)}},this.enableVisibilityOptionsOnCommentElement=()=>{try{if(this.visibilityOptionsEnabled)return;if(!this.commentElement||"function"!=typeof this.commentElement.enableVisibilityOptions)return;this.commentElement.enableVisibilityOptions(),this.visibilityOptionsEnabled=!0,rh(gt.Events.VISIBILITY_OPTIONS_ENABLED)}catch(t){console.warn("Error in enableVisibilityOptionsOnCommentElement: ",t),nh("Error in enableVisibilityOptionsOnCommentElement: ",t)}},this.disableVisibilityOptionsOnCommentElement=()=>{try{if(!this.visibilityOptionsEnabled)return;if(!this.commentElement||"function"!=typeof this.commentElement.disableVisibilityOptions)return void(this.visibilityOptionsEnabled=!1);this.commentElement.disableVisibilityOptions(),this.visibilityOptionsEnabled=!1,rh(gt.Events.VISIBILITY_OPTIONS_DISABLED)}catch(t){console.warn("Error in disableVisibilityOptionsOnCommentElement: ",t),nh("Error in disableVisibilityOptionsOnCommentElement: ",t)}},this.maybeApplyVisibilityOptionsToCommentElement=()=>{!this.clientMode&&"Admin"===this.snippylyUserRole&&this.canShowPrivateCommentToggle?this.enableVisibilityOptionsOnCommentElement():this.disableVisibilityOptionsOnCommentElement()},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.disablePrivateCommentModeOnCommentElement(),this.privateCommentModeEnabled=!1,rh(gt.Events.PRIVATE_MODE_DISABLED)):(this.enablePrivateCommentModeOnCommentElement(),this.privateCommentModeEnabled=!0,rh(gt.Events.PRIVATE_MODE_ENABLED)),Ad(fe,this.privateCommentModeEnabled.toString()))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),nh("Error in togglePrivateCommentMode: ",t)}},this.checkPrivateCommentModeFromStorage=()=>{try{!this.allFeatureDisabled&&"Admin"===this.snippylyUserRole&&this.canShowPrivateCommentToggle&&Md(fe)&&(this.privateCommentModeEnabled="true"===Md(fe),this.privateCommentModeEnabled&&this.enablePrivateCommentModeOnCommentElement())}catch(t){console.warn("Error in checkPrivateCommentModeFromStorage: ",t),nh("Error in checkPrivateCommentModeFromStorage: ",t)}},this.loginWithGoogle=()=>{try{if(rh(gt.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;this.clientMode&&Ad(At,"true",!1);const t=this.buildSignInUrlWithParams(this.signInUrl||""),e=this.signInWindowTarget();"_blank"===e?window.open(t,"_blank","noopener,noreferrer"):window.open(t,e)}catch(t){console.warn("Error in loginWithGoogle: ",t),nh("Error in loginWithGoogle: ",t)}},this.signInWindowTarget=()=>{try{return this.isRunningUnderPreviewProxy()&&this.isInFrame()?"_blank":"_self"}catch(t){return console.warn("Error in signInWindowTarget: ",t),"_self"}},this.isInFrame=()=>{try{return window.top!==window.self}catch(t){return console.warn("Error in isInFrame: ",t),!0}},this.buildSignInUrlWithParams=t=>{try{const e=new URL(t);return this.apiKey&&e.searchParams.set("apiKey",this.apiKey),this.projectId&&e.searchParams.set("projectId",this.projectId),e.toString()}catch(e){return console.warn("Error in buildSignInUrlWithParams: ",e),nh("Error in buildSignInUrlWithParams: ",e),t}},this.getQRCode=async()=>{if(!this.qrCodeLoading)try{this.qrCodeLoading=!0,this.qrCodeError=!1;const t=new URL(window.location.href);null==t||t.searchParams.set("review","true");const e=null==t?void 0:t.toString();if(!e)return void(this.qrCodeError=!0);const i=_d(e,Qe,Xe),o=await Eh(i);"ok"===o.status?this.qrCode=o.qrcode:this.qrCodeError=!0}catch(t){this.qrCodeError=!0,console.warn("Error in getQRCode: ",t),nh("Error in getQRCode: ",t)}finally{this.qrCodeLoading=!1}},this.retryQRCode=async()=>{try{this.qrCodeError=!1,await this.getQRCode()}catch(t){console.warn("Error in retryQRCode: ",t),nh("Error in retryQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{if(rh(gt.Events.OPEN_MOBILE_CLICKED),this.showQrCode&&this.qrCodeLoading)return;this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),nh("Error in toggleQRCodeVisibility: ",t)}},this.onUserInviteToolClick=()=>{var t;(null===(t=this.snippylyUser)||void 0===t?void 0:t.isGuest)?(this.guestModeSignInModalConfig.title="Sign in to invite others.",this.guestModeSignInModalConfig.description="Invite team members to comment on this project.",this.guestModeSignInModalConfig.showLeaveCommentButton=!1,this.guestModeSignInModalConfig.closeOnClickOutside=!0,this.openGuestModeSignInModal()):this.openInviteModal()},this.openInviteModal=()=>{this.showInviteModal=!0,rh(gt.Events.INVITE_MODAL_OPENED)},this.closeInviteModal=()=>{this.showInviteModal=!1},this.onInviteSuccess=()=>{this.closeInviteModal(),rh(gt.Events.INVITE_SENT)},this.removeSnippyly=async()=>{try{rh(gt.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,Td(At),Td(Mt),Td(Zt),Td(oe,"sessionStorage"),Td(ne,"sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete(Zt),e.delete(At),e.delete(Kt),e.delete(Mt),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete(re),e.delete(se),e.delete(ae),this.projectVersion=void 0,this.projectVersionKey=void 0,delete window.snippylyInitialLoadUrl,window.history.replaceState({},document.title,t.href),window.location.reload()}catch(t){console.warn("Error in removeSnippyly: ",t),nh("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{rh(gt.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null),await Velt.signOutUser(),Td(Jt),Td(Qt),Bd(),Td(de),Td(fe),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),nh("Error in signOutUser: ",t)}},this.toggleMenu=(t,e)=>{try{t.stopPropagation(),this.menuOpenedId===e?this.menuOpenedId=void 0:this.menuOpenedId=e}catch(t){console.warn("Error in toggleMenu: ",t),nh("Error in toggleMenu: ",t)}},this.copyLink=()=>{try{navigator.clipboard.writeText(window.location.href),this.copyLinkTooltip="Link copied!",setTimeout((()=>{this.copyLinkTooltip="Copy Link"}),2e3)}catch(t){console.warn("Error in copyLink: ",t),nh("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${Je}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${Je}/dashboard/project/comment/${this.apiKey}/${this.serverDocumentId}`),rh(gt.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),nh("Error in goToAdminPortal: ",t)}},this.openBugReportModal=()=>{try{this.showBugReportModal=!0,rh(gt.Events.REPORT_BUG_CLICKED)}catch(t){console.warn("Error in openBugReportModal: ",t),nh("Error in openBugReportModal: ",t)}},this.closeBugReportModal=()=>{try{this.showBugReportModal=!1}catch(t){console.warn("Error in closeBugReportModal: ",t),nh("Error in closeBugReportModal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${Je}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${Je}/dashboard`),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),nh("Error in goToAdminPortalDashboard: ",t)}},this.joinCommunity=()=>{try{window.open("https://join.slack.com/t/superflowusers/shared_invite/zt-1q3jzsddt-NEb~uu9RXscLfxOIDGQXJw","_blank")}catch(t){console.warn("Error in joinCommunity: ",t),nh("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,Ad(se,"true");const t=new URL(document.location);t.searchParams.delete(se),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onboardingNextClick: ",t),nh("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,Ad(ae,"true",!1,"sessionStorage");const t=new URL(document.location);t.searchParams.delete(ae),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onLiveDemoModalNextClick: ",t),nh("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(le),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),nh("Error in onFigmaDemoModalNextClick: ",t)}},this.onUpgradePlanClick=()=>{try{window.open(Ye,"_blank")}catch(t){console.warn("Error in onUpgradePlanClick: ",t),nh("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,Ad(ce,"true"),this.firstCommentNudge&&(this.firstCommentNudge=!1,this.autoCommentModeArmedOnce=!0)}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),nh("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{rh(gt.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),nh("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,rh(gt.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),nh("Error in openGuestModeSignInModal: ",t)}},this.closeGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!1,this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig))}catch(t){console.warn("Error in closeGuestModeSignInModal: ",t),nh("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{rh(gt.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),nh("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{if(this.clientMode)return;t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,rh(gt.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),nh("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),nh("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{rh(gt.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),nh("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{rh(gt.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),nh("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{rh(gt.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),nh("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,rh(gt.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),nh("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),nh("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{rh(gt.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),nh("Error in onGuestModeBannerSignInButtonClick: ",t)}},this.updateGuestUserName=async()=>{var t;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;const e=Ld(!0,this.apiKey);if(e){const t=JSON.parse(JSON.stringify(e));e.name=this.guestUserNameInput,e.photoUrl=null,this.guestUserNameUpdateLoading=!0,(t=>{try{const e=JSON.stringify(t),i=_d(e,Qe,Xe);Ad(ee,i,!0)}catch(t){console.warn("Error in updateGuestUser: ",t),nh("Error in updateGuestUser: ",t)}})(e),await Velt.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await gh(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,Ad(be,"true"),rh(gt.Events.GUEST_MODE_NAME_ADDED,{oldName:null==t?void 0:t.name,newName:null==e?void 0:e.name})}this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateGuestUserName: ",t),nh("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(rh(gt.Events.REVIEW_PASSWORD_ADDED),!(null===(t=this.password)||void 0===t?void 0:t.trim()))return;if(this.validatingPasswordLoading)return;this.validatingPasswordLoading=!0,this.isPasswordValid=await dh(this.apiKey,this.projectId,this.password),function(t,e){try{const i="object"==typeof e?JSON.stringify(e):e;localStorage.setItem(t,i)}catch(t){console.warn("Error in setLocalStorage: ",t)}}(ge,this.isPasswordValid),this.isPasswordValid?(this.password="",this.onPasswordProtectedModalCloseButtonClick(),this.showInvalidPassword=!1,this.applyVeltFeatureGates(),rh(gt.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,rh(gt.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),nh("Error in submitPassword: ",t)}},this.updateUserName=async()=>{var t,e;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;this.guestUserNameUpdateLoading=!0;const i=JSON.parse(JSON.stringify(this.snippylyUser)),o=JSON.parse(JSON.stringify(this.snippylyUser));o.name=this.guestUserNameInput;const n=this.readLiveSignIn(),r=n&&(null===(e=n.user)||void 0===e?void 0:e.userId)===(null==i?void 0:i.userId)?n.token:null,s=this.isLiveShareGuest()?r:this.credentialFor(i,this.identityCameFromToken),a=await gh(this.apiKey,this.projectId||"",i,o,!1,s);if(!1===(null==a?void 0:a.success))return console.warn("[CWS Toolbar] Name change refused; keeping the old name:",null==a?void 0:a.reason),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",void this.closeGuestModeNameModel();await Velt.updateUser(o),this.snippylyUser=JSON.parse(JSON.stringify(o));const l=this.identityCameFromToken?Nd():null;if(l){l.name=o.name;const t=JSON.stringify(l),e=_d(t,Qe,Xe);Ad(Qt,e,!0)}o.isGuest&&(this.guestUserNameUpdated=!0,Ad(be,"true")),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),nh("Error in updateUserName: ",t)}},this.isAgentAnnotation=t=>{var e;try{const i=null!==this.extractAgentId((null===(e=null==t?void 0:t.agent)||void 0===e?void 0:e.agentFields)||[]),o=(null==t?void 0:t.type)===_e,n=(null==t?void 0:t.commentType)===_e;return i||o||n}catch(t){return console.warn("Error in isAgentAnnotation: ",t),!1}},this.getSidebarGroupExpansionMap=()=>{var t,e,i,o,n;try{const r=document.querySelector(Oe.VELT_COMMENTS_SIDEBAR_LEGACY),s=null===(n=null===(o=null===(i=null===(e=null===(t=null==r?void 0:r._ngElementStrategy)||void 0===t?void 0:t.componentRef)||void 0===e?void 0:e.instance)||void 0===i?void 0:i.componentConfigSignal)||void 0===o?void 0:o.call(i))||void 0===n?void 0:n.virtualScrollData;if(!Array.isArray(s))return;const a=new Map;return s.forEach((t=>{var e,i;if("group"!==(null==t?void 0:t.type))return;const o=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.displayName,n=null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.isExpanded;"string"==typeof o&&"boolean"==typeof n&&a.set(o,n)})),a}catch(t){return void console.warn("Error in getSidebarGroupExpansionMap: ",t)}},this.filterAgentCommentsFromSidebar=(t,e)=>{try{if(this.isSettingSidebarData)return;if(!t||!this.commentElement)return;const i=t.commentAnnotations;if(!Array.isArray(i))return;if(this.processAgentComments(this.mergeOnboardingFetchedAnnotations(i)),this.ensureOnboardingFindingsLoaded(),this.sidebarV2Enabled)return;if(this.showAgentCommentsInSidebar)return;const o=Array.isArray(null==t?void 0:t.systemFilteredAnnotations)?t.systemFilteredAnnotations:[],n=new Set(o.map((t=>(null==t?void 0:t.annotationId)||(null==t?void 0:t.id))).filter((t=>Boolean(t)))),r=[];i.forEach((t=>{if(this.isAgentAnnotation(t))return;const e=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id);e&&n.has(e)&&r.push(t)}));const s=new Map;r.forEach((t=>{var e,i,o,n;const r=(null===(e=null==t?void 0:t.pageInfo)||void 0===e?void 0:e.path)||(null===(i=null==t?void 0:t.pageInfo)||void 0===i?void 0:i.url)||(null===(o=null==t?void 0:t.location)||void 0===o?void 0:o.path)||"/";s.has(r)||s.set(r,[]),null===(n=s.get(r))||void 0===n||n.push(t)}));const a=[],l=new URL(window.location.href).pathname,c="/"+this.normalizePagePath(l);s.forEach(((t,i)=>{const o=null==e?void 0:e.get(i);a.push({groupId:i,groupName:i,isExpanded:"boolean"==typeof o?o:i===c,annotations:t})})),this.isSettingSidebarData=!0,this.commentElement.setCommentSidebarData(a,{grouping:!0}),this.isSettingSidebarData=!1}catch(t){this.isSettingSidebarData=!1,console.warn("Error in filterAgentCommentsFromSidebar: ",t),nh("Error in filterAgentCommentsFromSidebar: ",t)}},this.mountVeltCollaborationElements=()=>{if(!document.querySelector(Oe.VELT_COMMENTS)){const t=document.createElement(Oe.VELT_COMMENTS);t.setAttribute("filter-comments-on-dom","true"),t.setAttribute("shadow-dom","true"),null==t||t.addEventListener("onSignIn",(()=>{this.loginWithGoogle()})),null==t||t.addEventListener("onUpgrade",(()=>{this.onUpgradePlanClick()})),t.addEventListener("onCommentAdd",(t=>{this.addCommentCount++,this.trackClientRequestAdded(),this.notifyClientRequest(null==t?void 0:t.detail),this.onRequestModeCommentAdd(null==t?void 0:t.detail)})),t.addEventListener("onCommentUpdate",(t=>{var e,i;(null===(e=this.snippylyUser)||void 0===e?void 0:e.isGuest)&&"newlyAdded"===(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.type)&&(this.addCommentCount>=2&&(this.showModalOnceCommentIsModeIsOff=!0),this.addCommentCount>=5&&!this.showModalOnceCommentIsModeIsOff&&(this.showModalOnceCommentIsModeIsOff=!0))})),window.document.body.appendChild(t)}if(!this.isClientRequestsMode()){if(!document.querySelector(Oe.VELT_CURSOR)){const t=document.createElement(Oe.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Oe.VELT_HUDDLE)){const t=document.createElement(Oe.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Oe.VELT_RECORDER_NOTES)){const t=document.createElement(Oe.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Oe.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Oe.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Oe.VELT_ARROWS)){const t=document.createElement(Oe.VELT_ARROWS);window.document.body.appendChild(t)}}},this.unmountVeltCollaborationElements=()=>{try{document.querySelectorAll(Hp.COLLABORATION_TAGS.join(", ")).forEach((t=>t.remove()))}catch(t){console.warn("Error in unmountVeltCollaborationElements: ",t),nh("Error in unmountVeltCollaborationElements: ",t)}},this.mountCommentSidebar=()=>{const t=this.sidebarV2Enabled,e=t?Oe.VELT_COMMENTS_SIDEBAR_V2:Oe.VELT_COMMENTS_SIDEBAR_LEGACY,i=t?Oe.VELT_COMMENTS_SIDEBAR_LEGACY:Oe.VELT_COMMENTS_SIDEBAR_V2;if(document.querySelectorAll(i).forEach((t=>t.remove())),!document.querySelector(e)){const i=document.createElement(e);i.setAttribute("shadow-dom","true"),i.setAttribute(t?Le.URL_NAVIGATION:Le.ENABLE_URL_NAVIGATION,"true"),i.setAttribute(Le.CURRENT_LOCATION_SUFFIX,"true"),e===Oe.VELT_COMMENTS_SIDEBAR_LEGACY&&(i.setAttribute(Le.SIDEBAR_BUTTON_COUNT_TYPE,Re),i.setAttribute(Le.CUSTOM_ACTIONS,"true")),window.document.body.appendChild(i)}},this.setCommentSidebarVisibility=t=>{var e,i,o,n,r,s,a,l;try{if(t===this.showAgentCommentsInSidebar)return;if(this.sidebarV2Enabled)return t?null===(i=null===(e=this.commentElement)||void 0===e?void 0:e.disableFilterCommentsOnDom)||void 0===i||i.call(e):null===(n=null===(o=this.commentElement)||void 0===o?void 0:o.enableFilterCommentsOnDom)||void 0===n||n.call(o),void(this.showAgentCommentsInSidebar=t);const c=document.querySelector(Oe.VELT_COMMENTS_SIDEBAR_LEGACY);if(!c)return;t?(c.removeAttribute(Le.SIDEBAR_BUTTON_COUNT_TYPE),c.removeAttribute(Le.CUSTOM_ACTIONS),null===(s=null===(r=this.commentElement)||void 0===r?void 0:r.disableFilterCommentsOnDom)||void 0===s||s.call(r)):(c.setAttribute(Le.SIDEBAR_BUTTON_COUNT_TYPE,Re),c.setAttribute(Le.CUSTOM_ACTIONS,"true"),null===(l=null===(a=this.commentElement)||void 0===a?void 0:a.enableFilterCommentsOnDom)||void 0===l||l.call(a)),this.showAgentCommentsInSidebar=t}catch(t){console.warn("Error in setCommentSidebarVisibility: ",t),nh("Error in setCommentSidebarVisibility: ",t)}},this.toggleCommentSidebarVisibility=()=>{try{this.setCommentSidebarVisibility(!this.showAgentCommentsInSidebar),this.menuOpenedId=void 0}catch(t){console.warn("Error in toggleCommentSidebarVisibility: ",t),nh("Error in toggleCommentSidebarVisibility: ",t)}},this.applyPageCommentsVisibility=()=>{try{const t=this.commentElement;if(!t)return;this.pageCommentsHidden?"function"==typeof t.hideCommentsOnDom&&t.hideCommentsOnDom():"function"==typeof t.showCommentsOnDom&&t.showCommentsOnDom()}catch(t){console.warn("Error in applyPageCommentsVisibility: ",t),nh("Error in applyPageCommentsVisibility: ",t)}},this.togglePageCommentsVisibility=()=>{try{this.pageCommentsHidden=!this.pageCommentsHidden,this.pageCommentsHidden?Ad(qt,"true",!1,"sessionStorage"):Td(qt,"sessionStorage"),this.applyPageCommentsVisibility(),this.menuOpenedId=void 0}catch(t){console.warn("Error in togglePageCommentsVisibility: ",t),nh("Error in togglePageCommentsVisibility: ",t)}},this.unhidePageCommentsIfHidden=()=>{try{if(!this.pageCommentsHidden)return;this.pageCommentsHidden=!1,Td(qt,"sessionStorage"),this.applyPageCommentsVisibility()}catch(t){console.warn("Error in unhidePageCommentsIfHidden: ",t)}},this.toggleSidebarV2=()=>{try{Ad(xt,this.sidebarV2Enabled?"false":"true",!1,"sessionStorage"),window.location.reload()}catch(t){console.warn("Error in toggleSidebarV2: ",t),nh("Error in toggleSidebarV2: ",t)}},this.toggleVeltProxy=()=>{try{if(!this.veltProxyToggleVisible)return;t=!this.veltProxyEnabled,Ad(Et,t?"true":"false"),window.location.reload()}catch(t){console.warn("Error in toggleVeltProxy: ",t),nh("Error in toggleVeltProxy: ",t)}var t},this.isScreenshotDisabledHost=()=>{try{return Ie.includes(window.location.hostname)}catch{return!1}},this.getScreenshotMode=()=>{var t,e,i;return"local"===(null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.advancedFeatures)||void 0===i?void 0:i.screenshotMode)?"local":"basic"},this.logCaptureTrigger=(...t)=>{Pu()&&"undefined"!=typeof console&&console.warn("[sf-capture][trigger]",...t)},this.ensureAddCommentAnnotationSubscription=()=>{var t,e,i;this.commentElement&&"function"==typeof this.commentElement.on?this.addCommentAnnotationSubscription&&this.addCommentAnnotationSubscribedEl===this.commentElement?this.logCaptureTrigger("addCommentAnnotation subscription already attached"):(this.addCommentAnnotationSubscription&&(null===(i=(e=this.addCommentAnnotationSubscription).unsubscribe)||void 0===i||i.call(e),this.addCommentAnnotationSubscription=void 0,this.logCaptureTrigger("addCommentAnnotation re-subscribing: comment element changed")),this.addCommentAnnotationSubscription=this.commentElement.on("addCommentAnnotation").subscribe((t=>this.onAddCommentAnnotation(t))),this.addCommentAnnotationSubscribedEl=this.commentElement,this.logCaptureTrigger("addCommentAnnotation subscription attached")):this.logCaptureTrigger("addCommentAnnotation subscription NOT attached: commentElement.on unavailable",{hasCommentElement:!!this.commentElement,hasOn:"function"==typeof(null===(t=this.commentElement)||void 0===t?void 0:t.on)})},this.applyScreenshotSetting=()=>{var t,e,i,o,n,r,s,a,l,c,d,h,u;if(this.commentElement)return this.isScreenshotDisabledHost()?(null===(e=(t=this.commentElement).disableScreenshot)||void 0===e||e.call(t),void(this.nativeScreenshotEnabled&&(this.nativeScreenshotEnabled=!1,this.nativeCapture.dispose()))):void(this.nativeScreenshotEnabled?null===(o=(i=this.commentElement).disableScreenshot)||void 0===o||o.call(i):(null===(s=null===(r=null===(n=this.customerMetadata)||void 0===n?void 0:n.superflow)||void 0===r?void 0:r.advancedFeatures)||void 0===s?void 0:s.takeScreenshotOnComments)?"local"!==this.getScreenshotMode()?null===(u=(h=this.commentElement).enableScreenshot)||void 0===u||u.call(h):null===(d=(c=this.commentElement).disableScreenshot)||void 0===d||d.call(c):null===(l=(a=this.commentElement).disableScreenshot)||void 0===l||l.call(a))},this.canUseNativeScreenshot=()=>{var t,e,i;return!this.isScreenshotDisabledHost()&&(hp()&&"local"===this.getScreenshotMode()&&!!(null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.advancedFeatures)||void 0===i?void 0:i.takeScreenshotOnComments))},this.getNativeScreenshotPermission=()=>{const t=Md(Ae,!1,"sessionStorage");return"granted"===t||"denied"===t?t:null},this.setNativeScreenshotPermission=t=>{Ad(Ae,t,!1,"sessionStorage"),this.nativeScreenshotDenied="denied"===t},this.clearNativeScreenshotPermission=()=>{Td(Ae,"sessionStorage"),this.nativeScreenshotDenied=!1},this.promptNativeScreenshotForCommentMode=()=>{this.nativeScreenshotEnabled||this.nativeScreenshotEnabling||!this.canUseNativeScreenshot()||(this.logCaptureTrigger("commentMode enter: requesting screen share"),this.enableNativeScreenshot())},this.toggleNativeScreenshot=async()=>{try{if(!this.canUseNativeScreenshot())return;this.nativeScreenshotEnabled?(this.disableNativeScreenshot(),this.setNativeScreenshotPermission("denied")):(this.clearNativeScreenshotPermission(),await this.enableNativeScreenshot()),this.menuOpenedId=void 0}catch(t){console.warn("Error in toggleNativeScreenshot: ",t),nh("Error in toggleNativeScreenshot: ",t)}},this.enableNativeScreenshot=()=>(this.nativeScreenshotEnabling&&this.nativeScreenshotEnablingPromise||(this.nativeScreenshotEnabling=!0,this.nativeScreenshotEnablingPromise=this.performEnableNativeScreenshot()),this.nativeScreenshotEnablingPromise),this.performEnableNativeScreenshot=async()=>{var t,e;try{if(await this.nativeCapture.init(),!this.nativeCapture.isActive())return this.nativeScreenshotEnabled=!1,void this.nativeCapture.dispose();this.nativeScreenshotEnabled=!0,this.setNativeScreenshotPermission("granted"),null===(e=null===(t=this.commentElement)||void 0===t?void 0:t.disableScreenshot)||void 0===e||e.call(t),this.ensureAddCommentAnnotationSubscription()}catch(t){this.nativeScreenshotEnabled=!1,this.nativeCapture.dispose(),!function(t){var e;const i=t,o=null!==(e=null==i?void 0:i.message)&&void 0!==e?e:"";return!0===(null==i?void 0:i.sfNativeExpected)||"native-share-ended-during-init"===o||"native-not-supported"===o}(t)?console.warn("Native screenshot enable failed/cancelled: ",t):(this.setNativeScreenshotPermission("denied"),Pu()&&"undefined"!=typeof console&&console.info("[sf-capture][native] enable skipped (expected):",t))}finally{this.nativeScreenshotEnabling=!1,this.nativeScreenshotEnablingPromise=void 0}},this.disableNativeScreenshot=()=>{try{this.nativeScreenshotEnabled=!1,this.nativeCapture.dispose(),this.restoreSdkScreenshot()}catch(t){console.warn("Error in disableNativeScreenshot: ",t),nh("Error in disableNativeScreenshot: ",t)}},this.handleNativeScreenshotStreamEnded=()=>{try{const t=this.nativeScreenshotEnabled;if(this.nativeScreenshotEnabled=!1,!t)return;this.setNativeScreenshotPermission("denied"),this.restoreSdkScreenshot(),this.requestUpdate()}catch(t){console.warn("Error in handleNativeScreenshotStreamEnded: ",t),nh("Error in handleNativeScreenshotStreamEnded: ",t)}},this.restoreSdkScreenshot=()=>{var t,e,i,o,n;this.isScreenshotDisabledHost()||"basic"===this.getScreenshotMode()&&(null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.advancedFeatures)||void 0===i?void 0:i.takeScreenshotOnComments)&&(null===(n=null===(o=this.commentElement)||void 0===o?void 0:o.enableScreenshot)||void 0===n||n.call(o))},this.onAddCommentAnnotation=async t=>{var e,i,o,n,r,s,a,l,c;try{if(this.logCaptureTrigger("addCommentAnnotation event",{nativeScreenshotEnabled:this.nativeScreenshotEnabled,captureActive:this.nativeCapture.isActive(),dataKeys:t?Object.keys(t):null,commentAnnotationKeys:(null==t?void 0:t.commentAnnotation)?Object.keys(t.commentAnnotation):null}),!this.nativeScreenshotEnabled&&!this.canUseNativeScreenshot())return void this.logCaptureTrigger("skip: native screenshot unavailable");if(!this.nativeScreenshotEnabled){const t=this.nativeScreenshotEnabling&&!!this.nativeScreenshotEnablingPromise;if(!t&&null!==this.getNativeScreenshotPermission())return void this.logCaptureTrigger("skip: native screenshot not enabled (share decision recorded, no prompt in flight)");if(this.logCaptureTrigger(t?"comment add: share prompt already in flight, awaiting its outcome":"comment add: share never requested this session, prompting"),await this.enableNativeScreenshot(),!this.nativeScreenshotEnabled)return void this.logCaptureTrigger("skip: screen share not granted")}const d=null!==(o=null!==(e=null==t?void 0:t.annotationId)&&void 0!==e?e:null===(i=null==t?void 0:t.commentAnnotation)||void 0===i?void 0:i.annotationId)&&void 0!==o?o:null==t?void 0:t.id,h=null!==(l=null!==(a=null!==(r=null===(n=null==t?void 0:t.commentAnnotation)||void 0===n?void 0:n.comments)&&void 0!==r?r:null===(s=null==t?void 0:t.commentAnnotation)||void 0===s?void 0:s.commentData)&&void 0!==a?a:null==t?void 0:t.comments)&&void 0!==l?l:null==t?void 0:t.commentData,u=null===(c=null==h?void 0:h[0])||void 0===c?void 0:c.commentId;if(!d||!u)return void this.logCaptureTrigger("skip: missing ids",{annotationId:d,commentId:u,data:t});this.captureAndAttachScreenshot(d,u)}catch(t){console.warn("Error in onAddCommentAnnotation: ",t),nh("Error in onAddCommentAnnotation: ",t)}},this.captureAndAttachScreenshot=(t,e)=>this.nativeCapture.isActive()?(this.pendingScreenshotCount+=1,this.capturingScreenshot=!0,this.screenshotChain=this.screenshotChain.catch((()=>{})).then((()=>this.runCaptureAndAttach(t,e))).finally((()=>{this.pendingScreenshotCount=Math.max(0,this.pendingScreenshotCount-1),0===this.pendingScreenshotCount&&(this.capturingScreenshot=!1)})),this.screenshotChain):(this.logCaptureTrigger("skip: native capture not active",{annotationId:t,commentId:e}),Promise.resolve()),this.runCaptureAndAttach=async(t,e)=>{var i,o,n,r;try{this.logCaptureTrigger("capture start",{annotationId:t,commentId:e});const s=await this.nativeCapture.capture({focusAnnotationId:t}),a="image/webp"===s.blobType?"webp":"png",l=new File([s.blob],`screenshot-${t}.${a}`,{type:s.blobType}),c=await(null===(o=null===(i=this.commentElement)||void 0===i?void 0:i.addAttachment)||void 0===o?void 0:o.call(i,{annotationId:t,commentId:e,files:[l]}));if(c&&Array.isArray(c)&&c.length>0&&(null===(n=c[0])||void 0===n?void 0:n.valid)){const i=null===(r=c[0])||void 0===r?void 0:r.attachment;await this.commentElement.updateComment({annotationId:t,comment:{commentId:e,attachments:[i]},merge:!0}),this.logCaptureTrigger("capture attached",{annotationId:t,commentId:e})}else console.warn("Invalid screenshot file")}catch(t){console.warn("Native screenshot capture/attach failed: ",t),nh("Native screenshot capture/attach failed: ",t)}},this.setupSidebarAgentCommentFilter=()=>{var t,e,i,o,n,r;try{if(!this.commentElement)return;if(this.isClientRequestsMode())return void this.setupClientSidebarFilter();if("function"==typeof this.commentElement.on&&(this.commentElement.on("commentSidebarDataInit").subscribe((t=>{this.filterAgentCommentsFromSidebar(t)})),this.commentElement.on("commentSidebarDataUpdate").subscribe((t=>{const e=this.getSidebarGroupExpansionMap();this.filterAgentCommentsFromSidebar(t,e)}))),this.setupAgentWarningsHydration(),this.agentCommentsModeRequested)return this.setCommentSidebarVisibility(!0),void(this.showAgentCommentsInSidebar||(null===(e=null===(t=this.commentElement)||void 0===t?void 0:t.disableFilterCommentsOnDom)||void 0===e||e.call(t),this.showAgentCommentsInSidebar=!0));this.sidebarV2Enabled&&(this.showAgentCommentsInSidebar?null===(o=null===(i=this.commentElement)||void 0===i?void 0:i.disableFilterCommentsOnDom)||void 0===o||o.call(i):null===(r=null===(n=this.commentElement)||void 0===n?void 0:n.enableFilterCommentsOnDom)||void 0===r||r.call(n))}catch(t){console.warn("Error in setupSidebarAgentCommentFilter: ",t),nh("Error in setupSidebarAgentCommentFilter: ",t)}},this.setupAgentWarningsHydration=()=>{try{if(!this.commentElement||"function"!=typeof this.commentElement.getAllCommentAnnotations||!this.documentId)return;const t=this.commentElement.getAllCommentAnnotations(this.documentId+"");if(!t||"function"!=typeof t.subscribe)return;const e=t.subscribe((t=>{try{if(this.streamEmissionCount+=1,this.lastStreamEmissionAt=Date.now(),!this.sidebarV2Enabled&&!this.showAgentCommentsInSidebar)return;this.lastStreamAnnotations=Array.isArray(t)?t:[],this.processAgentComments(this.mergeOnboardingFetchedAnnotations(this.lastStreamAnnotations)),this.ensureOnboardingFindingsLoaded()}catch(t){console.warn("Error in agent-warnings hydration subscription: ",t),nh("Error in agent-warnings hydration subscription: ",t)}}));this.subscriptions.push(e)}catch(t){console.warn("Error in setupAgentWarningsHydration: ",t),nh("Error in setupAgentWarningsHydration: ",t)}},this.getContentWarningsDisplayCount=()=>{try{return this.contentWarningsCount>99?"99+":`${this.contentWarningsCount}`}catch(t){return console.warn("Error in getContentWarningsDisplayCount: ",t),"0"}},this.onContentWarningsButtonClick=()=>{try{this.showContentWarningSidebar=!this.showContentWarningSidebar}catch(t){console.warn("Error in onContentWarningsButtonClick: ",t),nh("Error in onContentWarningsButtonClick: ",t)}},this.onContentWarningSidebarClose=()=>{try{this.showContentWarningSidebar=!1}catch(t){console.warn("Error in onContentWarningSidebarClose: ",t)}},this.getOnboardingDismissedProjectIds=()=>{try{const t=Md(Ut,!1,"sessionStorage");if(!t)return[];try{const e=JSON.parse(t);if(Array.isArray(e))return e.filter((t=>"string"==typeof t&&t.length>0))}catch{}return[t]}catch(t){return console.warn("Error in getOnboardingDismissedProjectIds: ",t),nh("Error in getOnboardingDismissedProjectIds: ",t),[]}},this.setOnboardingDismissedProjectIds=t=>{try{const e=t.slice(-20);if(0===e.length)return void Td(Ut,"sessionStorage");Ad(Ut,JSON.stringify(e),!1,"sessionStorage")}catch(t){console.warn("Error in setOnboardingDismissedProjectIds: ",t),nh("Error in setOnboardingDismissedProjectIds: ",t)}},this.recordOnboardingSidebarDismissal=()=>{try{if(!this.projectId)return;const t=`${this.projectId}`,e=this.getOnboardingDismissedProjectIds().filter((e=>e!==t));this.setOnboardingDismissedProjectIds([...e,t])}catch(t){console.warn("Error in recordOnboardingSidebarDismissal: ",t),nh("Error in recordOnboardingSidebarDismissal: ",t)}},this.clearOnboardingSidebarDismissal=()=>{try{if(!this.projectId)return;const t=`${this.projectId}`,e=this.getOnboardingDismissedProjectIds();if(!e.includes(t))return;this.setOnboardingDismissedProjectIds(e.filter((e=>e!==t)))}catch(t){console.warn("Error in clearOnboardingSidebarDismissal: ",t),nh("Error in clearOnboardingSidebarDismissal: ",t)}},this.canShowTourCommentTooltip=()=>{try{return!(this.allFeatureDisabled||this.readOnlyMode||!this.showTourCommentTooltip)&&!(this.onboardingMode&&this.showContentWarningSidebar)}catch(t){return console.warn("Error in canShowTourCommentTooltip: ",t),nh("Error in canShowTourCommentTooltip: ",t),!1}},this.autoOpenOnboardingSidebar=()=>{try{if(!this.onboardingMode||this.allFeatureDisabled)return;if(!this.projectId)return;if(this.getOnboardingDismissedProjectIds().includes(`${this.projectId}`))return;this.showContentWarningSidebar=!0}catch(t){console.warn("Error in autoOpenOnboardingSidebar: ",t),nh("Error in autoOpenOnboardingSidebar: ",t)}},this.restoreContentWarningSidebarState=()=>{var t,e;try{if(this.onboardingMode)return this.autoOpenOnboardingSidebar(),void(this.showContentWarningSidebar&&(this.showAgentCommentsInSidebar?null===(e=null===(t=this.commentElement)||void 0===t?void 0:t.disableFilterCommentsOnDom)||void 0===e||e.call(t):this.setCommentSidebarVisibility(!0)));const i="true"===Md(Ee,!1,"sessionStorage"),o=new URL(window.location.href).searchParams.has(Kt);if(!i)return;if(!o)return;if(this.allFeatureDisabled||"Admin"!==this.snippylyUserRole)return;this.showContentWarningSidebar=!0}catch(t){console.warn("Error in restoreContentWarningSidebarState: ",t),nh("Error in restoreContentWarningSidebarState: ",t)}},this.navigateTo=t=>{try{window.location.href=t}catch(t){console.warn("Error in navigateTo: ",t),nh("Error in navigateTo: ",t)}},this.onContentWarningSidebarAddAll=()=>{},this.onContentWarningItemClick=t=>{var e,i;try{const o=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.annotation;if(!(null==o?void 0:o.annotationId)&&!(null==o?void 0:o.id))return;const n=(null==o?void 0:o.annotationId)||(null==o?void 0:o.id),r=null===(i=null==o?void 0:o.pageInfo)||void 0===i?void 0:i.url;if(yu(o))return void this.selectAnnotationOnPage(n);if(r&&!this.isCurrentPageUrl(r)){if(this.showContentWarningSidebar&&Ad(Ee,"true",!1,"sessionStorage"),this.isRunningUnderLivePreview()){const t=new URL(r),e=Pd(t)?null:jd(r),i=null!=e?e:t.pathname,o=null===e?t.search:"",s=this.buildLivePreviewNavigationUrl(`${i}${o}`,n);return void(s&&this.navigateTo(s))}if(this.isRunningUnderPreviewProxy()){return void(!(null!==jd(r))&&window.parent&&window.parent!==window&&window.parent.postMessage({type:Wt,url:r,annotationId:n},"*"))}const t=new URL(r);return t.searchParams.set(Kt,n),void this.navigateTo(t.toString())}this.selectAnnotationOnPage(n)}catch(t){console.warn("Error in onContentWarningItemClick: ",t),nh("Error in onContentWarningItemClick: ",t)}},this.buildLivePreviewNavigationUrl=(t,e)=>{try{const i=new URL(t,window.location.origin);return i.origin!==window.location.origin?(console.warn("[CWS Toolbar] Refusing a live preview navigation off this origin:",t),null):(i.searchParams.delete(We),i.searchParams.set(Kt,e),i.toString())}catch(t){return console.warn("Error in buildLivePreviewNavigationUrl: ",t),null}},this.selectAnnotationOnPage=t=>{var e;try{(null===(e=this.commentElement)||void 0===e?void 0:e.selectCommentByAnnotationId)&&this.commentElement.selectCommentByAnnotationId(t),setTimeout((()=>{var e;(null===(e=this.commentElement)||void 0===e?void 0:e.scrollToCommentByAnnotationId)&&this.commentElement.scrollToCommentByAnnotationId(t)}),150)}catch(t){console.warn("Error in selectAnnotationOnPage: ",t),nh("Error in selectAnnotationOnPage: ",t)}},this.onContentWarningItemNext=t=>{var e;try{const i=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.annotation;if(!i)return;this.navigateToCheckPage(this.resolveFullAnnotation(i),"next")}catch(t){console.warn("Error in onContentWarningItemNext: ",t),nh("Error in onContentWarningItemNext: ",t)}},this.getCurrentCheckPageKey=()=>{var t;try{if(this.isRunningUnderPreviewProxy())return this.previewLocationPath||"/";if(this.autoLocation&&"string"==typeof(null===(t=this.location)||void 0===t?void 0:t.url)&&this.location.url)return this.location.url;const e=new URL(window.location.href);for(const t of[At,Mt,Zt,Kt,se,ae])e.searchParams.delete(t);return`${e.pathname}${this.queryParamsComments?e.search:""}`}catch(t){return console.warn("Error in getCurrentCheckPageKey: ",t),nh("Error in getCurrentCheckPageKey: ",t),window.location.pathname}},this.navigateToCheckPage=(t,e="next")=>{try{const i=bu(t);if(i.length<2)return!1;const o=Eu(i,this.getCurrentCheckPageKey(),e);return!!o&&this.navigateToCheckPageKey(t,o)}catch(t){return console.warn("Error in navigateToCheckPage: ",t),nh("Error in navigateToCheckPage: ",t),!1}},this.navigateToCheckPageKey=(t,e)=>{var i;try{const o=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id);if(!o||!e)return!1;if(this.showContentWarningSidebar&&Ad(Ee,"true",!1,"sessionStorage"),this.isRunningUnderLivePreview()){const t=this.buildLivePreviewNavigationUrl(e,o);return!!t&&(this.navigateTo(t),!0)}if(this.isRunningUnderPreviewProxy()){const n=null===(i=null==t?void 0:t.pageInfo)||void 0===i?void 0:i.url;if("string"!=typeof n||!n||null!==jd(n))return!1;if(!window.parent||window.parent===window)return!1;const r=new URL(e,new URL(n).origin);return window.parent.postMessage({type:Wt,url:r.toString(),annotationId:o},"*"),!0}const n=new URL(e,window.location.origin);return n.searchParams.set(Kt,o),this.navigateTo(n.toString()),!0}catch(t){return console.warn("Error in navigateToCheckPageKey: ",t),nh("Error in navigateToCheckPageKey: ",t),!1}},this.resolveFullAnnotation=t=>{var e;try{if(!t||lu(t))return t;const i=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id);if(!i)return t;const o=t=>((null==t?void 0:t.annotationId)||(null==t?void 0:t.id))===i,n=this.lastStreamAnnotations.find(o);if(lu(n))return n;for(const t of this.agentGroups){const i=null===(e=null==t?void 0:t.annotations)||void 0===e?void 0:e.find(o);if(lu(i))return i}return t}catch(e){return console.warn("Error in resolveFullAnnotation: ",e),nh("Error in resolveFullAnnotation: ",e),t}},this.isCurrentPageUrl=t=>{var e;try{const i=null!==(e=jd(t))&&void 0!==e?e:new URL(t).pathname;let o=window.location.pathname;return!this.isRunningUnderLivePreview()&&this.isRunningUnderPreviewProxy()&&(o=this.previewLocationPath||"/"),i===o}catch{return!1}},this.setupVeltButtonClickListener=()=>{try{if(!(null===Velt||void 0===Velt?void 0:Velt.on))return void console.warn("[CWS Toolbar] Velt.on not available for button click listener");Velt.on("veltButtonClick").subscribe((t=>{var e;try{if(!t)return;const i=null===(e=null==t?void 0:t.buttonContext)||void 0===e?void 0:e.clickedButtonId,o=null==t?void 0:t.commentAnnotation,n=(null==o?void 0:o.annotationId)||(null==o?void 0:o.id),r="accept-suggestion"===i||"reject-suggestion"===i;if(r&&n&&this.processingAnnotationIds.has(n))return;if(r&&this.isSuggestionActionsHiddenForViewer())return void console.warn("[CWS Toolbar] Only workspace members can accept or reject suggestions. Ignoring:",i);if("prev-suggestion"===i||"next-suggestion"===i){const t="next-suggestion"===i?"next":"prev",e=this.resolveFullAnnotation(o);yu(e)&&bu(e).length>1?this.navigateToCheckPage(e,t):this.navigateSuggestion(o,t)}else"accept-suggestion"===i&&this.handleAcceptSuggestion(o)}catch(t){console.warn("Error in veltButtonClick handler: ",t)}})),this.commentElement.onCommentSelectionChange().subscribe((t=>{this.handleCommentSelection(t)}))}catch(t){console.warn("Error in setupVeltButtonClickListener: ",t),nh("Error in setupVeltButtonClickListener: ",t)}},this.navigateSuggestion=(t,e)=>{var i,o,n,r,s;try{if(!t)return void console.warn("[CWS Toolbar] No annotation provided for navigation");const a=null===(o=null===(i=null==t?void 0:t.agent)||void 0===i?void 0:i.result)||void 0===o?void 0:o.incorrectWord;if(!a)return void console.warn("[CWS Toolbar] No incorrectWord found on annotation");const l=this.findMatchingWarning(a);if(!l)return void console.warn("[CWS Toolbar] No matching warning found for word:",a);const c=null===(n=null==t?void 0:t.pageInfo)||void 0===n?void 0:n.path,d=this.normalizePagePath(c),h=null===(r=null==l?void 0:l.annotations)||void 0===r?void 0:r.filter((t=>{var e;const i=null===(e=null==t?void 0:t.pageInfo)||void 0===e?void 0:e.path;return this.normalizePagePath(i)===d}));if(!(null==h?void 0:h.length)||h.length<=1)return;const u=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id),p=h.findIndex((t=>((null==t?void 0:t.annotationId)||(null==t?void 0:t.id))===u));if(-1===p)return void console.warn("[CWS Toolbar] Current annotation not found in warning group");let v;v="next"===e?(p+1)%h.length:(p-1+h.length)%h.length;const g=h[v],f=(null==g?void 0:g.annotationId)||(null==g?void 0:g.id);f&&((null===(s=this.commentElement)||void 0===s?void 0:s.selectCommentByAnnotationId)&&this.commentElement.selectCommentByAnnotationId(f),setTimeout((()=>{var t;(null===(t=this.commentElement)||void 0===t?void 0:t.scrollToCommentByAnnotationId)&&this.commentElement.scrollToCommentByAnnotationId(f)}),150))}catch(t){console.warn("Error in navigateSuggestion: ",t),nh("Error in navigateSuggestion: ",t)}},this.findMatchingWarning=t=>{var e;try{for(const i of this.agentGroups){const o=null===(e=null==i?void 0:i.warnings)||void 0===e?void 0:e.find((e=>(null==e?void 0:e.primaryText)===t));if(o)return o}return null}catch(t){return console.warn("Error in findMatchingWarning: ",t),null}},this.removeAnnotationFromWarnings=t=>{var e,i,o;try{if(!t)return;const n=e=>{var i,o,n,r;for(const s of e){const e=null===(i=null==s?void 0:s.annotations)||void 0===i?void 0:i.find((e=>((null==e?void 0:e.annotationId)||(null==e?void 0:e.id))===t));if(e){const t="grammar"===(null===(n=null===(o=null==e?void 0:e.agent)||void 0===o?void 0:o.result)||void 0===n?void 0:n.type)?this.grammarSuggestionPagePathMap:this.spellingSuggestionPagePathMap,i=(null==s?void 0:s.primaryText)||"",a=null===(r=null==e?void 0:e.pageInfo)||void 0===r?void 0:r.path,l=this.normalizePagePath(a);if(i&&l&&t.has(i)){const e=t.get(i),o=e.get(l)||0;o>1?e.set(l,o-1):(e.delete(l),0===e.size&&t.delete(i))}return}}};for(const t of this.agentGroups)(null==t?void 0:t.agentId)!==Ne.SPELL_CHECK&&(null==t?void 0:t.agentId)!==Ne.GRAMMAR_CHECK||n(t.warnings);const r=null!==(o=null===(i=null===(e=this.agentGroups)||void 0===e?void 0:e.map((e=>{var i,o,n,r,s;const a=null!==(n=null===(o=null===(i=null==e?void 0:e.warnings)||void 0===i?void 0:i.map((e=>{var i;const o=null===(i=null==e?void 0:e.annotations)||void 0===i?void 0:i.filter((e=>((null==e?void 0:e.annotationId)||(null==e?void 0:e.id))!==t));return o&&0!==o.length?{...e,annotations:o,occurrences:o.length}:null})))||void 0===o?void 0:o.filter((t=>null!==t)))&&void 0!==n?n:[],l=null!==(s=null===(r=null==e?void 0:e.annotations)||void 0===r?void 0:r.filter((e=>((null==e?void 0:e.annotationId)||(null==e?void 0:e.id))!==t)))&&void 0!==s?s:[];return 0===a.length?null:{...e,warnings:a,warningCount:a.length,annotations:l}})))||void 0===i?void 0:i.filter((t=>null!==t)))&&void 0!==o?o:[];this.agentGroups=r;const s=r.reduce(((t,e)=>t+e.warningCount),0);this.contentWarningsCount=s,this.hasContentWarnings=s>0,this.onboardingFetchedAnnotations=this.onboardingFetchedAnnotations.filter((e=>((null==e?void 0:e.annotationId)||(null==e?void 0:e.id))!==t)),this.onboardingMode&&(this.onboardingRemovedAnnotationIds.add(t),this.setOnboardingUnsyncedAnnotationIds(this.onboardingFetchedAnnotations.map((t=>null==t?void 0:t.annotationId))))}catch(t){console.warn("Error in removeAnnotationFromWarnings: ",t)}},this.setSuggestionButtonsLoading=(t,e,i)=>{try{const o=i||document.querySelector(".velt-comment-dialog.selected");if(!o)return;const n=o.querySelector(".sf-accept-btn"),r=o.querySelector(".sf-reject-btn");if(e){const e="accept"===t?n:r,i="accept"===t?r:n;null==e||e.classList.add("sf-btn-loading"),null==i||i.classList.add("sf-btn-disabled")}else null==n||n.classList.remove("sf-btn-loading","sf-btn-disabled"),null==r||r.classList.remove("sf-btn-loading","sf-btn-disabled")}catch(t){console.warn("Error in setSuggestionButtonsLoading: ",t)}},this.handleAcceptSuggestion=async t=>{var e,i,o;try{const n=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id);if(!n)return void console.warn("[CWS Toolbar] handleAcceptSuggestion: No annotationId found",t);if(this.processingAnnotationIds.has(n))return;const r=(null===(e=this.snippylyUser)||void 0===e?void 0:e.userId)||(null===(i=this.snippylyUser)||void 0===i?void 0:i.uid),s=(null===(o=this.snippylyUser)||void 0===o?void 0:o.email)||"";if(!r)return void console.warn("[CWS Toolbar] handleAcceptSuggestion: No user available");if(!this.documentId)return void console.warn("[CWS Toolbar] handleAcceptSuggestion: No documentId available");this.processingAnnotationIds.add(n);const a=document.querySelector(".velt-comment-dialog.selected");this.setSuggestionButtonsLoading("accept",!0,a);try{await kh(this.apiKey,this.apiKey,this.documentId+"",n,{userId:r,email:s},this.suggestionCredential()),this.removeAnnotationFromWarnings(n)}finally{this.processingAnnotationIds.delete(n),this.setSuggestionButtonsLoading("accept",!1,a)}}catch(t){console.warn("Error in handleAcceptSuggestion: ",t),nh("Error in handleAcceptSuggestion: ",t)}},this.trackAgentPins=t=>{try{const e=this.agentPinTargets;if(this.agentPinTargets=new Map((t=>{const e=[],i=new Set;for(const o of Array.isArray(t)?t:[]){if("square"!==Cp(o))continue;const t=su(o);t&&!i.has(t)&&(i.add(t),e.push({id:t,icon:kp(o)}))}return e})(t).map((t=>[t.id,t]))),!this.isConnected)return;for(const t of e.keys())if(!this.agentPinTargets.has(t))for(const e of Fp(t))Bp(e),this.agentPinDecoratedContainers.delete(e);this.decorateAgentPins(),this.syncAgentPinDomObserver()}catch(t){console.warn("Error in trackAgentPins: ",t),nh("Error in trackAgentPins: ",t)}},this.resyncAgentPins=()=>{try{if(!this.isConnected||0===this.agentPinTargets.size)return;this.decorateAgentPins(),this.syncAgentPinDomObserver()}catch(t){console.warn("Error in resyncAgentPins: ",t),nh("Error in resyncAgentPins: ",t)}},this.decorateAgentPins=()=>{try{if(!this.isConnected)return;const t=new Set,e=new Map;for(const i of this.agentPinTargets.values())for(const o of Fp(i.id))"light"===this.decorateAgentPinContainer(o,i,e)&&t.add(i.id);this.agentPinLightDomIds=t,this.writeAgentPinPageCss()}catch(t){console.warn("Error in decorateAgentPins: ",t),nh("Error in decorateAgentPins: ",t)}},this.decorateAgentPinContainer=(t,e,i)=>{let o=i.get(e.icon);void 0===o&&(o=Lp(e.icon),i.set(e.icon,o));const n=Rp(t);for(const t of n)Dp(t,o);this.agentPinDecoratedContainers.add(t);const r=Up(t,n);return"unrecognised"===r&&this.noteUnrecognisedAgentPin(t),r},this.noteUnrecognisedAgentPin=t=>{try{if(this.agentPinMarkupReported)return;this.agentPinUnrecognisedContainers.add(t),null===this.agentPinMarkupRecheckTimer&&(this.agentPinMarkupRecheckTimer=setTimeout((()=>this.checkUnrecognisedAgentPins()),Hp.AGENT_PIN_MARKUP_RECHECK_MS))}catch(t){console.warn("Error in noteUnrecognisedAgentPin: ",t)}},this.checkUnrecognisedAgentPins=()=>{try{null!==this.agentPinMarkupRecheckTimer&&(clearTimeout(this.agentPinMarkupRecheckTimer),this.agentPinMarkupRecheckTimer=null);const t=Array.from(this.agentPinUnrecognisedContainers);if(this.agentPinUnrecognisedContainers.clear(),this.agentPinMarkupReported||!this.isConnected)return;for(const e of t){const t=Pp(e);if(!e.isConnected||!this.agentPinTargets.has(t)||"unrecognised"!==Up(e))continue;this.agentPinMarkupReported=!0;const i=$p.join(" ");return console.warn(`[Superflow] Agent pin not squared: the SDK rendered pin ${t} with none of the SDK pin internals (${i}). Update SDK_PIN_INTERNALS for this SDK version.`),void nh("Agent pin SDK markup not recognised","SDK pin internals changed",{annotationId:t,selectors:i})}}catch(t){console.warn("Error in checkUnrecognisedAgentPins: ",t)}},this.decoratePendingAgentPins=()=>{try{const t=Array.from(this.agentPinPendingContainers);if(this.agentPinPendingContainers.clear(),!this.isConnected)return;const e=new Map;let i=!1;for(const o of t){if(!o.isConnected||this.agentPinDecoratedContainers.has(o))continue;const t=this.agentPinTargets.get(Pp(o));t&&("light"!==this.decorateAgentPinContainer(o,t,e)||this.agentPinLightDomIds.has(t.id)||(this.agentPinLightDomIds.add(t.id),i=!0))}i&&this.writeAgentPinPageCss()}catch(t){console.warn("Error in decoratePendingAgentPins: ",t),nh("Error in decoratePendingAgentPins: ",t)}},this.writeAgentPinPageCss=()=>{const t=[];for(const e of this.agentPinLightDomIds){const i=this.agentPinTargets.get(e);i&&t.push(i)}const e=(t=>{var e;const i=new Map;for(const o of Array.isArray(t)?t:[]){if(!(null==o?void 0:o.id))continue;const t=null!==(e=i.get(o.icon))&&void 0!==e?e:[];t.push(`#${Mp}${Op(o.id)}`),i.set(o.icon,t)}return Array.from(i.entries()).map((([t,e])=>Lp(t,e))).join("\n")})(t);e!==this.agentPinPageCss&&(this.agentPinPageCss=e,document.head&&Dp(document.head,e))},this.scheduleAgentPinDecorate=()=>{try{if(!this.isConnected||0===this.agentPinTargets.size||null!==this.agentPinFrameCancel)return;const t=()=>{this.agentPinFrameCancel=null,this.decoratePendingAgentPins()};if("function"==typeof requestAnimationFrame){const e=requestAnimationFrame(t);this.agentPinFrameCancel=()=>cancelAnimationFrame(e)}else{const e=setTimeout(t,16);this.agentPinFrameCancel=()=>clearTimeout(e)}}catch(t){console.warn("Error in scheduleAgentPinDecorate: ",t),nh("Error in scheduleAgentPinDecorate: ",t)}},this.onAgentPinMutations=t=>{try{if(0===this.agentPinTargets.size)return;const{added:e,changed:i}=(t=>{const e=new Set,i=new Set;try{for(const o of Array.isArray(t)?t:[]){const t=null==o?void 0:o.addedNodes;if(!t||0===t.length)continue;let n=!1;for(let i=0;i<t.length;i+=1){const o=t[i];if(1!==o.nodeType)continue;n=!0;const r=o;Pp(r)?e.add(r):Ip.includes(r.localName)&&r.querySelectorAll(Tp).forEach((t=>e.add(t)))}const r=o.target;if(!n||!r||1!==r.nodeType)continue;const s=r.closest(Tp);s&&i.add(s)}}catch{}return{added:Array.from(e),changed:Array.from(i)}})(t);let o=!1;for(const t of i)this.agentPinTargets.has(Pp(t))&&(this.agentPinDecoratedContainers.delete(t),this.agentPinPendingContainers.add(t),o=!0);for(const t of e)!this.agentPinDecoratedContainers.has(t)&&this.agentPinTargets.has(Pp(t))&&(this.agentPinPendingContainers.add(t),o=!0);o&&this.scheduleAgentPinDecorate()}catch(t){console.warn("Error in onAgentPinMutations: ",t),nh("Error in onAgentPinMutations: ",t)}},this.syncAgentPinDomObserver=()=>{var t;try{if(!this.isConnected||0===this.agentPinTargets.size)return null===(t=this.agentPinDomObserver)||void 0===t||t.disconnect(),void(this.agentPinDomObserver=null);if(this.agentPinDomObserver||"undefined"==typeof MutationObserver||!document.body)return;this.agentPinDomObserver=new MutationObserver((t=>this.onAgentPinMutations(t))),this.agentPinDomObserver.observe(document.body,{childList:!0,subtree:!0})}catch(t){console.warn("Error in syncAgentPinDomObserver: ",t),nh("Error in syncAgentPinDomObserver: ",t)}},this.teardownAgentPins=()=>{var t,e;try{null===(t=this.agentPinDomObserver)||void 0===t||t.disconnect(),this.agentPinDomObserver=null,null===(e=this.agentPinFrameCancel)||void 0===e||e.call(this),this.agentPinFrameCancel=null,this.agentPinPendingContainers.clear(),null!==this.agentPinMarkupRecheckTimer&&(clearTimeout(this.agentPinMarkupRecheckTimer),this.agentPinMarkupRecheckTimer=null),this.agentPinUnrecognisedContainers.clear(),this.agentPinLightDomIds=new Set,this.agentPinPageCss="",document.head&&Dp(document.head,"");for(const t of this.agentPinTargets.values())for(const e of Fp(t.id))Bp(e);this.agentPinDecoratedContainers=new WeakSet}catch(t){console.warn("Error in teardownAgentPins: ",t),nh("Error in teardownAgentPins: ",t)}},this.showFirstCommentNudge=()=>{try{if(!this.autoCommentModeRequested||this.autoCommentModeArmedOnce||this.addCommentMode)return;this.firstCommentNudge=!0,this.showTourCommentTooltip=!0}catch(t){console.warn("Error in showFirstCommentNudge: ",t),nh("Error in showFirstCommentNudge: ",t)}},this.disableCommentMode=()=>{var t;try{(null===(t=this.commentElement)||void 0===t?void 0:t.disableCommentMode)&&this.commentElement.disableCommentMode()}catch(t){console.warn("Error in disableAddCommentMode: ",t),nh("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?R`
6209
6209
  <div class="disable-add-comment-button" @click=${()=>this.disableCommentMode()}>
6210
6210
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
6211
6211
  <path fill-rule="evenodd" clip-rule="evenodd" d="M3.52861 3.52858C3.78896 3.26823 4.21107 3.26823 4.47141 3.52858L8.00001 7.05717L11.5286 3.52858C11.789 3.26823 12.2111 3.26823 12.4714 3.52858C12.7318 3.78892 12.7318 4.21103 12.4714 4.47138L8.94282 7.99998L12.4714 11.5286C12.7318 11.7889 12.7318 12.211 12.4714 12.4714C12.2111 12.7317 11.789 12.7317 11.5286 12.4714L8.00001 8.94279L4.47141 12.4714C4.21107 12.7317 3.78896 12.7317 3.52861 12.4714C3.26826 12.211 3.26826 11.7889 3.52861 11.5286L7.0572 7.99998L3.52861 4.47138C3.26826 4.21103 3.26826 3.78892 3.52861 3.52858Z" fill="#FAFBFF"/>
6212
6212
  </svg>
6213
6213
  </div>
6214
- `:R``}catch(t){return console.warn("Error in disableAddCommentModeButton: ",t),oh("Error in disableAddCommentModeButton: ",t),R``}},this.addStyles=()=>{var t,e;try{const i=document.createElement("style");i.textContent=_h.cssText,null===(t=this.shadowRoot)||void 0===t||t.appendChild(i);const o=document.createElement("style");o.textContent=$h.cssText,null===(e=this.shadowRoot)||void 0===e||e.appendChild(o)}catch(t){console.warn("Error in addStyles: ",t),oh("Error in addStyles: ",t)}},this.checkToolbarPosition=()=>{var t;try{const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".snippyly-plugin-container");if(!e)return;requestAnimationFrame((()=>{var t;try{const{x:i}=e.getBoundingClientRect();if(i>=0)return;const o=e.style.transform,[n,r]=(null===(t=o.match(/translate\(([-\d.]+)px,\s*([-\d.]+)px\)/))||void 0===t?void 0:t.slice(1))||[],s=parseInt(n)-i;e.style.transform=`translate(${s||0}px, ${r||0}px)`}catch(t){console.warn("Error in checkToolbarPosition Request Animation Frame",t)}}))}catch(t){console.warn("Error in checkToolbarPosition",t)}},this._dragX=0,this._dragY=0,this._isDragging=!1,this._startX=0,this._startY=0,this.toolbarMouseMove=t=>{var e;try{if(t.stopPropagation(),this._isDragging){let i,o;const n=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".snippyly-plugin-container");if(n){if(i=t.clientX-this._startX,o=t.clientY-this._startY,i>20||o>40)return;if(window.innerWidth-n.getBoundingClientRect().width-Math.abs(i)<32)return;if(window.innerHeight-n.getBoundingClientRect().height-Math.abs(o)<n.getBoundingClientRect().height)return;n.style.transform=`translate(${i}px, ${o}px)`}}}catch(t){console.warn("Error in toolbarMouseMove",t)}},this.toolbarMouseDown=t=>{var e;try{const i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".snippyly-plugin-container");if(i){this._isDragging=!0;const e=window.getComputedStyle(i),o=new WebKitCSSMatrix(e.transform);this._startX=t.clientX-o.m41,this._startY=t.clientY-o.m42}}catch(t){console.warn("Error in toolbarMouseDown",t)}},this.toolbarMouseUp=t=>{try{t&&(this._isDragging=!1,this.scheduleOnboardingViewportClamp())}catch(t){console.warn("Error in toolbarMouseUp",t)}},this.toolbarMouseLeave=t=>{try{t&&(this._isDragging=!1,this.scheduleOnboardingViewportClamp())}catch(t){console.warn("Error in toolbarMouseLeave",t)}},this.isReviewModeActive=()=>{try{return"true"===Md(Mt,!1)}catch(t){return console.warn("Error in isReviewModeActive: ",t),!1}},this.canShowApproveAction=()=>{try{return!!this.snippylyUser&&!!this.apiKey&&!!this.projectId&&(this.isReviewModeActive()||this.isClientDefaultMode())&&!this.readOnlyMode&&!this.embedMode&&!this.isClientRequestsMode()&&!this.isRequestMode()}catch(t){return console.warn("Error in canShowApproveAction: ",t),!1}},this.readProjectApproval=t=>{try{const e=null==t?void 0:t.approval;if(!e||"object"!=typeof e)return null;const i=e.approvedAt;if("number"!=typeof i||!Number.isFinite(i))return null;return{approvedAt:i,approverName:"string"==typeof e.approverName?e.approverName:""}}catch(t){return console.warn("Error in readProjectApproval: ",t),null}},this.approvedStateTitle=t=>{try{const e=new Date(t.approvedAt).toLocaleString(),i=t.approverName.trim();return i?Ih("Approved by {name} on {date}").replace("{name}",(()=>i)).replace("{date}",(()=>e)):Ih("Approved on {date}").replace("{date}",(()=>e))}catch(t){return console.warn("Error in approvedStateTitle: ",t),Ih("Approved")}},this.clearApprovalNoticeTimer=()=>{try{void 0!==this.approvalNoticeTimer&&(clearTimeout(this.approvalNoticeTimer),this.approvalNoticeTimer=void 0)}catch(t){console.warn("Error in clearApprovalNoticeTimer: ",t)}},this.showApprovalNotice=t=>{try{this.clearApprovalNoticeTimer(),this.approvalNotice=t,this.approvalNoticeTimer=setTimeout((()=>{this.approvalNoticeTimer=void 0,this.approvalNotice=null}),5e3)}catch(t){console.warn("Error in showApprovalNotice: ",t),oh("Error in showApprovalNotice: ",t)}},this.onApproveClick=async()=>{let t=!1;try{if(this.approving||this.projectApproval)return;const e=this.snippylyUser;if(!(null==e?void 0:e.userId)||!this.apiKey||!this.projectId)return;this.approving=!0,t=!0,nh(gt.Events.PROJECT_APPROVE_CLICKED,{projectId:this.projectId});const i=await kh({apiKey:this.apiKey,documentId:this.projectId,user:{userId:e.userId,name:e.name,email:e.email}});if(i){const t="number"==typeof i.approvedAt&&Number.isFinite(i.approvedAt)?i.approvedAt:Date.now(),o="string"==typeof e.name&&e.name.trim()||"string"==typeof e.email&&e.email.trim()||"";this.projectApproval={approvedAt:t,approverName:o},this.showApprovalNotice("approved"),nh(gt.Events.PROJECT_APPROVED,{projectId:this.projectId,snapshotStatus:i.snapshotStatus})}else this.showApprovalNotice("failed"),nh(gt.Events.PROJECT_APPROVE_FAILED,{projectId:this.projectId})}catch(e){console.warn("Error in onApproveClick: ",e),oh("Error in onApproveClick: ",e),t&&this.showApprovalNotice("failed")}finally{t&&(this.approving=!1)}},this.renderApproveAction=()=>{try{if(this.projectApproval){const t=this.approvedStateTitle(this.projectApproval);return R`
6214
+ `:R``}catch(t){return console.warn("Error in disableAddCommentModeButton: ",t),nh("Error in disableAddCommentModeButton: ",t),R``}},this.addStyles=()=>{var t,e;try{const i=document.createElement("style");i.textContent=$h.cssText,null===(t=this.shadowRoot)||void 0===t||t.appendChild(i);const o=document.createElement("style");o.textContent=Nh.cssText,null===(e=this.shadowRoot)||void 0===e||e.appendChild(o)}catch(t){console.warn("Error in addStyles: ",t),nh("Error in addStyles: ",t)}},this.checkToolbarPosition=()=>{var t;try{const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".snippyly-plugin-container");if(!e)return;requestAnimationFrame((()=>{var t;try{const{x:i}=e.getBoundingClientRect();if(i>=0)return;const o=e.style.transform,[n,r]=(null===(t=o.match(/translate\(([-\d.]+)px,\s*([-\d.]+)px\)/))||void 0===t?void 0:t.slice(1))||[],s=parseInt(n)-i;e.style.transform=`translate(${s||0}px, ${r||0}px)`}catch(t){console.warn("Error in checkToolbarPosition Request Animation Frame",t)}}))}catch(t){console.warn("Error in checkToolbarPosition",t)}},this._dragX=0,this._dragY=0,this._isDragging=!1,this._startX=0,this._startY=0,this.toolbarMouseMove=t=>{var e;try{if(t.stopPropagation(),this._isDragging){let i,o;const n=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".snippyly-plugin-container");if(n){if(i=t.clientX-this._startX,o=t.clientY-this._startY,i>20||o>40)return;if(window.innerWidth-n.getBoundingClientRect().width-Math.abs(i)<32)return;if(window.innerHeight-n.getBoundingClientRect().height-Math.abs(o)<n.getBoundingClientRect().height)return;n.style.transform=`translate(${i}px, ${o}px)`}}}catch(t){console.warn("Error in toolbarMouseMove",t)}},this.toolbarMouseDown=t=>{var e;try{const i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".snippyly-plugin-container");if(i){this._isDragging=!0;const e=window.getComputedStyle(i),o=new WebKitCSSMatrix(e.transform);this._startX=t.clientX-o.m41,this._startY=t.clientY-o.m42}}catch(t){console.warn("Error in toolbarMouseDown",t)}},this.toolbarMouseUp=t=>{try{t&&(this._isDragging=!1,this.scheduleOnboardingViewportClamp())}catch(t){console.warn("Error in toolbarMouseUp",t)}},this.toolbarMouseLeave=t=>{try{t&&(this._isDragging=!1,this.scheduleOnboardingViewportClamp())}catch(t){console.warn("Error in toolbarMouseLeave",t)}},this.isReviewModeActive=()=>{try{return"true"===Md(At,!1)}catch(t){return console.warn("Error in isReviewModeActive: ",t),!1}},this.canShowApproveAction=()=>{try{return!!this.snippylyUser&&!!this.apiKey&&!!this.projectId&&(this.isReviewModeActive()||this.isClientDefaultMode())&&!this.readOnlyMode&&!this.embedMode&&!this.isClientRequestsMode()&&!this.isRequestMode()}catch(t){return console.warn("Error in canShowApproveAction: ",t),!1}},this.readProjectApproval=t=>{try{const e=null==t?void 0:t.approval;if(!e||"object"!=typeof e)return null;const i=e.approvedAt;if("number"!=typeof i||!Number.isFinite(i))return null;return{approvedAt:i,approverName:"string"==typeof e.approverName?e.approverName:""}}catch(t){return console.warn("Error in readProjectApproval: ",t),null}},this.approvedStateTitle=t=>{try{const e=new Date(t.approvedAt).toLocaleString(),i=t.approverName.trim();return i?_h("Approved by {name} on {date}").replace("{name}",(()=>i)).replace("{date}",(()=>e)):_h("Approved on {date}").replace("{date}",(()=>e))}catch(t){return console.warn("Error in approvedStateTitle: ",t),_h("Approved")}},this.clearApprovalNoticeTimer=()=>{try{void 0!==this.approvalNoticeTimer&&(clearTimeout(this.approvalNoticeTimer),this.approvalNoticeTimer=void 0)}catch(t){console.warn("Error in clearApprovalNoticeTimer: ",t)}},this.showApprovalNotice=t=>{try{this.clearApprovalNoticeTimer(),this.approvalNotice=t,this.approvalNoticeTimer=setTimeout((()=>{this.approvalNoticeTimer=void 0,this.approvalNotice=null}),5e3)}catch(t){console.warn("Error in showApprovalNotice: ",t),nh("Error in showApprovalNotice: ",t)}},this.onApproveClick=async()=>{let t=!1;try{if(this.approving||this.projectApproval)return;const e=this.snippylyUser;if(!(null==e?void 0:e.userId)||!this.apiKey||!this.projectId)return;this.approving=!0,t=!0,rh(gt.Events.PROJECT_APPROVE_CLICKED,{projectId:this.projectId});const i=await Sh({apiKey:this.apiKey,documentId:this.projectId,user:{userId:e.userId,name:e.name,email:e.email}});if(i){const t="number"==typeof i.approvedAt&&Number.isFinite(i.approvedAt)?i.approvedAt:Date.now(),o="string"==typeof e.name&&e.name.trim()||"string"==typeof e.email&&e.email.trim()||"";this.projectApproval={approvedAt:t,approverName:o},this.showApprovalNotice("approved"),rh(gt.Events.PROJECT_APPROVED,{projectId:this.projectId,snapshotStatus:i.snapshotStatus})}else this.showApprovalNotice("failed"),rh(gt.Events.PROJECT_APPROVE_FAILED,{projectId:this.projectId})}catch(e){console.warn("Error in onApproveClick: ",e),nh("Error in onApproveClick: ",e),t&&this.showApprovalNotice("failed")}finally{t&&(this.approving=!1)}},this.renderApproveAction=()=>{try{if(this.projectApproval){const t=this.approvedStateTitle(this.projectApproval);return R`
6215
6215
  <div class="action approve-action ${ut({"d-none":this.addCommentMode})}">
6216
6216
  <div class="tooltip">
6217
6217
  <div class="tooltiptext approved-tooltiptext" data-testid="sf-approved-tooltip">${t}</div>
6218
6218
  <span class="s-approve-button s-approve-button--approved" aria-label=${t} data-testid="sf-approved">
6219
- <svg class="s-approve-check" aria-hidden="true" viewBox="0 0 16 16" width="14" height="14" focusable="false"><path d="M3.5 8.5l2.75 2.75L12.5 5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>${Ih("Approved")}
6219
+ <svg class="s-approve-check" aria-hidden="true" viewBox="0 0 16 16" width="14" height="14" focusable="false"><path d="M3.5 8.5l2.75 2.75L12.5 5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>${_h("Approved")}
6220
6220
  </span>
6221
6221
  </div>
6222
6222
  </div>
6223
6223
  `}return R`
6224
6224
  <div class="action approve-action ${ut({"d-none":this.addCommentMode})}">
6225
- <button type="button" class="s-approve-button" ?disabled=${this.approving} @click=${()=>this.onApproveClick()} data-testid="sf-approve">${Ih(this.approving?"Approving...":"Approve")}</button>
6225
+ <button type="button" class="s-approve-button" ?disabled=${this.approving} @click=${()=>this.onApproveClick()} data-testid="sf-approve">${_h(this.approving?"Approving...":"Approve")}</button>
6226
6226
  </div>
6227
- `}catch(t){return console.warn("Error in renderApproveAction: ",t),oh("Error in renderApproveAction: ",t),R``}},this.renderApprovalNotice=()=>{try{return"approved"===this.approvalNotice?R`<div class="sf-approval-banner" role="status">${Ih("Approved. Thank you.")}</div>`:"failed"===this.approvalNotice?R`<div class="sf-approval-banner sf-approval-banner--failed" role="alert">${Ih("Could not approve. Try again.")}</div>`:null}catch(t){return console.warn("Error in renderApprovalNotice: ",t),null}},this.renderCommentTool=()=>{try{return R`
6227
+ `}catch(t){return console.warn("Error in renderApproveAction: ",t),nh("Error in renderApproveAction: ",t),R``}},this.renderApprovalNotice=()=>{try{return"approved"===this.approvalNotice?R`<div class="sf-approval-banner" role="status">${_h("Approved. Thank you.")}</div>`:"failed"===this.approvalNotice?R`<div class="sf-approval-banner sf-approval-banner--failed" role="alert">${_h("Could not approve. Try again.")}</div>`:null}catch(t){return console.warn("Error in renderApprovalNotice: ",t),null}},this.renderCommentTool=()=>{try{return R`
6228
6228
  <div class="action tooltip comment-tool-container">
6229
- <div class="tooltiptext">${this.readOnlyMode?Ih("Open your site in a new tab to add comments"):this.allFeatureDisabled?Ih("Commenting is disabled. Contact admin."):Ih("Comment (C)")}</div>
6229
+ <div class="tooltiptext">${this.readOnlyMode?_h("Open your site in a new tab to add comments"):this.allFeatureDisabled?_h("Commenting is disabled. Contact admin."):_h("Comment (C)")}</div>
6230
6230
  ${this.canShowTourCommentTooltip()?R`
6231
6231
  <div class="tour-tooltiptext" @click=${()=>this.onTourCommentTooltipClick()}>
6232
- <div class="tour-tooltip-content">${Ih(this.firstCommentNudge?"Add your first comment":"Click to add comments on this page.")}</div>
6233
- <button class="tour-tooltip-action" @click=${()=>this.onTourCommentTooltipClick()}>${Ih("Ok")}</button>
6232
+ <div class="tour-tooltip-content">${_h(this.firstCommentNudge?"Add your first comment":"Click to add comments on this page.")}</div>
6233
+ <button class="tour-tooltip-action" @click=${()=>this.onTourCommentTooltipClick()}>${_h("Ok")}</button>
6234
6234
  </div>
6235
6235
  `:null}
6236
6236
  ${this.allFeatureDisabled||this.readOnlyMode?R`
@@ -6247,7 +6247,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6247
6247
  <velt-comment-tool @click=${()=>this.onTourCommentTooltipClick()} class="${ut({active:!this.allFeatureDisabled&&this.showTourCommentTooltip})}"></velt-comment-tool>
6248
6248
  `}
6249
6249
  </div>
6250
- `}catch(t){return console.warn("Error in renderCommentTool: ",t),oh("Error in renderCommentTool: ",t),R``}},this.renderContentWarningSidebar=()=>{try{const t=!this.allFeatureDisabled&&(this.onboardingMode||"Admin"===this.snippylyUserRole);return this.showContentWarningSidebar&&t?R`
6250
+ `}catch(t){return console.warn("Error in renderCommentTool: ",t),nh("Error in renderCommentTool: ",t),R``}},this.renderContentWarningSidebar=()=>{try{const t=!this.allFeatureDisabled&&(this.onboardingMode||"Admin"===this.snippylyUserRole);return this.showContentWarningSidebar&&t?R`
6251
6251
  <content-warning-sidebar
6252
6252
  .agentGroups=${this.agentGroups}
6253
6253
  .currentPageUrl=${this.getEffectiveCurrentPageUrl()}
@@ -6260,21 +6260,21 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6260
6260
  @content-warning-item-click=${this.onContentWarningItemClick}
6261
6261
  @content-warning-item-next=${this.onContentWarningItemNext}
6262
6262
  ></content-warning-sidebar>
6263
- `:R``}catch(t){return console.warn("Error in renderContentWarningSidebar: ",t),oh("Error in renderContentWarningSidebar: ",t),R``}},this.getOnboardingTotalFindings=()=>{try{return Lu(this.getDisplayAgentRunStatuses(),this.agentGroups).filter((t=>t.state===qh)).reduce(((t,e)=>t+(e.count||0)),0)}catch(t){return console.warn("Error in getOnboardingTotalFindings: ",t),oh("Error in getOnboardingTotalFindings: ",t),0}},this.isOnboardingRunClean=()=>{try{return 0!==this.agentRunStatuses.length&&Lu(this.getDisplayAgentRunStatuses(),this.agentGroups).every((t=>t.state===Zh))}catch(t){return console.warn("Error in isOnboardingRunClean: ",t),oh("Error in isOnboardingRunClean: ",t),!1}},this.getOnboardingFindingsDisplayCount=()=>{try{const t=this.getOnboardingTotalFindings();return t>99?"99+":`${t}`}catch(t){return console.warn("Error in getOnboardingFindingsDisplayCount: ",t),oh("Error in getOnboardingFindingsDisplayCount: ",t),"0"}},this.isOnboardingAgentStatusLoading=()=>{try{return this.onboardingMode&&!this.agentRunStatusSettled}catch(t){return console.warn("Error in isOnboardingAgentStatusLoading: ",t),oh("Error in isOnboardingAgentStatusLoading: ",t),!1}},this.getOnboardingAgentButtonState=()=>{try{return!this.agentRunStatusTimedOut&&this.agentRunStatuses.some((t=>null==t?void 0:t.isRunning))?Ee.RUNNING:this.isOnboardingAgentStatusLoading()?Ee.LOADING:this.getOnboardingTotalFindings()>0?Ee.FINDINGS:this.isOnboardingRunClean()?Ee.CLEAN:Ee.IDLE}catch(t){return console.warn("Error in getOnboardingAgentButtonState: ",t),oh("Error in getOnboardingAgentButtonState: ",t),Ee.IDLE}},this.getOnboardingAgentButtonLabel=()=>{try{const t=this.getOnboardingAgentButtonState();if(t===Ee.RUNNING){const t=this.agentRunStatuses.length;return 1===t?Ih(ke.RUNNING_SINGLE):`${Ih(ke.RUNNING)} ${t} ${Ih(ke.QA_AGENTS)}`}return t===Ee.LOADING?Ih(ke.LOADING):t===Ee.FINDINGS?1===this.getOnboardingTotalFindings()?Ih(ke.FINDING_SINGLE):`${this.getOnboardingFindingsDisplayCount()} ${Ih(ke.FINDINGS)}`:Ih(t===Ee.CLEAN?ke.NO_FINDINGS_FOUND:ke.QA_AGENTS)}catch(t){return console.warn("Error in getOnboardingAgentButtonLabel: ",t),oh("Error in getOnboardingAgentButtonLabel: ",t),Ih(ke.QA_AGENTS)}},this.renderOnboardingAgentButtonIcon=t=>{try{return t===Ee.RUNNING||t===Ee.LOADING?R`
6263
+ `:R``}catch(t){return console.warn("Error in renderContentWarningSidebar: ",t),nh("Error in renderContentWarningSidebar: ",t),R``}},this.getOnboardingTotalFindings=()=>{try{return Ru(this.getDisplayAgentRunStatuses(),this.agentGroups).filter((t=>t.state===Zh)).reduce(((t,e)=>t+(e.count||0)),0)}catch(t){return console.warn("Error in getOnboardingTotalFindings: ",t),nh("Error in getOnboardingTotalFindings: ",t),0}},this.isOnboardingRunClean=()=>{try{return 0!==this.agentRunStatuses.length&&Ru(this.getDisplayAgentRunStatuses(),this.agentGroups).every((t=>t.state===Kh))}catch(t){return console.warn("Error in isOnboardingRunClean: ",t),nh("Error in isOnboardingRunClean: ",t),!1}},this.getOnboardingFindingsDisplayCount=()=>{try{const t=this.getOnboardingTotalFindings();return t>99?"99+":`${t}`}catch(t){return console.warn("Error in getOnboardingFindingsDisplayCount: ",t),nh("Error in getOnboardingFindingsDisplayCount: ",t),"0"}},this.isOnboardingAgentStatusLoading=()=>{try{return this.onboardingMode&&!this.agentRunStatusSettled}catch(t){return console.warn("Error in isOnboardingAgentStatusLoading: ",t),nh("Error in isOnboardingAgentStatusLoading: ",t),!1}},this.getOnboardingAgentButtonState=()=>{try{return!this.agentRunStatusTimedOut&&this.agentRunStatuses.some((t=>null==t?void 0:t.isRunning))?ke.RUNNING:this.isOnboardingAgentStatusLoading()?ke.LOADING:this.getOnboardingTotalFindings()>0?ke.FINDINGS:this.isOnboardingRunClean()?ke.CLEAN:ke.IDLE}catch(t){return console.warn("Error in getOnboardingAgentButtonState: ",t),nh("Error in getOnboardingAgentButtonState: ",t),ke.IDLE}},this.getOnboardingAgentButtonLabel=()=>{try{const t=this.getOnboardingAgentButtonState();if(t===ke.RUNNING){const t=this.agentRunStatuses.length;return 1===t?_h(Se.RUNNING_SINGLE):`${_h(Se.RUNNING)} ${t} ${_h(Se.QA_AGENTS)}`}return t===ke.LOADING?_h(Se.LOADING):t===ke.FINDINGS?1===this.getOnboardingTotalFindings()?_h(Se.FINDING_SINGLE):`${this.getOnboardingFindingsDisplayCount()} ${_h(Se.FINDINGS)}`:_h(t===ke.CLEAN?Se.NO_FINDINGS_FOUND:Se.QA_AGENTS)}catch(t){return console.warn("Error in getOnboardingAgentButtonLabel: ",t),nh("Error in getOnboardingAgentButtonLabel: ",t),_h(Se.QA_AGENTS)}},this.renderOnboardingAgentButtonIcon=t=>{try{return t===ke.RUNNING||t===ke.LOADING?R`
6264
6264
  <svg class="onboarding-agent-icon onboarding-agent-icon-spinner" width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
6265
6265
  <path d="M17 8.5C17 13.1944 13.1944 17 8.5 17C3.80558 17 0 13.1944 0 8.5C0 3.80558 3.80558 3.82234e-06 8.5 3.82234e-06C13.1944 3.82234e-06 17 3.80558 17 8.5ZM2.125 8.5C2.125 12.0208 4.97918 14.875 8.5 14.875C12.0208 14.875 14.875 12.0208 14.875 8.5C14.875 4.97919 12.0208 2.125 8.5 2.125C4.97918 2.125 2.125 4.97919 2.125 8.5Z" fill="#D9D9D9"/>
6266
6266
  <path d="M15.9375 8.5C16.5243 8.5 17.0068 8.02247 16.9337 7.44024C16.7696 6.13462 16.3039 4.87981 15.5675 3.77766C14.6335 2.37984 13.306 1.29037 11.7528 0.647028C10.1996 0.00368291 8.49057 -0.164645 6.84173 0.163329C5.54166 0.421929 4.32507 0.979922 3.28585 1.78712C2.82242 2.14709 2.82596 2.82597 3.24089 3.2409V3.2409C3.65583 3.65583 4.32448 3.64716 4.8025 3.30682C5.53316 2.7866 6.36879 2.42403 7.2563 2.2475C8.49293 2.00152 9.77473 2.12776 10.9396 2.61027C12.1045 3.09278 13.1001 3.90988 13.8006 4.95824C14.3034 5.71064 14.6379 6.55789 14.7867 7.4424C14.884 8.02107 15.3507 8.5 15.9375 8.5V8.5Z" fill="#625DF5"/>
6267
6267
  </svg>
6268
- `:t===Ee.FINDINGS?R`
6268
+ `:t===ke.FINDINGS?R`
6269
6269
  <svg class="onboarding-agent-icon" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
6270
6270
  <rect width="18" height="18" rx="9" fill="#E94B1E"/>
6271
6271
  <path d="M10.2467 4.5L10.0307 11.0205H8.43772L8.20822 4.5H10.2467ZM9.27472 14.1795C8.93272 14.1795 8.64922 14.076 8.42422 13.869C8.20822 13.653 8.10022 13.3875 8.10022 13.0725C8.10022 12.7575 8.20822 12.4965 8.42422 12.2895C8.64922 12.0735 8.93272 11.9655 9.27472 11.9655C9.60772 11.9655 9.88222 12.0735 10.0982 12.2895C10.3142 12.4965 10.4222 12.7575 10.4222 13.0725C10.4222 13.3875 10.3142 13.653 10.0982 13.869C9.88222 14.076 9.60772 14.1795 9.27472 14.1795Z" fill="white"/>
6272
6272
  </svg>
6273
- `:t===Ee.CLEAN?R`
6273
+ `:t===ke.CLEAN?R`
6274
6274
  <svg class="onboarding-agent-icon" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
6275
6275
  <path d="M5.83333 10L10 14.1667L18.3333 5.83333M1.66667 10L5.83333 14.1667M10 10L14.1667 5.83333" stroke="#0DCF82" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/>
6276
6276
  </svg>
6277
- `:null}catch(t){return console.warn("Error in renderOnboardingAgentButtonIcon: ",t),oh("Error in renderOnboardingAgentButtonIcon: ",t),null}},this.renderOnboardingToolbar=()=>{try{const t=!!this.snippylyUserRole&&!this.isPlanExpired&&!this.planLimitLocked&&!this.projectDeleted&&!this.allFeatureDisabled&&(!this.passwordProtected||this.passwordProtected&&this.isPasswordValid),e=this.getOnboardingAgentButtonState();return R`
6277
+ `:null}catch(t){return console.warn("Error in renderOnboardingAgentButtonIcon: ",t),nh("Error in renderOnboardingAgentButtonIcon: ",t),null}},this.renderOnboardingToolbar=()=>{try{const t=!!this.snippylyUserRole&&!this.isPlanExpired&&!this.planLimitLocked&&!this.projectDeleted&&!this.allFeatureDisabled&&(!this.passwordProtected||this.passwordProtected&&this.isPasswordValid),e=this.getOnboardingAgentButtonState();return R`
6278
6278
  <div class="snippyly-plugin-container onboarding-container" part="superflow-toolbar-container">
6279
6279
  <div class="toolbar onboarding-toolbar"
6280
6280
  @mousemove=${t=>this.toolbarMouseMove(t)}
@@ -6297,7 +6297,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6297
6297
  </div>
6298
6298
  ${this.renderContentWarningSidebar()}
6299
6299
  </div>
6300
- `}catch(t){return console.warn("Error in renderOnboardingToolbar: ",t),oh("Error in renderOnboardingToolbar: ",t),R``}},this.renderClientToolbar=()=>{var t;try{const e=xi((null===(t=this.clientGrant)||void 0===t?void 0:t.project)||null),i=!!this.snippylyUserRole&&!this.isPlanExpired&&!this.planLimitLocked&&!this.projectDeleted&&!this.allFeatureDisabled&&(!this.passwordProtected||this.passwordProtected&&this.isPasswordValid);return R`
6300
+ `}catch(t){return console.warn("Error in renderOnboardingToolbar: ",t),nh("Error in renderOnboardingToolbar: ",t),R``}},this.renderClientToolbar=()=>{var t;try{const e=Ei((null===(t=this.clientGrant)||void 0===t?void 0:t.project)||null),i=!!this.snippylyUserRole&&!this.isPlanExpired&&!this.planLimitLocked&&!this.projectDeleted&&!this.allFeatureDisabled&&(!this.passwordProtected||this.passwordProtected&&this.isPasswordValid);return R`
6301
6301
  <div class="snippyly-plugin-container client-container" part="superflow-toolbar-container"
6302
6302
  data-testid="sf-client-toolbar">
6303
6303
  <div class="toolbar client-toolbar"
@@ -6319,28 +6319,28 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6319
6319
  <div class="toolbar-divider"></div>
6320
6320
  <div class="client-requests-button" data-testid="sf-client-requests">
6321
6321
  <div class="tooltip">
6322
- <div class="tooltiptext">${Ih(hi)}</div>
6322
+ <div class="tooltiptext">${_h(ui)}</div>
6323
6323
  <velt-sidebar-button shadow-dom="false"></velt-sidebar-button>
6324
6324
  </div>
6325
6325
  <button type="button" class="client-requests-label" data-testid="sf-client-requests-label"
6326
- @click=${()=>this.onClientRequestsClick()}>${Ih(hi)}</button>
6326
+ @click=${()=>this.onClientRequestsClick()}>${_h(ui)}</button>
6327
6327
  </div>
6328
6328
  `:null}
6329
6329
  ${this.loading?null:R`
6330
6330
  <div class="toolbar-divider"></div>
6331
6331
  <button type="button" class="client-sign-in-button" data-testid="sf-client-sign-in"
6332
- @click=${()=>this.onClientSignInClick()}>${Ih(ui)}</button>
6332
+ @click=${()=>this.onClientSignInClick()}>${_h(pi)}</button>
6333
6333
  `}
6334
6334
  </div>
6335
6335
  </div>
6336
- `}catch(t){return console.warn("Error in renderClientToolbar: ",t),oh("Error in renderClientToolbar: ",t),R``}},this.renderRequestSignOut=()=>{try{const t=function(t){try{const e=t&&"object"==typeof t?t:null,i="string"==typeof(null==e?void 0:e.email)?e.email.trim():"",o="string"==typeof(null==e?void 0:e.name)?e.name.trim():"";return i||o}catch(t){return console.warn("Error in signOutIdentity: ",t),""}}(this.snippylyUser),e=t?`${Ih(Gd)} ${t}`:"",i=Ih(Hd),o=R`
6336
+ `}catch(t){return console.warn("Error in renderClientToolbar: ",t),nh("Error in renderClientToolbar: ",t),R``}},this.renderRequestSignOut=()=>{try{const t=function(t){try{const e=t&&"object"==typeof t?t:null,i="string"==typeof(null==e?void 0:e.email)?e.email.trim():"",o="string"==typeof(null==e?void 0:e.name)?e.name.trim():"";return i||o}catch(t){return console.warn("Error in signOutIdentity: ",t),""}}(this.snippylyUser),e=t?`${_h(Wd)} ${t}`:"",i=_h(Gd),o=R`
6337
6337
  <button type="button" class="client-sign-in-button" data-testid="sf-request-sign-out"
6338
6338
  aria-label=${e?`${i}. ${e}`:i}
6339
6339
  @click=${()=>this.signOutUser()}>${i}</button>`;return e?R`
6340
6340
  <div class="tooltip request-sign-out">
6341
6341
  <div class="tooltiptext request-sign-out-tooltiptext" data-testid="sf-request-sign-out-tooltip">${e}</div>
6342
6342
  ${o}
6343
- </div>`:o}catch(t){return console.warn("Error in renderRequestSignOut: ",t),oh("Error in renderRequestSignOut: ",t),R``}},this.renderRequestToolbar=()=>{try{const t=this.maintenanceRequestsLabel.trim()?function(t){try{return("string"==typeof t?t.trim():"")||Bd}catch(t){return console.warn("Error in requestToolbarTitle: ",t),Bd}}(this.maintenanceRequestsLabel):Ih(Bd),e=!!this.snippylyUserRole&&!this.isPlanExpired&&!this.planLimitLocked&&!this.projectDeleted&&!this.allFeatureDisabled&&(!this.passwordProtected||this.passwordProtected&&this.isPasswordValid);return R`
6343
+ </div>`:o}catch(t){return console.warn("Error in renderRequestSignOut: ",t),nh("Error in renderRequestSignOut: ",t),R``}},this.renderRequestToolbar=()=>{try{const t=this.maintenanceRequestsLabel.trim()?function(t){try{return("string"==typeof t?t.trim():"")||zd}catch(t){return console.warn("Error in requestToolbarTitle: ",t),zd}}(this.maintenanceRequestsLabel):_h(zd),e=!!this.snippylyUserRole&&!this.isPlanExpired&&!this.planLimitLocked&&!this.projectDeleted&&!this.allFeatureDisabled&&(!this.passwordProtected||this.passwordProtected&&this.isPasswordValid);return R`
6344
6344
  <div class="snippyly-plugin-container client-container request-container" part="superflow-toolbar-container"
6345
6345
  data-testid="sf-request-toolbar">
6346
6346
  <div class="toolbar client-toolbar"
@@ -6360,11 +6360,11 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6360
6360
  <div class="toolbar-divider"></div>
6361
6361
  <div class="client-requests-button" data-testid="sf-request-requests">
6362
6362
  <div class="tooltip">
6363
- <div class="tooltiptext">${Ih(zd)}</div>
6363
+ <div class="tooltiptext">${_h(Hd)}</div>
6364
6364
  <velt-sidebar-button shadow-dom="false"></velt-sidebar-button>
6365
6365
  </div>
6366
6366
  <button type="button" class="client-requests-label" data-testid="sf-request-requests-label"
6367
- @click=${()=>this.onClientRequestsClick()}>${Ih(zd)}</button>
6367
+ @click=${()=>this.onClientRequestsClick()}>${_h(Hd)}</button>
6368
6368
  </div>
6369
6369
  `:null}
6370
6370
  ${this.customLoginEnabledLocally?null:R`
@@ -6373,19 +6373,19 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6373
6373
  `}
6374
6374
  </div>
6375
6375
  </div>
6376
- `}catch(t){return console.warn("Error in renderRequestToolbar: ",t),oh("Error in renderRequestToolbar: ",t),R``}},localStorage.setItem("sfToolbarVersion",ft),this.guestUserNameUpdated=!!Md(ye);const t=new URL(document.location);t.searchParams.has(Yt)&&t.searchParams.delete(Yt),this.signInUrl=`${Ke}/signin?redirect_url=${encodeURIComponent(null==t?void 0:t.toString())}&source=sf`,this.signOutUrl=(t=>{try{const e=new URL(t);return Fd(e)?(e.searchParams.delete(Yt),e.searchParams.set(Ge,We),e.toString()):null}catch(t){return console.warn("Error in buildLivePreviewSignOutUrl: ",t),null}})(t.toString())||`${Ke}/signout?redirect_url=${encodeURIComponent(null==t?void 0:t.toString())}&source=sf`;const e=window.Superflow;window.Superflow={enableCustomLogin:async()=>{this.customLoginEnabledLocally=!0,Ad(Qt),Ud(),await this.checkCustomLoginEnabled()},identify:async t=>{this.providedUser=t,this.customLoginEnabled&&this.loginWithCustomUser()},signInUrl:this.signInUrl,signOutUrl:this.signOutUrl,openGuestModeSignInModal:t=>{this.skipGuestNameModal=t,this.openGuestModeSignInModal()},onPasswordProtectedModalOpenButtonClick:()=>{this.onPasswordProtectedModalOpenButtonClick()}},this.bootstrapStubToReplay=e;try{this.detectVersion(),this.setWindowEventListner(),this.urlChangeListener(),this.checkUrl(),this.nativeCapture.onEnded=()=>this.handleNativeScreenshotStreamEnded(),console.log("*** Staging Mode ON! ***")}catch(t){console.warn("Error in constructor: ",t),oh("Error in constructor: ",t)}}get loadPlugin(){return this._loadPlugin}set loadPlugin(t){var e,i,o,n,r,s,a,l,c,d;this._loadPlugin=t,this.loadPlugin?(this.classList.add("visible"),null===(i=null===(e=null===document||void 0===document?void 0:document.body)||void 0===e?void 0:e.style)||void 0===i||i.setProperty("transform","none","important"),null===(r=null===(n=null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.parentElement)||void 0===n?void 0:n.style)||void 0===r||r.setProperty("transform","none","important"),null===(a=null===(s=null===document||void 0===document?void 0:document.body)||void 0===s?void 0:s.style)||void 0===a||a.setProperty("perspective","none","important"),null===(d=null===(c=null===(l=null===document||void 0===document?void 0:document.body)||void 0===l?void 0:l.parentElement)||void 0===c?void 0:c.style)||void 0===d||d.setProperty("perspective","none","important")):this.classList.remove("visible")}get expanded(){return this._expanded}set expanded(t){this._expanded=t,this.expanded?this.classList.add("expanded"):this.classList.remove("expanded")}get isPlanExpired(){return this._isPlanExpired}set isPlanExpired(t){this._isPlanExpired=t,this.checkToEnableUpgradeButton(),this.applyVeltFeatureGates()}get apiKey(){return this._apiKey}set apiKey(t){this._apiKey=t,this.onApiKeyChange(),th({apiKey:this.apiKey}),this.checkUrl(),this.apiKey&&this.replayBootstrapQueue()}get projectId(){return this._projectId}set projectId(t){this._projectId=t,this.projectIdSupplied=!!t,this.checkUrl()}get projectVersionKey(){return this._projectVersionKey}set projectVersionKey(t){try{this._projectVersionKey=t,this.projectVersionKey&&Sd(ie,this.projectVersionKey,!1,"sessionStorage"),this.exitReviewModeCalled||this.detectVersion()}catch(t){console.warn("Error in set projectVersionKey: ",t),oh("Error in set projectVersionKey: ",t)}}get autoLocation(){return this._autoLocation}set autoLocation(t){this._autoLocation="true"===t||!0===t}get menuOpenedId(){return this._menuOpenedId}set menuOpenedId(t){this._menuOpenedId=t,this.menuOpenedId?this.addWindowClickEventListener():this.removeWindowClickEventListener()}get isUserGlobalContact(){return this._isUserGlobalContact}set isUserGlobalContact(t){this._isUserGlobalContact=t,this.checkToEnableUpgradeButton()}get privateCommentModeEnabled(){return this._privateCommentModeEnabled}set privateCommentModeEnabled(t){this._privateCommentModeEnabled=t,this.darkMode=!!this.privateCommentModeEnabled}get customerMetadata(){return this._customerMetadata}set customerMetadata(t){this._customerMetadata=t,this.setLogos()}get documentMetadata(){return this._documentMetadata}set documentMetadata(t){this._documentMetadata=t}get darkMode(){return this._darkMode}set darkMode(t){this._darkMode=t,this.setLogos()}get queryParamsComments(){return this._queryParamsComments}set queryParamsComments(t){this._queryParamsComments=t,this.setQueryParamsCommentsInSdk()}get usePageTitleAsLocationName(){return this._usePageTitleAsLocationName}set usePageTitleAsLocationName(t){this._usePageTitleAsLocationName=t}get totalViews(){return this._totalViews}set totalViews(t){this._totalViews=t,this.totalViewsCount=Object.keys(this.totalViews||{}).length}get sidebarV2Enabled(){return function(t){const e=!!t&&St.includes(t);try{const t=sessionStorage.getItem(xt);if("true"===t)return!0;if("false"===t)return!1}catch{}return!e}(this.apiKey)}get canToggleSidebarVersion(){return!0}get veltProxyEnabled(){return function(t){const e=!!t&&kt.includes(t);try{const t=null===localStorage||void 0===localStorage?void 0:localStorage.getItem(Et);if("true"===t)return!0;if("false"===t)return!1}catch(t){}return!e}(this.apiKey)}replayBootstrapQueue(){try{const t=this.bootstrapStubToReplay;if(this.bootstrapStubToReplay=null,!t||!0!==t.isBootstrapStub||!Array.isArray(t.pending))return;const e=window.Superflow;for(const i of t.pending)try{const t=i&&"string"==typeof i.method?e[i.method]:void 0;"function"==typeof t&&t.apply(e,Array.isArray(i.args)?i.args:[])}catch(t){console.warn("Error replaying bootstrap call: ",null==i?void 0:i.method,t),oh("Error replaying bootstrap call: ",t)}t.pending.length=0}catch(t){console.warn("Error in replayBootstrapQueue: ",t),oh("Error in replayBootstrapQueue: ",t)}}connectedCallback(){super.connectedCallback(),Fh.install(),Fh.setEnvironmentContext(ft,this.staging?"staging":"production"),this.getAttribute("apiKey")&&!this.getAttribute("projectId")&&(this.projectId=bd(xd(window.location.origin))+"",this.projectIdSupplied=!1),this.expanded=!0,this.setAttribute("data-velt-comment-disabled","true"),this.style.zIndex="2147483647",this.nativeScreenshotDenied="denied"===Md(Se,!1,"sessionStorage"),this.ensureAddCommentAnnotationSubscription(),this.resyncAgentPins(),this.setupSuggestionActionGuard(),this.applySuggestionActionStyles(),setTimeout((()=>{if(!this.superflowToolbarMoved){this.superflowToolbarMoved=!0,document.body.appendChild(this);const t=document.querySelector(".cdk-overlay-container");t&&document.body.appendChild(t)}}),5e3);const t=document.createElement("style");t.innerHTML='\n body[data-velt-ongoing-recording="screen"] superflow-toolbar { display: none !important; }\n ',document.head.appendChild(t),this.addStyles(),setTimeout((()=>{const t=document.querySelectorAll('script[src*="snippyly.min.js"]');(null==t?void 0:t.length)>1&&(console.warn("Multiple superflow scripts installed."),nh(gt.Events.DUPLICATE_SCRIPT_INSTALLED))}),1e3),this.locationChangeListenerAttached||(this.setWindowEventListner(),this.checkUrl()),this.startAgentRunStatusListener()}updated(t){try{if(super.updated(t),t.has("showContentWarningSidebar")){this.setCommentSidebarVisibility(this.showContentWarningSidebar);const e=t.get("showContentWarningSidebar");this.showContentWarningSidebar?(Sd(xe,"true",!1,"sessionStorage"),this.onboardingMode&&this.clearOnboardingSidebarDismissal(),this.unhidePageCommentsIfHidden()):!0===e&&(Ad(xe,"sessionStorage"),this.onboardingMode&&this.recordOnboardingSidebarDismissal())}this.onboardingMode&&(this.observeOnboardingPanel(),this.scheduleOnboardingViewportClamp())}catch(t){console.warn("Error in updated: ",t)}}disconnectedCallback(){try{super.disconnectedCallback(),this.stopAgentRunStatusListener(),queueMicrotask((()=>{var t,e;try{if(this.isConnected)return void this.logCaptureTrigger("disconnect teardown skipped: element moved, not removed");this.logCaptureTrigger("disconnect teardown: element removed, releasing stream + subscription"),this.nativeCapture.dispose(),this.nativeScreenshotEnabled=!1,this.capturingScreenshot=!1,this.pendingScreenshotCount=0,this.restoreSdkScreenshot(),null===(e=null===(t=this.addCommentAnnotationSubscription)||void 0===t?void 0:t.unsubscribe)||void 0===e||e.call(t),this.addCommentAnnotationSubscription=void 0,this.addCommentAnnotationSubscribedEl=void 0,this.teardownAgentPins(),this.clearApprovalNoticeTimer(),this.approvalNotice=null,this.removeSuggestionActionStyles(),this.removeWindowLocationChangeListener()}catch(t){console.warn("Error in disconnectedCallback teardown: ",t)}}))}catch(t){console.warn("Error in disconnectedCallback: ",t)}}async detectToolbarEnabled(){try{if(this.projectId&&this.apiKey){this.toolbarEnabledApiCalled=!0;const t=document.location.toString();this.isDriveOrPreviewHost()?this.toolbarEnabled=!0:this.toolbarEnabled=await dh(this.apiKey,this.projectId,t),this.toolbarEnabled||nh(gt.Events.TOOLBAR_DISABLED)}}catch(t){console.warn("Error in detectToolbarEnabled: ",t),oh("Error in detectToolbarEnabled: ",t)}}get canShowPrivateCommentToggle(){return this.hasPrivateCommentsAccess&&this.isPrivateCommentsEnabledOnWorkspace}renderProjectNotFoundChip(){const t=this.isUserGlobalContact||"Admin"===this.snippylyUserRole;return R`
6376
+ `}catch(t){return console.warn("Error in renderRequestToolbar: ",t),nh("Error in renderRequestToolbar: ",t),R``}},localStorage.setItem("sfToolbarVersion",ft),this.guestUserNameUpdated=!!Md(be);const t=new URL(document.location);t.searchParams.has(Yt)&&t.searchParams.delete(Yt),this.signInUrl=`${Je}/signin?redirect_url=${encodeURIComponent(null==t?void 0:t.toString())}&source=sf`,this.signOutUrl=(t=>{try{const e=new URL(t);return Pd(e)?(e.searchParams.delete(Yt),e.searchParams.set(We,qe),e.toString()):null}catch(t){return console.warn("Error in buildLivePreviewSignOutUrl: ",t),null}})(t.toString())||`${Je}/signout?redirect_url=${encodeURIComponent(null==t?void 0:t.toString())}&source=sf`;const e=window.Superflow;window.Superflow={enableCustomLogin:async()=>{this.customLoginEnabledLocally=!0,Td(Qt),Bd(),await this.checkCustomLoginEnabled()},identify:async t=>{this.providedUser=t,this.customLoginEnabled&&this.loginWithCustomUser()},signInUrl:this.signInUrl,signOutUrl:this.signOutUrl,openGuestModeSignInModal:t=>{this.skipGuestNameModal=t,this.openGuestModeSignInModal()},onPasswordProtectedModalOpenButtonClick:()=>{this.onPasswordProtectedModalOpenButtonClick()}},this.bootstrapStubToReplay=e;try{this.detectVersion(),this.setWindowEventListner(),this.urlChangeListener(),this.checkUrl(),this.nativeCapture.onEnded=()=>this.handleNativeScreenshotStreamEnded(),console.log("*** Staging Mode ON! ***")}catch(t){console.warn("Error in constructor: ",t),nh("Error in constructor: ",t)}}get loadPlugin(){return this._loadPlugin}set loadPlugin(t){var e,i,o,n,r,s,a,l,c,d;this._loadPlugin=t,this.loadPlugin?(this.classList.add("visible"),null===(i=null===(e=null===document||void 0===document?void 0:document.body)||void 0===e?void 0:e.style)||void 0===i||i.setProperty("transform","none","important"),null===(r=null===(n=null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.parentElement)||void 0===n?void 0:n.style)||void 0===r||r.setProperty("transform","none","important"),null===(a=null===(s=null===document||void 0===document?void 0:document.body)||void 0===s?void 0:s.style)||void 0===a||a.setProperty("perspective","none","important"),null===(d=null===(c=null===(l=null===document||void 0===document?void 0:document.body)||void 0===l?void 0:l.parentElement)||void 0===c?void 0:c.style)||void 0===d||d.setProperty("perspective","none","important")):this.classList.remove("visible")}get expanded(){return this._expanded}set expanded(t){this._expanded=t,this.expanded?this.classList.add("expanded"):this.classList.remove("expanded")}get isPlanExpired(){return this._isPlanExpired}set isPlanExpired(t){this._isPlanExpired=t,this.checkToEnableUpgradeButton(),this.applyVeltFeatureGates()}get apiKey(){return this._apiKey}set apiKey(t){this._apiKey=t,this.onApiKeyChange(),eh({apiKey:this.apiKey}),this.checkUrl(),this.apiKey&&this.replayBootstrapQueue()}get projectId(){return this._projectId}set projectId(t){this._projectId=t,this.projectIdSupplied=!!t,this.checkUrl()}get projectVersionKey(){return this._projectVersionKey}set projectVersionKey(t){try{this._projectVersionKey=t,this.projectVersionKey&&Ad(oe,this.projectVersionKey,!1,"sessionStorage"),this.exitReviewModeCalled||this.detectVersion()}catch(t){console.warn("Error in set projectVersionKey: ",t),nh("Error in set projectVersionKey: ",t)}}get autoLocation(){return this._autoLocation}set autoLocation(t){this._autoLocation="true"===t||!0===t}get menuOpenedId(){return this._menuOpenedId}set menuOpenedId(t){this._menuOpenedId=t,this.menuOpenedId?this.addWindowClickEventListener():this.removeWindowClickEventListener()}get isUserGlobalContact(){return this._isUserGlobalContact}set isUserGlobalContact(t){this._isUserGlobalContact=t,this.checkToEnableUpgradeButton()}get privateCommentModeEnabled(){return this._privateCommentModeEnabled}set privateCommentModeEnabled(t){this._privateCommentModeEnabled=t,this.darkMode=!!this.privateCommentModeEnabled}get customerMetadata(){return this._customerMetadata}set customerMetadata(t){this._customerMetadata=t,this.setLogos()}get documentMetadata(){return this._documentMetadata}set documentMetadata(t){this._documentMetadata=t}get darkMode(){return this._darkMode}set darkMode(t){this._darkMode=t,this.setLogos()}get queryParamsComments(){return this._queryParamsComments}set queryParamsComments(t){this._queryParamsComments=t,this.setQueryParamsCommentsInSdk()}get usePageTitleAsLocationName(){return this._usePageTitleAsLocationName}set usePageTitleAsLocationName(t){this._usePageTitleAsLocationName=t}get totalViews(){return this._totalViews}set totalViews(t){this._totalViews=t,this.totalViewsCount=Object.keys(this.totalViews||{}).length}get sidebarV2Enabled(){return function(t){const e=!!t&&St.includes(t);try{const t=sessionStorage.getItem(xt);if("true"===t)return!0;if("false"===t)return!1}catch{}return!e}(this.apiKey)}get canToggleSidebarVersion(){return!0}get veltProxyEnabled(){return function(t){const e=!!t&&kt.includes(t);try{const t=null===localStorage||void 0===localStorage?void 0:localStorage.getItem(Et);if("true"===t)return!0;if("false"===t)return!1}catch(t){}return!e}(this.apiKey)}replayBootstrapQueue(){try{const t=this.bootstrapStubToReplay;if(this.bootstrapStubToReplay=null,!t||!0!==t.isBootstrapStub||!Array.isArray(t.pending))return;const e=window.Superflow;for(const i of t.pending)try{const t=i&&"string"==typeof i.method?e[i.method]:void 0;"function"==typeof t&&t.apply(e,Array.isArray(i.args)?i.args:[])}catch(t){console.warn("Error replaying bootstrap call: ",null==i?void 0:i.method,t),nh("Error replaying bootstrap call: ",t)}t.pending.length=0}catch(t){console.warn("Error in replayBootstrapQueue: ",t),nh("Error in replayBootstrapQueue: ",t)}}connectedCallback(){super.connectedCallback(),Ph.install(),Ph.setEnvironmentContext(ft,this.staging?"staging":"production"),this.getAttribute("apiKey")&&!this.getAttribute("projectId")&&(this.projectId=Cd(Ed(window.location.origin))+"",this.projectIdSupplied=!1),this.expanded=!0,this.setAttribute("data-velt-comment-disabled","true"),this.style.zIndex="2147483647",this.nativeScreenshotDenied="denied"===Md(Ae,!1,"sessionStorage"),this.ensureAddCommentAnnotationSubscription(),this.resyncAgentPins(),this.applySuggestionActionStyles(),setTimeout((()=>{if(!this.superflowToolbarMoved){this.superflowToolbarMoved=!0,document.body.appendChild(this);const t=document.querySelector(".cdk-overlay-container");t&&document.body.appendChild(t)}}),5e3);const t=document.createElement("style");t.innerHTML='\n body[data-velt-ongoing-recording="screen"] superflow-toolbar { display: none !important; }\n ',document.head.appendChild(t),this.addStyles(),setTimeout((()=>{const t=document.querySelectorAll('script[src*="snippyly.min.js"]');(null==t?void 0:t.length)>1&&(console.warn("Multiple superflow scripts installed."),rh(gt.Events.DUPLICATE_SCRIPT_INSTALLED))}),1e3),this.locationChangeListenerAttached||(this.setWindowEventListner(),this.checkUrl()),this.startAgentRunStatusListener()}updated(t){try{if(super.updated(t),t.has("showContentWarningSidebar")){this.setCommentSidebarVisibility(this.showContentWarningSidebar);const e=t.get("showContentWarningSidebar");this.showContentWarningSidebar?(Ad(Ee,"true",!1,"sessionStorage"),this.onboardingMode&&this.clearOnboardingSidebarDismissal(),this.unhidePageCommentsIfHidden()):!0===e&&(Td(Ee,"sessionStorage"),this.onboardingMode&&this.recordOnboardingSidebarDismissal())}this.onboardingMode&&(this.observeOnboardingPanel(),this.scheduleOnboardingViewportClamp())}catch(t){console.warn("Error in updated: ",t)}}disconnectedCallback(){try{super.disconnectedCallback(),this.stopAgentRunStatusListener(),queueMicrotask((()=>{var t,e;try{if(this.isConnected)return void this.logCaptureTrigger("disconnect teardown skipped: element moved, not removed");this.logCaptureTrigger("disconnect teardown: element removed, releasing stream + subscription"),this.nativeCapture.dispose(),this.nativeScreenshotEnabled=!1,this.capturingScreenshot=!1,this.pendingScreenshotCount=0,this.restoreSdkScreenshot(),null===(e=null===(t=this.addCommentAnnotationSubscription)||void 0===t?void 0:t.unsubscribe)||void 0===e||e.call(t),this.addCommentAnnotationSubscription=void 0,this.addCommentAnnotationSubscribedEl=void 0,this.teardownAgentPins(),this.clearApprovalNoticeTimer(),this.approvalNotice=null,this.removeSuggestionActionStyles(),this.removeWindowLocationChangeListener()}catch(t){console.warn("Error in disconnectedCallback teardown: ",t)}}))}catch(t){console.warn("Error in disconnectedCallback: ",t)}}async detectToolbarEnabled(){try{if(this.projectId&&this.apiKey){this.toolbarEnabledApiCalled=!0;const t=document.location.toString();this.isDriveOrPreviewHost()?this.toolbarEnabled=!0:this.toolbarEnabled=await hh(this.apiKey,this.projectId,t),this.toolbarEnabled||rh(gt.Events.TOOLBAR_DISABLED)}}catch(t){console.warn("Error in detectToolbarEnabled: ",t),nh("Error in detectToolbarEnabled: ",t)}}get canShowPrivateCommentToggle(){return this.hasPrivateCommentsAccess&&this.isPrivateCommentsEnabledOnWorkspace}renderProjectNotFoundChip(){const t=this.isUserGlobalContact||"Admin"===this.snippylyUserRole;return R`
6377
6377
  <div class="tooltip">
6378
6378
  <div class="tooltiptext">
6379
- ${Ih("This project no longer exists in Superflow. It may have been deleted.")}
6379
+ ${_h("This project no longer exists in Superflow. It may have been deleted.")}
6380
6380
  </div>
6381
6381
  <div class="s-alert-btn danger">
6382
6382
  <div class='error-container'>
6383
6383
  ${this.getAlertIcon()}
6384
- <div class="error-message">${Ih("Project not found")}</div>
6384
+ <div class="error-message">${_h("Project not found")}</div>
6385
6385
  </div>
6386
6386
  ${t?R`
6387
6387
  <div class="s-cta-btn" @click=${()=>this.goToAdminPortalDashboard()}>
6388
- ${Ih("Open Superflow")}
6388
+ ${_h("Open Superflow")}
6389
6389
  </div>
6390
6390
  `:null}
6391
6391
  </div>
@@ -6427,7 +6427,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6427
6427
  <div class="toolbar-section comment-viewmode-section ${ut({"d-none":!this.expanded})}">
6428
6428
  <div class="toolbar-actions1 ${ut({"d-none":!this.commentElement})}">
6429
6429
  <div class="tooltip">
6430
- <div class="tooltiptext">${Ih("All Comments")}</div>
6430
+ <div class="tooltiptext">${_h("All Comments")}</div>
6431
6431
  <velt-sidebar-button sidebar-button-count-type="filter" shadow-dom="false"></velt-sidebar-button>
6432
6432
  </div>
6433
6433
  </div>
@@ -6497,13 +6497,13 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6497
6497
  <path fill-rule="evenodd" clip-rule="evenodd" d="M8.64754 5.99921C8.27961 6.01309 7.97008 5.72609 7.95619 5.35816C7.92488 4.5287 7.8809 3.92331 7.83766 3.48926C7.79508 3.06179 7.53702 2.8046 7.1773 2.76063C6.75313 2.70878 6.15477 2.66634 5.33367 2.66634C4.51254 2.66634 3.91418 2.70878 3.49002 2.76063C3.13048 2.80458 2.87229 3.06189 2.8297 3.48946C2.74944 4.29515 2.667 5.68713 2.667 7.99968C2.667 10.3122 2.74944 11.7042 2.8297 12.5099C2.87229 12.9375 3.13048 13.1948 3.49002 13.2387C3.91418 13.2906 4.51254 13.333 5.33367 13.333C6.15477 13.333 6.75313 13.2906 7.1773 13.2387C7.53702 13.1947 7.79508 12.9376 7.83766 12.5101C7.8809 12.076 7.92488 11.4706 7.95619 10.6412C7.97008 10.2733 8.27961 9.98626 8.64754 10.0001C9.01546 10.014 9.30247 10.3236 9.28858 10.6915C9.25644 11.5428 9.21087 12.1761 9.16443 12.6423C9.06679 13.6224 8.38345 14.4345 7.33908 14.5622C6.85294 14.6216 6.19979 14.6663 5.33367 14.6663C4.46752 14.6663 3.81436 14.6216 3.32822 14.5622C2.28377 14.4345 1.60055 13.622 1.50293 12.6421C1.41698 11.7792 1.33367 10.3407 1.33367 7.99968C1.33367 5.65866 1.41698 4.22013 1.50293 3.35729C1.60055 2.37738 2.28377 1.56483 3.32822 1.43715C3.81436 1.37772 4.46752 1.33301 5.33367 1.33301C6.19979 1.33301 6.85294 1.37772 7.33908 1.43714C8.38345 1.56481 9.06679 2.37697 9.16443 3.35709C9.21087 3.8233 9.25644 4.45651 9.28858 5.30786C9.30247 5.67579 9.01546 5.98532 8.64754 5.99921Z" fill="white"/>
6498
6498
  <path fill-rule="evenodd" clip-rule="evenodd" d="M11.1966 6.13807C10.9362 5.87772 10.9362 5.45561 11.1966 5.19526C11.4569 4.93491 11.879 4.93491 12.1394 5.19526L14.4727 7.5286C14.7331 7.78894 14.7331 8.21105 14.4727 8.4714L12.1394 10.8047C11.879 11.0651 11.4569 11.0651 11.1966 10.8047C10.9362 10.5444 10.9362 10.1223 11.1966 9.86193L12.3918 8.66667H6.0013C5.63311 8.66667 5.33463 8.36819 5.33463 8C5.33463 7.63181 5.63311 7.33333 6.0013 7.33333L12.3918 7.33333L11.1966 6.13807Z" fill="white"/>
6499
6499
  </svg>
6500
- <span>${Ih("Sign in again!")}</span>
6500
+ <span>${_h("Sign in again!")}</span>
6501
6501
  `:R`
6502
6502
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
6503
6503
  <path fill-rule="evenodd" clip-rule="evenodd" d="M8.64754 5.99921C8.27961 6.01309 7.97008 5.72609 7.95619 5.35816C7.92488 4.5287 7.8809 3.92331 7.83766 3.48926C7.79508 3.06179 7.53702 2.8046 7.1773 2.76063C6.75313 2.70878 6.15477 2.66634 5.33367 2.66634C4.51254 2.66634 3.91418 2.70878 3.49002 2.76063C3.13048 2.80458 2.87229 3.06189 2.8297 3.48946C2.74944 4.29515 2.667 5.68713 2.667 7.99968C2.667 10.3122 2.74944 11.7042 2.8297 12.5099C2.87229 12.9375 3.13048 13.1948 3.49002 13.2387C3.91418 13.2906 4.51254 13.333 5.33367 13.333C6.15477 13.333 6.75313 13.2906 7.1773 13.2387C7.53702 13.1947 7.79508 12.9376 7.83766 12.5101C7.8809 12.076 7.92488 11.4706 7.95619 10.6412C7.97008 10.2733 8.27961 9.98626 8.64754 10.0001C9.01546 10.014 9.30247 10.3236 9.28858 10.6915C9.25644 11.5428 9.21087 12.1761 9.16443 12.6423C9.06679 13.6224 8.38345 14.4345 7.33908 14.5622C6.85294 14.6216 6.19979 14.6663 5.33367 14.6663C4.46752 14.6663 3.81436 14.6216 3.32822 14.5622C2.28377 14.4345 1.60055 13.622 1.50293 12.6421C1.41698 11.7792 1.33367 10.3407 1.33367 7.99968C1.33367 5.65866 1.41698 4.22013 1.50293 3.35729C1.60055 2.37738 2.28377 1.56483 3.32822 1.43715C3.81436 1.37772 4.46752 1.33301 5.33367 1.33301C6.19979 1.33301 6.85294 1.37772 7.33908 1.43714C8.38345 1.56481 9.06679 2.37697 9.16443 3.35709C9.21087 3.8233 9.25644 4.45651 9.28858 5.30786C9.30247 5.67579 9.01546 5.98532 8.64754 5.99921Z" fill="white"/>
6504
6504
  <path fill-rule="evenodd" clip-rule="evenodd" d="M11.1966 6.13807C10.9362 5.87772 10.9362 5.45561 11.1966 5.19526C11.4569 4.93491 11.879 4.93491 12.1394 5.19526L14.4727 7.5286C14.7331 7.78894 14.7331 8.21105 14.4727 8.4714L12.1394 10.8047C11.879 11.0651 11.4569 11.0651 11.1966 10.8047C10.9362 10.5444 10.9362 10.1223 11.1966 9.86193L12.3918 8.66667H6.0013C5.63311 8.66667 5.33463 8.36819 5.33463 8C5.33463 7.63181 5.63311 7.33333 6.0013 7.33333L12.3918 7.33333L11.1966 6.13807Z" fill="white"/>
6505
6505
  </svg>
6506
- <span>${Ih("Sign in to comment")}</span>
6506
+ <span>${_h("Sign in to comment")}</span>
6507
6507
  `}`}
6508
6508
  </a>
6509
6509
  </div>
@@ -6540,9 +6540,9 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6540
6540
  </div>
6541
6541
  </div>
6542
6542
  <div class="menu-point-wrap">
6543
- ${Ih("Sign in to comment on this page.")}
6543
+ ${_h("Sign in to comment on this page.")}
6544
6544
  <a href="https://www.usesuperflow.com/features" target="_blank">
6545
- ${Ih("Learn more")}
6545
+ ${_h("Learn more")}
6546
6546
  <svg width="14" height="14" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
6547
6547
  <path d="M4.30881 1.72602C3.67106 1.86293 3.11953 2.1682 2.64215 2.64149C2.29011 2.99745 2.05915 3.34183 1.89878 3.76037C1.66018 4.37857 1.668 4.08911 1.668 10.0007C1.668 15.9122 1.66018 15.6228 1.89878 16.241C2.29385 17.2699 3.29164 18.0876 4.38704 18.291C4.70779 18.3496 15.2947 18.3496 15.6154 18.291C16.2297 18.1775 16.9494 17.7942 17.3838 17.3481C17.8221 16.8942 18.1506 16.284 18.2797 15.6736C18.3227 15.4702 18.3345 14.8051 18.3345 12.2973V9.17907H17.5129H16.6913V12.1017C16.6913 13.7957 16.6756 15.126 16.6522 15.259C16.5348 15.975 15.9753 16.5343 15.2593 16.6517C14.9503 16.7025 5.05201 16.7025 4.74282 16.6517C4.03857 16.5382 3.48296 15.9944 3.34997 15.2862C3.29912 15.0085 3.29521 5.06326 3.34997 4.74251C3.46731 4.02653 4.02684 3.467 4.74282 3.34966C4.87582 3.32619 6.20609 3.31054 7.90013 3.31054H10.8226V2.48895V1.66735L7.68482 1.67126C5.25184 1.67126 4.48891 1.68691 4.30881 1.72602Z" fill="#4C5366"/>
6548
6548
  <path d="M12.5058 2.48917V3.31077H14.0004H15.4988L13.3548 5.45481L11.2148 7.59477L11.7939 8.17385C12.1108 8.49069 12.3887 8.74902 12.4082 8.74902C12.4317 8.74902 13.4019 7.79443 14.5679 6.62845L16.6924 4.50413V6.0026V7.49715H17.514H18.3352V4.58253V1.66791H15.4206H12.5058V2.48917Z" fill="#4C5366"/>
@@ -6555,7 +6555,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6555
6555
  <path d="M5.25 12.75V12.7575M5.25 5.25V5.2575M12.75 5.25V5.2575M12.75 10.5H10.5V12.75M15 10.5V10.5075M10.5 15H12.75M12.75 12.75H15V15M3 3.75C3 3.55109 3.07902 3.36032 3.21967 3.21967C3.36032 3.07902 3.55109 3 3.75 3H6.75C6.94891 3 7.13968 3.07902 7.28033 3.21967C7.42098 3.36032 7.5 3.55109 7.5 3.75V6.75C7.5 6.94891 7.42098 7.13968 7.28033 7.28033C7.13968 7.42098 6.94891 7.5 6.75 7.5H3.75C3.55109 7.5 3.36032 7.42098 3.21967 7.28033C3.07902 7.13968 3 6.94891 3 6.75V3.75ZM10.5 3.75C10.5 3.55109 10.579 3.36032 10.7197 3.21967C10.8603 3.07902 11.0511 3 11.25 3H14.25C14.4489 3 14.6397 3.07902 14.7803 3.21967C14.921 3.36032 15 3.55109 15 3.75V6.75C15 6.94891 14.921 7.13968 14.7803 7.28033C14.6397 7.42098 14.4489 7.5 14.25 7.5H11.25C11.0511 7.5 10.8603 7.42098 10.7197 7.28033C10.579 7.13968 10.5 6.94891 10.5 6.75V3.75ZM3 11.25C3 11.0511 3.07902 10.8603 3.21967 10.7197C3.36032 10.579 3.55109 10.5 3.75 10.5H6.75C6.94891 10.5 7.13968 10.579 7.28033 10.7197C7.42098 10.8603 7.5 11.0511 7.5 11.25V14.25C7.5 14.4489 7.42098 14.6397 7.28033 14.7803C7.13968 14.921 6.94891 15 6.75 15H3.75C3.55109 15 3.36032 14.921 3.21967 14.7803C3.07902 14.6397 3 14.4489 3 14.25V11.25Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
6556
6556
  </svg>
6557
6557
 
6558
- <p>${Ih("Open in Mobile")}</p>
6558
+ <p>${_h("Open in Mobile")}</p>
6559
6559
  </div>
6560
6560
  ${this.canToggleSidebarVersion?R`
6561
6561
  <div class="menu-point" @click=${()=>this.toggleSidebarV2()}>
@@ -6565,7 +6565,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6565
6565
  @click=${t=>t.stopPropagation()}
6566
6566
  @change=${()=>this.toggleSidebarV2()}
6567
6567
  />
6568
- <p>${Ih("Try V2 Sidebar (beta)")}</p>
6568
+ <p>${_h("Try V2 Sidebar (beta)")}</p>
6569
6569
  </div>
6570
6570
  `:""}
6571
6571
  <div class="menu-point" @click=${()=>this.toggleCommentSidebarVisibility()}>
@@ -6575,7 +6575,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6575
6575
  @click=${t=>t.stopPropagation()}
6576
6576
  @change=${()=>this.toggleCommentSidebarVisibility()}
6577
6577
  />
6578
- <p>${Ih("Show Agent Comments in Sidebar & Page")}</p>
6578
+ <p>${_h("Show Agent Comments in Sidebar & Page")}</p>
6579
6579
  </div>
6580
6580
  <div class="menu-point" @click=${()=>this.togglePageCommentsVisibility()}>
6581
6581
  <input
@@ -6584,7 +6584,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6584
6584
  @click=${t=>t.stopPropagation()}
6585
6585
  @change=${()=>this.togglePageCommentsVisibility()}
6586
6586
  />
6587
- <p>${Ih("Show Comments on Page")}</p>
6587
+ <p>${_h("Show Comments on Page")}</p>
6588
6588
  </div>
6589
6589
  ${this.veltProxyToggleVisible?R`
6590
6590
  <div class="menu-point tooltip velt-proxy-menu-point" @click=${()=>this.toggleVeltProxy()}>
@@ -6594,10 +6594,10 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6594
6594
  @click=${t=>t.stopPropagation()}
6595
6595
  @change=${()=>this.toggleVeltProxy()}
6596
6596
  />
6597
- <p>${Ih("Use Secure Proxy")}</p>
6597
+ <p>${_h("Use Secure Proxy")}</p>
6598
6598
  <div class="tooltiptext velt-proxy-tooltiptext">
6599
- <span>${Ih("Routes Superflow's backend traffic through Superflow-owned domains.")}</span>
6600
- <span>${Ih("Turn this off if your network blocks them. Reloads the page.")}</span>
6599
+ <span>${_h("Routes Superflow's backend traffic through Superflow-owned domains.")}</span>
6600
+ <span>${_h("Turn this off if your network blocks them. Reloads the page.")}</span>
6601
6601
  </div>
6602
6602
  </div>
6603
6603
  `:""}
@@ -6607,7 +6607,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6607
6607
  <path fill-rule="evenodd" clip-rule="evenodd" d="M8.29289 8.29289C8.68342 7.90237 9.31658 7.90237 9.70711 8.29289L12 10.5858L14.2929 8.29289C14.6834 7.90237 15.3166 7.90237 15.7071 8.29289C16.0976 8.68342 16.0976 9.31658 15.7071 9.70711L13.4142 12L15.7071 14.2929C16.0976 14.6834 16.0976 15.3166 15.7071 15.7071C15.3166 16.0976 14.6834 16.0976 14.2929 15.7071L12 13.4142L9.70711 15.7071C9.31658 16.0976 8.68342 16.0976 8.29289 15.7071C7.90237 15.3166 7.90237 14.6834 8.29289 14.2929L10.5858 12L8.29289 9.70711C7.90237 9.31658 7.90237 8.68342 8.29289 8.29289Z" fill="#777E91"/>
6608
6608
  </svg>
6609
6609
 
6610
- <p>${Ih("Exit Review Mode")}</p>
6610
+ <p>${_h("Exit Review Mode")}</p>
6611
6611
  </div>
6612
6612
  ${!this.customLoginEnabledLocally&&this.allowGuestModeSignIn?R`
6613
6613
  <div class="menu-point" @click=${()=>this.loginWithGoogle()}>
@@ -6615,7 +6615,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6615
6615
  <path fill-rule="evenodd" clip-rule="evenodd" d="M8.64754 5.99921C8.27961 6.01309 7.97008 5.72609 7.95619 5.35816C7.92488 4.5287 7.8809 3.92331 7.83766 3.48926C7.79508 3.06179 7.53702 2.8046 7.1773 2.76063C6.75313 2.70878 6.15477 2.66634 5.33367 2.66634C4.51254 2.66634 3.91418 2.70878 3.49002 2.76063C3.13048 2.80458 2.87229 3.06189 2.8297 3.48946C2.74944 4.29515 2.667 5.68713 2.667 7.99968C2.667 10.3122 2.74944 11.7042 2.8297 12.5099C2.87229 12.9375 3.13048 13.1948 3.49002 13.2387C3.91418 13.2906 4.51254 13.333 5.33367 13.333C6.15477 13.333 6.75313 13.2906 7.1773 13.2387C7.53702 13.1947 7.79508 12.9376 7.83766 12.5101C7.8809 12.076 7.92488 11.4706 7.95619 10.6412C7.97008 10.2733 8.27961 9.98626 8.64754 10.0001C9.01546 10.014 9.30247 10.3236 9.28858 10.6915C9.25644 11.5428 9.21087 12.1761 9.16443 12.6423C9.06679 13.6224 8.38345 14.4345 7.33908 14.5622C6.85294 14.6216 6.19979 14.6663 5.33367 14.6663C4.46752 14.6663 3.81436 14.6216 3.32822 14.5622C2.28377 14.4345 1.60055 13.622 1.50293 12.6421C1.41698 11.7792 1.33367 10.3407 1.33367 7.99968C1.33367 5.65866 1.41698 4.22013 1.50293 3.35729C1.60055 2.37738 2.28377 1.56483 3.32822 1.43715C3.81436 1.37772 4.46752 1.33301 5.33367 1.33301C6.19979 1.33301 6.85294 1.37772 7.33908 1.43714C8.38345 1.56481 9.06679 2.37697 9.16443 3.35709C9.21087 3.8233 9.25644 4.45651 9.28858 5.30786C9.30247 5.67579 9.01546 5.98532 8.64754 5.99921Z" fill="#777E91"/>
6616
6616
  <path fill-rule="evenodd" clip-rule="evenodd" d="M11.1966 6.13807C10.9362 5.87772 10.9362 5.45561 11.1966 5.19526C11.4569 4.93491 11.879 4.93491 12.1394 5.19526L14.4727 7.5286C14.7331 7.78894 14.7331 8.21105 14.4727 8.4714L12.1394 10.8047C11.879 11.0651 11.4569 11.0651 11.1966 10.8047C10.9362 10.5444 10.9362 10.1223 11.1966 9.86193L12.3918 8.66667H6.0013C5.63311 8.66667 5.33463 8.36819 5.33463 8C5.33463 7.63181 5.63311 7.33333 6.0013 7.33333L12.3918 7.33333L11.1966 6.13807Z" fill="#777E91"/>
6617
6617
  </svg>
6618
- <p>${Ih("Sign in")}</p>
6618
+ <p>${_h("Sign in")}</p>
6619
6619
  </div>
6620
6620
  `:null}
6621
6621
  </div>
@@ -6633,7 +6633,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6633
6633
  </div>
6634
6634
  ${this.showQrCode?R`
6635
6635
  <div class="qrcode-container">
6636
- ${this.qrCode?R`<img class="qrcode" src=${this.qrCode} alt=${Ih("QR code to open this page on your phone")} />`:this.qrCodeError?R`<div class="qrcode-message">
6636
+ ${this.qrCode?R`<img class="qrcode" src=${this.qrCode} alt=${_h("QR code to open this page on your phone")} />`:this.qrCodeError?R`<div class="qrcode-message">
6637
6637
  <span>Could not load the QR code.</span>
6638
6638
  <button class="qrcode-retry-btn" @click=${()=>this.retryQRCode()}>Retry</button>
6639
6639
  </div>`:R`<div class="qrcode-message"><span class="qrcode-spinner"></span></div>`}
@@ -6646,13 +6646,13 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6646
6646
  <div class="s-modal" @click=${t=>null==t?void 0:t.stopPropagation()}>
6647
6647
  <img src="https://app.usesuperflow.com/assets/party-emoji.svg" alt="" />
6648
6648
  <div class="s-modal-text">
6649
- <h1>${Ih("Try Superflow using the toolbar below.")}</h1>
6649
+ <h1>${_h("Try Superflow using the toolbar below.")}</h1>
6650
6650
  <p>
6651
- ${Ih("Get ready to drop your first comment!")} <br/>
6652
- ${Ih("But before you do that, you definitely deserve a high five!")}
6651
+ ${_h("Get ready to drop your first comment!")} <br/>
6652
+ ${_h("But before you do that, you definitely deserve a high five!")}
6653
6653
  </p>
6654
6654
  </div>
6655
- <div class="s-button s-primary" @click=${()=>this.onLiveDemoModalNextClick()}>${Ih("Done")}</div>
6655
+ <div class="s-button s-primary" @click=${()=>this.onLiveDemoModalNextClick()}>${_h("Done")}</div>
6656
6656
  </div>
6657
6657
  </div>
6658
6658
  `:R``}
@@ -6662,11 +6662,11 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6662
6662
  <img src="https://app.usesuperflow.com/assets/party-emoji.svg" alt="" />
6663
6663
  <div class="s-modal-text">
6664
6664
  <h1>
6665
- ${Ih("Sign in on the toolbar below and add")}<br/>
6666
- ${Ih("comments on the design flaws.")}
6665
+ ${_h("Sign in on the toolbar below and add")}<br/>
6666
+ ${_h("comments on the design flaws.")}
6667
6667
  </h1>
6668
6668
  </div>
6669
- <div class="s-button s-primary" @click=${()=>this.onFigmaDemoModalNextClick()}>${Ih("Done")}</div>
6669
+ <div class="s-button s-primary" @click=${()=>this.onFigmaDemoModalNextClick()}>${_h("Done")}</div>
6670
6670
  </div>
6671
6671
  </div>
6672
6672
  `:R``}
@@ -6675,11 +6675,11 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6675
6675
  ${this.disableCommentModeButton()}
6676
6676
  ${this.capturingScreenshot?R`<div class="sf-screenshot-capturing-banner">
6677
6677
  <span class="sf-screenshot-capturing-spinner"></span>
6678
- ${Ih("Capturing screenshot…")}
6678
+ ${_h("Capturing screenshot…")}
6679
6679
  </div>`:null}
6680
6680
  ${!this.capturingScreenshot&&this.nativeScreenshotDenied&&!this.nativeScreenshotEnabled&&this.canUseNativeScreenshot()?R`<div class="sf-screenshot-denied-banner">
6681
6681
  <span class="sf-screenshot-denied-icon">!</span>
6682
- ${Ih("Screenshots off — enable via the ⋯ menu")}
6682
+ ${_h("Screenshots off — enable via the ⋯ menu")}
6683
6683
  </div>`:null}
6684
6684
  ${this.renderApprovalNotice()}
6685
6685
  <div class="toolbar ${ut({expanded:this.expanded,"add-comment-mode":this.addCommentMode,"private-comment-mode":!!this.privateCommentModeEnabled})}" @resize=${this.checkToolbarPosition()}
@@ -6698,7 +6698,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6698
6698
  </div>
6699
6699
 
6700
6700
  ${!(null===(t=this.snippylyUser)||void 0===t?void 0:t.isGuest)&&!(null===(e=this.snippylyUser)||void 0===e?void 0:e.name)||(null===(i=this.snippylyUser)||void 0===i?void 0:i.isGuest)&&!this.guestUserNameUpdated?R`
6701
- <div class="toolbar-section snippyly-logo ${ut({"d-xs-none":this.expanded,"d-none":this.addCommentMode})}" @click=${()=>{nh(gt.Events.TOOLBAR_NOTIFICATION_CLICKED),this.openGuestModeNameModel()}}>
6701
+ <div class="toolbar-section snippyly-logo ${ut({"d-xs-none":this.expanded,"d-none":this.addCommentMode})}" @click=${()=>{rh(gt.Events.TOOLBAR_NOTIFICATION_CLICKED),this.openGuestModeNameModel()}}>
6702
6702
 
6703
6703
  <div class="notification-container">
6704
6704
  <div class="notification">
@@ -6744,16 +6744,16 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6744
6744
  ${this.snippylyUserRole&&this.planLimitLocked&&!this.projectDeleted&&!this.isPlanExpired?R`
6745
6745
  <div class="tooltip">
6746
6746
  <div class="tooltiptext">
6747
- ${this.isUserGlobalContact?Ih("This workspace is over its plan limits. Comments are paused until the plan is updated."):Ih("Ask your workspace admin to update the plan.")}
6747
+ ${this.isUserGlobalContact?_h("This workspace is over its plan limits. Comments are paused until the plan is updated."):_h("Ask your workspace admin to update the plan.")}
6748
6748
  </div>
6749
6749
  <div class="s-alert-btn danger">
6750
6750
  <div class='error-container'>
6751
6751
  ${this.getAlertIcon()}
6752
- <div class="error-message">${Ih("Limit Reached")}</div>
6752
+ <div class="error-message">${_h("Limit Reached")}</div>
6753
6753
  </div>
6754
6754
  ${this.isUserGlobalContact?R`
6755
6755
  <div class="s-cta-btn" @click=${()=>this.onUpgradePlanClick()}>
6756
- ${Ih("Upgrade")}
6756
+ ${_h("Upgrade")}
6757
6757
  </div>
6758
6758
  `:null}
6759
6759
  </div>
@@ -6762,7 +6762,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6762
6762
  ${this.snippylyUserRole||this.projectDeleted?null:R`
6763
6763
  <div class="tooltip ${ut({"d-none":!this.expanded||this.addCommentMode})}">
6764
6764
  <div class="tooltiptext">
6765
- ${this.snippylyUserRole?null:R`${Ih("You don't have access to this project.")} <br/> ${Ih("Please contact admin.")}`}
6765
+ ${this.snippylyUserRole?null:R`${_h("You don't have access to this project.")} <br/> ${_h("Please contact admin.")}`}
6766
6766
  </div>
6767
6767
  <div class="s-alert-btn">
6768
6768
  <div class='error-container'>
@@ -6829,7 +6829,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6829
6829
  <!-- The Live Huddle tool is hidden from the toolbar. -->
6830
6830
  ${this.staging&&!this.addCommentMode?R`
6831
6831
  <div class="tooltip cursor-pointer">
6832
- <div class="tooltiptext">${Ih("Recording")}</div>
6832
+ <div class="tooltiptext">${_h("Recording")}</div>
6833
6833
  <velt-recorder-tool type="all"></velt-recorder-tool>
6834
6834
  </div>
6835
6835
  `:null}
@@ -6845,13 +6845,13 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6845
6845
  <div class="toolbar-section comment-viewmode-section ${ut({"d-none":!this.expanded||this.addCommentMode})}">
6846
6846
  <div class="toolbar-actions1">
6847
6847
  <div class="tooltip">
6848
- <div class="tooltiptext">${Ih("Open Comments")}</div>
6848
+ <div class="tooltiptext">${_h("Open Comments")}</div>
6849
6849
  <velt-sidebar-button shadow-dom="false"></velt-sidebar-button>
6850
6850
  </div>
6851
6851
  ${this.allFeatureDisabled||"Admin"!==this.snippylyUserRole?null:R`
6852
6852
  ${this.hasAgentAccess?R`
6853
6853
  <div class="tooltip">
6854
- <div class="tooltiptext">${Ih("Agent Comments")}</div>
6854
+ <div class="tooltiptext">${_h("Agent Comments")}</div>
6855
6855
  <div class="content-warnings-button ${ut({"has-warnings":this.hasContentWarnings})}" @click=${()=>this.onContentWarningsButtonClick()}>
6856
6856
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
6857
6857
  <path d="M12.0003 10.2329V13.8332M12.0003 16.5334H12.0093M10.5268 5.36441L3.23087 17.546C3.08046 17.8064 3.00087 18.1017 3.00001 18.4025C2.99915 18.7033 3.07705 18.999 3.22596 19.2604C3.37487 19.5217 3.5896 19.7395 3.8488 19.8921C4.108 20.0446 4.40263 20.1267 4.70338 20.1301H19.2971C19.5978 20.1266 19.8922 20.0445 20.1513 19.892C20.4104 19.7395 20.625 19.5218 20.7739 19.2606C20.9228 18.9994 21.0007 18.7038 21 18.4032C20.9992 18.1025 20.9198 17.8073 20.7697 17.5469L13.4737 5.36351C13.3202 5.11015 13.1039 4.90064 12.8458 4.75524C12.5877 4.60984 12.2965 4.53345 12.0003 4.53345C11.704 4.53345 11.4128 4.60984 11.1547 4.75524C10.8966 4.90064 10.6803 5.11015 10.5268 5.36351V5.36441Z" stroke="currentColor" stroke-width="1.80014" stroke-linecap="round" stroke-linejoin="round"/>
@@ -6901,7 +6901,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6901
6901
  <div class="toolbar-actions2">
6902
6902
  ${this.isPlanExpired?null:R`
6903
6903
  <div class="action tooltip cursor-pointer d-sm-none user-invite-tool-container" @click=${()=>this.onUserInviteToolClick()}>
6904
- <div class="tooltiptext">${Ih("Share")}</div>
6904
+ <div class="tooltiptext">${_h("Share")}</div>
6905
6905
  <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
6906
6906
  <path d="M7.25016 8.91671L12.7502 6.08337M7.25016 11.0834L12.7502 13.9167M2.5 10C2.5 10.663 2.76339 11.2989 3.23223 11.7678C3.70107 12.2366 4.33696 12.5 5 12.5C5.66304 12.5 6.29893 12.2366 6.76777 11.7678C7.23661 11.2989 7.5 10.663 7.5 10C7.5 9.33696 7.23661 8.70107 6.76777 8.23223C6.29893 7.76339 5.66304 7.5 5 7.5C4.33696 7.5 3.70107 7.76339 3.23223 8.23223C2.76339 8.70107 2.5 9.33696 2.5 10ZM12.5 5C12.5 5.66304 12.7634 6.29893 13.2322 6.76777C13.7011 7.23661 14.337 7.5 15 7.5C15.663 7.5 16.2989 7.23661 16.7678 6.76777C17.2366 6.29893 17.5 5.66304 17.5 5C17.5 4.33696 17.2366 3.70107 16.7678 3.23223C16.2989 2.76339 15.663 2.5 15 2.5C14.337 2.5 13.7011 2.76339 13.2322 3.23223C12.7634 3.70107 12.5 4.33696 12.5 5ZM12.5 15C12.5 15.663 12.7634 16.2989 13.2322 16.7678C13.7011 17.2366 14.337 17.5 15 17.5C15.663 17.5 16.2989 17.2366 16.7678 16.7678C17.2366 16.2989 17.5 15.663 17.5 15C17.5 14.337 17.2366 13.7011 16.7678 13.2322C16.2989 12.7634 15.663 12.5 15 12.5C14.337 12.5 13.7011 12.7634 13.2322 13.2322C12.7634 13.7011 12.5 14.337 12.5 15Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
6907
6907
  </svg>
@@ -6909,7 +6909,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6909
6909
  `}
6910
6910
  ${(null===(o=this.snippylyUser)||void 0===o?void 0:o.isGuest)&&this.allowGuestModeSignIn?R`
6911
6911
  <div class="s-guest-user-sign-in-button" @click=${()=>this.loginWithGoogle()}>
6912
- <p>${Ih("Sign in")}</p>
6912
+ <p>${_h("Sign in")}</p>
6913
6913
  </div>
6914
6914
  `:R`
6915
6915
  <div class="action">
@@ -6928,7 +6928,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6928
6928
  ${this.getLogoMark(!0)}
6929
6929
  </div>
6930
6930
  <a href="https://www.usesuperflow.com/features?ref=toolbar" target="_blank">
6931
- ${Ih("Powered by Superflow")}
6931
+ ${_h("Powered by Superflow")}
6932
6932
  </a>
6933
6933
  </div>
6934
6934
  <hr />
@@ -6937,7 +6937,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6937
6937
  <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
6938
6938
  <path d="M12.75 5.25L5.25 12.75M12.75 5.25H6M12.75 5.25V12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
6939
6939
  </svg>
6940
- <p>${Ih("View project")}</p>
6940
+ <p>${_h("View project")}</p>
6941
6941
  </div>
6942
6942
  `:R``}
6943
6943
  ${(null===(p=this.snippylyUser)||void 0===p?void 0:p.isGuest)?R``:R`
@@ -6945,7 +6945,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6945
6945
  <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
6946
6946
  <path d="M3 3.75C3 3.336 3.336 3 3.75 3H14.25C14.664 3 15 3.336 15 3.75V11.25C15 11.664 14.664 12 14.25 12H7.5L4.5 15V12H3.75C3.336 12 3 11.664 3 11.25V3.75Z M9 6V9 M9 10.5V10.5075" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
6947
6947
  </svg>
6948
- <p>${Ih("Report a bug")}</p>
6948
+ <p>${_h("Report a bug")}</p>
6949
6949
  </div>
6950
6950
  `}
6951
6951
  ${this.isUserGlobalContact||!(null===(v=this.snippylyUser)||void 0===v?void 0:v.isGuest)?R`<hr />`:R``}
@@ -6960,7 +6960,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6960
6960
  d="M15.75 9C13.95 12 11.7 13.5 9 13.5C6.3 13.5 4.05 12 2.25 9C4.05 6 6.3 4.5 9 4.5C11.7 4.5 13.95 6 15.75 9Z"
6961
6961
  stroke="#777E91" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" />
6962
6962
  </svg>
6963
- <p>${Ih(this.totalViewsCount+" Total Views")}</p>
6963
+ <p>${_h(this.totalViewsCount+" Total Views")}</p>
6964
6964
  </div>
6965
6965
  </velt-view-analytics>
6966
6966
  `:R``}
@@ -6980,7 +6980,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6980
6980
  <path d="M5.25 12.75V12.7575M5.25 5.25V5.2575M12.75 5.25V5.2575M12.75 10.5H10.5V12.75M15 10.5V10.5075M10.5 15H12.75M12.75 12.75H15V15M3 3.75C3 3.55109 3.07902 3.36032 3.21967 3.21967C3.36032 3.07902 3.55109 3 3.75 3H6.75C6.94891 3 7.13968 3.07902 7.28033 3.21967C7.42098 3.36032 7.5 3.55109 7.5 3.75V6.75C7.5 6.94891 7.42098 7.13968 7.28033 7.28033C7.13968 7.42098 6.94891 7.5 6.75 7.5H3.75C3.55109 7.5 3.36032 7.42098 3.21967 7.28033C3.07902 7.13968 3 6.94891 3 6.75V3.75ZM10.5 3.75C10.5 3.55109 10.579 3.36032 10.7197 3.21967C10.8603 3.07902 11.0511 3 11.25 3H14.25C14.4489 3 14.6397 3.07902 14.7803 3.21967C14.921 3.36032 15 3.55109 15 3.75V6.75C15 6.94891 14.921 7.13968 14.7803 7.28033C14.6397 7.42098 14.4489 7.5 14.25 7.5H11.25C11.0511 7.5 10.8603 7.42098 10.7197 7.28033C10.579 7.13968 10.5 6.94891 10.5 6.75V3.75ZM3 11.25C3 11.0511 3.07902 10.8603 3.21967 10.7197C3.36032 10.579 3.55109 10.5 3.75 10.5H6.75C6.94891 10.5 7.13968 10.579 7.28033 10.7197C7.42098 10.8603 7.5 11.0511 7.5 11.25V14.25C7.5 14.4489 7.42098 14.6397 7.28033 14.7803C7.13968 14.921 6.94891 15 6.75 15H3.75C3.55109 15 3.36032 14.921 3.21967 14.7803C3.07902 14.6397 3 14.4489 3 14.25V11.25Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
6981
6981
  </svg>
6982
6982
 
6983
- <p>${Ih("Open in Mobile")}</p>
6983
+ <p>${_h("Open in Mobile")}</p>
6984
6984
  </div>
6985
6985
  ${this.canToggleSidebarVersion?R`
6986
6986
  <div class="menu-point" @click=${()=>this.toggleSidebarV2()}>
@@ -6990,7 +6990,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
6990
6990
  @click=${t=>t.stopPropagation()}
6991
6991
  @change=${()=>this.toggleSidebarV2()}
6992
6992
  />
6993
- <p>${Ih("Try V2 Sidebar (beta)")}</p>
6993
+ <p>${_h("Try V2 Sidebar (beta)")}</p>
6994
6994
  </div>
6995
6995
  `:""}
6996
6996
  <div class="menu-point" @click=${()=>this.toggleCommentSidebarVisibility()}>
@@ -7000,7 +7000,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7000
7000
  @click=${t=>t.stopPropagation()}
7001
7001
  @change=${()=>this.toggleCommentSidebarVisibility()}
7002
7002
  />
7003
- <p>${Ih("Show Agent Comments in Sidebar & Page")}</p>
7003
+ <p>${_h("Show Agent Comments in Sidebar & Page")}</p>
7004
7004
  </div>
7005
7005
  <div class="menu-point" @click=${()=>this.togglePageCommentsVisibility()}>
7006
7006
  <input
@@ -7009,7 +7009,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7009
7009
  @click=${t=>t.stopPropagation()}
7010
7010
  @change=${()=>this.togglePageCommentsVisibility()}
7011
7011
  />
7012
- <p>${Ih("Show Comments on Page")}</p>
7012
+ <p>${_h("Show Comments on Page")}</p>
7013
7013
  </div>
7014
7014
  ${this.canUseNativeScreenshot()?R`
7015
7015
  <div class="menu-point tooltip native-screenshot-menu-point" @click=${()=>this.toggleNativeScreenshot()}>
@@ -7019,10 +7019,10 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7019
7019
  @click=${t=>t.stopPropagation()}
7020
7020
  @change=${()=>this.toggleNativeScreenshot()}
7021
7021
  />
7022
- <p>${Ih("Use Local Screenshot")}</p>
7022
+ <p>${_h("Use Local Screenshot")}</p>
7023
7023
  <div class="tooltiptext native-screenshot-tooltiptext">
7024
- <span>${Ih("Useful for capturing pages that are gated behind a login.")}</span>
7025
- <span>${Ih("Uses your browser's screen sharing permission to take the screenshot.")}</span>
7024
+ <span>${_h("Useful for capturing pages that are gated behind a login.")}</span>
7025
+ <span>${_h("Uses your browser's screen sharing permission to take the screenshot.")}</span>
7026
7026
  </div>
7027
7027
  </div>
7028
7028
  `:""}
@@ -7034,10 +7034,10 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7034
7034
  @click=${t=>t.stopPropagation()}
7035
7035
  @change=${()=>this.toggleVeltProxy()}
7036
7036
  />
7037
- <p>${Ih("Use Secure Proxy")}</p>
7037
+ <p>${_h("Use Secure Proxy")}</p>
7038
7038
  <div class="tooltiptext velt-proxy-tooltiptext">
7039
- <span>${Ih("Routes Superflow's backend traffic through Superflow-owned domains.")}</span>
7040
- <span>${Ih("Turn this off if your network blocks them. Reloads the page.")}</span>
7039
+ <span>${_h("Routes Superflow's backend traffic through Superflow-owned domains.")}</span>
7040
+ <span>${_h("Turn this off if your network blocks them. Reloads the page.")}</span>
7041
7041
  </div>
7042
7042
  </div>
7043
7043
  `:""}
@@ -7047,7 +7047,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7047
7047
  <path fill-rule="evenodd" clip-rule="evenodd" d="M8.29289 8.29289C8.68342 7.90237 9.31658 7.90237 9.70711 8.29289L12 10.5858L14.2929 8.29289C14.6834 7.90237 15.3166 7.90237 15.7071 8.29289C16.0976 8.68342 16.0976 9.31658 15.7071 9.70711L13.4142 12L15.7071 14.2929C16.0976 14.6834 16.0976 15.3166 15.7071 15.7071C15.3166 16.0976 14.6834 16.0976 14.2929 15.7071L12 13.4142L9.70711 15.7071C9.31658 16.0976 8.68342 16.0976 8.29289 15.7071C7.90237 15.3166 7.90237 14.6834 8.29289 14.2929L10.5858 12L8.29289 9.70711C7.90237 9.31658 7.90237 8.68342 8.29289 8.29289Z" fill="#777E91"/>
7048
7048
  </svg>
7049
7049
 
7050
- <p>${Ih("Exit Review Mode")}</p>
7050
+ <p>${_h("Exit Review Mode")}</p>
7051
7051
  </div>
7052
7052
  ${this.customLoginEnabledLocally||(null===(g=this.snippylyUser)||void 0===g?void 0:g.isGuest)?null:R`
7053
7053
  <div class="menu-point" @click=${()=>this.signOutUser()}>
@@ -7055,7 +7055,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7055
7055
  <path fill-rule="evenodd" clip-rule="evenodd" d="M8.27201 11.9903C8.68593 11.9746 9.03414 12.2975 9.04977 12.7114C9.085 13.6446 9.13447 14.3257 9.18312 14.814C9.23103 15.2949 9.52134 15.5842 9.92603 15.6337C10.4032 15.692 11.0764 15.7397 12.0001 15.7397C12.9239 15.7397 13.597 15.692 14.0742 15.6337C14.4787 15.5842 14.7692 15.2947 14.8171 14.8137C14.9074 13.9073 15.0001 12.3414 15.0001 9.73975C15.0001 7.13813 14.9074 5.57215 14.8171 4.66575C14.7692 4.18474 14.4787 3.89527 14.0742 3.84582C13.597 3.78749 12.9239 3.73974 12.0001 3.73974C11.0764 3.73974 10.4032 3.78748 9.92602 3.84582C9.52134 3.89529 9.23103 4.18463 9.18312 4.66552C9.13447 5.15383 9.085 5.8349 9.04977 6.76804C9.03414 7.18196 8.68593 7.50484 8.27201 7.48921C7.85809 7.47359 7.53521 7.12537 7.55084 6.71145C7.58699 5.75368 7.63826 5.04132 7.69051 4.51683C7.80035 3.4142 8.5691 2.50052 9.74402 2.3569C10.2909 2.29004 11.0257 2.23974 12.0001 2.23974C12.9745 2.23974 13.7093 2.29005 14.2562 2.35691C15.4312 2.50055 16.1999 3.41466 16.3097 4.51706C16.4064 5.48776 16.5001 7.1061 16.5001 9.73975C16.5001 12.3734 16.4064 13.9917 16.3097 14.9624C16.1999 16.0648 15.4313 16.9789 14.2562 17.1226C13.7093 17.1894 12.9745 17.2397 12.0001 17.2397C11.0257 17.2397 10.2909 17.1894 9.74402 17.1226C8.56911 16.979 7.80035 16.0653 7.69051 14.9627C7.63826 14.4382 7.58699 13.7258 7.55084 12.768C7.53521 12.3541 7.85809 12.0059 8.27201 11.9903Z" fill="#FF7162"/>
7056
7056
  <path fill-rule="evenodd" clip-rule="evenodd" d="M5.40533 11.8344C5.69822 12.1273 5.69822 12.6022 5.40533 12.8951C5.11244 13.188 4.63756 13.188 4.34467 12.8951L1.71967 10.2701C1.42678 9.97718 1.42678 9.50231 1.71967 9.20942L4.34467 6.58442C4.63756 6.29152 5.11244 6.29152 5.40533 6.58442C5.69822 6.87731 5.69822 7.35218 5.40533 7.64508L4.06066 8.98975H11.25C11.6642 8.98975 12 9.32553 12 9.73975C12 10.154 11.6642 10.4897 11.25 10.4897L4.06066 10.4897L5.40533 11.8344Z" fill="#FF7162"/>
7057
7057
  </svg>
7058
- <p>${Ih("Sign Out")}</p>
7058
+ <p>${_h("Sign Out")}</p>
7059
7059
  </div>
7060
7060
  `}
7061
7061
  </div>
@@ -7075,7 +7075,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7075
7075
  </div>
7076
7076
  ${this.showQrCode?R`
7077
7077
  <div class="qrcode-container">
7078
- ${this.qrCode?R`<img class="qrcode" src=${this.qrCode} alt=${Ih("QR code to open this page on your phone")} />`:this.qrCodeError?R`<div class="qrcode-message">
7078
+ ${this.qrCode?R`<img class="qrcode" src=${this.qrCode} alt=${_h("QR code to open this page on your phone")} />`:this.qrCodeError?R`<div class="qrcode-message">
7079
7079
  <span>Could not load the QR code.</span>
7080
7080
  <button class="qrcode-retry-btn" @click=${()=>this.retryQRCode()}>Retry</button>
7081
7081
  </div>`:R`<div class="qrcode-message"><span class="qrcode-spinner"></span></div>`}
@@ -7088,13 +7088,13 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7088
7088
  <div class="s-modal" @click=${t=>null==t?void 0:t.stopPropagation()}>
7089
7089
  <img src="https://app.usesuperflow.com/assets/party-emoji.svg" alt="" />
7090
7090
  <div class="s-modal-text">
7091
- <h1>${Ih("You’re a SuperFlow installation wizard!")}</h1>
7091
+ <h1>${_h("You’re a SuperFlow installation wizard!")}</h1>
7092
7092
  <p>
7093
- ${Ih("Get ready to drop your first comment!")} <br/>
7094
- ${Ih("But before you do that, you definitely deserve a high five!")}
7093
+ ${_h("Get ready to drop your first comment!")} <br/>
7094
+ ${_h("But before you do that, you definitely deserve a high five!")}
7095
7095
  </p>
7096
7096
  </div>
7097
- <div class="s-button s-primary" @click=${()=>this.onboardingNextClick()}>${Ih("Next")}</div>
7097
+ <div class="s-button s-primary" @click=${()=>this.onboardingNextClick()}>${_h("Next")}</div>
7098
7098
  </div>
7099
7099
  </div>
7100
7100
  `:R``}
@@ -7103,13 +7103,13 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7103
7103
  <div class="s-modal" @click=${t=>null==t?void 0:t.stopPropagation()}>
7104
7104
  <img src="https://app.usesuperflow.com/assets/party-emoji.svg" alt="" />
7105
7105
  <div class="s-modal-text">
7106
- <h1>${Ih("Try Superflow using the toolbar below.")}</h1>
7106
+ <h1>${_h("Try Superflow using the toolbar below.")}</h1>
7107
7107
  <p>
7108
- ${Ih("Get ready to drop your first comment!")} <br/>
7109
- ${Ih("But before you do that, you definitely deserve a high five!")}
7108
+ ${_h("Get ready to drop your first comment!")} <br/>
7109
+ ${_h("But before you do that, you definitely deserve a high five!")}
7110
7110
  </p>
7111
7111
  </div>
7112
- <div class="s-button s-primary" @click=${()=>this.onLiveDemoModalNextClick()}>${Ih("Done")}</div>
7112
+ <div class="s-button s-primary" @click=${()=>this.onLiveDemoModalNextClick()}>${_h("Done")}</div>
7113
7113
  </div>
7114
7114
  </div>
7115
7115
  `:R``}
@@ -7119,11 +7119,11 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7119
7119
  <img src="https://app.usesuperflow.com/assets/party-emoji.svg" alt="" />
7120
7120
  <div class="s-modal-text">
7121
7121
  <h1>
7122
- ${Ih("Sign in on the toolbar below and add")}<br/>
7123
- ${Ih("comments on the design flaws.")}
7122
+ ${_h("Sign in on the toolbar below and add")}<br/>
7123
+ ${_h("comments on the design flaws.")}
7124
7124
  </h1>
7125
7125
  </div>
7126
- <div class="s-button s-primary" @click=${()=>this.onFigmaDemoModalNextClick()}>${Ih("Done")}</div>
7126
+ <div class="s-button s-primary" @click=${()=>this.onFigmaDemoModalNextClick()}>${_h("Done")}</div>
7127
7127
  </div>
7128
7128
  </div>
7129
7129
  `:R``}
@@ -7193,7 +7193,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7193
7193
  </g>
7194
7194
  </svg>
7195
7195
  `:null}
7196
- ${this.guestUserNameUpdateLoading?"":Ih("Save")}
7196
+ ${this.guestUserNameUpdateLoading?"":_h("Save")}
7197
7197
  </div>
7198
7198
  <div class="s-modal-link-text" @click=${()=>this.onGuestModeNameModalSkipButtonClick()}>Skip</div>
7199
7199
  </div>
@@ -7214,7 +7214,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7214
7214
  </div>
7215
7215
  <div class="s-modal-title">${null===(w=this.guestModeSignInModalConfig)||void 0===w?void 0:w.title}</div>
7216
7216
  <div class="s-modal-subtitle">${null===(y=this.guestModeSignInModalConfig)||void 0===y?void 0:y.description}</div>
7217
- <div class="s-button s-primary s-signin-button" @click=${()=>this.onGuestModeSignInModalSignInButtonClick()}>${Ih("Sign in")}</div>
7217
+ <div class="s-button s-primary s-signin-button" @click=${()=>this.onGuestModeSignInModalSignInButtonClick()}>${_h("Sign in")}</div>
7218
7218
  ${this.guestModeSignInModalConfig.showLeaveCommentButton?R`
7219
7219
  <div class="s-modal-link-text" @click=${t=>{this.closeGuestModeSignInModal(),this.openGuestModeNameModel(t)}}>Leave Comment Anonymously</div>
7220
7220
  `:R``}
@@ -7225,7 +7225,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7225
7225
  <div class="s-guest-mode-banner">
7226
7226
  <span>Notify your team about your comments by signing in.</span>
7227
7227
  <div class="s-guest-mode-banner-actions">
7228
- <button @click=${()=>this.onGuestModeBannerSignInButtonClick()}>${Ih("Sign in")}</button>
7228
+ <button @click=${()=>this.onGuestModeBannerSignInButtonClick()}>${_h("Sign in")}</button>
7229
7229
  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="cursor-pointer" viewBox="0 0 16 16" @click=${()=>this.hideGuestModeSignInBanner()}>
7230
7230
  <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>
7231
7231
  </svg>
@@ -7312,7 +7312,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7312
7312
  </g>
7313
7313
  </svg>
7314
7314
  `:null}
7315
- ${this.validatingPasswordLoading?"":Ih("Submit")}
7315
+ ${this.validatingPasswordLoading?"":_h("Submit")}
7316
7316
  </div>
7317
7317
  </div>
7318
7318
  ${this.showInvalidPassword?R`
@@ -7347,7 +7347,7 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7347
7347
  .documentId=${this.documentId}
7348
7348
  .hasInviteAccess=${!0}
7349
7349
  .disableInvite=${!(this.snippylyUser&&!(null===(C=this.snippylyUser)||void 0===C?void 0:C.isGuest))}
7350
- .userSeatsExhausted=${!!(null===(E=null===(x=this.featureAccess)||void 0===x?void 0:x[bh.WorkspaceUserSeats])||void 0===E?void 0:E.hasUsageExhausted)}
7350
+ .userSeatsExhausted=${!!(null===(E=null===(x=this.featureAccess)||void 0===x?void 0:x[Ch.WorkspaceUserSeats])||void 0===E?void 0:E.hasUsageExhausted)}
7351
7351
  @superflow-invite-modal-close=${this.closeInviteModal}
7352
7352
  @superflow-invite-modal-invite-success=${this.onInviteSuccess}
7353
7353
  ></superflow-invite-modal>
@@ -7363,4 +7363,4 @@ class dd extends Ja{}dd.Encryptor=class extends dd{processBlock(t,e){const i=t,o
7363
7363
  @superflow-bug-report-modal-close=${this.closeBugReportModal}
7364
7364
  ></superflow-bug-report-modal>
7365
7365
  `:""}
7366
- `}}zp.CLIENT_NOTIFY_RETRY_MS=5e3,zp.SUGGESTION_ACTIONS_HIDDEN_CSS="\n velt-comment-dialog-suggestion-actions,\n velt-comment-dialog-suggestion-actions-internal,\n velt-comment-dialog-suggestion-action-accept,\n velt-comment-dialog-suggestion-action-accept-internal,\n velt-comment-dialog-suggestion-action-reject,\n velt-comment-dialog-suggestion-action-reject-internal,\n velt-comment-dialog-legacy-suggestion-action,\n velt-comment-dialog-legacy-suggestion-action-accept,\n velt-comment-dialog-legacy-suggestion-action-reject,\n .velt-suggestion-actions,\n .sf-accept-btn,\n .sf-reject-btn {\n display: none !important;\n }\n ",zp.SUGGESTION_ACTIONS_HIDDEN_STYLE_ATTR="data-sf-suggestion-actions-hidden",zp.COLLABORATION_TAGS=[Ne.VELT_COMMENTS,Ne.VELT_CURSOR,Ne.VELT_HUDDLE,Ne.VELT_RECORDER_NOTES,Ne.VELT_RECORDER_CONTROL_PANEL,Ne.VELT_ARROWS,Ne.VELT_COMMENTS_SIDEBAR_LEGACY,Ne.VELT_COMMENTS_SIDEBAR_V2],zp.AGENT_PIN_MARKUP_RECHECK_MS=2e3,zp.styles=[_h,$h],Bp([rt()],zp.prototype,"loadPlugin",null),Bp([rt()],zp.prototype,"comments",void 0),Bp([rt()],zp.prototype,"commentElement",void 0),Bp([rt()],zp.prototype,"contactElement",void 0),Bp([rt()],zp.prototype,"rewriterElement",void 0),Bp([rt()],zp.prototype,"presenceElement",void 0),Bp([rt()],zp.prototype,"commentSubscription",void 0),Bp([rt()],zp.prototype,"selectionElement",void 0),Bp([rt()],zp.prototype,"viewsElement",void 0),Bp([rt()],zp.prototype,"docElement",void 0),Bp([rt()],zp.prototype,"addCommentMode",void 0),Bp([rt()],zp.prototype,"showTourCommentTooltip",void 0),Bp([rt()],zp.prototype,"firstCommentNudge",void 0),Bp([rt()],zp.prototype,"allFeatureDisabled",void 0),Bp([rt()],zp.prototype,"planLimitLocked",void 0),Bp([rt()],zp.prototype,"projectDeleted",void 0),Bp([rt()],zp.prototype,"allFeatureRestricted",void 0),Bp([rt()],zp.prototype,"guestMode",void 0),Bp([rt()],zp.prototype,"_expanded",void 0),Bp([rt()],zp.prototype,"loading",void 0),Bp([rt()],zp.prototype,"signInError",void 0),Bp([rt()],zp.prototype,"snippylyUser",void 0),Bp([rt()],zp.prototype,"snippylyUserRole",void 0),Bp([rt()],zp.prototype,"_isPlanExpired",void 0),Bp([rt()],zp.prototype,"showOnboardingModal",void 0),Bp([rt()],zp.prototype,"embedMode",void 0),Bp([rt()],zp.prototype,"readOnlyMode",void 0),Bp([rt()],zp.prototype,"onboardingMode",void 0),Bp([rt()],zp.prototype,"clientMode",void 0),Bp([rt()],zp.prototype,"clientModeBlocked",void 0),Bp([rt()],zp.prototype,"clientGrant",void 0),Bp([rt()],zp.prototype,"maintenanceRequests",void 0),Bp([rt()],zp.prototype,"maintenanceRequestsLabel",void 0),Bp([rt()],zp.prototype,"showLiveDemoModal",void 0),Bp([rt()],zp.prototype,"showFigmaDemoModal",void 0),Bp([rt()],zp.prototype,"showGuestModeSignInModal",void 0),Bp([rt()],zp.prototype,"guestModeSignInModalConfig",void 0),Bp([rt()],zp.prototype,"showGuestModeNameModal",void 0),Bp([rt()],zp.prototype,"guestModeSignInBannerVisible",void 0),Bp([rt()],zp.prototype,"guestUserNameInput",void 0),Bp([rt()],zp.prototype,"guestUserModelOpened",void 0),Bp([rt()],zp.prototype,"guestUserNameUpdated",void 0),Bp([rt()],zp.prototype,"guestUserNameUpdateLoading",void 0),Bp([nt()],zp.prototype,"apiKey",null),Bp([nt()],zp.prototype,"projectId",null),Bp([rt()],zp.prototype,"staging",void 0),Bp([nt()],zp.prototype,"projectVersionKey",null),Bp([rt()],zp.prototype,"projectVersion",void 0),Bp([rt()],zp.prototype,"version",void 0),Bp([nt()],zp.prototype,"veltVersion",void 0),Bp([nt()],zp.prototype,"autoLocation",null),Bp([rt()],zp.prototype,"_menuOpenedId",void 0),Bp([rt()],zp.prototype,"copyLinkTooltip",void 0),Bp([rt()],zp.prototype,"approving",void 0),Bp([rt()],zp.prototype,"approvalNotice",void 0),Bp([rt()],zp.prototype,"projectApproval",void 0),Bp([rt()],zp.prototype,"invalidApiKey",void 0),Bp([rt()],zp.prototype,"documentId",void 0),Bp([rt()],zp.prototype,"serverDocumentId",void 0),Bp([rt()],zp.prototype,"_isUserGlobalContact",void 0),Bp([rt()],zp.prototype,"location",void 0),Bp([rt()],zp.prototype,"qrCode",void 0),Bp([rt()],zp.prototype,"showQrCode",void 0),Bp([rt()],zp.prototype,"qrCodeLoading",void 0),Bp([rt()],zp.prototype,"qrCodeError",void 0),Bp([rt()],zp.prototype,"customLoginEnabledLocally",void 0),Bp([nt()],zp.prototype,"customLoginEnabled",void 0),Bp([rt()],zp.prototype,"providedUser",void 0),Bp([rt()],zp.prototype,"autoTranslation",void 0),Bp([rt()],zp.prototype,"addCommentCount",void 0),Bp([rt()],zp.prototype,"isSigningInUserAdmin",void 0),Bp([rt()],zp.prototype,"_privateCommentModeEnabled",void 0),Bp([rt()],zp.prototype,"superflowToolbarMoved",void 0),Bp([rt()],zp.prototype,"_customerMetadata",void 0),Bp([rt()],zp.prototype,"logoMark",void 0),Bp([rt()],zp.prototype,"wordMark",void 0),Bp([rt()],zp.prototype,"_darkMode",void 0),Bp([rt()],zp.prototype,"projectConfig",void 0),Bp([rt()],zp.prototype,"allowGuestModeSignIn",void 0),Bp([rt()],zp.prototype,"_queryParamsComments",void 0),Bp([rt()],zp.prototype,"_usePageTitleAsLocationName",void 0),Bp([rt()],zp.prototype,"toolbarEnabled",void 0),Bp([rt()],zp.prototype,"toolbarEnabledApiCalled",void 0),Bp([rt()],zp.prototype,"passwordProtected",void 0),Bp([rt()],zp.prototype,"isPasswordValid",void 0),Bp([rt()],zp.prototype,"password",void 0),Bp([rt()],zp.prototype,"validatingPasswordLoading",void 0),Bp([rt()],zp.prototype,"showPasswordProtectedModal",void 0),Bp([rt()],zp.prototype,"showInvalidPassword",void 0),Bp([rt()],zp.prototype,"skipGuestNameModal",void 0),Bp([rt()],zp.prototype,"_totalViews",void 0),Bp([rt()],zp.prototype,"totalViewsCount",void 0),Bp([rt()],zp.prototype,"inviteUrl",void 0),Bp([rt()],zp.prototype,"showModalOnceCommentIsModeIsOff",void 0),Bp([rt()],zp.prototype,"showInviteModal",void 0),Bp([rt()],zp.prototype,"showBugReportModal",void 0),Bp([rt()],zp.prototype,"featureAccess",void 0),Bp([rt()],zp.prototype,"hasAgentAccess",void 0),Bp([rt()],zp.prototype,"hasPrivateCommentsAccess",void 0),Bp([rt()],zp.prototype,"isPrivateCommentsEnabledOnWorkspace",void 0),Bp([rt()],zp.prototype,"hasContentWarnings",void 0),Bp([rt()],zp.prototype,"contentWarningsCount",void 0),Bp([rt()],zp.prototype,"showContentWarningSidebar",void 0),Bp([rt()],zp.prototype,"showAgentCommentsInSidebar",void 0),Bp([rt()],zp.prototype,"pageCommentsHidden",void 0),Bp([rt()],zp.prototype,"veltProxyToggleVisible",void 0),Bp([rt()],zp.prototype,"nativeScreenshotEnabled",void 0),Bp([rt()],zp.prototype,"nativeScreenshotDenied",void 0),Bp([rt()],zp.prototype,"capturingScreenshot",void 0),Bp([rt()],zp.prototype,"agentGroups",void 0),Bp([rt()],zp.prototype,"agentRunStatuses",void 0),Bp([rt()],zp.prototype,"agentRunStatusTimedOut",void 0),Bp([rt()],zp.prototype,"agentRunStatusSettled",void 0),Bp([rt()],zp.prototype,"onboardingUnsyncedAnnotationIds",void 0),Bp([rt()],zp.prototype,"spellingSuggestionPagePathMap",void 0),Bp([rt()],zp.prototype,"grammarSuggestionPagePathMap",void 0),(t=>{if(customElements.get("superflow-toolbar")||customElements.get("snippyly-plugin"))return;const e={allow:["sdkUrl","windowVariables","snippylyPlugin"],loaders:{windowVariables:()=>{const t=null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_API_KEY;return{valid:!!t,type:"windowVariables",apiKey:t,staging:!!(null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_STAGING),projectVersionKey:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_PROJECT_VERSION_KEY,projectId:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_PROJECT_ID,autoLocation:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_AUTO_LOCATION,veltVersion:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_VELT_VERSION}},snippylyPlugin:()=>{const t=document.querySelector("snippyly-plugin");if(!t)return;const e=t.getAttribute("apiKey"),i=!!t.getAttribute("staging"),o=t.getAttribute("projectVersionKey"),n=t.getAttribute("projectId"),r=t.getAttribute("autoLocation"),s=t.getAttribute("veltVersion");return null==t||t.remove(),{valid:!!e,type:"snippylyPlugin",apiKey:e,staging:i,projectVersionKey:o,projectId:n,autoLocation:r,veltVersion:s}},sdkUrl:()=>{const t=document.getElementById("superflowToolbarScript");if(!t)return;const e=null==t?void 0:t.src,i=new URL(e).searchParams,o=i.has("apiKey")?i.get("apiKey"):void 0;return{valid:!!o,type:"sdkUrl",apiKey:o,staging:void 0,projectVersionKey:void 0,projectId:i.has("projectId")?i.get("projectId"):void 0,autoLocation:i.has("autoLocation")?i.get("autoLocation"):void 0,veltVersion:i.has("veltVersion")?i.get("veltVersion"):void 0}}},load:()=>{for(let t=0;t<e.allow.length;t++){const i=e.allow[t],o=e.loaders[i]();if(o&&o.valid)return o}}},i=()=>{try{const i=e.load();if(customElements.define("superflow-toolbar",t),i&&i.valid){(()=>{try{document.querySelectorAll("superflow-toolbar").forEach((t=>{t.remove()})),document.querySelectorAll("snippyly-plugin").forEach((t=>{t.remove()}))}catch(t){console.warn("Error in removeSuperflowToolbarTag: ",t)}})();const t={};return t.apiKey=i.apiKey,i.staging&&(t.staging="true"),i.projectVersionKey&&(t.projectVersionKey=i.projectVersionKey),i.projectId&&(t.projectId=i.projectId),(null==i?void 0:i.autoLocation)&&(t.autoLocation=i.autoLocation),(null==i?void 0:i.veltVersion)&&(t.veltVersion=i.veltVersion),void((t={})=>{try{const e=document.createElement("superflow-toolbar");Object.keys(t||{}).forEach((i=>{e.setAttribute(i,t[i])})),document.body.appendChild(e)}catch(t){console.warn("Error in loadSuperflowToolbarTag: ",t)}})(t)}}catch(t){console.warn("Error in initSuperflow: ",t)}};(null===document||void 0===document?void 0:document.body)?i():null===document||void 0===document||document.addEventListener("DOMContentLoaded",(()=>{i()}))})(zp);class Hp extends tt{}customElements.get("snippyly-plugin")||customElements.define("snippyly-plugin",Hp),t.SnippylyPlugin=Hp,t.SuperflowToolbar=zp}({});
7366
+ `}}Hp.CLIENT_NOTIFY_RETRY_MS=5e3,Hp.SUGGESTION_ACTIONS_HIDDEN_CSS="\n velt-comment-dialog-suggestion-actions,\n velt-comment-dialog-suggestion-actions-internal,\n velt-comment-dialog-suggestion-action-accept,\n velt-comment-dialog-suggestion-action-accept-internal,\n velt-comment-dialog-suggestion-action-reject,\n velt-comment-dialog-suggestion-action-reject-internal,\n velt-comment-dialog-legacy-suggestion-action,\n velt-comment-dialog-legacy-suggestion-action-accept,\n velt-comment-dialog-legacy-suggestion-action-reject,\n .velt-suggestion-actions,\n .sf-accept-btn,\n .sf-reject-btn {\n display: none !important;\n }\n ",Hp.SUGGESTION_ACTIONS_HIDDEN_STYLE_ATTR="data-sf-suggestion-actions-hidden",Hp.COLLABORATION_TAGS=[Oe.VELT_COMMENTS,Oe.VELT_CURSOR,Oe.VELT_HUDDLE,Oe.VELT_RECORDER_NOTES,Oe.VELT_RECORDER_CONTROL_PANEL,Oe.VELT_ARROWS,Oe.VELT_COMMENTS_SIDEBAR_LEGACY,Oe.VELT_COMMENTS_SIDEBAR_V2],Hp.AGENT_PIN_MARKUP_RECHECK_MS=2e3,Hp.styles=[$h,Nh],zp([rt()],Hp.prototype,"loadPlugin",null),zp([rt()],Hp.prototype,"comments",void 0),zp([rt()],Hp.prototype,"commentElement",void 0),zp([rt()],Hp.prototype,"contactElement",void 0),zp([rt()],Hp.prototype,"rewriterElement",void 0),zp([rt()],Hp.prototype,"presenceElement",void 0),zp([rt()],Hp.prototype,"commentSubscription",void 0),zp([rt()],Hp.prototype,"selectionElement",void 0),zp([rt()],Hp.prototype,"viewsElement",void 0),zp([rt()],Hp.prototype,"docElement",void 0),zp([rt()],Hp.prototype,"addCommentMode",void 0),zp([rt()],Hp.prototype,"showTourCommentTooltip",void 0),zp([rt()],Hp.prototype,"firstCommentNudge",void 0),zp([rt()],Hp.prototype,"allFeatureDisabled",void 0),zp([rt()],Hp.prototype,"planLimitLocked",void 0),zp([rt()],Hp.prototype,"projectDeleted",void 0),zp([rt()],Hp.prototype,"allFeatureRestricted",void 0),zp([rt()],Hp.prototype,"guestMode",void 0),zp([rt()],Hp.prototype,"_expanded",void 0),zp([rt()],Hp.prototype,"loading",void 0),zp([rt()],Hp.prototype,"signInError",void 0),zp([rt()],Hp.prototype,"snippylyUser",void 0),zp([rt()],Hp.prototype,"snippylyUserRole",void 0),zp([rt()],Hp.prototype,"_isPlanExpired",void 0),zp([rt()],Hp.prototype,"showOnboardingModal",void 0),zp([rt()],Hp.prototype,"embedMode",void 0),zp([rt()],Hp.prototype,"readOnlyMode",void 0),zp([rt()],Hp.prototype,"onboardingMode",void 0),zp([rt()],Hp.prototype,"clientMode",void 0),zp([rt()],Hp.prototype,"clientModeBlocked",void 0),zp([rt()],Hp.prototype,"clientGrant",void 0),zp([rt()],Hp.prototype,"maintenanceRequests",void 0),zp([rt()],Hp.prototype,"maintenanceRequestsLabel",void 0),zp([rt()],Hp.prototype,"showLiveDemoModal",void 0),zp([rt()],Hp.prototype,"showFigmaDemoModal",void 0),zp([rt()],Hp.prototype,"showGuestModeSignInModal",void 0),zp([rt()],Hp.prototype,"guestModeSignInModalConfig",void 0),zp([rt()],Hp.prototype,"showGuestModeNameModal",void 0),zp([rt()],Hp.prototype,"guestModeSignInBannerVisible",void 0),zp([rt()],Hp.prototype,"guestUserNameInput",void 0),zp([rt()],Hp.prototype,"guestUserModelOpened",void 0),zp([rt()],Hp.prototype,"guestUserNameUpdated",void 0),zp([rt()],Hp.prototype,"guestUserNameUpdateLoading",void 0),zp([nt()],Hp.prototype,"apiKey",null),zp([nt()],Hp.prototype,"projectId",null),zp([rt()],Hp.prototype,"staging",void 0),zp([nt()],Hp.prototype,"projectVersionKey",null),zp([rt()],Hp.prototype,"projectVersion",void 0),zp([rt()],Hp.prototype,"version",void 0),zp([nt()],Hp.prototype,"veltVersion",void 0),zp([nt()],Hp.prototype,"autoLocation",null),zp([rt()],Hp.prototype,"_menuOpenedId",void 0),zp([rt()],Hp.prototype,"copyLinkTooltip",void 0),zp([rt()],Hp.prototype,"approving",void 0),zp([rt()],Hp.prototype,"approvalNotice",void 0),zp([rt()],Hp.prototype,"projectApproval",void 0),zp([rt()],Hp.prototype,"invalidApiKey",void 0),zp([rt()],Hp.prototype,"documentId",void 0),zp([rt()],Hp.prototype,"serverDocumentId",void 0),zp([rt()],Hp.prototype,"_isUserGlobalContact",void 0),zp([rt()],Hp.prototype,"location",void 0),zp([rt()],Hp.prototype,"qrCode",void 0),zp([rt()],Hp.prototype,"showQrCode",void 0),zp([rt()],Hp.prototype,"qrCodeLoading",void 0),zp([rt()],Hp.prototype,"qrCodeError",void 0),zp([rt()],Hp.prototype,"customLoginEnabledLocally",void 0),zp([nt()],Hp.prototype,"customLoginEnabled",void 0),zp([rt()],Hp.prototype,"providedUser",void 0),zp([rt()],Hp.prototype,"autoTranslation",void 0),zp([rt()],Hp.prototype,"addCommentCount",void 0),zp([rt()],Hp.prototype,"isSigningInUserAdmin",void 0),zp([rt()],Hp.prototype,"_privateCommentModeEnabled",void 0),zp([rt()],Hp.prototype,"superflowToolbarMoved",void 0),zp([rt()],Hp.prototype,"_customerMetadata",void 0),zp([rt()],Hp.prototype,"logoMark",void 0),zp([rt()],Hp.prototype,"wordMark",void 0),zp([rt()],Hp.prototype,"_darkMode",void 0),zp([rt()],Hp.prototype,"projectConfig",void 0),zp([rt()],Hp.prototype,"allowGuestModeSignIn",void 0),zp([rt()],Hp.prototype,"_queryParamsComments",void 0),zp([rt()],Hp.prototype,"_usePageTitleAsLocationName",void 0),zp([rt()],Hp.prototype,"toolbarEnabled",void 0),zp([rt()],Hp.prototype,"toolbarEnabledApiCalled",void 0),zp([rt()],Hp.prototype,"passwordProtected",void 0),zp([rt()],Hp.prototype,"isPasswordValid",void 0),zp([rt()],Hp.prototype,"password",void 0),zp([rt()],Hp.prototype,"validatingPasswordLoading",void 0),zp([rt()],Hp.prototype,"showPasswordProtectedModal",void 0),zp([rt()],Hp.prototype,"showInvalidPassword",void 0),zp([rt()],Hp.prototype,"skipGuestNameModal",void 0),zp([rt()],Hp.prototype,"_totalViews",void 0),zp([rt()],Hp.prototype,"totalViewsCount",void 0),zp([rt()],Hp.prototype,"inviteUrl",void 0),zp([rt()],Hp.prototype,"showModalOnceCommentIsModeIsOff",void 0),zp([rt()],Hp.prototype,"showInviteModal",void 0),zp([rt()],Hp.prototype,"showBugReportModal",void 0),zp([rt()],Hp.prototype,"featureAccess",void 0),zp([rt()],Hp.prototype,"hasAgentAccess",void 0),zp([rt()],Hp.prototype,"hasPrivateCommentsAccess",void 0),zp([rt()],Hp.prototype,"isPrivateCommentsEnabledOnWorkspace",void 0),zp([rt()],Hp.prototype,"hasContentWarnings",void 0),zp([rt()],Hp.prototype,"contentWarningsCount",void 0),zp([rt()],Hp.prototype,"showContentWarningSidebar",void 0),zp([rt()],Hp.prototype,"showAgentCommentsInSidebar",void 0),zp([rt()],Hp.prototype,"pageCommentsHidden",void 0),zp([rt()],Hp.prototype,"veltProxyToggleVisible",void 0),zp([rt()],Hp.prototype,"nativeScreenshotEnabled",void 0),zp([rt()],Hp.prototype,"nativeScreenshotDenied",void 0),zp([rt()],Hp.prototype,"capturingScreenshot",void 0),zp([rt()],Hp.prototype,"agentGroups",void 0),zp([rt()],Hp.prototype,"agentRunStatuses",void 0),zp([rt()],Hp.prototype,"agentRunStatusTimedOut",void 0),zp([rt()],Hp.prototype,"agentRunStatusSettled",void 0),zp([rt()],Hp.prototype,"onboardingUnsyncedAnnotationIds",void 0),zp([rt()],Hp.prototype,"spellingSuggestionPagePathMap",void 0),zp([rt()],Hp.prototype,"grammarSuggestionPagePathMap",void 0),(t=>{if(customElements.get("superflow-toolbar")||customElements.get("snippyly-plugin"))return;const e={allow:["sdkUrl","windowVariables","snippylyPlugin"],loaders:{windowVariables:()=>{const t=null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_API_KEY;return{valid:!!t,type:"windowVariables",apiKey:t,staging:!!(null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_STAGING),projectVersionKey:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_PROJECT_VERSION_KEY,projectId:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_PROJECT_ID,autoLocation:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_AUTO_LOCATION,veltVersion:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_VELT_VERSION}},snippylyPlugin:()=>{const t=document.querySelector("snippyly-plugin");if(!t)return;const e=t.getAttribute("apiKey"),i=!!t.getAttribute("staging"),o=t.getAttribute("projectVersionKey"),n=t.getAttribute("projectId"),r=t.getAttribute("autoLocation"),s=t.getAttribute("veltVersion");return null==t||t.remove(),{valid:!!e,type:"snippylyPlugin",apiKey:e,staging:i,projectVersionKey:o,projectId:n,autoLocation:r,veltVersion:s}},sdkUrl:()=>{const t=document.getElementById("superflowToolbarScript");if(!t)return;const e=null==t?void 0:t.src,i=new URL(e).searchParams,o=i.has("apiKey")?i.get("apiKey"):void 0;return{valid:!!o,type:"sdkUrl",apiKey:o,staging:void 0,projectVersionKey:void 0,projectId:i.has("projectId")?i.get("projectId"):void 0,autoLocation:i.has("autoLocation")?i.get("autoLocation"):void 0,veltVersion:i.has("veltVersion")?i.get("veltVersion"):void 0}}},load:()=>{for(let t=0;t<e.allow.length;t++){const i=e.allow[t],o=e.loaders[i]();if(o&&o.valid)return o}}},i=()=>{try{const i=e.load();if(customElements.define("superflow-toolbar",t),i&&i.valid){(()=>{try{document.querySelectorAll("superflow-toolbar").forEach((t=>{t.remove()})),document.querySelectorAll("snippyly-plugin").forEach((t=>{t.remove()}))}catch(t){console.warn("Error in removeSuperflowToolbarTag: ",t)}})();const t={};return t.apiKey=i.apiKey,i.staging&&(t.staging="true"),i.projectVersionKey&&(t.projectVersionKey=i.projectVersionKey),i.projectId&&(t.projectId=i.projectId),(null==i?void 0:i.autoLocation)&&(t.autoLocation=i.autoLocation),(null==i?void 0:i.veltVersion)&&(t.veltVersion=i.veltVersion),void((t={})=>{try{const e=document.createElement("superflow-toolbar");Object.keys(t||{}).forEach((i=>{e.setAttribute(i,t[i])})),document.body.appendChild(e)}catch(t){console.warn("Error in loadSuperflowToolbarTag: ",t)}})(t)}}catch(t){console.warn("Error in initSuperflow: ",t)}};(null===document||void 0===document?void 0:document.body)?i():null===document||void 0===document||document.addEventListener("DOMContentLoaded",(()=>{i()}))})(Hp);class Gp extends tt{}customElements.get("snippyly-plugin")||customElements.define("snippyly-plugin",Gp),t.SnippylyPlugin=Gp,t.SuperflowToolbar=Hp}({});