Mini Kabibi Habibi
(()=>{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,safeSrc:s,t:l}=i(6516),c=i(6633),{compareIdentifiers:u}=i(2329);class d{constructor(e,t){if(t=c(t),e instanceof d){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[l.LOOSE]:a[l.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 d)){if("string"==typeof e&&e===this.version)return 0;e=new d(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof d||(e=new d(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof d||(e=new d(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 u(i,r)}while(++t)}compareBuild(e){e instanceof d||(e=new d(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 u(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=new RegExp(`^${this.options.loose?s[l.PRERELEASELOOSE]:s[l.PRERELEASE]}$`),i=`-${t}`.match(e);if(!i||i[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===u(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=d},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.NUMERICIDENTIFIER]}|${c[d.NONNUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${c[d.NUMERICIDENTIFIERLOOSE]}|${c[d.NONNUMERICIDENTIFIER]})`),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=>{"use strict";e.exports={rE:"8.3.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),k=i(7625),R=i(9332),P=i(9398),D=i(9433),F=i(6652),x=i(7457),L=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:k,coerce:R,Comparator:P,Range:D,satisfies:F,toComparators:x,maxSatisfying:L,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=>R(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=k(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}))},k=(e,t)=>(l("replaceStars",e,t),e.trim().replace(u[d.STAR],"")),R=(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}}(),(()=>{"use strict";class e{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 t=function(e,i){return t=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])},t(e,i)};function n(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var r=function(){return r=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},r.apply(this,arguments)};function o(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 a=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()))}},s=i(8686).rE,l="appInitialization.appLoaded",c="appInitialization.expectedFailure",u="appInitialization.failure",d="appInitialization.success",p="authentication.getAuthToken",h="authentication.getUser",v="authentication.authenticate",f="authentication.authenticate.success",m="authentication.authenticate.failure",g="calendar.composeMeeting",S="calendar.openCalendarItem",y="clipboard.writeToClipboard",A="clipboard.readFromClipboard",I="conversations.openConversation",E="conversations.closeConversation",T="getChatMembers",C={sendCustomTelemetryData:"copilot.customTelemetry.sendCustomTelemetryData"},b={getEligibilityInfo:"copilot.eligibility.getEligibilityInfo"},w="tasks.startTask",O="tasks.completeTask",k={resize:"tasks.updateTask"},R="externalAppCardActions.processActionOpenUrl",P="externalAppCardActions.processActionSubmit",D="externalAppCardActionsForCEA.processActionOpenUrl",F="externalAppCardActionsForCEA.processActionSubmit",x="externalAppCommands.processActionCommand",L="externalAppAuthentication.authenticateAndResendRequest",N="externalAppAuthentication.authenticateWithSSO",_="externalAppAuthentication.authenticateWithSSOAndResendRequest",M="externalAppAuthentication.authenticateWithOauth2",U="externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins",$="externalAppAuthenticationForCEA.authenticateWithSSO",z="externalAppAuthenticationForCEA.authenticateWithOauth",H="externalAppAuthenticationForCEA.authenticateAndResendRequest",V="externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest",W="files.addCloudStorageFolder",B="files.copyMoveFiles",j="files.deleteCloudStorageFolder",G="files.getCloudStorageFolders",K="openFilePreview",q="files.getExternalProviders",X="files.getCloudStorageFolderContents",J="getContext",Y="initialize",Q={addAndConfigure:"hostEntity.tab.addAndConfigure",reconfigure:"hostEntity.tab.reconfigure",rename:"hostEntity.tab.rename",remove:"hostEntity.tab.remove",getAll:"hostEntity.tab.getAll"},Z="location.getLocation",ee={showLocation:"location.showLocation"},te="interactive.getFluidTenantInfo",ie="interactive.getFluidToken",ne="interactive.getFluidContainerId",re="interactive.setFluidContainerId",oe="interactive.getNtpTime",ae="interactive.registerClientId",se="interactive.getClientRoles",le="interactive.getClientInfo",ce="mail.composeMail",ue="mail.openMailItem",de="marketplace.getCart",pe="marketplace.addOrUpdateCartItems",he="marketplace.removeCartItems",ve="marketplace.updateCartStatus",fe="captureImage",me="getMedia",ge="selectMedia",Se="viewImages",ye="meeting.getAppContentStageSharingCapabilities",Ae="meeting.getAppContentStageSharingState",Ie="meeting.getAuthenticationTokenForAnonymousUser",Ee="getIncomingClientAudioState",Te="meeting.getLiveStreamState",Ce="meeting.getMeetingDetails",be={setOptions:"meeting.appShareButton.setOptions"},we="meeting.requestStartLiveStreaming",Oe="meeting.requestStopLiveStreaming",ke="meeting.shareAppContentToStage",Re="meeting.stopSharingAppContentToStage",Pe="toggleIncomingClientAudio",De="meeting.requestAppAudioHandling",Fe="meeting.updateMicState",xe="meeting.joinMeeting",Le="meetingRoom.getPairedMeetingRoomInfo",Ne="meetingRoom.sendCommandToPairedMeetingRoom",_e="nestedAppAuth.execute",Me="nestedAppAuth.manageNAATrustedOrigins",Ue="settings.getSettings",$e="navigateCrossDomain",ze="pages.navigateToApp",He="returnFocus",Ve="setFrameContext",We="shareDeepLink",Be={navigateBack:"navigateBack"},je={navigateTo:"pages.currentApp.navigateTo",navigateToDefaultPage:"pages.currentApp.navigateToDefaultPage"},Ge={getTabInstances:"getTabInstances",getMruTabInstances:"getMruTabInstances",navigateToTab:"navigateToTab"},Ke={setConfig:"settings.setSettings",setValidityState:"settings.setValidityState",save:{success:"settings.save.success",failure:"settings.save.failure"},remove:{success:"settings.remove.success",failure:"settings.remove.failure"}},qe={enterFullscreen:"enterFullscreen",exitFullscreen:"exitFullscreen"},Xe={getPermissionStatus:"permissions.has"},Je="permissions.request",Ye="remoteCamera.getCapableParticipants",Qe="remoteCamera.requestControl",Ze="remoteCamera.sendControlCommand",et="remoteCamera.terminateSession",tt="readyToUnload",it="registerHandler",nt="search.unregister",rt="search.closeSearch",ot="stageView.open",at={close:"stageView.self.close"},st="store.openFullStore",lt="store.openAppDetail",ct="store.openInContextStore",ut="store.openSpecificStore",dt="teams.getTeamChannels",pt="teams.refreshSiteUrl",ht={getConfigSetting:"getConfigSetting",joinedTeams:{getUserJoinedTeams:"getUserJoinedTeams"}};var vt,ft,mt,gt;!function(e){e.ME="ME",e.CEA="CEA"}(vt||(vt={})),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"}(ft||(ft={})),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"}(mt||(mt={})),function(e){e.PermissionError="PermissionError",e.NotFound="NotFound",e.Throttling="Throttling",e.Offline="Offline",e.Other="Other"}(gt||(gt={}));const St={resourceDomainParameter:"{resourceDomain}",validResourcePattern:"^((https|api)://{resourceDomain}([:/].*)?)$"},yt=/^(\*\.)*[^*]+$/i,At=new Set(["b5abf2ae-c16b-4310-8f8a-d3bcdb52f162","d870f6cd-4aa5-4d42-9626-ab690c041429","43a6e7fb-bd10-4c0a-b02e-6a9c86ba272a"]),It=new Set(["f3a6e67f-850d-4dd9-960a-04c6638ded39","f3a6e67f-850d-4dd9-960a-04c6638ded36","b6b18421-3bba-40df-a983-05fbbc9e2d13","a9750531-44bc-4346-84a7-c4ceda140ef4"]),Et=["com.example.microsoftteamstabs.test","com.example.m365testapp.test"],Tt=new Set([...At,...Et]),Ct="Authorization code exceeds max length of 4096 characters",bt="Authorization code contains unexpected characters. Allowed characters are a-z, A-Z, 0-9, ., _, +, /, =, ~, and -",wt="Desktop clients must provide implementation for externalAuthService on IAuthenticationService. External auth flows may not work as expected when externalAuthService is not provided.",Ot="App does not have the required permissions for this operation",kt=["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"],Rt="2.19",Pt="The detected TeamsJS Version is < 2.19. App may not be able to run on this domain. Please update TeamsJS.",Dt=["localhost","local.teams.office.com","local.teams.microsoft.com","local.office.com"];class Ft{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 xt,Lt=new Uint8Array(16);function Nt(){if(!xt&&!(xt="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 xt(Lt)}const _t=/^(?:[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,Mt=function(e){return"string"==typeof e&&_t.test(e)};for(var Ut=[],$t=0;$t<256;++$t)Ut.push(($t+256).toString(16).substr(1));const zt=function(e,t,i){var n=(e=e||{}).random||(e.rng||Nt)();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=(Ut[e[t+0]]+Ut[e[t+1]]+Ut[e[t+2]]+Ut[e[t+3]]+"-"+Ut[e[t+4]]+Ut[e[t+5]]+"-"+Ut[e[t+6]]+Ut[e[t+7]]+"-"+Ut[e[t+8]]+Ut[e[t+9]]+"-"+Ut[e[t+10]]+Ut[e[t+11]]+Ut[e[t+12]]+Ut[e[t+13]]+Ut[e[t+14]]+Ut[e[t+15]]).toLowerCase();if(!Mt(i))throw TypeError("Stringified UUID is invalid");return i}(n)},Ht="{authId}",Vt="authId",Wt="result",Bt=(()=>{const e={};return{startNewExternalAuthSession:(t,i,n)=>{const r=(e=>{const t=new URL(e).searchParams.get(Vt);return t&&t!==Ht?t:zt()})(t);return t=t.replace("{oauthRedirectMethod}","deeplink").replace(Ht,r).replace("{hostRedirectUrl}",n?((e,t)=>{const i=new URL(e);i.searchParams.delete(Vt),i.searchParams.delete(Wt);const n=decodeURIComponent(i.searchParams.toString()),r=""===n.trim();i.search="";const o=`${n}${r?"":"&"}`;return encodeURIComponent(`${i.toString()}?${o}${Vt}=${t}&${Wt}={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,Ct):r.test(i)?n.handler(!0,i):n.handler(!1,bt),delete e[t]}}}}})();var jt,Gt,Kt;!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"}(jt||(jt={})),(Kt=Gt||(Gt={})).Debug="Debug",Kt.Info="Info",Kt.Warn="Warn",Kt.Error="Error";const qt="api.appInitialization.sdkLoaded",Xt={[Y]:"api.appInitialization.initialize",[l]:"api.appInitialization.appLoaded",[d]:"api.appInitialization.success",[u]:"api.appInitialization.failure",[c]:"api.appInitialization.expectedFailure","appEntity.selectAppEntity":"api.appEntity.selectAppEntity","appInstallDialog.openAppInstallDialog":"api.appInstallDialog.openAppInstallDialog",[v]:"api.authentication.authenticate",[p]:"api.getAuthToken",[h]:"api.getUser",[m]:"api.authentication.notifyFailure",[f]:"api.authentication.notifySuccess","media.scanBarCode":"api.barCode.scanBarCode",[g]:"api.calendar.composeMeeting",[S]:"api.calendar.openCalendarItem","call.startCall":"api.call.startCall","chat.openChat":"api.chat.openChat",[A]:"api.clipboard.readFromClipboard",[y]:"api.clipboard.writeToClipboard",[E]:"api.conversations.closeConversation",[T]:"api.conversations.getChatMembers",[I]:"api.conversations.openConversation",[b.getEligibilityInfo]:"api.copilot.eligibility.getEligibilityInfo",[C.sendCustomTelemetryData]:"api.copilot.customTelemetry.sendCustomTelemetryData",[w]:"api.dialogs.open",[O]:"api.dialogs.submit",[k.resize]:"api.dialogs.update.resize",[L]:"api.externalAppAuthentication.authenticateAndResendRequest",[M]:"api.externalAppAuthentication.authenticateWithOauth",[U]:"api.externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins",[N]:"api.externalAppAuthentication.authenticateWithSSO",[_]:"api.externalAppAuthentication.authenticateWithSSOAndResendRequest",[H]:"api.externalAppAuthenticationForCEA.authenticateAndResendRequest",[V]:"api.externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest",[z]:"api.externalAppAuthenticationForCEA.authenticateWithOauth",[$]:"api.externalAppAuthenticationForCEA.authenticateWithSSO",[R]:"api.externalAppCardActions.processActionOpenUrl",[P]:"api.externalAppCardActions.processActionSubmit",[D]:"api.externalAppCardActionsForCEA.processActionOpenUrl",[F]:"api.externalAppCardActionsForCEA.processActionSubmit","externalAppCardActionsForDA.processActionOpenUrlDialog":"api.externalAppCardActionsForDA.processActionOpenUrlDialog",[x]:"api.externalAppCommands.processActionCommand",[W]:"api.files.addCloudStorageFolder",[B]:"api.files.copyMoveFiles",[j]:"api.files.deleteCloudStorageFolder",[X]:"api.files.getCloudStorageFolderContents",[G]:"api.files.getCloudStorageFolders",[q]:"api.files.getExternalProviders",[K]:"api.files.openFilePreview",[J]:"api.getContext",[Q.addAndConfigure]:"api.hostEntity.tab.addAndConfigure",[Q.reconfigure]:"api.hostEntity.tab.reconfigure",[Q.rename]:"api.hostEntity.tab.rename",[Q.remove]:"api.hostEntity.tab.remove",[Q.getAll]:"api.hostEntity.tab.getAll",[le]:"api.interactive.getClientInfo",[se]:"api.interactive.getClientRoles",[ne]:"api.interactive.getFluidContainerId",[te]:"api.interactive.getFluidTenantInfo",[ie]:"api.interactive.getFluidToken",[oe]:"api.interactive.getNtpTime",[ae]:"api.interactive.registerClientId",[re]:"api.interactive.setFluidContainerId",executeDeepLink:"api.links.openLink",[Z]:"api.location.getCurrentLocation",[ee.showLocation]:"api.location.map.showLocation",[ce]:"api.mail.composeMail",[ue]:"api.mail.openMailItem",[pe]:"api.marketplace.addOrUpdateCartItems",[de]:"api.marketplace.getCart",[he]:"api.marketplace.removeCartItems",[ve]:"api.marketplace.updateCartStatus",[fe]:"api.media.captureImage",[me]:"api.media.getMedia",[ge]:"api.media.selectMedia",[Se]:"api.media.viewImages",[be.setOptions]:"api.meeting.appShareButton.setOptions",[ye]:"api.meeting.getAppContentStageSharingCapabilities",[Ae]:"api.meeting.getAppContentStageSharingState",[Ie]:"api.meeting.getAuthenticationTokenForAnonymousUser",[Ee]:"api.meeting.getIncomingClientAudioState",[Te]:"api.meeting.getLiveStreamState",[Ce]:"api.meeting.getMeetingDetails",[xe]:"api.meeting.joinMeeting",[De]:"api.meeting.requestAppAudioHandling",[we]:"api.meeting.requestStartLiveStreaming",[Oe]:"api.meeting.requestStopLiveStreaming",[ke]:"api.meeting.shareAppContentToStage",[Re]:"api.meeting.stopSharingAppContentToStage",[Pe]:"api.meeting.toggleIncomingClientAudio",[Fe]:"api.meeting.updateMicState",[Le]:"api.meetingRoom.getPairedMeetingRoomInfo",[Ne]:"api.meetingRoom.sendCommandToPairedMeetingRoom","monetization.openPurchaseExperience":"api.monetization.openPurchaseExperience",[_e]:"api.nestedAppAuth.execute",[Me]:"api.nestedAppAuth.manageNAATrustedOrigins","notifications.showNotification":"api.notifications.showNotification",[Be.navigateBack]:"api.pages.backStack.navigateBack",[Ke.remove.failure]:"api.pages.config.remove.failure",[Ke.remove.success]:"api.pages.config.remove.success",[Ke.save.failure]:"api.pages.config.save.failure",[Ke.save.success]:"api.pages.config.save.success",[Ke.setConfig]:"api.pages.config.setConfig",[Ke.setValidityState]:"api.pages.config.setValidityState",[je.navigateTo]:"api.pages.currentApp.navigateTo",[je.navigateToDefaultPage]:"api.pages.currentApp.navigateToDefaultPage",[qe.enterFullscreen]:"api.pages.fullTrust.enterFullscreen",[qe.exitFullscreen]:"api.pages.fullTrust.exitFullscreen",[Ue]:"api.pages.getConfig",[$e]:"api.pages.navigateCrossDomain",[ze]:"api.pages.navigateToApp",[He]:"api.pages.returnFocus",[Ve]:"api.pages.setCurrentFrame",[We]:"api.pages.shareDeepLink",[Ge.getMruTabInstances]:"api.pages.tabs.getMruTabInstances",[Ge.getTabInstances]:"api.pages.tabs.getTabInstances",[Ge.navigateToTab]:"api.pages.tabs.navigateToTab","people.selectPeople":"api.people.selectPeople",[Je]:"api.permissions.requestUserConsentForPermission",[Xe.getPermissionStatus]:"api.permissions.storageService.getPermissionStatus","profile.showProfile":"api.profile.showProfile",[it]:"api.registerHandler",[Ye]:"api.remoteCamera.getCapableParticipants",[Qe]:"api.remoteCamera.requestControl",[Ze]:"api.remoteCamera.sendControlCommand",[et]:"api.remoteCamera.terminateSession",[rt]:"api.search.closeSearch",[nt]:"api.search.unregister",[ot]:"api.stageView.open",[at.close]:"api.stageView.self.close",[st]:"api.store.openFullStore",[lt]:"api.store.openAppDetail",[ct]:"api.store.openInContextStore",[ut]:"api.store.openSpecificStore",[ht.getConfigSetting]:"api.teams.fullTrust.getConfigSetting",[ht.joinedTeams.getUserJoinedTeams]:"api.teams.fullTrust.joinedTeams.getUserJoinedTeams",[dt]:"api.teams.getTeamChannels",[pt]:"api.teams.refreshSiteUrl","webStorage.isWebStorageClearedOnUserLogOut":"api.webStorage.isWebStorageClearedOnUserLogOut"},Jt=new Map([[Y,"initialize"],[l,"appLoaded"],[d,"success"],[u,"failure"],[c,"expectedFailure"]]);var Yt,Qt=(Yt=[],{fireEvent:function(e){Yt.forEach((function(t){return t(e)}))},addListener:function(e){e&&Yt.push(e)}});function Zt(e,t,i){Qt.fireEvent({level:e,category:t,message:i})}function ei(e,t,i){Zt(0,e,(function(){var e=i instanceof Error?i.message:"";return"".concat(t,": ").concat(e)}))}var ti={};function ii(e,t){"Office."===e.substring(0,7)&&"."!==e[e.length-1]?ti[e]?(t.ariaTenantToken&&(ti[e].ariaTenantToken=t.ariaTenantToken),t.dnmToken&&(ti[e].dnmToken=t.dnmToken)):ti[e]=t:Zt(0,0,(function(){return"Namespace: ".concat(e)}))}function ni(e,t){for(var i=e.length;i>0;){var n=e.substr(0,i);if(ti[n]){var r=ti[n];return t.ariaTenantToken=r.ariaTenantToken,t.dnmToken=r.dnmToken,!0}i=e.lastIndexOf(".",i-1)}return!1}var ri=9007199254740991,oi=-ri,ai=/^Office(\.[A-Z][a-zA-Z0-9]*){2,}$/,si=/^[a-zA-Z0-9_\.]{1,95}$/;function li(e){return si.test(e)}function ci(e){e&&e.forEach((function(e){if("string"!=typeof e.name||!li(e.name))throw new Error("Invalid dataField name");2===e.dataType&&function(e){if("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e<oi||e>ri)throw new Error("Invalid integer ".concat(JSON.stringify(e)))}(e.value)}))}function ui(e,t,i){return hi(e,1,t,i)}function di(e,t,i){return hi(e,2,t,i)}function pi(e,t,i){return hi(e,0,t,i)}function hi(e,t,i,n){return{name:e,dataType:t,value:i,classification:n||4}}function vi(e){var t={eventName:e.eventName,eventFlags:e.eventFlags||{},telemetryProperties:e.telemetryProperties?r({},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 fi,mi,gi,Si,yi,Ai,Ii,Ei=function(){function e(e,t,i){var n,o,a;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=r(r({},e.getConfig()),this.config),(o=this.partAFields).push.apply(o,e.partAFields)),t&&(a=this.persistentDataFields).push.apply(a,t)}return e.prototype.addEventContentType=function(e,t){e.push(di("EventContent.Type",t))},e.prototype.sendTelemetryEvent=function(e){var t=vi(e),i=t.telemetryProperties;i.nexusTenantToken=-1;var n=i.ariaTenantToken;n||ni(t.eventName,i)||n?this.sendTelemetryEventInternal(t,1):Zt(0,0,(function(){return"No tenant token: "+e.eventName}))},e.prototype.sendNonStandardEvent=function(e,t){var i=vi(e);this.sendTelemetryEventInternal(i,t)},e.prototype.sendCustomerContent=function(e){var t=vi(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=vi(e),i=t.telemetryProperties;i.dnmToken||ni(t.eventName,i)||i.dnmToken?(this.addEventContentType(t.dataFields,1),this.sendTelemetryEventInternal(t,3)):Zt(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]):Zt(1,0,(function(){return"No telemetry sinks are attached."})));this.processTelemetryEvent(e,t)}catch(e){return void ei(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 Zt(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(pi("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||!ai.test(t))throw new Error("Invalid eventName");var t,i=e.eventContract;if(i){if(i.name&&!li(i.name))throw new Error("Invalid eventContract");ci(i.dataFields)}ci(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){ii(e,{ariaTenantToken:t,nexusTenantToken:i})},e.prototype.setDNMToken=function(e,t){ii(e,{dnmToken:t})},e.prototype.cloneEvent=function(e){return vi(e)},e.prototype.getConfig=function(){return this.config},e}();!function(e){e.getFields=function(e,t){var i=[];return i.push(di("".concat(e,".Code"),t.code)),void 0!==t.type&&i.push(pi("".concat(e,".Type"),t.type)),void 0!==t.tag&&i.push(di("".concat(e,".Tag"),t.tag)),void 0!==t.isExpected&&i.push(ui("".concat(e,".IsExpected"),t.isExpected)),i.push(pi("zC.Activity.Result","Office.System.Result")),i}}(fi||(fi={})),function(e){e.contractName="Office.System.Activity",e.getFields=function(t){var i="Activity",n=[];return void 0!==t.cV&&n.push(pi("".concat(i,".CV"),t.cV)),n.push(di("".concat(i,".Duration"),t.duration)),n.push(di("".concat(i,".Count"),t.count)),n.push(di("".concat(i,".AggMode"),t.aggMode)),void 0!==t.success&&n.push(ui("".concat(i,".Success"),t.success)),void 0!==t.result&&n.push.apply(n,fi.getFields("".concat(i,".Result"),t.result)),n.push(pi("zC.Activity",e.contractName)),n}}(mi||(mi={})),function(e){e.getFields=function(e,t){var i=[];return void 0!==t.id&&i.push(pi("".concat(e,".Id"),t.id)),void 0!==t.version&&i.push(pi("".concat(e,".Version"),t.version)),void 0!==t.sessionId&&i.push(pi("".concat(e,".SessionId"),t.sessionId)),i}}(gi||(gi={})),function(e){e.getFields=function(e,t){var i=[];return void 0!==t.alias&&i.push(pi("".concat(e,".Alias"),t.alias)),void 0!==t.primaryIdentityHash&&i.push(pi("".concat(e,".PrimaryIdentityHash"),t.primaryIdentityHash)),void 0!==t.primaryIdentitySpace&&i.push(pi("".concat(e,".PrimaryIdentitySpace"),t.primaryIdentitySpace)),void 0!==t.tenantId&&i.push(pi("".concat(e,".TenantId"),t.tenantId)),void 0!==t.tenantGroup&&i.push(pi("".concat(e,".TenantGroup"),t.tenantGroup)),void 0!==t.isAnonymous&&i.push(ui("".concat(e,".IsAnonymous"),t.isAnonymous)),i}}(Si||(Si={})),function(e){e.getFields=function(e,t){var i=[];return void 0!==t.name&&i.push(pi("".concat(e,".Name"),t.name)),void 0!==t.state&&i.push(pi("".concat(e,".State"),t.state)),i}}(yi||(yi={})),function(e){e.getFields=function(e,t){var i=[];return void 0!==t.id&&i.push(di("".concat(e,".Id"),t.id)),void 0!==t.name&&i.push(pi("".concat(e,".Name"),t.name)),void 0!==t.commandSurface&&i.push(pi("".concat(e,".CommandSurface"),t.commandSurface)),void 0!==t.parentName&&i.push(pi("".concat(e,".ParentName"),t.parentName)),void 0!==t.triggerMethod&&i.push(pi("".concat(e,".TriggerMethod"),t.triggerMethod)),void 0!==t.timeOffsetMs&&i.push(di("".concat(e,".TimeOffsetMs"),t.timeOffsetMs)),i}}(Ai||(Ai={})),function(e){e.getFields=function(e,t){var i=[];return i.push(pi("".concat(e,".ErrorGroup"),t.errorGroup)),i.push(di("".concat(e,".Tag"),t.tag)),void 0!==t.code&&i.push(di("".concat(e,".Code"),t.code)),void 0!==t.id&&i.push(di("".concat(e,".Id"),t.id)),void 0!==t.count&&i.push(di("".concat(e,".Count"),t.count)),i}}(Ii||(Ii={}));var Ti,Ci=mi,bi=fi,wi=Ii,Oi=yi,ki=gi,Ri=Ai,Pi=Si;function Di(e,t){return e?e+"."+t:t}function Fi(e,t,i,n,r){void 0===r&&(r=4),n&&e.push(pi("".concat(Di(t,i)),n,r))}function xi(e,t,i,n){"boolean"==typeof n&&e.push(ui("".concat(Di(t,i)),n))}function Li(e,t,i,n){"number"==typeof n&&e.push(di("".concat(Di(t,i)),n))}!function(e){var t,i;t=e.Office||(e.Office={}),(i=t.System||(t.System={})).Activity=Ci,i.Result=bi,i.Error=wi,i.Funnel=Oi,i.Host=ki,i.User=Pi,i.UserAction=Ri}(Ti||(Ti={}));var Ni,_i={contractName:"Office.System.Activity",getFields:function(e){var t="Activity",i=[];return Fi(i,t,"CV",e.cV),Li(i,t,"Duration",e.duration),Li(i,t,"Count",e.count),Li(i,t,"AggMode",e.aggMode),xi(i,t,"Success",e.success),e.result&&i.push.apply(i,function(e){var t="Activity.Result",i=[];return Li(i,t,"Code",e.code),Fi(i,t,"Type",e.type),Li(i,t,"Tag",e.tag),xi(i,t,"IsExpected",e.isExpected),i.push(pi("zC.Activity.Result","Office.System.Result")),i}(e.result)),i.push(pi("zC.Activity",this.contractName)),i}},Mi=function(e){var t="User",i=[];return Fi(i,t,"PrimaryIdentityHash",e.primaryIdentityHash),Fi(i,t,"PrimaryIdentitySpace",e.primaryIdentitySpace),Fi(i,t,"TenantId",e.tenantId,1),Fi(i,t,"TenantGroup",e.tenantGroup,1),xi(i,t,"IsAnonymous",e.isAnonymous),xi(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"}(Ni||(Ni={}));var Ui,$i=function(e){var t="App",i=[];return Fi(i,t,"Name",e.name,1),Fi(i,t,"Platform",e.platform,1),Fi(i,t,"Version",e.version,1),i},zi=function(e){var t="Session",i=[];return Fi(i,t,"Id",e.id,1),Fi(i,t,"EcsETag",e.ecsETag,1),i};!function(e){e.Automation="Automation",e.Dogfood="Dogfood",e.Microsoft="Microsoft",e.Insiders="Insiders",e.Production="Production"}(Ui||(Ui={}));var Hi,Vi;!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 Fi(t,o,"FeatureActionType",e.featureActionType),xi(t,o,"IsUserInitiated",e.isUserInitiated),Fi(t,o,"FeatureName",e.featureName),Fi(t,o,"SubFeatureName",e.subFeatureName),Fi(t,o,"Capability",e.capability),xi(t,o,"IsThumbsUp",e.isThumbsUp),Fi(t,o,"EntryPoint",e.entryPoint),Fi(t,o,"Verb",e.verb),Fi(t,o,"InteractionId",e.interactionId),Fi(t,o,"ConversationId",e.conversationId),t.push(pi("zC.".concat(o),"Office.System.Copilot")),t}}(Hi||(Hi={})),function(e){var t="Asha";!function(e){e.Pillar="Pillar",e.Error="Error"}(e.EventType||(e.EventType={})),e.getFields=function(e){var i=[];return Fi(i,t,"EventType",e.eventType),Fi(i,t,"Pillar",e.pillar),Fi(i,t,"Scenario",e.scenario),Fi(i,t,"Veto",e.veto),Fi(i,t,"Error",e.error),xi(i,t,"InStaging",e.inStaging),xi(i,t,"IsSessionEndingError",e.isSessionEndingError),xi(i,t,"IsIntentional",e.isIntentional),xi(i,t,"IsInternal",e.isInternal),i.push(pi("zC.".concat(t),"Office.System.Asha")),i}}(Vi||(Vi={}));var Wi,Bi=function(){return(Bi="object"==typeof self&&"object"==typeof self.performance&&"function"==typeof self.performance.now?function(){return self.performance.now()}:function(){return Date.now()})()},ji=function(e){var t,i=Bi(),n=vi(e.telemetryEvent);return r(r({cv:e.parentCv.getNext()},n),{createChildActivity:function(t){return ji({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&&Zt(1,0,(function(){return"Activity does not have success or result set"}));var a=Bi(),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,_i.getFields(l)),this.eventContract={name:_i.contractName,dataFields:c},e.sendTelemetryEvent(this)}Zt(0,0,(function(){return"'".concat(o.eventName,"' already ended")}))}})},Gi=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}(),Ki=function(e){function t(t,i,n){var r=e.call(this,t,i,n)||this;return r.baseCv=function(){if(!Wi){for(var e=[],t=0;t<22;t++)e.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Math.floor(64*Math.random())));Wi=new Gi(e.join(""))}return Wi}(),r}return n(t,e),t.prototype.createActivity=function(e){return ji({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:_i.contractName,dataFields:_i.getFields(t)},dataFields:i,eventFlags:n})},t.prototype.sendError=function(e){var t=function(e){var t="Error",i=[];return i.push(pi("".concat(t,".ErrorGroup"),e.errorGroup)),i.push(di("".concat(t,".Tag"),e.tag)),void 0!==e.code&&i.push(di("".concat(t,".Code"),e.code)),void 0!==e.id&&i.push(di("".concat(t,".Id"),e.id)),void 0!==e.count&&i.push(di("".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 ji({sendTelemetryEvent:this.sendCustomerContent.bind(this),telemetryEvent:e,parentCv:this.baseCv})},t}(Ei),qi="function",Xi="object",Ji="undefined",Yi="prototype",Qi="hasOwnProperty",Zi=Object,en=Zi[Yi],tn=Zi.assign,nn=Zi.create,rn=Zi.defineProperty,on=en[Qi],an=null;function sn(e){void 0===e&&(e=!0);var t=!1===e?null:an;return t||(typeof globalThis!==Ji&&(t=globalThis),t||typeof self===Ji||(t=self),t||typeof window===Ji||(t=window),t||typeof i.g===Ji||(t=i.g),an=t),t}function ln(e){throw new TypeError(e)}function cn(e){if(nn)return nn(e);if(null==e)return{};var t=typeof e;function i(){}return t!==Xi&&t!==qi&&ln("Object prototype may only be an Object:"+e),i[Yi]=e,new i}var un="initialize",dn="name",pn="getNotifyMgr",hn="identifier",vn="push",fn="isInitialized",mn="config",gn="instrumentationKey",Sn="logger",yn="length",An="time",In="processNext",En="getProcessTelContext",Tn="addNotificationListener",Cn="removeNotificationListener",bn="stopPollingInternalLogs",wn="onComplete",On="getPlugin",kn="flush",Rn="_extensions",Pn="splice",Dn="teardown",Fn="messageId",xn="message",Ln="isAsync",Nn="_doTeardown",_n="update",Mn="getNext",Un="diagLog",$n="setNextPlugin",zn="createNew",Hn="cookieCfg",Vn="indexOf",Wn="substring",Bn="userAgent",jn="split",Gn="setEnabled",Kn="substr",qn="nodeType",Xn="apply",Jn="replace",Yn="enableDebugExceptions",Qn="call",Zn="type",er="handler",tr="listeners",ir="isChildEvt",nr="getCtx",rr="setCtx",or="complete",ar="traceId",sr="spanId",lr="traceFlags",cr="",ur="channels",dr="core",pr="createPerfMgr",hr="disabled",vr="extensionConfig",fr="processTelemetry",mr="priority",gr="eventsSent",Sr="eventsDiscarded",yr="eventsSendRequest",Ar="perfEvent",Ir="errorToConsole",Er="warnToConsole",Tr="getPerfMgr",Cr="toISOString",br="endsWith",wr="startsWith",Or="indexOf",kr="trim",Rr="toString",Pr="constructor",Dr=rn,Fr=Zi.freeze,xr=(Zi.seal,Zi.keys),Lr=String[Yi],Nr=Lr[kr],_r=Lr[br],Mr=Lr[wr],Ur=Date[Yi][Cr],$r=Array.isArray,zr=en[Rr],Hr=on[Rr],Vr=Hr[Qn](Zi),Wr=/-([a-z])/g,Br=/([^\w\d_$])/g,jr=/^(\d+[\w\d_$])/,Gr=Object.getPrototypeOf;function Kr(e){return void 0===e||typeof e===Ji}function qr(e){return null===e||Kr(e)}function Xr(e){return!qr(e)}function Jr(e,t){return!(!e||!on[Qn](e,t))}function Yr(e){return!(!e||typeof e!==Xi)}function Qr(e){return!(!e||typeof e!==qi)}function Zr(e){var t=e;return t&&ro(t)&&(t=(t=(t=t[Jn](Wr,(function(e,t){return t.toUpperCase()})))[Jn](Br,"_"))[Jn](jr,(function(e,t){return"_"+t}))),t}function eo(e,t){if(e)for(var i in e)on[Qn](e,i)&&t[Qn](e,i,e[i])}function to(e,t){var i=!1;return e&&t&&!(i=e===t)&&(i=Mr?e[wr](t):function(e,t){var i=!1,n=t?t[yn]:0;if(e&&n&&e[yn]>=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 io(e,t){return!(!e||!t)&&-1!==e[Vn](t)}var no=$r||function(e){return!(!e||"[object Array]"!==zr[Qn](e))};function ro(e){return"string"==typeof e}function oo(e){return"number"==typeof e}function ao(e){return"boolean"==typeof e}function so(e){var t=!1;if(e&&"object"==typeof e){var i=Gr?Gr(e):function(e){if(e){if(Gr)return Gr(e);var t=e.__proto__||e[Yi]||e[Pr];if(t)return t}return null}(e);i?(i[Pr]&&on[Qn](i,Pr)&&(i=i[Pr]),t=typeof i===qi&&Hr[Qn](i)===Vr):t=!0}return t}function lo(e){if(e)return Ur?e[Cr]():function(e){if(e&&e.getUTCFullYear){var t=function(e){var t=String(e);return 1===t[yn]&&(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 co(e,t,i){var n=e[yn];try{for(var r=0;r<n&&(!(r in e)||-1!==t[Qn](i||e,e[r],r,e));r++);}catch(e){}}function uo(e,t,i){if(e){if(e[Or])return e[Or](t,i);var n=e[yn],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 po(e){return e&&(e=Nr&&e[kr]?e[kr]():e[Jn]?e[Jn](/^\s+|(?=\s)\s+$/g,cr):e),e}var ho=!{toString:null}.propertyIsEnumerable("toString"),vo=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];function fo(e){var t=typeof e;if(t===qi||t===Xi&&null!==e||ln("objKeys called on non-object"),!ho&&xr)return xr(e);var i=[];for(var n in e)e&&on[Qn](e,n)&&i[vn](n);if(ho)for(var r=vo[yn],o=0;o<r;o++)e&&on[Qn](e,vo[o])&&i[vn](vo[o]);return i}function mo(e,t,i,n){if(Dr)try{var r={enumerable:!0,configurable:!0};return i&&(r.get=i),n&&(r.set=n),Dr(e,t,r),!0}catch(e){}return!1}var go=Fr||function(e){return e};function So(){var e=Date;return e.now?e.now():(new e).getTime()}function yo(e){return function(e){return!(!e||"[object Error]"!==zr[Qn](e))}(e)?e[dn]:cr}function Ao(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 Io(e,t,i){var n;return e?!(n=e[t])&&qr(n)&&(n=Kr(i)?{}:i,e[t]=n):n=Kr(i)?{}:i,n}function Eo(e,t){return qr(e)?t:e}function To(e){return!!e}function Co(e){throw new Error(e)}function bo(e,t,i,n,r){e&&t&&i&&(!1!==r||Kr(e[t]))&&(e[t]=function(e,t){var i=null,n=null;return Qr(e)?i=e:n=e,function(){var e=arguments;if(i&&(n=i()),n)return n[t][Xn](n,e)}}(i,n))}function wo(e){return e&&tn&&(e=Zi(tn({},e))),e}function Oo(e,t,i,n,r,o){var a=arguments,s=a[0]||{},l=a[yn],c=!1,u=1;for(l>0&&ao(s)&&(c=s,s=a[u]||{},u++),Yr(s)||(s={});u<l;u++){var d=a[u],p=no(d),h=Yr(d);for(var v in d)if(p&&v in d||h&&on[Qn](d,v)){var f=d[v],m=void 0;if(c&&f&&((m=no(f))||so(f))){var g=s[v];m?no(g)||(g=[]):so(g)||(g={}),f=Oo(c,g,f)}void 0!==f&&(s[v]=f)}}return s}var ko,Ro="Data.",Po="User.PrimaryIdentityHash",Do="User.PrimaryIdentitySpace",Fo="User.TenantId",xo="User.IsAnonymous",Lo="User.IsSignedIn",No="f998cc5ba4d448d6a1e8e913ff18be94-dd122e0a-fcf8-4dc5-9dbb-6afac5325183-7405";function _o(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 Zt(0,1,(function(){return"DNM: Invalid field type "+s})),r=!1,"break";var l;l=i?"zC."===s.substr(0,3)?"zC."+Ro+s.substr(3):Ro+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 Mo(e){Zt(0,1,(function(){return"Invalid "+e}))}function Uo(e){return ro(e)&&""!==e}function $o(e,t){return Object.values(t).includes(e)}function zo(e){return $o(e,Ni)}function Ho(e){return $o(e,Ui)}function Vo(e){return["MSACID","MSAPUID","OrgIdCID","OrgIdPUID","UserObjectId","Other"].includes(e)}function Wo(e){return!e||"Other"===e}function Bo(e,t){var i=!0;function n(t,n){n(e[t])||(Mo(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",Uo),n("App.Platform",t?zo:Uo),n("App.Version",Uo),n("Session.Id",r),t?(n("Release.AudienceGroup",Ho),n(Lo,ao),e[Lo]?(n(Po,Uo),n(Do,Vo),["OrgIdCID","OrgIdPUID","UserObjectId"].includes(e[Do])?n(Fo,r):n(Fo,qr)):(n(Do,Wo),n(Fo,qr))):e[xo]||!1===e[Lo]||(n(Po,Uo),n(Do,Uo),e[Fo]&&n(Fo,r)),qr(e[xo])||e[Lo]!==e[xo]||(Mo(xo),i=!1),i}var jo,Go="undefined",Ko="constructor",qo="prototype",Xo="function",Jo="_dynInstFuncs",Yo="_isDynProxy",Qo="_dynClass",Zo="_dynInstChk",ea=Zo,ta="_dfOpts",ia="_unknown_",na="__proto__",ra="_dyn"+na,oa="__dynProto$Gbl",aa="_dynInstProto",sa="useBaseInst",la="setInstFuncs",ca=Object,ua=ca.getPrototypeOf,da=ca.getOwnPropertyNames,pa=(typeof globalThis!==Go&&(jo=globalThis),jo||typeof self===Go||(jo=self),jo||typeof window===Go||(jo=window),jo||typeof i.g===Go||(jo=i.g),jo||{}),ha=pa[oa]||(pa[oa]={o:(ko={},ko[la]=!0,ko[sa]=!0,ko),n:1e3});function va(e,t){return e&&ca[qo].hasOwnProperty.call(e,t)}function fa(e){return e&&(e===ca[qo]||e===Array[qo])}function ma(e){return fa(e)||e===Function[qo]}function ga(e){var t;if(e){if(ua)return ua(e);var i=e[na]||e[qo]||(e[Ko]?e[Ko][qo]:null);t=e[ra]||i,va(e,ra)||(delete e[aa],t=e[ra]=e[aa]||e[ra],e[aa]=i)}return t}function Sa(e,t){var i=[];if(da)i=da(e);else for(var n in e)"string"==typeof n&&va(e,n)&&i.push(n);if(i&&i.length>0)for(var r=0;r<i.length;r++)t(i[r])}function ya(e,t,i){return t!==Ko&&typeof e[t]===Xo&&(i||va(e,t))&&t!==na&&t!==qo}function Aa(e){throw new TypeError("DynamicProto: "+e)}function Ia(){return Object.create?(e=Object.create)?e(null):{}:{};var e}function Ea(e,t){for(var i=e.length-1;i>=0;i--)if(e[i]===t)return!0;return!1}function Ta(e,t,i,n,r){if(!fa(e)){var o=i[Jo]=i[Jo]||Ia();if(!fa(o)){var a=o[t]=o[t]||Ia();!1!==o[ea]&&(o[ea]=!!r),fa(a)||Sa(i,(function(t){ya(i,t,!1)&&i[t]!==n[t]&&(a[t]=i[t],delete i[t],(!va(e,t)||e[t]&&!e[t][Yo])&&(e[t]=function(e,t){var i=function(){var n=function(e,t,i,n){var r=null;if(e&&va(i,Qo)){var o=e[Jo]||Ia();if((r=(o[i[Qo]]||Ia())[t])||Aa("Missing ["+t+"] "+Xo),!r[Zo]&&!1!==o[ea]){for(var a=!va(e,t),s=ga(e),l=[];a&&s&&!ma(s)&&!Ea(l,s);){var c=s[t];if(c){a=c===n;break}l.push(s),s=ga(s)}try{a&&(e[t]=r),r[Zo]=1}catch(e){o[ea]=!1}}}return r}(this,t,e,i)||function(e,t,i){var n=t[e];return n===i&&(n=ga(t)[e]),typeof n!==Xo&&Aa("["+e+"] is not a "+Xo),n}(t,e,i);return n.apply(this,arguments)};return i[Yo]=1,i}(e,t)))}))}}}function Ca(e,t){return va(e,qo)?e.name||t||ia:((e||{})[Ko]||{}).name||t||ia}function ba(e,t,i,n){va(e,qo)||Aa("theClass is an invalid class definition.");var r=e[qo];(function(e,t){if(ua){for(var i=[],n=ga(t);n&&!ma(n)&&!Ea(i,n);){if(n===e)return!0;i.push(n),n=ga(n)}return!1}return!0})(r,t)||Aa("["+Ca(e)+"] not in hierarchy of ["+Ca(t)+"]");var o=null;va(r,Qo)?o=r[Qo]:(o="_dynCls$"+Ca(e,"_")+"$"+ha.n,ha.n++,r[Qo]=o);var a=ba[ta],s=!!a[sa];s&&n&&void 0!==n[sa]&&(s=!!n[sa]);var l=function(e){var t=Ia();return Sa(e,(function(i){!t[i]&&ya(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[Yo]&&n){var o=e[Jo]||{};!1!==o[ea]&&(r=(o[t[Qo]]||{})[i]||r)}return function(){return r.apply(e,arguments)}}var o=Ia();Sa(i,(function(e){o[e]=r(t,i,e)}));for(var a=ga(e),s=[];a&&!ma(a)&&!Ea(s,a);)Sa(a,(function(e){!o[e]&&ya(a,e,!ua)&&(o[e]=r(t,a,e))})),s.push(a),a=ga(a);return o}(r,t,l,s);i(t,c);var u=!!ua&&!!a[la];u&&n&&(u=!!n[la]),Ta(r,o,t,l,!1!==u)}ba[ta]=ha.o;var wa="window",Oa="JSON",ka="XMLHttpRequest",Ra=null,Pa=null,Da=null,Fa=null;function xa(e,t){var i=!1;if(e){try{if(!(i=t in e)){var n=e[Yi];n&&(i=t in n)}}catch(e){}if(!i)try{i=!Kr((new e)[t])}catch(e){}}return i}function La(e){var t=sn();return t&&t[e]?t[e]:e===wa&&Na()?window:null}function Na(){return Boolean(typeof window===Xi&&window)}function _a(){return Na()?window:La(wa)}function Ma(){return Boolean(typeof document===Xi&&document)?document:La("document")}function Ua(){return Boolean(typeof navigator===Xi&&navigator)}function $a(){return Ua()?navigator:La("navigator")}function za(e){return typeof location===Xi&&location?location:La("location")}function Ha(){return Boolean(typeof JSON===Xi&&JSON||null!==La(Oa))}function Va(){return Ha()?JSON||La(Oa):null}function Wa(){var e=$a();return!(!e||!e.product)&&"ReactNative"===e.product}function Ba(){var e=$a();if(e&&(e[Bn]!==Pa||null===Ra)){var t=((Pa=e[Bn])||cr).toLowerCase();Ra=io(t,"msie")||io(t,"trident/")}return Ra}function ja(e){var t=Object[Yi].toString[Qn](e),i=cr;return"[object Error]"===t?i="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e[dn]+"'":Ha()&&(i=Va().stringify(e)),t+i}function Ga(){return null===Fa&&(Fa=Ua()&&Boolean($a().sendBeacon)),Fa}function Ka(e){var t=!1;try{t=!!La("fetch");var i=La("Request");t&&e&&i&&(t=xa(i,"keepalive"))}catch(e){}return t}function qa(){var e=!1;try{e=!!La(ka)}catch(e){}return e}var Xa,Ja=["eventsSent","eventsDiscarded","eventsSendRequest","perfEvent"],Ya=null;function Qa(e,t){return function(){var i=arguments,n=Za(t);if(n){var r=n.listener;r&&r[e]&&r[e][Xn](r,i)}}}function Za(e){var t,i=Ya;return i||!0===e.disableDbgExt||(i=Ya||((t=La("Microsoft"))&&(Ya=t.ApplicationInsights),Ya)),i?i.ChromeDbgExt:null}function es(e){if(!Xa){Xa={};for(var t=0;t<Ja[yn];t++)Xa[Ja[t]]=Qa(Ja[t],e)}return Xa}function ts(e){return e?'"'+e[Jn](/\"/g,cr)+'"':cr}function is(e,t){var i=typeof console!==Ji?console:La("console");if(i){var n="log";i[e]&&(n=e),Qr(i[n])&&i[n](t)}}var ns=function(){function e(e,t,i,n){void 0===i&&(i=!1);var r=this;r[Fn]=e,r[xn]=(i?"AI: ":"AI (Internal): ")+e;var o=cr;Ha()&&(o=Va().stringify(n));var a=(t?" message:"+ts(t):cr)+(n?" props:"+ts(o):cr);r[xn]+=a}return e.dataType="MessageData",e}(),rs=function(){function e(t){this.identifier="DiagnosticLogger",this.queue=[];var i,n,r,o,a=0,s={};ba(e,this,(function(e){function l(t,i){if(!(a>=r)){var o=!0,l="AITR_"+i[Fn];if(s[l]?o=!1:s[l]=!0,o&&(t<=n&&(e.queue[vn](i),a++,c(1===t?"error":"warn",i)),a===r)){var u="Internal events throttle limit per PageView reached for this app.",d=new ns(23,u,!1);e.queue[vn](d),1===t?e[Ir](u):e[Er](u)}}}function c(e,i){var n=Za(t||{});n&&n[Un]&&n[Un](e,i)}!function(e){i=Eo(e.loggingLevelConsole,0),n=Eo(e.loggingLevelTelemetry,1),r=Eo(e.maxMessageLimit,25),o=Eo(e.enableDebug,Eo(e[Yn],!1))}(t||{}),e.consoleLoggingLevel=function(){return i},e.telemetryLoggingLevel=function(){return n},e.maxInternalMessageLimit=function(){return r},e[Yn]=function(){return o},e.throwInternal=function(t,n,r,a,u){void 0===u&&(u=!1);var d=new ns(n,r,u,a);if(o)throw ja(d);var p=1===t?Ir:Er;if(Kr(d[xn]))c("throw"+(1===t?"Critical":"Warning"),d);else{if(u){var h=+d[Fn];!s[h]&&i>=t&&(e[p](d[xn]),s[h]=!0)}else i>=t&&e[p](d[xn]);l(t,d)}},e[Er]=function(e){is("warn",e),c("warning",e)},e[Ir]=function(e){is("error",e),c("error",e)},e.resetInternalMessageCount=function(){a=0,s={}},e.logInternalMessage=l}))}return e.__ieDyn=1,e}();function os(e){return e||new rs}function as(e,t,i,n,r,o){void 0===o&&(o=!1),os(e).throwInternal(t,i,n,r,o)}function ss(e,t){os(e)[Er](t)}var ls="toGMTString",cs="toUTCString",us="cookie",ds="expires",ps="enabled",hs="isCookieUseDisabled",vs="disableCookiesUsage",fs="_ckMgr",ms=null,gs=null,Ss=null,ys=Ma(),As={},Is={};function Es(e){return!e||e.isEnabled()}function Ts(e,t){return!!(t&&e&&no(e.ignoreCookies))&&-1!==e.ignoreCookies[Vn](t)}function Cs(e,t){var i,n=function(e){var t=e[Hn]=e[Hn]||{};if(Ao(t,"domain",e.cookieDomain,Xr,qr),Ao(t,"path",e.cookiePath||"/",null,qr),qr(t[ps])){var i=void 0;Kr(e[hs])||(i=!e[hs]),Kr(e[vs])||(i=!e[vs]),t[ps]=i}return t}(e||Is),r=n.path||"/",o=n.domain,a=!1!==n[ps],s=((i={isEnabled:function(){var e=a&&bs(t),i=Is[fs];return e&&i&&s!==i&&(e=Es(i)),e}})[Gn]=function(e){a=!1!==e},i.set=function(e,t,i,a,l){var c,u=!1;if(Es(s)&&!function(e,t){return!!(t&&e&&no(e.blockedCookies)&&-1!==e.blockedCookies[Vn](t))||Ts(e,t)}(n,e)){var d={},p=po(t||cr),h=p[Vn](";");if(-1!==h&&(p=po(t[Wn](0,h)),d=ws(t[Wn](h+1))),Ao(d,"domain",a||o,To,Kr),!qr(i)){var v=Ba();if(Kr(d[ds])){var f=So()+1e3*i;if(f>0){var m=new Date;m.setTime(f),Ao(d,ds,Os(m,v?ls:cs)||Os(m,v?ls:cs)||cr,To)}}v||Ao(d,"max-age",cr+i,null,Kr)}var g=za();g&&"https:"===g.protocol&&(Ao(d,"secure",null,null,Kr),null===gs&&(c=($a()||{})[Bn],gs=!(ro(c)&&(io(c,"CPU iPhone OS 12")||io(c,"iPad; CPU OS 12")||io(c,"Macintosh; Intel Mac OS X 10_14")&&io(c,"Version/")&&io(c,"Safari")||io(c,"Macintosh; Intel Mac OS X 10_14")&&function(e,t){var i=!1;return e&&t&&!(i=e===t)&&(i=_r?e[br](t):function(e,t){var i=!1,n=t?t[yn]:0,r=e?e[yn]: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)")||io(c,"Chrome/5")||io(c,"Chrome/6")||io(c,"UnrealEngine")&&!io(c,"Chrome")||io(c,"UCBrowser/12")||io(c,"UCBrowser/11")))),gs&&Ao(d,"SameSite","None",null,Kr)),Ao(d,"path",l||r,null,Kr),(n.setCookie||Ps)(e,ks(p,d)),u=!0}return u},i.get=function(e){var t=cr;return Es(s)&&!Ts(n,e)&&(t=(n.getCookie||Rs)(e)),t},i.del=function(e,t){var i=!1;return Es(s)&&(i=s.purge(e,t)),i},i.purge=function(e,i){var r,o=!1;if(bs(t)){var a=((r={}).path=i||"/",r[ds]="Thu, 01 Jan 1970 00:00:01 GMT",r);Ba()||(a["max-age"]="0"),(n.delCookie||Ps)(e,ks(cr,a)),o=!0}return o},i);return s[fs]=s,s}function bs(e){if(null===ms){ms=!1;try{ms=void 0!==(ys||{})[us]}catch(t){as(e,2,68,"Cannot access document.cookie - "+yo(t),{exception:ja(t)})}}return ms}function ws(e){var t={};return e&&e[yn]&&co(po(e)[jn](";"),(function(e){if(e=po(e||cr)){var i=e[Vn]("=");-1===i?t[e]=null:t[po(e[Wn](0,i))]=po(e[Wn](i+1))}})),t}function Os(e,t){return Qr(e[t])?e[t]():null}function ks(e,t){var i=e||cr;return eo(t,(function(e,t){i+="; "+e+(qr(t)?cr:"="+t)})),i}function Rs(e){var t=cr;if(ys){var i=ys[us]||cr;Ss!==i&&(As=ws(i),Ss=i),t=po(As[e]||cr)}return t}function Ps(e,t){ys&&(ys[us]=e+"="+t)}var Ds=4294967296,Fs=4294967295,xs=!1,Ls=123456789,Ns=987654321;function _s(){try{var e=2147483647&So();(t=(Math.random()*Ds^e)+e)<0&&(t>>>=0),Ls=123456789+t&Fs,Ns=987654321-t&Fs,xs=!0}catch(e){}var t}function Ms(e){var t=0,i=La("crypto")||La("msCrypto");return i&&i.getRandomValues&&(t=i.getRandomValues(new Uint32Array(1))[0]&Fs),0===t&&Ba()&&(xs||_s(),t=function(e){var t=((Ns=36969*(65535&Ns)+(Ns>>16)&Fs)<<16)+(65535&(Ls=18e3*(65535&Ls)+(Ls>>16)&Fs))>>>0&Fs;return e||(t>>>=0),t}()&Fs),0===t&&(t=Math.floor(Ds*Math.random()|0)),e||(t>>>=0),t}var Us=rn,$s="2.8.18",zs="."+function(e){void 0===e&&(e=22);for(var t=Ms()>>>0,i=0,n=cr;n[yn]<e;)i++,n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(63&t),t>>>=6,5===i&&(t=(Ms()<<2&4294967295|3&t)>>>0,i=0);return n}(6),Hs=0;function Vs(e){return 1===e[qn]||9===e[qn]||!+e[qn]}function Ws(e,t){return void 0===t&&(t=!1),Zr(e+Hs+++(t?"."+$s:cr)+zs)}function Bs(e){var t={id:Ws("_aiData-"+(e||cr)+"."+$s),accept:function(e){return Vs(e)},get:function(e,i,n,r){var o=e[t.id];return o?o[Zr(i)]:(r&&((o=function(e,t){var i=t[e.id];if(!i){i={};try{Vs(t)&&(function(e,t,i){if(Us)try{return Us(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))[Zr(i)]=n),n)},kill:function(e,t){if(e&&e[t])try{delete e[t]}catch(e){}}};return t}var js="attachEvent",Gs="addEventListener",Ks="detachEvent",qs="removeEventListener",Xs="events",Js="visibilitychange",Ys="pagehide",Qs="pageshow",Zs="unload",el="beforeunload",tl=Ws("aiEvtPageHide"),il=Ws("aiEvtPageShow"),nl=/\.[\.]+/g,rl=/[\.]+$/,ol=1,al=Bs("events"),sl=/^([^.]*)(?:\.(.+)|)/;function ll(e){return e&&e[Jn]?e[Jn](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,cr):e}function cl(e,t){var i;if(t){var n=cr;no(t)?(n=cr,co(t,(function(e){(e=ll(e))&&("."!==e[0]&&(e="."+e),n+=e)}))):n=ll(t),n&&("."!==n[0]&&(n="."+n),e=(e||cr)+n)}var r=sl.exec(e||cr)||[];return(i={})[Zn]=r[1],i.ns=(r[2]||cr).replace(nl,".").replace(rl,cr)[jn](".").sort().join("."),i}function ul(e,t,i){void 0===i&&(i=!0);var n=al.get(e,Xs,{},i),r=n[t];return r||(r=n[t]=[]),r}function dl(e,t,i,n){e&&t&&t[Zn]&&(e[qs]?e[qs](t[Zn],i,n):e[Ks]&&e[Ks]("on"+t[Zn],i))}function pl(e,t,i,n){for(var r=t[yn];r--;){var o=t[r];o&&(i.ns&&i.ns!==o.evtName.ns||n&&!n(o)||(dl(e,o.evtName,o[er],o.capture),t[Pn](r,1)))}}function hl(e,t){return t?cl("xx",no(t)?[e].concat(t):[e,t]).ns[jn]("."):e}function vl(e,t,i,n,r){var o;void 0===r&&(r=!1);var a=!1;if(e)try{var s=cl(t,n);if(a=function(e,t,i,n){var r=!1;return e&&t&&t[Zn]&&i&&(e[Gs]?(e[Gs](t[Zn],i,n),r=!0):e[js]&&(e[js]("on"+t[Zn],i),r=!0)),r}(e,s,i,r),a&&al.accept(e)){var l=((o={guid:ol++,evtName:s})[er]=i,o.capture=r,o);ul(e,s.type)[vn](l)}}catch(e){}return a}function fl(e,t,i,n,r){if(void 0===r&&(r=!1),e)try{var o=cl(t,n),a=!1;!function(e,t,i){if(t[Zn])pl(e,ul(e,t[Zn]),t,i);else{var n=al.get(e,Xs,{});eo(n,(function(n,r){pl(e,r,t,i)})),0===fo(n)[yn]&&al.kill(e,Xs)}}(e,o,(function(e){return!((!o.ns||i)&&e[er]!==i||(a=!0,0))})),a||dl(e,o,i,r)}catch(e){}}function ml(e,t,i,n){var r=!1;return t&&e&&e[yn]>0&&co(e,(function(e){e&&(i&&-1!==uo(i,e)||(r=function(e,t,i){var n=!1,r=_a();r&&(n=vl(r,e,t,i),n=vl(r.body,e,t,i)||n);var o=Ma();return o&&(n=vl(o,e,t,i)||n),n}(e,t,n)||r))})),r}function gl(e,t,i){e&&no(e)&&co(e,(function(e){e&&function(e,t,i){var n=_a();n&&(fl(n,e,t,i),fl(n.body,e,t,i));var r=Ma();r&&fl(r,e,t,i)}(e,t,i)}))}function Sl(e,t,i){var n=hl(tl,i),r=ml([Ys],e,t,n);return t&&-1!==uo(t,Js)||(r=ml([Js],(function(t){var i=Ma();e&&i&&"hidden"===i.visibilityState&&e(t)}),t,n)||r),!r&&t&&(r=Sl(e,null,i)),r}function yl(e,t,i){var n=hl(il,i),r=ml([Qs],e,t,n);return!(r=ml([Js],(function(t){var i=Ma();e&&i&&"visible"===i.visibilityState&&e(t)}),t,n)||r)&&t&&(r=yl(e,null,i)),r}function Al(){var e=function(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],i=cr,n=0;n<4;n++)i+=t[15&(e=Ms())]+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&Ms())|0];return i[Kn](0,8)+i[Kn](9,4)+"4"+i[Kn](13,3)+r+i[Kn](16,3)+i[Kn](19,12)}();return e[Wn](0,8)+"-"+e[Wn](8,12)+"-"+e[Wn](12,16)+"-"+e[Wn](16,20)+"-"+e[Wn](20)}var Il=((sn()||{}).Symbol,(sn()||{}).Reflect,function(e,t){return Il=Zi.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t[Qi](i)&&(e[i]=t[i])},Il(e,t)});function El(e,t){function i(){this.constructor=e}typeof t!==qi&&null!==t&&ln("Class extends value "+String(t)+" is not a constructor or null"),Il(e,t),e[Yi]=null===t?cn(t):(i[Yi]=t[Yi],new i)}function Tl(e,t){for(var i=0,n=t.length,r=e.length;i<n;i++,r++)e[r]=t[i];return e}var Cl="ctx",bl="ParentContextKey",wl="ChildrenContextKey",Ol=function(){function e(t,i,n){var r,o=this,a=!1;o.start=So(),o[dn]=t,o[Ln]=n,o[ir]=function(){return!1},Qr(i)&&(a=mo(o,"payload",(function(){return!r&&Qr(i)&&(r=i(),i=null),r}))),o[nr]=function(t){return t?t===e[bl]||t===e[wl]?o[t]:(o[Cl]||{})[t]:null},o[rr]=function(t,i){t&&(t===e[bl]?(o[t]||(o[ir]=function(){return!0}),o[t]=i):t===e[wl]?o[t]=i:(o[Cl]=o[Cl]||{})[t]=i)},o[or]=function(){var t=0,n=o[nr](e[wl]);if(no(n))for(var r=0;r<n[yn];r++){var s=n[r];s&&(t+=s[An])}o[An]=So()-o.start,o.exTime=o[An]-t,o[or]=function(){},!a&&Qr(i)&&(o.payload=i())}}return e.ParentContextKey="parent",e.ChildrenContextKey="childEvts",e}(),kl=function(){function e(t){this.ctx={},ba(e,this,(function(e){e.create=function(e,t,i){return new Ol(e,t,i)},e.fire=function(e){e&&(e[or](),t&&Qr(t[Ar])&&t[Ar](e))},e[rr]=function(t,i){t&&((e[Cl]=e[Cl]||{})[t]=i)},e[nr]=function(t){return(e[Cl]||{})[t]}}))}return e.__ieDyn=1,e}(),Rl="CoreUtils.doPerf";function Pl(e,t,i,n,r){if(e){var o=e;if(o[Tr]&&(o=o[Tr]()),o){var a=void 0,s=o[nr](Rl);try{if(a=o.create(t(),n,r)){if(s&&a[rr]&&(a[rr](Ol[bl],s),s[nr]&&s[rr])){var l=s[nr](Ol[wl]);l||(l=[],s[rr](Ol[wl],l)),l[vn](a)}return o[rr](Rl,a),i(a)}}catch(e){a&&a[rr]&&a[rr]("exception",e)}finally{a&&o.fire(a),o[rr](Rl,s)}}}return i()}function Dl(e,t,i){return!(!e||e[yn]!==t||e===i||!e.match(/^[\da-f]*$/i))}var Fl=Bs("plugin");function xl(e){return Fl.get(e,"state",{},!0)}function Ll(e,t){for(var i,n=[],r=null,o=e[Mn]();o;){var a=o[On]();a&&(r&&Qr(r[$n])&&Qr(a[fr])&&r[$n](a),(Qr(a[fn])?a[fn]():(i=xl(a))[fn])||n[vn](a),r=a,o=o[Mn]())}co(n,(function(n){var r=e[dr]();n[un](e.getCfg(),r,t,e[Mn]()),i=xl(n),n[dr]||i[dr]||(i[dr]=r),i[fn]=!0,delete i[Dn]}))}function Nl(e){return e.sort((function(e,t){var i=0;if(t){var n=Qr(t[fr]);Qr(e[fr])?i=n?e[mr]-t[mr]:1:n&&(i=-1)}else i=e?1:-1;return i}))}var _l="_hasRun",Ml="_getTelCtx",Ul=0;function $l(e,t,i,n){var r=null,o=[];null!==n&&(r=n?function(e,t,i){for(;e;){if(e[On]()===i)return e;e=e[Mn]()}return Wl([i],t[mn]||{},t)}(e,i,n):e);var a={_next:function(){var e=r;if(r=e?e[Mn]():null,!e){var t=o;t&&t[yn]>0&&(co(t,(function(e){try{e.func[Qn](e.self,e.args)}catch(e){as(i[Sn],2,73,"Unexpected Exception during onComplete - "+ja(e))}})),o=[])}return e},ctx:{core:function(){return i},diagLog:function(){return function(e,t){return(e||{})[Sn]||new rs(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&&!qr(o[i])?r=o[i]:t&&!qr(t[i])&&(r=t[i]),qr(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[On]();i&&e(i)}},onComplete:function(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];e&&o[vn]({func:e,self:Kr(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[vr];o&&e&&(r=o[e])}if(r){if(Yr(i)&&0!==n){var a=Oo(!0,i,r);t&&2===n&&eo(i,(function(e){if(qr(a[e])){var i=t[e];qr(i)||(a[e]=i)}})),r=a}}else r=i;return r}return a}function zl(e,t,i,n){var r=$l(e,t,i,n),o=r.ctx;return o[In]=function(e){var t=r._next();return t&&t[fr](e,o),!t},o[zn]=function(e,n){return void 0===e&&(e=null),no(e)&&(e=Wl(e,t,i,n)),zl(e||o[Mn](),t,i,n)},o}function Hl(e,t,i){var n=t[mn]||{},r=$l(e,n,t,i),o=r.ctx;return o[In]=function(e){var t=r._next();return t&&t.unload(o,e),!t},o[zn]=function(e,i){return void 0===e&&(e=null),no(e)&&(e=Wl(e,n,t,i)),Hl(e||o[Mn](),t,i)},o}function Vl(e,t,i){var n=t[mn]||{},r=$l(e,n,t,i).ctx;return r[In]=function(e){return r.iterate((function(t){Qr(t[_n])&&t[_n](r,e)}))},r[zn]=function(e,i){return void 0===e&&(e=null),no(e)&&(e=Wl(e,n,t,i)),Vl(e||r[Mn](),t,i)},r}function Wl(e,t,i,n){var r=null,o=!n;if(no(e)&&e[yn]>0){var a=null;co(e,(function(e){if(o||n!==e||(o=!0),o&&e&&Qr(e[fr])){var s=function(e,t,i){var n,r=null,o=Qr(e[fr]),a=Qr(e[$n]),s={getPlugin:function(){return e},getNext:function(){return r},processTelemetry:function(n,c){l(c=c||function(){var n;return e&&Qr(e[Ml])&&(n=e[Ml]()),n||(n=zl(s,t,i)),n}(),(function(t){if(!e||!o)return!1;var i=xl(e);return!i[Dn]&&!i[hr]&&(a&&e[$n](r),e[fr](n,t),!0)}),"processTelemetry",(function(){return{item:n}}),!n.sync)||c[In](n)},unload:function(t,i){l(t,(function(){var n=!1;if(e){var r=xl(e),o=e[dr]||r[dr];!e||o&&o!==t.core()||r[Dn]||(r[dr]=null,r[Dn]=!0,r[fn]=!1,e[Dn]&&!0===e[Dn](t,i)&&(n=!0))}return n}),"unload",(function(){}),i[Ln])||t[In](i)},update:function(t,i){l(t,(function(){var n=!1;if(e){var r=xl(e),o=e[dr]||r[dr];!e||o&&o!==t.core()||r[Dn]||e[_n]&&!0===e[_n](t,i)&&(n=!0)}return n}),"update",(function(){}),!1)||t[In](i)},_id:n=e?e[hn]+"-"+e[mr]+"-"+Ul++:"Unknown-0-"+Ul++,_setNext:function(e){r=e}};function l(t,i,o,a,s){var l=!1,c=e?e[hn]:"TelemetryPluginChain",u=t[_l];return u||(u=t[_l]={}),t.setNext(r),e&&Pl(t[dr](),(function(){return c+":"+o}),(function(){u[n]=!0;try{var e=r?r._id:cr;e&&(u[e]=!1),l=i(t)}catch(e){var a=!r||u[r._id];a&&(l=!0),r&&a||as(t[Un](),1,73,"Plugin ["+c+"] failed during "+o+" - "+ja(e)+", run flags: "+ja(u))}}),a,s),l}return go(s)}(e,t,i);r||(r=s),a&&a._setNext(s),a=s}}))}return n&&!r?Wl([n],t,i):r}var Bl=500;function jl(e,t,i){t&&no(t)&&t[yn]>0&&(co(t=t.sort((function(e,t){return e[mr]-t[mr]})),(function(e){e[mr]<Bl&&Co("Channel has invalid priority - "+e[hn])})),e[vn]({queue:go(t),chain:Wl(t,i[mn],i)}))}function Gl(){var e=[];return{add:function(t){t&&e[vn](t)},run:function(t,i){co(e,(function(e){try{e(t,i)}catch(e){as(t[Un](),2,73,"Unexpected error calling unload handler - "+ja(e))}})),e=[]}}}var Kl="getPlugin",ql=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||zl(null,{},a[dr]);t=n&&n[Kl]?r[zn](null,n[Kl]):r[zn](null,n)}return t}function l(e,t,r){e&&Ao(e,vr,[],null,qr),!r&&t&&(r=t[En]()[Mn]());var o=n;n&&n[Kl]&&(o=n[Kl]()),a[dr]=t,i=zl(r,e,t,o)}function c(){t=!1,a[dr]=null,i=null,n=null,o=[],r=Gl()}c(),ba(e,a,(function(e){e[un]=function(e,i,n,r){l(e,i,r),t=!0},e[Dn]=function(t,i){var a,s=e[dr];if(s&&(!t||s===t[dr]())){var l,u=!1,d=t||Hl(null,s,n&&n[Kl]?n[Kl]():n),p=i||((a={reason:0})[Ln]=!1,a);return e[Nn]&&!0===e[Nn](d,p,h)?l=!0:h(),l}function h(){if(!u){u=!0,r.run(d,i);var e=o;o=[],co(e,(function(e){e.rm()})),!0===l&&d[In](p),c()}}},e[_n]=function(t,i){var r=e[dr];if(r&&(!t||r===t[dr]())){var o,a=!1,s=t||Vl(null,r,n&&n[Kl]?n[Kl]():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[Mn]()))}},e._addHook=function(e){e&&(no(e)?o=o.concat(e):o[vn](e))},bo(e,"_addUnloadCb",(function(){return r}),"add")})),a[Un]=function(e){return s(e)[Un]()},a[fn]=function(){return t},a.setInitialized=function(e){t=e},a[$n]=function(e){n=e},a[In]=function(e,t){t?t[In](e):n&&Qr(n[fr])&&n[fr](e,null)},a._getTelCtx=s}return e.__ieDyn=1,e}(),Xl=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(),ba(t,r,(function(e,t){e.addTelemetryInitializer=function(e){var t={id:i++,fn:e};return n[vn](t),{remove:function(){co(n,(function(e,i){if(e.id===t.id)return n[Pn](i,1),-1}))}}},e[fr]=function(t,i){for(var r=!1,o=n[yn],a=0;a<o;++a){var s=n[a];if(s)try{if(!1===s.fn[Xn](null,[t])){r=!0;break}}catch(e){as(i[Un](),1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+yo(e),{exception:ja(e)},!0)}}r||e[In](t,i)},e[Nn]=function(){o()}})),r}return El(t,e),t.__ieDyn=1,t}(ql),Jl="Plugins must provide initialize method",Yl="_notificationManager",Ql="SDK is still unloading...",Zl={loggingLevelConsole:1};function ec(e,t){return new kl(t)}function tc(e,t){var i=!1;return co(t,(function(t){if(t===e)return i=!0,-1})),i}var ic=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;ba(e,this,(function(e){function T(i){if(!I&&!E&&(i||e[Sn]&&e[Sn].queue[yn]>0)){var n=Eo(t.diagnosticLogInterval);n&&n>0||(n=1e4),I=setInterval((function(){clearInterval(I),I=0,P()}),n)}return I}function C(){i=!1,t=Oo(!0,{},Zl),e[mn]=t,e[Sn]=new rs(t),e[Rn]=[],f=new Xl,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=Ws("AIBaseCore",!0),S=Gl(),A=null}function b(){var i=zl(k(),t,e);return i[wn](T),i}function w(i){var n=function(e,t,i){var n,r=[],o={};return co(i,(function(t){(qr(t)||qr(t[un]))&&Co(Jl);var i=t[mr],n=t[hn];t&&i&&(qr(o[i])?o[i]=n:ss(e,"Two extensions have same priority #"+i+" - "+o[i]+", "+n)),(!i||i<500)&&r[vn](t)})),(n={all:i})[dr]=r,n}(e[Sn],0,c);u=n[dr],l=null;var r=n.all;if(h=go(function(e,t,i){var n=[];if(e&&co(e,(function(e){return jl(n,e,i)})),t){var r=[];co(t,(function(e){e[mr]>Bl&&r[vn](e)})),jl(n,r,i)}return n}(p,r,e)),d){var o=uo(r,d);-1!==o&&r[Pn](o,1),-1!==(o=uo(u,d))&&u[Pn](o,1),d._setQueue(h)}else d=function(e,t){function i(){return zl(null,t[mn],t,null)}function n(e,t,i,n){var r=e?e[yn]+1:1;function o(){0==--r&&(n&&n(),n=null)}r>0&&co(e,(function(e){if(e&&e.queue[yn]>0){var n=e.chain,a=t[zn](n);a[wn](o),i(a)}else r--})),o()}var r=!1,o={identifier:"ChannelControllerPlugin",priority:Bl,initialize:function(t,i,n,o){r=!0,co(e,(function(e){e&&e.queue[yn]>0&&Ll(zl(e.chain,t,i),n)}))},isInitialized:function(){return r},processTelemetry:function(t,r){n(e,r||i(),(function(e){e[In](t)}),(function(){r[In](t)}))},update:function(t,i){var r=i||{reason:0};return n(e,t,(function(e){e[In](r)}),(function(){t[In](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[In](o)}),(function(){t[In](o),r=!1})),!0},getChannel:function(t){var i=null;return e&&e[yn]>0&&co(e,(function(e){if(e&&e.queue[yn]>0&&(co(e.queue,(function(e){if(e[hn]===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[kn]){s++;var i=!1;e[kn](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[vn](d),u[vn](d),e[Rn]=Nl(r),d[un](t,e,r),Ll(b(),r),e[Rn]=go(Nl(u||[])).slice(),i&&function(t){var i=Vl(k(),e);i[wn](T),e._updateHook&&!0===e._updateHook(i,t)||i[In](t)}(i)}function O(t){var i,n=null,r=null;return co(e[Rn],(function(e){if(e[hn]===t&&e!==d&&e!==f)return r=e,-1})),!r&&d&&(r=d.getChannel(t)),r&&((i={plugin:r})[Gn]=function(e){xl(r)[hr]=!e},i.isEnabled=function(){var e=xl(r);return!e[Dn]&&!e[hr]},i.remove=function(e,t){var i;void 0===e&&(e=!0);var n=[r],o=((i={reason:1})[Ln]=e,i);R(n,o,(function(e){e&&w({reason:32,removed:n}),t&&t(e)}))},n=i),n}function k(){if(!l){var i=(u||[]).slice();-1===uo(i,f)&&i[vn](f),l=Wl(Nl(i),t,e)}return l}function R(i,n,r){if(i&&i[yn]>0){var o=Hl(Wl(i,t,e),e);o[wn]((function(){var e=!1,t=[];co(c,(function(n,r){tc(n,i)?e=!0:t[vn](n)})),c=t;var n=[];p&&(co(p,(function(t,r){var o=[];co(t,(function(t){tc(t,i)?e=!0:o[vn](t)})),n[vn](o)})),p=n),r&&r(e),T()})),o[In](n)}else r(!1)}function P(){if(e[Sn]&&e[Sn].queue){var i=e[Sn].queue.slice(0);e[Sn].queue[yn]=0,co(i,(function(i){var n,r=((n={})[dn]=m||"InternalMessageId: "+i[Fn],n.iKey=Eo(t[gn]),n.time=lo(new Date),n.baseType=ns.dataType,n.baseData={message:i[xn]},n);e.track(r)}))}}function D(e,t,i,n){return d?d[kn](e,t,i||6,n):(t&&t(!1),!0)}function F(t){var i=e[Sn];i?(as(i,2,73,t),T()):Co(t)}var x,L,N,_;C(),e[fn]=function(){return i},e[un]=function(n,o,s,l){var u,d;v&&Co(Ql),e[fn]()&&Co("Core should not be initialized more than once"),t=n||{},e[mn]=t,qr(n[gn])&&Co("Please provide instrumentation key"),r=l,e[Yl]=l,!0===(d=Eo(t.disableDbgExt))&&y&&(r[Cn](y),y=null),r&&!y&&!0!==d&&(y=es(t),r[Tn](y)),!(u=Eo(t.enablePerfMgr))&&a&&(a=null),u&&Io(t,pr,ec),Io(t,vr,{}).NotificationManager=r,s&&(e[Sn]=s);var f=Io(t,"extensions",[]);(c=[])[vn].apply(c,Tl(Tl([],o),f)),p=Io(t,ur,[]),w(null),h&&0!==h[yn]||Co("No "+ur+" available"),i=!0,e.releaseQueue()},e.getTransmissionControls=function(){var e=[];return h&&co(h,(function(t){e[vn](t.queue)})),go(e)},e.track=function(i){i.iKey=i.iKey||t[gn],i[An]=i[An]||lo(new Date),i.ver=i.ver||"4.0",!v&&e[fn]()?b()[In](i):n[vn](i)},e[En]=b,e[pn]=function(){return r||(r=function(){var e;return cn(((e={})[Tn]=function(e){},e[Cn]=function(e){},e[gr]=function(e){},e[Sr]=function(e,t){},e[yr]=function(e,t){},e))}(),e[Yl]=r),r},e[Tn]=function(e){r&&r[Tn](e)},e[Cn]=function(e){r&&r[Cn](e)},e.getCookieMgr=function(){return s||(s=Cs(t,e[Sn])),s},e.setCookieMgr=function(e){s=e},e[Tr]=function(){if(!o&&!a&&Eo(t.enablePerfMgr)){var i=Eo(t[pr]);Qr(i)&&(a=i(e,e[pn]()))}return o||a||null},e.setPerfMgr=function(e){o=e},e.eventCnt=function(){return n[yn]},e.releaseQueue=function(){if(i&&n[yn]>0){var e=n;n=[],co(e,(function(e){b()[In](e)}))}},e.pollInternalLogs=function(e){return m=e||null,E=!1,I&&(clearInterval(I),I=null),T(!0)},e[bn]=function(){E=!0,I&&(clearInterval(I),I=0,P())},L=function(){return f},N=["addTelemetryInitializer"],(x=e)&&L&&Yr(x)&&no(N)&&co(N,(function(e){ro(e)&&bo(x,e,L,e,_)})),e.unload=function(t,n,r){var o;void 0===t&&(t=!0),i||Co("SDK is not initialized"),v&&Co(Ql);var a=((o={reason:50})[Ln]=t,o.flushComplete=!1,o),s=Hl(k(),e);function l(t){a.flushComplete=t,v=!0,S.run(s,a),e[bn](),s[In](a)}s[wn]((function(){C(),n&&n(a)}),e),P(),D(t,l,6,r)||l(!1)},e[On]=O,e.addPlugin=function(e,t,i,n){if(!e)return n&&n(!1),void F(Jl);var r=O(e[hn]);if(r&&!t)return n&&n(!1),void F("Plugin ["+e[hn]+"] is already loaded!");var o={reason:16};function a(t){c[vn](e),o.added=[e],w(o),n&&n(!0)}if(r){var s=[r.plugin];R(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[kn]=D,e.getTraceCtx=function(e){var t;return A||(t={},A={getName:function(){return t[dn]},setName:function(e){t[dn]=e},getTraceId:function(){return t[ar]},setTraceId:function(e){Dl(e,32,"00000000000000000000000000000000")&&(t[ar]=e)},getSpanId:function(){return t[sr]},setSpanId:function(e){Dl(e,16,"0000000000000000")&&(t[sr]=e)},getTraceFlags:function(){return t[lr]},setTraceFlags:function(e){t[lr]=e}}),A},e.setTraceCtx=function(e){A=e||null},bo(e,"addUnloadCb",(function(){return S}),"add")}))}return e.__ieDyn=1,e}();function nc(e,t,i,n){co(e,(function(e){if(e&&e[t])if(i)setTimeout((function(){return n(e)}),0);else try{n(e)}catch(e){}}))}var rc,oc=function(){function e(t){this.listeners=[];var i=!!(t||{}).perfEvtsSendAll;ba(e,this,(function(e){e[Tn]=function(t){e.listeners[vn](t)},e[Cn]=function(t){for(var i=uo(e[tr],t);i>-1;)e.listeners[Pn](i,1),i=uo(e[tr],t)},e[gr]=function(t){nc(e[tr],gr,!0,(function(e){e[gr](t)}))},e[Sr]=function(t,i){nc(e[tr],Sr,!0,(function(e){e[Sr](t,i)}))},e[yr]=function(t,i){nc(e[tr],yr,i,(function(e){e[yr](t,i)}))},e[Ar]=function(t){t&&(!i&&t[ir]()||nc(e[tr],Ar,!1,(function(e){t[Ln]?setTimeout((function(){return e[Ar](t)}),0):e[Ar](t)})))}}))}return e.__ieDyn=1,e}(),ac=function(e){function t(){var i=e.call(this)||this;return ba(t,i,(function(e,t){function i(t){var i=e[pn]();i&&i[Sr]([t],2)}e[un]=function(e,i,n,r){t[un](e,i,n||new rs(e),r||new oc(e))},e.track=function(n){Pl(e[Tr](),(function(){return"AppInsightsCore:track"}),(function(){null===n&&(i(n),Co("Invalid telemetry item")),function(e){qr(e[dn])&&(i(e),Co("telemetry name required"))}(n),t.track(n)}),(function(){return{item:n}}),!n.sync)}})),i}return El(t,e),t.__ieDyn=1,t}(ic),sc="version",lc="properties",cc="1DS-Web-JS-3.2.18",uc="withCredentials",dc=((rc={})[0]=0,rc[2]=6,rc[1]=1,rc[3]=7,rc[4098]=6,rc[4097]=1,rc[4099]=7,rc);function pc(e){return!(""===e||qr(e))}function hc(e,t,i){var n=-1;if(!Kr(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=dc[gc(e)]||-1;-1!==n&&-1!==r?n|=r:6===r&&(n=r)}return n}function vc(e,t,i,n,r){var o={},a=!1,s=0,l=arguments.length,c=arguments;for("[object Boolean]"===Object[Yi].toString.call(c[0])&&(a=c[0],s++);s<l;s++)eo(c[s],(function(e,t){a&&t&&Yr(t)?no(t)?(o[e]=o[e]||[],co(t,(function(t,i){t&&Yr(t)?o[e][i]=vc(!0,o[e][i],t):o[e][i]=t}))):o[e]=vc(!0,o[e],t):o[e]=t}));return o}Boolean(Ma()),Boolean(_a());var fc=function(){var e=La("performance");return e&&e.now?e.now():So()};function mc(e,t){var i=e;i.timings=i.timings||{},i.timings.processTelemetryStart=i.timings.processTelemetryStart||{},i.timings.processTelemetryStart[t]=fc()}function gc(e){var t=0;if(null!=e){var i=typeof e;"string"===i?t=1:"number"===i?t=2:"boolean"===i?t=3:i===Xi&&(t=4,no(e)?(t=4096,e.length>0&&(t|=gc(e[0]))):on.call(e,"value")&&(t=8192|gc(e.value)))}return t}var Sc=function(e){function t(){var i=e.call(this)||this;return i.pluginVersionStringArr=[],ba(t,i,(function(e,t){e.logger&&e.logger.queue||(e.logger=new rs({loggingLevelConsole:1})),e.initialize=function(i,n,r,o){Pl(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||Co("Invalid property storage override passed."),i.channels&&co(i.channels,(function(e){e&&co(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&&co(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=ja(t);-1!==c.indexOf("channels")&&(c+="\n - Channels must be provided through config.channels only!"),as(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){Pl(e,(function(){return"AppInsightsCore.track"}),(function(){var n,r=i;if(r){r.timings=r.timings||{},r.timings.trackStart=fc(),(n=r.latency)&&oo(n)&&n>=1&&n<=4||(r.latency=1);var o=r.ext=r.ext||{};o.sdk=o.sdk||{},o.sdk.ver=cc;var a=r.baseData=r.baseData||{};a[lc]=a[lc]||{};var s=a[lc];s[sc]=s[sc]||e.pluginVersionString||""}t.track(r)}),(function(){return{item:i}}),!i.sync)}})),i}return El(t,e),t.__ieDyn=1,t}(ac);const yc=Sc;var Ac,Ic,Ec=(Ic={},eo({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},(function(e,t){Ic[e]=t,Ic[t]=e})),Ac=Ic,Fr&&eo(Ac,(function(e,t){(no(t)||Yr(t))&&Fr(t)})),go(Ac)),Tc="REAL_TIME",Cc="",bc="POST",wc="drop",Oc="requeue",kc="application/x-json-stream",Rc="cache-control",Pc="content-type",Dc="kill-duration",Fc="time-delta-millis",xc="client-version",Lc="client-id",Nc="time-delta-to-apply-millis",_c="upload-time",Mc="apikey",Uc="AuthMsaDeviceTicket",$c="AuthXToken",zc="msfpc",Hc="trace",Vc="user";function Wc(e){var t=(e.ext||{}).intweb;return t&&pc(t[zc])?t[zc]:null}function Bc(e){for(var t=null,i=0;null===t&&i<e.length;i++)t=Wc(e[i]);return t}var jc=function(){function e(t,i){var n=i?[].concat(i):[],r=this,o=Bc(n);r.iKey=function(){return t},r.Msfpc=function(){return o||Cc},r.count=function(){return n.length},r.events=function(){return n},r.addEvent=function(e){return!!e&&(n.push(e),o||(o=Wc(e)),!0)},r.split=function(i,r){var a;if(i<n.length){var s=n.length-i;qr(r)||(s=r<s?r:s),a=n.splice(i,s),o=Bc(n)}return new e(t,a)}}return e.create=function(t,i){return new e(t,i)},e}();const Gc=function(){function e(){var t=!0,i=!0,n=!0,r="use-collector-delta",o=!1;ba(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 Kc=function(){function e(){var t={};ba(e,this,(function(e){e.setKillSwitchTenants=function(e,i){if(e&&i)try{var n=function(e){var t=[];return e&&co(e,(function(e){t.push(po(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]]=So()+r}catch(e){return[]}return[]},e.isTenantKilled=function(e){var i=t,n=po(e);return void 0!==i[n]&&i[n]>So()||(delete i[n],!1)}}))}return e.__ieDyn=1,e}();const qc=Kc;function Xc(e){var t,i=Math.floor(1200*Math.random())+2400;return t=Math.pow(2,e)*i,Math.min(t,6e5)}var Jc,Yc=2e6,Qc=Math.min(Yc,65e3),Zc="metadata",eu="f",tu=/\./,iu=function(){function e(t,i,n,r){var o="data",a="baseData",s=!!r,l=!0,c=i,u={};ba(e,this,(function(e){function i(e,t,r,o,a,l,d){eo(e,(function(e,p){var h=null;if(p||pc(p)){var v=r,f=e,m=a,g=t;if(s&&!o&&tu.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=to(e,"ext.metadata")||to(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&&!pc(t)||"string"!=typeof e)return null;var n=typeof t;if("string"===n||"number"===n||"boolean"===n||no(t))t={value:t};else if("object"!==n||on.call(t,"value")){if(qr(t.value)||""===t.value||!ro(t.value)&&!oo(t.value)&&!ao(t.value)&&!no(t.value))return null}else t={value:i?JSON.stringify(t):t};if(no(t.value)&&!(t.value.length>0))return null;if(!qr(t.kind)){if(no(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&&!no(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:Cc,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&&Pl(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?Qc:Yc,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(jc.create(n.iKey(),l)),c&&c.length>0&&i.failedEvts.push(jc.create(n.iKey(),c)),s){i.batches.push(n),i.payloadBlob=o,i.numEvents=a;var S=n.iKey();-1===uo(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 Pl(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,eo(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){nu(n,e,t,i)}),l),i(e.data,s,o,!1,[],(function(e,t,i){nu(n,e,t,i)}),l),JSON.stringify(t)}),(function(){return{item:e}}))}catch(e){return null}}}))}return e.__ieDyn=1,e}();function nu(e,t,i,n){if(n&&e){var r=hc(n.value,n.kind,n.propertyType);if(r>-1){var o=e[Zc];o||(o=e[Zc]={f:{}});var a=o[eu];if(a||(a=o[eu]={}),t)for(var s=0;s<t.length;s++){var l=t[s];a[l]||(a[l]={f:{}});var c=a[l][eu];c||(c=a[l][eu]={}),a=c}a=a[i]={},no(n.value)?a.a={t:r}:a.t=r}}}var ru="sendAttempt",ou="&NoResponseBody=true",au=((Jc={})[1]=Oc,Jc[100]=Oc,Jc[200]="sent",Jc[8004]=wc,Jc[8003]=wc,Jc),su={},lu={};function cu(e,t,i){su[e]=t,!1!==i&&(lu[t]=e)}function uu(e){try{return e.responseText}catch(e){}return Cc}function du(e,t){var i=!1;if(e&&t){var n=fo(e);if(n&&n.length>0)for(var r=t.toLowerCase(),o=0;o<n.length;o++){var a=n[o];if(a&&Jr(t,a)&&a.toLowerCase()===r){i=!0;break}}}return i}function pu(e,t,i,n){t&&i&&i.length>0&&(n&&su[t]?(e.hdrs[su[t]]=i,e.useHdrs=!0):e.url+="&"+t+"="+i)}function hu(e,t){return t&&(oo(t)?e=[t].concat(e):no(t)&&(e=t.concat(e))),e}cu(Uc,Uc,!1),cu(xc,xc),cu(Lc,"Client-Id"),cu(Mc,Mc),cu(Nc,Nc),cu(_c,_c),cu($c,$c);var vu=function(){function e(t,i,n,r,o){this._responseHandlers=[];var a,s,l,c,u,d,p,h,v,f,m="?cors=true&"+Pc.toLowerCase()+"="+kc,g=new qc,S=!1,y=new Gc,A=!1,I=0,E=!0,T=[],C={},b=[],w=null,O=!1,k=!1,R=!1;ba(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===Da&&(Da=typeof XDomainRequest!==Ji)&&qa()&&(Da=Da&&!xa(La(ka),"withCredentials")),Da?n=F:qa()&&(n=L)):2===i&&Ka(t)&&(!t||t&&!h)?n=x:A&&3===i&&Ga()&&(n=_),r++;return n?{_transport:i,_isSync:t,sendPOST:n}:null}function F(e,t,i){var n=new XDomainRequest;n.open(bc,e.urlString),e.timeout&&(n.timeout=e.timeout),n.onload=function(){var e=uu(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 x(e,t,i){var n,r=e.urlString,a=!1,s=!1,l=((n={body:e.data,method:bc}).Microsoft_ApplicationInsights_BypassAjaxInstrumentation=!0,n);i&&(l.keepalive=!0,2===e._sendReason&&(a=!0,f&&(r+=ou))),P&&(l.credentials="include"),e.headers&&fo(e.headers).length>0&&(l.headers=e.headers),fetch(r,l).then((function(e){var i={},n=Cc,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 L(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]=po(n))}return e}function o(e,i){N(t,e.status,function(e){var t,i,n={};return e.getAllResponseHeaders?(t=e.getAllResponseHeaders(),i={},ro(t)&&co(po(t).split(/[\r\n]+/),(function(e){if(e){var t=e.indexOf(": ");if(-1!==t){var n=po(e.substring(0,t)).toLowerCase(),r=po(e.substring(t+1));i[n]=r}else i[po(e)]=1}})),n=i):(n=r(n,e,Fc),n=r(n,e,Dc),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,uc,i),s.open(e,t,!r),i&&a(s,uc,i),!r&&o&&a(s,"timeout",o),s}(bc,n,P,!0,i,e.timeout);eo(e.headers,(function(e,t){a.setRequestHeader(e,t)})),a.onload=function(){var e=uu(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){as(s,2,518,ja(e))}}function _(e,t,i){var n=200,r=e._thePayload,o=e.urlString+(f?ou:Cc);try{var a=$a();if(!a.sendBeacon(o,e.data))if(r){var l=[];co(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){ss(s,"Failed to send telemetry using sendBeacon API. Ex:"+ja(e)),n=0}finally{N(t,n,{},Cc)}}function M(e){return 2===e||3===e}function U(e){return k&&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&&co(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;Pl(c,(function(){return"HttpManager:_sendBatches"}),(function(a){a&&(e=e.slice(0));for(var s=[],c=null,d=fc(),p=l[r]||(u?l[1]:l[0]),h=p&&p._transport,f=v&&(k||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,fc(),o),d=fc(),c=null):(j(c,d,fc(),o),d=fc(),e=[m].concat(e),c=null)))}c&&j(c,d,fc(),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){as(s,2,48,"Unexpected Exception sending batch: "+ja(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=R;(t.isBeacon||3===v._transport)&&(f=!1);var S=function(e,t){var i={url:m,hdrs:{},useHdrs:!1};t?(i.hdrs=vc(i.hdrs,C),i.useHdrs=fo(i.hdrs).length>0):eo(C,(function(e,t){lu[e]?pu(i,lu[e],t,!1):(i.hdrs[e]=t,i.useHdrs=!0)})),pu(i,Lc,"NO_AUTH",t),pu(i,xc,cc,t);var n=Cc;co(e.apiKeys,(function(e){n.length>0&&(n+=","),n+=e})),pu(i,Mc,n,t),pu(i,_c,So().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 Cc}(e);if(pc(r)&&(i.url+="&ext.intweb.msfpc="+r),y.shouldAddClockSkewHeaders()&&pu(i,Nc,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=fc();Pl(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[ru]>0?C[ru]++:C[ru]=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&&(du(w.headers,Rc)||(w.headers[Rc]="no-cache, no-store"),du(w.headers,Pc)||(w.headers[Pc]=kc));var R=null;v&&(R=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!==Ji){if(i){y.setClockSkew(i[Fc]);var h=i[Dc]||i["kill-duration-seconds"];co(g.setKillSwitchTenants(i["kill-tokens"],h),(function(e){co(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,k?2:r.sendType,5)}),k,Xc(v))):(d=!0,k&&(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=fc();co(e,(function(e){e&&e.count()>0&&function(e,t){O&&co(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){ss(s,"Unexpected exception sending payload. Ex:"+ja(e)),N(r,0,{})}}),Pl(c,(function(){return"HttpManager:_doPayloadSend.sender"}),(function(){if(R)if(0===t.sendType&&I++,u&&!t.isBeacon&&3!==v._transport){var i={data:w.data,urlString:w.urlString,headers:vc({},w.headers),timeout:w.timeout,disableXhrSync:w.disableXhrSync,disableFetchKeepAlive:w.disableFetchKeepAlive},n=!1;Pl(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),R(e)}),t.isSync||t.isTeardown)}catch(e){n||R(w)}}))}else R(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){as(s,1,519,"Response handler failed: "+e)}if(t){var r=JSON.parse(t);pc(r.webResult)&&pc(r.webResult[zc])&&u.set("MSFPC",r.webResult[zc],31536e3)}}catch(e){}}function q(e,t,i,n){if(e&&e.length>0&&r){var o=r[(l=t,u=au[l],pc(u)||(u="oth",l>=9e3&&l<=9999?u="rspFail":l>=8e3&&l<=8999?u=wc:l>=1e3&&l<=1999&&(u="send")),u)];if(o){var a=0!==i;Pl(c,(function(){return"HttpManager:_sendBatchesNotification"}),(function(){G((function(){try{o.call(r,e,t,a,i)}catch(e){as(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,R=!!Kr(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;Kr(r.enableCompoundKey)||(g=!!r.enableCompoundKey),d=r.xhrTimeout,p=!!r.disableXhrSync,h=!!r.disableFetchKeepAlive,f=!1!==r.addNoResponse,A=!Wa(),w=new iu(c,S,y,g),qr(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 k=za();k&&k.protocol&&"file:"===k.protocol.toLowerCase()&&(P=!1);var F=[];Wa()?(F=[2,1],b=[2,1,3]):F=[1,2,3],(n=D(F=hu(F,r.transports),!1))||ss(s,"No available transport to send events"),I=D(F,!0)}T||(T=D(b=hu(b,r.unloadTransports),!0)),v=!E&&(A&&Ga()||!h&&Ka(!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){Kr(e)&&(e=0),k&&(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){k=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&&(qr(t)&&(t=1),k&&(t=U(t),i=2),W([e],0,!1,t,i||0))}}))}return e.__ieDyn=1,e}();function fu(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];return setTimeout(e,t,i)}function mu(e){clearTimeout(e)}function gu(e,t){return{set:e||fu,clear:t||mu}}var Su="eventsDiscarded",yu="overrideInstrumentationKey",Au="maxEventRetryAttempts",Iu="maxUnloadEventRetryAttempts";const Eu=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=Tc,I=null,E=null,T=0,C=0,b={},w=-1,O=!0,k=!1,R=6,P=2;return ba(t,n,(function(e,t){function n(e){"beforeunload"!==(e||_a().event).type&&(k=!0,o.setUnloading(k)),$(2,2)}function D(e){k=!1,o.setUnloading(k)}function F(e,t){if(e.sendAttempt||(e.sendAttempt=0),e.latency||(e.latency=1),e.ext&&e.ext[Hc]&&delete e.ext[Hc],e.ext&&e.ext[Vc]&&e.ext[Vc].id&&delete e.ext[Vc].id,O&&(e.ext=wo(e.ext),e.baseData&&(e.baseData=wo(e.baseData)),e.data&&(e.data=wo(e.data))),e.sync)if(T||v)e.latency=3,e.sync=!1;else if(o)return O&&(e=wo(e)),void o.sendSynchronousBatch(jc.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(Su,[o],Ec.QueueFull),!0}i++}return W(),!1}(e.iKey,e.latency,s,l)&&(a=!V(e,t))}a&&J(Su,[e],Ec.QueueFull)}function x(e,t,i){var n=B(e,t,i);return o.sendQueuedRequests(t,i),n}function L(){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,x(4,0,1),N()}),e))}var t=y[A][1];!I&&!h&&t>=0&&!v&&(L()?I=M((function(){I=null,x(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=Tc,I=null,E=null,T=0,C=0,r=null,b={},a=void 0,s=0,w=-1,l=null,O=!0,k=!1,R=6,P=2,c=null,u=gu(),o=new vu(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=Xc(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||x(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=jc.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=wo(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&&co(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()?Pl(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&&(co(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(Su,e,Ec.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){x(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={})[Tc]=[2,1,0],y.NEAR_REAL_TIME=[6,3,0],y.BEST_EFFORT=[18,9,0]}function q(t,i){var n=[],r=R;k&&(r=P),co(t,(function(t){t&&t.count()>0&&co(t.events(),(function(t){t&&(t.sync&&(t.latency=4,t.sync=!1),t.sendAttempt<r?(mc(t,e.identifier),F(t,!1)):n.push(t))}))})),n.length>0&&J(Su,n,Ec.NonRetryableStatus),k&&$(2,2)}function X(t,i){var n=e._notificationManager||{},r=n[t];if(r)try{r.apply(n,i)}catch(i){as(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&&co(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(Su,e,t>=8e3&&t<=8999?t-8e3:Ec.Unknown)}function te(e){Y(Su,e,Ec.NonRetryableStatus),N()}function ie(e,t){Y(Su,e,Ec.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){Pl(l,(function(){return"PostChannel:initialize"}),(function(){var p=l;t.initialize(s,l,d);try{l.addUnloadCb,c=hl(Ws(e.identifier),l.evtNamespace&&l.evtNamespace());var h=e._getTelCtx();s.extensionConfig[e.identifier]=s.extensionConfig[e.identifier]||{},i=h.getExtCfg(e.identifier),u=gu(i.setTimeoutOverride,i.clearTimeoutOverride),O=!i.disableOptimizeObj&&!!La("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),oo(i[Au])&&(R=i[Au]),oo(i[Iu])&&(P=i[Iu]),ne(),i.httpXHROverride&&i.httpXHROverride.sendPOST&&(r=i.httpXHROverride),pc(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&&no(e)&&!(r=ml(e,t,i,n))&&i&&i[yn]>0&&(r=ml(e,t,null,n))})([el,Zs,Ys],n,f,c),Sl(n,f,c),yl(D,s.disablePageShowEvents,c)}catch(t){throw e.setInitialized(!1),t}}),(function(){return{coreConfig:s,core:l,extensions:d}}))},e.processTelemetry=function(t,n){mc(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[yu]&&(a.iKey=i[yu]),r&&r[yu]&&(a.iKey=r[yu]),F(a,!0),k?$(2,2):N()),e.processNext(a,n)},e._doTeardown=function(e,t){var i;$(2,2),d=!0,o.teardown(),gl([el,Zs,Ys],null,c),i=hl(tl,c),gl([Ys],null,i),gl([Js],null,i),function(e,t){var i=hl(il,t);gl([Qs],null,i),gl([Js],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&&co(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=Tc,N(),eo(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();x(1,1,i),null!=t&&t(),n&&N()}},e.setMsaAuthTicket=function(e){o.addHeader(Uc,e)},e.hasEvents=L,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())},mo(e,"_setTimeoutOverride",(function(){return u.set}),(function(e){u=gu(e,u.clear)})),mo(e,"_clearTimeoutOverride",(function(){return u.clear}),(function(e){u=gu(u.set,e)}))})),n}return El(t,e),t.__ieDyn=1,t}(ql);var Tu="HttpManager:_sendBatches",Cu="PrivacyGuard:_processTelemetry",bu=function(){function e(e,t,i){this.start=Bi(),this.name=e,this.isAsync=!0===i,this.payload=t}return e.prototype.isChildEvt=function(){return!1},e.prototype.complete=function(){this.time=Bi()-this.start,this.exTime=this.time},e}(),wu=function(){function e(e){this._callbacks=e}return e.prototype.create=function(e,t,i){return e===Tu||e===Cu?new bu(e,t,i):null},e.prototype.fire=function(e){if(e&&e.complete(),this._callbacks)switch(e.name){case Tu:this.handleSendBatches(e);break;case Cu: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}(),Ou=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.initialize=function(t,i){this._postChannel=new Eu;var n=null!=i?i:[];t.channels=[[this._postChannel]],t.extensionConfig=t.extensionConfig||[],t.extensionConfig[this._postChannel.identifier]=r(r({},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}(yc),ku=function(e){function t(t,i){var n,o=e.call(this,t,i)||this;o.sendTelemetryEvent=function(e){return function(){try{return void((t=o.getOneDSTelemetryEvent(e))&&n&&n.track(t))}catch(e){return void ei(1,"1DS Sink",e)}var t}()},o.sendCustomerContent=function(e){},o.sendNonStandardEvent=function(e,t){var i=!1;l.forEach((function(n){n.canHandle(t)&&(n.processEvent(e),i=!0)})),i||Zt(0,1,(function(){return"Missing Handler for "+t+"to process"+e.eventName}))},o.flush=function(e){null==n||n.flush(e),l.forEach((function(t){t.flush(e)}))},o.shutdown=function(){try{null==n||n.shutdown(),l.forEach((function(e){e.shutdown()}))}catch(e){Zt(0,2,(function(){return"An error occurred on shutdown"}))}};var a,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:r({},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 o=new Ou;return o.initialize(n,e.plugins),o.setUploadFrequency(e.uploadFrequency),e.notificationListener&&o.addNotificationListener(e.notificationListener),e.stats&&o.setPerfMgr(new wu(e.stats)),o}(i,No),l.forEach((function(e){e.initialize(o,i)})),!i.endpointUrl)throw new Error("Missing Endpoint Url");return i.disableStatsTracking||(a=o,(s=n)&&s.addNotificationListener({eventsSent:function(e){Zt(2,2,(function(){return"Successfully sent ".concat(e.length," event(s)")})),Zt(3,2,(function(){return"Sent event(s) details : ".concat(JSON.stringify(e,null,2))})),a.eventsSent+=e.length},eventsDiscarded:function(e,t){Zt(0,2,(function(){return"Discarded ".concat(e.length," event(s) because ").concat(t)})),Zt(3,2,(function(){return"Discarded event(s) details : ".concat(JSON.stringify(e,null,2))})),a.eventsDiscarded+=e.length}})),o}return n(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=Al();this.init=function(e){return Bo(s,!1)},this.begin=function(){return o=o&&Bo(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=vi(e);if(function(e,t){for(var i=function(i){var n=t[i];if(!n.processEvent(e))return Zt(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(!_o(c,r.dataFields,!0,t.eventType))return void Zt(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,"_")),_o(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 Zt(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){_o(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($i(p.app)),u(Mi(p.user)),u(zi(p.session));var h=p.release;h&&u((Fi(d=[],"Release","AudienceGroup",h.audienceGroup,1),d))}this.addPreprocessor(a)})),Ru="Office.Telemetry.OTelJS.EventThrottled";function Pu(e){return"number"==typeof e}var Du,Fu,xu=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===Ru)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):Pu(this._maxSingleEventPerSecond)&&(i=this.applyThrottle(this._singleEventInLastInterval[t],this._maxSingleEventPerSecond,"MaxSingleEventsPerSecond",t)),Pu(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:Ru,telemetryProperties:{ariaTenantToken:No,nexusTenantToken:1723},eventFlags:{diagnosticLevel:110},dataFields:[pi("SinkName",this._sinkName||""),pi("ThrottledEvent.Name",n),di(i,t)]})),Zt(2,1,(function(){return"1DS Sink Event Throttle: Exceeded ".concat(t," ").concat(i,": ").concat(n)})),1))},e}();(Fu=Du||(Du={})).USGOV_DOD="https://pf.events.data.microsoft.com/OneCollector/1.0/",Fu.USGOV_DOJ="https://tb.events.data.microsoft.com/OneCollector/1.0/",Fu.PUBLIC="https://browser.events.data.microsoft.com/OneCollector/1.0/",Fu.CUSTOMER_CONTENT="",Fu.EUDB="https://eu-office.events.data.microsoft.com/OneCollector/1.0/";var Lu,Nu,_u,Mu,Uu,$u,zu,Hu,Vu,Wu,Bu,ju,Gu,Ku,qu,Xu,Ju,Yu,Qu,Zu,ed,td,id,nd,rd=i(9315);(nd=Lu||(Lu={})).Unknown="unknown",nd.Loading="loading",nd.WaitingForAppLoad="WaitingForAppLoad",nd.Loaded="loaded",nd.Failed="failed",nd.Unloading="unloading",nd.Unloaded="unloaded",nd.Cached="cached",(id=Nu||(Nu={}))[id.NOT_SUPPORTED_ON_PLATFORM=100]="NOT_SUPPORTED_ON_PLATFORM",id[id.INTERNAL_ERROR=500]="INTERNAL_ERROR",id[id.NOT_SUPPORTED_IN_CURRENT_CONTEXT=501]="NOT_SUPPORTED_IN_CURRENT_CONTEXT",id[id.PERMISSION_DENIED=1e3]="PERMISSION_DENIED",id[id.NETWORK_ERROR=2e3]="NETWORK_ERROR",id[id.NO_HW_SUPPORT=3e3]="NO_HW_SUPPORT",id[id.INVALID_ARGUMENTS=4e3]="INVALID_ARGUMENTS",id[id.UNAUTHORIZED_USER_OPERATION=5e3]="UNAUTHORIZED_USER_OPERATION",id[id.INSUFFICIENT_RESOURCES=6e3]="INSUFFICIENT_RESOURCES",id[id.THROTTLE=7e3]="THROTTLE",id[id.USER_ABORT=8e3]="USER_ABORT",id[id.OPERATION_TIMED_OUT=8001]="OPERATION_TIMED_OUT",id[id.OLD_PLATFORM=9e3]="OLD_PLATFORM",id[id.FILE_NOT_FOUND=404]="FILE_NOT_FOUND",id[id.SIZE_EXCEEDED=1e4]="SIZE_EXCEEDED",(_u||(_u={})).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"}(Mu||(Mu={})),function(e){e.Regular="Regular",e.Private="Private",e.Shared="Shared"}(Uu||(Uu={})),function(e){e[e.Admin=0]="Admin",e[e.User=1]="User",e[e.Guest=2]="Guest"}($u||($u={})),(td=zu||(zu={})).Inline="inline",td.Desktop="desktop",td.Web="web",function(e){e.M365Content="m365content"}(Hu||(Hu={})),function(e){e.DriveId="driveId",e.GroupId="groupId",e.SiteId="siteId",e.UserId="userId"}(Vu||(Vu={})),function(e){e.Public="public",e.EUDB="eudb",e.DOD="dod",e.DOJ="doj"}(Wu||(Wu={})),function(e){e.Public="public",e.EUDB="eudb",e.Other="other"}(Bu||(Bu={})),function(e){e[e.PreviousLandmark=0]="PreviousLandmark",e[e.NextLandmark=1]="NextLandmark",e[e.Read=2]="Read",e[e.Compose=3]="Compose"}(ju||(ju={})),function(e){e[e.PreviousLandmark=0]="PreviousLandmark",e[e.NextLandmark=1]="NextLandmark",e[e.GoToActivityFeed=2]="GoToActivityFeed"}(Gu||(Gu={}));class od{constructor(e){this.uuid=zt(),this.uuid=e||zt(),Mt(this.uuid)}toString(){return this.uuid}static validate(e){return Mt(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"}(Ku||(Ku={})),function(e){e.windows="windows",e.macOs="macos"}(qu||(qu={})),function(e){e.default="default",e.dark="dark",e.highContrast="contrast"}(Xu||(Xu={})),function(e){e.fileOpenPreference="fileOpenPreference",e.theme="theme"}(Ju||(Ju={})),function(e){e.web="web",e.desktop="desktop"}(Yu||(Yu={})),function(e){e.settings="settings",e.content="content",e.authentication="authentication",e.remove="remove",e.task="task",e.sidePanel="sidePanel",e.meetingStage="meetingStage"}(Qu||(Qu={})),function(e){e.copilotSidePanel="copilotSidePanel"}(Zu||(Zu={})),function(e){e.TextPlain="text/plain",e.TextHtml="text/html",e.ImagePNG="image/png",e.ImageJPEG="image/jpeg"}(ed||(ed={}));class ad{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 sd={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};function ld(){return sd}const cd=e=>e&&new URL(e).host,ud=/([\[\]\^\$\|\(\)\\\.\+\*\?\{\}\=\!\<\>\-])/gi,dd=(e,t,i,n)=>{try{return void 0!==i&&Id(new URL(e),hd(i,n),t)}catch(e){return t.log(Gt.Error,"isValidOriginForApp","Invalid origin",null),!1}},pd=e=>{let t=[];for(const i of e)i.match(yt)||t.push(i);return t},hd=(e,t)=>{var i,n,r;const o=new ad;return e.validDomains&&e.validDomains.forEach((e=>o.add(Ad(e,t)))),null===(i=e.pages.configurable)||void 0===i||i.forEach((e=>o.add(cd(yd(e.configurationUrl,t))))),null===(n=e.pages.static)||void 0===n||n.forEach((e=>{e.contentUrl&&o.add(cd(yd(e.contentUrl,t)))})),(null===(r=null==e?void 0:e.connector)||void 0===r?void 0:r.configurationUrl)&&o.add(cd(e.connector.configurationUrl)),Array.from(o.values())},vd=e=>!!e&&At.has(e.toLowerCase()),fd=e=>vd(null==e?void 0:e.id),md=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}},gd=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()}},Sd=(e,t)=>{let i;if(ld().useUrlClassForValidDomains)i=(e.startsWith("https://")||e.startsWith("api://"))&&Mt(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"},yd=(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 Cd(e,f)},Ad=(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 Cd(e,a)},Id=(e,t,i)=>{const n=Td(e),r=new ad;let o=[...t];const a=pd([...t]);a.length>0&&(i.log(Gt.Debug,"isUrlInDomainList",`Invalid domain detected with ${a}}`),ld().wildcardValidDomainRuleDetection&&(o=o.filter((e=>!a.includes(e)))));for(const e of o){if(!r.add(e))continue;const t=Ed(e),i=new RegExp(`^https://${t}((/|\\?).*)?$`,"i");if(n.match(i))return!0}return!1},Ed=e=>{if(!0===ld().wildcardValidDomainRuleDetection&&pd([e]).length>0)throw new Error("The wildcardValidDomainRuleDetection flag is enabled and an improper wildcard domain segment was detected: "+e);return e.replaceAll(".","[.]").replaceAll("*","[^/^.]+")},Td=e=>e.href,Cd=(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=bd(r,t,i,(e=>encodeURI(e)))),o&&(o=bd(o,t,i,(e=>encodeURIComponent(e)))),r+o},bd=(e,t,i=[],n)=>{if(void 0!==t)if("object"==typeof t)for(const r in t)e=bd(e,t[r],i.concat(r),n);else if(ld().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 wd(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,parentMessageId:e.app.parentMessageId||"",userClickTime:e.app.userClickTime||0,userClickTimeV2:e.app.userClickTimeV2||0,userFileOpenPreference:e.app.userFileOpenPreference||zu.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 Od(e){return void 0!==e&&Tt.has(e)&&!ld().disableDebuggingTelemetryToAria}const kd=new Map([["api.appInitialization.initialize",Y],["api.appInitialization.appLoaded",l],["api.appInitialization.success",d],["api.appInitialization.failure",u],["api.appInitialization.expectedFailure",c]]);function Rd(e){return ld().disableFirstPartyAppsAsMicrosoftOwned?!!(null==e?void 0:e.isFullTrust):!!(null==e?void 0:e.isMicrosoftOwned)||!!(null==e?void 0:e.isFullTrust)}class Pd{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 Dd{constructor(){}static getInstance(){return Dd.instance||(Dd.instance=new Pd),Dd.instance}}const Fd=new RegExp("[a-zA-Z0-9_\\-\\.]+(@|%40|%2540)[a-zA-Z0-9_\\-\\.]+\\.[a-zA-Z]{2,5}","g"),xd=(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.")&&!Dt.some((e=>t===e||t.endsWith("."+e))))||kt.some((e=>t===e||t.endsWith("."+e)))}),Ld=(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},Nd=e=>!!e&&void 0!==e.user.id;function _d(e){return e.majorVersion<1||1==e.majorVersion&&e.minorVersion<5}const Md=e=>{let t;return t=e===Wu.Public?Bu.Public:e===Wu.EUDB?Bu.EUDB:Bu.Other,t};function Ud(e){return e?((t=e)&&(t=t.replace(Fd,"email_removed")),t):"";var t}const $d=performance&&"object"==typeof performance&&["now","timeOrigin"].map((e=>e in performance)).every((e=>e));function zd(e="monotonic"){return ld().useGlobalMonotonicTimersForTelemetry&&Hd(e)||Hd("date")}function Hd(e){switch(e){case"date":return{type:"date",value:Date.now()};case"monotonic":if(!$d)return;return{type:"monotonic",value:performance.now()+performance.timeOrigin};default:throw new Error(`Unsupported timestamp type: ${e}`)}}function Vd(){var e;return null===(e=Hd("monotonic"))||void 0===e?void 0:e.value}function Wd(e,t){return $d&&e&&ld().useGlobalMonotonicTimersForTelemetry?{type:"monotonic",value:e}:t?{type:"date",value:t}:void 0}function Bd(){return $d?1e3*Math.floor(performance.now()):1e3*Date.now()}var jd,Gd;!function(e){e.Start="start",e.End="end"}(jd||(jd={})),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"}(Gd||(Gd={}));const Kd={[Gd.MetaOsAppContainerInitiation]:0,[Gd.GetPermissions]:0,[Gd.IframeSetAndLoadOrigin]:0,[Gd.OverallAppLoadTimeBeforeInitialize]:0,[Gd.InitializeMessageDelay]:0,[Gd.InitializeMessageProcessTime]:0,[Gd.AppLoadedMessageDelay]:0,[Gd.AppLoadedMessageProcessTime]:0,[Gd.SuccessMessageDelay]:0,[Gd.SuccessMessageProcessTime]:0,[Gd.FailureMessageDelay]:0,[Gd.FailureMessageProcessTime]:0,[Gd.ExpectedFailureMessageDelay]:0,[Gd.ExpectedFailureMessageProcessTime]:0};function qd(e,t){const i=function(e){return zd(e.type).value-e.value}(t);switch(e){case Y:Kd.initializeMessageDelay_ms=i;break;case l:Kd.appLoadedMessageDelay_ms=i;break;case d:Kd.successMessageDelay_ms=i;break;default:console.warn(e+" is not supported in this environment")}return i}const Xd={};let Jd=!1;function Yd(e,t){var i;if(!Jd&&(i=t,Object.values(Gd).includes(i))&&"object"==typeof window&&"object"==typeof window.performance&&"now"in window.performance){const i=performance.now();if(e!==jd.Start||Xd.hasOwnProperty(t)){if(e===jd.End){const e=Xd[t];if(void 0!==e){const n=parseFloat((i-e).toFixed(2));Kd[t]=Math.max(Kd[t],n)}delete Xd[t]}}else Xd[t]=i}}class Qd{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=[...Ti.Office.System.User.getFields("User",{isAnonymous:!0})];let o=[pi(`${this.eventFieldPrefix}.HostName`,this.hubInfo.name),pi(`${this.eventFieldPrefix}.HostVersion`,this.hubInfo.version),pi(`${this.eventFieldPrefix}.HostSdkVersion`,s),pi(`${this.eventFieldPrefix}.HostSessionId`,this.hubInfo.sessionId),pi(`${this.eventFieldPrefix}.TelemetrySource`,this.telemetrySource),pi(`${this.eventFieldPrefix}.Platform`,t.app.host.clientType===Yu.web?"Web":"Desktop"),pi(`${this.eventFieldPrefix}.HostRingId`,null!==(n=null==t?void 0:t.app.host.ringId)&&void 0!==n?n:"")];this.telemetryLogger=new Ki,this.telemetryLogger.setTenantToken(this.namespace,this.ariaTenantToken,this.nexusTenantToken);const a=tp(t.user.dataResidency);if(a){this.oneDsSink=new ku(o,{endpointUrl:a});const e=new xu("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]}let l=$i({name:"OfficeAppHostingSdk"});null===(r=this.oneDsSink)||void 0===r||r.addPersistentDataFields(l),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}:zd();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 ep(this,d,l,u,c,Rd(this.appDefinition),e)):(this.addHubSdkTelemetryScenarioDataFields(l.value,null!=o&&o),new Zd(this,d,l,u,c))}shouldCustomTelemetryScenarioReceiveAppInitTelemetry(e){var t,i;return e!==qt&&(!kd.has(e)||!Od(null===(t=this.appDefinition)||void 0===t?void 0:t.id)||null!==(i=ld().shouldCustomTelemetryScenarioReceiveAppInitTelemetry)&&void 0!==i&&i)}addAppInitializationDataFields(){var e,t,i,n,r,o,a,s,l,c,u,d,p,h,v,f;let m=pi(`${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:""),g=pi("ManifestVersion",null!==(r=null===(n=this.appDefinition)||void 0===n?void 0:n.manifestVersion)&&void 0!==r?r:""),S=ui("ShowLoadingIndicator",null!==(a=null===(o=this.appDefinition)||void 0===o?void 0:o.showLoadingIndicator)&&void 0!==a&&a),y=ui(Qd.CACHEDAPP_IND_FIELD_NAME,null!==(s=this.usingCachedApp)&&void 0!==s&&s),A=ui(Qd.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);const I=pi("InteractionContext",(Nd(this.appContext)&&this.appDefinition?function(e){if(e.frameContext===Qu.sidePanel||e.frameContext===Qu.meetingStage||e.frameContext===Qu.content)return e.meetingId?"Meeting":e.chatId?"Chat":e.channelId?"Channel":"Personal"}(wd(this.appContext,this.appDefinition)):void 0)||"");let E=di("UserClickTime",null!==(p=null===(d=this.appContext)||void 0===d?void 0:d.app.userClickTime)&&void 0!==p?p:0),T=di("UserClickTimeV2",null!==(v=null===(h=this.appContext)||void 0===h?void 0:h.app.userClickTimeV2)&&void 0!==v?v:0),C=pi("FeatureFlags",JSON.stringify(ld()));null===(f=this.oneDsSink)||void 0===f||f.addPersistentDataFields([m,g,S,y,A,I,E,T,C])}addHubSdkTelemetryScenarioDataFields(e,t){var i;let n=di("AppSdkRequestCreationTimeStamp",e),r=ui("IsProxiedFromChild",t);null===(i=this.oneDsSink)||void 0===i||i.addPersistentDataFields([n,r])}static getApiVersionTagForTelemetry(e,t){if(null!=t){if(null==e&&(0,rd.satisfies)(t,Qd.TEAMS_JS_LIBRARY_V1))return"v1";if(null==e&&(0,rd.satisfies)(t,`>${Qd.TEAMS_JS_LIBRARY_V2_LOWEST_VERSION}`)&&(0,rd.satisfies)(Qd.TEAMS_JS_LIBRARY_VERSION_WITH_APIVERSIONTAG,`>${t}`))return"unknown";if(e&&(0,rd.satisfies)(t,`>=${Qd.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;let l=this.appContext;if(this.appContext=e,this.oneDsSink){if(Nd(e)&&(!Nd(l)||e.user.id!==l.user.id)){let a,s=!e.user.id;if(s)a=this.anonymousDataFields;else{let l=(null===(i=null===(t=this.appContext.user)||void 0===t?void 0:t.tenant)||void 0===i?void 0:i.id)!==this.consumerTid;a=Mi({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:s})}this.oneDsSink.addPersistentDataFields(a)}if(this.appContext.app.sessionId!==(null==l?void 0:l.app.sessionId)){let e=zi({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)){let e=pi("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=[pi("HostedAppId",null!=i?i:""),pi("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:""),pi(Qd.APPSDK_VERSION_FIELD_NAME,null!==(s=this.appSdkVersion)&&void 0!==s?s:""),pi(Qd.APPSDK_API_VERSION_TAG_FIELD_NAME,Qd.getApiVersionTagForTelemetry(n,this.appSdkVersion)),pi("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:""),pi("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++){let 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!ld().disableExtendedTelemetryForMetaOSStoreApps&&!!e&&It.has(e)}shouldLogToAria(e,t){return!e.startsWith("eventDispatch")&&("appInitializationExtended"!==e||this.isAppStoreAppId(t))}}Qd.TEAMS_JS_LIBRARY_V1="1.x",Qd.TEAMS_JS_LIBRARY_V2_LOWEST_VERSION="2.0.0-beta.0",Qd.TEAMS_JS_LIBRARY_VERSION_WITH_APIVERSIONTAG="2.21.0",Qd.APPSDK_VERSION_FIELD_NAME="HostedAppSdkVersion",Qd.APPSDK_API_VERSION_TAG_FIELD_NAME="HostedAppSdkApiVersionTag",Qd.APPSDK_APP_INIT_STATE_TRANSITION_FIELD_NAME="HostedAppSdkAppInitStateTransition",Qd.CACHEDAPP_IND_FIELD_NAME="UsingCachedApp",Qd.APP_TERMINATE_REASON="HostedAppTerminateReason",Qd.BACKGROUND_LOAD_IND_FIELD_NAME="IsBackgroundLoad",Qd.WEB_CONTENT_SDK_ID="WebContentSdkId",Qd.COMM_BRIDGE_ID="CommunicationBridgeId",Qd.COMM_BRIDGE_LISTENERS_ADDED="CommunicationBridgeListenersAdded",Qd.IFRAME_SRC="IFrameInfoSrc",Qd.IFRAME_ORIGIN="IFrameOrigin",Qd.APP_DEFINITION="AppDefinition",Qd.USER_CLICK_TIME="UserClickTime",Qd.USER_CLICK_TIME_V2="UserClickTimeV2",Qd.APP_STATE_UPDATED="AppStateUpdated";class Zd{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=ld().useGlobalMonotonicTimersForTelemetry?i:{type:(a=i).type,value:Bd()-1e3*(Date.now()-a.value)}}addOrUpdateActivityDataField(e,t){var i,n,r,o,a,s,l;let 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(pi(e,t)):"boolean"==typeof t?null===(a=null===(o=this.activity)||void 0===o?void 0:o.dataFields)||void 0===a||a.push(ui(e,t)):"number"==typeof t&&(null===(l=null===(s=this.activity)||void 0===s?void 0:s.dataFields)||void 0===l||l.push(di(e,t)))}addOrUpdateActivityDataFieldForAppInitStateTransition(e){var t,i,n;const r=Qd.APPSDK_APP_INIT_STATE_TRANSITION_FIELD_NAME;let 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(pi(r,e))}oldMarkPhase(e,t){var i,n,r;const o=Bd(),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(di(`Activity.Phase.${e}`,a)),null===(r=this.customScenario)||void 0===r||r.markPhase(e)}markPhase(e,t=!1){var i,n,r;if(!ld().useGlobalMonotonicTimersForTelemetry)return this.oldMarkPhase(e,t);const o=zd(this.lastMark.type);if(this.lastMark.type!==o.type)return void Dd.getInstance().log(Gt.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(di(`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(pi("ErrorMessage",Ud(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({},Kd);return function(){o(this,void 0,void 0,(function*(){Jd=!0;for(const e in Kd)Kd.hasOwnProperty(e)&&(Kd[e]=0);for(const e in Xd)Xd.hasOwnProperty(e)&&delete Xd[e];yield new Promise((e=>setTimeout(e,0))),Jd=!1}))}(),e}());null===(i=null===(t=this.activity)||void 0===t?void 0:t.dataFields)||void 0===i||i.push(pi("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 ep extends Zd{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(pi("ErrorMessage",Ud(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(pi("WarnMessage",Ud(e)))}}const tp=e=>{switch(e){case Wu.EUDB:return Du.EUDB;case Wu.DOD:return Du.USGOV_DOD;case Wu.DOJ:return Du.USGOV_DOJ;case Wu.Public:return Du.PUBLIC;default:return}};var ip,np,rp,op,ap,sp;!function(e){e.Unknown="Unknown",e.Windows="Windows",e.iOS="iOS",e.Android="Android",e.Linux="Linux",e.tvOS="tvOS",e.MacOS="MacOS"}(ip||(ip={})),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"}(np||(np={})),function(e){e.NotSpecified="NotSpecified",e.User="User",e.System="System"}(rp||(rp={})),function(e){e.Unknown="Unknown",e.Anonymous="Anonymous",e.AAD="AAD",e.MSA="MSA",e.Self="Self"}(op||(op={})),function(e){e.Unknown="Unknown",e.AccessControlData="AccessControlData",e.CustomerContent="CustomerContent",e.EUII="EUII",e.OII="OII",e.AccountData="OII",e.SystemMetaData="SystemMetaData"}(ap||(ap={})),function(e){e.ApplicationEngaged="ApplicationEngaged"}(sp||(sp={}));class lp{constructor(e,t,i){var n,r,a;this.appSdkHost=e,this.hubServices=t,this.appContext=i,this.getDefaultSignalAuthToken=()=>o(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(lp.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 l=this.appSdkHost.getAppDefinition();this.actorInfo={ActorId:op.Self,ActorIdType:op.Self,ActorType:rp.User,AadTenantId:op.Self},this.applicationInfo={AppName:"",AadAppId:null!==(n=null==l?void 0:l.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===(a=this.appContext)||void 0===a?void 0:a.app.host.name,MetaOSHubSDKVersion:s}}createSignal(e){return{SignalType:e.signalType,Compliance:ap.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 Ku.office||Ku.outlookWin32||Ku.office:return np.OXO;case Ku.teams||Ku.teamsModern:return np.Teams;default:return np.Unknown}}getOs(){let e="Unknown";if(window&&window.navigator.userAgent){let t=window.navigator.userAgent;-1!=t.indexOf("Windows")?e="Windows":-1!=t.indexOf("Mac OS")?e="MacOS":-1!=t.indexOf("Android")?e="Android":-1!=t.indexOf("Linux")?e="Linux":/iPad|iPhone|iPod/.test(t)&&(e="iOS")}return e}sendSignal(e,t){return new Promise(((i,n)=>o(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>lp.RETRY_LIMIT?Promise.reject("Retry Limit reached. Unable to send Signal."):fetch(lp.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=>o(this,void 0,void 0,(function*(){return n&&n.ok?Promise.resolve(e.CV):n&&lp.RETRY_CODES.has(n.status)?(yield this.delay(i),this.postSignalWithRetry(e,t,++i)):Promise.reject(n)}))))}}function cp(e,t,i){return o(this,void 0,void 0,(function*(){try{let i=yield e.getAppContext();if(i.page.frameContext!=Qu.authentication){const n=new lp(e,t,i),r=n.createSignal({signalType:sp.ApplicationEngaged,startTime:e.getUserClickTime(),endTime:Date.now()});let o=yield n.sendSignal(r);e.getLogger().log(Gt.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(Gt.Error,"sendAppEngageSignal","Error occurred while sending substrate signal",n)}}))}lp.SIGS_ENDPOINT="https://substrate.office.com/sigsapi/v1.0/Me/Signals",lp.RETRY_LIMIT=2,lp.RETRY_CODES=new Set([503]),lp.DEFAULT_SIGS_RESOURCE_URL="https://outlook.office.com";const up=new Set([_e]);Nu.INTERNAL_ERROR,_u.INTERNAL_ERROR;const dp=(e,t)=>({errorCode:e,message:t}),pp=e=>o(void 0,void 0,void 0,(function*(){return null!=e?{kind:"appResponse",data:e}:{kind:"appResponse"}})),hp={kind:"logResponse"},vp=(e,...t)=>o(void 0,void 0,void 0,(function*(){return yield e(...t),hp})),fp=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 mp{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:dp(Nu.INVALID_ARGUMENTS,"App ID is not valid.")}(e)}toString(){return this.idAsString}get id(){return this.idAsString}}class gp extends mp{constructor(e){super(e),function(e,t){if(!function(e){return e.length<256&&e.length>4}(e))throw null!=t?t:dp(Nu.INVALID_ARGUMENTS,"App ID is not valid.")}(e)}toJSON(){return{appIdAsString:this.toString()}}}class Sp{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 ld().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:Xt[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===Xt[v]}canPassScenarioToHandler(e){return e===Xt[v]||e===Xt[L]||e===Xt[N]||e===Xt[_]||e===Xt[M]||e===Xt[H]||e===Xt[$]||e===Xt[z]||e===Xt[V]||e===Xt[R]||e===Xt[P]||e===Xt[D]||e===Xt[F]||e===Xt[x]||e===Xt[_e]||e===Xt[p]}handleMessage(e,t,i,n,r){var a,s,l,c,u,d,p,h;return o(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 o=null!==(a=this.handlers[t].callbackFixedArgsLength)&&void 0!==a?a:i.length;i.push(...Array(Math.max(0,o-i.length)).fill(void 0)),this.trackMessageDelayForAppInitAPIs(t,n);const v=this.handlers[t];let f=this.createTelemetryScenario(t,v,i,e,n,r);try{if(v.isRestrictedToFullTrustApps&&!(null===(s=this.appSdkHost.getAppDefinition())||void 0===s?void 0:s.isFullTrust))throw dp(Nu.INTERNAL_ERROR,Ot);if(v.isRestrictedToMicrosoftOwnedApps&&!(null===(l=this.appSdkHost.getAppDefinition())||void 0===l?void 0:l.isMicrosoftOwned))throw dp(Nu.INTERNAL_ERROR,Ot);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 dp(Nu.INTERNAL_ERROR,Ot);if(v.isRestrictedToFirstPartyOrLobApps&&!Rd(this.appSdkHost.getAppDefinition())&&!(null===(d=this.appSdkHost.getAppDefinition())||void 0===d?void 0:d.isLOB))throw dp(Nu.INTERNAL_ERROR,Ot);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 dp(Nu.INTERNAL_ERROR,Ot);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=fp(e);return this.appSdkHost.getLogger().log(Gt.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 Jt.has(e)&&!Od(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===Y||this.appSdkHost.isInitialized()}trackMessageDelayForAppInitAPIs(e,t){}validateDependencies(e){}cleanup(){}}function yp(e,t){const i=Object.assign({},e);return t.forEach((e=>delete i[e])),i}const Ap=[{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:yp(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})}}}],Ip=(e,t,i=Ap)=>{if(e.apiVersion<=t)return e;let n=e;for(let e of i)if(n.apiVersion===e.versionToDowngradeFrom&&(n=e.downgradeToPreviousVersion(n)),n.apiVersion<=t)break;return n},Ep="App failed to call initialize(). Immediate or Loading Screen apps are required to call app.initialize().",Tp="App failed to call notifySuccess(). Loading screen apps are required to call app.notifySuccess() when the app is loaded.";var Cp,bp;!function(e){e[e.initialAppInitializationTimerExpiration=1]="initialAppInitializationTimerExpiration",e[e.extendedAppInitializationTimerExpiration=2]="extendedAppInitializationTimerExpiration"}(Cp||(Cp={}));class wp extends Sp{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 xd(window.location.href)&&t&&Ld(t,Rt)?Pt:""},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:Lu.Failed,reason:ft.CachedAppLoadTimedOut,appSdkVersion:null===(t=this.telemetryService)||void 0===t?void 0:t.getAppSdkVersion()}),null===(i=this.hubServices.logger)||void 0===i||i.log(Gt.Error,"Error Screen Reason",Tp+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=ld().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&&It.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(Y,this.onInitializeCalled),this.registerHandler(J,this.getContext,{errorCallback:this.onGetContextError}),this.registerHandler(tt,this.readyToUnload),this.registerHandler(l,this.onNotifyAppLoadedCalled),this.registerHandler(d,this.onNotifySuccessCalled),this.registerHandler(u,this.onNotifyFailureCalled),this.registerHandler(c,this.onNotifyExpectedFailureCalled)}getTimeoutValueForImmediateAppInMills(){var e;const t=function(){const e=ld().overrideForEachInitStateChangeTimeoutsInMs;return null!=e?e:3e4}();return null!=ld().overrideForEachInitStateChangeTimeoutsInMs&&(null===(e=this.hubServices.logger)||void 0===e||e.log(Gt.Info,"Feature Flag overrideForEachInitStateChangeTimeoutsInMs",`Using timeout for immediate app: ${t} milliseconds`)),t}getTimeoutValueForLoadingScreenAppInMills(){var e,t;const i=function(){const e=ld().extendedAppLoadTimeoutInMillis,t=ld().overrideForEachInitStateChangeTimeoutsInMs;return null!=t?t:null!=e?e:45e3}();return null!=ld().overrideForEachInitStateChangeTimeoutsInMs&&(null===(e=this.hubServices.logger)||void 0===e||e.log(Gt.Info,"Feature Flag overrideForEachInitStateChangeTimeoutsInMs",`Using timeout for loading screen app: ${i} milliseconds`)),null!=ld().extendedAppLoadTimeoutInMillis&&(null===(t=this.hubServices.logger)||void 0===t||t.log(Gt.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(Qd.APPSDK_VERSION_FIELD_NAME,e)}))}updateTelemetryDataFieldAppSdkApiVersionTag(e,t,i){const n=e.data.apiVersionTag;i.forEach((e=>{null==e||e.addOrUpdateActivityDataField(Qd.APPSDK_API_VERSION_TAG_FIELD_NAME,Qd.getApiVersionTagForTelemetry(n,t))}))}updateTelemetryDataFieldUsingCachedApp(e){e.forEach((e=>{var t;null==e||e.addOrUpdateActivityDataField(Qd.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(Jt.has(e)&&t){const a=qd(e,t),s=Jt.get(e);if(!s)return void console.warn(`${s} is undefined in applicationInitializationAPIs`);Yd(jd.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 gp(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(""),ft.Validation_InvalidDomains,null==u?void 0:u.message),pp(null==u?void 0:u.message);i||(i=1),this.appSdkHost.setInitialized(!0);const d=this.appSdkHost.getHubInfo();let p=this.constructHubConfig(d);var 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(Gt.Warn,"AppEligibilityInformation from host","Host has provided appEligibilityInformation AND ICopilotEligibilityService. Only one of these should be provided.")),h=i<p.apiVersion?Ip(p,i):p;const v=[this.appSdkHost.getFrameContext(),this.appSdkHost.getHubInfo().clientType,"2.0.0",JSON.stringify(h)];return Yd(jd.End,Gd.InitializeMessageProcessTime),this.isLoadingScreenApp()?(this.stopInitializeStateTransitionTimer(),this.initStateTransitionTimerId=window.setTimeout((()=>{var e,t,i,n;this.appInitializationScenarioAlreadyStopped?(this.recordInitializationDoubleStopAttempt(Cp.extendedAppInitializationTimerExpiration),this.appSdkHost.setAppInitInfo({state:Lu.Loaded,appSdkVersion:null===(e=this.telemetryService)||void 0===e?void 0:e.getAppSdkVersion()})):(this.failAppInitializationScenario(Tp),null===(t=this.extendedAppInitializationScenario)||void 0===t||t.fail(Tp),this.appSdkHost.setAppInitInfo({state:Lu.Failed,reason:ft.AppInitTimeout,appSdkVersion:null===(i=this.telemetryService)||void 0===i?void 0:i.getAppSdkVersion()})),null===(n=this.hubServices.logger)||void 0===n||n.log(Gt.Error,"Error Screen Reason",Tp+this.getOCDIWarning())}),this.timeToWaitForStateTransitionsInMs)):(this.appSdkHost.setAppInitInfo({state:Lu.Loaded,appSdkVersion:t}),this.stopAppInitializationScenario(),ld().createAndSendSignalsToSubstrate&&cp(this.appSdkHost,this.hubServices,this.telemetryService)),pp(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!fd(this.appDefinition)&&r?(null===(n=this.hubServices.logger)||void 0===n||n.log(Gt.Warn,"AppEligibilityInformation from host","App is not a copilot app, 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 o(this,void 0,void 0,(function*(){const e=wd(yield this.appSdkHost.getAppContext(),this.appDefinition);return pp(e)}))}onGetContextError(e,t){return null==t||t.fail(fp(e)),pp({})}onNotifyAppLoadedCalled(e,t){var i;return o(this,void 0,void 0,(function*(){return this.markTelemetryForAppInitializationPhases("InitializedToAppLoadedInvoked",t,e),this.appSdkHost.setAppInitInfo({state:Lu.Loaded,appSdkVersion:null===(i=this.telemetryService)||void 0===i?void 0:i.getAppSdkVersion()}),Yd(jd.End,Gd.AppLoadedMessageProcessTime),hp}))}onNotifySuccessCalled(e,t){var i,n;return o(this,void 0,void 0,(function*(){return this.markInitializationStatusAsReported()?(this.appSdkHost.setAppInitInfo({state:Lu.Loaded,appSdkVersion:null===(i=this.telemetryService)||void 0===i?void 0:i.getAppSdkVersion()}),(this.isLoadingScreenApp()||this.usingCachedApp)&&(ld().createAndSendSignalsToSubstrate&&cp(this.appSdkHost,this.hubServices,this.telemetryService),this.telemetryService.setAppSdkVersion(t),this.updateAppInitializationScenarioFields(t,e),Yd(jd.End,Gd.SuccessMessageProcessTime),this.stopAppInitializationScenario()),null===(n=this.extendedAppInitializationScenario)||void 0===n||n.stop(),pp([null])):pp([null])}))}onNotifyFailureCalled(e,t,i){var n,r;return o(this,void 0,void 0,(function*(){return this.markInitializationStatusAsReported()?(this.isShowLoadingIndicatorEnabled&&(Yd(jd.End,Gd.FailureMessageProcessTime),this.failAppInitializationScenario(t,i)),this.appSdkHost.setAppInitInfo({state:Lu.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),hp):hp}))}onNotifyExpectedFailureCalled(e,t,i){var n,r;return o(this,void 0,void 0,(function*(){if(!this.markInitializationStatusAsReported())return hp;this.appSdkHost.setAppInitInfo({state:Lu.Loaded,appSdkVersion:null===(n=this.telemetryService)||void 0===n?void 0:n.getAppSdkVersion()});const e="Expected."+t;return this.isShowLoadingIndicatorEnabled&&(Yd(jd.End,Gd.ExpectedFailureMessageProcessTime),this.failAppInitializationScenario(e,i)),null===(r=this.extendedAppInitializationScenario)||void 0===r||r.fail(e,i),hp}))}markInitializationStatusAsReported(){return this.initializationStatusReported?(this.cleanup(),!1):(this.initializationStatusReported=!0,!0)}readyToUnload(){return o(this,void 0,void 0,(function*(){return this.appSdkHost.setAppInitInfo({state:Lu.Unloaded}),hp}))}cleanup(){this.stopInitializeStateTransitionTimer()}isTeamsCoreSupported(e){return!!this.isTeamsHub(e)||this.isLifeCycleImplemented()&&fd(this.appDefinition)}constructHubConfig(e){var t,i,n,r,o,a,s,l,c,u,d,p,h,v,f;return{apiVersion:4,hostVersionsInfo:this.getUpdatedHostVersionsInfo(),canParentManageNAATrustedOrigins:null!==(n=null===(i=null===(t=this.hubServices.nestedAppAuthService)||void 0===t?void 0:t.canParentManageNAATrustedOrigins)||void 0===i?void 0:i.call(t))&&void 0!==n&&n,isDeeplyNestedAuthSupported:null!==(o=null===(r=this.hubServices.nestedAppAuthService)||void 0===r?void 0:r.isDeeplyNestedAuthSupported())&&void 0!==o&&o,isNAAChannelRecommended:null!==(a=this.isNAAChannelRecommended)&&void 0!==a&&a,supports:{app:{notifySuccessResponse:{}},appInstallDialog:this.hubServices.appInstallDialogService?{}:void 0,appEntity:this.hubServices.appEntityService?{}:void 0,barCode:this.hubServices.barCodeService?{}:void 0,calendar:this.hubServices.calendarService?{}:void 0,call:this.hubServices.callService?{}:void 0,chat:this.hubServices.chatService?{}:void 0,clipboard:navigator&&navigator.clipboard?{}:void 0,conversations:this.hubServices.conversationsService?{}:void 0,copilot:fd(this.appDefinition)&&this.hubServices.copilotService?{customTelemetry:this.hubServices.copilotService.customTelemetryService?{}:void 0,eligibility:this.hubServices.copilotService.eligibilityService?{}:void 0}:void 0,dialog:this.hubServices.dialogService?{url:this.hubServices.dialogService.urlService?{bot:this.hubServices.dialogService.urlService.urlBotService?{}:void 0,parentCommunication:this.hubServices.dialogService.urlService.parentCommunicationService?{}:void 0}:void 0,card:this.hubServices.dialogService.cardService&&this.hostVersionsInfo&&this.hostVersionsInfo.adaptiveCardSchemaVersion&&!_d(this.hostVersionsInfo.adaptiveCardSchemaVersion)?{bot:this.hubServices.dialogService.cardService.cardBotService?{}:void 0}:void 0,update:this.hubServices.dialogService.updateService?{}:void 0}:void 0,externalAppAuthentication:this.hubServices.externalAppChannelService&&this.hubServices.externalAppInfoService?{}:void 0,externalAppAuthenticationForCEA:this.hubServices.externalAppChannelForCEAService&&this.hubServices.externalAppInfoService?{}:void 0,externalAppCardActions:this.hubServices.externalAppCardActionsService&&this.hubServices.externalAppInfoService?{}:void 0,externalAppCardActionsForCEA:this.hubServices.externalAppCardActionsForCEAService&&this.hubServices.externalAppInfoService?{}:void 0,externalAppCardActionsForDA:this.hubServices.externalAppCardActionsForDAService&&this.hubServices.externalAppInfoService?{}:void 0,externalAppCommands:this.hubServices.externalAppCommandsService&&this.hubServices.externalAppInfoService?{}:void 0,files:this.hubServices.filesService?{}:void 0,geoLocation:this.hubServices.locationService?{map:this.hubServices.locationService.mapService?{}:void 0}:void 0,hostEntity:{tab:(null===(s=this.hubServices.hostEntityService)||void 0===s?void 0:s.tabService)?{}:void 0},interactive:this.hubServices.interactiveService?{}:void 0,location:this.hubServices.locationService&&this.hubServices.locationService.mapService?{}:void 0,logs:this.hubServices.logService?{}:void 0,mail:this.hubServices.mailService?{handoff:this.hubServices.mailService.handoffService?{}:void 0}:void 0,marketplace:this.hubServices.marketplaceService?{}:void 0,media:this.hubServices.mediaService?{}:void 0,meeting:this.hubServices.meetingService?{appShareButton:this.hubServices.meetingService.appShareButton?{}:void 0}:void 0,meetingRoom:this.hubServices.meetingRoomService?{}:void 0,messageChannels:this.hubServices.messageChannelsService?{telemetry:this.hubServices.messageChannelsService.telemetry,dataLayer:this.hubServices.messageChannelsService.dataLayer}:void 0,monetization:this.hubServices.monetizationService?{}:void 0,nestedAppAuth:this.hubServices.nestedAppAuthService?{}:void 0,notifications:this.hubServices.notificationService?{}:void 0,otherAppStateChange:this.hubServices.otherAppStateChangeService?{}:void 0,pages:{appButton:(null===(l=this.hubServices.pageService)||void 0===l?void 0:l.appButtonService)?{}:void 0,backStack:(null===(c=this.hubServices.pageService)||void 0===c?void 0:c.backStackService)?{}:void 0,config:(null===(u=this.hubServices.pageService)||void 0===u?void 0:u.configService)?{}:void 0,fullTrust:(null===(d=this.hubServices.pageService)||void 0===d?void 0:d.fullTrustService)?{}:void 0,tabs:(null===(p=this.hubServices.pageService)||void 0===p?void 0:p.tabsService)?{}:void 0,currentApp:{}},people:this.hubServices.peopleService?{}:void 0,permissions:this.hubServices.devicePermissionService?{}:void 0,profile:this.hubServices.profileService?{}:void 0,remoteCamera:this.hubServices.remoteCameraService?{}:void 0,search:this.hubServices.searchService?{}:void 0,sharing:this.hubServices.sharingService?{history:this.hubServices.sharingService.historyService?{}:void 0}:void 0,stageView:this.hubServices.stageViewService?{self:this.hubServices.stageViewService.selfService?{}:void 0}:void 0,store:this.hubServices.storeService?{}:void 0,teams:this.hubServices.teamsService?{fullTrust:(null===(h=this.hubServices.teamsService)||void 0===h?void 0:h.fullTrustService)?{joinedTeams:(null===(f=null===(v=this.hubServices.teamsService)||void 0===v?void 0:v.fullTrustService)||void 0===f?void 0:f.joinedTeamsService)?{}:void 0}:void 0}:void 0,teamsCore:this.isTeamsCoreSupported(e.name)?{}:void 0,thirdPartyCloudStorage:this.hubServices.thirdPartyCloudStorageService?{}:void 0,video:this.hubServices.videoExtensibilityService&&(this.hubServices.videoExtensibilityService.mediaStreamService||this.hubServices.videoExtensibilityService.sharedFrameService)?{mediaStream:this.hubServices.videoExtensibilityService.mediaStreamService?{}:void 0,sharedFrame:this.hubServices.videoExtensibilityService.sharedFrameService?{}:void 0}:void 0,webStorage:this.hubServices.webStorageService?{}:void 0}}}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:Lu.Failed,reason:ft.AppInitTimeout,appSdkVersion:null===(t=this.telemetryService)||void 0===t?void 0:t.getAppSdkVersion()}),null===(i=this.hubServices.logger)||void 0===i||i.log(Gt.Error,"Error Bubble Reason",Ep+this.getOCDIWarning())}onInitializeCallTimedOutForLoadingScreenApp(){var e,t,i,n;this.appInitializationScenarioAlreadyStopped?(this.recordInitializationDoubleStopAttempt(Cp.initialAppInitializationTimerExpiration),this.appSdkHost.setAppInitInfo({state:Lu.Loaded,appSdkVersion:null===(e=this.telemetryService)||void 0===e?void 0:e.getAppSdkVersion()})):(this.failAppInitializationScenario(Ep),null===(t=this.extendedAppInitializationScenario)||void 0===t||t.fail(Ep),this.appSdkHost.setAppInitInfo({state:Lu.Failed,reason:ft.AppInitTimeout,appSdkVersion:null===(i=this.telemetryService)||void 0===i?void 0:i.getAppSdkVersion()})),null===(n=this.hubServices.logger)||void 0===n||n.log(Gt.Error,"Error Screen Reason",Ep+this.getOCDIWarning())}isTeamsHub(e){return e===Ku.teams||e===Ku.teamsModern}isLifeCycleImplemented(){return!!this.hubServices.lifecycleService}logTelemetryForAppSdkLoaded(){var e,t,i;if(Od(null===(e=this.appDefinition)||void 0===e?void 0:e.id)){const e=null===(t=this.telemetryService)||void 0===t?void 0:t.createScenario(qt);null===(i=e.addOrUpdateActivityDataField)||void 0===i||i.call(e,Qd.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"}(bp||(bp={}));class Op{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:bp.Uninitialized,a=e=>{this.internalAppStateMap.set(t,e)},s={[`${bp.Loading}_${d}`]:()=>this.setStateToLoaded(a),[`${bp.Loading}_${c}`]:()=>this.setStateToLoaded(a),[`${bp.Loading}_${l}`]:()=>this.setStateToLoadingWithoutSpinner(a),[`${bp.LoadingWithoutSpinner}_${d}`]:()=>this.setStateToLoaded(a),[`${bp.LoadingWithoutSpinner}_${c}`]:()=>this.setStateToLoaded(a),[`${bp.Cached}_${l}`]:()=>this.setStateToLoadingWithoutSpinner(a),[`${bp.Cached}_${d}`]:()=>this.setStateToLoaded(a),[`${bp.Loaded}_${tt}`]:()=>this.setStateWhenAppEntersCached(a),[`${bp.Uninitialized}_${Y}`]:()=>this.setStateToLoading(a,n),[`${bp.Loading}_${Y}`]:()=>this.setStateToLoading(a,n),[`${bp.Loaded}_${Y}`]:()=>this.setStateToLoading(a,n),[`${bp.LoadingWithoutSpinner}_${Y}`]:()=>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,Y,i)}msg_notifyAppLoaded_processedSuccessfully(e,t){this.stateChangeHelper(e,t,l)}msg_notifySuccess_processedSuccessfully(e,t){this.stateChangeHelper(e,t,d)}msg_notifyExpectedFailure_processingSucceess(e,t){this.stateChangeHelper(e,t,c)}msg_notifyFailure_processedSuccessfully(e,t){this.stateChangeHelper(e,t,u)}msg_readyToUnload_processedSuccessfully(e,t){this.stateChangeHelper(e,t,tt)}setStateToLoading(e,t){e(bp.Loading),void 0===t||t||this.setStateToLoaded(e)}setStateToLoaded(e){e(bp.Loaded)}setStateToLoadingWithoutSpinner(e){e(bp.LoadingWithoutSpinner)}setStateWhenAppEntersCached(e){e(bp.Cached)}isAllowedToProcessInitializeEvent(e){var t;return void 0===e||(null!==(t=this.internalAppStateMap.get(e))&&void 0!==t?t:bp.Uninitialized)!==bp.Cached}isAllowedToProcessNotifySuccessEvent(e){if(void 0===e)return!0;const t=this.internalAppStateMap.get(e);return t==bp.Loading||t==bp.LoadingWithoutSpinner||t==bp.Cached}isAllowedToProcessNotifyAppLoadedEvent(e){return void 0===e||this.internalAppStateMap.get(e)==bp.Loading}isAllowedToProcessNotifyExpectedFailureEvent(e){if(void 0===e)return!0;const t=this.internalAppStateMap.get(e);return t==bp.Loading||t==bp.LoadingWithoutSpinner}isAllowedToProcessNotifyFailureEvent(e){if(void 0===e)return!0;const t=this.internalAppStateMap.get(e);return t==bp.Loading||t==bp.LoadingWithoutSpinner}isAllowedToProcessReadyToUnloadEvent(e){return void 0===e||this.internalAppStateMap.get(e)==bp.Loaded}}class kp{constructor(){}static getInstance(){return kp.instance||(kp.instance=new Op),kp.instance}}function Rp(){return kp.getInstance()}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.";class Fp{constructor(e){this.getOCDIWarning=()=>{var e;const t=null===(e=this.telemetryWrapper.telemetryService)||void 0===e?void 0:e.getAppSdkVersion();return xd(window.location.href)&&t&&Ld(t,Rt)?Pt:""},this.startTimerToWaitForNofifyCallFromApp=()=>window.setTimeout((()=>{var e,t;window.clearTimeout(this.timerId),this.telemetryWrapper.failAppInitializationScenario(Dp),this.telemetryWrapper.failExtendedAppInitializationScenario(Dp),this.appSdkHost.setAppInitInfo({state:Lu.Failed,reason:ft.AppInitTimeout,appSdkVersion:null===(e=this.telemetryWrapper.telemetryService)||void 0===e?void 0:e.getAppSdkVersion()}),null===(t=this.hubServices.logger)||void 0===t||t.log(Gt.Error,"Error Screen Reason",Dp+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:Lu.Failed,reason:ft.CachedAppLoadTimedOut,appSdkVersion:null===(e=this.telemetryWrapper.telemetryService)||void 0===e?void 0:e.getAppSdkVersion()}),null===(t=this.hubServices.logger)||void 0===t||t.log(Gt.Error,"Error Screen Reason",Dp+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!=Y)throw dp(Nu.INTERNAL_ERROR,`Timer cannot be set correctly by event: ${e.data.func}`);this.timerId=this.startTimerToWaitForNofifyCallFromApp()}}clearTimer(e){const t=e.data.func;t!==Y&&t!==d&&t!=c&&t!=u||window.clearTimeout(this.timerId)}getTimeoutValueForImmediateAppInMills(){var e;const t=function(){const e=ld().overrideForEachInitStateChangeTimeoutsInMs;return null!=e?e:3e4}();return null!=ld().overrideForEachInitStateChangeTimeoutsInMs&&(null===(e=this.hubServices.logger)||void 0===e||e.log(Gt.Info,"Feature Flag overrideForEachInitStateChangeTimeoutsInMs",`Using timeout for immediate app: ${t} milliseconds`)),t}getTimeoutValueForLoadingScreenAppInMills(){var e,t;const i=function(){const e=ld().extendedAppLoadTimeoutInMillis,t=ld().overrideForEachInitStateChangeTimeoutsInMs;return null!=t?t:null!=e?e:45e3}();return null!=ld().overrideForEachInitStateChangeTimeoutsInMs&&(null===(e=this.hubServices.logger)||void 0===e||e.log(Gt.Info,"Feature Flag overrideForEachInitStateChangeTimeoutsInMs",`Using timeout for loading screen app: ${i} milliseconds`)),null!=ld().extendedAppLoadTimeoutInMillis&&(null===(t=this.hubServices.logger)||void 0===t||t.log(Gt.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:Lu.Failed,reason:ft.AppInitTimeout,appSdkVersion:null===(e=this.telemetryWrapper.telemetryService)||void 0===e?void 0:e.getAppSdkVersion()}),null===(t=this.hubServices.logger)||void 0===t||t.log(Gt.Error,"Error Bubble Reason",Pp+this.getOCDIWarning())}onInitializeCallTimedOutForLoadingScreenApp(){var e,t;window.clearTimeout(this.timerId),this.telemetryWrapper.failAppInitializationScenario(Pp),this.telemetryWrapper.failExtendedAppInitializationScenario(Pp),this.appSdkHost.setAppInitInfo({state:Lu.Failed,reason:ft.AppInitTimeout,appSdkVersion:null===(e=this.telemetryWrapper.telemetryService)||void 0===e?void 0:e.getAppSdkVersion()}),null===(t=this.hubServices.logger)||void 0===t||t.log(Gt.Error,"Error Screen Reason",Pp+this.getOCDIWarning())}}class xp{constructor(){}handleEvent(e){return e.orchestratorCommandParams.timerWrapper.timer=new Fp(e),hp}}function Lp(){return new xp}class Np{constructor(){}handleEvent(e){return o(this,void 0,void 0,(function*(){const t=e.orchestratorCommandParams.appSdkHost,i=e.orchestratorCommandParams.appDefinition,n=wd(yield t.getAppContext(),i);return pp(n)}))}}class _p{constructor(){}constructHubConfig(e,t,i,n,r){var o,a,s,l,c,u,d,p,h,v,f,m,g,S;return{apiVersion:4,hostVersionsInfo:this.getUpdatedHostVersionsInfo(n,t,r),canParentManageNAATrustedOrigins:null!==(s=null===(a=null===(o=t.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=t.nestedAppAuthService)||void 0===l?void 0:l.isDeeplyNestedAuthSupported())&&void 0!==c&&c,isNAAChannelRecommended:null!=i&&i,supports:{app:{notifySuccessResponse:{}},appInstallDialog:t.appInstallDialogService?{}:void 0,appEntity:t.appEntityService?{}:void 0,barCode:t.barCodeService?{}:void 0,calendar:t.calendarService?{}:void 0,call:t.callService?{}:void 0,chat:t.chatService?{}:void 0,clipboard:navigator&&navigator.clipboard?{}:void 0,conversations:t.conversationsService?{}:void 0,copilot:fd(n.getAppDefinition())&&t.copilotService?{customTelemetry:t.copilotService.customTelemetryService?{}:void 0,eligibility:t.copilotService.eligibilityService?{}:void 0}:void 0,dialog:t.dialogService?{url:t.dialogService.urlService?{bot:t.dialogService.urlService.urlBotService?{}:void 0,parentCommunication:t.dialogService.urlService.parentCommunicationService?{}:void 0}:void 0,card:t.dialogService.cardService&&r&&r.adaptiveCardSchemaVersion&&!_d(r.adaptiveCardSchemaVersion)?{bot:t.dialogService.cardService.cardBotService?{}:void 0}:void 0,update:t.dialogService.updateService?{}:void 0}:void 0,externalAppAuthentication:t.externalAppChannelService&&t.externalAppInfoService?{}:void 0,externalAppAuthenticationForCEA:t.externalAppChannelForCEAService&&t.externalAppInfoService?{}:void 0,externalAppCardActions:t.externalAppCardActionsService&&t.externalAppInfoService?{}:void 0,externalAppCardActionsForCEA:t.externalAppCardActionsForCEAService&&t.externalAppInfoService?{}:void 0,externalAppCardActionsForDA:t.externalAppCardActionsForDAService&&t.externalAppInfoService?{}:void 0,externalAppCommands:t.externalAppCommandsService&&t.externalAppInfoService?{}:void 0,files:t.filesService?{}:void 0,geoLocation:t.locationService?{map:t.locationService.mapService?{}:void 0}:void 0,hostEntity:{tab:(null===(u=t.hostEntityService)||void 0===u?void 0:u.tabService)?{}:void 0},interactive:t.interactiveService?{}:void 0,location:t.locationService&&t.locationService.mapService?{}:void 0,logs:t.logService?{}:void 0,mail:t.mailService?{handoff:t.mailService.handoffService?{}:void 0}:void 0,marketplace:t.marketplaceService?{}:void 0,media:t.mediaService?{}:void 0,meeting:t.meetingService?{appShareButton:t.meetingService.appShareButton?{}:void 0}:void 0,meetingRoom:t.meetingRoomService?{}:void 0,messageChannels:t.messageChannelsService?{telemetry:t.messageChannelsService.telemetry,dataLayer:t.messageChannelsService.dataLayer}:void 0,monetization:t.monetizationService?{}:void 0,nestedAppAuth:t.nestedAppAuthService?{}:void 0,notifications:t.notificationService?{}:void 0,otherAppStateChange:t.otherAppStateChangeService?{}:void 0,pages:{appButton:(null===(d=t.pageService)||void 0===d?void 0:d.appButtonService)?{}:void 0,backStack:(null===(p=t.pageService)||void 0===p?void 0:p.backStackService)?{}:void 0,config:(null===(h=t.pageService)||void 0===h?void 0:h.configService)?{}:void 0,fullTrust:(null===(v=t.pageService)||void 0===v?void 0:v.fullTrustService)?{}:void 0,tabs:(null===(f=t.pageService)||void 0===f?void 0:f.tabsService)?{}:void 0,currentApp:{}},people:t.peopleService?{}:void 0,permissions:t.devicePermissionService?{}:void 0,profile:t.profileService?{}:void 0,remoteCamera:t.remoteCameraService?{}:void 0,search:t.searchService?{}:void 0,sharing:t.sharingService?{history:t.sharingService.historyService?{}:void 0}:void 0,stageView:t.stageViewService?{self:t.stageViewService.selfService?{}:void 0}:void 0,store:t.storeService?{}:void 0,teams:t.teamsService?{fullTrust:(null===(m=t.teamsService)||void 0===m?void 0:m.fullTrustService)?{joinedTeams:(null===(S=null===(g=t.teamsService)||void 0===g?void 0:g.fullTrustService)||void 0===S?void 0:S.joinedTeamsService)?{}:void 0}:void 0}:void 0,teamsCore:this.isTeamsCoreSupported(e.name,n,t)?{}:void 0,thirdPartyCloudStorage:t.thirdPartyCloudStorageService?{}:void 0,video:t.videoExtensibilityService&&(t.videoExtensibilityService.mediaStreamService||t.videoExtensibilityService.sharedFrameService)?{mediaStream:t.videoExtensibilityService.mediaStreamService?{}:void 0,sharedFrame:t.videoExtensibilityService.sharedFrameService?{}:void 0}:void 0,webStorage:t.webStorageService?{}:void 0}}}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!fd(e.getAppDefinition())&&a?(null===(o=t.logger)||void 0===o||o.log(Gt.Warn,"AppEligibilityInformation from host","App is not a copilot app, 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)&&fd(t.getAppDefinition())}isTeamsHub(e){return e===Ku.teams||e===Ku.teamsModern}isLifeCycleImplemented(e){return!!e.lifecycleService}verifyIfOriginBlocked(e,t,i){var n,r;const o=null==t?void 0:t.isOriginBlocked(new gp(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,a,s;return o(this,void 0,void 0,(function*(){const o=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",o,e.sdkEventMessage);const p=this.verifyIfOriginBlocked(u,e.orchestratorCommandParams.originsToBlock,c);if(p)return d.isShowLoadingIndicatorEnabled&&(Yd(jd.End,Gd.FailureMessageProcessTime),d.failAppInitializationScenario(ft.Validation_InvalidDomains,null==p?void 0:p.message)),d.failExtendedAppInitializationScenario(ft.Validation_InvalidDomains,null==p?void 0:p.message),u.setAppInitInfo({state:Lu.Failed,reason:ft.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),pp(null==p?void 0:p.message);u.setInitialized(!0);const h=u.getHubInfo();let v=this.constructHubConfig(h,e.orchestratorCommandParams.hubServices,e.orchestratorCommandParams.isNAAChannelRecommended,u,e.orchestratorCommandParams.hostVersionsInfo);var 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===(a=e.orchestratorCommandParams.hubServices.logger)||void 0===a||a.log(Gt.Warn,"AppEligibilityInformation from host","Host has provided appEligibilityInformation AND ICopilotEligibilityService. Only one of these should be provided.")),f=l<v.apiVersion?Ip(v,l):v;const m=[u.getFrameContext(),u.getHubInfo().clientType,"2.0.0",JSON.stringify(f)];return Yd(jd.End,Gd.InitializeMessageProcessTime),null===(s=e.orchestratorCommandParams.timerWrapper.timer)||void 0===s||s.clearTimer(e.sdkEventMessage),d.isLoadingScreenApp()?Lp().handleEvent(e):(u.setAppInitInfo({state:Lu.Loaded,appSdkVersion:o}),d.stopAppInitializationScenario(),ld().createAndSendSignalsToSubstrate&&cp(u,e.orchestratorCommandParams.hubServices,d.telemetryService)),Rp().msg_initialize_processedSuccessfully(e.orchestratorCommandParams.telemetryWrapper,e.sdkEventMessage.data.teamsJsInstanceId,d.isShowLoadingIndicatorEnabled),pp(m)}))}}class Mp{constructor(){}handleEvent(e){const t=e.args[0],i=e.orchestratorCommandParams.telemetryWrapper;return i.markTelemetryForAppInitializationPhases("InitializedToAppLoadedInvoked",t,e.sdkEventMessage),e.orchestratorCommandParams.appSdkHost.setAppInitInfo({state:Lu.Loaded,appSdkVersion:i.telemetryService.getAppSdkVersion()}),Yd(jd.End,Gd.AppLoadedMessageProcessTime),Rp().msg_notifyAppLoaded_processedSuccessfully(e.orchestratorCommandParams.telemetryWrapper,e.sdkEventMessage.data.teamsJsInstanceId),hp}}class Up{constructor(){}handleEvent(e){var t;const i=e.args[0],n=e.args[1],r=e.orchestratorCommandParams.telemetryWrapper;e.orchestratorCommandParams.appSdkHost.setAppInitInfo({state:Lu.Loaded,appSdkVersion:r.telemetryService.getAppSdkVersion()});const o="Expected."+i;return r.isShowLoadingIndicatorEnabled&&(Yd(jd.End,Gd.ExpectedFailureMessageProcessTime),r.failAppInitializationScenario(o,n),null===(t=e.orchestratorCommandParams.timerWrapper.timer)||void 0===t||t.clearTimer(e.sdkEventMessage)),r.failExtendedAppInitializationScenario(o,n),Rp().msg_notifyExpectedFailure_processingSucceess(e.orchestratorCommandParams.telemetryWrapper,e.sdkEventMessage.data.teamsJsInstanceId),hp}}class $p{constructor(){}handleEvent(e){var t;const i=e.args[0],n=e.args[1],r=e.orchestratorCommandParams.telemetryWrapper;return r.isShowLoadingIndicatorEnabled&&(Yd(jd.End,Gd.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:Lu.Failed,reason:i,appSdkVersion:r.telemetryService.getAppSdkVersion()}),Rp().msg_notifyFailure_processedSuccessfully(e.orchestratorCommandParams.telemetryWrapper,e.sdkEventMessage.data.teamsJsInstanceId),hp}}class zp{constructor(){}handleEvent(e){var t;const i=e.args[0],n=e.orchestratorCommandParams.telemetryWrapper;return e.orchestratorCommandParams.appSdkHost.setAppInitInfo({state:Lu.Loaded,appSdkVersion:n.telemetryService.getAppSdkVersion()}),(n.isLoadingScreenApp()||n.usingCachedApp)&&(ld().createAndSendSignalsToSubstrate&&cp(e.orchestratorCommandParams.appSdkHost,e.orchestratorCommandParams.hubServices,n.telemetryService),n.telemetryService.setAppSdkVersion(i),n.updateAppInitializationScenarioFields(i,e.sdkEventMessage),Yd(jd.End,Gd.SuccessMessageProcessTime),n.stopAppInitializationScenario()),n.stopExtendedAppInitializationScenario(),null===(t=e.orchestratorCommandParams.timerWrapper.timer)||void 0===t||t.clearTimer(e.sdkEventMessage),Rp().msg_notifySuccess_processedSuccessfully(e.orchestratorCommandParams.telemetryWrapper,e.sdkEventMessage.data.teamsJsInstanceId),{kind:"appResponse",data:[null]}}}class Hp{constructor(){}handleEvent(e){return e.orchestratorCommandParams.appSdkHost.setAppInitInfo({state:Lu.Unloaded}),Rp().msg_readyToUnload_processedSuccessfully(e.orchestratorCommandParams.telemetryWrapper,e.sdkEventMessage.data.teamsJsInstanceId),hp}}class Vp{constructor(){}processTimer(e){return o(this,void 0,void 0,(function*(){return Lp().handleEvent(e)}))}processCommand(e){return o(this,void 0,void 0,(function*(){var t=e.sdkEventMessage.data.func;this.isAllowedToProcess(t,e.sdkEventMessage.data.teamsJsInstanceId);var 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 Y:if(!Rp().isAllowedToProcessInitializeEvent(t))throw dp(Nu.INTERNAL_ERROR,"Not allowed to process initialize event");break;case d:if(!Rp().isAllowedToProcessNotifySuccessEvent(t))throw dp(Nu.INTERNAL_ERROR,"Not allowed to process notify success event");break;case l:if(!Rp().isAllowedToProcessNotifyAppLoadedEvent(t))throw dp(Nu.INTERNAL_ERROR,"Not allowed to process notify app loaded event");break;case u:if(!Rp().isAllowedToProcessNotifyFailureEvent(t))throw dp(Nu.INTERNAL_ERROR,"Not allowed to process notify failure event");break;case c:if(!Rp().isAllowedToProcessNotifyExpectedFailureEvent(t))throw dp(Nu.INTERNAL_ERROR,"Not allowed to process notify expected failure event");break;case tt:if(!Rp().isAllowedToProcessReadyToUnloadEvent(t))throw dp(Nu.INTERNAL_ERROR,"Not allowed to process ready to unload event")}}selectDelegate(e){let t;switch(e){case Y:t=new _p;break;case J:t=new Np;break;case d:t=new zp;break;case l:t=new Mp;break;case tt:t=new Hp;break;case u:t=new $p;break;case c:t=new Up}return t}}class Wp{constructor(){}static getInstance(){return Wp.instance||(Wp.instance=new Vp),Wp.instance}}function Bp(){return Wp.getInstance()}class jp{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=ld().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&&It.has(c);(u||d)&&(this.extendedAppInitializationScenario=this.createExtendedAppInitTelemetry(c))}logTelemetryForAppSdkLoaded(){var e,t,i;if(Od(null===(e=this.appDefinition)||void 0===e?void 0:e.id)){const e=null===(t=this.telemetryService)||void 0===t?void 0:t.createScenario(qt);null===(i=e.addOrUpdateActivityDataField)||void 0===i||i.call(e,Qd.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(Qd.APPSDK_VERSION_FIELD_NAME,e)}))}updateTelemetryDataFieldAppSdkApiVersionTag(e,t,i){const n=e.data.apiVersionTag;i.forEach((e=>{null==e||e.addOrUpdateActivityDataField(Qd.APPSDK_API_VERSION_TAG_FIELD_NAME,Qd.getApiVersionTagForTelemetry(n,t))}))}updateTelemetryDataFieldUsingCachedApp(e){e.forEach((e=>{var t;null==e||e.addOrUpdateActivityDataField(Qd.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(Jt.has(e)&&t){const a=qd(e,t),s=Jt.get(e);if(!s)return void console.warn(`${s} is undefined in applicationInitializationAPIs`);Yd(jd.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 Gp{}class Kp extends Sp{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 jp(e,t,i,e.getAppDefinition(),r),this.timerWrapper=new Gp,this.telemetryWrapper.addOrUpdateActivityDataFieldForAppInitStateTransition("App initialization progress begins, teamsJsInstanceId: undefined, AppInitState: uninitialized\n"),this.startAppInitializationFlow()}initHandlers(){this.registerHandler(Y,this.onInitializeCalled,{errorCallback:this.onInitializeCalledError}),this.registerHandler(J,this.getContext,{errorCallback:this.onGetContextError}),this.registerHandler(tt,this.readyToUnload,{errorCallback:this.onReadyToUnloadError}),this.registerHandler(l,this.onNotifyAppLoadedCalled,{errorCallback:this.onNotifyAppLoadedCalledError}),this.registerHandler(d,this.onNotifySuccessCalled,{errorCallback:this.onNotifySuccessCalledError}),this.registerHandler(u,this.onNotifyFailureCalled,{errorCallback:this.onNotifyFailureCalledError}),this.registerHandler(c,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 Bp().processCommand(e)}startAppInitializationFlow(){const e=this.buildOrchestratorCommand(new MessageEvent("message"),[]);Bp().processTimer(e)}onInitializeCalled(e,t,i,n){const r=[t,i,n];let o=this.buildOrchestratorCommand(e,r);return this.processCommand(o)}onInitializeCalledError(e,t){return null==t||t.fail(fp(e)),pp({})}getContext(e){const t=this.buildOrchestratorCommand(e,[]);return this.processCommand(t)}onGetContextError(e,t){return null==t||t.fail(fp(e)),pp({})}readyToUnload(e){return o(this,void 0,void 0,(function*(){let t=this.buildOrchestratorCommand(e,[]);return this.processCommand(t)}))}onReadyToUnloadError(e,t){return null==t||t.fail(fp(e)),pp({})}onNotifyAppLoadedCalled(e,t){const i=[t],n=this.buildOrchestratorCommand(e,i);return this.processCommand(n)}onNotifyAppLoadedCalledError(e,t){return null==t||t.fail(fp(e)),pp({})}onNotifySuccessCalled(e,t){const i=[t],n=this.buildOrchestratorCommand(e,i);return this.processCommand(n)}onNotifySuccessCalledError(e,t){return null==t||t.fail(fp(e)),pp({})}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(fp(e)),pp({})}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(fp(e)),pp({})}trackMessageDelayForAppInitAPIs(e,t){this.telemetryWrapper.trackMessageDelayForAppInitAPIs(e,t)}}class qp extends Sp{constructor(e,t,i){super(e,t),this.appSdkHost=e,this.telemetryService=t,this.authenticationService=i,this.TAG="BaseAuthenticationMessageHandler"}initHandlers(){this.registerHandler(h,this.handleGetUser,{errorCallback:this.onGetUserError,isRestrictedToMicrosoftOwnedOrFullTrustApps:!0}),this.registerHandler(p,this.handleGetAuthToken,{callbackFixedArgsLength:5,errorCallback:this.onGetAuthTokenError})}validateDependencies(){this.appSdkHost.getContext().app.host.clientType!==Yu.desktop||this.authenticationService.externalAuthService||this.appSdkHost.getLogger().log(Gt.Warn,this.TAG,wt)}handleGetUser(){return o(this,void 0,void 0,(function*(){let e=yield this.authenticationService.getUser();if(e){let t=yield this.appSdkHost.getAppContext(),i=Object.assign(Object.assign({},e.profile),{dataResidency:Md(t.user.dataResidency)});return pp([!0,i])}return Promise.reject("Failed to fetch the user profile")}))}onGetUserError(e,t){return null==t||t.fail(`GetUser failed ${fp(e)}`),pp([!1,e])}handleGetAuthToken(e,t,i,n,r,a){return o(this,void 0,void 0,(function*(){const o=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=>md(e)||gd(e))(n):void 0;if((i.name===Ku.teams||i.name===Ku.teamsModern)&&t&&t.length>0&&(!n||n.isFullTrust||(h=n.id)&&-1!==Et.indexOf(h.toLowerCase()))){if(n){const i=ld().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=yd(t,i);let a=!1;null===(r=n.resources)||void 0===r||r.forEach((n=>{if(!a&&n){const r=yd(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&&Sd(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&&Sd(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))?yd(t[0],r):((e,t)=>{var i,n;return(null===(i=e.webApplicationInfo)||void 0===i?void 0:i.resource)&&yd(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(ld().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(!ld().useUrlClassForValidDomains){const n=ld().escapeRegExSpecialCharactersInValidDomains?(i=t)&&new URL(i).host.replace(ud,"\\$1"):cd(t),r=St.validResourcePattern.replace(St.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&&Sd(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,o,!1,!1,a);let 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)}(a));return pp([!0,l.token])}))}onGetAuthTokenError(e,t){return null==t||t.fail(`GetAuthToken failed ${fp(e)}`),pp([!1,e])}}class Xp extends qp{constructor(e,t,i){super(e,t,i),this.appAuthSdkHost=e,this.telemetryService=t,this.authenticationService=i}initHandlers(){super.initHandlers(),this.registerHandler(f,this.handleNotifySuccess),this.registerHandler(m,this.handleNotifyFailure)}handleNotifySuccess(e,t){return this.appAuthSdkHost.closeWindow(),this.appAuthSdkHost.stopAuthWindowMonitor(),vp(this.authenticationService.notifySuccess,t)}handleNotifyFailure(e,t){return this.appAuthSdkHost.closeWindow(),this.appAuthSdkHost.stopAuthWindowMonitor(),vp(this.authenticationService.notifyFailure,t,jt.Other)}}const Jp=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=>Jp(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 i={};for(var t of Object.getOwnPropertyNames(e)){const n=e[t];i[t]=Jp(n)}return i}throw Error("Provided type '"+typeof e+"' ("+Object.prototype.toString.call(e)+") can't be cloned using deepCopy.")};class Yp{constructor(e){this.appSdkHost=e,this.messageHandlers=[],this.TAG="BaseMessageProcessor",this.ValidCustomApiHubs=[Ku.edge,Ku.orange,Ku.outlook,Ku.outlookWin32,Ku.teams,Ku.teamsModern]}process(e){var t;return o(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 pp(t.data);return"appResponse"===n.kind&&this.processHandlerResultHelper(i,n,e),Promise.resolve(!0)}}throw Error("Unhandled message")}catch(i){this.appSdkHost.getLogger().log(Gt.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=vd(null==e?void 0:e.id),r=this.ValidCustomApiHubs.includes(t);return t===Ku.outlookWin32||t===Ku.outlook?n&&r:!!i&&r}processForDeeplyNestedRequest(e){var t;return o(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(!up.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(Gt.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 o(this,void 0,void 0,(function*(){const t=dd(e.origin,this.appSdkHost.getLogger(),this.appSdkHost.getAppDefinition(),this.appSdkHost.getContext());e.isTrustedOrigin=t,this.appSdkHost.getLogger().log(Gt.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 od(t)})})(e.data);let n=i.args,r=i.apiVersionTag;return n=i.args&&Array.isArray(i.args)?i.args.map((e=>{return t=e,"function"==typeof structuredClone?structuredClone(t):Jp(t);var t})):[],n.unshift(e),{result:yield this.callMessageHandler(r,i.func,n,Wd(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 Qp extends Yp{constructor(e,t,i){super(e),this.appSdkHost=e,this.authService=t,this.telemetryService=i,this.messageHandlers.push(new Xp(e,i,t)),this.messageHandlers.push(function(e,t,i,n,r,o,a){return ld().useNewAppInitializationExperience?new Kp(e,t,i,n,r,o,a):new wp(e,t,i,n,r,o,a)}(e,{},i)),this.messageHandlers.forEach((e=>e.initHandlers()))}}class Zp extends Error{constructor(e,t){super(e),this.failureReason=t,this.message=e,this.name="HubSdkAuthServicesInternalError"}}class eh{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 od).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 Qd(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,Qd.APP_TERMINATE_REASON,t),null===(n=r.addOrUpdateActivityDataField)||void 0===n||n.call(r,Qd.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,Qd.WEB_CONTENT_SDK_ID,this.webContentSdkId),null===(n=r.addOrUpdateActivityDataField)||void 0===n||n.call(r,Qd.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,Qd.WEB_CONTENT_SDK_ID,this.webContentSdkId),null===(n=o.addOrUpdateActivityDataField)||void 0===n||n.call(o,Qd.COMM_BRIDGE_ID,(null==t?void 0:t.toString())||"unknown"),null===(r=o.addOrUpdateActivityDataField)||void 0===r||r.call(o,Qd.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,Qd.WEB_CONTENT_SDK_ID,this.webContentSdkId),null===(l=v.addOrUpdateActivityDataField)||void 0===l||l.call(v,Qd.COMM_BRIDGE_ID,(null==o?void 0:o.toString())||"unknown"),null===(c=v.addOrUpdateActivityDataField)||void 0===c||c.call(v,Qd.COMM_BRIDGE_LISTENERS_ADDED,e),null===(u=v.addOrUpdateActivityDataField)||void 0===u||u.call(v,Qd.APP_DEFINITION,JSON.stringify(t)),null===(d=v.addOrUpdateActivityDataField)||void 0===d||d.call(v,Qd.CACHEDAPP_IND_FIELD_NAME,!!n),null===(p=v.addOrUpdateActivityDataField)||void 0===p||p.call(v,Qd.USER_CLICK_TIME,i),r&&(null===(h=v.addOrUpdateActivityDataField)||void 0===h||h.call(v,Qd.USER_CLICK_TIME_V2,r)),v.stop()}getHostWindow(){return this.hostWindow}getFrameContext(){return this.context.page.frameContext}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=Wd(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,Qd.WEB_CONTENT_SDK_ID,this.webContentSdkId)}getAppInitializationScenario(){return this.appInitializationScenario}}const th="HostedWebContentAuthSdkService";class ih extends eh{constructor(e,t,i,n,r,a,s,l){super(e,r,n,a,s,void 0),this.hostWindow=e,this.openWindowInfo=t,this.appDefinition=i,this.authenticationService=n,this.context=r,this.logger=a,this.onExternalAuthenticationComplete=(e,t)=>{e?this.authenticationService.notifySuccess(t):(t!==Ct&&t!==bt||this.logger.log(Gt.Error,th,t),this.authenticationService.notifyFailure(t))},this.onAuthMessageReceived=e=>o(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 Qp(this,this.authenticationService,this.telemetryService))};try{this.passContextForUrlValidation=ld().authExtensionContextForUrlValidation,this.context.app.host.clientType!==Yu.desktop||this.authenticationService.externalAuthService||this.logger.log(Gt.Warn,th,wt),this.context.page.frameContext!==Qu.authentication&&this.notifyAsFailureAndThrowError("Invalid frame context for scenario",jt.InvalidFrameContext),this.appDefinition||this.notifyAsFailureAndThrowError("App definition not available",jt.AppDefinitionUnavailable),this.telemetryService.setAppDefinition(this.appDefinition),this.checkUrlIsValid(t.url)||this.notifyAsFailureAndThrowError("Auth url is not valid",jt.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 Zp?(i=e.message,t=e.failureReason,n=!1):e instanceof Error?(i=e.message,t=jt.Other,n=!1):(i="Unknown error",t=jt.Other,n=!0),this.authenticationService&&this.authenticationService.notifyFailure(i,t),a.log(Gt.Error,th,`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===Yu.desktop&&this.authenticationService.externalAuthService)try{this.authWindow=this.authenticationService.externalAuthService.openUrlInEmbeddedBrowser(new URL(t.url),i)}catch(e){null!==this.authWindow&&(this.logger.log(Gt.Error,th,`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===Yu.web&&a.dispatch("authWindowBlocked"),new Zp("URL was unable to be opened in embedded browser",jt.BlockedByBrowser);this.setupEmbeddedAuthWindow(t.url,e,this.hostWindow)}launchExternalAuthenticationWorkflow(e){const t=Bt.startNewExternalAuthSession(e,this.onExternalAuthenticationComplete,this.authenticationService.externalAuthRedirectUrl);try{this.authenticationService.externalAuthService?this.authenticationService.externalAuthService.openUrlInExternalBrowser(t):this.hostWindow.open(t)}catch(e){throw new Zp("Failed to open the URL in external browser",jt.Other)}}shouldUseExternalAuthenticationWorkflow(e,t){return e===Yu.desktop&&!0===t}notifyAsFailureAndThrowError(e,t){throw this.authenticationService&&this.authenticationService.notifyFailure(e,t),new Zp(`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 Ft(i),this.globalWindowEventListener.addListener("message",this.onAuthMessageReceived),this.startAuthWindowMonitor(),this.initializeAuthenticationContext(t)}checkUrlIsValid(e){return this.passContextForUrlValidation?dd(e,this.logger,this.appDefinition,this.context):dd(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:Vd()};this.postMessage(n)}}sendRequestMessage(e,t){if(this.origin){const i={func:e,args:t,monotonicTimestamp:Vd()};this.postMessage(i)}}startAuthWindowMonitor(){this.stopAuthWindowMonitor(),this.authWindowMonitor=this.hostWindow.setInterval((()=>{this.authWindowInterval()}),100)}authWindowInterval(){this.isWindowOpen()?this.sendRequestMessage("ping"):(this.HandleError("CancelledByUser",jt.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 nh={Debug:console.debug,Info:console.log,Warn:console.warn,Error:console.error};class rh{log(e,t,i,n){nh[e](`[LoggerService] tag: ${t}, level: ${e}, message: ${i}, exception: `,n||"undefined")}}var oh,ah;!function(e){e.Success="success",e.Failure="failure"}(oh||(oh={})),function(e){e.AuthConfig="AuthConfig"}(ah||(ah={}));const sh=window.chrome.webview;class lh extends e{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=>{ch(this.data.type,oh.Success,e)};notifyFailure=async e=>{ch(this.data.type,oh.Failure,e)};acquireToken=async(e,t,i)=>(ch(this.data.type,oh.Failure,"acquireToken in MetaOSAuthExtension is not implemented"),{token:""})}function ch(e,t,i){sh?.postMessage({eventType:e,status:t,data:i})}sh?.addEventListener("message",(e=>{e.data&&e.data.type===ah.AuthConfig&&function(e){const t=e.validDomains?e.validDomains.split(","):[];new ih(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 lh(e),{app:{locale:e.locale||"en-US",theme:e.isDarkMode?Xu.dark:Xu.default,host:{name:Ku.outlookWin32,clientType:Yu.desktop,version:e.clientVersion,sessionId:e.hostSessionId},sessionId:e.sessionId},page:{id:"defaultId",frameContext:Qu.authentication},user:{dataResidency:e.dataResidency}},new rh)||ch(e.type,oh.Failure,"MetaOSAuthExtension is null")}(e.data)}))})()})();