Mini Kabibi Habibi
(()=>{"use strict";var e={330:(e,t,i)=>{const n=i(3682);e.exports=(e,t,i)=>n(e,t,i)>0},504:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},542:(e,t,i)=>{const n=i(2306),r=i(9433);e.exports=(e,t,i)=>{let o=null,a=null,s=null;try{s=new r(t,i)}catch(e){return null}return e.forEach((e=>{s.test(e)&&(o&&-1!==a.compare(e)||(o=e,a=new n(o,i)))})),o}},623:(e,t,i)=>{const n=i(2306),r=i(9433),o=i(330);e.exports=(e,t)=>{e=new r(e,t);let i=new n("0.0.0");if(e.test(i))return i;if(i=new n("0.0.0-0"),e.test(i))return i;i=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let a=null;r.forEach((e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":a&&!o(t,a)||(a=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!a||i&&!o(i,a)||(i=a)}return i&&e.test(i)?i:null}},971:(e,t,i)=>{const n=i(5923);e.exports=(e,t)=>e.sort(((e,i)=>n(i,e,t)))},1716:(e,t,i)=>{const n=i(9789);e.exports=(e,t,i)=>n(e,t,"<",i)},1859:(e,t,i)=>{const n=i(3682);e.exports=(e,t,i)=>n(e,t,i)>=0},2221:(e,t,i)=>{const n=i(2306);e.exports=(e,t,i,r,o)=>{"string"==typeof i&&(o=r,r=i,i=void 0);try{return new n(e instanceof n?e.version:e,i).inc(t,r,o).version}catch(e){return null}}},2306:(e,t,i)=>{const n=i(6286),{MAX_LENGTH:r,MAX_SAFE_INTEGER:o}=i(504),{safeRe:a,t:s}=i(6516),l=i(6633),{compareIdentifiers:c}=i(2329);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>r)throw new TypeError(`version is longer than ${r} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const i=e.trim().match(t.loose?a[s.LOOSE]:a[s.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<o)return t}return e})):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const i=this.prerelease[t],r=e.prerelease[t];if(n("prerelease compare",t,i,r),void 0===i&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===i)return-1;if(i!==r)return c(i,r)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const i=this.build[t],r=e.build[t];if(n("build compare",t,i,r),void 0===i&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===i)return-1;if(i!==r)return c(i,r)}while(++t)}inc(e,t,i){if(e.startsWith("pre")){if(!t&&!1===i)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?a[s.PRERELEASELOOSE]:a[s.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,i),this.inc("pre",t,i);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,i),this.inc("pre",t,i);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(i)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===i)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===i&&(n=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},2329:e=>{const t=/^[0-9]+$/,i=(e,i)=>{const n=t.test(e),r=t.test(i);return n&&r&&(e=+e,i=+i),e===i?0:n&&!r?-1:r&&!n?1:e<i?-1:1};e.exports={compareIdentifiers:i,rcompareIdentifiers:(e,t)=>i(t,e)}},2492:(e,t,i)=>{const n=i(2306);e.exports=(e,t)=>new n(e,t).major},2782:(e,t,i)=>{const n=i(9433);e.exports=(e,t,i)=>(e=new n(e,i),t=new n(t,i),e.intersects(t,i))},2827:(e,t,i)=>{const n=i(3682);e.exports=(e,t,i)=>0===n(e,t,i)},3212:(e,t,i)=>{const n=i(8950);e.exports=(e,t)=>{const i=n(e.trim().replace(/^[=v]+/,""),t);return i?i.version:null}},3413:(e,t,i)=>{const n=i(5923);e.exports=(e,t)=>e.sort(((e,i)=>n(e,i,t)))},3560:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},3588:(e,t,i)=>{const n=i(3682);e.exports=(e,t,i)=>n(t,e,i)},3682:(e,t,i)=>{const n=i(2306);e.exports=(e,t,i)=>new n(e,i).compare(new n(t,i))},3870:(e,t,i)=>{const n=i(3682);e.exports=(e,t,i)=>n(e,t,i)<=0},3899:(e,t,i)=>{const n=i(8950);e.exports=(e,t)=>{const i=n(e,t);return i?i.version:null}},3961:(e,t,i)=>{const n=i(3682);e.exports=(e,t,i)=>0!==n(e,t,i)},4410:(e,t,i)=>{const n=i(8950);e.exports=(e,t)=>{const i=n(e,null,!0),r=n(t,null,!0),o=i.compare(r);if(0===o)return null;const a=o>0,s=a?i:r,l=a?r:i,c=!!s.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(s))return l.minor&&!l.patch?"minor":"patch"}const u=c?"pre":"";return i.major!==r.major?u+"major":i.minor!==r.minor?u+"minor":i.patch!==r.patch?u+"patch":"prerelease"}},4563:(e,t,i)=>{const n=i(6652),r=i(3682);e.exports=(e,t,i)=>{const o=[];let a=null,s=null;const l=e.sort(((e,t)=>r(e,t,i)));for(const e of l)n(e,t,i)?(s=e,a||(a=e)):(s&&o.push([a,s]),s=null,a=null);a&&o.push([a,null]);const c=[];for(const[e,t]of o)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");const u=c.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return u.length<d.length?u:t}},5744:(e,t,i)=>{const n=i(2306);e.exports=(e,t)=>new n(e,t).minor},5923:(e,t,i)=>{const n=i(2306);e.exports=(e,t,i)=>{const r=new n(e,i),o=new n(t,i);return r.compare(o)||r.compareBuild(o)}},5969:(e,t,i)=>{const n=i(3682);e.exports=(e,t)=>n(e,t,!0)},6231:(e,t,i)=>{const n=i(2306);e.exports=(e,t)=>new n(e,t).patch},6286:e=>{const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},6516:(e,t,i)=>{const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=i(504),a=i(6286),s=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],d=t.t={};let p=0;const h="[a-zA-Z0-9-]",v=[["\\s",1],["\\d",o],[h,r]],f=(e,t,i)=>{const n=(e=>{for(const[t,i]of v)e=e.split(`${t}*`).join(`${t}{0,${i}}`).split(`${t}+`).join(`${t}{1,${i}}`);return e})(t),r=p++;a(e,r,t),d[e]=r,c[r]=t,u[r]=n,s[r]=new RegExp(t,i?"g":void 0),l[r]=new RegExp(n,i?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),f("MAINVERSION",`(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${c[d.PRERELEASEIDENTIFIER]}(?:\\.${c[d.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${c[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[d.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${h}+`),f("BUILD",`(?:\\+(${c[d.BUILDIDENTIFIER]}(?:\\.${c[d.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${c[d.MAINVERSION]}${c[d.PRERELEASE]}?${c[d.BUILD]}?`),f("FULL",`^${c[d.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${c[d.MAINVERSIONLOOSE]}${c[d.PRERELEASELOOSE]}?${c[d.BUILD]}?`),f("LOOSE",`^${c[d.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${c[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${c[d.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:${c[d.PRERELEASE]})?${c[d.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:${c[d.PRERELEASELOOSE]})?${c[d.BUILD]}?)?)?`),f("XRANGE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),f("COERCE",`${c[d.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",c[d.COERCEPLAIN]+`(?:${c[d.PRERELEASE]})?`+`(?:${c[d.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",c[d.COERCE],!0),f("COERCERTLFULL",c[d.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${c[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${c[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${c[d.LONECARET]}${c[d.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${c[d.LONECARET]}${c[d.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${c[d.GTLT]}\\s*(${c[d.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]}|${c[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${c[d.XRANGEPLAIN]})\\s+-\\s+(${c[d.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${c[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[d.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},6633:e=>{const t=Object.freeze({loose:!0}),i=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:i},6652:(e,t,i)=>{const n=i(9433);e.exports=(e,t,i)=>{try{t=new n(t,i)}catch(e){return!1}return t.test(e)}},7457:(e,t,i)=>{const n=i(9433);e.exports=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},7536:(e,t,i)=>{const n=i(9433);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},7625:(e,t,i)=>{const n=i(2827),r=i(3961),o=i(330),a=i(1859),s=i(9245),l=i(3870);e.exports=(e,t,i,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof i&&(i=i.version),e===i;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof i&&(i=i.version),e!==i;case"":case"=":case"==":return n(e,i,c);case"!=":return r(e,i,c);case">":return o(e,i,c);case">=":return a(e,i,c);case"<":return s(e,i,c);case"<=":return l(e,i,c);default:throw new TypeError(`Invalid operator: ${t}`)}}},8301:(e,t,i)=>{const n=i(9789);e.exports=(e,t,i)=>n(e,t,">",i)},8686:e=>{e.exports={rE:"8.10.0"}},8812:(e,t,i)=>{const n=i(2306),r=i(9433);e.exports=(e,t,i)=>{let o=null,a=null,s=null;try{s=new r(t,i)}catch(e){return null}return e.forEach((e=>{s.test(e)&&(o&&1!==a.compare(e)||(o=e,a=new n(o,i)))})),o}},8950:(e,t,i)=>{const n=i(2306);e.exports=(e,t,i=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!i)return null;throw e}}},9245:(e,t,i)=>{const n=i(3682);e.exports=(e,t,i)=>n(e,t,i)<0},9315:(e,t,i)=>{const n=i(6516),r=i(504),o=i(2306),a=i(2329),s=i(8950),l=i(3899),c=i(3212),u=i(2221),d=i(4410),p=i(2492),h=i(5744),v=i(6231),f=i(9503),m=i(3682),g=i(3588),S=i(5969),y=i(5923),A=i(3413),I=i(971),E=i(330),T=i(9245),C=i(2827),b=i(3961),w=i(1859),O=i(3870),R=i(7625),k=i(9332),P=i(9398),D=i(9433),F=i(6652),L=i(7457),x=i(542),N=i(8812),_=i(623),M=i(7536),U=i(9789),$=i(8301),z=i(1716),H=i(2782),V=i(4563),W=i(9730);e.exports={parse:s,valid:l,clean:c,inc:u,diff:d,major:p,minor:h,patch:v,prerelease:f,compare:m,rcompare:g,compareLoose:S,compareBuild:y,sort:A,rsort:I,gt:E,lt:T,eq:C,neq:b,gte:w,lte:O,cmp:R,coerce:k,Comparator:P,Range:D,satisfies:F,toComparators:L,maxSatisfying:x,minSatisfying:N,minVersion:_,validRange:M,outside:U,gtr:$,ltr:z,intersects:H,simplifyRange:V,subset:W,SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}},9332:(e,t,i)=>{const n=i(2306),r=i(8950),{safeRe:o,t:a}=i(6516);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let i=null;if((t=t||{}).rtl){const n=t.includePrerelease?o[a.COERCERTLFULL]:o[a.COERCERTL];let r;for(;(r=n.exec(e))&&(!i||i.index+i[0].length!==e.length);)i&&r.index+r[0].length===i.index+i[0].length||(i=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}else i=e.match(t.includePrerelease?o[a.COERCEFULL]:o[a.COERCE]);if(null===i)return null;const s=i[2],l=i[3]||"0",c=i[4]||"0",u=t.includePrerelease&&i[5]?`-${i[5]}`:"",d=t.includePrerelease&&i[6]?`+${i[6]}`:"";return r(`${s}.${l}.${c}${u}${d}`,t)}},9398:(e,t,i)=>{const n=Symbol("SemVer ANY");class r{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?a[s.COMPARATORLOOSE]:a[s.COMPARATOR],i=e.match(t);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==i[1]?i[1]:"","="===this.operator&&(this.operator=""),i[2]?this.semver=new u(i[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=o(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=r;const o=i(6633),{safeRe:a,t:s}=i(6516),l=i(7625),c=i(6286),u=i(2306),d=i(9433)},9433:(e,t,i)=>{const n=/\s+/g;class r{constructor(e,t){if(t=a(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(n," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&S(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&m))+":"+e,i=o.get(t);if(i)return i;const n=this.options.loose,r=n?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];e=e.replace(r,P(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(u[d.COMPARATORTRIM],p),l("comparator trim",e),e=e.replace(u[d.TILDETRIM],h),l("tilde trim",e),e=e.replace(u[d.CARETTRIM],v),l("caret trim",e);let a=e.split(" ").map((e=>A(e,this.options))).join(" ").split(/\s+/).map((e=>k(e,this.options)));n&&(a=a.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(u[d.COMPARATORLOOSE]))))),l("range list",a);const c=new Map,S=a.map((e=>new s(e,this.options)));for(const e of S){if(g(e))return[e];c.set(e.value,e)}c.size>1&&c.has("")&&c.delete("");const y=[...c.values()];return o.set(t,y),y}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((i=>y(i,t)&&e.set.some((e=>y(e,t)&&i.every((i=>e.every((e=>i.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(D(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const o=new(i(3560)),a=i(6633),s=i(9398),l=i(6286),c=i(2306),{safeRe:u,t:d,comparatorTrimReplace:p,tildeTrimReplace:h,caretTrimReplace:v}=i(6516),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:m}=i(504),g=e=>"<0.0.0-0"===e.value,S=e=>""===e.value,y=(e,t)=>{let i=!0;const n=e.slice();let r=n.pop();for(;i&&n.length;)i=n.every((e=>r.intersects(e,t))),r=n.pop();return i},A=(e,t)=>(l("comp",e,t),e=C(e,t),l("caret",e),e=E(e,t),l("tildes",e),e=w(e,t),l("xrange",e),e=R(e,t),l("stars",e),e),I=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map((e=>T(e,t))).join(" "),T=(e,t)=>{const i=t.loose?u[d.TILDELOOSE]:u[d.TILDE];return e.replace(i,((t,i,n,r,o)=>{let a;return l("tilde",e,t,i,n,r,o),I(i)?a="":I(n)?a=`>=${i}.0.0 <${+i+1}.0.0-0`:I(r)?a=`>=${i}.${n}.0 <${i}.${+n+1}.0-0`:o?(l("replaceTilde pr",o),a=`>=${i}.${n}.${r}-${o} <${i}.${+n+1}.0-0`):a=`>=${i}.${n}.${r} <${i}.${+n+1}.0-0`,l("tilde return",a),a}))},C=(e,t)=>e.trim().split(/\s+/).map((e=>b(e,t))).join(" "),b=(e,t)=>{l("caret",e,t);const i=t.loose?u[d.CARETLOOSE]:u[d.CARET],n=t.includePrerelease?"-0":"";return e.replace(i,((t,i,r,o,a)=>{let s;return l("caret",e,t,i,r,o,a),I(i)?s="":I(r)?s=`>=${i}.0.0${n} <${+i+1}.0.0-0`:I(o)?s="0"===i?`>=${i}.${r}.0${n} <${i}.${+r+1}.0-0`:`>=${i}.${r}.0${n} <${+i+1}.0.0-0`:a?(l("replaceCaret pr",a),s="0"===i?"0"===r?`>=${i}.${r}.${o}-${a} <${i}.${r}.${+o+1}-0`:`>=${i}.${r}.${o}-${a} <${i}.${+r+1}.0-0`:`>=${i}.${r}.${o}-${a} <${+i+1}.0.0-0`):(l("no pr"),s="0"===i?"0"===r?`>=${i}.${r}.${o}${n} <${i}.${r}.${+o+1}-0`:`>=${i}.${r}.${o}${n} <${i}.${+r+1}.0-0`:`>=${i}.${r}.${o} <${+i+1}.0.0-0`),l("caret return",s),s}))},w=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>O(e,t))).join(" ")),O=(e,t)=>{e=e.trim();const i=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return e.replace(i,((i,n,r,o,a,s)=>{l("xRange",e,i,n,r,o,a,s);const c=I(r),u=c||I(o),d=u||I(a),p=d;return"="===n&&p&&(n=""),s=t.includePrerelease?"-0":"",c?i=">"===n||"<"===n?"<0.0.0-0":"*":n&&p?(u&&(o=0),a=0,">"===n?(n=">=",u?(r=+r+1,o=0,a=0):(o=+o+1,a=0)):"<="===n&&(n="<",u?r=+r+1:o=+o+1),"<"===n&&(s="-0"),i=`${n+r}.${o}.${a}${s}`):u?i=`>=${r}.0.0${s} <${+r+1}.0.0-0`:d&&(i=`>=${r}.${o}.0${s} <${r}.${+o+1}.0-0`),l("xRange return",i),i}))},R=(e,t)=>(l("replaceStars",e,t),e.trim().replace(u[d.STAR],"")),k=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),P=e=>(t,i,n,r,o,a,s,l,c,u,d,p)=>`${i=I(n)?"":I(r)?`>=${n}.0.0${e?"-0":""}`:I(o)?`>=${n}.${r}.0${e?"-0":""}`:a?`>=${i}`:`>=${i}${e?"-0":""}`} ${l=I(c)?"":I(u)?`<${+c+1}.0.0-0`:I(d)?`<${c}.${+u+1}.0-0`:p?`<=${c}.${u}.${d}-${p}`:e?`<${c}.${u}.${+d+1}-0`:`<=${l}`}`.trim(),D=(e,t,i)=>{for(let i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!i.includePrerelease){for(let i=0;i<e.length;i++)if(l(e[i].semver),e[i].semver!==s.ANY&&e[i].semver.prerelease.length>0){const n=e[i].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},9503:(e,t,i)=>{const n=i(8950);e.exports=(e,t)=>{const i=n(e,t);return i&&i.prerelease.length?i.prerelease:null}},9730:(e,t,i)=>{const n=i(9433),r=i(9398),{ANY:o}=r,a=i(6652),s=i(3682),l=[new r(">=0.0.0-0")],c=[new r(">=0.0.0")],u=(e,t,i)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=i.includePrerelease?l:c}if(1===t.length&&t[0].semver===o){if(i.includePrerelease)return!0;t=c}const n=new Set;let r,u,h,v,f,m,g;for(const t of e)">"===t.operator||">="===t.operator?r=d(r,t,i):"<"===t.operator||"<="===t.operator?u=p(u,t,i):n.add(t.semver);if(n.size>1)return null;if(r&&u){if(h=s(r.semver,u.semver,i),h>0)return null;if(0===h&&(">="!==r.operator||"<="!==u.operator))return null}for(const e of n){if(r&&!a(e,String(r),i))return null;if(u&&!a(e,String(u),i))return null;for(const n of t)if(!a(e,String(n),i))return!1;return!0}let S=!(!u||i.includePrerelease||!u.semver.prerelease.length)&&u.semver,y=!(!r||i.includePrerelease||!r.semver.prerelease.length)&&r.semver;S&&1===S.prerelease.length&&"<"===u.operator&&0===S.prerelease[0]&&(S=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,r)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(v=d(r,e,i),v===e&&v!==r)return!1}else if(">="===r.operator&&!a(r.semver,String(e),i))return!1;if(u)if(S&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===S.major&&e.semver.minor===S.minor&&e.semver.patch===S.patch&&(S=!1),"<"===e.operator||"<="===e.operator){if(f=p(u,e,i),f===e&&f!==u)return!1}else if("<="===u.operator&&!a(u.semver,String(e),i))return!1;if(!e.operator&&(u||r)&&0!==h)return!1}return!(r&&m&&!u&&0!==h||u&&g&&!r&&0!==h||y||S)},d=(e,t,i)=>{if(!e)return t;const n=s(e.semver,t.semver,i);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,i)=>{if(!e)return t;const n=s(e.semver,t.semver,i);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,i={})=>{if(e===t)return!0;e=new n(e,i),t=new n(t,i);let r=!1;e:for(const n of e.set){for(const e of t.set){const t=u(n,e,i);if(r=r||null!==t,t)continue e}if(r)return!1}return!0}},9789:(e,t,i)=>{const n=i(2306),r=i(9398),{ANY:o}=r,a=i(9433),s=i(6652),l=i(330),c=i(9245),u=i(3870),d=i(1859);e.exports=(e,t,i,p)=>{let h,v,f,m,g;switch(e=new n(e,p),t=new a(t,p),i){case">":h=l,v=u,f=c,m=">",g=">=";break;case"<":h=c,v=d,f=l,m="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,p))return!1;for(let i=0;i<t.set.length;++i){const n=t.set[i];let a=null,s=null;if(n.forEach((e=>{e.semver===o&&(e=new r(">=0.0.0")),a=a||e,s=s||e,h(e.semver,a.semver,p)?a=e:f(e.semver,s.semver,p)&&(s=e)})),a.operator===m||a.operator===g)return!1;if((!s.operator||s.operator===m)&&v(e,s.semver))return!1;if(s.operator===g&&f(e,s.semver))return!1}return!0}}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,i),o.exports}i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();class n{constructor(){this.registrations=new Map}addEventListener(e,t){this.registrations.set(e,t)}dispatchEvent(e,t){this.registrations.has(e)&&this.registrations.get(e)(t)}clearListeners(){this.registrations.clear()}}var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},r(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var a=function(){return a=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a.apply(this,arguments)};function s(e,t,i,n){return new(i||(i=Promise))((function(r,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;const l=new class{constructor(){this.listeners=new Map}addListener(e,t){var i;this.listeners.has(e)||this.listeners.set(e,new Set),null===(i=this.listeners.get(e))||void 0===i||i.add(t)}removeListener(e,t){var i;null===(i=this.listeners.get(e))||void 0===i||i.delete(t)}dispatch(e){const t=this.listeners.get(e);t&&t.forEach((e=>e()))}},c=i(8686).rE,u="appInitialization.appLoaded",d="appInitialization.expectedFailure",p="appInitialization.failure",h="appInitialization.success",v="authentication.getAuthToken",f="authentication.getUser",m="authentication.authenticate",g="authentication.authenticate.success",S="authentication.authenticate.failure",y="calendar.composeMeeting",A="calendar.openCalendarItem",I="clipboard.writeToClipboard",E="clipboard.readFromClipboard",T="conversations.openConversation",C="conversations.closeConversation",b="getChatMembers",w={sendCustomTelemetryData:"copilot.customTelemetry.sendCustomTelemetryData"},O={getEligibilityInfo:"copilot.eligibility.getEligibilityInfo"},R={closeSidePanel:"copilot.view.closeSidePanel"},k="tasks.startTask",P="tasks.completeTask",D={resize:"tasks.updateTask"},F="externalAppCardActions.processActionOpenUrl",L="externalAppCardActions.processActionSubmit",x="externalAppCardActionsForCEA.processActionOpenUrl",N="externalAppCardActionsForCEA.processActionSubmit",_="externalAppCommands.processActionCommand",M="externalAppAuthentication.authenticateAndResendRequest",U="externalAppAuthentication.authenticateWithSSO",$="externalAppAuthentication.authenticateWithSSOAndResendRequest",z="externalAppAuthentication.authenticateWithOauth2",H="externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins",V="externalAppAuthenticationForCEA.authenticateWithSSO",W="externalAppAuthenticationForCEA.authenticateWithOauth",B="externalAppAuthenticationForCEA.authenticateAndResendRequest",j="externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest",G="files.addCloudStorageFolder",K="files.copyMoveFiles",q="files.deleteCloudStorageFolder",X="files.getCloudStorageFolders",J="openFilePreview",Y="files.getExternalProviders",Q="files.getCloudStorageFolderContents",Z="getContext",ee="initialize",te={addAndConfigure:"hostEntity.tab.addAndConfigure",reconfigure:"hostEntity.tab.reconfigure",rename:"hostEntity.tab.rename",remove:"hostEntity.tab.remove",getAll:"hostEntity.tab.getAll"},ie="location.getLocation",ne={showLocation:"location.showLocation"},re="interactive.getFluidTenantInfo",oe="interactive.getFluidToken",ae="interactive.getFluidContainerId",se="interactive.setFluidContainerId",le="interactive.getNtpTime",ce="interactive.registerClientId",ue="interactive.getClientRoles",de="interactive.getClientInfo",pe="mail.composeMail",he="mail.openMailItem",ve="marketplace.getCart",fe="marketplace.addOrUpdateCartItems",me="marketplace.removeCartItems",ge="marketplace.updateCartStatus",Se="captureImage",ye="getMedia",Ae="selectMedia",Ie="viewImages",Ee="meeting.getAppContentStageSharingCapabilities",Te="meeting.getAppContentStageSharingState",Ce="meeting.getAuthenticationTokenForAnonymousUser",be="getIncomingClientAudioState",we="meeting.getLiveStreamState",Oe="meeting.getMeetingDetails",Re={setOptions:"meeting.appShareButton.setOptions"},ke="meeting.requestStartLiveStreaming",Pe="meeting.requestStopLiveStreaming",De="meeting.shareAppContentToStage",Fe="meeting.stopSharingAppContentToStage",Le="toggleIncomingClientAudio",xe="meeting.requestAppAudioHandling",Ne="meeting.updateMicState",_e="meeting.joinMeeting",Me="meetingRoom.getPairedMeetingRoomInfo",Ue="meetingRoom.sendCommandToPairedMeetingRoom",$e="nestedAppAuth.execute",ze="nestedAppAuth.manageNAATrustedOrigins",He="settings.getSettings",Ve="navigateCrossDomain",We="pages.navigateToApp",Be="returnFocus",je="setFrameContext",Ge="shareDeepLink",Ke={navigateBack:"navigateBack"},qe={navigateTo:"pages.currentApp.navigateTo",navigateToDefaultPage:"pages.currentApp.navigateToDefaultPage"},Xe={getTabInstances:"getTabInstances",getMruTabInstances:"getMruTabInstances",navigateToTab:"navigateToTab"},Je={setConfig:"settings.setSettings",setValidityState:"settings.setValidityState",save:{success:"settings.save.success",failure:"settings.save.failure"},remove:{success:"settings.remove.success",failure:"settings.remove.failure"}},Ye={enterFullscreen:"enterFullscreen",exitFullscreen:"exitFullscreen"},Qe={getPermissionStatus:"permissions.has"},Ze="permissions.request",et="remoteCamera.getCapableParticipants",tt="remoteCamera.requestControl",it="remoteCamera.sendControlCommand",nt="remoteCamera.terminateSession",rt="readyToUnload",ot="registerHandler",at="search.unregister",st="search.closeSearch",lt="shortcutRelay.getHostShortcuts",ct="shortcutRelay.forwardShortcutEvent",ut="stageView.open",dt={close:"stageView.self.close"},pt="store.openFullStore",ht="store.openAppDetail",vt="store.openInContextStore",ft="store.openSpecificStore",mt="teams.getTeamChannels",gt="teams.refreshSiteUrl",St={getConfigSetting:"getConfigSetting",joinedTeams:{getUserJoinedTeams:"getUserJoinedTeams"}};var yt,At,It,Et;!function(e){e.ME="ME",e.CEA="CEA"}(yt||(yt={})),function(e){e.AuthFailed="AuthFailed",e.Timeout="Timeout",e.Other="Other",e.AppInitTimeout="AppInitTimeout",e.CachedAppLoadTimedOut="CachedAppLoadTimedOut",e.Validation="Validation",e.Validation_InvalidDomains="Validation_InvalidDomains",e.Ocdi="Ocdi"}(At||(At={})),function(e){e.AppExpiration="app expiration",e.AppNotifyFailure="app sent notify failure",e.AppUnloadTimeout="app unload timeout",e.FreeMemoryUnderMinimum="insufficient memory to retain the cached app",e.HostExplicitRemoval="host explicitly removed the app",e.HostMemoryLimitExceeded="host memory limit exceeded",e.AppDidNotRegisterForCaching="app did not register for caching",e.NumAppsExceeded="number of apps exceeded"}(It||(It={})),function(e){e.PermissionError="PermissionError",e.NotFound="NotFound",e.Throttling="Throttling",e.Offline="Offline",e.Other="Other"}(Et||(Et={}));const Tt={resourceDomainParameter:"{resourceDomain}",validResourcePattern:"^((https|api)://{resourceDomain}([:/].*)?)$"},Ct=/^(\*\.)*[^*]+$/i,bt=new Set(["b5abf2ae-c16b-4310-8f8a-d3bcdb52f162","d870f6cd-4aa5-4d42-9626-ab690c041429","43a6e7fb-bd10-4c0a-b02e-6a9c86ba272a"]),wt=new Set(["96f7e131-7b0f-4947-8a62-9cd027b94147"]),Ot=new Set(["c3a1996d-db0f-4857-a6ea-7aabf0266b00","25b07509-bc6a-4a53-b683-9beb24e55570"]),Rt=new Set(["f3a6e67f-850d-4dd9-960a-04c6638ded39","f3a6e67f-850d-4dd9-960a-04c6638ded36","b6b18421-3bba-40df-a983-05fbbc9e2d13","a9750531-44bc-4346-84a7-c4ceda140ef4"]),kt=["com.example.microsoftteamstabs.test","com.example.m365testapp.test"],Pt=new Set([...bt,...kt]),Dt="Authorization code exceeds max length of 4096 characters",Ft="Authorization code contains unexpected characters. Allowed characters are a-z, A-Z, 0-9, ., _, +, /, =, ~, and -",Lt="Desktop clients must provide implementation for externalAuthService on IAuthenticationService. External auth flows may not work as expected when externalAuthService is not provided.",xt="App does not have the required permissions for this operation",Nt=["www.microsoft365.com","bing.com","edgeservices.bing.com","www.bing.com","www.staging-bing-int.com","teams.cloud.microsoft","outlook.cloud.microsoft","m365.cloud.microsoft","copilot.microsoft.com","windows.msn.com"],_t="2.19",Mt="The detected TeamsJS Version is < 2.19. App may not be able to run on this domain. Please update TeamsJS.",Ut=["localhost","local.teams.office.com","local.teams.microsoft.com","local.office.com"];class $t{constructor(e){this.listeners={},this.element=e}addListener(e,t){this.element&&(this.removeListener(e),this.element.addEventListener(e,t),this.listeners[e]=t)}removeListener(e){this.element&&this.listeners[e]&&(this.element.removeEventListener(e,this.listeners[e]),delete this.listeners[e])}removeAllListeners(){for(const e of Object.keys(this.listeners))this.removeListener(e)}}var zt,Ht=new Uint8Array(16);function Vt(){if(!zt&&!(zt="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return zt(Ht)}const Wt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Bt=function(e){return"string"==typeof e&&Wt.test(e)};for(var jt=[],Gt=0;Gt<256;++Gt)jt.push((Gt+256).toString(16).substr(1));const Kt=function(e,t,i){var n=(e=e||{}).random||(e.rng||Vt)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(var r=0;r<16;++r)t[i+r]=n[r];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(jt[e[t+0]]+jt[e[t+1]]+jt[e[t+2]]+jt[e[t+3]]+"-"+jt[e[t+4]]+jt[e[t+5]]+"-"+jt[e[t+6]]+jt[e[t+7]]+"-"+jt[e[t+8]]+jt[e[t+9]]+"-"+jt[e[t+10]]+jt[e[t+11]]+jt[e[t+12]]+jt[e[t+13]]+jt[e[t+14]]+jt[e[t+15]]).toLowerCase();if(!Bt(i))throw TypeError("Stringified UUID is invalid");return i}(n)},qt="{authId}",Xt="authId",Jt="result",Yt=(()=>{const e={};return{startNewExternalAuthSession:(t,i,n)=>{const r=(e=>{const t=new URL(e).searchParams.get(Xt);return t&&t!==qt?t:Kt()})(t);return t=t.replace("{oauthRedirectMethod}","deeplink").replace(qt,r).replace("{hostRedirectUrl}",n?((e,t)=>{const i=new URL(e);i.searchParams.delete(Xt),i.searchParams.delete(Jt);const n=decodeURIComponent(i.searchParams.toString()),r=""===n.trim();i.search="";const o=`${n}${r?"":"&"}`;return encodeURIComponent(`${i.toString()}?${o}${Xt}=${t}&${Jt}={result}`)})(n,r):""),e[r]={handler:i,url:t,timeoutId:window.setTimeout((()=>{i(!1,"OAuth session timeout"),delete e[r]}),12e4)},new URL(t)},completeAuth:(t,i)=>{if("string"==typeof t&&"string"==typeof i){const n=e[t];if(n){window.clearTimeout(n.timeoutId);const r=RegExp("^[-a-zA-Z0-9._~+/=]+$");i.length>4096?n.handler(!1,Dt):r.test(i)?n.handler(!0,i):n.handler(!1,Ft),delete e[t]}}}}})();var Qt,Zt,ei;!function(e){e.AppDefinitionUnavailable="AppDefinitionUnavailable",e.BlockedByBrowser="BlockedByBrowser",e.CancelledByUser="CancelledByUser",e.InvalidAuthUrl="InvalidAuthUrl",e.InvalidFrameContext="InvalidFrameContext",e.InvalidOrigin="InvalidOrigin",e.Other="Other",e.AuthWindowReferenceUndefined="AuthWindowReferenceUndefined"}(Qt||(Qt={})),(ei=Zt||(Zt={})).Debug="Debug",ei.Info="Info",ei.Warn="Warn",ei.Error="Error";const ti="api.appInitialization.sdkLoaded",ii={[ee]:"api.appInitialization.initialize",[u]:"api.appInitialization.appLoaded",[h]:"api.appInitialization.success",[p]:"api.appInitialization.failure",[d]:"api.appInitialization.expectedFailure","appEntity.selectAppEntity":"api.appEntity.selectAppEntity","appInstallDialog.openAppInstallDialog":"api.appInstallDialog.openAppInstallDialog",[m]:"api.authentication.authenticate",[v]:"api.getAuthToken",[f]:"api.getUser",[S]:"api.authentication.notifyFailure",[g]:"api.authentication.notifySuccess","media.scanBarCode":"api.barCode.scanBarCode",[y]:"api.calendar.composeMeeting",[A]:"api.calendar.openCalendarItem","call.startCall":"api.call.startCall","chat.openChat":"api.chat.openChat",[E]:"api.clipboard.readFromClipboard",[I]:"api.clipboard.writeToClipboard",[C]:"api.conversations.closeConversation",[b]:"api.conversations.getChatMembers",[T]:"api.conversations.openConversation",[O.getEligibilityInfo]:"api.copilot.eligibility.getEligibilityInfo",[w.sendCustomTelemetryData]:"api.copilot.customTelemetry.sendCustomTelemetryData",[R.closeSidePanel]:"api.copilot.view.closeSidePanel",[k]:"api.dialogs.open",[P]:"api.dialogs.submit",[D.resize]:"api.dialogs.update.resize",[M]:"api.externalAppAuthentication.authenticateAndResendRequest",[z]:"api.externalAppAuthentication.authenticateWithOauth",[H]:"api.externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins",[U]:"api.externalAppAuthentication.authenticateWithSSO",[$]:"api.externalAppAuthentication.authenticateWithSSOAndResendRequest",[B]:"api.externalAppAuthenticationForCEA.authenticateAndResendRequest",[j]:"api.externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest",[W]:"api.externalAppAuthenticationForCEA.authenticateWithOauth",[V]:"api.externalAppAuthenticationForCEA.authenticateWithSSO",[F]:"api.externalAppCardActions.processActionOpenUrl",[L]:"api.externalAppCardActions.processActionSubmit",[x]:"api.externalAppCardActionsForCEA.processActionOpenUrl",[N]:"api.externalAppCardActionsForCEA.processActionSubmit","externalAppCardActionsForDA.processActionOpenUrlDialog":"api.externalAppCardActionsForDA.processActionOpenUrlDialog",[_]:"api.externalAppCommands.processActionCommand",[G]:"api.files.addCloudStorageFolder",[K]:"api.files.copyMoveFiles",[q]:"api.files.deleteCloudStorageFolder",[Q]:"api.files.getCloudStorageFolderContents",[X]:"api.files.getCloudStorageFolders",[Y]:"api.files.getExternalProviders",[J]:"api.files.openFilePreview",[Z]:"api.getContext",[te.addAndConfigure]:"api.hostEntity.tab.addAndConfigure",[te.reconfigure]:"api.hostEntity.tab.reconfigure",[te.rename]:"api.hostEntity.tab.rename",[te.remove]:"api.hostEntity.tab.remove",[te.getAll]:"api.hostEntity.tab.getAll",[de]:"api.interactive.getClientInfo",[ue]:"api.interactive.getClientRoles",[ae]:"api.interactive.getFluidContainerId",[re]:"api.interactive.getFluidTenantInfo",[oe]:"api.interactive.getFluidToken",[le]:"api.interactive.getNtpTime",[ce]:"api.interactive.registerClientId",[se]:"api.interactive.setFluidContainerId",executeDeepLink:"api.links.openLink",[ie]:"api.location.getCurrentLocation",[ne.showLocation]:"api.location.map.showLocation",[pe]:"api.mail.composeMail",[he]:"api.mail.openMailItem",[fe]:"api.marketplace.addOrUpdateCartItems",[ve]:"api.marketplace.getCart",[me]:"api.marketplace.removeCartItems",[ge]:"api.marketplace.updateCartStatus",[Se]:"api.media.captureImage",[ye]:"api.media.getMedia",[Ae]:"api.media.selectMedia",[Ie]:"api.media.viewImages",[Re.setOptions]:"api.meeting.appShareButton.setOptions",[Ee]:"api.meeting.getAppContentStageSharingCapabilities",[Te]:"api.meeting.getAppContentStageSharingState",[Ce]:"api.meeting.getAuthenticationTokenForAnonymousUser",[be]:"api.meeting.getIncomingClientAudioState",[we]:"api.meeting.getLiveStreamState",[Oe]:"api.meeting.getMeetingDetails",[_e]:"api.meeting.joinMeeting",[xe]:"api.meeting.requestAppAudioHandling",[ke]:"api.meeting.requestStartLiveStreaming",[Pe]:"api.meeting.requestStopLiveStreaming",[De]:"api.meeting.shareAppContentToStage",[Fe]:"api.meeting.stopSharingAppContentToStage",[Le]:"api.meeting.toggleIncomingClientAudio",[Ne]:"api.meeting.updateMicState",[Me]:"api.meetingRoom.getPairedMeetingRoomInfo",[Ue]:"api.meetingRoom.sendCommandToPairedMeetingRoom","monetization.openPurchaseExperience":"api.monetization.openPurchaseExperience",[$e]:"api.nestedAppAuth.execute",[ze]:"api.nestedAppAuth.manageNAATrustedOrigins","notifications.showNotification":"api.notifications.showNotification",[Ke.navigateBack]:"api.pages.backStack.navigateBack",[Je.remove.failure]:"api.pages.config.remove.failure",[Je.remove.success]:"api.pages.config.remove.success",[Je.save.failure]:"api.pages.config.save.failure",[Je.save.success]:"api.pages.config.save.success",[Je.setConfig]:"api.pages.config.setConfig",[Je.setValidityState]:"api.pages.config.setValidityState",[qe.navigateTo]:"api.pages.currentApp.navigateTo",[qe.navigateToDefaultPage]:"api.pages.currentApp.navigateToDefaultPage",[Ye.enterFullscreen]:"api.pages.fullTrust.enterFullscreen",[Ye.exitFullscreen]:"api.pages.fullTrust.exitFullscreen",[He]:"api.pages.getConfig",[Ve]:"api.pages.navigateCrossDomain",[We]:"api.pages.navigateToApp",[Be]:"api.pages.returnFocus",[je]:"api.pages.setCurrentFrame",[Ge]:"api.pages.shareDeepLink",[Xe.getMruTabInstances]:"api.pages.tabs.getMruTabInstances",[Xe.getTabInstances]:"api.pages.tabs.getTabInstances",[Xe.navigateToTab]:"api.pages.tabs.navigateToTab","people.selectPeople":"api.people.selectPeople",[Ze]:"api.permissions.requestUserConsentForPermission",[Qe.getPermissionStatus]:"api.permissions.storageService.getPermissionStatus","profile.showProfile":"api.profile.showProfile",[ot]:"api.registerHandler",[et]:"api.remoteCamera.getCapableParticipants",[tt]:"api.remoteCamera.requestControl",[it]:"api.remoteCamera.sendControlCommand",[nt]:"api.remoteCamera.terminateSession",[st]:"api.search.closeSearch",[at]:"api.search.unregister",[lt]:"api.shortcutRelay.getHostShortcuts",[ct]:"api.shortcutRelay.forwardShortcutEvent",[ut]:"api.stageView.open",[dt.close]:"api.stageView.self.close",[pt]:"api.store.openFullStore",[ht]:"api.store.openAppDetail",[vt]:"api.store.openInContextStore",[ft]:"api.store.openSpecificStore",[St.getConfigSetting]:"api.teams.fullTrust.getConfigSetting",[St.joinedTeams.getUserJoinedTeams]:"api.teams.fullTrust.joinedTeams.getUserJoinedTeams",[mt]:"api.teams.getTeamChannels",[gt]:"api.teams.refreshSiteUrl","webStorage.isWebStorageClearedOnUserLogOut":"api.webStorage.isWebStorageClearedOnUserLogOut"},ni=new Map([[ee,"initialize"],[u,"appLoaded"],[h,"success"],[p,"failure"],[d,"expectedFailure"]]);var ri,oi=(ri=[],{fireEvent:function(e){ri.forEach((function(t){return t(e)}))},addListener:function(e){e&&ri.push(e)}});function ai(e,t,i){oi.fireEvent({level:e,category:t,message:i})}function si(e,t,i){ai(0,e,(function(){var e=i instanceof Error?i.message:"";return"".concat(t,": ").concat(e)}))}var li={};function ci(e,t){"Office."===e.substring(0,7)&&"."!==e[e.length-1]?li[e]?(t.ariaTenantToken&&(li[e].ariaTenantToken=t.ariaTenantToken),t.dnmToken&&(li[e].dnmToken=t.dnmToken)):li[e]=t:ai(0,0,(function(){return"Namespace: ".concat(e)}))}function ui(e,t){for(var i=e.length;i>0;){var n=e.substr(0,i);if(li[n]){var r=li[n];return t.ariaTenantToken=r.ariaTenantToken,t.dnmToken=r.dnmToken,!0}i=e.lastIndexOf(".",i-1)}return!1}var di=9007199254740991,pi=-di,hi=/^Office(\.[A-Z][a-zA-Z0-9]*){2,}$/,vi=/^[a-zA-Z0-9_\.]{1,95}$/;function fi(e){return vi.test(e)}function mi(e){e&&e.forEach((function(e){if("string"!=typeof e.name||!fi(e.name))throw new Error("Invalid dataField name");2===e.dataType&&function(e){if("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e<pi||e>di)throw new Error("Invalid integer ".concat(JSON.stringify(e)))}(e.value)}))}function gi(e,t,i){return Ai(e,1,t,i)}function Si(e,t,i){return Ai(e,2,t,i)}function yi(e,t,i){return Ai(e,0,t,i)}function Ai(e,t,i,n){return{name:e,dataType:t,value:i,classification:n||4}}function Ii(e){var t={eventName:e.eventName,eventFlags:e.eventFlags||{},telemetryProperties:e.telemetryProperties?a({},e.telemetryProperties):{},dataFields:e.dataFields?e.dataFields.slice():[],timestamp:e.timestamp||(new Date).getTime()};return e.eventContract&&(t.eventContract={name:e.eventContract.name,dataFields:e.eventContract.dataFields.slice()}),t}var Ei,Ti,Ci,bi,wi,Oi,Ri,ki=function(){function e(e,t,i){var n,r,o;this.telemetrySinks=[],this.persistentDataFields=[],this.partAFields=[],this.eventQueue=[],this.config=i||{},e&&(this.telemetrySinks=e.telemetrySinks,(n=this.persistentDataFields).push.apply(n,e.persistentDataFields),this.config=a(a({},e.getConfig()),this.config),(r=this.partAFields).push.apply(r,e.partAFields)),t&&(o=this.persistentDataFields).push.apply(o,t)}return e.prototype.addEventContentType=function(e,t){e.push(Si("EventContent.Type",t))},e.prototype.sendTelemetryEvent=function(e){var t=Ii(e),i=t.telemetryProperties;i.nexusTenantToken=-1;var n=i.ariaTenantToken;n||ui(t.eventName,i)||n?this.sendTelemetryEventInternal(t,1):ai(0,0,(function(){return"No tenant token: "+e.eventName}))},e.prototype.sendNonStandardEvent=function(e,t){var i=Ii(e);this.sendTelemetryEventInternal(i,t)},e.prototype.sendCustomerContent=function(e){var t=Ii(e),i=t.telemetryProperties,n=i.customerContentVersion;return(!n||n>2)&&(i.customerContentVersion=2),i.ariaTenantToken=void 0,i.nexusTenantToken=void 0,i.dnmToken=void 0,this.addEventContentType(t.dataFields,2),this.sendTelemetryEventInternal(t,2)},e.prototype.sendDirectNumericEvent=function(e){var t=Ii(e),i=t.telemetryProperties;i.dnmToken||ui(t.eventName,i)||i.dnmToken?(this.addEventContentType(t.dataFields,1),this.sendTelemetryEventInternal(t,3)):ai(0,0,(function(){return"No dnm token: "+t.eventName}))},e.prototype.sendTelemetryEventInternal=function(e,t){if(2===t||!e.telemetryProperties.customerContentVersion&&!e.telemetryProperties.customerContentType){try{if(0===this.telemetrySinks.length)return void(this.config.enableQueue&&this.eventQueue.length<1e3?this.eventQueue.push([e,t]):ai(1,0,(function(){return"No telemetry sinks are attached."})));this.processTelemetryEvent(e,t)}catch(e){return void si(0,"SendTelemetryEvent",e)}this.telemetrySinks.forEach((function(i){try{3===t||2===t?i.sendNonStandardEvent&&i.sendNonStandardEvent(e,t):i.sendTelemetryEvent(e)}catch(e){}}))}else ai(0,0,(function(){return"Customer content"}))},e.prototype.processTelemetryEvent=function(e,t){var i,n,r;if(e.dataFields&&(null===(r=e.dataFields)||void 0===r||r.unshift(yi("OTelJS.Version","4.22.404")),3!==t&&this.persistentDataFields&&(i=e.dataFields).unshift.apply(i,this.persistentDataFields)),this.partAFields.length>0){var o=e.eventContract||{name:"",dataFields:[]};(n=o.dataFields).push.apply(n,this.partAFields),e.eventContract=o}this.config.disableValidation||function(e){if(!(t=e.eventName)||t.length>98||!hi.test(t))throw new Error("Invalid eventName");var t,i=e.eventContract;if(i){if(i.name&&!fi(i.name))throw new Error("Invalid eventContract");mi(i.dataFields)}mi(e.dataFields)}(e)},e.prototype.addSink=function(e){this.telemetrySinks.push(e),this.flushQueue()},e.prototype.flushQueue=function(){var e=this.eventQueue;if(this.eventQueue=[],this.telemetrySinks.length>0)for(var t=0,i=e;t<i.length;t++){var n=i[t],r=n[0],o=n[1];this.sendTelemetryEventInternal(r,o)}},e.prototype.setTenantToken=function(e,t,i){ci(e,{ariaTenantToken:t,nexusTenantToken:i})},e.prototype.setDNMToken=function(e,t){ci(e,{dnmToken:t})},e.prototype.cloneEvent=function(e){return Ii(e)},e.prototype.getConfig=function(){return this.config},e}();!function(e){e.getFields=function(e,t){var i=[];return i.push(Si("".concat(e,".Code"),t.code)),void 0!==t.type&&i.push(yi("".concat(e,".Type"),t.type)),void 0!==t.tag&&i.push(Si("".concat(e,".Tag"),t.tag)),void 0!==t.isExpected&&i.push(gi("".concat(e,".IsExpected"),t.isExpected)),i.push(yi("zC.Activity.Result","Office.System.Result")),i}}(Ei||(Ei={})),function(e){e.contractName="Office.System.Activity",e.getFields=function(t){var i="Activity",n=[];return void 0!==t.cV&&n.push(yi("".concat(i,".CV"),t.cV)),n.push(Si("".concat(i,".Duration"),t.duration)),n.push(Si("".concat(i,".Count"),t.count)),n.push(Si("".concat(i,".AggMode"),t.aggMode)),void 0!==t.success&&n.push(gi("".concat(i,".Success"),t.success)),void 0!==t.result&&n.push.apply(n,Ei.getFields("".concat(i,".Result"),t.result)),n.push(yi("zC.Activity",e.contractName)),n}}(Ti||(Ti={})),function(e){e.getFields=function(e,t){var i=[];return void 0!==t.id&&i.push(yi("".concat(e,".Id"),t.id)),void 0!==t.version&&i.push(yi("".concat(e,".Version"),t.version)),void 0!==t.sessionId&&i.push(yi("".concat(e,".SessionId"),t.sessionId)),i}}(Ci||(Ci={})),function(e){e.getFields=function(e,t){var i=[];return void 0!==t.alias&&i.push(yi("".concat(e,".Alias"),t.alias)),void 0!==t.primaryIdentityHash&&i.push(yi("".concat(e,".PrimaryIdentityHash"),t.primaryIdentityHash)),void 0!==t.primaryIdentitySpace&&i.push(yi("".concat(e,".PrimaryIdentitySpace"),t.primaryIdentitySpace)),void 0!==t.tenantId&&i.push(yi("".concat(e,".TenantId"),t.tenantId)),void 0!==t.tenantGroup&&i.push(yi("".concat(e,".TenantGroup"),t.tenantGroup)),void 0!==t.isAnonymous&&i.push(gi("".concat(e,".IsAnonymous"),t.isAnonymous)),i}}(bi||(bi={})),function(e){e.getFields=function(e,t){var i=[];return void 0!==t.name&&i.push(yi("".concat(e,".Name"),t.name)),void 0!==t.state&&i.push(yi("".concat(e,".State"),t.state)),i}}(wi||(wi={})),function(e){e.getFields=function(e,t){var i=[];return void 0!==t.id&&i.push(Si("".concat(e,".Id"),t.id)),void 0!==t.name&&i.push(yi("".concat(e,".Name"),t.name)),void 0!==t.commandSurface&&i.push(yi("".concat(e,".CommandSurface"),t.commandSurface)),void 0!==t.parentName&&i.push(yi("".concat(e,".ParentName"),t.parentName)),void 0!==t.triggerMethod&&i.push(yi("".concat(e,".TriggerMethod"),t.triggerMethod)),void 0!==t.timeOffsetMs&&i.push(Si("".concat(e,".TimeOffsetMs"),t.timeOffsetMs)),i}}(Oi||(Oi={})),function(e){e.getFields=function(e,t){var i=[];return i.push(yi("".concat(e,".ErrorGroup"),t.errorGroup)),i.push(Si("".concat(e,".Tag"),t.tag)),void 0!==t.code&&i.push(Si("".concat(e,".Code"),t.code)),void 0!==t.id&&i.push(Si("".concat(e,".Id"),t.id)),void 0!==t.count&&i.push(Si("".concat(e,".Count"),t.count)),i}}(Ri||(Ri={}));var Pi,Di=Ti,Fi=Ei,Li=Ri,xi=wi,Ni=Ci,_i=Oi,Mi=bi;function Ui(e,t){return e?e+"."+t:t}function $i(e,t,i,n,r){void 0===r&&(r=4),n&&e.push(yi("".concat(Ui(t,i)),n,r))}function zi(e,t,i,n){"boolean"==typeof n&&e.push(gi("".concat(Ui(t,i)),n))}function Hi(e,t,i,n){"number"==typeof n&&e.push(Si("".concat(Ui(t,i)),n))}!function(e){var t,i;t=e.Office||(e.Office={}),(i=t.System||(t.System={})).Activity=Di,i.Result=Fi,i.Error=Li,i.Funnel=xi,i.Host=Ni,i.User=Mi,i.UserAction=_i}(Pi||(Pi={}));var Vi,Wi={contractName:"Office.System.Activity",getFields:function(e){var t="Activity",i=[];return $i(i,t,"CV",e.cV),Hi(i,t,"Duration",e.duration),Hi(i,t,"Count",e.count),Hi(i,t,"AggMode",e.aggMode),zi(i,t,"Success",e.success),e.result&&i.push.apply(i,function(e){var t="Activity.Result",i=[];return Hi(i,t,"Code",e.code),$i(i,t,"Type",e.type),Hi(i,t,"Tag",e.tag),zi(i,t,"IsExpected",e.isExpected),i.push(yi("zC.Activity.Result","Office.System.Result")),i}(e.result)),i.push(yi("zC.Activity",this.contractName)),i}},Bi=function(e){var t="User",i=[];return $i(i,t,"PrimaryIdentityHash",e.primaryIdentityHash),$i(i,t,"PrimaryIdentitySpace",e.primaryIdentitySpace),$i(i,t,"TenantId",e.tenantId,1),$i(i,t,"TenantGroup",e.tenantGroup,1),zi(i,t,"IsAnonymous",e.isAnonymous),zi(i,t,"IsSignedIn",e.isSignedIn),i};!function(e){e.Web="Web",e.Desktop="Desktop",e.Universal="Universal",e.Mobile="Mobile",e.Win32="Win32",e.Mac="Mac",e.iOS="iOS",e.Android="Android"}(Vi||(Vi={}));var ji,Gi=function(e){var t="App",i=[];return $i(i,t,"Name",e.name,1),$i(i,t,"Platform",e.platform,1),$i(i,t,"Version",e.version,1),i},Ki=function(e){var t="Session",i=[];return $i(i,t,"Id",e.id,1),$i(i,t,"EcsETag",e.ecsETag,1),i};!function(e){e.Automation="Automation",e.Dogfood="Dogfood",e.Microsoft="Microsoft",e.Insiders="Insiders",e.Production="Production"}(ji||(ji={}));var qi,Xi;!function(e){var t,i,n,r,o="Copilot";(r=e.FeatureActionType||(e.FeatureActionType={})).IsEnabled="IsEnabled",r.IsSeen="IsSeen",r.IsTried="IsTried",r.IsKept="IsKept",r.IsRejected="IsRejected",(n=e.Capability||(e.Capability={})).ContentGeneration="Content Generation",n.Commanding="Commanding",n.QAandSummaries="QA and Summaries",n.Collaboration="Collaboration",n.Suggestions="Suggestions",(i=e.EntryPoint||(e.EntryPoint={})).Chat="Chat",i.Canvas="Canvas",i.SuggestionsPane="Suggestions Pane",i.Backstage="Backstage",(t=e.Verb||(e.Verb={})).Create="Create",t.Command="Command",t.Ask="Ask",t.Summarize="Summarize",t.Share="Share",t.Analyze="Analyze",e.getFields=function(e){var t=[];return $i(t,o,"FeatureActionType",e.featureActionType),zi(t,o,"IsUserInitiated",e.isUserInitiated),$i(t,o,"FeatureName",e.featureName),$i(t,o,"SubFeatureName",e.subFeatureName),$i(t,o,"Capability",e.capability),zi(t,o,"IsThumbsUp",e.isThumbsUp),$i(t,o,"EntryPoint",e.entryPoint),$i(t,o,"Verb",e.verb),$i(t,o,"InteractionId",e.interactionId),$i(t,o,"ConversationId",e.conversationId),t.push(yi("zC.".concat(o),"Office.System.Copilot")),t}}(qi||(qi={})),function(e){var t="Asha";!function(e){e.Pillar="Pillar",e.Error="Error"}(e.EventType||(e.EventType={})),e.getFields=function(e){var i=[];return $i(i,t,"EventType",e.eventType),$i(i,t,"Pillar",e.pillar),$i(i,t,"Scenario",e.scenario),$i(i,t,"Veto",e.veto),$i(i,t,"Error",e.error),zi(i,t,"InStaging",e.inStaging),zi(i,t,"IsSessionEndingError",e.isSessionEndingError),zi(i,t,"IsIntentional",e.isIntentional),zi(i,t,"IsInternal",e.isInternal),i.push(yi("zC.".concat(t),"Office.System.Asha")),i}}(Xi||(Xi={}));var Ji,Yi=function(){return(Yi="object"==typeof self&&"object"==typeof self.performance&&"function"==typeof self.performance.now?function(){return self.performance.now()}:function(){return Date.now()})()},Qi=function(e){var t,i=Yi(),n=Ii(e.telemetryEvent);return a(a({cv:e.parentCv.getNext()},n),{createChildActivity:function(t){return Qi({telemetryEvent:t,sendTelemetryEvent:e.sendTelemetryEvent,parentCv:this.cv})},setResult:function(e,t,i){this.result={code:e,type:t,tag:i}},endNow:function(){var n,r,o=this;if(!t){void 0===this.success&&void 0===this.result&&ai(1,0,(function(){return"Activity does not have success or result set"}));var a=Yi(),s=Math.floor(1e3*(a-i));t=!0;var l={duration:s,count:1,aggMode:0,cV:this.cv.value,success:this.success,result:this.result},c=null!==(r=null===(n=this.eventContract)||void 0===n?void 0:n.dataFields)&&void 0!==r?r:[];return c.push.apply(c,Wi.getFields(l)),this.eventContract={name:Wi.contractName,dataFields:c},e.sendTelemetryEvent(this)}ai(0,0,(function(){return"'".concat(o.eventName,"' already ended")}))}})},Zi=function(){function e(e){this.value=e,this.nextChild=0}return e.prototype.getNext=function(){return new e("".concat(this.value,".").concat(++this.nextChild))},e}(),en=function(e){function t(t,i,n){var r=e.call(this,t,i,n)||this;return r.baseCv=function(){if(!Ji){for(var e=[],t=0;t<22;t++)e.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Math.floor(64*Math.random())));Ji=new Zi(e.join(""))}return Ji}(),r}return o(t,e),t.prototype.createActivity=function(e){return Qi({sendTelemetryEvent:this.sendTelemetryEvent.bind(this),telemetryEvent:e,parentCv:this.baseCv})},t.prototype.sendActivity=function(e,t,i,n){return this.sendTelemetryEvent({eventName:e,eventContract:{name:Wi.contractName,dataFields:Wi.getFields(t)},dataFields:i,eventFlags:n})},t.prototype.sendError=function(e){var t=function(e){var t="Error",i=[];return i.push(yi("".concat(t,".ErrorGroup"),e.errorGroup)),i.push(Si("".concat(t,".Tag"),e.tag)),void 0!==e.code&&i.push(Si("".concat(t,".Code"),e.code)),void 0!==e.id&&i.push(Si("".concat(t,".Id"),e.id)),void 0!==e.count&&i.push(Si("".concat(t,".Count"),e.count)),i}(e.error);return null!=e.dataFields&&t.push.apply(t,e.dataFields),this.sendTelemetryEvent({eventName:e.eventName,dataFields:t,eventFlags:e.eventFlags})},t.prototype.createCustomerContentActivity=function(e){return Qi({sendTelemetryEvent:this.sendCustomerContent.bind(this),telemetryEvent:e,parentCv:this.baseCv})},t}(ki),tn="function",nn="object",rn="undefined",on="prototype",an="hasOwnProperty",sn=Object,ln=sn[on],cn=sn.assign,un=sn.create,dn=sn.defineProperty,pn=ln[an],hn=null;function vn(e){void 0===e&&(e=!0);var t=!1===e?null:hn;return t||(typeof globalThis!==rn&&(t=globalThis),t||typeof self===rn||(t=self),t||typeof window===rn||(t=window),t||typeof i.g===rn||(t=i.g),hn=t),t}function fn(e){throw new TypeError(e)}function mn(e){if(un)return un(e);if(null==e)return{};var t=typeof e;function i(){}return t!==nn&&t!==tn&&fn("Object prototype may only be an Object:"+e),i[on]=e,new i}var gn="initialize",Sn="name",yn="getNotifyMgr",An="identifier",In="push",En="isInitialized",Tn="config",Cn="instrumentationKey",bn="logger",wn="length",On="time",Rn="processNext",kn="getProcessTelContext",Pn="addNotificationListener",Dn="removeNotificationListener",Fn="stopPollingInternalLogs",Ln="onComplete",xn="getPlugin",Nn="flush",_n="_extensions",Mn="splice",Un="teardown",$n="messageId",zn="message",Hn="isAsync",Vn="_doTeardown",Wn="update",Bn="getNext",jn="diagLog",Gn="setNextPlugin",Kn="createNew",qn="cookieCfg",Xn="indexOf",Jn="substring",Yn="userAgent",Qn="split",Zn="setEnabled",er="substr",tr="nodeType",ir="apply",nr="replace",rr="enableDebugExceptions",or="call",ar="type",sr="handler",lr="listeners",cr="isChildEvt",ur="getCtx",dr="setCtx",pr="complete",hr="traceId",vr="spanId",fr="traceFlags",mr="",gr="channels",Sr="core",yr="createPerfMgr",Ar="disabled",Ir="extensionConfig",Er="processTelemetry",Tr="priority",Cr="eventsSent",br="eventsDiscarded",wr="eventsSendRequest",Or="perfEvent",Rr="errorToConsole",kr="warnToConsole",Pr="getPerfMgr",Dr="toISOString",Fr="endsWith",Lr="startsWith",xr="indexOf",Nr="trim",_r="toString",Mr="constructor",Ur=dn,$r=sn.freeze,zr=(sn.seal,sn.keys),Hr=String[on],Vr=Hr[Nr],Wr=Hr[Fr],Br=Hr[Lr],jr=Date[on][Dr],Gr=Array.isArray,Kr=ln[_r],qr=pn[_r],Xr=qr[or](sn),Jr=/-([a-z])/g,Yr=/([^\w\d_$])/g,Qr=/^(\d+[\w\d_$])/,Zr=Object.getPrototypeOf;function eo(e){return void 0===e||typeof e===rn}function to(e){return null===e||eo(e)}function io(e){return!to(e)}function no(e,t){return!(!e||!pn[or](e,t))}function ro(e){return!(!e||typeof e!==nn)}function oo(e){return!(!e||typeof e!==tn)}function ao(e){var t=e;return t&&po(t)&&(t=(t=(t=t[nr](Jr,(function(e,t){return t.toUpperCase()})))[nr](Yr,"_"))[nr](Qr,(function(e,t){return"_"+t}))),t}function so(e,t){if(e)for(var i in e)pn[or](e,i)&&t[or](e,i,e[i])}function lo(e,t){var i=!1;return e&&t&&!(i=e===t)&&(i=Br?e[Lr](t):function(e,t){var i=!1,n=t?t[wn]:0;if(e&&n&&e[wn]>=n&&!(i=e===t)){for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;i=!0}return i}(e,t)),i}function co(e,t){return!(!e||!t)&&-1!==e[Xn](t)}var uo=Gr||function(e){return!(!e||"[object Array]"!==Kr[or](e))};function po(e){return"string"==typeof e}function ho(e){return"number"==typeof e}function vo(e){return"boolean"==typeof e}function fo(e){var t=!1;if(e&&"object"==typeof e){var i=Zr?Zr(e):function(e){if(e){if(Zr)return Zr(e);var t=e.__proto__||e[on]||e[Mr];if(t)return t}return null}(e);i?(i[Mr]&&pn[or](i,Mr)&&(i=i[Mr]),t=typeof i===tn&&qr[or](i)===Xr):t=!0}return t}function mo(e){if(e)return jr?e[Dr]():function(e){if(e&&e.getUTCFullYear){var t=function(e){var t=String(e);return 1===t[wn]&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}}(e)}function go(e,t,i){var n=e[wn];try{for(var r=0;r<n&&(!(r in e)||-1!==t[or](i||e,e[r],r,e));r++);}catch(e){}}function So(e,t,i){if(e){if(e[xr])return e[xr](t,i);var n=e[wn],r=i||0;try{for(var o=Math.max(r>=0?r:n-Math.abs(r),0);o<n;o++)if(o in e&&e[o]===t)return o}catch(e){}}return-1}function yo(e){return e&&(e=Vr&&e[Nr]?e[Nr]():e[nr]?e[nr](/^\s+|(?=\s)\s+$/g,mr):e),e}var Ao=!{toString:null}.propertyIsEnumerable("toString"),Io=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];function Eo(e){var t=typeof e;if(t===tn||t===nn&&null!==e||fn("objKeys called on non-object"),!Ao&&zr)return zr(e);var i=[];for(var n in e)e&&pn[or](e,n)&&i[In](n);if(Ao)for(var r=Io[wn],o=0;o<r;o++)e&&pn[or](e,Io[o])&&i[In](Io[o]);return i}function To(e,t,i,n){if(Ur)try{var r={enumerable:!0,configurable:!0};return i&&(r.get=i),n&&(r.set=n),Ur(e,t,r),!0}catch(e){}return!1}var Co=$r||function(e){return e};function bo(){var e=Date;return e.now?e.now():(new e).getTime()}function wo(e){return function(e){return!(!e||"[object Error]"!==Kr[or](e))}(e)?e[Sn]:mr}function Oo(e,t,i,n,r){var o=i;return e&&((o=e[t])===i||r&&!r(o)||n&&!n(i)||(o=i,e[t]=o)),o}function Ro(e,t,i){var n;return e?!(n=e[t])&&to(n)&&(n=eo(i)?{}:i,e[t]=n):n=eo(i)?{}:i,n}function ko(e,t){return to(e)?t:e}function Po(e){return!!e}function Do(e){throw new Error(e)}function Fo(e,t,i,n,r){e&&t&&i&&(!1!==r||eo(e[t]))&&(e[t]=function(e,t){var i=null,n=null;return oo(e)?i=e:n=e,function(){var e=arguments;if(i&&(n=i()),n)return n[t][ir](n,e)}}(i,n))}function Lo(e){return e&&cn&&(e=sn(cn({},e))),e}function xo(e,t,i,n,r,o){var a=arguments,s=a[0]||{},l=a[wn],c=!1,u=1;for(l>0&&vo(s)&&(c=s,s=a[u]||{},u++),ro(s)||(s={});u<l;u++){var d=a[u],p=uo(d),h=ro(d);for(var v in d)if(p&&v in d||h&&pn[or](d,v)){var f=d[v],m=void 0;if(c&&f&&((m=uo(f))||fo(f))){var g=s[v];m?uo(g)||(g=[]):fo(g)||(g={}),f=xo(c,g,f)}void 0!==f&&(s[v]=f)}}return s}var No,_o="Data.",Mo="User.PrimaryIdentityHash",Uo="User.PrimaryIdentitySpace",$o="User.TenantId",zo="User.IsAnonymous",Ho="User.IsSignedIn",Vo="f998cc5ba4d448d6a1e8e913ff18be94-dd122e0a-fcf8-4dc5-9dbb-6afac5325183-7405";function Wo(e,t,i,n){var r=!0;if(t)for(var o=function(t){var o=t.classification,a=t.dataType,s=t.name;if(o&&!(4===o||1===o||2===n&&32===o||3===n&&2048===o))return r=!1,"break";if(3===n&&i&&3!==a&&1!==a&&2!==a&&"OTelJS.Version"!==s&&"OTelJS.Sink"!==s)return ai(0,1,(function(){return"DNM: Invalid field type "+s})),r=!1,"break";var l;l=i?"zC."===s.substr(0,3)?"zC."+_o+s.substr(3):_o+s:s;var c=void 0;switch(a){case 3:c=6;break;case 2:c=4;break;case 4:c=8;break;case 0:return e[l]="string"==typeof t.value?t.value.substr(0,25e3):t.value,"continue";default:return e[l]=t.value,"continue"}var u={value:t.value,propertyType:c};e[l]=u},a=0,s=t;a<s.length&&"break"!==o(s[a]);a++);return r}function Bo(e){ai(0,1,(function(){return"Invalid "+e}))}function jo(e){return po(e)&&""!==e}function Go(e,t){return Object.values(t).includes(e)}function Ko(e){return Go(e,Vi)}function qo(e){return Go(e,ji)}function Xo(e){return["MSACID","MSAPUID","OrgIdCID","OrgIdPUID","UserObjectId","Other"].includes(e)}function Jo(e){return!e||"Other"===e}function Yo(e,t){var i=!0;function n(t,n){n(e[t])||(Bo(t),i=!1)}function r(e){return new RegExp("^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$",t?"":"i").test(e)}return n("App.Name",jo),n("App.Platform",t?Ko:jo),n("App.Version",jo),n("Session.Id",r),t?(n("Release.AudienceGroup",qo),n(Ho,vo),e[Ho]?(n(Mo,jo),n(Uo,Xo),["OrgIdCID","OrgIdPUID","UserObjectId"].includes(e[Uo])?n($o,r):n($o,to)):(n(Uo,Jo),n($o,to))):e[zo]||!1===e[Ho]||(n(Mo,jo),n(Uo,jo),e[$o]&&n($o,r)),to(e[zo])||e[Ho]!==e[zo]||(Bo(zo),i=!1),i}var Qo,Zo="undefined",ea="constructor",ta="prototype",ia="function",na="_dynInstFuncs",ra="_isDynProxy",oa="_dynClass",aa="_dynInstChk",sa=aa,la="_dfOpts",ca="_unknown_",ua="__proto__",da="_dyn"+ua,pa="__dynProto$Gbl",ha="_dynInstProto",va="useBaseInst",fa="setInstFuncs",ma=Object,ga=ma.getPrototypeOf,Sa=ma.getOwnPropertyNames,ya=(typeof globalThis!==Zo&&(Qo=globalThis),Qo||typeof self===Zo||(Qo=self),Qo||typeof window===Zo||(Qo=window),Qo||typeof i.g===Zo||(Qo=i.g),Qo||{}),Aa=ya[pa]||(ya[pa]={o:(No={},No[fa]=!0,No[va]=!0,No),n:1e3});function Ia(e,t){return e&&ma[ta].hasOwnProperty.call(e,t)}function Ea(e){return e&&(e===ma[ta]||e===Array[ta])}function Ta(e){return Ea(e)||e===Function[ta]}function Ca(e){var t;if(e){if(ga)return ga(e);var i=e[ua]||e[ta]||(e[ea]?e[ea][ta]:null);t=e[da]||i,Ia(e,da)||(delete e[ha],t=e[da]=e[ha]||e[da],e[ha]=i)}return t}function ba(e,t){var i=[];if(Sa)i=Sa(e);else for(var n in e)"string"==typeof n&&Ia(e,n)&&i.push(n);if(i&&i.length>0)for(var r=0;r<i.length;r++)t(i[r])}function wa(e,t,i){return t!==ea&&typeof e[t]===ia&&(i||Ia(e,t))&&t!==ua&&t!==ta}function Oa(e){throw new TypeError("DynamicProto: "+e)}function Ra(){return Object.create?(e=Object.create)?e(null):{}:{};var e}function ka(e,t){for(var i=e.length-1;i>=0;i--)if(e[i]===t)return!0;return!1}function Pa(e,t,i,n,r){if(!Ea(e)){var o=i[na]=i[na]||Ra();if(!Ea(o)){var a=o[t]=o[t]||Ra();!1!==o[sa]&&(o[sa]=!!r),Ea(a)||ba(i,(function(t){wa(i,t,!1)&&i[t]!==n[t]&&(a[t]=i[t],delete i[t],(!Ia(e,t)||e[t]&&!e[t][ra])&&(e[t]=function(e,t){var i=function(){var n=function(e,t,i,n){var r=null;if(e&&Ia(i,oa)){var o=e[na]||Ra();if((r=(o[i[oa]]||Ra())[t])||Oa("Missing ["+t+"] "+ia),!r[aa]&&!1!==o[sa]){for(var a=!Ia(e,t),s=Ca(e),l=[];a&&s&&!Ta(s)&&!ka(l,s);){var c=s[t];if(c){a=c===n;break}l.push(s),s=Ca(s)}try{a&&(e[t]=r),r[aa]=1}catch(e){o[sa]=!1}}}return r}(this,t,e,i)||function(e,t,i){var n=t[e];return n===i&&(n=Ca(t)[e]),typeof n!==ia&&Oa("["+e+"] is not a "+ia),n}(t,e,i);return n.apply(this,arguments)};return i[ra]=1,i}(e,t)))}))}}}function Da(e,t){return Ia(e,ta)?e.name||t||ca:((e||{})[ea]||{}).name||t||ca}function Fa(e,t,i,n){Ia(e,ta)||Oa("theClass is an invalid class definition.");var r=e[ta];(function(e,t){if(ga){for(var i=[],n=Ca(t);n&&!Ta(n)&&!ka(i,n);){if(n===e)return!0;i.push(n),n=Ca(n)}return!1}return!0})(r,t)||Oa("["+Da(e)+"] not in hierarchy of ["+Da(t)+"]");var o=null;Ia(r,oa)?o=r[oa]:(o="_dynCls$"+Da(e,"_")+"$"+Aa.n,Aa.n++,r[oa]=o);var a=Fa[la],s=!!a[va];s&&n&&void 0!==n[va]&&(s=!!n[va]);var l=function(e){var t=Ra();return ba(e,(function(i){!t[i]&&wa(e,i,!1)&&(t[i]=e[i])})),t}(t),c=function(e,t,i,n){function r(e,t,i){var r=t[i];if(r[ra]&&n){var o=e[na]||{};!1!==o[sa]&&(r=(o[t[oa]]||{})[i]||r)}return function(){return r.apply(e,arguments)}}var o=Ra();ba(i,(function(e){o[e]=r(t,i,e)}));for(var a=Ca(e),s=[];a&&!Ta(a)&&!ka(s,a);)ba(a,(function(e){!o[e]&&wa(a,e,!ga)&&(o[e]=r(t,a,e))})),s.push(a),a=Ca(a);return o}(r,t,l,s);i(t,c);var u=!!ga&&!!a[fa];u&&n&&(u=!!n[fa]),Pa(r,o,t,l,!1!==u)}Fa[la]=Aa.o;var La="window",xa="JSON",Na="XMLHttpRequest",_a=null,Ma=null,Ua=null,$a=null;function za(e,t){var i=!1;if(e){try{if(!(i=t in e)){var n=e[on];n&&(i=t in n)}}catch(e){}if(!i)try{i=!eo((new e)[t])}catch(e){}}return i}function Ha(e){var t=vn();return t&&t[e]?t[e]:e===La&&Va()?window:null}function Va(){return Boolean(typeof window===nn&&window)}function Wa(){return Va()?window:Ha(La)}function Ba(){return Boolean(typeof document===nn&&document)?document:Ha("document")}function ja(){return Boolean(typeof navigator===nn&&navigator)}function Ga(){return ja()?navigator:Ha("navigator")}function Ka(e){return typeof location===nn&&location?location:Ha("location")}function qa(){return Boolean(typeof JSON===nn&&JSON||null!==Ha(xa))}function Xa(){return qa()?JSON||Ha(xa):null}function Ja(){var e=Ga();return!(!e||!e.product)&&"ReactNative"===e.product}function Ya(){var e=Ga();if(e&&(e[Yn]!==Ma||null===_a)){var t=((Ma=e[Yn])||mr).toLowerCase();_a=co(t,"msie")||co(t,"trident/")}return _a}function Qa(e){var t=Object[on].toString[or](e),i=mr;return"[object Error]"===t?i="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e[Sn]+"'":qa()&&(i=Xa().stringify(e)),t+i}function Za(){return null===$a&&($a=ja()&&Boolean(Ga().sendBeacon)),$a}function es(e){var t=!1;try{t=!!Ha("fetch");var i=Ha("Request");t&&e&&i&&(t=za(i,"keepalive"))}catch(e){}return t}function ts(){var e=!1;try{e=!!Ha(Na)}catch(e){}return e}var is,ns=["eventsSent","eventsDiscarded","eventsSendRequest","perfEvent"],rs=null;function os(e,t){return function(){var i=arguments,n=as(t);if(n){var r=n.listener;r&&r[e]&&r[e][ir](r,i)}}}function as(e){var t,i=rs;return i||!0===e.disableDbgExt||(i=rs||((t=Ha("Microsoft"))&&(rs=t.ApplicationInsights),rs)),i?i.ChromeDbgExt:null}function ss(e){if(!is){is={};for(var t=0;t<ns[wn];t++)is[ns[t]]=os(ns[t],e)}return is}function ls(e){return e?'"'+e[nr](/\"/g,mr)+'"':mr}function cs(e,t){var i=typeof console!==rn?console:Ha("console");if(i){var n="log";i[e]&&(n=e),oo(i[n])&&i[n](t)}}var us=function(){function e(e,t,i,n){void 0===i&&(i=!1);var r=this;r[$n]=e,r[zn]=(i?"AI: ":"AI (Internal): ")+e;var o=mr;qa()&&(o=Xa().stringify(n));var a=(t?" message:"+ls(t):mr)+(n?" props:"+ls(o):mr);r[zn]+=a}return e.dataType="MessageData",e}(),ds=function(){function e(t){this.identifier="DiagnosticLogger",this.queue=[];var i,n,r,o,a=0,s={};Fa(e,this,(function(e){function l(t,i){if(!(a>=r)){var o=!0,l="AITR_"+i[$n];if(s[l]?o=!1:s[l]=!0,o&&(t<=n&&(e.queue[In](i),a++,c(1===t?"error":"warn",i)),a===r)){var u="Internal events throttle limit per PageView reached for this app.",d=new us(23,u,!1);e.queue[In](d),1===t?e[Rr](u):e[kr](u)}}}function c(e,i){var n=as(t||{});n&&n[jn]&&n[jn](e,i)}!function(e){i=ko(e.loggingLevelConsole,0),n=ko(e.loggingLevelTelemetry,1),r=ko(e.maxMessageLimit,25),o=ko(e.enableDebug,ko(e[rr],!1))}(t||{}),e.consoleLoggingLevel=function(){return i},e.telemetryLoggingLevel=function(){return n},e.maxInternalMessageLimit=function(){return r},e[rr]=function(){return o},e.throwInternal=function(t,n,r,a,u){void 0===u&&(u=!1);var d=new us(n,r,u,a);if(o)throw Qa(d);var p=1===t?Rr:kr;if(eo(d[zn]))c("throw"+(1===t?"Critical":"Warning"),d);else{if(u){var h=+d[$n];!s[h]&&i>=t&&(e[p](d[zn]),s[h]=!0)}else i>=t&&e[p](d[zn]);l(t,d)}},e[kr]=function(e){cs("warn",e),c("warning",e)},e[Rr]=function(e){cs("error",e),c("error",e)},e.resetInternalMessageCount=function(){a=0,s={}},e.logInternalMessage=l}))}return e.__ieDyn=1,e}();function ps(e){return e||new ds}function hs(e,t,i,n,r,o){void 0===o&&(o=!1),ps(e).throwInternal(t,i,n,r,o)}function vs(e,t){ps(e)[kr](t)}var fs="toGMTString",ms="toUTCString",gs="cookie",Ss="expires",ys="enabled",As="isCookieUseDisabled",Is="disableCookiesUsage",Es="_ckMgr",Ts=null,Cs=null,bs=null,ws=Ba(),Os={},Rs={};function ks(e){return!e||e.isEnabled()}function Ps(e,t){return!!(t&&e&&uo(e.ignoreCookies))&&-1!==e.ignoreCookies[Xn](t)}function Ds(e,t){var i,n=function(e){var t=e[qn]=e[qn]||{};if(Oo(t,"domain",e.cookieDomain,io,to),Oo(t,"path",e.cookiePath||"/",null,to),to(t[ys])){var i=void 0;eo(e[As])||(i=!e[As]),eo(e[Is])||(i=!e[Is]),t[ys]=i}return t}(e||Rs),r=n.path||"/",o=n.domain,a=!1!==n[ys],s=((i={isEnabled:function(){var e=a&&Fs(t),i=Rs[Es];return e&&i&&s!==i&&(e=ks(i)),e}})[Zn]=function(e){a=!1!==e},i.set=function(e,t,i,a,l){var c,u=!1;if(ks(s)&&!function(e,t){return!!(t&&e&&uo(e.blockedCookies)&&-1!==e.blockedCookies[Xn](t))||Ps(e,t)}(n,e)){var d={},p=yo(t||mr),h=p[Xn](";");if(-1!==h&&(p=yo(t[Jn](0,h)),d=Ls(t[Jn](h+1))),Oo(d,"domain",a||o,Po,eo),!to(i)){var v=Ya();if(eo(d[Ss])){var f=bo()+1e3*i;if(f>0){var m=new Date;m.setTime(f),Oo(d,Ss,xs(m,v?fs:ms)||xs(m,v?fs:ms)||mr,Po)}}v||Oo(d,"max-age",mr+i,null,eo)}var g=Ka();g&&"https:"===g.protocol&&(Oo(d,"secure",null,null,eo),null===Cs&&(c=(Ga()||{})[Yn],Cs=!(po(c)&&(co(c,"CPU iPhone OS 12")||co(c,"iPad; CPU OS 12")||co(c,"Macintosh; Intel Mac OS X 10_14")&&co(c,"Version/")&&co(c,"Safari")||co(c,"Macintosh; Intel Mac OS X 10_14")&&function(e,t){var i=!1;return e&&t&&!(i=e===t)&&(i=Wr?e[Fr](t):function(e,t){var i=!1,n=t?t[wn]:0,r=e?e[wn]:0;if(n&&r&&r>=n&&!(i=e===t)){for(var o=r-1,a=n-1;a>=0;a--){if(e[o]!=t[a])return!1;o--}i=!0}return i}(e,t)),i}(c,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||co(c,"Chrome/5")||co(c,"Chrome/6")||co(c,"UnrealEngine")&&!co(c,"Chrome")||co(c,"UCBrowser/12")||co(c,"UCBrowser/11")))),Cs&&Oo(d,"SameSite","None",null,eo)),Oo(d,"path",l||r,null,eo),(n.setCookie||Ms)(e,Ns(p,d)),u=!0}return u},i.get=function(e){var t=mr;return ks(s)&&!Ps(n,e)&&(t=(n.getCookie||_s)(e)),t},i.del=function(e,t){var i=!1;return ks(s)&&(i=s.purge(e,t)),i},i.purge=function(e,i){var r,o=!1;if(Fs(t)){var a=((r={}).path=i||"/",r[Ss]="Thu, 01 Jan 1970 00:00:01 GMT",r);Ya()||(a["max-age"]="0"),(n.delCookie||Ms)(e,Ns(mr,a)),o=!0}return o},i);return s[Es]=s,s}function Fs(e){if(null===Ts){Ts=!1;try{Ts=void 0!==(ws||{})[gs]}catch(t){hs(e,2,68,"Cannot access document.cookie - "+wo(t),{exception:Qa(t)})}}return Ts}function Ls(e){var t={};return e&&e[wn]&&go(yo(e)[Qn](";"),(function(e){if(e=yo(e||mr)){var i=e[Xn]("=");-1===i?t[e]=null:t[yo(e[Jn](0,i))]=yo(e[Jn](i+1))}})),t}function xs(e,t){return oo(e[t])?e[t]():null}function Ns(e,t){var i=e||mr;return so(t,(function(e,t){i+="; "+e+(to(t)?mr:"="+t)})),i}function _s(e){var t=mr;if(ws){var i=ws[gs]||mr;bs!==i&&(Os=Ls(i),bs=i),t=yo(Os[e]||mr)}return t}function Ms(e,t){ws&&(ws[gs]=e+"="+t)}var Us=4294967296,$s=4294967295,zs=!1,Hs=123456789,Vs=987654321;function Ws(){try{var e=2147483647&bo();(t=(Math.random()*Us^e)+e)<0&&(t>>>=0),Hs=123456789+t&$s,Vs=987654321-t&$s,zs=!0}catch(e){}var t}function Bs(e){var t=0,i=Ha("crypto")||Ha("msCrypto");return i&&i.getRandomValues&&(t=i.getRandomValues(new Uint32Array(1))[0]&$s),0===t&&Ya()&&(zs||Ws(),t=function(e){var t=((Vs=36969*(65535&Vs)+(Vs>>16)&$s)<<16)+(65535&(Hs=18e3*(65535&Hs)+(Hs>>16)&$s))>>>0&$s;return e||(t>>>=0),t}()&$s),0===t&&(t=Math.floor(Us*Math.random()|0)),e||(t>>>=0),t}var js=dn,Gs="2.8.18",Ks="."+function(e){void 0===e&&(e=22);for(var t=Bs()>>>0,i=0,n=mr;n[wn]<e;)i++,n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(63&t),t>>>=6,5===i&&(t=(Bs()<<2&4294967295|3&t)>>>0,i=0);return n}(6),qs=0;function Xs(e){return 1===e[tr]||9===e[tr]||!+e[tr]}function Js(e,t){return void 0===t&&(t=!1),ao(e+qs+++(t?"."+Gs:mr)+Ks)}function Ys(e){var t={id:Js("_aiData-"+(e||mr)+"."+Gs),accept:function(e){return Xs(e)},get:function(e,i,n,r){var o=e[t.id];return o?o[ao(i)]:(r&&((o=function(e,t){var i=t[e.id];if(!i){i={};try{Xs(t)&&(function(e,t,i){if(js)try{return js(e,t,{value:i,enumerable:!1,configurable:!0}),!0}catch(e){}return!1}(t,e.id,i)||(t[e.id]=i))}catch(e){}}return i}(t,e))[ao(i)]=n),n)},kill:function(e,t){if(e&&e[t])try{delete e[t]}catch(e){}}};return t}var Qs="attachEvent",Zs="addEventListener",el="detachEvent",tl="removeEventListener",il="events",nl="visibilitychange",rl="pagehide",ol="pageshow",al="unload",sl="beforeunload",ll=Js("aiEvtPageHide"),cl=Js("aiEvtPageShow"),ul=/\.[\.]+/g,dl=/[\.]+$/,pl=1,hl=Ys("events"),vl=/^([^.]*)(?:\.(.+)|)/;function fl(e){return e&&e[nr]?e[nr](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,mr):e}function ml(e,t){var i;if(t){var n=mr;uo(t)?(n=mr,go(t,(function(e){(e=fl(e))&&("."!==e[0]&&(e="."+e),n+=e)}))):n=fl(t),n&&("."!==n[0]&&(n="."+n),e=(e||mr)+n)}var r=vl.exec(e||mr)||[];return(i={})[ar]=r[1],i.ns=(r[2]||mr).replace(ul,".").replace(dl,mr)[Qn](".").sort().join("."),i}function gl(e,t,i){void 0===i&&(i=!0);var n=hl.get(e,il,{},i),r=n[t];return r||(r=n[t]=[]),r}function Sl(e,t,i,n){e&&t&&t[ar]&&(e[tl]?e[tl](t[ar],i,n):e[el]&&e[el]("on"+t[ar],i))}function yl(e,t,i,n){for(var r=t[wn];r--;){var o=t[r];o&&(i.ns&&i.ns!==o.evtName.ns||n&&!n(o)||(Sl(e,o.evtName,o[sr],o.capture),t[Mn](r,1)))}}function Al(e,t){return t?ml("xx",uo(t)?[e].concat(t):[e,t]).ns[Qn]("."):e}function Il(e,t,i,n,r){var o;void 0===r&&(r=!1);var a=!1;if(e)try{var s=ml(t,n);if(a=function(e,t,i,n){var r=!1;return e&&t&&t[ar]&&i&&(e[Zs]?(e[Zs](t[ar],i,n),r=!0):e[Qs]&&(e[Qs]("on"+t[ar],i),r=!0)),r}(e,s,i,r),a&&hl.accept(e)){var l=((o={guid:pl++,evtName:s})[sr]=i,o.capture=r,o);gl(e,s.type)[In](l)}}catch(e){}return a}function El(e,t,i,n,r){if(void 0===r&&(r=!1),e)try{var o=ml(t,n),a=!1;!function(e,t,i){if(t[ar])yl(e,gl(e,t[ar]),t,i);else{var n=hl.get(e,il,{});so(n,(function(n,r){yl(e,r,t,i)})),0===Eo(n)[wn]&&hl.kill(e,il)}}(e,o,(function(e){return!((!o.ns||i)&&e[sr]!==i||(a=!0,0))})),a||Sl(e,o,i,r)}catch(e){}}function Tl(e,t,i,n){var r=!1;return t&&e&&e[wn]>0&&go(e,(function(e){e&&(i&&-1!==So(i,e)||(r=function(e,t,i){var n=!1,r=Wa();r&&(n=Il(r,e,t,i),n=Il(r.body,e,t,i)||n);var o=Ba();return o&&(n=Il(o,e,t,i)||n),n}(e,t,n)||r))})),r}function Cl(e,t,i){e&&uo(e)&&go(e,(function(e){e&&function(e,t,i){var n=Wa();n&&(El(n,e,t,i),El(n.body,e,t,i));var r=Ba();r&&El(r,e,t,i)}(e,t,i)}))}function bl(e,t,i){var n=Al(ll,i),r=Tl([rl],e,t,n);return t&&-1!==So(t,nl)||(r=Tl([nl],(function(t){var i=Ba();e&&i&&"hidden"===i.visibilityState&&e(t)}),t,n)||r),!r&&t&&(r=bl(e,null,i)),r}function wl(e,t,i){var n=Al(cl,i),r=Tl([ol],e,t,n);return!(r=Tl([nl],(function(t){var i=Ba();e&&i&&"visible"===i.visibilityState&&e(t)}),t,n)||r)&&t&&(r=wl(e,null,i)),r}function Ol(){var e=function(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],i=mr,n=0;n<4;n++)i+=t[15&(e=Bs())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var r=t[8+(3&Bs())|0];return i[er](0,8)+i[er](9,4)+"4"+i[er](13,3)+r+i[er](16,3)+i[er](19,12)}();return e[Jn](0,8)+"-"+e[Jn](8,12)+"-"+e[Jn](12,16)+"-"+e[Jn](16,20)+"-"+e[Jn](20)}var Rl=((vn()||{}).Symbol,(vn()||{}).Reflect,function(e,t){return Rl=sn.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t[an](i)&&(e[i]=t[i])},Rl(e,t)});function kl(e,t){function i(){this.constructor=e}typeof t!==tn&&null!==t&&fn("Class extends value "+String(t)+" is not a constructor or null"),Rl(e,t),e[on]=null===t?mn(t):(i[on]=t[on],new i)}function Pl(e,t){for(var i=0,n=t.length,r=e.length;i<n;i++,r++)e[r]=t[i];return e}var Dl="ctx",Fl="ParentContextKey",Ll="ChildrenContextKey",xl=function(){function e(t,i,n){var r,o=this,a=!1;o.start=bo(),o[Sn]=t,o[Hn]=n,o[cr]=function(){return!1},oo(i)&&(a=To(o,"payload",(function(){return!r&&oo(i)&&(r=i(),i=null),r}))),o[ur]=function(t){return t?t===e[Fl]||t===e[Ll]?o[t]:(o[Dl]||{})[t]:null},o[dr]=function(t,i){t&&(t===e[Fl]?(o[t]||(o[cr]=function(){return!0}),o[t]=i):t===e[Ll]?o[t]=i:(o[Dl]=o[Dl]||{})[t]=i)},o[pr]=function(){var t=0,n=o[ur](e[Ll]);if(uo(n))for(var r=0;r<n[wn];r++){var s=n[r];s&&(t+=s[On])}o[On]=bo()-o.start,o.exTime=o[On]-t,o[pr]=function(){},!a&&oo(i)&&(o.payload=i())}}return e.ParentContextKey="parent",e.ChildrenContextKey="childEvts",e}(),Nl=function(){function e(t){this.ctx={},Fa(e,this,(function(e){e.create=function(e,t,i){return new xl(e,t,i)},e.fire=function(e){e&&(e[pr](),t&&oo(t[Or])&&t[Or](e))},e[dr]=function(t,i){t&&((e[Dl]=e[Dl]||{})[t]=i)},e[ur]=function(t){return(e[Dl]||{})[t]}}))}return e.__ieDyn=1,e}(),_l="CoreUtils.doPerf";function Ml(e,t,i,n,r){if(e){var o=e;if(o[Pr]&&(o=o[Pr]()),o){var a=void 0,s=o[ur](_l);try{if(a=o.create(t(),n,r)){if(s&&a[dr]&&(a[dr](xl[Fl],s),s[ur]&&s[dr])){var l=s[ur](xl[Ll]);l||(l=[],s[dr](xl[Ll],l)),l[In](a)}return o[dr](_l,a),i(a)}}catch(e){a&&a[dr]&&a[dr]("exception",e)}finally{a&&o.fire(a),o[dr](_l,s)}}}return i()}function Ul(e,t,i){return!(!e||e[wn]!==t||e===i||!e.match(/^[\da-f]*$/i))}var $l=Ys("plugin");function zl(e){return $l.get(e,"state",{},!0)}function Hl(e,t){for(var i,n=[],r=null,o=e[Bn]();o;){var a=o[xn]();a&&(r&&oo(r[Gn])&&oo(a[Er])&&r[Gn](a),(oo(a[En])?a[En]():(i=zl(a))[En])||n[In](a),r=a,o=o[Bn]())}go(n,(function(n){var r=e[Sr]();n[gn](e.getCfg(),r,t,e[Bn]()),i=zl(n),n[Sr]||i[Sr]||(i[Sr]=r),i[En]=!0,delete i[Un]}))}function Vl(e){return e.sort((function(e,t){var i=0;if(t){var n=oo(t[Er]);oo(e[Er])?i=n?e[Tr]-t[Tr]:1:n&&(i=-1)}else i=e?1:-1;return i}))}var Wl="_hasRun",Bl="_getTelCtx",jl=0;function Gl(e,t,i,n){var r=null,o=[];null!==n&&(r=n?function(e,t,i){for(;e;){if(e[xn]()===i)return e;e=e[Bn]()}return Jl([i],t[Tn]||{},t)}(e,i,n):e);var a={_next:function(){var e=r;if(r=e?e[Bn]():null,!e){var t=o;t&&t[wn]>0&&(go(t,(function(e){try{e.func[or](e.self,e.args)}catch(e){hs(i[bn],2,73,"Unexpected Exception during onComplete - "+Qa(e))}})),o=[])}return e},ctx:{core:function(){return i},diagLog:function(){return function(e,t){return(e||{})[bn]||new ds(t)}(i,t)},getCfg:function(){return t},getExtCfg:s,getConfig:function(e,i,n){void 0===n&&(n=!1);var r,o=s(e,null);return o&&!to(o[i])?r=o[i]:t&&!to(t[i])&&(r=t[i]),to(r)?n:r},hasNext:function(){return!!r},getNext:function(){return r},setNext:function(e){r=e},iterate:function(e){for(var t;t=a._next();){var i=t[xn]();i&&e(i)}},onComplete:function(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];e&&o[In]({func:e,self:eo(t)?a.ctx:t,args:i})}}};function s(e,i,n){var r;if(void 0===i&&(i={}),void 0===n&&(n=0),t){var o=t[Ir];o&&e&&(r=o[e])}if(r){if(ro(i)&&0!==n){var a=xo(!0,i,r);t&&2===n&&so(i,(function(e){if(to(a[e])){var i=t[e];to(i)||(a[e]=i)}})),r=a}}else r=i;return r}return a}function Kl(e,t,i,n){var r=Gl(e,t,i,n),o=r.ctx;return o[Rn]=function(e){var t=r._next();return t&&t[Er](e,o),!t},o[Kn]=function(e,n){return void 0===e&&(e=null),uo(e)&&(e=Jl(e,t,i,n)),Kl(e||o[Bn](),t,i,n)},o}function ql(e,t,i){var n=t[Tn]||{},r=Gl(e,n,t,i),o=r.ctx;return o[Rn]=function(e){var t=r._next();return t&&t.unload(o,e),!t},o[Kn]=function(e,i){return void 0===e&&(e=null),uo(e)&&(e=Jl(e,n,t,i)),ql(e||o[Bn](),t,i)},o}function Xl(e,t,i){var n=t[Tn]||{},r=Gl(e,n,t,i).ctx;return r[Rn]=function(e){return r.iterate((function(t){oo(t[Wn])&&t[Wn](r,e)}))},r[Kn]=function(e,i){return void 0===e&&(e=null),uo(e)&&(e=Jl(e,n,t,i)),Xl(e||r[Bn](),t,i)},r}function Jl(e,t,i,n){var r=null,o=!n;if(uo(e)&&e[wn]>0){var a=null;go(e,(function(e){if(o||n!==e||(o=!0),o&&e&&oo(e[Er])){var s=function(e,t,i){var n,r=null,o=oo(e[Er]),a=oo(e[Gn]),s={getPlugin:function(){return e},getNext:function(){return r},processTelemetry:function(n,c){l(c=c||function(){var n;return e&&oo(e[Bl])&&(n=e[Bl]()),n||(n=Kl(s,t,i)),n}(),(function(t){if(!e||!o)return!1;var i=zl(e);return!i[Un]&&!i[Ar]&&(a&&e[Gn](r),e[Er](n,t),!0)}),"processTelemetry",(function(){return{item:n}}),!n.sync)||c[Rn](n)},unload:function(t,i){l(t,(function(){var n=!1;if(e){var r=zl(e),o=e[Sr]||r[Sr];!e||o&&o!==t.core()||r[Un]||(r[Sr]=null,r[Un]=!0,r[En]=!1,e[Un]&&!0===e[Un](t,i)&&(n=!0))}return n}),"unload",(function(){}),i[Hn])||t[Rn](i)},update:function(t,i){l(t,(function(){var n=!1;if(e){var r=zl(e),o=e[Sr]||r[Sr];!e||o&&o!==t.core()||r[Un]||e[Wn]&&!0===e[Wn](t,i)&&(n=!0)}return n}),"update",(function(){}),!1)||t[Rn](i)},_id:n=e?e[An]+"-"+e[Tr]+"-"+jl++:"Unknown-0-"+jl++,_setNext:function(e){r=e}};function l(t,i,o,a,s){var l=!1,c=e?e[An]:"TelemetryPluginChain",u=t[Wl];return u||(u=t[Wl]={}),t.setNext(r),e&&Ml(t[Sr](),(function(){return c+":"+o}),(function(){u[n]=!0;try{var e=r?r._id:mr;e&&(u[e]=!1),l=i(t)}catch(e){var a=!r||u[r._id];a&&(l=!0),r&&a||hs(t[jn](),1,73,"Plugin ["+c+"] failed during "+o+" - "+Qa(e)+", run flags: "+Qa(u))}}),a,s),l}return Co(s)}(e,t,i);r||(r=s),a&&a._setNext(s),a=s}}))}return n&&!r?Jl([n],t,i):r}var Yl=500;function Ql(e,t,i){t&&uo(t)&&t[wn]>0&&(go(t=t.sort((function(e,t){return e[Tr]-t[Tr]})),(function(e){e[Tr]<Yl&&Do("Channel has invalid priority - "+e[An])})),e[In]({queue:Co(t),chain:Jl(t,i[Tn],i)}))}function Zl(){var e=[];return{add:function(t){t&&e[In](t)},run:function(t,i){go(e,(function(e){try{e(t,i)}catch(e){hs(t[jn](),2,73,"Unexpected error calling unload handler - "+Qa(e))}})),e=[]}}}var ec="getPlugin",tc=function(){function e(){var t,i,n,r,o,a=this;function s(e){void 0===e&&(e=null);var t=e;if(!t){var r=i||Kl(null,{},a[Sr]);t=n&&n[ec]?r[Kn](null,n[ec]):r[Kn](null,n)}return t}function l(e,t,r){e&&Oo(e,Ir,[],null,to),!r&&t&&(r=t[kn]()[Bn]());var o=n;n&&n[ec]&&(o=n[ec]()),a[Sr]=t,i=Kl(r,e,t,o)}function c(){t=!1,a[Sr]=null,i=null,n=null,o=[],r=Zl()}c(),Fa(e,a,(function(e){e[gn]=function(e,i,n,r){l(e,i,r),t=!0},e[Un]=function(t,i){var a,s=e[Sr];if(s&&(!t||s===t[Sr]())){var l,u=!1,d=t||ql(null,s,n&&n[ec]?n[ec]():n),p=i||((a={reason:0})[Hn]=!1,a);return e[Vn]&&!0===e[Vn](d,p,h)?l=!0:h(),l}function h(){if(!u){u=!0,r.run(d,i);var e=o;o=[],go(e,(function(e){e.rm()})),!0===l&&d[Rn](p),c()}}},e[Wn]=function(t,i){var r=e[Sr];if(r&&(!t||r===t[Sr]())){var o,a=!1,s=t||Xl(null,r,n&&n[ec]?n[ec]():n),c=i||{reason:0};return e._doUpdate&&!0===e._doUpdate(s,c,u)?o=!0:u(),o}function u(){a||(a=!0,l(s.getCfg(),s.core(),s[Bn]()))}},e._addHook=function(e){e&&(uo(e)?o=o.concat(e):o[In](e))},Fo(e,"_addUnloadCb",(function(){return r}),"add")})),a[jn]=function(e){return s(e)[jn]()},a[En]=function(){return t},a.setInitialized=function(e){t=e},a[Gn]=function(e){n=e},a[Rn]=function(e,t){t?t[Rn](e):n&&oo(n[Er])&&n[Er](e,null)},a._getTelCtx=s}return e.__ieDyn=1,e}(),ic=function(e){function t(){var i,n,r=e.call(this)||this;function o(){i=0,n=[]}return r.identifier="TelemetryInitializerPlugin",r.priority=199,o(),Fa(t,r,(function(e,t){e.addTelemetryInitializer=function(e){var t={id:i++,fn:e};return n[In](t),{remove:function(){go(n,(function(e,i){if(e.id===t.id)return n[Mn](i,1),-1}))}}},e[Er]=function(t,i){for(var r=!1,o=n[wn],a=0;a<o;++a){var s=n[a];if(s)try{if(!1===s.fn[ir](null,[t])){r=!0;break}}catch(e){hs(i[jn](),1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+wo(e),{exception:Qa(e)},!0)}}r||e[Rn](t,i)},e[Vn]=function(){o()}})),r}return kl(t,e),t.__ieDyn=1,t}(tc),nc="Plugins must provide initialize method",rc="_notificationManager",oc="SDK is still unloading...",ac={loggingLevelConsole:1};function sc(e,t){return new Nl(t)}function lc(e,t){var i=!1;return go(t,(function(t){if(t===e)return i=!0,-1})),i}var cc=function(){function e(){var t,i,n,r,o,a,s,l,c,u,d,p,h,v,f,m,g,S,y,A,I=0,E=!1;Fa(e,this,(function(e){function T(i){if(!I&&!E&&(i||e[bn]&&e[bn].queue[wn]>0)){var n=ko(t.diagnosticLogInterval);n&&n>0||(n=1e4),I=setInterval((function(){clearInterval(I),I=0,P()}),n)}return I}function C(){i=!1,t=xo(!0,{},ac),e[Tn]=t,e[bn]=new ds(t),e[_n]=[],f=new ic,n=[],r=null,o=null,a=null,s=null,l=null,u=null,c=[],d=null,p=null,h=null,v=!1,m=null,g=Js("AIBaseCore",!0),S=Zl(),A=null}function b(){var i=Kl(R(),t,e);return i[Ln](T),i}function w(i){var n=function(e,t,i){var n,r=[],o={};return go(i,(function(t){(to(t)||to(t[gn]))&&Do(nc);var i=t[Tr],n=t[An];t&&i&&(to(o[i])?o[i]=n:vs(e,"Two extensions have same priority #"+i+" - "+o[i]+", "+n)),(!i||i<500)&&r[In](t)})),(n={all:i})[Sr]=r,n}(e[bn],0,c);u=n[Sr],l=null;var r=n.all;if(h=Co(function(e,t,i){var n=[];if(e&&go(e,(function(e){return Ql(n,e,i)})),t){var r=[];go(t,(function(e){e[Tr]>Yl&&r[In](e)})),Ql(n,r,i)}return n}(p,r,e)),d){var o=So(r,d);-1!==o&&r[Mn](o,1),-1!==(o=So(u,d))&&u[Mn](o,1),d._setQueue(h)}else d=function(e,t){function i(){return Kl(null,t[Tn],t,null)}function n(e,t,i,n){var r=e?e[wn]+1:1;function o(){0==--r&&(n&&n(),n=null)}r>0&&go(e,(function(e){if(e&&e.queue[wn]>0){var n=e.chain,a=t[Kn](n);a[Ln](o),i(a)}else r--})),o()}var r=!1,o={identifier:"ChannelControllerPlugin",priority:Yl,initialize:function(t,i,n,o){r=!0,go(e,(function(e){e&&e.queue[wn]>0&&Hl(Kl(e.chain,t,i),n)}))},isInitialized:function(){return r},processTelemetry:function(t,r){n(e,r||i(),(function(e){e[Rn](t)}),(function(){r[Rn](t)}))},update:function(t,i){var r=i||{reason:0};return n(e,t,(function(e){e[Rn](r)}),(function(){t[Rn](r)})),!0},pause:function(){n(e,i(),(function(e){e.iterate((function(e){e.pause&&e.pause()}))}),null)},resume:function(){n(e,i(),(function(e){e.iterate((function(e){e.resume&&e.resume()}))}),null)},teardown:function(t,i){var o=i||{reason:0,isAsync:!1};return n(e,t,(function(e){e[Rn](o)}),(function(){t[Rn](o),r=!1})),!0},getChannel:function(t){var i=null;return e&&e[wn]>0&&go(e,(function(e){if(e&&e.queue[wn]>0&&(go(e.queue,(function(e){if(e[An]===t)return i=e,-1})),i))return-1})),i},flush:function(t,r,o,a){var s=1,l=!1,c=null;function u(){s--,l&&0===s&&(c&&(clearTimeout(c),c=null),r&&r(l),r=null)}return a=a||5e3,n(e,i(),(function(e){e.iterate((function(e){if(e[Nn]){s++;var i=!1;e[Nn](t,(function(){i=!0,u()}),o)||i||(t&&null==c?c=setTimeout((function(){c=null,u()}),a):u())}}))}),(function(){l=!0,u()})),!0},_setQueue:function(t){e=t}};return o}(h,e);r[In](d),u[In](d),e[_n]=Vl(r),d[gn](t,e,r),Hl(b(),r),e[_n]=Co(Vl(u||[])).slice(),i&&function(t){var i=Xl(R(),e);i[Ln](T),e._updateHook&&!0===e._updateHook(i,t)||i[Rn](t)}(i)}function O(t){var i,n=null,r=null;return go(e[_n],(function(e){if(e[An]===t&&e!==d&&e!==f)return r=e,-1})),!r&&d&&(r=d.getChannel(t)),r&&((i={plugin:r})[Zn]=function(e){zl(r)[Ar]=!e},i.isEnabled=function(){var e=zl(r);return!e[Un]&&!e[Ar]},i.remove=function(e,t){var i;void 0===e&&(e=!0);var n=[r],o=((i={reason:1})[Hn]=e,i);k(n,o,(function(e){e&&w({reason:32,removed:n}),t&&t(e)}))},n=i),n}function R(){if(!l){var i=(u||[]).slice();-1===So(i,f)&&i[In](f),l=Jl(Vl(i),t,e)}return l}function k(i,n,r){if(i&&i[wn]>0){var o=ql(Jl(i,t,e),e);o[Ln]((function(){var e=!1,t=[];go(c,(function(n,r){lc(n,i)?e=!0:t[In](n)})),c=t;var n=[];p&&(go(p,(function(t,r){var o=[];go(t,(function(t){lc(t,i)?e=!0:o[In](t)})),n[In](o)})),p=n),r&&r(e),T()})),o[Rn](n)}else r(!1)}function P(){if(e[bn]&&e[bn].queue){var i=e[bn].queue.slice(0);e[bn].queue[wn]=0,go(i,(function(i){var n,r=((n={})[Sn]=m||"InternalMessageId: "+i[$n],n.iKey=ko(t[Cn]),n.time=mo(new Date),n.baseType=us.dataType,n.baseData={message:i[zn]},n);e.track(r)}))}}function D(e,t,i,n){return d?d[Nn](e,t,i||6,n):(t&&t(!1),!0)}function F(t){var i=e[bn];i?(hs(i,2,73,t),T()):Do(t)}var L,x,N,_;C(),e[En]=function(){return i},e[gn]=function(n,o,s,l){var u,d;v&&Do(oc),e[En]()&&Do("Core should not be initialized more than once"),t=n||{},e[Tn]=t,to(n[Cn])&&Do("Please provide instrumentation key"),r=l,e[rc]=l,!0===(d=ko(t.disableDbgExt))&&y&&(r[Dn](y),y=null),r&&!y&&!0!==d&&(y=ss(t),r[Pn](y)),!(u=ko(t.enablePerfMgr))&&a&&(a=null),u&&Ro(t,yr,sc),Ro(t,Ir,{}).NotificationManager=r,s&&(e[bn]=s);var f=Ro(t,"extensions",[]);(c=[])[In].apply(c,Pl(Pl([],o),f)),p=Ro(t,gr,[]),w(null),h&&0!==h[wn]||Do("No "+gr+" available"),i=!0,e.releaseQueue()},e.getTransmissionControls=function(){var e=[];return h&&go(h,(function(t){e[In](t.queue)})),Co(e)},e.track=function(i){i.iKey=i.iKey||t[Cn],i[On]=i[On]||mo(new Date),i.ver=i.ver||"4.0",!v&&e[En]()?b()[Rn](i):n[In](i)},e[kn]=b,e[yn]=function(){return r||(r=function(){var e;return mn(((e={})[Pn]=function(e){},e[Dn]=function(e){},e[Cr]=function(e){},e[br]=function(e,t){},e[wr]=function(e,t){},e))}(),e[rc]=r),r},e[Pn]=function(e){r&&r[Pn](e)},e[Dn]=function(e){r&&r[Dn](e)},e.getCookieMgr=function(){return s||(s=Ds(t,e[bn])),s},e.setCookieMgr=function(e){s=e},e[Pr]=function(){if(!o&&!a&&ko(t.enablePerfMgr)){var i=ko(t[yr]);oo(i)&&(a=i(e,e[yn]()))}return o||a||null},e.setPerfMgr=function(e){o=e},e.eventCnt=function(){return n[wn]},e.releaseQueue=function(){if(i&&n[wn]>0){var e=n;n=[],go(e,(function(e){b()[Rn](e)}))}},e.pollInternalLogs=function(e){return m=e||null,E=!1,I&&(clearInterval(I),I=null),T(!0)},e[Fn]=function(){E=!0,I&&(clearInterval(I),I=0,P())},x=function(){return f},N=["addTelemetryInitializer"],(L=e)&&x&&ro(L)&&uo(N)&&go(N,(function(e){po(e)&&Fo(L,e,x,e,_)})),e.unload=function(t,n,r){var o;void 0===t&&(t=!0),i||Do("SDK is not initialized"),v&&Do(oc);var a=((o={reason:50})[Hn]=t,o.flushComplete=!1,o),s=ql(R(),e);function l(t){a.flushComplete=t,v=!0,S.run(s,a),e[Fn](),s[Rn](a)}s[Ln]((function(){C(),n&&n(a)}),e),P(),D(t,l,6,r)||l(!1)},e[xn]=O,e.addPlugin=function(e,t,i,n){if(!e)return n&&n(!1),void F(nc);var r=O(e[An]);if(r&&!t)return n&&n(!1),void F("Plugin ["+e[An]+"] is already loaded!");var o={reason:16};function a(t){c[In](e),o.added=[e],w(o),n&&n(!0)}if(r){var s=[r.plugin];k(s,{reason:2,isAsync:!!i},(function(e){e?(o.removed=s,o.reason|=32,a()):n&&n(!1)}))}else a()},e.evtNamespace=function(){return g},e[Nn]=D,e.getTraceCtx=function(e){var t;return A||(t={},A={getName:function(){return t[Sn]},setName:function(e){t[Sn]=e},getTraceId:function(){return t[hr]},setTraceId:function(e){Ul(e,32,"00000000000000000000000000000000")&&(t[hr]=e)},getSpanId:function(){return t[vr]},setSpanId:function(e){Ul(e,16,"0000000000000000")&&(t[vr]=e)},getTraceFlags:function(){return t[fr]},setTraceFlags:function(e){t[fr]=e}}),A},e.setTraceCtx=function(e){A=e||null},Fo(e,"addUnloadCb",(function(){return S}),"add")}))}return e.__ieDyn=1,e}();function uc(e,t,i,n){go(e,(function(e){if(e&&e[t])if(i)setTimeout((function(){return n(e)}),0);else try{n(e)}catch(e){}}))}var dc,pc=function(){function e(t){this.listeners=[];var i=!!(t||{}).perfEvtsSendAll;Fa(e,this,(function(e){e[Pn]=function(t){e.listeners[In](t)},e[Dn]=function(t){for(var i=So(e[lr],t);i>-1;)e.listeners[Mn](i,1),i=So(e[lr],t)},e[Cr]=function(t){uc(e[lr],Cr,!0,(function(e){e[Cr](t)}))},e[br]=function(t,i){uc(e[lr],br,!0,(function(e){e[br](t,i)}))},e[wr]=function(t,i){uc(e[lr],wr,i,(function(e){e[wr](t,i)}))},e[Or]=function(t){t&&(!i&&t[cr]()||uc(e[lr],Or,!1,(function(e){t[Hn]?setTimeout((function(){return e[Or](t)}),0):e[Or](t)})))}}))}return e.__ieDyn=1,e}(),hc=function(e){function t(){var i=e.call(this)||this;return Fa(t,i,(function(e,t){function i(t){var i=e[yn]();i&&i[br]([t],2)}e[gn]=function(e,i,n,r){t[gn](e,i,n||new ds(e),r||new pc(e))},e.track=function(n){Ml(e[Pr](),(function(){return"AppInsightsCore:track"}),(function(){null===n&&(i(n),Do("Invalid telemetry item")),function(e){to(e[Sn])&&(i(e),Do("telemetry name required"))}(n),t.track(n)}),(function(){return{item:n}}),!n.sync)}})),i}return kl(t,e),t.__ieDyn=1,t}(cc),vc="version",fc="properties",mc="1DS-Web-JS-3.2.18",gc="withCredentials",Sc=((dc={})[0]=0,dc[2]=6,dc[1]=1,dc[3]=7,dc[4098]=6,dc[4097]=1,dc[4099]=7,dc);function yc(e){return!(""===e||to(e))}function Ac(e,t,i){var n=-1;if(!eo(e))if(t>0&&(32===t?n=8192:t<=13&&(n=t<<5)),function(e){return e>=0&&e<=9}(i))-1===n&&(n=0),n|=i;else{var r=Sc[Cc(e)]||-1;-1!==n&&-1!==r?n|=r:6===r&&(n=r)}return n}function Ic(e,t,i,n,r){var o={},a=!1,s=0,l=arguments.length,c=arguments;for("[object Boolean]"===Object[on].toString.call(c[0])&&(a=c[0],s++);s<l;s++)so(c[s],(function(e,t){a&&t&&ro(t)?uo(t)?(o[e]=o[e]||[],go(t,(function(t,i){t&&ro(t)?o[e][i]=Ic(!0,o[e][i],t):o[e][i]=t}))):o[e]=Ic(!0,o[e],t):o[e]=t}));return o}Boolean(Ba()),Boolean(Wa());var Ec=function(){var e=Ha("performance");return e&&e.now?e.now():bo()};function Tc(e,t){var i=e;i.timings=i.timings||{},i.timings.processTelemetryStart=i.timings.processTelemetryStart||{},i.timings.processTelemetryStart[t]=Ec()}function Cc(e){var t=0;if(null!=e){var i=typeof e;"string"===i?t=1:"number"===i?t=2:"boolean"===i?t=3:i===nn&&(t=4,uo(e)?(t=4096,e.length>0&&(t|=Cc(e[0]))):pn.call(e,"value")&&(t=8192|Cc(e.value)))}return t}var bc=function(e){function t(){var i=e.call(this)||this;return i.pluginVersionStringArr=[],Fa(t,i,(function(e,t){e.logger&&e.logger.queue||(e.logger=new ds({loggingLevelConsole:1})),e.initialize=function(i,n,r,o){Ml(e,(function(){return"AppInsightsCore.initialize"}),(function(){var a=e.pluginVersionStringArr;if(i){i.endpointUrl||(i.endpointUrl="https://browser.events.data.microsoft.com/OneCollector/1.0/");var s=i.propertyStorageOverride;!s||s.getProperty&&s.setProperty||Do("Invalid property storage override passed."),i.channels&&go(i.channels,(function(e){e&&go(e,(function(e){if(e.identifier&&e.version){var t=e.identifier+"="+e.version;a.push(t)}}))}))}e.getWParam=function(){return"undefined"!=typeof document||i.enableWParam?0:-1},n&&go(n,(function(e){if(e&&e.identifier&&e.version){var t=e.identifier+"="+e.version;a.push(t)}})),e.pluginVersionString=a.join(";"),e.pluginVersionStringArr=a;try{t.initialize(i,n,r,o),e.pollInternalLogs("InternalLog")}catch(t){var l=e.logger,c=Qa(t);-1!==c.indexOf("channels")&&(c+="\n - Channels must be provided through config.channels only!"),hs(l,1,514,"SDK Initialization Failed - no telemetry will be sent: "+c)}}),(function(){return{config:i,extensions:n,logger:r,notificationManager:o}}))},e.track=function(i){Ml(e,(function(){return"AppInsightsCore.track"}),(function(){var n,r=i;if(r){r.timings=r.timings||{},r.timings.trackStart=Ec(),(n=r.latency)&&ho(n)&&n>=1&&n<=4||(r.latency=1);var o=r.ext=r.ext||{};o.sdk=o.sdk||{},o.sdk.ver=mc;var a=r.baseData=r.baseData||{};a[fc]=a[fc]||{};var s=a[fc];s[vc]=s[vc]||e.pluginVersionString||""}t.track(r)}),(function(){return{item:i}}),!i.sync)}})),i}return kl(t,e),t.__ieDyn=1,t}(hc);const wc=bc;var Oc,Rc,kc=(Rc={},so({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},(function(e,t){Rc[e]=t,Rc[t]=e})),Oc=Rc,$r&&so(Oc,(function(e,t){(uo(t)||ro(t))&&$r(t)})),Co(Oc)),Pc="REAL_TIME",Dc="",Fc="POST",Lc="drop",xc="requeue",Nc="application/x-json-stream",_c="cache-control",Mc="content-type",Uc="kill-duration",$c="time-delta-millis",zc="client-version",Hc="client-id",Vc="time-delta-to-apply-millis",Wc="upload-time",Bc="apikey",jc="AuthMsaDeviceTicket",Gc="AuthXToken",Kc="msfpc",qc="trace",Xc="user";function Jc(e){var t=(e.ext||{}).intweb;return t&&yc(t[Kc])?t[Kc]:null}function Yc(e){for(var t=null,i=0;null===t&&i<e.length;i++)t=Jc(e[i]);return t}var Qc=function(){function e(t,i){var n=i?[].concat(i):[],r=this,o=Yc(n);r.iKey=function(){return t},r.Msfpc=function(){return o||Dc},r.count=function(){return n.length},r.events=function(){return n},r.addEvent=function(e){return!!e&&(n.push(e),o||(o=Jc(e)),!0)},r.split=function(i,r){var a;if(i<n.length){var s=n.length-i;to(r)||(s=r<s?r:s),a=n.splice(i,s),o=Yc(n)}return new e(t,a)}}return e.create=function(t,i){return new e(t,i)},e}();const Zc=function(){function e(){var t=!0,i=!0,n=!0,r="use-collector-delta",o=!1;Fa(e,this,(function(e){e.allowRequestSending=function(){return t},e.firstRequestSent=function(){n&&(n=!1,o||(t=!1))},e.shouldAddClockSkewHeaders=function(){return i},e.getClockSkewHeaderValue=function(){return r},e.setClockSkew=function(e){o||(e?(r=e,i=!0,o=!0):i=!1,t=!0)}}))}return e.__ieDyn=1,e}();var eu=function(){function e(){var t={};Fa(e,this,(function(e){e.setKillSwitchTenants=function(e,i){if(e&&i)try{var n=function(e){var t=[];return e&&go(e,(function(e){t.push(yo(e))})),t}(e.split(","));if("this-request-only"===i)return n;for(var r=1e3*parseInt(i,10),o=0;o<n.length;++o)t[n[o]]=bo()+r}catch(e){return[]}return[]},e.isTenantKilled=function(e){var i=t,n=yo(e);return void 0!==i[n]&&i[n]>bo()||(delete i[n],!1)}}))}return e.__ieDyn=1,e}();const tu=eu;function iu(e){var t,i=Math.floor(1200*Math.random())+2400;return t=Math.pow(2,e)*i,Math.min(t,6e5)}var nu,ru=2e6,ou=Math.min(ru,65e3),au="metadata",su="f",lu=/\./,cu=function(){function e(t,i,n,r){var o="data",a="baseData",s=!!r,l=!0,c=i,u={};Fa(e,this,(function(e){function i(e,t,r,o,a,l,d){so(e,(function(e,p){var h=null;if(p||yc(p)){var v=r,f=e,m=a,g=t;if(s&&!o&&lu.test(e)){var S=e.split("."),y=S.length;if(y>1){m&&(m=m.slice());for(var A=0;A<y-1;A++){var I=S[A];g=g[I]=g[I]||{},v+="."+I,m&&m.push(I)}f=S[y-1]}}var E=o&&function(e){var t=u[e];return void 0===t&&(e.length>=7&&(t=lo(e,"ext.metadata")||lo(e,"ext.web")),u[e]=t),t}(v);if(h=!E&&c&&c.handleField(v,f)?c.value(v,f,p,n):function(e,t,i){if(!t&&!yc(t)||"string"!=typeof e)return null;var n=typeof t;if("string"===n||"number"===n||"boolean"===n||uo(t))t={value:t};else if("object"!==n||pn.call(t,"value")){if(to(t.value)||""===t.value||!po(t.value)&&!ho(t.value)&&!vo(t.value)&&!uo(t.value))return null}else t={value:i?JSON.stringify(t):t};if(uo(t.value)&&!(t.value.length>0))return null;if(!to(t.kind)){if(uo(t.value)||!(0===(r=t.kind)||r>0&&r<=13||32===r))return null;t.value=t.value.toString()}var r;return t}(f,p,n)){var T=h.value;if(g[f]=T,l&&l(m,f,h),d&&"object"==typeof T&&!uo(T)){var C=m;C&&(C=C.slice()).push(f),i(p,T,v+"."+f,o,C,l,d)}}}}))}e.createPayload=function(e,t,i,n,r,o){return{apiKeys:[],payloadBlob:Dc,overflow:null,sizeExceed:[],failedEvts:[],batches:[],numEvents:0,retryCnt:e,isTeardown:t,isSync:i,isBeacon:n,sendType:o,sendReason:r}},e.appendPayload=function(i,n,r){var o=i&&n&&!i.overflow;return o&&Ml(t,(function(){return"Serializer:appendPayload"}),(function(){for(var t=n.events(),o=i.payloadBlob,a=i.numEvents,s=!1,l=[],c=[],u=i.isBeacon,d=u?65e3:3984588,p=u?ou:ru,h=0,v=0;h<t.length;){var f=t[h];if(f){if(a>=r){i.overflow=n.split(h);break}var m=e.getEventBlob(f);if(m&&m.length<=p){var g=m.length;if(o.length+g>d){i.overflow=n.split(h);break}o&&(o+="\n"),o+=m,++v>20&&(o.substr(0,1),v=0),s=!0,a++}else m?l.push(f):c.push(f),t.splice(h,1),h--}h++}if(l&&l.length>0&&i.sizeExceed.push(Qc.create(n.iKey(),l)),c&&c.length>0&&i.failedEvts.push(Qc.create(n.iKey(),c)),s){i.batches.push(n),i.payloadBlob=o,i.numEvents=a;var S=n.iKey();-1===So(i.apiKeys,S)&&i.apiKeys.push(S)}}),(function(){return{payload:i,theBatch:{iKey:n.iKey(),evts:n.events()},max:r}})),o},e.getEventBlob=function(e){try{return Ml(t,(function(){return"Serializer.getEventBlob"}),(function(){var t={};t.name=e.name,t.time=e.time,t.ver=e.ver,t.iKey="o:"+function(e){if(e){var t=e.indexOf("-");if(t>-1)return e.substring(0,t)}return""}(e.iKey);var n={},r=e.ext;r&&(t.ext=n,so(r,(function(e,t){i(t,n[e]={},"ext."+e,!0,null,null,!0)})));var s=t[o]={};s.baseType=e.baseType;var c=s[a]={};return i(e.baseData,c,a,!1,[a],(function(e,t,i){uu(n,e,t,i)}),l),i(e.data,s,o,!1,[],(function(e,t,i){uu(n,e,t,i)}),l),JSON.stringify(t)}),(function(){return{item:e}}))}catch(e){return null}}}))}return e.__ieDyn=1,e}();function uu(e,t,i,n){if(n&&e){var r=Ac(n.value,n.kind,n.propertyType);if(r>-1){var o=e[au];o||(o=e[au]={f:{}});var a=o[su];if(a||(a=o[su]={}),t)for(var s=0;s<t.length;s++){var l=t[s];a[l]||(a[l]={f:{}});var c=a[l][su];c||(c=a[l][su]={}),a=c}a=a[i]={},uo(n.value)?a.a={t:r}:a.t=r}}}var du="sendAttempt",pu="&NoResponseBody=true",hu=((nu={})[1]=xc,nu[100]=xc,nu[200]="sent",nu[8004]=Lc,nu[8003]=Lc,nu),vu={},fu={};function mu(e,t,i){vu[e]=t,!1!==i&&(fu[t]=e)}function gu(e){try{return e.responseText}catch(e){}return Dc}function Su(e,t){var i=!1;if(e&&t){var n=Eo(e);if(n&&n.length>0)for(var r=t.toLowerCase(),o=0;o<n.length;o++){var a=n[o];if(a&&no(t,a)&&a.toLowerCase()===r){i=!0;break}}}return i}function yu(e,t,i,n){t&&i&&i.length>0&&(n&&vu[t]?(e.hdrs[vu[t]]=i,e.useHdrs=!0):e.url+="&"+t+"="+i)}function Au(e,t){return t&&(ho(t)?e=[t].concat(e):uo(t)&&(e=t.concat(e))),e}mu(jc,jc,!1),mu(zc,zc),mu(Hc,"Client-Id"),mu(Bc,Bc),mu(Vc,Vc),mu(Wc,Wc),mu(Gc,Gc);var Iu=function(){function e(t,i,n,r,o){this._responseHandlers=[];var a,s,l,c,u,d,p,h,v,f,m="?cors=true&"+Mc.toLowerCase()+"="+Nc,g=new tu,S=!1,y=new Zc,A=!1,I=0,E=!0,T=[],C={},b=[],w=null,O=!1,R=!1,k=!1;Fa(e,this,(function(e){var P=!0;function D(e,t){for(var i=0,n=null,r=0;null==n&&r<e.length;)1===(i=e[r])?(null===Ua&&(Ua=typeof XDomainRequest!==rn)&&ts()&&(Ua=Ua&&!za(Ha(Na),"withCredentials")),Ua?n=F:ts()&&(n=x)):2===i&&es(t)&&(!t||t&&!h)?n=L:A&&3===i&&Za()&&(n=_),r++;return n?{_transport:i,_isSync:t,sendPOST:n}:null}function F(e,t,i){var n=new XDomainRequest;n.open(Fc,e.urlString),e.timeout&&(n.timeout=e.timeout),n.onload=function(){var e=gu(n);N(t,200,{},e),K(e)},n.onerror=function(){N(t,400,{})},n.ontimeout=function(){N(t,500,{})},n.onprogress=function(){},i?n.send(e.data):o.set((function(){n.send(e.data)}),0)}function L(e,t,i){var n,r=e.urlString,a=!1,s=!1,l=((n={body:e.data,method:Fc}).Microsoft_ApplicationInsights_BypassAjaxInstrumentation=!0,n);i&&(l.keepalive=!0,2===e._sendReason&&(a=!0,f&&(r+=pu))),P&&(l.credentials="include"),e.headers&&Eo(e.headers).length>0&&(l.headers=e.headers),fetch(r,l).then((function(e){var i={},n=Dc,r=e.headers;r&&r.forEach((function(e,t){i[t]=e})),e.body&&e.text().then((function(e){n=e})),s||(s=!0,N(t,e.status,i,n),K(n))})).catch((function(e){s||(s=!0,N(t,0,{}))})),a&&!s&&(s=!0,N(t,200,{})),!s&&e.timeout>0&&o.set((function(){s||(s=!0,N(t,500,{}))}),e.timeout)}function x(e,t,i){var n=e.urlString;function r(e,t,i){if(!e[i]&&t&&t.getResponseHeader){var n=t.getResponseHeader(i);n&&(e[i]=yo(n))}return e}function o(e,i){N(t,e.status,function(e){var t,i,n={};return e.getAllResponseHeaders?(t=e.getAllResponseHeaders(),i={},po(t)&&go(yo(t).split(/[\r\n]+/),(function(e){if(e){var t=e.indexOf(": ");if(-1!==t){var n=yo(e.substring(0,t)).toLowerCase(),r=yo(e.substring(t+1));i[n]=r}else i[yo(e)]=1}})),n=i):(n=r(n,e,$c),n=r(n,e,Uc),n=r(n,e,"kill-duration-seconds")),n}(e),i)}i&&e.disableXhrSync&&(i=!1);var a=function(e,t,i,n,r,o){function a(e,t,i){try{e[t]=i}catch(e){}}void 0===n&&(n=!1),void 0===r&&(r=!1);var s=new XMLHttpRequest;return n&&a(s,"Microsoft_ApplicationInsights_BypassAjaxInstrumentation",n),i&&a(s,gc,i),s.open(e,t,!r),i&&a(s,gc,i),!r&&o&&a(s,"timeout",o),s}(Fc,n,P,!0,i,e.timeout);so(e.headers,(function(e,t){a.setRequestHeader(e,t)})),a.onload=function(){var e=gu(a);o(a,e),K(e)},a.onerror=function(){o(a)},a.ontimeout=function(){o(a)},a.send(e.data)}function N(e,t,i,n){try{e(t,i,n)}catch(e){hs(s,2,518,Qa(e))}}function _(e,t,i){var n=200,r=e._thePayload,o=e.urlString+(f?pu:Dc);try{var a=Ga();if(!a.sendBeacon(o,e.data))if(r){var l=[];go(r.batches,(function(e){if(l&&e&&e.count()>0){for(var t=e.events(),i=0;i<t.length;i++)if(!a.sendBeacon(o,w.getEventBlob(t[i]))){l.push(e.split(i));break}}else l.push(e.split(0))})),q(l,8003,r.sendType,!0)}else n=0}catch(e){vs(s,"Failed to send telemetry using sendBeacon API. Ex:"+Qa(e)),n=0}finally{N(t,n,{},Dc)}}function M(e){return 2===e||3===e}function U(e){return R&&M(e)&&(e=2),e}function $(){return!S&&I<i}function z(){var e=b;return b=[],e}function H(e,t,i){var n=!1;return e&&e.length>0&&!S&&l[t]&&w&&(n=0!==t||$()&&(i>0||y.allowRequestSending())),n}function V(e){var t={};return e&&go(e,(function(e,i){t[i]={iKey:e.iKey(),evts:e.events()}})),t}function W(e,i,n,r,o){if(e&&0!==e.length)if(S)q(e,1,r);else{r=U(r);try{var a=e,u=0!==r;Ml(c,(function(){return"HttpManager:_sendBatches"}),(function(a){a&&(e=e.slice(0));for(var s=[],c=null,d=Ec(),p=l[r]||(u?l[1]:l[0]),h=p&&p._transport,f=v&&(R||M(r)||3===h||p._isSync&&2===h);H(e,r,i);){var m=e.shift();m&&m.count()>0&&(g.isTenantKilled(m.iKey())?s.push(m):(c=c||w.createPayload(i,n,u,f,o,r),w.appendPayload(c,m,t)?null!==c.overflow&&(e=[c.overflow].concat(e),c.overflow=null,j(c,d,Ec(),o),d=Ec(),c=null):(j(c,d,Ec(),o),d=Ec(),e=[m].concat(e),c=null)))}c&&j(c,d,Ec(),o),e.length>0&&(b=e.concat(b)),q(s,8004,r)}),(function(){return{batches:V(a),retryCount:i,isTeardown:n,isSynchronous:u,sendReason:o,useSendBeacon:M(r),sendType:r}}),!u)}catch(e){hs(s,2,48,"Unexpected Exception sending batch: "+Qa(e))}}}function B(e,t,i){e[t]=e[t]||{},e[t][a.identifier]=i}function j(t,i,r,o){if(t&&t.payloadBlob&&t.payloadBlob.length>0){var u=!!e.sendHook,v=l[t.sendType];!M(t.sendType)&&t.isBeacon&&2===t.sendReason&&(v=l[2]||l[3]||v);var f=k;(t.isBeacon||3===v._transport)&&(f=!1);var S=function(e,t){var i={url:m,hdrs:{},useHdrs:!1};t?(i.hdrs=Ic(i.hdrs,C),i.useHdrs=Eo(i.hdrs).length>0):so(C,(function(e,t){fu[e]?yu(i,fu[e],t,!1):(i.hdrs[e]=t,i.useHdrs=!0)})),yu(i,Hc,"NO_AUTH",t),yu(i,zc,mc,t);var n=Dc;go(e.apiKeys,(function(e){n.length>0&&(n+=","),n+=e})),yu(i,Bc,n,t),yu(i,Wc,bo().toString(),t);var r=function(e){for(var t=0;t<e.batches.length;t++){var i=e.batches[t].Msfpc();if(i)return encodeURIComponent(i)}return Dc}(e);if(yc(r)&&(i.url+="&ext.intweb.msfpc="+r),y.shouldAddClockSkewHeaders()&&yu(i,Vc,y.getClockSkewHeaderValue(),t),c.getWParam){var o=c.getWParam();o>=0&&(i.url+="&w="+o)}for(var a=0;a<T.length;a++)i.url+="&"+T[a].name+"="+T[a].value;return i}(t,f);f=f||S.useHdrs;var A=Ec();Ml(c,(function(){return"HttpManager:_doPayloadSend"}),(function(){for(var l=0;l<t.batches.length;l++)for(var m=t.batches[l].events(),T=0;T<m.length;T++){var C=m[T];if(O){var b=C.timings=C.timings||{};B(b,"sendEventStart",A),B(b,"serializationStart",i),B(b,"serializationCompleted",r)}C[du]>0?C[du]++:C[du]=1}q(t.batches,1e3+(o||0),t.sendType,!0);var w={data:t.payloadBlob,urlString:S.url,headers:S.hdrs,_thePayload:t,_sendReason:o,timeout:d,disableXhrSync:p,disableFetchKeepAlive:h};f&&(Su(w.headers,_c)||(w.headers[_c]="no-cache, no-store"),Su(w.headers,Mc)||(w.headers[Mc]=Nc));var k=null;v&&(k=function(i){y.firstRequestSent();var r=function(i,r){!function(t,i,r,o){var s,l=9e3,c=null,u=!1,d=!1;try{var p=!0;if(typeof t!==rn){if(i){y.setClockSkew(i[$c]);var h=i[Uc]||i["kill-duration-seconds"];go(g.setKillSwitchTenants(i["kill-tokens"],h),(function(e){go(r.batches,(function(t){if(t.iKey()===e){c=c||[];var i=t.split(0);r.numEvents-=i.count(),c.push(i)}}))}))}if(200==t||204==t)return void(l=200);((s=t)>=300&&s<500&&408!=s&&429!=s||501==s||505==s||r.numEvents<=0)&&(p=!1),l=9e3+t%1e3}if(p){l=100;var v=r.retryCnt;0===r.sendType&&(v<n?(u=!0,G((function(){0===r.sendType&&I--,W(r.batches,v+1,r.isTeardown,R?2:r.sendType,5)}),R,iu(v))):(d=!0,R&&(l=8001)))}}finally{u||(y.setClockSkew(),function(t,i,n,r){try{r&&a._backOffTransmission(),200===i&&(r||t.isSync||a._clearBackOff(),function(e){if(O){var t=Ec();go(e,(function(e){e&&e.count()>0&&function(e,t){O&&go(e,(function(e){B(e.timings=e.timings||{},"sendEventCompleted",t)}))}(e.events(),t)}))}}(t.batches)),q(t.batches,i,t.sendType,!0)}finally{0===t.sendType&&(I--,5!==n&&e.sendQueuedRequests(t.sendType,n))}}(r,l,o,d)),q(c,8004,r.sendType)}}(i,r,t,o)},l=t.isTeardown||t.isSync;try{v.sendPOST(i,r,l),e.sendListener&&e.sendListener(w,i,l,t.isBeacon)}catch(e){vs(s,"Unexpected exception sending payload. Ex:"+Qa(e)),N(r,0,{})}}),Ml(c,(function(){return"HttpManager:_doPayloadSend.sender"}),(function(){if(k)if(0===t.sendType&&I++,u&&!t.isBeacon&&3!==v._transport){var i={data:w.data,urlString:w.urlString,headers:Ic({},w.headers),timeout:w.timeout,disableXhrSync:w.disableXhrSync,disableFetchKeepAlive:w.disableFetchKeepAlive},n=!1;Ml(c,(function(){return"HttpManager:_doPayloadSend.sendHook"}),(function(){try{e.sendHook(i,(function(e){n=!0,E||e._thePayload||(e._thePayload=e._thePayload||w._thePayload,e._sendReason=e._sendReason||w._sendReason),k(e)}),t.isSync||t.isTeardown)}catch(e){n||k(w)}}))}else k(w)}))}),(function(){return{thePayload:t,serializationStart:i,serializationCompleted:r,sendReason:o}}),t.isSync)}t.sizeExceed&&t.sizeExceed.length>0&&q(t.sizeExceed,8003,t.sendType),t.failedEvts&&t.failedEvts.length>0&&q(t.failedEvts,8002,t.sendType)}function G(e,t,i){t?e():o.set(e,i)}function K(t){var i=e._responseHandlers;try{for(var n=0;n<i.length;n++)try{i[n](t)}catch(e){hs(s,1,519,"Response handler failed: "+e)}if(t){var r=JSON.parse(t);yc(r.webResult)&&yc(r.webResult[Kc])&&u.set("MSFPC",r.webResult[Kc],31536e3)}}catch(e){}}function q(e,t,i,n){if(e&&e.length>0&&r){var o=r[(l=t,u=hu[l],yc(u)||(u="oth",l>=9e3&&l<=9999?u="rspFail":l>=8e3&&l<=8999?u=Lc:l>=1e3&&l<=1999&&(u="send")),u)];if(o){var a=0!==i;Ml(c,(function(){return"HttpManager:_sendBatchesNotification"}),(function(){G((function(){try{o.call(r,e,t,a,i)}catch(e){hs(s,1,74,"send request notification failed: "+e)}}),n||a,0)}),(function(){return{batches:V(e),reason:t,isSync:a,sendSync:n,sendType:i}}),!a)}}var l,u}e.initialize=function(e,t,i,n,r){var o;r||(r={}),m=e+m,k=!!eo(r.avoidOptions)||!r.avoidOptions,c=t,u=t.getCookieMgr(),O=!c.config.disableEventTimings;var g=!!c.config.enableCompoundKey;s=(a=i).diagLog();var S=r.valueSanitizer,y=r.stringifyObjects;eo(r.enableCompoundKey)||(g=!!r.enableCompoundKey),d=r.xhrTimeout,p=!!r.disableXhrSync,h=!!r.disableFetchKeepAlive,f=!1!==r.addNoResponse,A=!Ja(),w=new cu(c,S,y,g),to(r.useSendBeacon)||(A=!!r.useSendBeacon);var I=n,T=r.alwaysUseXhrOverride?n:null,C=r.alwaysUseXhrOverride?n:null,b=[3,2];if(!n){E=!1;var R=Ka();R&&R.protocol&&"file:"===R.protocol.toLowerCase()&&(P=!1);var F=[];Ja()?(F=[2,1],b=[2,1,3]):F=[1,2,3],(n=D(F=Au(F,r.transports),!1))||vs(s,"No available transport to send events"),I=D(F,!0)}T||(T=D(b=Au(b,r.unloadTransports),!0)),v=!E&&(A&&Za()||!h&&es(!0)),(o={})[0]=n,o[1]=I||D([1,2,3],!0),o[2]=T||I||D([1],!0),o[3]=C||D([2,3],!0)||I||D([1],!0),l=o},e._getDbgPlgTargets=function(){return[l[0],g,w,l]},e.addQueryStringParameter=function(e,t){for(var i=0;i<T.length;i++)if(T[i].name===e)return void(T[i].value=t);T.push({name:e,value:t})},e.addHeader=function(e,t){C[e]=t},e.canSendRequest=function(){return $()&&y.allowRequestSending()},e.sendQueuedRequests=function(e,t){eo(e)&&(e=0),R&&(e=U(e),t=2),H(b,e,0)&&W(z(),0,!1,e,t||0)},e.isCompletelyIdle=function(){return!S&&0===I&&0===b.length},e.setUnloading=function(e){R=e},e.addBatch=function(e){if(e&&e.count()>0){if(g.isTenantKilled(e.iKey()))return!1;b.push(e)}return!0},e.teardown=function(){b.length>0&&W(z(),0,!0,2,2)},e.pause=function(){S=!0},e.resume=function(){S=!1,e.sendQueuedRequests(0,4)},e.sendSynchronousBatch=function(e,t,i){e&&e.count()>0&&(to(t)&&(t=1),R&&(t=U(t),i=2),W([e],0,!1,t,i||0))}}))}return e.__ieDyn=1,e}();function Eu(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];return setTimeout(e,t,i)}function Tu(e){clearTimeout(e)}function Cu(e,t){return{set:e||Eu,clear:t||Tu}}var bu="eventsDiscarded",wu="overrideInstrumentationKey",Ou="maxEventRetryAttempts",Ru="maxUnloadEventRetryAttempts";const ku=function(e){function t(){var i,n=e.call(this)||this;n.identifier="PostChannel",n.priority=1011,n.version="3.2.18";var r,o,a,s,l,c,u,d=!1,p=[],h=null,v=!1,f=0,m=500,g=0,S=1e4,y={},A=Pc,I=null,E=null,T=0,C=0,b={},w=-1,O=!0,R=!1,k=6,P=2;return Fa(t,n,(function(e,t){function n(e){"beforeunload"!==(e||Wa().event).type&&(R=!0,o.setUnloading(R)),$(2,2)}function D(e){R=!1,o.setUnloading(R)}function F(e,t){if(e.sendAttempt||(e.sendAttempt=0),e.latency||(e.latency=1),e.ext&&e.ext[qc]&&delete e.ext[qc],e.ext&&e.ext[Xc]&&e.ext[Xc].id&&delete e.ext[Xc].id,O&&(e.ext=Lo(e.ext),e.baseData&&(e.baseData=Lo(e.baseData)),e.data&&(e.data=Lo(e.data))),e.sync)if(T||v)e.latency=3,e.sync=!1;else if(o)return O&&(e=Lo(e)),void o.sendSynchronousBatch(Qc.create(e.iKey,[e]),!0===e.sync?1:e.sync,3);var i=e.latency,n=g,r=S;4===i&&(n=f,r=m);var a=!1;if(n<r)a=!V(e,t);else{var s=1,l=20;4===i&&(s=4,l=1),a=!0,function(e,t,i,n){for(;i<=t;){var r=z(e,t,!0);if(r&&r.count()>0){var o=r.split(0,n),a=o.count();if(a>0)return 4===i?f-=a:g-=a,Y(bu,[o],kc.QueueFull),!0}i++}return W(),!1}(e.iKey,e.latency,s,l)&&(a=!V(e,t))}a&&J(bu,[e],kc.QueueFull)}function L(e,t,i){var n=B(e,t,i);return o.sendQueuedRequests(t,i),n}function x(){return g>0}function N(){if(w>=0&&B(w,0,l)&&o.sendQueuedRequests(0,l),f>0&&!E&&!v){var e=y[A][2];e>=0&&(E=M((function(){E=null,L(4,0,1),N()}),e))}var t=y[A][1];!I&&!h&&t>=0&&!v&&(x()?I=M((function(){I=null,L(0===C?3:1,0,1),C++,C%=2,N()}),t):C=0)}function _(){i=null,d=!1,p=[],h=null,v=!1,f=0,m=500,g=0,S=1e4,y={},A=Pc,I=null,E=null,T=0,C=0,r=null,b={},a=void 0,s=0,w=-1,l=null,O=!0,R=!1,k=6,P=2,c=null,u=Cu(),o=new Iu(500,2,1,{requeue:q,send:Q,sent:Z,drop:ee,rspFail:te,oth:ie},u),K(),b[4]={batches:[],iKeyMap:{}},b[3]={batches:[],iKeyMap:{}},b[2]={batches:[],iKeyMap:{}},b[1]={batches:[],iKeyMap:{}},ne()}function M(e,t){0===t&&T&&(t=1);var i=1e3;return T&&(i=iu(T-1)),u.set(e,t*i)}function U(){return null!==I&&(u.clear(I),I=null,C=0,!0)}function $(e,t){U(),h&&(u.clear(h),h=null),v||L(1,e,t)}function z(e,t,i){var n=b[t];n||(n=b[t=1]);var r=n.iKeyMap[e];return!r&&i&&(r=Qc.create(e),n.batches.push(r),n.iKeyMap[e]=r),r}function H(t,i){o.canSendRequest()&&!T&&(a>0&&g>a&&(i=!0),i&&null==h&&e.flush(t,null,20))}function V(e,t){O&&(e=Lo(e));var i=e.latency,n=z(e.iKey,i,!0);return!!n.addEvent(e)&&(4!==i?(g++,t&&0===e.sendAttempt&&H(!e.sync,s>0&&n.count()>=s)):f++,!0)}function W(){for(var e=0,t=0,i=function(i){var n=b[i];n&&n.batches&&go(n.batches,(function(n){4===i?e+=n.count():t+=n.count()}))},n=1;n<=4;n++)i(n);g=t,f=e}function B(t,i,n){var r=!1,a=0===i;return!a||o.canSendRequest()?Ml(e.core,(function(){return"PostChannel._queueBatches"}),(function(){for(var e=[],i=4;i>=t;){var n=b[i];n&&n.batches&&n.batches.length>0&&(go(n.batches,(function(t){o.addBatch(t)?r=r||t&&t.count()>0:e=e.concat(t.events()),4===i?f-=t.count():g-=t.count()})),n.batches=[],n.iKeyMap={}),i--}e.length>0&&J(bu,e,kc.KillSwitch),r&&w>=t&&(w=-1,l=0)}),(function(){return{latency:t,sendType:i,sendReason:n}}),!a):(w=w>=0?Math.min(w,t):t,l=Math.max(l,n)),r}function j(e,t){L(1,0,t),W(),G((function(){e&&e(),p.length>0?h=M((function(){h=null,j(p.shift(),t)}),0):(h=null,N())}))}function G(e){o.isCompletelyIdle()?e():h=M((function(){h=null,G(e)}),.25)}function K(){(y={})[Pc]=[2,1,0],y.NEAR_REAL_TIME=[6,3,0],y.BEST_EFFORT=[18,9,0]}function q(t,i){var n=[],r=k;R&&(r=P),go(t,(function(t){t&&t.count()>0&&go(t.events(),(function(t){t&&(t.sync&&(t.latency=4,t.sync=!1),t.sendAttempt<r?(Tc(t,e.identifier),F(t,!1)):n.push(t))}))})),n.length>0&&J(bu,n,kc.NonRetryableStatus),R&&$(2,2)}function X(t,i){var n=e._notificationManager||{},r=n[t];if(r)try{r.apply(n,i)}catch(i){hs(e.diagLog(),1,74,t+" notification failed: "+i)}}function J(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];t&&t.length>0&&X(e,[t].concat(i))}function Y(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];t&&t.length>0&&go(t,(function(t){t&&t.count()>0&&X(e,[t.events()].concat(i))}))}function Q(e,t,i){e&&e.length>0&&X("eventsSendRequest",[t>=1e3&&t<=1999?t-1e3:0,!0!==i])}function Z(e,t){Y("eventsSent",e,t),N()}function ee(e,t){Y(bu,e,t>=8e3&&t<=8999?t-8e3:kc.Unknown)}function te(e){Y(bu,e,kc.NonRetryableStatus),N()}function ie(e,t){Y(bu,e,kc.Unknown),N()}function ne(){s=i&&i.disableAutoBatchFlushLimit?0:Math.max(1500,S/6)}_(),e._getDbgPlgTargets=function(){return[o]},e.initialize=function(s,l,d){Ml(l,(function(){return"PostChannel:initialize"}),(function(){var p=l;t.initialize(s,l,d);try{l.addUnloadCb,c=Al(Js(e.identifier),l.evtNamespace&&l.evtNamespace());var h=e._getTelCtx();s.extensionConfig[e.identifier]=s.extensionConfig[e.identifier]||{},i=h.getExtCfg(e.identifier),u=Cu(i.setTimeoutOverride,i.clearTimeoutOverride),O=!i.disableOptimizeObj&&!!Ha("chrome"),function(e){var t=e.getWParam;e.getWParam=function(){var e=0;return i.ignoreMc1Ms0CookieProcessing&&(e|=2),e|t()}}(p),i.eventsLimitInMem>0&&(S=i.eventsLimitInMem),i.immediateEventLimit>0&&(m=i.immediateEventLimit),i.autoFlushEventsLimit>0&&(a=i.autoFlushEventsLimit),ho(i[Ou])&&(k=i[Ou]),ho(i[Ru])&&(P=i[Ru]),ne(),i.httpXHROverride&&i.httpXHROverride.sendPOST&&(r=i.httpXHROverride),yc(s.anonCookieName)&&o.addQueryStringParameter("anoncknm",s.anonCookieName),o.sendHook=i.payloadPreprocessor,o.sendListener=i.payloadListener;var v=i.overrideEndpointUrl?i.overrideEndpointUrl:s.endpointUrl;e._notificationManager=l.getNotifyMgr(),o.initialize(v,e.core,e,r,i);var f=s.disablePageUnloadEvents||[];(function(e,t,i,n){var r=!1;t&&e&&uo(e)&&!(r=Tl(e,t,i,n))&&i&&i[wn]>0&&(r=Tl(e,t,null,n))})([sl,al,rl],n,f,c),bl(n,f,c),wl(D,s.disablePageShowEvents,c)}catch(t){throw e.setInitialized(!1),t}}),(function(){return{coreConfig:s,core:l,extensions:d}}))},e.processTelemetry=function(t,n){Tc(t,e.identifier);var r=(n=e._getTelCtx(n)).getExtCfg(e.identifier),o=!!i.disableTelemetry;r&&(o=o||!!r.disableTelemetry);var a=t;o||d||(i[wu]&&(a.iKey=i[wu]),r&&r[wu]&&(a.iKey=r[wu]),F(a,!0),R?$(2,2):N()),e.processNext(a,n)},e._doTeardown=function(e,t){var i;$(2,2),d=!0,o.teardown(),Cl([sl,al,rl],null,c),i=Al(ll,c),Cl([rl],null,i),Cl([nl],null,i),function(e,t){var i=Al(cl,t);Cl([ol],null,i),Cl([nl],null,i)}(0,c),_()},e.setEventQueueLimits=function(e,t){S=e>0?e:1e4,a=t>0?t:0,ne();var i=g>e;if(!i&&s>0)for(var n=1;!i&&n<=3;n++){var r=b[n];r&&r.batches&&go(r.batches,(function(e){e&&e.count()>=s&&(i=!0)}))}H(!0,i)},e.pause=function(){U(),v=!0,o.pause()},e.resume=function(){v=!1,o.resume(),N()},e.addResponseHandler=function(e){o._responseHandlers.push(e)},e._loadTransmitProfiles=function(e){U(),K(),A=Pc,N(),so(e,(function(e,t){var i=t.length;if(i>=2){var n=i>2?t[2]:0;if(t.splice(0,i-2),t[1]<0&&(t[0]=-1),t[1]>0&&t[0]>0){var r=t[0]/t[1];t[0]=Math.ceil(r)*t[1]}n>=0&&t[1]>=0&&n>t[1]&&(n=t[1]),t.push(n),y[e]=t}}))},e.flush=function(e,t,i){if(void 0===e&&(e=!0),!v)if(i=i||1,e)null==h?(U(),B(1,0,i),h=M((function(){h=null,j(t,i)}),0)):p.push(t);else{var n=U();L(1,1,i),null!=t&&t(),n&&N()}},e.setMsaAuthTicket=function(e){o.addHeader(jc,e)},e.hasEvents=x,e._setTransmitProfile=function(e){A!==e&&void 0!==y[e]&&(U(),A=e,N())},e._backOffTransmission=function(){T<4&&(T++,U(),N())},e._clearBackOff=function(){T&&(T=0,U(),N())},To(e,"_setTimeoutOverride",(function(){return u.set}),(function(e){u=Cu(e,u.clear)})),To(e,"_clearTimeoutOverride",(function(){return u.clear}),(function(e){u=Cu(u.set,e)}))})),n}return kl(t,e),t.__ieDyn=1,t}(tc);var Pu="HttpManager:_sendBatches",Du="PrivacyGuard:_processTelemetry",Fu=function(){function e(e,t,i){this.start=Yi(),this.name=e,this.isAsync=!0===i,this.payload=t}return e.prototype.isChildEvt=function(){return!1},e.prototype.complete=function(){this.time=Yi()-this.start,this.exTime=this.time},e}(),Lu=function(){function e(e){this._callbacks=e}return e.prototype.create=function(e,t,i){return e===Pu||e===Du?new Fu(e,t,i):null},e.prototype.fire=function(e){if(e&&e.complete(),this._callbacks)switch(e.name){case Pu:this.handleSendBatches(e);break;case Du:this.handlePrivacyGuardNotification(e)}},e.prototype.setCtx=function(e,t){},e.prototype.getCtx=function(e){},e.prototype.handleSendBatches=function(e){if(this._callbacks.requestProcessingStats){var t=0;if(e.payload){var i=e.payload();if(i.batches)for(var n in i.batches)t+=i.batches[n].evts.length}this._callbacks.requestProcessingStats(e.time||0,t)}},e.prototype.handlePrivacyGuardNotification=function(e){this._callbacks.privacyGuardStats&&e.time&&e.time>0&&this._callbacks.privacyGuardStats(e.time)},e}(),xu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.initialize=function(t,i){this._postChannel=new ku;var n=null!=i?i:[];t.channels=[[this._postChannel]],t.extensionConfig=t.extensionConfig||[],t.extensionConfig[this._postChannel.identifier]=a(a({},t.channelConfiguration),t.extensionConfig[this._postChannel.identifier]);try{e.prototype.initialize.call(this,t,n)}catch(e){this.logger.warnToConsole("Failed to initialize SDK."+e)}},t.prototype.setUploadFrequency=function(e){if(this._postChannel&&e){var t=e/1e3,i=t/2,n={};n.OTelCustomTransmissionProfile=[t,i],this._postChannel._loadTransmitProfiles(n),this._postChannel._setTransmitProfile("OTelCustomTransmissionProfile")}},t.prototype.flush=function(e){this._postChannel&&this._postChannel.flush(e)},t.prototype.shutdown=function(){this._postChannel&&this._postChannel.teardown()},t}(wc),Nu=function(e){function t(t,i){var n,r=e.call(this,t,i)||this;r.sendTelemetryEvent=function(e){return function(){try{return void((t=r.getOneDSTelemetryEvent(e))&&n&&n.track(t))}catch(e){return void si(1,"1DS Sink",e)}var t}()},r.sendCustomerContent=function(e){},r.sendNonStandardEvent=function(e,t){var i=!1;l.forEach((function(n){n.canHandle(t)&&(n.processEvent(e),i=!0)})),i||ai(0,1,(function(){return"Missing Handler for "+t+"to process"+e.eventName}))},r.flush=function(e){null==n||n.flush(e),l.forEach((function(t){t.flush(e)}))},r.shutdown=function(){try{null==n||n.shutdown(),l.forEach((function(e){e.shutdown()}))}catch(e){ai(0,2,(function(){return"An error occurred on shutdown"}))}};var o,s,l=i.nonStandardEventHandlers||[];if(n=function(e,t){var i=e.httpXHROverride,n={instrumentationKey:t,endpointUrl:e.endpointUrl,channelConfiguration:{eventsLimitInMem:e.eventsLimitInMem,httpXHROverride:i,autoFlushEventsLimit:e.autoFlushEventsLimit,setTimeoutOverride:e.setTimeoutOverride,clearTimeoutOverride:e.clearTimeoutOverride,ignoreMc1Ms0CookieProcessing:!0,disableOptimizeObj:!0},enableWParam:!i,disableCookiesUsage:!0,extensionConfig:a({},e.extensionConfig)};e.stats&&e.stats.networkStats&&n.channelConfiguration&&(n.channelConfiguration.payloadListener=function(t,i){var n,r=i||t;r.data&&(null===(n=e.stats)||void 0===n||n.networkStats(r.data.length))});var r=new xu;return r.initialize(n,e.plugins),r.setUploadFrequency(e.uploadFrequency),e.notificationListener&&r.addNotificationListener(e.notificationListener),e.stats&&r.setPerfMgr(new Lu(e.stats)),r}(i,Vo),l.forEach((function(e){e.initialize(r,i)})),!i.endpointUrl)throw new Error("Missing Endpoint Url");return i.disableStatsTracking||(o=r,(s=n)&&s.addNotificationListener({eventsSent:function(e){ai(2,2,(function(){return"Successfully sent ".concat(e.length," event(s)")})),ai(3,2,(function(){return"Sent event(s) details : ".concat(JSON.stringify(e,null,2))})),o.eventsSent+=e.length},eventsDiscarded:function(e,t){ai(0,2,(function(){return"Discarded ".concat(e.length," event(s) because ").concat(t)})),ai(3,2,(function(){return"Discarded event(s) details : ".concat(JSON.stringify(e,null,2))})),o.eventsDiscarded+=e.length}})),r}return o(t,e),t}((function(e,t){var i=this;this.eventsProcessed=0,this.eventsSent=0,this.eventsDiscarded=0;var n=[],r=!1,o=!0,a={name:"DiagnosticLevel",processEvent:function(e){var t=e.eventFlags.diagnosticLevel;return r||10===t||110===t||120===t}},s={},l=Ol();this.init=function(e){return Yo(s,!1)},this.begin=function(){return o=o&&Yo(s,!0)},this.getOneDSTelemetryEvent=function(e){return c(e,{eventType:1})},this.getOneDSCustomerContent=function(e){var t=e.telemetryProperties.customerContentVersion;if(t&&Math.floor(t)<=2&&1===e.telemetryProperties.customerContentType)return c(e,{eventType:2})};var c=function(e,t){if(o){var r=Ii(e);if(function(e,t){for(var i=function(i){var n=t[i];if(!n.processEvent(e))return ai(2,1,(function(){return"".concat(e.eventName," suppressed by ").concat(n.name)})),{value:!1}},n=0;n<t.length;n++){var r=i(n);if("object"==typeof r)return r.value}return!0}(r,n)){var a=(h=r,h.timestamp?new Date(h.timestamp):new Date).toISOString(),c={"Event.Name":r.eventName,"Event.Source":"OTelJS","Event.Time":{value:a,propertyType:9}};for(var u in i.eventsProcessed++,c["Event.Sequence"]={value:i.eventsProcessed,propertyType:4},c["Event.Id"]=l+"."+i.eventsProcessed,s)c[u]=s[u];if(!Wo(c,r.dataFields,!0,t.eventType))return void ai(0,1,(function(){return"Dropping Event: "+r.eventName}));var d="custom";r.eventContract&&(r.eventContract.name&&(c["Event.Contract"]=r.eventContract.name,d+="."+r.eventContract.name.toLowerCase().replace(/\./g,"_")),Wo(c,r.eventContract.dataFields,!1,t.eventType));var p=function(e,t){return 2===t?"b22a201c3f1d41d28ccc399ba6cc9ca2-1972c77f-1f79-4283-a0f9-b4ddc4646f55-7121":e.telemetryProperties&&(1!==t||e.telemetryProperties.ariaTenantToken)?1===t?e.telemetryProperties.ariaTenantToken:void 0:void ai(0,1,(function(){return"Missing Aria Token"}))}(r,t.eventType);if(!p)return;return{iKey:p,name:r.eventName,data:c,time:a,baseType:d,ext:{sdk:{seq:i.eventsProcessed}}}}}var h};this.addPreprocessor=function(e){n.push(e)},this.getOneDSPersistentDataFields=function(){return s},this.getPreprocessors=function(){return n};var u=function(e){Wo(s,e,!1,1)};this.addPersistentDataFields=u,this.setOptionalEventsEnabled=function(e){r=e},this.setFullEventsEnabled=this.setOptionalEventsEnabled,t.enableOptionalEvents&&(r=!0),u(e);var d,p=t.coreFields;if(p){u(Gi(p.app)),u(Bi(p.user)),u(Ki(p.session));var h=p.release;h&&u(($i(d=[],"Release","AudienceGroup",h.audienceGroup,1),d))}this.addPreprocessor(a)})),_u="Office.Telemetry.OTelJS.EventThrottled";function Mu(e){return"number"==typeof e}var Uu,$u,zu=function(){function e(e,t){this._sinkName=e,this._telemetrySink=t,this.name="EventThrottler",this._totalEventsInLastInterval=0,this._singleEventInLastInterval={},this._eventThrottleReported={},this._lastIntervalStart=Date.now(),this._maxNamedEventsPerSecond={}}return e.prototype.setSingleEventThrottle=function(e){this._maxSingleEventPerSecond=e},e.prototype.setTotalEventThrottle=function(e){this._maxTotalEventsPerSecond=e},e.prototype.setNamedEventThrottle=function(e,t){this._maxNamedEventsPerSecond[e]=t},e.prototype.processEvent=function(e){var t=e.eventName;if(t===_u)return!0;var i=!0;return Date.now()-this._lastIntervalStart>1e3&&(this._lastIntervalStart=Date.now(),this._totalEventsInLastInterval=0,this._singleEventInLastInterval={}),this._singleEventInLastInterval[t]=this._singleEventInLastInterval[t]+1||1,t in this._maxNamedEventsPerSecond?i=this.applyThrottle(this._singleEventInLastInterval[t],this._maxNamedEventsPerSecond[t],"MaxNamedEventsPerSecond",t):Mu(this._maxSingleEventPerSecond)&&(i=this.applyThrottle(this._singleEventInLastInterval[t],this._maxSingleEventPerSecond,"MaxSingleEventsPerSecond",t)),Mu(this._maxTotalEventsPerSecond)&&(this._totalEventsInLastInterval++,i&&(i=this.applyThrottle(this._totalEventsInLastInterval,this._maxTotalEventsPerSecond,"MaxTotalEventsPerSecond",t))),i},e.prototype.applyThrottle=function(e,t,i,n){return!(e>t&&(e===t+1&&this._telemetrySink&&!this._eventThrottleReported[n]&&(this._eventThrottleReported[n]=!0,this._telemetrySink.sendTelemetryEvent({eventName:_u,telemetryProperties:{ariaTenantToken:Vo,nexusTenantToken:1723},eventFlags:{diagnosticLevel:110},dataFields:[yi("SinkName",this._sinkName||""),yi("ThrottledEvent.Name",n),Si(i,t)]})),ai(2,1,(function(){return"1DS Sink Event Throttle: Exceeded ".concat(t," ").concat(i,": ").concat(n)})),1))},e}();($u=Uu||(Uu={})).USGOV_DOD="https://pf.events.data.microsoft.com/OneCollector/1.0/",$u.USGOV_DOJ="https://tb.events.data.microsoft.com/OneCollector/1.0/",$u.PUBLIC="https://browser.events.data.microsoft.com/OneCollector/1.0/",$u.CUSTOMER_CONTENT="",$u.EUDB="https://eu-office.events.data.microsoft.com/OneCollector/1.0/";var Hu,Vu,Wu,Bu,ju,Gu,Ku,qu,Xu,Ju,Yu,Qu,Zu,ed,td,id,nd,rd,od,ad,sd,ld,cd,ud,dd=i(9315);(ud=Hu||(Hu={})).Unknown="unknown",ud.Loading="loading",ud.WaitingForAppLoad="WaitingForAppLoad",ud.Loaded="loaded",ud.Failed="failed",ud.Unloading="unloading",ud.Unloaded="unloaded",ud.Cached="cached",(cd=Vu||(Vu={}))[cd.NOT_SUPPORTED_ON_PLATFORM=100]="NOT_SUPPORTED_ON_PLATFORM",cd[cd.INTERNAL_ERROR=500]="INTERNAL_ERROR",cd[cd.NOT_SUPPORTED_IN_CURRENT_CONTEXT=501]="NOT_SUPPORTED_IN_CURRENT_CONTEXT",cd[cd.PERMISSION_DENIED=1e3]="PERMISSION_DENIED",cd[cd.NETWORK_ERROR=2e3]="NETWORK_ERROR",cd[cd.NO_HW_SUPPORT=3e3]="NO_HW_SUPPORT",cd[cd.INVALID_ARGUMENTS=4e3]="INVALID_ARGUMENTS",cd[cd.UNAUTHORIZED_USER_OPERATION=5e3]="UNAUTHORIZED_USER_OPERATION",cd[cd.INSUFFICIENT_RESOURCES=6e3]="INSUFFICIENT_RESOURCES",cd[cd.THROTTLE=7e3]="THROTTLE",cd[cd.USER_ABORT=8e3]="USER_ABORT",cd[cd.OPERATION_TIMED_OUT=8001]="OPERATION_TIMED_OUT",cd[cd.OLD_PLATFORM=9e3]="OLD_PLATFORM",cd[cd.FILE_NOT_FOUND=404]="FILE_NOT_FOUND",cd[cd.SIZE_EXCEEDED=1e4]="SIZE_EXCEEDED",(Wu||(Wu={})).INTERNAL_ERROR="INTERNAL_ERROR",function(e){e[e.Standard=0]="Standard",e[e.Edu=1]="Edu",e[e.Class=2]="Class",e[e.Plc=3]="Plc",e[e.Staff=4]="Staff"}(Bu||(Bu={})),function(e){e.Regular="Regular",e.Private="Private",e.Shared="Shared"}(ju||(ju={})),function(e){e[e.Admin=0]="Admin",e[e.User=1]="User",e[e.Guest=2]="Guest"}(Gu||(Gu={})),(ld=Ku||(Ku={})).Inline="inline",ld.Desktop="desktop",ld.Web="web",function(e){e.M365Content="m365content"}(qu||(qu={})),function(e){e.DriveId="driveId",e.GroupId="groupId",e.SiteId="siteId",e.UserId="userId"}(Xu||(Xu={})),function(e){e.Public="public",e.EUDB="eudb",e.DOD="dod",e.DOJ="doj"}(Ju||(Ju={})),function(e){e.Public="public",e.EUDB="eudb",e.Other="other"}(Yu||(Yu={})),function(e){e[e.PreviousLandmark=0]="PreviousLandmark",e[e.NextLandmark=1]="NextLandmark",e[e.Read=2]="Read",e[e.Compose=3]="Compose"}(Qu||(Qu={})),function(e){e[e.PreviousLandmark=0]="PreviousLandmark",e[e.NextLandmark=1]="NextLandmark",e[e.GoToActivityFeed=2]="GoToActivityFeed"}(Zu||(Zu={}));class pd{constructor(e){this.uuid=Kt(),this.uuid=e||Kt(),Bt(this.uuid)}toString(){return this.uuid}static validate(e){return Bt(e)}}!function(e){e.bing="Bing",e.cmc="CMC",e.cmcMobile="CMCMobile",e.edge="Edge",e.edgeSidebar="EdgeSidebar",e.office="Office",e.orange="Orange",e.outlook="Outlook",e.outlookWin32="OutlookWin32",e.teams="Teams",e.teamsModern="TeamsModern",e.windowsCopilot="WindowsCopilot"}(ed||(ed={})),function(e){e.windows="windows",e.macOs="macos"}(td||(td={})),function(e){e.default="default",e.dark="dark",e.highContrast="contrast"}(id||(id={})),function(e){e.fileOpenPreference="fileOpenPreference",e.theme="theme"}(nd||(nd={})),function(e){e.web="web",e.desktop="desktop"}(rd||(rd={})),function(e){e.settings="settings",e.content="content",e.authentication="authentication",e.remove="remove",e.task="task",e.sidePanel="sidePanel",e.meetingStage="meetingStage"}(od||(od={})),function(e){e.copilotSidePanel="copilotSidePanel",e.copilotMainPane="copilotMainPane",e.copilotFullScreen="copilotFullScreen"}(ad||(ad={})),function(e){e.TextPlain="text/plain",e.TextHtml="text/html",e.ImagePNG="image/png",e.ImageJPEG="image/jpeg"}(sd||(sd={}));class hd{constructor(){this.items=new Map,this.add=e=>{if(e){const t=e.toLowerCase();if(!this.items.has(t))return this.items.set(t,e),!0}return!1},this.values=()=>Array.from(this.items.values())}}let vd={wildcardValidDomainRuleDetection:!0,extendedAppLoadTimeoutInMillis:void 0,authExtensionContextForUrlValidation:!0,escapeRegExSpecialCharactersInValidDomains:!0,useUrlClassForValidDomains:!0,useStrictValidDomainRuleDetection:!0,resetTimerWhenInitCalledAndWaitForNotifySuccess:!1,createAndSendSignalsToSubstrate:!0,useGlobalMonotonicTimersForTelemetry:!1,shouldLazilyWriteDefaultDevicePermissions:!0,disableFirstPartyAppsAsMicrosoftOwned:!1,shouldCustomTelemetryScenarioReceiveAppInitTelemetry:!1,disableDebuggingTelemetryToAria:!1,disableExtendedTelemetryForMetaOSStoreApps:!1,useStrictAppIdValidationInStorage:!1,recreateCommBridgeListenersBeforeLoadingApp:!1,overrideForEachInitStateChangeTimeoutsInMs:void 0,useNewAppInitializationExperience:!1,showErrorBanners:!0,disableNewMessageHandlingExperience:!1,enableNotificationsUI:!1,enableDevicePermissionDBV2:!1,enableSuffixAppendForIframeId:!1,enableHarmonyCustomMessagingForOpalApp:!1,useRelativeRenderingForCaching:!1};function fd(){return vd}const md=e=>e&&new URL(e).host,gd=/([\[\]\^\$\|\(\)\\\.\+\*\?\{\}\=\!\<\>\-])/gi,Sd=(e,t,i,n)=>{try{return void 0!==i&&kd(new URL(e),Ad(i,n),t)}catch(e){return t.log(Zt.Error,"isValidOriginForApp","Invalid origin",null),!1}},yd=e=>{const t=[];for(const i of e)i.match(Ct)||t.push(i);return t},Ad=(e,t)=>{var i,n,r;const o=new hd;return e.validDomains&&e.validDomains.forEach((e=>o.add(Rd(e,t)))),null===(i=e.pages.configurable)||void 0===i||i.forEach((e=>o.add(md(Od(e.configurationUrl,t))))),null===(n=e.pages.static)||void 0===n||n.forEach((e=>{e.contentUrl&&o.add(md(Od(e.contentUrl,t)))})),(null===(r=null==e?void 0:e.connector)||void 0===r?void 0:r.configurationUrl)&&o.add(md(e.connector.configurationUrl)),Array.from(o.values())},Id=e=>!!e&&bt.has(e.toLowerCase()),Ed=e=>Id(null==e?void 0:e.id),Td=e=>{return Id(null==e?void 0:e.id)||!!(t=null==e?void 0:e.id)&&Ot.has(t.toLowerCase());var t},Cd=e=>{if((e=>{var t;return"BotBased"===(null===(t=e.composeExtension)||void 0===t?void 0:t.type)})(e)){const t=e.composeExtension.botId;if(!t)throw"botID cannot be undefined in BotBased composeExtension";return t}},bd=e=>{if((e=>{var t;return null===(t=null==e?void 0:e.copilotAgents)||void 0===t?void 0:t.customEngineAgents.length})(e)){const t=e.copilotAgents.customEngineAgents.filter((e=>"bot"===e.type));if(!t.length)throw"The type bot is missing from the customEngineAgents";if(t.length>1)throw"There cannot be multiple bot types in the customEngineAgents";const i=t[0].id;if(!i)throw"bot id cannot be undefined in CEA";return i.toString()}},wd=(e,t)=>{let i;if(fd().useUrlClassForValidDomains)i=(e.startsWith("https://")||e.startsWith("api://"))&&Bt(t)&&e.includes(`/botid-${t}`);else{const n="^((https|api):/(/.+)?/botid-{botId})".replace("{botId}",t);i=new RegExp(n,"i").test(e)}if(!i)throw"Resource is not valid"},Od=(e,t)=>{var i,n,r,o,a,s,l,c,u,d,p,h;if(!t)return e;const v=void 0!==t.page?t:void 0,f={teamSiteDomain:(null===(i=null==v?void 0:v.sharePointSite)||void 0===i?void 0:i.teamSiteDomain)||"",teamSitePath:(null===(n=null==v?void 0:v.sharePointSite)||void 0===n?void 0:n.teamSitePath)||"",teamSiteUrl:(null===(r=null==v?void 0:v.sharePointSite)||void 0===r?void 0:r.teamSiteUrl)||"",mySiteDomain:(null===(o=null==v?void 0:v.sharePointSite)||void 0===o?void 0:o.mySiteDomain)||"",mySitePath:(null===(a=null==v?void 0:v.sharePointSite)||void 0===a?void 0:a.mySitePath)||"",channelRelativeUrl:(null===(s=null==v?void 0:v.channel)||void 0===s?void 0:s.relativeUrl)||"",sharePointSite:{teamSiteDomain:(null===(l=null==v?void 0:v.sharePointSite)||void 0===l?void 0:l.teamSiteDomain)||"",teamSitePath:(null===(c=null==v?void 0:v.sharePointSite)||void 0===c?void 0:c.teamSitePath)||"",teamSiteUrl:(null===(u=null==v?void 0:v.sharePointSite)||void 0===u?void 0:u.teamSiteUrl)||"",mySiteDomain:(null===(d=null==v?void 0:v.sharePointSite)||void 0===d?void 0:d.mySiteDomain)||"",mySitePath:(null===(p=null==v?void 0:v.sharePointSite)||void 0===p?void 0:p.mySitePath)||""},channel:{relativeUrl:(null===(h=null==v?void 0:v.channel)||void 0===h?void 0:h.relativeUrl)||""}};return Fd(e,f)},Rd=(e,t)=>{var i,n,r,o;if(!t)return e;const a={teamSiteDomain:(null===(i=t.sharePointSite)||void 0===i?void 0:i.teamSiteDomain)||"",mySiteDomain:(null===(n=t.sharePointSite)||void 0===n?void 0:n.mySiteDomain)||"",sharePointSite:{teamSiteDomain:(null===(r=t.sharePointSite)||void 0===r?void 0:r.teamSiteDomain)||"",mySiteDomain:(null===(o=t.sharePointSite)||void 0===o?void 0:o.mySiteDomain)||""}};return Fd(e,a)},kd=(e,t,i)=>{const n=Dd(e),r=new hd;let o=[...t];const a=yd([...t]);a.length>0&&(i.log(Zt.Debug,"isUrlInDomainList",`Invalid domain detected with ${a}}`),fd().wildcardValidDomainRuleDetection&&(o=o.filter((e=>!a.includes(e)))));for(const e of o){if(!r.add(e))continue;const t=Pd(e),i=new RegExp(`^https://${t}((/|\\?).*)?$`,"i");if(n.match(i))return!0}return!1},Pd=e=>{if(!0===fd().wildcardValidDomainRuleDetection&&yd([e]).length>0)throw new Error("The wildcardValidDomainRuleDetection flag is enabled and an improper wildcard domain segment was detected: "+e);return e.replaceAll(".","[.]").replaceAll("*","[^/^.]+")},Dd=e=>e.href,Fd=(e,t,i=[])=>{const n=e.indexOf("?");let r="",o="";return n>0?(r=e.substring(0,n),o=e.substring(n)):r=e,r&&(r=Ld(r,t,i,(e=>encodeURI(e)))),o&&(o=Ld(o,t,i,(e=>encodeURIComponent(e)))),r+o},Ld=(e,t,i=[],n)=>{if(void 0!==t)if("object"==typeof t)for(const r in t)e=Ld(e,t[r],i.concat(r),n);else if(fd().useUrlClassForValidDomains)e=e.replaceAll(`{${i.join(".")}}`,n(t));else{const r=i.join("."),o=new RegExp(`{${r.replace(".","\\.")}}`,"g");e=e.replace(o,n(t))}return e};function xd(e,t){var i,n,r,o;return{actionInfo:e.actionInfo,locale:e.app.locale,appSessionId:e.app.sessionId||"",appLaunchId:e.app.launchId||"",appId:null!==(i=null==t?void 0:t.id)&&void 0!==i?i:"",theme:e.app.theme,appIconPosition:e.app.iconPositionVertical||0,osLocaleInfo:e.app.osLocaleInfo,messageId:e.app.messageId,parentMessageId:e.app.parentMessageId||"",userClickTime:e.app.userClickTime||0,userClickTimeV2:e.app.userClickTimeV2||0,userFileOpenPreference:e.app.userFileOpenPreference||Ku.Inline,manifestVersion:(null==t?void 0:t.manifestVersion)||"",hostName:e.app.host.name,hostClientType:e.app.host.clientType,sessionId:e.app.host.sessionId||"",ringId:e.app.host.ringId,entityId:e.page.id||"",frameContext:e.page.frameContext,renderingSurface:null===(n=e.page)||void 0===n?void 0:n.renderingSurface,subEntityId:e.page.subPageId||"",isFullScreen:e.page.isFullScreen||!1,isMultiWindow:e.page.isMultiWindow||!1,isBackgroundLoad:e.page.isBackgroundLoad,sourceOrigin:e.page.sourceOrigin||"",userObjectId:void 0!==e.user?e.user.id:void 0,isCallingAllowed:void 0!==e.user?e.user.isCallingAllowed:void 0,isPSTNCallingAllowed:void 0!==e.user?e.user.isPSTNCallingAllowed:void 0,userLicenseType:void 0!==e.user?e.user.licenseType:"",loginHint:void 0!==e.user?e.user.loginHint:void 0,userPrincipalName:void 0!==e.user?e.user.userPrincipalName:void 0,upn:void 0!==e.user?e.user.userPrincipalName:void 0,userDisplayName:void 0!==e.user?e.user.displayName:void 0,tid:void 0!==e.user&&void 0!==e.user.tenant?e.user.tenant.id:void 0,tenantSKU:(null===(o=null===(r=null==e?void 0:e.user)||void 0===r?void 0:r.tenant)||void 0===o?void 0:o.sku)||"",channelId:void 0!==e.channel?e.channel.id:void 0,channelName:void 0!==e.channel?e.channel.displayName:void 0,channelRelativeUrl:void 0!==e.channel?e.channel.relativeUrl:void 0,channelType:void 0!==e.channel?e.channel.membershipType:void 0,defaultOneNoteSectionId:void 0!==e.channel?e.channel.defaultOneNoteSectionId:void 0,hostTeamGroupId:void 0!==e.channel?e.channel.ownerGroupId:void 0,hostTeamTenantId:void 0!==e.channel?e.channel.ownerTenantId:void 0,chatId:void 0!==e.chat?e.chat.id:"",meetingId:void 0!==e.meeting?e.meeting.id:"",sharepoint:e.sharepoint,teamId:void 0!==e.team?e.team.internalId:void 0,teamName:void 0!==e.team?e.team.displayName:void 0,teamType:void 0!==e.team?e.team.type:void 0,groupId:void 0!==e.team?e.team.groupId:void 0,teamTemplateId:void 0!==e.team?e.team.templateId:void 0,isTeamArchived:void 0!==e.team?e.team.isArchived:void 0,userTeamRole:void 0!==e.team?e.team.userRole:void 0,teamSiteId:void 0!==e.sharePointSite?e.sharePointSite.teamSiteId:void 0,teamSiteUrl:void 0!==e.sharePointSite?e.sharePointSite.teamSiteUrl:void 0,teamSiteDomain:void 0!==e.sharePointSite?e.sharePointSite.teamSiteDomain:void 0,teamSitePath:void 0!==e.sharePointSite?e.sharePointSite.teamSitePath:void 0,mySiteDomain:void 0!==e.sharePointSite?e.sharePointSite.mySiteDomain:void 0,mySitePath:void 0!==e.sharePointSite?e.sharePointSite.mySitePath:void 0,dialogParameters:e.dialogParameters}}function Nd(e){return void 0!==e&&Pt.has(e)&&!fd().disableDebuggingTelemetryToAria}const _d=new Map([["api.appInitialization.initialize",ee],["api.appInitialization.appLoaded",u],["api.appInitialization.success",h],["api.appInitialization.failure",p],["api.appInitialization.expectedFailure",d]]);function Md(e){return fd().disableFirstPartyAppsAsMicrosoftOwned?!!(null==e?void 0:e.isFullTrust):!!(null==e?void 0:e.isMicrosoftOwned)||!!(null==e?void 0:e.isFullTrust)}class Ud{constructor(){this.logSubscribers=new Set}subscribeToLogs(e){if(this.logSubscribers.has(e)){const e="This logger has already been subscribed; duplicate subscriptions are not allowed.";throw console.log(e),new Error(e)}this.logSubscribers.add(e)}unsubscribeFromLogs(e){return this.logSubscribers.delete(e)}unsubscribeAll(){return this.logSubscribers.clear()}log(e,t,i,n){this.logSubscribers.forEach((r=>{r.log(e,t,i,n)}))}}class $d{constructor(){}static getInstance(){return $d.instance||($d.instance=new Ud),$d.instance}}const zd=new RegExp("[a-zA-Z0-9_\\-\\.]+(@|%40|%2540)[a-zA-Z0-9_\\-\\.]+\\.[a-zA-Z]{2,5}","g"),Hd=(new URL("https://teams.microsoft.com/l/"),e=>{let t;try{t=new URL(e).hostname}catch(t){return console.error("Invalid URL:",e),!1}return!(!t.startsWith("local.")&&!Ut.some((e=>t===e||t.endsWith("."+e))))||Nt.some((e=>t===e||t.endsWith("."+e)))}),Vd=(e,t)=>{var i,n;const r=e.split(".").map(Number),o=t.split(".").map(Number),a=Math.max(r.length,o.length);for(let e=0;e<a;e++){const t=null!==(i=r[e])&&void 0!==i?i:0,a=null!==(n=o[e])&&void 0!==n?n:0;if(t<a)return!0;if(t>a)return!1}return!1},Wd=e=>!!e&&void 0!==e.user.id,Bd=e=>{let t;return t=e===Ju.Public?Yu.Public:e===Ju.EUDB?Yu.EUDB:Yu.Other,t};function jd(e){return e?((t=e)&&(t=t.replace(zd,"email_removed")),t):"";var t}const Gd=performance&&"object"==typeof performance&&["now","timeOrigin"].map((e=>e in performance)).every((e=>e));function Kd(e="monotonic"){return fd().useGlobalMonotonicTimersForTelemetry&&qd(e)||qd("date")}function qd(e){switch(e){case"date":return{type:"date",value:Date.now()};case"monotonic":if(!Gd)return;return{type:"monotonic",value:performance.now()+performance.timeOrigin};default:throw new Error(`Unsupported timestamp type: ${e}`)}}function Xd(){var e;return null===(e=qd("monotonic"))||void 0===e?void 0:e.value}function Jd(e,t){return Gd&&e&&fd().useGlobalMonotonicTimersForTelemetry?{type:"monotonic",value:e}:t?{type:"date",value:t}:void 0}function Yd(){return Gd?1e3*Math.floor(performance.now()):1e3*Date.now()}var Qd,Zd;!function(e){e.Start="start",e.End="end"}(Qd||(Qd={})),function(e){e.MetaOsAppContainerInitiation="metaOsAppContainerInitiation_ms",e.GetPermissions="getPermissions_ms",e.IframeSetAndLoadOrigin="iframeSetAndLoadOrigin_ms",e.OverallAppLoadTimeBeforeInitialize="overallAppLoadTimeBeforeInitialize_ms",e.InitializeMessageDelay="initializeMessageDelay_ms",e.InitializeMessageProcessTime="initializeMessageProcessTime_ms",e.AppLoadedMessageDelay="appLoadedMessageDelay_ms",e.AppLoadedMessageProcessTime="appLoadedMessageProcessTime_ms",e.SuccessMessageDelay="successMessageDelay_ms",e.SuccessMessageProcessTime="successMessageProcessTime_ms",e.FailureMessageDelay="failureMessageDelay_ms",e.FailureMessageProcessTime="failureMessageProcessTime_ms",e.ExpectedFailureMessageDelay="expectedFailureMessageDelay_ms",e.ExpectedFailureMessageProcessTime="expectedFailureMessageProcessTime_ms"}(Zd||(Zd={}));const ep={[Zd.MetaOsAppContainerInitiation]:0,[Zd.GetPermissions]:0,[Zd.IframeSetAndLoadOrigin]:0,[Zd.OverallAppLoadTimeBeforeInitialize]:0,[Zd.InitializeMessageDelay]:0,[Zd.InitializeMessageProcessTime]:0,[Zd.AppLoadedMessageDelay]:0,[Zd.AppLoadedMessageProcessTime]:0,[Zd.SuccessMessageDelay]:0,[Zd.SuccessMessageProcessTime]:0,[Zd.FailureMessageDelay]:0,[Zd.FailureMessageProcessTime]:0,[Zd.ExpectedFailureMessageDelay]:0,[Zd.ExpectedFailureMessageProcessTime]:0};function tp(e,t){const i=function(e){return Kd(e.type).value-e.value}(t);switch(e){case ee:ep.initializeMessageDelay_ms=i;break;case u:ep.appLoadedMessageDelay_ms=i;break;case h:ep.successMessageDelay_ms=i;break;default:console.warn(e+" is not supported in this environment")}return i}const ip={};let np=!1;function rp(e,t){var i;if(!np&&(i=t,Object.values(Zd).includes(i))&&"object"==typeof window&&"object"==typeof window.performance&&"now"in window.performance){const i=performance.now();if(e!==Qd.Start||ip.hasOwnProperty(t)){if(e===Qd.End){const e=ip[t];if(void 0!==e){const n=parseFloat((i-e).toFixed(2));ep[t]=Math.max(ep[t],n)}delete ip[t]}}else ip[t]=i}}class op{constructor(e,t,i){var n,r;this.hubInfo=e,this.customTelemetryService=i,this.letterRegex=/[a-zA-Z]/,this.consumerTid="9188040d-6c67-4c5b-b112-36a304b66dad",this.telemetrySource="AppHostSdk",this.namespace="Office.AppHostingSdk",this.eventFieldPrefix="AppHost",this.ariaTenantToken="7ada8d16f9234e2093f080920f21dd7d-41cee27e-93c2-4a6b-a7aa-2001e852d387-7123",this.nexusTenantToken=-1,this.anonymousDataFields=[...Pi.Office.System.User.getFields("User",{isAnonymous:!0})];const o=[yi(`${this.eventFieldPrefix}.HostName`,this.hubInfo.name),yi(`${this.eventFieldPrefix}.HostVersion`,this.hubInfo.version),yi(`${this.eventFieldPrefix}.HostSdkVersion`,c),yi(`${this.eventFieldPrefix}.HostSessionId`,this.hubInfo.sessionId),yi(`${this.eventFieldPrefix}.TelemetrySource`,this.telemetrySource),yi(`${this.eventFieldPrefix}.Platform`,t.app.host.clientType===rd.web?"Web":"Desktop"),yi(`${this.eventFieldPrefix}.HostRingId`,null!==(n=null==t?void 0:t.app.host.ringId)&&void 0!==n?n:"")];this.telemetryLogger=new en,this.telemetryLogger.setTenantToken(this.namespace,this.ariaTenantToken,this.nexusTenantToken);const a=lp(t.user.dataResidency);if(a){this.oneDsSink=new Nu(o,{endpointUrl:a});const e=new zu("HubSDKServiceEventThrottler",this.oneDsSink);e.setNamedEventThrottle(`${this.namespace}.${this.sanitizeScenarioName("api.getContext")}`,6),e.setNamedEventThrottle(`${this.namespace}.${this.sanitizeScenarioName("api.registerHandler")}`,5),e.setNamedEventThrottle(`${this.namespace}.${this.sanitizeScenarioName("api.getAuthToken")}`,4),this.oneDsSink.addPreprocessor(e),this.telemetryLogger.telemetrySinks=[this.oneDsSink]}const s=Gi({name:"OfficeAppHostingSdk"});null===(r=this.oneDsSink)||void 0===r||r.addPersistentDataFields(s),this.setAppContext(t),this.isTest=void 0!==window.Cypress||function(){var e;return"undefined"!=typeof process&&void 0!==(null===(e=null===process||void 0===process?void 0:process.env)||void 0===e?void 0:e.JEST_WORKER_ID)}(),this.enableExtendedInitializationTracking=(null==i?void 0:i.enableExtendedInitializationTracking)||!1}createScenario(e,t,i,n,r="monotonic",o){var a,s;const l=i?{type:r,value:i}:Kd();t=null!=t?t:null===(a=this.appDefinition)||void 0===a?void 0:a.id;const c=this.isTest?void 0:this.telemetryLogger.createActivity(this.createTelemetryEvent(e,l.value,t,n)),u=this.shouldCustomTelemetryScenarioReceiveAppInitTelemetry(e)?null===(s=this.customTelemetryService)||void 0===s?void 0:s.createScenario(e,t,l.value,n,l.type):void 0,d=this.shouldLogToAria(e,t);return"appInitialization"==e||"appInitializationExtended"==e?(this.addAppInitializationDataFields(),new sp(this,d,l,u,c,Md(this.appDefinition),e)):(this.addHubSdkTelemetryScenarioDataFields(l.value,null!=o&&o),new ap(this,d,l,u,c))}shouldCustomTelemetryScenarioReceiveAppInitTelemetry(e){var t,i;return e!==ti&&(!_d.has(e)||!Nd(null===(t=this.appDefinition)||void 0===t?void 0:t.id)||null!==(i=fd().shouldCustomTelemetryScenarioReceiveAppInitTelemetry)&&void 0!==i&&i)}addAppInitializationDataFields(){var e,t,i,n,r,o,a,s,l,c,u,d,p,h,v,f,m,g,S;const y=yi(`${this.eventFieldPrefix}.ActionId`,null!==(i=null===(t=null===(e=this.appContext)||void 0===e?void 0:e.actionInfo)||void 0===t?void 0:t.actionId)&&void 0!==i?i:""),A=yi("ManifestVersion",null!==(r=null===(n=this.appDefinition)||void 0===n?void 0:n.manifestVersion)&&void 0!==r?r:""),I=gi("ShowLoadingIndicator",null!==(a=null===(o=this.appDefinition)||void 0===o?void 0:o.showLoadingIndicator)&&void 0!==a&&a),E=gi(op.CACHEDAPP_IND_FIELD_NAME,null!==(s=this.usingCachedApp)&&void 0!==s&&s),T=gi(op.BACKGROUND_LOAD_IND_FIELD_NAME,null!==(u=null===(c=null===(l=this.appContext)||void 0===l?void 0:l.page)||void 0===c?void 0:c.isBackgroundLoad)&&void 0!==u&&u),C=yi("InteractionContext",(Wd(this.appContext)&&this.appDefinition?function(e){if(e.frameContext===od.sidePanel||e.frameContext===od.meetingStage||e.frameContext===od.content)return e.meetingId?"Meeting":e.chatId?"Chat":e.channelId?"Channel":"Personal"}(xd(this.appContext,this.appDefinition)):void 0)||""),b=Si("UserClickTime",null!==(p=null===(d=this.appContext)||void 0===d?void 0:d.app.userClickTime)&&void 0!==p?p:0),w=Si("UserClickTimeV2",null!==(v=null===(h=this.appContext)||void 0===h?void 0:h.app.userClickTimeV2)&&void 0!==v?v:0),O=yi("RenderingSurface",null!==(g=null===(m=null===(f=this.appContext)||void 0===f?void 0:f.page)||void 0===m?void 0:m.renderingSurface)&&void 0!==g?g:""),R=yi("FeatureFlags",JSON.stringify(fd()));null===(S=this.oneDsSink)||void 0===S||S.addPersistentDataFields([y,A,I,E,T,C,b,w,R,O])}addHubSdkTelemetryScenarioDataFields(e,t){var i;const n=Si("AppSdkRequestCreationTimeStamp",e),r=gi("IsProxiedFromChild",t);null===(i=this.oneDsSink)||void 0===i||i.addPersistentDataFields([n,r])}static getApiVersionTagForTelemetry(e,t){if(null!=t){if(null==e&&(0,dd.satisfies)(t,op.TEAMS_JS_LIBRARY_V1))return"v1";if(null==e&&(0,dd.satisfies)(t,`>${op.TEAMS_JS_LIBRARY_V2_LOWEST_VERSION}`)&&(0,dd.satisfies)(op.TEAMS_JS_LIBRARY_VERSION_WITH_APIVERSIONTAG,`>${t}`))return"unknown";if(e&&(0,dd.satisfies)(t,`>=${op.TEAMS_JS_LIBRARY_VERSION_WITH_APIVERSIONTAG}`))return e}return null==e?"undefined_tag":e}setAppSdkVersion(e){this.appSdkVersion=e}getAppSdkVersion(){return this.appSdkVersion}setAppContext(e){var t,i,n,r,o,a,s;const l=this.appContext;if(this.appContext=e,this.oneDsSink){if(Wd(e)&&(!Wd(l)||e.user.id!==l.user.id)){const a=!e.user.id;let s;if(a)s=this.anonymousDataFields;else{const l=(null===(i=null===(t=this.appContext.user)||void 0===t?void 0:t.tenant)||void 0===i?void 0:i.id)!==this.consumerTid;s=Bi({primaryIdentityHash:null===(n=e.user)||void 0===n?void 0:n.id,primaryIdentitySpace:l?"UserObjectId":"MSAPuid",tenantId:null===(o=null===(r=this.appContext.user)||void 0===r?void 0:r.tenant)||void 0===o?void 0:o.id,tenantGroup:l?"Commercial":"Consumer",isAnonymous:a})}this.oneDsSink.addPersistentDataFields(s)}if(this.appContext.app.sessionId!==(null==l?void 0:l.app.sessionId)){const e=Ki({id:null!==(a=this.appContext.app.sessionId)&&void 0!==a?a:""});this.oneDsSink.addPersistentDataFields(e)}if(this.appContext.app.locale!==(null==l?void 0:l.app.locale)){const e=yi("Culture.UiLanguage",null!==(s=this.appContext.app.locale)&&void 0!==s?s:"");this.oneDsSink.addPersistentDataFields([e])}}}setAppDefinition(e){this.appDefinition=e}isSessionIdSet(){var e;return!!(null===(e=this.appContext)||void 0===e?void 0:e.app.sessionId)}setUsingCachedApp(e){this.usingCachedApp=e}createTelemetryEvent(e,t,i,n){var r,o,a,s,l,c,u,d,p;const h=[yi("HostedAppId",null!=i?i:""),yi("HostedAppEntityId",null!==(a=null===(o=null===(r=this.appContext)||void 0===r?void 0:r.page)||void 0===o?void 0:o.id)&&void 0!==a?a:""),yi(op.APPSDK_VERSION_FIELD_NAME,null!==(s=this.appSdkVersion)&&void 0!==s?s:""),yi(op.APPSDK_API_VERSION_TAG_FIELD_NAME,op.getApiVersionTagForTelemetry(n,this.appSdkVersion)),yi("HostedAppFrameContext",null!==(u=null===(c=null===(l=this.appContext)||void 0===l?void 0:l.page)||void 0===c?void 0:c.frameContext)&&void 0!==u?u:""),yi("HostedAppSessionId",null!==(p=null===(d=this.appContext)||void 0===d?void 0:d.app.sessionId)&&void 0!==p?p:"")];return{eventName:`${this.namespace}.${this.sanitizeScenarioName(e)}`,eventFlags:{dataCategories:2,diagnosticLevel:110},dataFields:h,timestamp:t}}sanitizeScenarioName(e){let t="",i=!0;for(let n=0;n<e.length;n++){const r=e.charAt(n);"."===r&&0!==n&&"."!==t.charAt(t.length-1)?(t+=r,i=!0):this.letterRegex.test(r)?i?(i=!1,t+=r.toUpperCase()):t+=r:i=!0}return t}isAppStoreAppId(e){return!fd().disableExtendedTelemetryForMetaOSStoreApps&&!!e&&Rt.has(e)}shouldLogToAria(e,t){return!e.startsWith("eventDispatch")&&("appInitializationExtended"!==e||this.isAppStoreAppId(t))}}op.TEAMS_JS_LIBRARY_V1="1.x",op.TEAMS_JS_LIBRARY_V2_LOWEST_VERSION="2.0.0-beta.0",op.TEAMS_JS_LIBRARY_VERSION_WITH_APIVERSIONTAG="2.21.0",op.APPSDK_VERSION_FIELD_NAME="HostedAppSdkVersion",op.APPSDK_API_VERSION_TAG_FIELD_NAME="HostedAppSdkApiVersionTag",op.APPSDK_APP_INIT_STATE_TRANSITION_FIELD_NAME="HostedAppSdkAppInitStateTransition",op.CACHEDAPP_IND_FIELD_NAME="UsingCachedApp",op.APP_TERMINATE_REASON="HostedAppTerminateReason",op.BACKGROUND_LOAD_IND_FIELD_NAME="IsBackgroundLoad",op.WEB_CONTENT_SDK_ID="WebContentSdkId",op.COMM_BRIDGE_ID="CommunicationBridgeId",op.COMM_BRIDGE_LISTENERS_ADDED="CommunicationBridgeListenersAdded",op.IFRAME_SRC="IFrameInfoSrc",op.IFRAME_ORIGIN="IFrameOrigin",op.APP_DEFINITION="AppDefinition",op.USER_CLICK_TIME="UserClickTime",op.USER_CLICK_TIME_V2="UserClickTimeV2",op.APP_STATE_UPDATED="AppStateUpdated",op.IFRAME_ID_SUFFIX="IFrameIdSuffix";class ap{constructor(e,t,i,n,r,o){var a;this.logger=e,this.shouldLogToAria=t,this.initialTimestamp=i,this.customScenario=n,this.activity=r,this.name=o,this.lastMark=fd().useGlobalMonotonicTimersForTelemetry?i:{type:(a=i).type,value:Yd()-1e3*(Date.now()-a.value)}}addOrUpdateActivityDataField(e,t){var i,n,r,o,a,s,l;const c=null===(i=this.activity)||void 0===i?void 0:i.dataFields.find((t=>t.name==e));c?c.value=t:"string"==typeof t?null===(r=null===(n=this.activity)||void 0===n?void 0:n.dataFields)||void 0===r||r.push(yi(e,t)):"boolean"==typeof t?null===(a=null===(o=this.activity)||void 0===o?void 0:o.dataFields)||void 0===a||a.push(gi(e,t)):"number"==typeof t&&(null===(l=null===(s=this.activity)||void 0===s?void 0:s.dataFields)||void 0===l||l.push(Si(e,t)))}addOrUpdateActivityDataFieldForAppInitStateTransition(e){var t,i,n;const r=op.APPSDK_APP_INIT_STATE_TRANSITION_FIELD_NAME,o=null===(t=this.activity)||void 0===t?void 0:t.dataFields.find((e=>e.name==r));o?o.value=`${o.value}${e}`:null===(n=null===(i=this.activity)||void 0===i?void 0:i.dataFields)||void 0===n||n.push(yi(r,e))}oldMarkPhase(e,t){var i,n,r;const o=Yd(),a=o-this.lastMark.value;t||(this.lastMark.value=o),null===(n=null===(i=this.activity)||void 0===i?void 0:i.dataFields)||void 0===n||n.push(Si(`Activity.Phase.${e}`,a)),null===(r=this.customScenario)||void 0===r||r.markPhase(e)}markPhase(e,t=!1){var i,n,r;if(!fd().useGlobalMonotonicTimersForTelemetry)return this.oldMarkPhase(e,t);const o=Kd(this.lastMark.type);if(this.lastMark.type!==o.type)return void $d.getInstance().log(Zt.Warn,"telemetry","The last mark was set to be a monotonic timer without checking for support for the performance API.");const a=(s=o.value-this.lastMark.value,Math.floor(1e3*s));var s;t||(this.lastMark=o),null===(n=null===(i=this.activity)||void 0===i?void 0:i.dataFields)||void 0===n||n.push(Si(`Activity.Phase.${e}`,a)),null===(r=this.customScenario)||void 0===r||r.markPhase(e)}trackMessageDelay(e,t,i){var n,r;null===(r=null===(n=this.customScenario)||void 0===n?void 0:n.trackMessageDelay)||void 0===r||r.call(n,e,t,i)}stop(){var e,t;void 0===(null===(e=this.activity)||void 0===e?void 0:e.success)&&(this.endActivity(!0),null===(t=this.customScenario)||void 0===t||t.stop())}fail(e){var t,i,n,r;void 0===(null===(t=this.activity)||void 0===t?void 0:t.success)&&(null===(n=null===(i=this.activity)||void 0===i?void 0:i.dataFields)||void 0===n||n.push(yi("ErrorMessage",jd(e))),this.endActivity(!1),null===(r=this.customScenario)||void 0===r||r.fail(e))}endActivity(e){var t,i;if("appInitialization"==this.name){const e=JSON.stringify(function(){const e=Object.assign({},ep);return function(){s(this,void 0,void 0,(function*(){np=!0;for(const e in ep)ep.hasOwnProperty(e)&&(ep[e]=0);for(const e in ip)ip.hasOwnProperty(e)&&delete ip[e];yield new Promise((e=>setTimeout(e,0))),np=!1}))}(),e}());null===(i=null===(t=this.activity)||void 0===t?void 0:t.dataFields)||void 0===i||i.push(yi("AppLoadingBreakdown",null!=e?e:""))}this.shouldLogToAria&&this.activity&&this.logger.isSessionIdSet()&&(this.activity.success=e,this.activity.endNow())}addDetails(e){var t,i;null===(i=null===(t=this.customScenario)||void 0===t?void 0:t.addDetails)||void 0===i||i.call(t,e)}getCustomScenario(){return this.customScenario}}class sp extends ap{constructor(e,t,i,n,r,o,a){super(e,t,i,n,r,a),this.logger=e,this.shouldLogToAria=t,this.initialTimestamp=i,this.customScenario=n,this.activity=r,this.isFirstParty=o,this.name=a}fail(e,t){var i,n,r;null===(n=null===(i=this.activity)||void 0===i?void 0:i.dataFields)||void 0===n||n.push(yi("ErrorMessage",jd(e))),this.endActivity(!1),null===(r=this.customScenario)||void 0===r||r.fail(this.isFirstParty&&t?e.concat(":",t):e)}markWarnMessage(e){var t,i;null===(i=null===(t=this.activity)||void 0===t?void 0:t.dataFields)||void 0===i||i.push(yi("WarnMessage",jd(e)))}}const lp=e=>{switch(e){case Ju.EUDB:return Uu.EUDB;case Ju.DOD:return Uu.USGOV_DOD;case Ju.DOJ:return Uu.USGOV_DOJ;case Ju.Public:return Uu.PUBLIC;default:return}};var cp,up,dp,pp,hp,vp;!function(e){e.Unknown="Unknown",e.Windows="Windows",e.iOS="iOS",e.Android="Android",e.Linux="Linux",e.tvOS="tvOS",e.MacOS="MacOS"}(cp||(cp={})),function(e){e.Unknown="Unknown",e.EXO="EXO",e.SPO="SPO",e.OXO="OXO",e.MileIQ="MileIQ",e.AFS="AFS",e.Teams="Teams",e.Stream="Stream",e.ODB="ODB",e.MicrosoftPowerBI="MicrosoftPowerBI",e.Yammer="Yammer"}(up||(up={})),function(e){e.NotSpecified="NotSpecified",e.User="User",e.System="System"}(dp||(dp={})),function(e){e.Unknown="Unknown",e.Anonymous="Anonymous",e.AAD="AAD",e.MSA="MSA",e.Self="Self"}(pp||(pp={})),function(e){e.Unknown="Unknown",e.AccessControlData="AccessControlData",e.CustomerContent="CustomerContent",e.EUII="EUII",e.OII="OII",e.AccountData="OII",e.SystemMetaData="SystemMetaData"}(hp||(hp={})),function(e){e.ApplicationEngaged="ApplicationEngaged"}(vp||(vp={}));class fp{constructor(e,t,i){var n,r,o;this.appSdkHost=e,this.hubServices=t,this.appContext=i,this.getDefaultSignalAuthToken=()=>s(this,void 0,void 0,(function*(){var e;if(!(null===(e=this.hubServices.authenticationService)||void 0===e?void 0:e.acquireToken))throw new Error("Cancelled since service is not available.");const t=yield this.hubServices.authenticationService.acquireToken(fp.DEFAULT_SIGS_RESOURCE_URL,void 0,!0);if(t&&t.token)return t.token;throw new Error("Empty token response.")})),this.delay=e=>new Promise((t=>{var i;setTimeout(t,Math.pow(null!==(i=this.jestDelay)&&void 0!==i?i:100,e))}));const a=this.appSdkHost.getAppDefinition();this.actorInfo={ActorId:pp.Self,ActorIdType:pp.Self,ActorType:dp.User,AadTenantId:pp.Self},this.applicationInfo={AppName:"",AadAppId:null!==(n=null==a?void 0:a.id)&&void 0!==n?n:"",Workload:this.getWorkLoad(null===(r=this.appContext)||void 0===r?void 0:r.app.host.name)},this.deviceInfo={Os:this.getOs(),UserAgent:window.navigator.userAgent},this.commonCustomProperties={HubName:null===(o=this.appContext)||void 0===o?void 0:o.app.host.name,MetaOSHubSDKVersion:c}}createSignal(e){return{SignalType:e.signalType,Compliance:hp.CustomerContent,CV:this.appContext.app.sessionId,StartTime:this.getDateTime(e.startTime),EndTime:this.getDateTime(e.endTime),Application:Object.assign({},this.applicationInfo),Actor:Object.assign({},this.actorInfo),Device:Object.assign({},this.deviceInfo),CustomProperties:Object.assign(Object.assign({},this.commonCustomProperties),e.customProperties)}}getDateTime(e){return e&&e>0?new Date(e):new Date}getWorkLoad(e){switch(e){case ed.office||ed.outlookWin32||ed.office:return up.OXO;case ed.teams||ed.teamsModern:return up.Teams;default:return up.Unknown}}getOs(){let e=cp.Unknown;if(window&&window.navigator.userAgent){const t=window.navigator.userAgent;-1!=t.indexOf("Windows")?e=cp.Windows:-1!=t.indexOf("Mac OS")?e=cp.MacOS:-1!=t.indexOf("Android")?e=cp.Android:-1!=t.indexOf("Linux")?e=cp.Linux:/iPad|iPhone|iPod/.test(t)&&(e=cp.iOS)}return e}sendSignal(e,t){return new Promise(((i,n)=>s(this,void 0,void 0,(function*(){if(t)i(this.postSignalWithRetry(e,t,1));else try{const t=yield this.getDefaultSignalAuthToken();i(this.postSignalWithRetry(e,t,1))}catch(e){n(e)}}))))}postSignalWithRetry(e,t,i){return i>fp.RETRY_LIMIT?Promise.reject("Retry Limit reached. Unable to send Signal."):fetch(fp.SIGS_ENDPOINT,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json","X-SignalInstanceId":e.CV,Authorization:"Bearer "+t}}).catch((e=>Promise.reject(e))).then((n=>s(this,void 0,void 0,(function*(){return n&&n.ok?Promise.resolve(e.CV):n&&fp.RETRY_CODES.has(n.status)?(yield this.delay(i),this.postSignalWithRetry(e,t,++i)):Promise.reject(n)}))))}}function mp(e,t,i){return s(this,void 0,void 0,(function*(){try{const i=yield e.getAppContext();if(i.page.frameContext!=od.authentication){const n=new fp(e,t,i),r=n.createSignal({signalType:vp.ApplicationEngaged,startTime:e.getUserClickTime(),endTime:Date.now()}),o=yield n.sendSignal(r);e.getLogger().log(Zt.Debug,"sendAppEngageSignal","Successfully posted the signal",o)}}catch(t){let n=t;if("status"in t){n=t.status+"";const e=null==i?void 0:i.createScenario("sigsSendSignalFailure");null==e||e.fail(n)}e.getLogger().log(Zt.Error,"sendAppEngageSignal","Error occurred while sending substrate signal",n)}}))}fp.SIGS_ENDPOINT="https://substrate.office.com/sigsapi/v1.0/Me/Signals",fp.RETRY_LIMIT=2,fp.RETRY_CODES=new Set([503]),fp.DEFAULT_SIGS_RESOURCE_URL="https://outlook.office.com";const gp=new Set([$e]);Vu.INTERNAL_ERROR,Wu.INTERNAL_ERROR;const Sp=(e,t)=>({errorCode:e,message:t}),yp=e=>s(void 0,void 0,void 0,(function*(){return null!=e?{kind:"appResponse",data:e}:{kind:"appResponse"}})),Ap={kind:"logResponse"},Ip=(e,...t)=>s(void 0,void 0,void 0,(function*(){return yield e(...t),Ap})),Ep=e=>{const t="An unknown error occurred that could not be converted into a string description.";return(e=>void 0!==(null==e?void 0:e.errorCode))(e)||e instanceof Error?e.message||t:"string"==typeof e?e:"object"==typeof e&&JSON.stringify(e)||t};class Tp{constructor(e){this.idAsString=e,function(e,t){if(function(e){return/<script[^>]*>[\s\S]*?<\/script[^>]*>/gi.test(e)}(e)||!function(e){for(let t=0;t<e.length;t++){const i=e.charCodeAt(t);if(i<32||i>126)return!1}return!0}(e))throw null!=t?t:Sp(Vu.INVALID_ARGUMENTS,"App ID is not valid.")}(e)}toString(){return this.idAsString}get id(){return this.idAsString}}class Cp extends Tp{constructor(e){super(e),function(e,t){if(!function(e){return e.length<256&&e.length>4}(e))throw null!=t?t:Sp(Vu.INVALID_ARGUMENTS,"App ID is not valid.")}(e)}toJSON(){return{appIdAsString:this.toString()}}}class bp{constructor(e,t){this.appSdkHost=e,this.telemetryService=t,this.handlers={},this.appDefinition=this.appSdkHost.getAppDefinition(),this.isTelemetryHandledByExecutor=!1}registerHandler(e,t,i){var n;this.handlers[e]=function(e){return fd().disableFirstPartyAppsAsMicrosoftOwned?e:Object.assign(Object.assign({},e),{isRestrictedToFirstPartyOrLobApps:e.isRestrictedToFullTrustOrLobApps||e.isRestrictedToFirstPartyOrLobApps,isRestrictedToMicrosoftOwnedOrFullTrustApps:e.isRestrictedToMicrosoftOwnedOrFullTrustApps||e.isRestrictedToFullTrustApps,isRestrictedToFullTrustApps:!1,isRestrictedToFullTrustOrLobApps:!1})}({callback:t,scenarioName:null!==(n=null==i?void 0:i.scenarioName)&&void 0!==n?n:ii[e],errorCallback:null==i?void 0:i.errorCallback,callbackFixedArgsLength:null==i?void 0:i.callbackFixedArgsLength,isRestrictedToFirstPartyOrLobApps:null==i?void 0:i.isRestrictedToFirstPartyOrLobApps,isRestrictedToFullTrustApps:null==i?void 0:i.isRestrictedToFullTrustApps,isRestrictedToFullTrustOrLobApps:null==i?void 0:i.isRestrictedToFullTrustOrLobApps,isRestrictedToMicrosoftOwnedApps:null==i?void 0:i.isRestrictedToMicrosoftOwnedApps,isRestrictedToMicrosoftOwnedOrFullTrustApps:null==i?void 0:i.isRestrictedToMicrosoftOwnedOrFullTrustApps})}deleteMessageHandling(e){delete this.handlers[e]}canHandleMessage(e){return this.validateInitialization(e)&&void 0!==this.handlers[e]}isAnAuthUXScenario(e){return e===ii[m]}canPassScenarioToHandler(e){return e===ii[m]||e===ii[M]||e===ii[U]||e===ii[$]||e===ii[z]||e===ii[B]||e===ii[V]||e===ii[W]||e===ii[j]||e===ii[F]||e===ii[L]||e===ii[x]||e===ii[N]||e===ii[_]||e===ii[$e]||e===ii[v]}handleMessage(e,t,i,n,r){var o,a,l,c,u,d,p,h;return s(this,void 0,void 0,(function*(){if(!this.validateInitialization(t))return Promise.reject("SDK context is not initialized");if(!this.canHandleMessage(t))return Promise.reject(`Handler cannot handle message: ${t}`);const s=null!==(o=this.handlers[t].callbackFixedArgsLength)&&void 0!==o?o:i.length;i.push(...Array(Math.max(0,s-i.length)).fill(void 0)),this.trackMessageDelayForAppInitAPIs(t,n);const v=this.handlers[t],f=this.createTelemetryScenario(t,v,i,e,n,r);try{if(v.isRestrictedToFullTrustApps&&!(null===(a=this.appSdkHost.getAppDefinition())||void 0===a?void 0:a.isFullTrust))throw Sp(Vu.INTERNAL_ERROR,xt);if(v.isRestrictedToMicrosoftOwnedApps&&!(null===(l=this.appSdkHost.getAppDefinition())||void 0===l?void 0:l.isMicrosoftOwned))throw Sp(Vu.INTERNAL_ERROR,xt);if(v.isRestrictedToFullTrustOrLobApps&&!(null===(c=this.appSdkHost.getAppDefinition())||void 0===c?void 0:c.isFullTrust)&&!(null===(u=this.appSdkHost.getAppDefinition())||void 0===u?void 0:u.isLOB))throw Sp(Vu.INTERNAL_ERROR,xt);if(v.isRestrictedToFirstPartyOrLobApps&&!Md(this.appSdkHost.getAppDefinition())&&!(null===(d=this.appSdkHost.getAppDefinition())||void 0===d?void 0:d.isLOB))throw Sp(Vu.INTERNAL_ERROR,xt);if(v.isRestrictedToMicrosoftOwnedOrFullTrustApps&&!(null===(p=this.appSdkHost.getAppDefinition())||void 0===p?void 0:p.isFullTrust)&&!(null===(h=this.appSdkHost.getAppDefinition())||void 0===h?void 0:h.isMicrosoftOwned))throw Sp(Vu.INTERNAL_ERROR,xt);if(!this.appSdkHost.checkIfCachedAndRequestAllowed(t))throw"Request not allowed when cached";this.validateDependencies(t);const e=yield v.callback.apply(this,i);return this.isAnAuthUXScenario(v.scenarioName)||null==f||f.stop(),e}catch(e){const t=Ep(e);return this.appSdkHost.getLogger().log(Zt.Error,"handleMessage","Error in handling message",t),v.errorCallback?v.errorCallback(e,f):(null==f||f.fail(t),Promise.reject(e))}}))}createTelemetryScenario(e,t,i=[],n,r,o){var a;const s=t.scenarioName,l=null===(a=this.appDefinition)||void 0===a?void 0:a.id;if(this.isTelemetryHandledByExecutor||!s||function(e,t){return ni.has(e)&&!Nd(t)}(e,l))return;const c=this.telemetryService.createScenario(s,l,null==r?void 0:r.value,n,null==r?void 0:r.type,o);return r&&c.markPhase("MessageDelay"),this.canPassScenarioToHandler(s)&&i.push(c),c}validateInitialization(e){return e===ee||this.appSdkHost.isInitialized()}trackMessageDelayForAppInitAPIs(e,t){}validateDependencies(e){}cleanup(){}}function wp(e,t){const i=Object.assign({},e);return t.forEach((e=>delete i[e])),i}const Op=[{versionToDowngradeFrom:4,downgradeToPreviousVersion:e=>{var t,i,n,r,o;return{apiVersion:3,hostVersionsInfo:e.hostVersionsInfo,supports:Object.assign(Object.assign({},e.supports),{dialog:e.supports.dialog?{url:(null===(t=e.supports)||void 0===t?void 0:t.dialog.url)?(null===(n=null===(i=e.supports)||void 0===i?void 0:i.dialog.url)||void 0===n?void 0:n.bot)?{bot:{}}:{}:void 0,card:null===(r=e.supports.dialog)||void 0===r?void 0:r.card,update:null===(o=e.supports.dialog)||void 0===o?void 0:o.update}:void 0})}}},{versionToDowngradeFrom:3,downgradeToPreviousVersion:e=>({apiVersion:2,hostVersionsInfo:e.hostVersionsInfo,supports:wp(e.supports,["clipboard","webStorage"])})},{versionToDowngradeFrom:2,downgradeToPreviousVersion:e=>{var t,i,n,r,o;return{apiVersion:1,supports:Object.assign(Object.assign({},e.supports),{dialog:e.supports.dialog?{bot:null===(n=null===(i=null===(t=e.supports)||void 0===t?void 0:t.dialog)||void 0===i?void 0:i.url)||void 0===n?void 0:n.bot,card:null===(r=e.supports.dialog)||void 0===r?void 0:r.card,update:null===(o=e.supports.dialog)||void 0===o?void 0:o.update}:void 0})}}}],Rp=(e,t,i=Op)=>{if(e.apiVersion<=t)return e;let n=e;for(const e of i)if(n.apiVersion===e.versionToDowngradeFrom&&(n=e.downgradeToPreviousVersion(n)),n.apiVersion<=t)break;return n};function kp(e,t,i,n,r){var o,a,s,l,c,u,d,p,h,v,f,m,g,S,y;return{apiVersion:4,hostVersionsInfo:n,canParentManageNAATrustedOrigins:null!==(s=null===(a=null===(o=e.nestedAppAuthService)||void 0===o?void 0:o.canParentManageNAATrustedOrigins)||void 0===a?void 0:a.call(o))&&void 0!==s&&s,isDeeplyNestedAuthSupported:null!==(c=null===(l=e.nestedAppAuthService)||void 0===l?void 0:l.isDeeplyNestedAuthSupported())&&void 0!==c&&c,isNAAChannelRecommended:null!=r&&r,supports:{app:{notifySuccessResponse:{}},appInstallDialog:e.appInstallDialogService?{}:void 0,appEntity:e.appEntityService?{}:void 0,barCode:e.barCodeService?{}:void 0,calendar:e.calendarService?{}:void 0,call:e.callService?{}:void 0,chat:e.chatService?{}:void 0,clipboard:navigator&&navigator.clipboard?{}:void 0,conversations:e.conversationsService?{}:void 0,copilot:e.copilotService?{customTelemetry:Ed(i)&&e.copilotService.customTelemetryService?{}:void 0,eligibility:Td(i)&&e.copilotService.eligibilityService?{}:void 0,sidePanel:Ed(i)&&e.copilotService.sidePanelService?{}:void 0,view:Ed(i)&&e.copilotService.viewService?{}:void 0}:void 0,dialog:e.dialogService?{url:e.dialogService.urlService?{bot:e.dialogService.urlService.urlBotService?{}:void 0,parentCommunication:e.dialogService.urlService.parentCommunicationService?{}:void 0}:void 0,card:e.dialogService.cardService&&n&&n.adaptiveCardSchemaVersion&&(y=n.adaptiveCardSchemaVersion,!(y.majorVersion<1||1==y.majorVersion&&y.minorVersion<5))?{bot:e.dialogService.cardService.cardBotService?{}:void 0}:void 0,update:e.dialogService.updateService?{}:void 0}:void 0,externalAppAuthentication:e.externalAppChannelService&&e.externalAppInfoService?{}:void 0,externalAppAuthenticationForCEA:e.externalAppChannelForCEAService&&e.externalAppInfoService?{}:void 0,externalAppCardActions:e.externalAppCardActionsService&&e.externalAppInfoService?{}:void 0,externalAppCardActionsForCEA:e.externalAppCardActionsForCEAService&&e.externalAppInfoService?{}:void 0,externalAppCardActionsForDA:e.externalAppCardActionsForDAService&&e.externalAppInfoService?{}:void 0,externalAppCommands:e.externalAppCommandsService&&e.externalAppInfoService?{}:void 0,files:e.filesService?{}:void 0,geoLocation:e.locationService?{map:e.locationService.mapService?{}:void 0}:void 0,hostEntity:{tab:(null===(u=e.hostEntityService)||void 0===u?void 0:u.tabService)?{}:void 0},interactive:e.interactiveService?{}:void 0,location:e.locationService&&e.locationService.mapService?{}:void 0,logs:e.logService?{}:void 0,mail:e.mailService?{handoff:e.mailService.handoffService?{}:void 0}:void 0,marketplace:e.marketplaceService?{}:void 0,media:e.mediaService?{}:void 0,meeting:e.meetingService?{appShareButton:e.meetingService.appShareButton?{}:void 0}:void 0,meetingRoom:e.meetingRoomService?{}:void 0,messageChannels:e.messageChannelsService?{telemetry:e.messageChannelsService.telemetry,dataLayer:e.messageChannelsService.dataLayer}:void 0,monetization:e.monetizationService?{}:void 0,nestedAppAuth:e.nestedAppAuthService?{}:void 0,notifications:e.notificationService?{}:void 0,otherAppStateChange:e.otherAppStateChangeService?{}:void 0,pages:{appButton:(null===(d=e.pageService)||void 0===d?void 0:d.appButtonService)?{}:void 0,backStack:(null===(p=e.pageService)||void 0===p?void 0:p.backStackService)?{}:void 0,config:(null===(h=e.pageService)||void 0===h?void 0:h.configService)?{}:void 0,fullTrust:(null===(v=e.pageService)||void 0===v?void 0:v.fullTrustService)?{}:void 0,tabs:(null===(f=e.pageService)||void 0===f?void 0:f.tabsService)?{}:void 0,currentApp:{}},people:e.peopleService?{}:void 0,permissions:e.devicePermissionService?{}:void 0,profile:e.profileService?{}:void 0,remoteCamera:e.remoteCameraService?{}:void 0,search:e.searchService?{}:void 0,sharing:e.sharingService?{history:e.sharingService.historyService?{}:void 0}:void 0,stageView:e.stageViewService?{self:e.stageViewService.selfService?{}:void 0}:void 0,store:e.storeService?{}:void 0,teams:e.teamsService?{fullTrust:(null===(m=e.teamsService)||void 0===m?void 0:m.fullTrustService)?{joinedTeams:(null===(S=null===(g=e.teamsService)||void 0===g?void 0:g.fullTrustService)||void 0===S?void 0:S.joinedTeamsService)?{}:void 0}:void 0}:void 0,teamsCore:t?{}:void 0,thirdPartyCloudStorage:e.thirdPartyCloudStorageService?{}:void 0,video:e.videoExtensibilityService&&(e.videoExtensibilityService.mediaStreamService||e.videoExtensibilityService.sharedFrameService)?{mediaStream:e.videoExtensibilityService.mediaStreamService?{}:void 0,sharedFrame:e.videoExtensibilityService.sharedFrameService?{}:void 0}:void 0,webStorage:e.webStorageService?{}:void 0,shortcutRelay:e.shortcutRelayService?{}:void 0}}}const Pp="App failed to call initialize(). Immediate or Loading Screen apps are required to call app.initialize().",Dp="App failed to call notifySuccess(). Loading screen apps are required to call app.notifySuccess() when the app is loaded.";var Fp,Lp;!function(e){e[e.initialAppInitializationTimerExpiration=1]="initialAppInitializationTimerExpiration",e[e.extendedAppInitializationTimerExpiration=2]="extendedAppInitializationTimerExpiration"}(Fp||(Fp={}));class xp extends bp{constructor(e,t,i,n,r,o,a){var s,l,c,u,d,p,h;super(e,i),this.appSdkHost=e,this.hubServices=t,this.telemetryService=i,this.hostVersionsInfo=n,this.usingCachedApp=r,this.isNAAChannelRecommended=o,this.originsToBlock=a,this.initializationStatusReported=!1,this.appInitializationScenarioAlreadyStopped=!1,this.getOCDIWarning=()=>{var e;const t=null===(e=this.telemetryService)||void 0===e?void 0:e.getAppSdkVersion();return Hd(window.location.href)&&t&&Vd(t,_t)?Mt:""},this.startTimerToWaitForInitializeCallFromApp=()=>this.usingCachedApp?window.setTimeout((()=>{var e,t,i;this.failAppInitializationScenario("Cached app load timed out"),null===(e=this.extendedAppInitializationScenario)||void 0===e||e.fail("Cached app load timed out"),this.appSdkHost.setAppInitInfo({state:Hu.Failed,reason:At.CachedAppLoadTimedOut,appSdkVersion:null===(t=this.telemetryService)||void 0===t?void 0:t.getAppSdkVersion()}),null===(i=this.hubServices.logger)||void 0===i||i.log(Zt.Error,"Error Screen Reason",Dp+this.getOCDIWarning())}),this.timeToWaitForStateTransitionsInMs):this.isLoadingScreenApp()?window.setTimeout((()=>{this.onInitializeCallTimedOutForLoadingScreenApp()}),this.timeToWaitForStateTransitionsInMs):window.setTimeout((()=>{this.onInitializeCallTimedOutForImmediateApp()}),this.timeToWaitForStateTransitionsInMs),this.stopAppInitializationScenario=()=>{var e;this.stopInitializeStateTransitionTimer(),null===(e=this.appInitializationScenario)||void 0===e||e.stop(),this.appInitializationScenarioAlreadyStopped=!0},this.failAppInitializationScenario=(e,t)=>{var i;this.stopInitializeStateTransitionTimer(),null===(i=this.appInitializationScenario)||void 0===i||i.fail(e,t)},this.stopInitializeStateTransitionTimer=()=>{window.clearTimeout(this.initStateTransitionTimerId)},this.recordInitializationDoubleStopAttempt=e=>{const t=this.telemetryService.createScenario("initializationDoubleStopAttempt");t.addOrUpdateActivityDataField("doubleInitEndAttemptCodeLocation",e),t.stop()},this.appSdkHost.startAppInitializationScenario(),this.appInitializationScenario=null===(s=this.appSdkHost)||void 0===s?void 0:s.getAppInitializationScenario(),null===(l=this.appInitializationScenario)||void 0===l||l.markPhase("ClickToBeginLoad"),this.logTelemetryForAppSdkLoaded(),this.isShowLoadingIndicatorEnabled=(null===(c=e.getAppDefinition())||void 0===c?void 0:c.showLoadingIndicator)||!1,this.forceAppToBeLoadingScreenApp=null!==(u=fd().resetTimerWhenInitCalledAndWaitForNotifySuccess)&&void 0!==u&&u,null===(d=this.appInitializationScenario)||void 0===d||d.addOrUpdateActivityDataField("resetTimerFlag",this.forceAppToBeLoadingScreenApp),this.recordCachingServiceState();const v=null===(p=this.appSdkHost.getAppDefinition())||void 0===p?void 0:p.id,f=null===(h=this.telemetryService)||void 0===h?void 0:h.enableExtendedInitializationTracking,m=v&&Rt.has(v);(f||m)&&(this.extendedAppInitializationScenario=this.createExtendedAppInitTelemetry(v)),this.timeToWaitForStateTransitionsInMs=this.isLoadingScreenApp()?this.getTimeoutValueForLoadingScreenAppInMills():this.getTimeoutValueForImmediateAppInMills(),this.initStateTransitionTimerId=this.startTimerToWaitForInitializeCallFromApp()}recordCachingServiceState(){var e,t;null===(e=this.appInitializationScenario)||void 0===e||e.addOrUpdateActivityDataField("isLifecycleServiceProvided",!!this.hubServices.lifecycleService),null===(t=this.appInitializationScenario)||void 0===t||t.addOrUpdateActivityDataField("isCacheManagementServiceProvided",!!this.hubServices.cacheManagementService)}createExtendedAppInitTelemetry(e){var t;const i=null===(t=this.telemetryService)||void 0===t?void 0:t.createScenario("appInitializationExtended",e);return null==i||i.markPhase("ClickToBeginLoad"),null==i||i.addOrUpdateActivityDataField("resetTimerFlag",this.forceAppToBeLoadingScreenApp),i}initHandlers(){this.registerHandler(ee,this.onInitializeCalled),this.registerHandler(Z,this.getContext,{errorCallback:this.onGetContextError}),this.registerHandler(rt,this.readyToUnload),this.registerHandler(u,this.onNotifyAppLoadedCalled),this.registerHandler(h,this.onNotifySuccessCalled),this.registerHandler(p,this.onNotifyFailureCalled),this.registerHandler(d,this.onNotifyExpectedFailureCalled)}getTimeoutValueForImmediateAppInMills(){var e;const t=function(){const e=fd().overrideForEachInitStateChangeTimeoutsInMs;return null!=e?e:3e4}();return null!=fd().overrideForEachInitStateChangeTimeoutsInMs&&(null===(e=this.hubServices.logger)||void 0===e||e.log(Zt.Info,"Feature Flag overrideForEachInitStateChangeTimeoutsInMs",`Using timeout for immediate app: ${t} milliseconds`)),t}getTimeoutValueForLoadingScreenAppInMills(){var e,t;const i=function(){const e=fd().extendedAppLoadTimeoutInMillis,t=fd().overrideForEachInitStateChangeTimeoutsInMs;return null!=t?t:null!=e?e:45e3}();return null!=fd().overrideForEachInitStateChangeTimeoutsInMs&&(null===(e=this.hubServices.logger)||void 0===e||e.log(Zt.Info,"Feature Flag overrideForEachInitStateChangeTimeoutsInMs",`Using timeout for loading screen app: ${i} milliseconds`)),null!=fd().extendedAppLoadTimeoutInMillis&&(null===(t=this.hubServices.logger)||void 0===t||t.log(Zt.Info,"Feature Flag extendedAppLoadTimeoutInMillis",`Using timeout for loading screen app: ${i} milliseconds`)),i}isLoadingScreenApp(){return this.forceAppToBeLoadingScreenApp||this.isShowLoadingIndicatorEnabled}updateTelemetryDataFieldAppSdkVersion(e,t){t.forEach((t=>{null==t||t.addOrUpdateActivityDataField(op.APPSDK_VERSION_FIELD_NAME,e)}))}updateTelemetryDataFieldAppSdkApiVersionTag(e,t,i){const n=e.data.apiVersionTag;i.forEach((e=>{null==e||e.addOrUpdateActivityDataField(op.APPSDK_API_VERSION_TAG_FIELD_NAME,op.getApiVersionTagForTelemetry(n,t))}))}updateTelemetryDataFieldUsingCachedApp(e){e.forEach((e=>{var t;null==e||e.addOrUpdateActivityDataField(op.CACHEDAPP_IND_FIELD_NAME,null!==(t=this.usingCachedApp)&&void 0!==t&&t)}))}updateAppInitializationScenarioFields(e,t){this.updateTelemetryDataFieldAppSdkVersion(e,[this.appInitializationScenario,this.extendedAppInitializationScenario]),this.updateTelemetryDataFieldAppSdkApiVersionTag(t,e,[this.appInitializationScenario,this.extendedAppInitializationScenario]),this.updateTelemetryDataFieldUsingCachedApp([this.appInitializationScenario,this.extendedAppInitializationScenario])}markTelemetryForAppInitializationPhases(e,t,i){var n,r;null===(n=this.appInitializationScenario)||void 0===n||n.markPhase(e),null===(r=this.extendedAppInitializationScenario)||void 0===r||r.markPhase(e),this.telemetryService.setAppSdkVersion(t),this.updateAppInitializationScenarioFields(t,i)}trackMessageDelayForAppInitAPIs(e,t){var i,n,r,o;if(ni.has(e)&&t){const a=tp(e,t),s=ni.get(e);if(!s)return void console.warn(`${s} is undefined in applicationInitializationAPIs`);rp(Qd.Start,`${s}MessageProcessTime_ms`),null===(n=null===(i=this.appInitializationScenario)||void 0===i?void 0:i.trackMessageDelay)||void 0===n||n.call(i,s,t,a),null===(o=null===(r=this.extendedAppInitializationScenario)||void 0===r?void 0:r.trackMessageDelay)||void 0===o||o.call(r,s,t,a)}}onInitializeCalled(e,t,i,n){var r,o,a,s,l,c;this.markTelemetryForAppInitializationPhases("BeginLoadToInitialized",t,e);const u=null===(r=this.originsToBlock)||void 0===r?void 0:r.isOriginBlocked(new Cp(null!==(a=null===(o=this.appDefinition)||void 0===o?void 0:o.id)&&void 0!==a?a:""),n||[]);if(this.originsToBlock&&!(null==u?void 0:u.isOriginValid))return this.onNotifyFailureCalled(new MessageEvent(""),At.Validation_InvalidDomains,null==u?void 0:u.message),yp(null==u?void 0:u.message);i||(i=1),this.appSdkHost.setInitialized(!0);const d=this.appSdkHost.getHubInfo(),p=this.constructHubConfig(d);let h;(null===(s=p.hostVersionsInfo)||void 0===s?void 0:s.appEligibilityInformation)&&(null===(l=p.supports.copilot)||void 0===l?void 0:l.eligibility)&&(null===(c=this.hubServices.logger)||void 0===c||c.log(Zt.Warn,"AppEligibilityInformation from host","Host has provided appEligibilityInformation AND ICopilotEligibilityService. Only one of these should be provided.")),h=i<p.apiVersion?Rp(p,i):p;const v=[this.appSdkHost.getFrameContext(),this.appSdkHost.getHubInfo().clientType,"2.0.0",JSON.stringify(h)];return rp(Qd.End,Zd.InitializeMessageProcessTime),this.isLoadingScreenApp()?(this.stopInitializeStateTransitionTimer(),this.initStateTransitionTimerId=window.setTimeout((()=>{var e,i;this.appInitializationScenarioAlreadyStopped?(this.recordInitializationDoubleStopAttempt(Fp.extendedAppInitializationTimerExpiration),this.appSdkHost.setAppInitInfo({state:Hu.Loaded,appSdkVersion:t})):(this.failAppInitializationScenario(Dp),null===(e=this.extendedAppInitializationScenario)||void 0===e||e.fail(Dp),this.appSdkHost.setAppInitInfo({state:Hu.Failed,reason:At.AppInitTimeout,appSdkVersion:t})),null===(i=this.hubServices.logger)||void 0===i||i.log(Zt.Error,"Error Screen Reason",Dp+this.getOCDIWarning())}),this.timeToWaitForStateTransitionsInMs)):(this.appSdkHost.setAppInitInfo({state:Hu.Loaded,appSdkVersion:t}),this.stopAppInitializationScenario(),fd().createAndSendSignalsToSubstrate&&mp(this.appSdkHost,this.hubServices,this.telemetryService)),yp(v)}getUpdatedHostVersionsInfo(){var e,t,i,n;const r=null!==(t=null===(e=this.appDefinition)||void 0===e?void 0:e.appEligibilityInformation)&&void 0!==t?t:null===(i=this.hostVersionsInfo)||void 0===i?void 0:i.appEligibilityInformation;return!Td(this.appDefinition)&&r?(null===(n=this.hubServices.logger)||void 0===n||n.log(Zt.Warn,"AppEligibilityInformation from host","App is not allowed to access copilot eligibility, so `hostVersionInfo.appEligibilityInformation` is removed before sending the object to teams-js."),Object.assign(Object.assign({},this.hostVersionsInfo),{appEligibilityInformation:void 0})):Object.assign(Object.assign({},this.hostVersionsInfo),{appEligibilityInformation:r})}getContext(){return s(this,void 0,void 0,(function*(){const e=xd(yield this.appSdkHost.getAppContext(),this.appDefinition);return yp(e)}))}onGetContextError(e,t){return null==t||t.fail(Ep(e)),yp({})}onNotifyAppLoadedCalled(e,t){return s(this,void 0,void 0,(function*(){return this.telemetryService.setAppSdkVersion(t),this.markTelemetryForAppInitializationPhases("InitializedToAppLoadedInvoked",t,e),this.appSdkHost.setAppInitInfo({state:Hu.Loaded,appSdkVersion:t}),rp(Qd.End,Zd.AppLoadedMessageProcessTime),Ap}))}onNotifySuccessCalled(e,t){var i;return s(this,void 0,void 0,(function*(){return this.markInitializationStatusAsReported()?(this.telemetryService.setAppSdkVersion(t),this.appSdkHost.setAppInitInfo({state:Hu.Loaded,appSdkVersion:t}),(this.isLoadingScreenApp()||this.usingCachedApp)&&(fd().createAndSendSignalsToSubstrate&&mp(this.appSdkHost,this.hubServices,this.telemetryService),this.telemetryService.setAppSdkVersion(t),this.updateAppInitializationScenarioFields(t,e),rp(Qd.End,Zd.SuccessMessageProcessTime),this.stopAppInitializationScenario()),null===(i=this.extendedAppInitializationScenario)||void 0===i||i.stop(),yp([null])):yp([null])}))}onNotifyFailureCalled(e,t,i){var n,r;return s(this,void 0,void 0,(function*(){return this.markInitializationStatusAsReported()?(this.isShowLoadingIndicatorEnabled&&(rp(Qd.End,Zd.FailureMessageProcessTime),this.failAppInitializationScenario(t,i)),this.appSdkHost.setAppInitInfo({state:Hu.Failed,reason:t,appSdkVersion:null===(n=this.telemetryService)||void 0===n?void 0:n.getAppSdkVersion()}),null===(r=this.extendedAppInitializationScenario)||void 0===r||r.fail(t,i),Ap):Ap}))}onNotifyExpectedFailureCalled(e,t,i){var n,r;return s(this,void 0,void 0,(function*(){if(!this.markInitializationStatusAsReported())return Ap;this.appSdkHost.setAppInitInfo({state:Hu.Loaded,appSdkVersion:null===(n=this.telemetryService)||void 0===n?void 0:n.getAppSdkVersion()});const e="Expected."+t;return this.isShowLoadingIndicatorEnabled&&(rp(Qd.End,Zd.ExpectedFailureMessageProcessTime),this.failAppInitializationScenario(e,i)),null===(r=this.extendedAppInitializationScenario)||void 0===r||r.fail(e,i),Ap}))}markInitializationStatusAsReported(){return this.initializationStatusReported?(this.cleanup(),!1):(this.initializationStatusReported=!0,!0)}readyToUnload(){return s(this,void 0,void 0,(function*(){return this.appSdkHost.setAppInitInfo({state:Hu.Unloaded}),Ap}))}cleanup(){this.stopInitializeStateTransitionTimer()}isTeamsCoreSupported(e){return!!this.isTeamsHub(e)||this.isLifeCycleImplemented()&&Ed(this.appDefinition)}constructHubConfig(e){return kp(this.hubServices,this.isTeamsCoreSupported(e.name),this.appSdkHost.getAppDefinition(),this.getUpdatedHostVersionsInfo(),this.isNAAChannelRecommended)}onInitializeCallTimedOutForImmediateApp(){var e,t,i;this.failAppInitializationScenario("SDK initialization timed out"),null===(e=this.extendedAppInitializationScenario)||void 0===e||e.fail("SDK initialization timed out"),this.appSdkHost.setAppInitInfo({state:Hu.Failed,reason:At.AppInitTimeout,appSdkVersion:null===(t=this.telemetryService)||void 0===t?void 0:t.getAppSdkVersion()}),null===(i=this.hubServices.logger)||void 0===i||i.log(Zt.Error,"Error Bubble Reason",Pp+this.getOCDIWarning())}onInitializeCallTimedOutForLoadingScreenApp(){var e,t,i,n;this.appInitializationScenarioAlreadyStopped?(this.recordInitializationDoubleStopAttempt(Fp.initialAppInitializationTimerExpiration),this.appSdkHost.setAppInitInfo({state:Hu.Loaded,appSdkVersion:null===(e=this.telemetryService)||void 0===e?void 0:e.getAppSdkVersion()})):(this.failAppInitializationScenario(Pp),null===(t=this.extendedAppInitializationScenario)||void 0===t||t.fail(Pp),this.appSdkHost.setAppInitInfo({state:Hu.Failed,reason:At.AppInitTimeout,appSdkVersion:null===(i=this.telemetryService)||void 0===i?void 0:i.getAppSdkVersion()})),null===(n=this.hubServices.logger)||void 0===n||n.log(Zt.Error,"Error Screen Reason",Pp+this.getOCDIWarning())}isTeamsHub(e){return e===ed.teams||e===ed.teamsModern}isLifeCycleImplemented(){return!!this.hubServices.lifecycleService}logTelemetryForAppSdkLoaded(){var e,t,i;if(Nd(null===(e=this.appDefinition)||void 0===e?void 0:e.id)){const e=null===(t=this.telemetryService)||void 0===t?void 0:t.createScenario(ti);null===(i=e.addOrUpdateActivityDataField)||void 0===i||i.call(e,op.WEB_CONTENT_SDK_ID,this.appSdkHost.getWebContentSdkId()),e.stop()}}}!function(e){e.Uninitialized="uninitialized",e.Loading="loading",e.Loaded="loaded",e.Cached="cached",e.LoadingWithoutSpinner="loadingWithoutSpinner"}(Lp||(Lp={}));class Np{constructor(){this.internalAppStateMap=new Map}stateChangeHelper(e,t,i,n){var r;if(void 0===t)return;const o=null!==(r=this.internalAppStateMap.get(t))&&void 0!==r?r:Lp.Uninitialized,a=e=>{this.internalAppStateMap.set(t,e)},s={[`${Lp.Loading}_${h}`]:()=>this.setStateToLoaded(a),[`${Lp.Loading}_${d}`]:()=>this.setStateToLoaded(a),[`${Lp.Loading}_${u}`]:()=>this.setStateToLoadingWithoutSpinner(a),[`${Lp.LoadingWithoutSpinner}_${h}`]:()=>this.setStateToLoaded(a),[`${Lp.LoadingWithoutSpinner}_${d}`]:()=>this.setStateToLoaded(a),[`${Lp.Cached}_${u}`]:()=>this.setStateToLoadingWithoutSpinner(a),[`${Lp.Cached}_${h}`]:()=>this.setStateToLoaded(a),[`${Lp.Loaded}_${rt}`]:()=>this.setStateWhenAppEntersCached(a),[`${Lp.Uninitialized}_${ee}`]:()=>this.setStateToLoading(a,n),[`${Lp.Loading}_${ee}`]:()=>this.setStateToLoading(a,n),[`${Lp.Loaded}_${ee}`]:()=>this.setStateToLoading(a,n),[`${Lp.LoadingWithoutSpinner}_${ee}`]:()=>this.setStateToLoading(a,n)}[`${o}_${i}`];s&&s(),e.addOrUpdateActivityDataFieldForAppInitStateTransition(`teamsJsInstanceId: ${t} transits state FROM: ${o} TO: ${this.internalAppStateMap.get(t)} BY: ${i}\n`)}msg_initialize_processedSuccessfully(e,t,i){this.stateChangeHelper(e,t,ee,i)}msg_notifyAppLoaded_processedSuccessfully(e,t){this.stateChangeHelper(e,t,u)}msg_notifySuccess_processedSuccessfully(e,t){this.stateChangeHelper(e,t,h)}msg_notifyExpectedFailure_processingSucceess(e,t){this.stateChangeHelper(e,t,d)}msg_notifyFailure_processedSuccessfully(e,t){this.stateChangeHelper(e,t,p)}msg_readyToUnload_processedSuccessfully(e,t){this.stateChangeHelper(e,t,rt)}setStateToLoading(e,t){e(Lp.Loading),void 0===t||t||this.setStateToLoaded(e)}setStateToLoaded(e){e(Lp.Loaded)}setStateToLoadingWithoutSpinner(e){e(Lp.LoadingWithoutSpinner)}setStateWhenAppEntersCached(e){e(Lp.Cached)}isAllowedToProcessInitializeEvent(e){var t;return void 0===e||(null!==(t=this.internalAppStateMap.get(e))&&void 0!==t?t:Lp.Uninitialized)!==Lp.Cached}isAllowedToProcessNotifySuccessEvent(e){if(void 0===e)return!0;const t=this.internalAppStateMap.get(e);return t==Lp.Loading||t==Lp.LoadingWithoutSpinner||t==Lp.Cached}isAllowedToProcessNotifyAppLoadedEvent(e){return void 0===e||this.internalAppStateMap.get(e)==Lp.Loading}isAllowedToProcessNotifyExpectedFailureEvent(e){if(void 0===e)return!0;const t=this.internalAppStateMap.get(e);return t==Lp.Loading||t==Lp.LoadingWithoutSpinner}isAllowedToProcessNotifyFailureEvent(e){if(void 0===e)return!0;const t=this.internalAppStateMap.get(e);return t==Lp.Loading||t==Lp.LoadingWithoutSpinner}isAllowedToProcessReadyToUnloadEvent(e){return void 0===e||this.internalAppStateMap.get(e)==Lp.Loaded}}class _p{constructor(){}static getInstance(){return _p.instance||(_p.instance=new Np),_p.instance}}function Mp(){return _p.getInstance()}const Up="App failed to call initialize(). Immediate or Loading Screen apps are required to call app.initialize().",$p="App failed to call notifySuccess(). Loading screen apps are required to call app.notifySuccess() when the app is loaded.";class zp{constructor(e){this.getOCDIWarning=()=>{var e;const t=null===(e=this.telemetryWrapper.telemetryService)||void 0===e?void 0:e.getAppSdkVersion();return Hd(window.location.href)&&t&&Vd(t,_t)?Mt:""},this.startTimerToWaitForNofifyCallFromApp=()=>window.setTimeout((()=>{var e,t;window.clearTimeout(this.timerId),this.telemetryWrapper.failAppInitializationScenario($p),this.telemetryWrapper.failExtendedAppInitializationScenario($p),this.appSdkHost.setAppInitInfo({state:Hu.Failed,reason:At.AppInitTimeout,appSdkVersion:null===(e=this.telemetryWrapper.telemetryService)||void 0===e?void 0:e.getAppSdkVersion()}),null===(t=this.hubServices.logger)||void 0===t||t.log(Zt.Error,"Error Screen Reason",$p+this.getOCDIWarning())}),this.timeToWaitForStateTransitionsInMs),this.startTimerToWaitForInitializeCallFromApp=()=>this.telemetryWrapper.usingCachedApp?window.setTimeout((()=>{var e,t;window.clearTimeout(this.timerId),this.telemetryWrapper.failAppInitializationScenario("Cached app load timed out"),this.telemetryWrapper.failExtendedAppInitializationScenario("Cached app load timed out"),this.appSdkHost.setAppInitInfo({state:Hu.Failed,reason:At.CachedAppLoadTimedOut,appSdkVersion:null===(e=this.telemetryWrapper.telemetryService)||void 0===e?void 0:e.getAppSdkVersion()}),null===(t=this.hubServices.logger)||void 0===t||t.log(Zt.Error,"Error Screen Reason",$p+this.getOCDIWarning())}),this.timeToWaitForStateTransitionsInMs):this.telemetryWrapper.isLoadingScreenApp()?window.setTimeout((()=>{this.onInitializeCallTimedOutForLoadingScreenApp()}),this.timeToWaitForStateTransitionsInMs):window.setTimeout((()=>{this.onInitializeCallTimedOutForImmediateApp()}),this.timeToWaitForStateTransitionsInMs),this.appSdkHost=e.orchestratorCommandParams.appSdkHost,this.hubServices=e.orchestratorCommandParams.hubServices,this.telemetryWrapper=e.orchestratorCommandParams.telemetryWrapper,this.timeToWaitForStateTransitionsInMs=this.telemetryWrapper.isLoadingScreenApp()?this.getTimeoutValueForLoadingScreenAppInMills():this.getTimeoutValueForImmediateAppInMills(),this.setTimer(e.sdkEventMessage)}setTimer(e){if(null==e.data||null===e.data||"func"in e.data&&null===e.data.func)this.timerId=this.startTimerToWaitForInitializeCallFromApp();else{if(void 0===e.data||null===e.data||void 0===e.data.func||e.data.func!=ee)throw Sp(Vu.INTERNAL_ERROR,`Timer cannot be set correctly by event: ${e.data.func}`);this.timerId=this.startTimerToWaitForNofifyCallFromApp()}}clearTimer(e){const t=e.data.func;t!==ee&&t!==h&&t!=d&&t!=p||window.clearTimeout(this.timerId)}getTimeoutValueForImmediateAppInMills(){var e;const t=function(){const e=fd().overrideForEachInitStateChangeTimeoutsInMs;return null!=e?e:3e4}();return null!=fd().overrideForEachInitStateChangeTimeoutsInMs&&(null===(e=this.hubServices.logger)||void 0===e||e.log(Zt.Info,"Feature Flag overrideForEachInitStateChangeTimeoutsInMs",`Using timeout for immediate app: ${t} milliseconds`)),t}getTimeoutValueForLoadingScreenAppInMills(){var e,t;const i=function(){const e=fd().extendedAppLoadTimeoutInMillis,t=fd().overrideForEachInitStateChangeTimeoutsInMs;return null!=t?t:null!=e?e:45e3}();return null!=fd().overrideForEachInitStateChangeTimeoutsInMs&&(null===(e=this.hubServices.logger)||void 0===e||e.log(Zt.Info,"Feature Flag overrideForEachInitStateChangeTimeoutsInMs",`Using timeout for loading screen app: ${i} milliseconds`)),null!=fd().extendedAppLoadTimeoutInMillis&&(null===(t=this.hubServices.logger)||void 0===t||t.log(Zt.Info,"Feature Flag extendedAppLoadTimeoutInMillis",`Using timeout for loading screen app: ${i} milliseconds`)),i}onInitializeCallTimedOutForImmediateApp(){var e,t;window.clearTimeout(this.timerId),this.telemetryWrapper.failAppInitializationScenario("SDK initialization timed out"),this.telemetryWrapper.failExtendedAppInitializationScenario("SDK initialization timed out"),this.appSdkHost.setAppInitInfo({state:Hu.Failed,reason:At.AppInitTimeout,appSdkVersion:null===(e=this.telemetryWrapper.telemetryService)||void 0===e?void 0:e.getAppSdkVersion()}),null===(t=this.hubServices.logger)||void 0===t||t.log(Zt.Error,"Error Bubble Reason",Up+this.getOCDIWarning())}onInitializeCallTimedOutForLoadingScreenApp(){var e,t;window.clearTimeout(this.timerId),this.telemetryWrapper.failAppInitializationScenario(Up),this.telemetryWrapper.failExtendedAppInitializationScenario(Up),this.appSdkHost.setAppInitInfo({state:Hu.Failed,reason:At.AppInitTimeout,appSdkVersion:null===(e=this.telemetryWrapper.telemetryService)||void 0===e?void 0:e.getAppSdkVersion()}),null===(t=this.hubServices.logger)||void 0===t||t.log(Zt.Error,"Error Screen Reason",Up+this.getOCDIWarning())}}class Hp{constructor(){}handleEvent(e){return e.orchestratorCommandParams.timerWrapper.timer=new zp(e),Ap}}function Vp(){return new Hp}class Wp{constructor(){}handleEvent(e){return s(this,void 0,void 0,(function*(){const t=e.orchestratorCommandParams.appSdkHost,i=e.orchestratorCommandParams.appDefinition,n=xd(yield t.getAppContext(),i);return yp(n)}))}}class Bp{constructor(){}constructHubConfig(e,t,i,n,r){return kp(t,this.isTeamsCoreSupported(e.name,n,t),n.getAppDefinition(),this.getUpdatedHostVersionsInfo(n,t,r),i)}getUpdatedHostVersionsInfo(e,t,i){var n,r,o;const a=null!==(r=null===(n=e.getAppDefinition())||void 0===n?void 0:n.appEligibilityInformation)&&void 0!==r?r:null==i?void 0:i.appEligibilityInformation;return!Td(e.getAppDefinition())&&a?(null===(o=t.logger)||void 0===o||o.log(Zt.Warn,"AppEligibilityInformation from host","App is not allowed to access copilot eligibility, so `hostVersionInfo.appEligibilityInformation` is removed before sending the object to teams-js."),Object.assign(Object.assign({},i),{appEligibilityInformation:void 0})):Object.assign(Object.assign({},i),{appEligibilityInformation:a})}isTeamsCoreSupported(e,t,i){return!!this.isTeamsHub(e)||this.isLifeCycleImplemented(i)&&Ed(t.getAppDefinition())}isTeamsHub(e){return e===ed.teams||e===ed.teamsModern}isLifeCycleImplemented(e){return!!e.lifecycleService}verifyIfOriginBlocked(e,t,i){var n,r;const o=null==t?void 0:t.isOriginBlocked(new Cp(null!==(r=null===(n=e.getAppDefinition())||void 0===n?void 0:n.id)&&void 0!==r?r:""),i||[]);return t&&!(null==o?void 0:o.isOriginValid)?o:null}handleEvent(e){var t,i,n,r,o,a;return s(this,void 0,void 0,(function*(){const s=e.args[0],l=void 0!==e.args[1]?e.args[1]:1,c=void 0!==e.args[2]?e.args[2]:void 0,u=e.orchestratorCommandParams.appSdkHost,d=e.orchestratorCommandParams.telemetryWrapper;d.markTelemetryForAppInitializationPhases("BeginLoadToInitialized",s,e.sdkEventMessage);const p=this.verifyIfOriginBlocked(u,e.orchestratorCommandParams.originsToBlock,c);if(p)return d.isShowLoadingIndicatorEnabled&&(rp(Qd.End,Zd.FailureMessageProcessTime),d.failAppInitializationScenario(At.Validation_InvalidDomains,null==p?void 0:p.message)),d.failExtendedAppInitializationScenario(At.Validation_InvalidDomains,null==p?void 0:p.message),u.setAppInitInfo({state:Hu.Failed,reason:At.Validation_InvalidDomains,appSdkVersion:null===(t=d.telemetryService)||void 0===t?void 0:t.getAppSdkVersion()}),null===(i=e.orchestratorCommandParams.timerWrapper.timer)||void 0===i||i.clearTimer(e.sdkEventMessage),yp(null==p?void 0:p.message);u.setInitialized(!0);const h=u.getHubInfo(),v=this.constructHubConfig(h,e.orchestratorCommandParams.hubServices,e.orchestratorCommandParams.isNAAChannelRecommended,u,e.orchestratorCommandParams.hostVersionsInfo);let f;(null===(n=v.hostVersionsInfo)||void 0===n?void 0:n.appEligibilityInformation)&&(null===(r=v.supports.copilot)||void 0===r?void 0:r.eligibility)&&(null===(o=e.orchestratorCommandParams.hubServices.logger)||void 0===o||o.log(Zt.Warn,"AppEligibilityInformation from host","Host has provided appEligibilityInformation AND ICopilotEligibilityService. Only one of these should be provided.")),f=l<v.apiVersion?Rp(v,l):v;const m=[u.getFrameContext(),u.getHubInfo().clientType,"2.0.0",JSON.stringify(f)];return rp(Qd.End,Zd.InitializeMessageProcessTime),null===(a=e.orchestratorCommandParams.timerWrapper.timer)||void 0===a||a.clearTimer(e.sdkEventMessage),d.isLoadingScreenApp()?Vp().handleEvent(e):(u.setAppInitInfo({state:Hu.Loaded,appSdkVersion:s}),d.stopAppInitializationScenario(),fd().createAndSendSignalsToSubstrate&&mp(u,e.orchestratorCommandParams.hubServices,d.telemetryService)),Mp().msg_initialize_processedSuccessfully(e.orchestratorCommandParams.telemetryWrapper,e.sdkEventMessage.data.teamsJsInstanceId,d.isShowLoadingIndicatorEnabled),yp(m)}))}}class jp{constructor(){}handleEvent(e){const t=e.args[0],i=e.orchestratorCommandParams.telemetryWrapper;return i.markTelemetryForAppInitializationPhases("InitializedToAppLoadedInvoked",t,e.sdkEventMessage),e.orchestratorCommandParams.appSdkHost.setAppInitInfo({state:Hu.Loaded,appSdkVersion:null!=t?t:i.telemetryService.getAppSdkVersion()}),i.telemetryService.setAppSdkVersion(t),rp(Qd.End,Zd.AppLoadedMessageProcessTime),Mp().msg_notifyAppLoaded_processedSuccessfully(e.orchestratorCommandParams.telemetryWrapper,e.sdkEventMessage.data.teamsJsInstanceId),Ap}}class Gp{constructor(){}handleEvent(e){var t;const i=e.args[0],n=e.args[1],r=e.orchestratorCommandParams.telemetryWrapper;e.orchestratorCommandParams.appSdkHost.setAppInitInfo({state:Hu.Loaded,appSdkVersion:r.telemetryService.getAppSdkVersion()});const o="Expected."+i;return r.isShowLoadingIndicatorEnabled&&(rp(Qd.End,Zd.ExpectedFailureMessageProcessTime),r.failAppInitializationScenario(o,n),null===(t=e.orchestratorCommandParams.timerWrapper.timer)||void 0===t||t.clearTimer(e.sdkEventMessage)),r.failExtendedAppInitializationScenario(o,n),Mp().msg_notifyExpectedFailure_processingSucceess(e.orchestratorCommandParams.telemetryWrapper,e.sdkEventMessage.data.teamsJsInstanceId),Ap}}class Kp{constructor(){}handleEvent(e){var t;const i=e.args[0],n=e.args[1],r=e.orchestratorCommandParams.telemetryWrapper;return r.isShowLoadingIndicatorEnabled&&(rp(Qd.End,Zd.FailureMessageProcessTime),r.failAppInitializationScenario(i,n),null===(t=e.orchestratorCommandParams.timerWrapper.timer)||void 0===t||t.clearTimer(e.sdkEventMessage)),r.failExtendedAppInitializationScenario(i,n),e.orchestratorCommandParams.appSdkHost.setAppInitInfo({state:Hu.Failed,reason:i,appSdkVersion:r.telemetryService.getAppSdkVersion()}),Mp().msg_notifyFailure_processedSuccessfully(e.orchestratorCommandParams.telemetryWrapper,e.sdkEventMessage.data.teamsJsInstanceId),Ap}}class qp{constructor(){}handleEvent(e){var t;const i=e.args[0],n=e.orchestratorCommandParams.telemetryWrapper;return e.orchestratorCommandParams.appSdkHost.setAppInitInfo({state:Hu.Loaded,appSdkVersion:i}),(n.isLoadingScreenApp()||n.usingCachedApp)&&(fd().createAndSendSignalsToSubstrate&&mp(e.orchestratorCommandParams.appSdkHost,e.orchestratorCommandParams.hubServices,n.telemetryService),n.telemetryService.setAppSdkVersion(i),n.updateAppInitializationScenarioFields(i,e.sdkEventMessage),rp(Qd.End,Zd.SuccessMessageProcessTime),n.stopAppInitializationScenario()),n.stopExtendedAppInitializationScenario(),null===(t=e.orchestratorCommandParams.timerWrapper.timer)||void 0===t||t.clearTimer(e.sdkEventMessage),Mp().msg_notifySuccess_processedSuccessfully(e.orchestratorCommandParams.telemetryWrapper,e.sdkEventMessage.data.teamsJsInstanceId),{kind:"appResponse",data:[null]}}}class Xp{constructor(){}handleEvent(e){return e.orchestratorCommandParams.appSdkHost.setAppInitInfo({state:Hu.Unloaded}),Mp().msg_readyToUnload_processedSuccessfully(e.orchestratorCommandParams.telemetryWrapper,e.sdkEventMessage.data.teamsJsInstanceId),Ap}}class Jp{constructor(){}processTimer(e){return s(this,void 0,void 0,(function*(){return Vp().handleEvent(e)}))}processCommand(e){return s(this,void 0,void 0,(function*(){const t=e.sdkEventMessage.data.func;this.isAllowedToProcess(t,e.sdkEventMessage.data.teamsJsInstanceId);const i=this.selectDelegate(t);if(void 0===i)throw new Error(`No delegate found for functionName: ${t}`);return yield i.handleEvent(e)}))}isAllowedToProcess(e,t){if(void 0!==t)switch(e){case ee:if(!Mp().isAllowedToProcessInitializeEvent(t))throw Sp(Vu.INTERNAL_ERROR,"Not allowed to process initialize event");break;case h:if(!Mp().isAllowedToProcessNotifySuccessEvent(t))throw Sp(Vu.INTERNAL_ERROR,"Not allowed to process notify success event");break;case u:if(!Mp().isAllowedToProcessNotifyAppLoadedEvent(t))throw Sp(Vu.INTERNAL_ERROR,"Not allowed to process notify app loaded event");break;case p:if(!Mp().isAllowedToProcessNotifyFailureEvent(t))throw Sp(Vu.INTERNAL_ERROR,"Not allowed to process notify failure event");break;case d:if(!Mp().isAllowedToProcessNotifyExpectedFailureEvent(t))throw Sp(Vu.INTERNAL_ERROR,"Not allowed to process notify expected failure event");break;case rt:if(!Mp().isAllowedToProcessReadyToUnloadEvent(t))throw Sp(Vu.INTERNAL_ERROR,"Not allowed to process ready to unload event")}}selectDelegate(e){let t;switch(e){case ee:t=new Bp;break;case Z:t=new Wp;break;case h:t=new qp;break;case u:t=new jp;break;case rt:t=new Xp;break;case p:t=new Kp;break;case d:t=new Gp}return t}}class Yp{constructor(){}static getInstance(){return Yp.instance||(Yp.instance=new Jp),Yp.instance}}function Qp(){return Yp.getInstance()}class Zp{constructor(e,t,i,n,r){var o,a,s,l;this.stopAppInitializationScenario=()=>{var e;null===(e=this.appInitializationScenario)||void 0===e||e.stop()},this.stopExtendedAppInitializationScenario=()=>{var e;null===(e=this.extendedAppInitializationScenario)||void 0===e||e.stop()},this.failAppInitializationScenario=(e,t)=>{var i;null===(i=this.appInitializationScenario)||void 0===i||i.fail(e,t)},this.failExtendedAppInitializationScenario=(e,t)=>{var i;null===(i=this.extendedAppInitializationScenario)||void 0===i||i.fail(e,t)},this.appSdkHost=e,this.hubServices=t,this._telemetryService=i,this.appDefinition=n,this._isShowLoadingIndicatorEnabled=n.showLoadingIndicator||!1,this._usingCachedApp=r,this.appSdkHost.startAppInitializationScenario(),this.appInitializationScenario=e.getAppInitializationScenario(),null===(o=this.appInitializationScenario)||void 0===o||o.markPhase("ClickToBeginLoad"),this.logTelemetryForAppSdkLoaded(),this.forceAppToBeLoadingScreenApp=null!==(a=fd().resetTimerWhenInitCalledAndWaitForNotifySuccess)&&void 0!==a&&a,null===(s=this.appInitializationScenario)||void 0===s||s.addOrUpdateActivityDataField("resetTimerFlag",this.forceAppToBeLoadingScreenApp),this.recordCachingServiceState();const c=this.appDefinition.id,u=null===(l=this.telemetryService)||void 0===l?void 0:l.enableExtendedInitializationTracking,d=c&&Rt.has(c);(u||d)&&(this.extendedAppInitializationScenario=this.createExtendedAppInitTelemetry(c))}logTelemetryForAppSdkLoaded(){var e,t,i;if(Nd(null===(e=this.appDefinition)||void 0===e?void 0:e.id)){const e=null===(t=this.telemetryService)||void 0===t?void 0:t.createScenario(ti);null===(i=e.addOrUpdateActivityDataField)||void 0===i||i.call(e,op.WEB_CONTENT_SDK_ID,this.appSdkHost.getWebContentSdkId()),e.stop()}}recordCachingServiceState(){var e,t;null===(e=this.appInitializationScenario)||void 0===e||e.addOrUpdateActivityDataField("isLifecycleServiceProvided",!!this.hubServices.lifecycleService),null===(t=this.appInitializationScenario)||void 0===t||t.addOrUpdateActivityDataField("isCacheManagementServiceProvided",!!this.hubServices.cacheManagementService)}createExtendedAppInitTelemetry(e){var t;const i=null===(t=this.telemetryService)||void 0===t?void 0:t.createScenario("appInitializationExtended",e);return null==i||i.markPhase("ClickToBeginLoad"),null==i||i.addOrUpdateActivityDataField("resetTimerFlag",this.forceAppToBeLoadingScreenApp),i}updateTelemetryDataFieldAppSdkVersion(e,t){t.forEach((t=>{null==t||t.addOrUpdateActivityDataField(op.APPSDK_VERSION_FIELD_NAME,e)}))}updateTelemetryDataFieldAppSdkApiVersionTag(e,t,i){const n=e.data.apiVersionTag;i.forEach((e=>{null==e||e.addOrUpdateActivityDataField(op.APPSDK_API_VERSION_TAG_FIELD_NAME,op.getApiVersionTagForTelemetry(n,t))}))}updateTelemetryDataFieldUsingCachedApp(e){e.forEach((e=>{var t;null==e||e.addOrUpdateActivityDataField(op.CACHEDAPP_IND_FIELD_NAME,null!==(t=this._usingCachedApp)&&void 0!==t&&t)}))}updateAppInitializationScenarioFields(e,t){this.updateTelemetryDataFieldAppSdkVersion(e,[this.appInitializationScenario,this.extendedAppInitializationScenario]),this.updateTelemetryDataFieldAppSdkApiVersionTag(t,e,[this.appInitializationScenario,this.extendedAppInitializationScenario]),this.updateTelemetryDataFieldUsingCachedApp([this.appInitializationScenario,this.extendedAppInitializationScenario])}addOrUpdateActivityDataFieldForAppInitStateTransition(e){var t,i;null===(t=this.appInitializationScenario)||void 0===t||t.addOrUpdateActivityDataFieldForAppInitStateTransition(e),null===(i=this.extendedAppInitializationScenario)||void 0===i||i.addOrUpdateActivityDataFieldForAppInitStateTransition(e)}markTelemetryForAppInitializationPhases(e,t,i){var n,r;null===(n=this.appInitializationScenario)||void 0===n||n.markPhase(e),null===(r=this.extendedAppInitializationScenario)||void 0===r||r.markPhase(e),this.telemetryService.setAppSdkVersion(t),this.updateAppInitializationScenarioFields(t,i)}trackMessageDelayForAppInitAPIs(e,t){var i,n,r,o;if(ni.has(e)&&t){const a=tp(e,t),s=ni.get(e);if(!s)return void console.warn(`${s} is undefined in applicationInitializationAPIs`);rp(Qd.Start,`${s}MessageProcessTime_ms`),null===(n=null===(i=this.appInitializationScenario)||void 0===i?void 0:i.trackMessageDelay)||void 0===n||n.call(i,s,t,a),null===(o=null===(r=this.extendedAppInitializationScenario)||void 0===r?void 0:r.trackMessageDelay)||void 0===o||o.call(r,s,t,a)}}isLoadingScreenApp(){return this.forceAppToBeLoadingScreenApp||this._isShowLoadingIndicatorEnabled}get isShowLoadingIndicatorEnabled(){return this._isShowLoadingIndicatorEnabled}get telemetryService(){return this._telemetryService}get usingCachedApp(){return this._usingCachedApp}}class eh{}class th extends bp{constructor(e,t,i,n,r,o,a){super(e,i),this.appSdkHost=e,this.hubServices=t,this.telemetryService=i,this.hostVersionsInfo=n,this.usingCachedApp=r,this.isNAAChannelRecommended=o,this.originsToBlock=a,this.telemetryWrapper=new Zp(e,t,i,e.getAppDefinition(),r),this.timerWrapper=new eh,this.telemetryWrapper.addOrUpdateActivityDataFieldForAppInitStateTransition("App initialization progress begins, teamsJsInstanceId: undefined, AppInitState: uninitialized\n"),this.startAppInitializationFlow()}initHandlers(){this.registerHandler(ee,this.onInitializeCalled,{errorCallback:this.onInitializeCalledError}),this.registerHandler(Z,this.getContext,{errorCallback:this.onGetContextError}),this.registerHandler(rt,this.readyToUnload,{errorCallback:this.onReadyToUnloadError}),this.registerHandler(u,this.onNotifyAppLoadedCalled,{errorCallback:this.onNotifyAppLoadedCalledError}),this.registerHandler(h,this.onNotifySuccessCalled,{errorCallback:this.onNotifySuccessCalledError}),this.registerHandler(p,this.onNotifyFailureCalled,{errorCallback:this.onNotifyFailureCalledError}),this.registerHandler(d,this.onNotifyExpectedFailureCalled,{errorCallback:this.onNotifyExpectedFailureCalledError})}buildOrchestratorCommand(e,t){return{sdkEventMessage:e,orchestratorCommandParams:{appSdkHost:this.appSdkHost,appDefinition:this.appSdkHost.getAppDefinition(),hubServices:this.hubServices,telemetryWrapper:this.telemetryWrapper,timerWrapper:this.timerWrapper,hostVersionsInfo:this.hostVersionsInfo,usingCachedApp:this.usingCachedApp,isNAAChannelRecommended:this.isNAAChannelRecommended,originsToBlock:this.originsToBlock},args:t}}processCommand(e){return Qp().processCommand(e)}startAppInitializationFlow(){const e=this.buildOrchestratorCommand(new MessageEvent("message"),[]);Qp().processTimer(e)}onInitializeCalled(e,t,i,n){const r=[t,i,n],o=this.buildOrchestratorCommand(e,r);return this.processCommand(o)}onInitializeCalledError(e,t){return null==t||t.fail(Ep(e)),yp({})}getContext(e){const t=this.buildOrchestratorCommand(e,[]);return this.processCommand(t)}onGetContextError(e,t){return null==t||t.fail(Ep(e)),yp({})}readyToUnload(e){return s(this,void 0,void 0,(function*(){const t=this.buildOrchestratorCommand(e,[]);return this.processCommand(t)}))}onReadyToUnloadError(e,t){return null==t||t.fail(Ep(e)),yp({})}onNotifyAppLoadedCalled(e,t){const i=[t],n=this.buildOrchestratorCommand(e,i);return this.processCommand(n)}onNotifyAppLoadedCalledError(e,t){return null==t||t.fail(Ep(e)),yp({})}onNotifySuccessCalled(e,t){const i=[t],n=this.buildOrchestratorCommand(e,i);return this.processCommand(n)}onNotifySuccessCalledError(e,t){return null==t||t.fail(Ep(e)),yp({})}onNotifyFailureCalled(e,t,i){const n=[t,i],r=this.buildOrchestratorCommand(e,n);return this.processCommand(r)}onNotifyFailureCalledError(e,t){return null==t||t.fail(Ep(e)),yp({})}onNotifyExpectedFailureCalled(e,t,i){const n=[t,i],r=this.buildOrchestratorCommand(e,n);return this.processCommand(r)}onNotifyExpectedFailureCalledError(e,t){return null==t||t.fail(Ep(e)),yp({})}trackMessageDelayForAppInitAPIs(e,t){this.telemetryWrapper.trackMessageDelayForAppInitAPIs(e,t)}}class ih extends bp{constructor(e,t,i){super(e,t),this.appSdkHost=e,this.telemetryService=t,this.authenticationService=i,this.TAG="BaseAuthenticationMessageHandler"}initHandlers(){this.registerHandler(f,this.handleGetUser,{errorCallback:this.onGetUserError,isRestrictedToMicrosoftOwnedOrFullTrustApps:!0}),this.registerHandler(v,this.handleGetAuthToken,{callbackFixedArgsLength:5,errorCallback:this.onGetAuthTokenError})}validateDependencies(){this.appSdkHost.getContext().app.host.clientType!==rd.desktop||this.authenticationService.externalAuthService||this.appSdkHost.getLogger().log(Zt.Warn,this.TAG,Lt)}handleGetUser(){return s(this,void 0,void 0,(function*(){const e=yield this.authenticationService.getUser();if(e){const t=yield this.appSdkHost.getAppContext(),i=Object.assign(Object.assign({},e.profile),{dataResidency:Bd(t.user.dataResidency)});return yp([!0,i])}return Promise.reject("Failed to fetch the user profile")}))}onGetUserError(e,t){return null==t||t.fail(`GetUser failed ${Ep(e)}`),yp([!1,e])}handleGetAuthToken(e,t,i,n,r,o){return s(this,void 0,void 0,(function*(){const a=yield this.appSdkHost.getAppContext(),s=yield((e,t,i,n,r,o=!1,a=!1,s)=>{var l,c,u,d;const p=a&&n?(e=>Cd(e)||bd(e))(n):void 0;if((i.name===ed.teams||i.name===ed.teamsModern)&&t&&t.length>0&&(!n||n.isFullTrust||(h=n.id)&&-1!==kt.indexOf(h.toLowerCase()))){if(n){const i=fd().restrictedFullTrustOverrides;if(i){let o;if(i.forEach((e=>{e.appId===n.id&&(o=e)})),o)return((e,t,i,n,r,o)=>{var a;let s=!0;return n?t.forEach((t=>{var r;if(s){const o=Od(t,i);let a=!1;null===(r=n.resources)||void 0===r||r.forEach((n=>{if(!a&&n){const r=Od(n.resource,i);if(o===r)if(n.requireOriginMatch){try{const i=new URL(e),n=new URL(t);i.hostname===n.hostname&&(a=!0)}catch(e){}e===r&&(a=!0)}else a=!0}})),a||(s=!1)}})):s=!1,s?(r&&wd(t[0],r),Promise.resolve(t)):(t.length>=1&&(null===(a=null==o?void 0:o.addDetails)||void 0===a||a.call(o,{invalidResource:t[0],isRestrictedFullTrustValidation:!0})),Promise.reject("App resource defined in manifest and iframe origin do not match"))})(e,t,r,o,a?p:void 0,s)}}return a&&p&&wd(t[0],p),Promise.resolve(t)}var h;if(null===(l=null==n?void 0:n.webApplicationInfo)||void 0===l?void 0:l.resource){let i;return i=1===(null==t?void 0:t.length)&&("api://{teamSiteDomain}"===t[0]&&"https://{teamSiteDomain}"===(null===(c=null==n?void 0:n.webApplicationInfo)||void 0===c?void 0:c.resource)||"api://{mySiteDomain}"===t[0]&&"https://{mySiteDomain}"===(null===(u=null==n?void 0:n.webApplicationInfo)||void 0===u?void 0:u.resource))?Od(t[0],r):((e,t)=>{var i,n;return(null===(i=e.webApplicationInfo)||void 0===i?void 0:i.resource)&&Od(null===(n=e.webApplicationInfo)||void 0===n?void 0:n.resource,t)})(n,r),i&&(((e,t)=>{if(!e.startsWith("https:")&&!e.startsWith("api:"))return!1;if(!(e=e.replace("api://","https://"))||!t)return!1;if(e===t)return!0;if(fd().useStrictValidDomainRuleDetection)try{const i=new URL(t),n=new URL(e);return!(i.origin!==n.origin||!i.origin||!n.origin)}catch(e){return!1}else{if(!fd().useUrlClassForValidDomains){const n=fd().escapeRegExSpecialCharactersInValidDomains?(i=t)&&new URL(i).host.replace(gd,"\\$1"):md(t),r=Tt.validResourcePattern.replace(Tt.resourceDomainParameter,n);return new RegExp(r,"i").test(e)}try{const i=new URL(t),n=new URL(e);return!(i.hostname!==n.hostname||!i.origin||!n.origin)}catch(e){return!1}}var i})(i,e)||o)?(a&&p&&wd(i,p),Promise.resolve([i])):(i&&(null===(d=null==s?void 0:s.addDetails)||void 0===d||d.call(s,{invalidResource:i,isRestrictedFullTrustValidation:!1})),Promise.reject("App resource defined in manifest and iframe origin do not match"))}return Promise.reject("App webApplicationInfo or resource not defined in manifest")})(e.origin,t,this.appSdkHost.getHubInfo(),this.appDefinition,a,!1,!1,o),l=yield this.authenticationService.acquireToken(s[0],i,n,r,function(e){var t;return null===(t=null==e?void 0:e.getCustomScenario)||void 0===t?void 0:t.call(e)}(o));return yp([!0,l.token])}))}onGetAuthTokenError(e,t){return null==t||t.fail(`GetAuthToken failed ${Ep(e)}`),yp([!1,e])}}class nh extends ih{constructor(e,t,i){super(e,t,i),this.appAuthSdkHost=e,this.telemetryService=t,this.authenticationService=i}initHandlers(){super.initHandlers(),this.registerHandler(g,this.handleNotifySuccess),this.registerHandler(S,this.handleNotifyFailure)}handleNotifySuccess(e,t){return this.appAuthSdkHost.closeWindow(),this.appAuthSdkHost.stopAuthWindowMonitor(),Ip(this.authenticationService.notifySuccess,t)}handleNotifyFailure(e,t){return this.appAuthSdkHost.closeWindow(),this.appAuthSdkHost.stopAuthWindowMonitor(),Ip(this.authenticationService.notifyFailure,t,Qt.Other)}}const rh=e=>{if(null==e||null===typeof e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.map((e=>rh(e)));if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return"function"==typeof structuredClone?structuredClone(e):e.slice(0);if("object"==typeof e){const t={};for(const i of Object.getOwnPropertyNames(e)){const n=e[i];t[i]=rh(n)}return t}throw Error("Provided type '"+typeof e+"' ("+Object.prototype.toString.call(e)+") can't be cloned using deepCopy.")};class oh{constructor(e){this.appSdkHost=e,this.messageHandlers=[],this.TAG="BaseMessageProcessor",this.ValidCustomApiHubs=[ed.edge,ed.orange,ed.outlook,ed.outlookWin32,ed.teams,ed.teamsModern,ed.office]}process(e){var t;return s(this,void 0,void 0,(function*(){try{if(e.isDeeplyNestedRequest)throw new Error("Access denied: Request from a nested iframe is not allowed");const{result:t,message:i}=yield this.callMessageHandlerHelper(e);if(t)return"appResponse"===t.kind&&this.processHandlerResultHelper(i,t,e),Promise.resolve(!0);if(this.canUseCustomProcessing()){const t=yield this.tryCustomProcessing(i);if(t.processed){const n=yield yp(t.data);return"appResponse"===n.kind&&this.processHandlerResultHelper(i,n,e),Promise.resolve(!0)}}throw Error("Unhandled message")}catch(i){this.appSdkHost.getLogger().log(Zt.Error,this.TAG,`Error in processing request: ${null===(t=e.data)||void 0===t?void 0:t.func}`,i)}return Promise.resolve(!1)}))}canUseCustomProcessing(){const e=this.appSdkHost.getAppDefinition(),t=this.appSdkHost.getHubInfo().name,i=null==e?void 0:e.isMicrosoftOwned,n=Id(null==e?void 0:e.id),r=this.ValidCustomApiHubs.includes(t);return t===ed.outlookWin32||t===ed.outlook?n&&r:t===ed.office?!!fd().enableHarmonyCustomMessagingForOpalApp&&r&&!!(o=null==e?void 0:e.id)&&wt.has(o.toLowerCase()):!!i&&r;var o}processForDeeplyNestedRequest(e){var t;return s(this,void 0,void 0,(function*(){try{if(!e.isDeeplyNestedRequest)throw new Error("Access denied: Request from a main/top iframe is not allowed");if(!gp.has(e.data.func))throw new Error(`Access denied: message func "${e.data.func}" is not allowed for requests from a nested iframe.`);const{result:t,message:i}=yield this.callMessageHandlerHelper(e);if(t)return"appResponse"===t.kind&&this.processHandlerResultHelper(i,t,e,!0),Promise.resolve(!0);throw Error("Unhandled message")}catch(i){this.appSdkHost.getLogger().log(Zt.Error,this.TAG,`Error in processing deeply nested request: ${null===(t=e.data)||void 0===t?void 0:t.func}`,i)}return Promise.resolve(!1)}))}callMessageHandlerHelper(e){return s(this,void 0,void 0,(function*(){const t=Sd(e.origin,this.appSdkHost.getLogger(),this.appSdkHost.getAppDefinition(),this.appSdkHost.getContext());e.isTrustedOrigin=t,this.appSdkHost.getLogger().log(Zt.Info,this.TAG,`Function name: ${e.data.func}, Args: ${e.data.args}, Version_APIName: ${e.data.apiVersionTag}, Teams-JS Library Instance Id: ${e.data.teamsJsInstanceId}`);const i=(e=>{const{uuidAsString:t}=e,i=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i}(e,["uuidAsString"]);return Object.assign(Object.assign({},i),{uuid:new pd(t)})})(e.data);let n=i.args;const r=i.apiVersionTag;return n=i.args&&Array.isArray(i.args)?i.args.map((e=>{return t=e,"function"==typeof structuredClone?structuredClone(t):rh(t);var t})):[],n.unshift(e),{result:yield this.callMessageHandler(r,i.func,n,Jd(i.monotonicTimestamp,i.timestamp),i.isProxiedFromChild),message:i}}))}callMessageHandler(e,t,i,n,r){for(const o of this.messageHandlers)if(o.canHandleMessage(t))return o.handleMessage(e,t,i,n,r);return Promise.resolve(void 0)}tryCustomProcessing(e){return Promise.resolve({processed:!1,data:void 0})}processHandlerResultHelper(e,t,i,n=!1){let r=[];if(void 0!==t.data&&(r=Array.isArray(t.data)?t.data:[t.data]),n){const t={source:i.source,origin:i.origin,func:e.func};this.appSdkHost.postDeeplyNestedResponseToApp(e,t,r)}else this.appSdkHost.postResponseToApp(e,r)}cleanup(){this.messageHandlers.forEach((e=>e.cleanup()))}}class ah extends oh{constructor(e,t,i){super(e),this.appSdkHost=e,this.authService=t,this.telemetryService=i,this.messageHandlers.push(new nh(e,i,t)),this.messageHandlers.push(function(e,t,i,n,r,o,a){return fd().useNewAppInitializationExperience?new th(e,t,i,n,r,o,a):new xp(e,t,i,n,r,o,a)}(e,{},i)),this.messageHandlers.forEach((e=>e.initHandlers()))}}class sh extends Error{constructor(e,t){super(e),this.failureReason=t,this.message=e,this.name="HubSdkAuthServicesInternalError"}}class lh{constructor(e,t,i,n,r,o){this.hostWindow=e,this.context=t,this.authenticationService=i,this.logger=n,this.customTelemetryService=r,this.onAppInitStateChanged=o,this.initialized=!1,this.webContentSdkId=(new pd).toString(),this.initializeAuthenticationContext=e=>{var t;this.context=e,this.contextPromise=null===(t=this.authenticationService)||void 0===t?void 0:t.getUser().then((e=>{var t,i,n,r,o,a,s,l,c;const u=Object.assign(Object.assign({},null===(t=this.context)||void 0===t?void 0:t.user),{id:(null===(i=null==e?void 0:e.profile)||void 0===i?void 0:i.oid)||"",displayName:(null===(n=null==e?void 0:e.profile)||void 0===n?void 0:n.displayName)||"",loginHint:(null===(r=null==e?void 0:e.profile)||void 0===r?void 0:r.loginHint)||"",userPrincipalName:(null===(o=null==e?void 0:e.profile)||void 0===o?void 0:o.upn)||"",tenant:{id:(null===(a=null==e?void 0:e.profile)||void 0===a?void 0:a.tid)||"",sku:null===(c=null===(l=null===(s=this.context)||void 0===s?void 0:s.user)||void 0===l?void 0:l.tenant)||void 0===c?void 0:c.sku}}),d=Object.assign(Object.assign({},this.context.app),{userClickTime:this.getUserClickTime()}),p=Object.assign(Object.assign({},this.context),{app:d,user:u});return this.telemetryService.setAppContext(p),p}))},this.getContext=()=>this.context,this.getAppContext=()=>this.contextPromise?this.contextPromise.then((e=>e)).catch((()=>this.context)):Promise.resolve(this.context),this.getAppDefinition=()=>this.appDefinition,this.checkIfCachedAndRequestAllowed=e=>!0,this.setAppInitInfo=e=>{this.onAppInitStateChanged&&this.onAppInitStateChanged(e)},this.getLogger=()=>this.logger,this.telemetryService=new op(this.getHubInfo(),t,this.customTelemetryService),this.context.app.userClickTime&&(this.userClickTime=this.context.app.userClickTime),this.context.app.userClickTimeV2&&(this.userClickTimeV2=this.context.app.userClickTimeV2)}getTelemetryService(){return this.telemetryService}getWebContentSdkId(){return this.webContentSdkId}isInitialized(){return this.initialized}setInitialized(e){this.initialized=e}getHubInfo(){return{name:this.context.app.host.name,version:this.context.app.host.version,clientType:this.context.app.host.clientType,sessionId:this.context.app.host.sessionId}}createTelemetryScenarioForAppTermination(e,t){var i,n;const r=this.telemetryService.createScenario("appTermination",e.id);null===(i=r.addOrUpdateActivityDataField)||void 0===i||i.call(r,op.APP_TERMINATE_REASON,t),null===(n=r.addOrUpdateActivityDataField)||void 0===n||n.call(r,op.WEB_CONTENT_SDK_ID,this.webContentSdkId),r.stop()}createTelemetryScenarioForUnloadSdk(e){var t,i,n;const r=this.telemetryService.createScenario("sdkUnload",null===(t=this.appDefinition)||void 0===t?void 0:t.id);null===(i=r.addOrUpdateActivityDataField)||void 0===i||i.call(r,op.WEB_CONTENT_SDK_ID,this.webContentSdkId),null===(n=r.addOrUpdateActivityDataField)||void 0===n||n.call(r,op.COMM_BRIDGE_ID,(null==e?void 0:e.toString())||"unknown"),r.stop()}createTelemetryScenarioForWebContentSdkCreated(e,t){var i,n,r;const o=this.telemetryService.createScenario("webContentSdkCreated");null===(i=o.addOrUpdateActivityDataField)||void 0===i||i.call(o,op.WEB_CONTENT_SDK_ID,this.webContentSdkId),null===(n=o.addOrUpdateActivityDataField)||void 0===n||n.call(o,op.COMM_BRIDGE_ID,(null==t?void 0:t.toString())||"unknown"),null===(r=o.addOrUpdateActivityDataField)||void 0===r||r.call(o,op.COMM_BRIDGE_LISTENERS_ADDED,e),o.stop()}createTelemetryScenarioForSetFrameAndLoadOrigin(e,t,i,n,r,o){var a,s,l,c,u,d,p,h;const v=null===(a=this.telemetryService)||void 0===a?void 0:a.createScenario("setFrameAndLoadOrigin");null===(s=v.addOrUpdateActivityDataField)||void 0===s||s.call(v,op.WEB_CONTENT_SDK_ID,this.webContentSdkId),null===(l=v.addOrUpdateActivityDataField)||void 0===l||l.call(v,op.COMM_BRIDGE_ID,(null==o?void 0:o.toString())||"unknown"),null===(c=v.addOrUpdateActivityDataField)||void 0===c||c.call(v,op.COMM_BRIDGE_LISTENERS_ADDED,e),null===(u=v.addOrUpdateActivityDataField)||void 0===u||u.call(v,op.APP_DEFINITION,JSON.stringify(t)),null===(d=v.addOrUpdateActivityDataField)||void 0===d||d.call(v,op.CACHEDAPP_IND_FIELD_NAME,!!n),null===(p=v.addOrUpdateActivityDataField)||void 0===p||p.call(v,op.USER_CLICK_TIME,i),r&&(null===(h=v.addOrUpdateActivityDataField)||void 0===h||h.call(v,op.USER_CLICK_TIME_V2,r)),v.stop()}getHostWindow(){return this.hostWindow}getFrameContext(){return this.context.page.frameContext}getRenderingSurface(){return this.context.page.renderingSurface}getUserClickTime(){return this.userClickTime}setUserClickTime(e){this.userClickTime=e}getUserClickTimeV2(){return this.userClickTimeV2}setUserClickTimeV2(e){this.userClickTimeV2=e}startAppInitializationScenario(){var e,t,i;const n=Jd(this.getUserClickTimeV2(),this.getUserClickTime());this.appInitializationScenario=null===(e=this.telemetryService)||void 0===e?void 0:e.createScenario("appInitialization",void 0,n.value,void 0,n.type),null===(i=(t=this.appInitializationScenario).addOrUpdateActivityDataField)||void 0===i||i.call(t,op.WEB_CONTENT_SDK_ID,this.webContentSdkId)}getAppInitializationScenario(){return this.appInitializationScenario}}const ch="HostedWebContentAuthSdkService";class uh extends lh{constructor(e,t,i,n,r,o,a,l){super(e,r,n,o,a,void 0),this.hostWindow=e,this.openWindowInfo=t,this.appDefinition=i,this.authenticationService=n,this.context=r,this.logger=o,this.onExternalAuthenticationComplete=(e,t)=>{e?this.authenticationService.notifySuccess(t):(t!==Dt&&t!==Ft||this.logger.log(Zt.Error,ch,t),this.authenticationService.notifyFailure(t))},this.onAuthMessageReceived=e=>s(this,void 0,void 0,(function*(){if(!this.authWindow||this.authWindow!==e.source)return;const t=e.origin;t!==this.origin&&this.checkUrlIsValid(t)&&(this.origin=e.origin),this.origin===t&&this.messageProcessor&&(yield this.messageProcessor.process(function(e){var t;return{data:e.data,isDeeplyNestedRequest:!1,origin:e.origin,source:null!==(t=e.source)&&void 0!==t?t:void 0}}(e)))})),this.setupAuthMessageHandlers=()=>{this.authenticationService&&(this.messageProcessor=new ah(this,this.authenticationService,this.telemetryService))};try{this.passContextForUrlValidation=fd().authExtensionContextForUrlValidation,this.context.app.host.clientType!==rd.desktop||this.authenticationService.externalAuthService||this.logger.log(Zt.Warn,ch,Lt),this.context.page.frameContext!==od.authentication&&this.notifyAsFailureAndThrowError("Invalid frame context for scenario",Qt.InvalidFrameContext),this.appDefinition||this.notifyAsFailureAndThrowError("App definition not available",Qt.AppDefinitionUnavailable),this.telemetryService.setAppDefinition(this.appDefinition),this.checkUrlIsValid(t.url)||this.notifyAsFailureAndThrowError("Auth url is not valid",Qt.InvalidAuthUrl),this.shouldUseExternalAuthenticationWorkflow(r.app.host.clientType,l)?this.launchExternalAuthenticationWorkflow(t.url):this.launchEmbeddedAuthenticationWorkflow(r,t)}catch(e){let t,i="",n=!1;if(e instanceof sh?(i=e.message,t=e.failureReason,n=!1):e instanceof Error?(i=e.message,t=Qt.Other,n=!1):(i="Unknown error",t=Qt.Other,n=!0),this.authenticationService&&this.authenticationService.notifyFailure(i,t),o.log(Zt.Error,ch,`Error in constructor: ${i}, failure reason: ${t}`),n)throw e}}launchEmbeddedAuthenticationWorkflow(e,t){const i=function(e){let t="";return e.width&&e.height&&(t=`width=${e.width},height=${e.height}`,void 0!==e.left&&void 0!==e.top&&(t=`${t},left=${e.left},top=${e.top}`)),t}(t);if(e.app.host.clientType===rd.desktop&&this.authenticationService.externalAuthService)try{this.authWindow=this.authenticationService.externalAuthService.openUrlInEmbeddedBrowser(new URL(t.url),i)}catch(e){null!==this.authWindow&&(this.logger.log(Zt.Error,ch,`openUrlInEmbeddedBrowser threw an error but still returned a non-null window object? Forcing window object to null. Error = ${e}`),this.authWindow=null)}else this.authWindow=this.hostWindow.open(t.url,"appAuthWindow",i);if(!this.authWindow)throw e.app.host.clientType===rd.web&&l.dispatch("authWindowBlocked"),new sh("URL was unable to be opened in embedded browser",Qt.BlockedByBrowser);this.setupEmbeddedAuthWindow(t.url,e,this.hostWindow)}launchExternalAuthenticationWorkflow(e){const t=Yt.startNewExternalAuthSession(e,this.onExternalAuthenticationComplete,this.authenticationService.externalAuthRedirectUrl);try{this.authenticationService.externalAuthService?this.authenticationService.externalAuthService.openUrlInExternalBrowser(t):this.hostWindow.open(t)}catch(e){throw new sh("Failed to open the URL in external browser",Qt.Other)}}shouldUseExternalAuthenticationWorkflow(e,t){return e===rd.desktop&&!0===t}notifyAsFailureAndThrowError(e,t){throw this.authenticationService&&this.authenticationService.notifyFailure(e,t),new sh(`Failure message: ${e}, failure reason: ${t}`)}setupEmbeddedAuthWindow(e,t,i){var n;this.origin=e,this.setUserClickTime(null!==(n=t.app.userClickTime)&&void 0!==n?n:Date.now()),t.app.userClickTimeV2&&this.setUserClickTimeV2(t.app.userClickTimeV2),this.setupAuthMessageHandlers(),this.globalWindowEventListener=new $t(i),this.globalWindowEventListener.addListener("message",this.onAuthMessageReceived),this.startAuthWindowMonitor(),this.initializeAuthenticationContext(t)}checkUrlIsValid(e){return this.passContextForUrlValidation?Sd(e,this.logger,this.appDefinition,this.context):Sd(e,this.logger,this.appDefinition)}getHostWindow(){return this.authWindow||null}postResponseToApp(e,t){this.sendResponseMessage(e,t)}postDeeplyNestedResponseToApp(){throw new Error("Auth window does not support nested request communication")}isWindowOpen(){return!!this.authWindow&&!this.authWindow.closed}closeWindow(){this.unloadApp(this.appDefinition)}sendResponseMessage(e,t){var i;if(this.origin){const n={id:e.id,uuidAsString:null===(i=e.uuid)||void 0===i?void 0:i.toString(),args:t,origin:this.origin,monotonicTimestamp:Xd()};this.postMessage(n)}}sendRequestMessage(e,t){if(this.origin){const i={func:e,args:t,monotonicTimestamp:Xd()};this.postMessage(i)}}startAuthWindowMonitor(){this.stopAuthWindowMonitor(),this.authWindowMonitor=this.hostWindow.setInterval((()=>{this.authWindowInterval()}),100)}authWindowInterval(){this.isWindowOpen()?this.sendRequestMessage("ping"):(this.HandleError("CancelledByUser",Qt.CancelledByUser),this.closeWindow(),this.stopAuthWindowMonitor())}stopAuthWindowMonitor(){this.authWindowMonitor&&(this.hostWindow.clearInterval(this.authWindowMonitor),this.authWindowMonitor=void 0)}unloadApp(e){var t;this.unloadSDK(),null===(t=this.authWindow)||void 0===t||t.close()}unloadSDK(){this.globalWindowEventListener&&this.globalWindowEventListener.removeListener("message")}postMessage(e){var t;this.origin&&(null===(t=this.authWindow)||void 0===t||t.postMessage(e,this.origin))}HandleError(e,t){this.authenticationService&&this.authenticationService.notifyFailure(e,t)}}const dh={Debug:console.debug,Info:console.log,Warn:console.warn,Error:console.error};class ph{log(e,t,i,n){dh[e](`[LoggerService] tag: ${t}, level: ${e}, message: ${i}, exception: `,n||"undefined")}}var hh,vh;!function(e){e.Success="success",e.Failure="failure"}(hh||(hh={})),function(e){e.AuthConfig="AuthConfig"}(vh||(vh={}));const fh=window.chrome.webview;class mh extends n{data;constructor(e){super(),this.data=e}getUser=async()=>({profile:{oid:this.data.userObjectId||"",tid:this.data.tenantId||"",upn:this.data.userPrincipalName||"",loginHint:this.data.loginHint||""}});notifySuccess=async e=>{gh(this.data.type,hh.Success,e)};notifyFailure=async e=>{gh(this.data.type,hh.Failure,e)};acquireToken=async(e,t,i)=>(gh(this.data.type,hh.Failure,"acquireToken in MetaOSAuthExtension is not implemented"),{token:""})}function gh(e,t,i){fh?.postMessage({eventType:e,status:t,data:i})}fh?.addEventListener("message",(e=>{e.data&&e.data.type===vh.AuthConfig&&function(e){const t=e.validDomains?e.validDomains.split(","):[];new uh(window,{url:e.targetUrl,width:e.width,height:e.height,left:e.left,top:e.right},{id:e.appId||"",validDomains:t,showLoadingIndicator:e.showLoadingIndicator,version:e.appVersion||"",devicePermissions:[],isFullTrust:!1,isLOB:!1,pages:{configurable:[],static:[]},manifestVersion:""},new mh(e),{app:{locale:e.locale||"en-US",theme:e.isDarkMode?id.dark:id.default,host:{name:ed.outlookWin32,clientType:rd.desktop,version:e.clientVersion,sessionId:e.hostSessionId},sessionId:e.sessionId},page:{id:"defaultId",frameContext:od.authentication},user:{dataResidency:e.dataResidency}},new ph)||gh(e.type,hh.Failure,"MetaOSAuthExtension is null")}(e.data)}))})();