26 lines
536 KiB
JavaScript
26 lines
536 KiB
JavaScript
/*
|
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
*/
|
|
|
|
/*
|
|
Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419.
|
|
*/
|
|
|
|
/*
|
|
* @overview es6-promise - a tiny implementation of Promises/A+.
|
|
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
|
* @license Licensed under MIT license
|
|
* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
|
|
* @version 2.3.0
|
|
*/
|
|
|
|
|
|
// Sources:
|
|
// osfweb: 16.0\14520.10000
|
|
// runtime: 16.0\14520.10000
|
|
// core: 16.0\14520.10000
|
|
// host: 16.0\16.0.14520.34950
|
|
|
|
|
|
|
|
var OfficeExt,__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();!function(e){var t=function(){function e(){}return e.prototype.isMsAjaxLoaded=function(){return!!("undefined"!==typeof Sys&&"undefined"!==typeof Type&&Sys.StringBuilder&&"function"===typeof Sys.StringBuilder&&Type.registerNamespace&&"function"===typeof Type.registerNamespace&&Type.registerClass&&"function"===typeof Type.registerClass&&"function"===typeof Function._validateParams&&Sys.Serialization&&Sys.Serialization.JavaScriptSerializer&&"function"===typeof Sys.Serialization.JavaScriptSerializer.serialize)},e.prototype.loadMsAjaxFull=function(e){var t=("https:"===window.location.protocol.toLowerCase()?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";OSF.OUtil.loadScript(t,e)},Object.defineProperty(e.prototype,"msAjaxError",{get:function(){return null==this._msAjaxError&&this.isMsAjaxLoaded()&&(this._msAjaxError=Error),this._msAjaxError},set:function(e){this._msAjaxError=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"msAjaxString",{get:function(){return null==this._msAjaxString&&this.isMsAjaxLoaded()&&(this._msAjaxString=String),this._msAjaxString},set:function(e){this._msAjaxString=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"msAjaxDebug",{get:function(){return null==this._msAjaxDebug&&this.isMsAjaxLoaded()&&(this._msAjaxDebug=Sys.Debug),this._msAjaxDebug},set:function(e){this._msAjaxDebug=e},enumerable:!0,configurable:!0}),e}();e.MicrosoftAjaxFactory=t}(OfficeExt||(OfficeExt={}));var OSFLog,Logger,OSFAriaLogger,OSFAppTelemetry,OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys,OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys,OSFVisioWAC,OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory,OSF=OSF||{};!function(e){var t=function(){function e(e){this._internalStorage=e}return e.prototype.getItem=function(e){try{return this._internalStorage&&this._internalStorage.getItem(e)}catch(e){return null}},e.prototype.setItem=function(e,t){try{this._internalStorage&&this._internalStorage.setItem(e,t)}catch(e){}},e.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(e){}},e.prototype.removeItem=function(e){try{this._internalStorage&&this._internalStorage.removeItem(e)}catch(e){}},e.prototype.getKeysWithPrefix=function(e){var t=[];try{for(var n=this._internalStorage&&this._internalStorage.length||0,i=0;i<n;i++){var o=this._internalStorage.key(i);0===o.indexOf(e)&&t.push(o)}}catch(e){}return t},e.prototype.isLocalStorageAvailable=function(){return null!=this._internalStorage},e}();e.SafeStorage=t}(OfficeExt||(OfficeExt={})),OSF.XdmFieldName={ConversationUrl:"ConversationUrl",AppId:"AppId"},OSF.TestFlightStart=1e3,OSF.TestFlightEnd=1009,OSF.FlightNames={UseOriginNotUrl:0,AddinEnforceHttps:2,FirstPartyAnonymousProxyReadyCheckTimeout:6,AddinRibbonIdAllowUnknown:9,ManifestParserDevConsoleLog:15,AddinActionDefinitionHybridMode:18,UseActionIdForUILessCommand:20,RequirementSetRibbonApiOnePointTwo:21,SetFocusToTaskpaneIsEnabled:22,ShortcutInfoArrayInUserPreferenceData:23,OSFTestFlight1000:OSF.TestFlightStart,OSFTestFlight1001:OSF.TestFlightStart+1,OSFTestFlight1002:OSF.TestFlightStart+2,OSFTestFlight1003:OSF.TestFlightStart+3,OSFTestFlight1004:OSF.TestFlightStart+4,OSFTestFlight1005:OSF.TestFlightStart+5,OSFTestFlight1006:OSF.TestFlightStart+6,OSFTestFlight1007:OSF.TestFlightStart+7,OSFTestFlight1008:OSF.TestFlightStart+8,OSFTestFlight1009:OSF.TestFlightEnd},OSF.FlightTreatmentNames={AllowStorageAccessByUserActivationOnIFrame:"Microsoft.Office.SharedOnline.AllowStorageAccessByUserActivationOnIFrame",IsPrivateAddin:"Microsoft.Office.SharedOnline.IsPrivateAddin",LogAllAddinsAsPublic:"Microsoft.Office.SharedOnline.LogAllAddinsAsPublic",AddinCommandRibbonCacheFixEnabled:"Microsoft.Office.SharedOnline.AddinCommandRibbonCacheFixEnabled",OSFSolutionRefactor:"Microsoft.Office.SharedOnline.OSFSolutionRefactor"},OSF.Flights=[],OSF.Settings={},OSF.WindowNameItemKeys={BaseFrameName:"baseFrameName",HostInfo:"hostInfo",XdmInfo:"xdmInfo",SerializerVersion:"serializerVersion",AppContext:"appContext",Flights:"flights"},OSF.OUtil=function(){var e=-1,t="#",n={},i=null,o=null,r=(new Date).getTime();function a(){var e=2147483647*Math.random();return(e^=r^(new Date).getMilliseconds()<<Math.floor(21*Math.random())).toString(16)}function s(){if(!i){try{var e=window.sessionStorage}catch(t){e=null}i=new OfficeExt.SafeStorage(e)}return i}function c(e){var t,n,i=[],o=[],r=e.length;for(t=0;t<r;t++)(n=e[t]).tabIndex?n.tabIndex>0?o.push(n):0===n.tabIndex&&i.push(n):i.push(n);return o=o.sort((function(e,t){var n=e.tabIndex-t.tabIndex;return 0===n&&(n=o.indexOf(e)-o.indexOf(t)),n})),[].concat(o,i)}return{set_entropy:function(e){if("string"==typeof e)for(var t=0;t<e.length;t+=4){for(var n=0,i=0;i<4&&t+i<e.length;i++)n=(n<<8)+e.charCodeAt(t+i);r^=n}else r^="number"==typeof e?e:2147483647*Math.random();r&=2147483647},extend:function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.uber=t.prototype,t.prototype.constructor===Object.prototype.constructor&&(t.prototype.constructor=t)},setNamespace:function(e,t){t&&e&&!t[e]&&(t[e]={})},unsetNamespace:function(e,t){t&&e&&t[e]&&delete t[e]},serializeSettings:function(e){var t={};for(var n in e){var i=e[n];try{i=JSON?JSON.stringify(i,(function(e,t){return OSF.OUtil.isDate(this[e])?OSF.DDA.SettingsManager.DateJSONPrefix+this[e].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix:t})):Sys.Serialization.JavaScriptSerializer.serialize(i),t[n]=i}catch(e){}}return t},deserializeSettings:function(e){var t={};for(var n in e=e||{}){var i=e[n];try{i=JSON?JSON.parse(i,(function(e,t){var n;return"string"===typeof t&&t&&t.length>6&&t.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&t.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix&&(n=new Date(parseInt(t.slice(5,-1))))?n:t})):Sys.Serialization.JavaScriptSerializer.deserialize(i,!0),t[n]=i}catch(e){}}return t},loadScript:function(e,t,i){if(e&&t){var o=window.document,r=n[e];if(r)r.loaded?t():r.pendingCallbacks.push(t);else{var a=o.createElement("script");a.type="text/javascript",r={loaded:!1,pendingCallbacks:[t],timer:null},n[e]=r;var s=function(){null!=r.timer&&(clearTimeout(r.timer),delete r.timer),r.loaded=!0;for(var e=r.pendingCallbacks.length,t=0;t<e;t++){r.pendingCallbacks.shift()()}},c=function(t){delete n[e],null!=r.timer&&(clearTimeout(r.timer),delete r.timer);for(var i=r.pendingCallbacks.length,o=0;o<i;o++){r.pendingCallbacks.shift()()}};a.readyState?a.onreadystatechange=function(){"loaded"!=a.readyState&&"complete"!=a.readyState||(a.onreadystatechange=null,s())}:a.onload=s,a.onerror=c,i=i||3e4,r.timer=setTimeout((function(){window.navigator.userAgent.indexOf("Trident")>0?c(null):c(new Event("Script load timed out"))}),i),a.setAttribute("crossOrigin","anonymous"),a.src=e,o.getElementsByTagName("head")[0].appendChild(a)}}},loadCSS:function(e){if(e){var t=window.document,n=t.createElement("link");n.type="text/css",n.rel="stylesheet",n.href=e,t.getElementsByTagName("head")[0].appendChild(n)}},parseEnum:function(e,t){var n=t[e.trim()];if("undefined"==typeof n)throw OsfMsAjaxFactory.msAjaxDebug.trace("invalid enumeration string:"+e),OsfMsAjaxFactory.msAjaxError.argument("str");return n},delayExecutionAndCache:function(){var e={calc:arguments[0]};return function(){return e.calc&&(e.val=e.calc.apply(this,arguments),delete e.calc),e.val}},getUniqueId:function(){return(e+=1).toString()},formatString:function(){var e=arguments,t=e[0];return t.replace(/{(\d+)}/gm,(function(t,n){var i=parseInt(n,10)+1;return void 0===e[i]?"{"+n+"}":e[i]}))},generateConversationId:function(){return[a(),a(),(new Date).getTime().toString()].join("_")},getFrameName:function(e){return"_xdm_"+e+this.generateConversationId()},addXdmInfoAsHash:function(e,t){return OSF.OUtil.addInfoAsHash(e,"&_xdm_Info=",t,!1)},addSerializerVersionAsHash:function(e,t){return OSF.OUtil.addInfoAsHash(e,"&_serializer_version=",t,!0)},addFlightsAsHash:function(e,t){return OSF.OUtil.addInfoAsHash(e,"&_flights=",t,!0)},addInfoAsHash:function(e,n,i,o){var r,a=(e=e.trim()||"").split(t),s=a.shift(),c=a.join(t);return r=o?[n,encodeURIComponent(i),c].join(""):[c,n,i].join(""),[s,t,r].join("")},parseHostInfoFromWindowName:function(e,t){return OSF.OUtil.parseInfoFromWindowName(e,t,OSF.WindowNameItemKeys.HostInfo)},parseXdmInfo:function(e){var t=OSF.OUtil.parseXdmInfoWithGivenFragment(e,window.location.hash);return t||(t=OSF.OUtil.parseXdmInfoFromWindowName(e,window.name)),t},parseXdmInfoFromWindowName:function(e,t){return OSF.OUtil.parseInfoFromWindowName(e,t,OSF.WindowNameItemKeys.XdmInfo)},parseXdmInfoWithGivenFragment:function(e,t){return OSF.OUtil.parseInfoWithGivenFragment("&_xdm_Info=","_xdm_",!1,e,t)},parseSerializerVersion:function(e){var t=OSF.OUtil.parseSerializerVersionWithGivenFragment(e,window.location.hash);return isNaN(t)&&(t=OSF.OUtil.parseSerializerVersionFromWindowName(e,window.name)),t},parseSerializerVersionFromWindowName:function(e,t){return parseInt(OSF.OUtil.parseInfoFromWindowName(e,t,OSF.WindowNameItemKeys.SerializerVersion))},parseSerializerVersionWithGivenFragment:function(e,t){return parseInt(OSF.OUtil.parseInfoWithGivenFragment("&_serializer_version=","_serializer_version=",!0,e,t))},parseFlights:function(e){var t=OSF.OUtil.parseFlightsWithGivenFragment(e,window.location.hash);return 0==t.length&&(t=OSF.OUtil.parseFlightsFromWindowName(e,window.name)),t},checkFlight:function(e){return OSF.Flights&&OSF.Flights.indexOf(e)>=0},pushFlight:function(e){return OSF.Flights.indexOf(e)<0&&(OSF.Flights.push(e),!0)},getBooleanSetting:function(e){return OSF.OUtil.getBooleanFromDictionary(OSF.Settings,e)},getBooleanFromDictionary:function(e,t){var n=e&&t&&void 0!==e[t]&&e[t]&&("string"===typeof e[t]&&"TRUE"===e[t].toUpperCase()||"boolean"===typeof e[t]&&e[t]);return void 0!==n&&n},parseFlightsFromWindowName:function(e,t){return OSF.OUtil.parseArrayWithDefault(OSF.OUtil.parseInfoFromWindowName(e,t,OSF.WindowNameItemKeys.Flights))},parseFlightsWithGivenFragment:function(e,t){return OSF.OUtil.parseArrayWithDefault(OSF.OUtil.parseInfoWithGivenFragment("&_flights=","_flights=",!0,e,t))},parseArrayWithDefault:function(e){var t=[];try{t=JSON.parse(e)}catch(e){}return Array.isArray(t)||(t=[]),t},parseInfoFromWindowName:function(e,t,n){try{var i=JSON.parse(t),o=null!=i?i[n]:null,r=s();if(!e&&r&&null!=i){var a=i[OSF.WindowNameItemKeys.BaseFrameName]+n;o?r.setItem(a,o):o=r.getItem(a)}return o}catch(e){return null}},parseInfoWithGivenFragment:function(e,t,n,i,o){var r=o.split(e),a=r.length>1?r[r.length-1]:null;n&&null!=a&&(a.indexOf("&")>=0&&(a=a.split("&")[0]),a=decodeURIComponent(a));var c=s();if(!i&&c){var l=window.name.indexOf(t);if(l>-1){var u=window.name.indexOf(";",l);-1==u&&(u=window.name.length);var d=window.name.substring(l,u);a?c.setItem(d,a):a=c.getItem(d)}}return a},getConversationId:function(){var e=window.location.search,t=null;if(e){var n=e.indexOf("&");(t=n>0?e.substring(1,n):e.substr(1))&&"="===t.charAt(t.length-1)&&(t=t.substring(0,t.length-1))&&(t=decodeURIComponent(t))}return t},getInfoItems:function(e){var t=e.split("$");return"undefined"==typeof t[1]&&(t=e.split("|")),"undefined"==typeof t[1]&&(t=e.split("%7C")),t},getXdmFieldValue:function(e,t){var n="",i=OSF.OUtil.parseXdmInfo(t);if(i){var o=OSF.OUtil.getInfoItems(i);if(void 0!=o&&o.length>=3)switch(e){case OSF.XdmFieldName.ConversationUrl:n=o[2];break;case OSF.XdmFieldName.AppId:n=o[1]}}return n},validateParamObject:function(e,t,n){var i=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:!1},{name:"expectedProperties",type:Object,mayBeNull:!1},{name:"callback",type:Function,mayBeNull:!0}]);if(i)throw i;for(var o in t)if(i=Function._validateParameter(e[o],t[o],o))throw i},writeProfilerMark:function(e){window.msWriteProfilerMark&&(window.msWriteProfilerMark(e),OsfMsAjaxFactory.msAjaxDebug.trace(e))},outputDebug:function(e){"undefined"!==typeof OsfMsAjaxFactory&&OsfMsAjaxFactory.msAjaxDebug&&OsfMsAjaxFactory.msAjaxDebug.trace&&OsfMsAjaxFactory.msAjaxDebug.trace(e)},defineNondefaultProperty:function(e,t,n,i){for(var o in n=n||{},i){var r=i[o];void 0==n[r]&&(n[r]=!0)}return Object.defineProperty(e,t,n),e},defineNondefaultProperties:function(e,t,n){for(var i in t=t||{})OSF.OUtil.defineNondefaultProperty(e,i,t[i],n);return e},defineEnumerableProperty:function(e,t,n){return OSF.OUtil.defineNondefaultProperty(e,t,n,["enumerable"])},defineEnumerableProperties:function(e,t){return OSF.OUtil.defineNondefaultProperties(e,t,["enumerable"])},defineMutableProperty:function(e,t,n){return OSF.OUtil.defineNondefaultProperty(e,t,n,["writable","enumerable","configurable"])},defineMutableProperties:function(e,t){return OSF.OUtil.defineNondefaultProperties(e,t,["writable","enumerable","configurable"])},finalizeProperties:function(e,t){t=t||{};for(var n=Object.getOwnPropertyNames(e),i=n.length,o=0;o<i;o++){var r=n[o],a=Object.getOwnPropertyDescriptor(e,r);a.get||a.set||(a.writable=t.writable||!1),a.configurable=t.configurable||!1,a.enumerable=t.enumerable||!0,Object.defineProperty(e,r,a)}return e},mapList:function(e,t){var n=[];if(e)for(var i in e)n.push(t(e[i]));return n},listContainsKey:function(e,t){for(var n in e)if(t==n)return!0;return!1},listContainsValue:function(e,t){for(var n in e)if(t==e[n])return!0;return!1},augmentList:function(e,t){var n=e.push?function(t,n){e.push(n)}:function(t,n){e[t]=n};for(var i in t)n(i,t[i])},redefineList:function(e,t){for(var n in e)delete e[n];for(var i in t)e[i]=t[i]},isArray:function(e){return"[object Array]"===Object.prototype.toString.apply(e)},isFunction:function(e){return"[object Function]"===Object.prototype.toString.apply(e)},isDate:function(e){return"[object Date]"===Object.prototype.toString.apply(e)},addEventListener:function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):Sys.Browser.agent===Sys.Browser.InternetExplorer&&e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},removeEventListener:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):Sys.Browser.agent===Sys.Browser.InternetExplorer&&e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},getCookieValue:function(e){return RegExp(e+"[^;]+").exec(document.cookie).toString().replace(/^[^=]+./,"")},xhrGet:function(e,t,n){var i;try{(i=new XMLHttpRequest).onreadystatechange=function(){4==i.readyState&&(200==i.status?t(i.responseText):n(i.status))},i.open("GET",e,!0),i.send()}catch(e){n(e)}},xhrGetFull:function(e,t,n,i){var o,r=t;try{(o=new XMLHttpRequest).onreadystatechange=function(){4==o.readyState&&(200==o.status?n(o,r):i(o.status))},o.open("GET",e,!0),o.send()}catch(e){i(e)}},encodeBase64:function(e){if(!e)return e;var t,n,i,o,r,a,s,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=[],u=[],d=0,f=e.length;do{t=e.charCodeAt(d++),n=e.charCodeAt(d++),i=e.charCodeAt(d++),s=0,o=255&t,r=t>>8,a=255&n,u[s++]=o>>2,u[s++]=(3&o)<<4|r>>4,u[s++]=(15&r)<<2|a>>6,u[s++]=63&a,isNaN(n)||(o=n>>8,r=255&i,a=i>>8,u[s++]=o>>2,u[s++]=(3&o)<<4|r>>4,u[s++]=(15&r)<<2|a>>6,u[s++]=63&a),isNaN(n)?u[s-1]=64:isNaN(i)&&(u[s-2]=64,u[s-1]=64);for(var p=0;p<s;p++)l.push(c.charAt(u[p]))}while(d<f);return l.join("")},getSessionStorage:function(){return s()},getLocalStorage:function(){if(!o){try{var e=window.localStorage}catch(t){e=null}o=new OfficeExt.SafeStorage(e)}return o},convertIntToCssHexColor:function(e){return"#"+(Number(e)+16777216).toString(16).slice(-6)},attachClickHandler:function(e,t){e.onclick=function(e){t()},e.ontouchend=function(e){t(),e.preventDefault()}},getQueryStringParamValue:function(e,t){var n=Function._validateParams(arguments,[{name:"queryString",type:String,mayBeNull:!1},{name:"paramName",type:String,mayBeNull:!1}]);if(n)return OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null."),"";var i=new RegExp("[\\?&]"+t+"=([^&#]*)","i");return i.test(e)?i.exec(e)[1]:(OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found."),"")},getHostnamePortionForLogging:function(e){var t=Function._validateParams(arguments,[{name:"hostname",type:String,mayBeNull:!1}]);if(t)return"";var n=e.split("."),i=n.length;return i>=2?n[i-2]+"."+n[i-1]:1==i?n[0]:void 0},isiOS:function(){return!!window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g)},isChrome:function(){return window.navigator.userAgent.indexOf("Chrome")>0&&!OSF.OUtil.isEdge()},isEdge:function(){return window.navigator.userAgent.indexOf("Edge")>0},isIE:function(){return window.navigator.userAgent.indexOf("Trident")>0},isFirefox:function(){return window.navigator.userAgent.indexOf("Firefox")>0},startsWith:function(e,t,n){return n?e.substr(0,t.length)===t:e.startsWith(t)},containsPort:function(e,t,n,i){return this.startsWith(e,t+"//"+n+":"+i,!0)||this.startsWith(e,n+":"+i,!0)},getRedundandPortString:function(e,t){return e&&t?"https:"==t.protocol&&this.containsPort(e,"https:",t.hostname,"443")?":443":"http:"==t.protocol&&this.containsPort(e,"http:",t.hostname,"80")?":80":"":""},removeChar:function(e,t){return t<e.length-1?e.substring(0,t)+e.substring(t+1):t==e.length-1?e.substring(0,e.length-1):e},cleanUrlOfChar:function(e,t){var n;for(n=0;n<e.length;n++)if(e.charAt(n)===t){if(n+1>=e.length)return this.removeChar(e,n);if("/"===t){if("?"===e.charAt(n+1)||"#"===e.charAt(n+1))return this.removeChar(e,n)}else if("?"===t&&"#"===e.charAt(n+1))return this.removeChar(e,n)}return e},cleanUrl:function(e){if(e=this.cleanUrlOfChar(e,"/"),e=this.cleanUrlOfChar(e,"?"),"https://"==(e=this.cleanUrlOfChar(e,"#")).substr(0,8))-1!=(t=e.indexOf(":443"))&&(t!=e.length-4&&"/"!=e.charAt(t+4)&&"?"!=e.charAt(t+4)&&"#"!=e.charAt(t+4)||(e=e.substring(0,t)+e.substring(t+4)));else if("http://"==e.substr(0,7)){var t;-1!=(t=e.indexOf(":80"))&&(t!=e.length-3&&"/"!=e.charAt(t+3)&&"?"!=e.charAt(t+3)&&"#"!=e.charAt(t+3)||(e=e.substring(0,t)+e.substring(t+3)))}return e},parseUrl:function(e,t){if(void 0===t&&(t=!1),"undefined"!==typeof e&&e){var n=this.isIE(),i={protocol:void 0,hostname:void 0,host:void 0,port:void 0,pathname:void 0,search:void 0,hash:void 0,isPortPartOfUrl:void 0};try{if(n){var o=document.createElement("a");if(o.href=e,!o||!o.protocol||!o.host||!o.hostname||!o.href||this.cleanUrl(o.href).toLowerCase()!==this.cleanUrl(e).toLowerCase())throw"InvalidUrl";if(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)&&t&&"https:"!=o.protocol)throw new Error("NotHttps");var r=this.getRedundandPortString(e,o);i.protocol=o.protocol,i.hostname=o.hostname,i.port=""==r?o.port:"",i.host=""!=r?o.hostname:o.host,i.pathname=(n?"/":"")+o.pathname,i.search=o.search,i.hash=o.hash,i.isPortPartOfUrl=this.containsPort(e,o.protocol,o.hostname,o.port)}else{var a=new URL(e);if(a&&a.protocol&&a.host&&a.hostname){if(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)&&t&&"https:"!=a.protocol)throw new Error("NotHttps");i.protocol=a.protocol,i.hostname=a.hostname,i.port=a.port,i.host=a.host,i.pathname=a.pathname,i.search=a.search,i.hash=a.hash,i.isPortPartOfUrl=a.host.lastIndexOf(":"+a.port)==a.host.length-a.port.length-1}}}catch(e){if("NotHttps"===e.message)throw e}return i}},shallowCopy:function(e){if(null==e)return null;if(e instanceof Object){if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t}var i=e.constructor();for(var o in e)e.hasOwnProperty(o)&&(i[o]=e[o]);return i}return e},createObject:function(e){var t=null;if(e){t={};for(var n=e.length,i=0;i<n;i++)t[e[i].name]=e[i].value}return t},addClass:function(e,t){if(!OSF.OUtil.hasClass(e,t)){var n=e.getAttribute("class");n?e.setAttribute("class",n+" "+t):e.setAttribute("class",t)}},removeClass:function(e,t){if(OSF.OUtil.hasClass(e,t)){var n=e.getAttribute("class"),i=new RegExp("(\\s|^)"+t+"(\\s|$)");n=n.replace(i,""),e.setAttribute("class",n)}},hasClass:function(e,t){var n=e.getAttribute("class");return n&&n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))},focusToFirstTabbable:function(e,t){var n,i,o=!1,r=function(e){o=!0},a=function(e,t,n){return t<0||t>e||0===t&&n?-1:t!==e-1||n?n?t-1:t+1:-1};if(e=c(e),n=t?e.length-1:0,0===e.length)return null;for(;!o&&n>=0&&n<e.length;)i=e[n],window.focus(),i.addEventListener("focus",r),i.focus(),i.removeEventListener("focus",r),n=a(e.length,n,t),o||i!==document.activeElement||(o=!0);return o?i:null},focusToNextTabbable:function(e,t,n){var i,o,r,a=!1,s=function(e){a=!0},l=function(e,t,n){return t<0||t>e||0===t&&n?-1:t!==e-1||n?n?t-1:t+1:-1};if(i=function(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}(e=c(e),t),(o=l(e.length,i,n))<0)return null;for(;!a&&o>=0&&o<e.length;)(r=e[o]).addEventListener("focus",s),r.focus(),r.removeEventListener("focus",s),o=l(e.length,o,n),a||r!==document.activeElement||(a=!0);return a?r:null},isNullOrUndefined:function(e){return"undefined"===typeof e||null===e},stringEndsWith:function(e,t){if(!OSF.OUtil.isNullOrUndefined(e)&&!OSF.OUtil.isNullOrUndefined(t)){if(t.length>e.length)return!1;if(e.substr(e.length-t.length)===t)return!0}return!1},hashCode:function(e){var t=0;if(!OSF.OUtil.isNullOrUndefined(e))for(var n=0,i=e.length;n<i;)t=(t<<5)-t+e.charCodeAt(n++)|0;return t},getValue:function(e,t){return OSF.OUtil.isNullOrUndefined(e)?t:e},externalNativeFunctionExists:function(e){return"unknown"===e||"undefined"!==e}}}(),OSF.OUtil.Guid=function(){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return{generateNewGuid:function(){for(var t="",n=(new Date).getTime(),i=0;i<32&&n>0;i++)8!=i&&12!=i&&16!=i&&20!=i||(t+="-"),t+=e[n%16],n=Math.floor(n/16);for(;i<32;i++)8!=i&&12!=i&&16!=i&&20!=i||(t+="-"),t+=e[Math.floor(16*Math.random())];return t}}}();try{!function(){OSF.Flights=OSF.OUtil.parseFlights(!0)}()}catch(e){}window.OSF=OSF,OSF.OUtil.setNamespace("OSF",window),OSF.MessageIDs={FetchBundleUrl:0,LoadReactBundle:1,LoadBundleSuccess:2,LoadBundleError:3},OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768,OutlookIOS:65536,OneNoteWebApp:131072,OneNote:262144,ExcelWinRT:524288,WordWinRT:1048576,PowerpointWinRT:2097152,OutlookAndroid:4194304,OneNoteWinRT:8388608,ExcelAndroid:8388609,VisioWebApp:8388610,OneNoteIOS:8388611,WordAndroid:8388613,PowerpointAndroid:8388614,Visio:8388615,OneNoteAndroid:4194305},OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"},OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"},OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7,NotifyHostError:8,RefreshAddinCommands:9,PageIsReady:10,TabIn:11,TabInShift:12,TabExit:13,TabExitShift:14,EscExit:15,F2Exit:16,ExitNoFocusable:17,ExitNoFocusableShift:18,MouseEnter:19,MouseLeave:20,UpdateTargetUrl:21,InstallCustomFunctions:22,SendTelemetryEvent:23,UninstallCustomFunctions:24,SendMessage:25,LaunchExtensionComponent:26,StopExtensionComponent:27,RestartExtensionComponent:28,EnableTaskPaneHeaderButton:29,DisableTaskPaneHeaderButton:30,TaskPaneHeaderButtonClicked:31,RemoveAppCommandsAddin:32,RefreshRibbonGallery:33,GetOriginalControlId:34,OfficeJsReady:35,InsertDevManifest:36,InsertDevManifestError:37,SendCustomerContent:38,KeyboardShortcuts:39},OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"},OSF.DialogMessageType={DialogMessageReceived:0,DialogParentMessageReceived:1,DialogClosed:12006},OSF.OfficeAppContext=function(e,t,n,i,o,r,a,s,c,l,u,d,f,p,h,m,g,y,O,v,b,_,S,A,D,C,P){this._id=e,this._appName=t,this._appVersion=n,this._appUILocale=i,this._dataLocale=o,this._docUrl=r,this._clientMode=a,this._settings=s,this._reason=c,this._osfControlType=l,this._eToken=u,this._correlationId=d,this._appInstanceId=f,this._touchEnabled=p,this._commerceAllowed=h,this._appMinorVersion=m,this._requirementMatrix=g,this._hostCustomMessage=y,this._hostFullVersion=O,this._isDialog=!1,this._clientWindowHeight=v,this._clientWindowWidth=b,this._addinName=_,this._appDomains=S,this._dialogRequirementMatrix=A,this._featureGates=D,this._officeTheme=C,this._initialDisplayMode=P,this.get_id=function(){return this._id},this.get_appName=function(){return this._appName},this.get_appVersion=function(){return this._appVersion},this.get_appUILocale=function(){return this._appUILocale},this.get_dataLocale=function(){return this._dataLocale},this.get_docUrl=function(){return this._docUrl},this.get_clientMode=function(){return this._clientMode},this.get_bindings=function(){return this._bindings},this.get_settings=function(){return this._settings},this.get_reason=function(){return this._reason},this.get_osfControlType=function(){return this._osfControlType},this.get_eToken=function(){return this._eToken},this.get_correlationId=function(){return this._correlationId},this.get_appInstanceId=function(){return this._appInstanceId},this.get_touchEnabled=function(){return this._touchEnabled},this.get_commerceAllowed=function(){return this._commerceAllowed},this.get_appMinorVersion=function(){return this._appMinorVersion},this.get_requirementMatrix=function(){return this._requirementMatrix},this.get_dialogRequirementMatrix=function(){return this._dialogRequirementMatrix},this.get_hostCustomMessage=function(){return this._hostCustomMessage},this.get_hostFullVersion=function(){return this._hostFullVersion},this.get_isDialog=function(){return this._isDialog},this.get_clientWindowHeight=function(){return this._clientWindowHeight},this.get_clientWindowWidth=function(){return this._clientWindowWidth},this.get_addinName=function(){return this._addinName},this.get_appDomains=function(){return this._appDomains},this.get_featureGates=function(){return this._featureGates},this.get_officeTheme=function(){return this._officeTheme},this.get_initialDisplayMode=function(){return this._initialDisplayMode?this._initialDisplayMode:0}},OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1},OSF.ClientMode={ReadOnly:0,ReadWrite:1},OSF.OUtil.setNamespace("Microsoft",window),OSF.OUtil.setNamespace("Office",Microsoft),OSF.OUtil.setNamespace("Client",Microsoft.Office),OSF.OUtil.setNamespace("WebExtension",Microsoft.Office),Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened",ControlActivation:"controlActivation"},Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"},Microsoft.Office.WebExtension.FilterType={All:"all"},Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",PlatformType:"platformType",HostType:"hostType",ForceConsent:"forceConsent",ForceAddAccount:"forceAddAccount",AuthChallenge:"authChallenge",AllowConsentPrompt:"allowConsentPrompt",ForMSGraphAccess:"forMSGraphAccess",AllowSignInPrompt:"allowSignInPrompt",JsonPayload:"jsonPayload",EnableNewHosts:"enableNewHosts",AccountTypeFilter:"accountTypeFilter",AddinTrustId:"addinTrustId",Reserved:"reserved",Tcid:"tcid",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",Text:"text",ImageLeft:"imageLeft",ImageTop:"imageTop",ImageWidth:"imageWidth",ImageHeight:"imageHeight",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex",CustomFieldId:"customFieldId",Url:"url",MessageHandler:"messageHandler",Width:"width",Height:"height",RequireHTTPs:"requireHTTPS",MessageToParent:"messageToParent",DisplayInIframe:"displayInIframe",MessageContent:"messageContent",HideTitle:"hideTitle",UseDeviceIndependentPixels:"useDeviceIndependentPixels",PromptBeforeOpen:"promptBeforeOpen",EnforceAppDomain:"enforceAppDomain",UrlNoHostInfo:"urlNoHostInfo",TargetOrigin:"targetOrigin",AppCommandInvocationCompletedData:"appCommandInvocationCompletedData",Base64:"base64",FormId:"formId"},OSF.OUtil.setNamespace("DDA",OSF),OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0},OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"},OSF.DDA.EventDescriptors={},OSF.DDA.ListDescriptors={},OSF.DDA.UI={},OSF.DDA.getXdmEventName=function(e,t){return t==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||t==Microsoft.Office.WebExtension.EventType.BindingDataChanged||t==Microsoft.Office.WebExtension.EventType.DataNodeDeleted||t==Microsoft.Office.WebExtension.EventType.DataNodeInserted||t==Microsoft.Office.WebExtension.EventType.DataNodeReplaced?e+"_"+t:t},OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidCloseContainerMethod:97,dispidGetAccessTokenMethod:98,dispidGetAuthContextMethod:99,dispidOpenBrowserWindow:102,dispidCreateDocumentMethod:105,dispidInsertFormMethod:106,dispidDisplayRibbonCalloutAsyncMethod:109,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123,dispidCreateTaskMethod:124,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidGetDataNodeTextMethod:142,dispidSetDataNodeTextMethod:143,dispidMessageParentMethod:144,dispidSendMessageMethod:145,dispidExecuteFeature:146,dispidQueryFeature:147,dispidMethodMax:147},OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidDialogMessageReceivedEvent:10,dispidDialogNotificationShownInAddinEvent:11,dispidDialogParentMessageReceivedEvent:12,dispidObjectDeletedEvent:13,dispidObjectSelectionChangedEvent:14,dispidObjectDataChangedEvent:15,dispidContentControlAddedEvent:16,dispidActivationStatusChangedEvent:32,dispidRichApiMessageEvent:33,dispidAppCommandInvokedEvent:39,dispidOlkItemSelectedChangedEvent:46,dispidOlkRecipientsChangedEvent:47,dispidOlkAppointmentTimeChangedEvent:48,dispidOlkRecurrenceChangedEvent:49,dispidOlkAttachmentsChangedEvent:50,dispidOlkEnhancedLocationsChangedEvent:51,dispidOlkInfobarClickedEvent:52,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63},OSF.DDA.ErrorCodeManager=function(){var e={};return{getErrorArgs:function(t){var n=e[t];return n?(n.name||(n.name=e[this.errorCodes.ooeInternalError].name),n.message||(n.message=e[this.errorCodes.ooeInternalError].message)):n=e[this.errorCodes.ooeInternalError],n},addErrorMessage:function(t,n){e[t]=n},errorCodes:{ooeSuccess:0,ooeChunkResult:1,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeInvalidOrTimedOutSession:5012,ooeInvalidApiArguments:5013,ooeOperationCancelled:5014,ooeWorkbookHidden:5015,ooeWriteNotSupportedWhenModalDialogOpen:5016,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeActivityLimitReached:5102,ooeRequestPayloadSizeLimitExceeded:5103,ooeResponsePayloadSizeLimitExceeded:5104,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeCustomXmlExceedQuota:6101,ooeCustomXmlOutOfDate:6102,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11e3,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101,ooeInvalidWidth:12e3,ooeInvalidHeight:12001,ooeNavigationError:12002,ooeInvalidScheme:12003,ooeAppDomains:12004,ooeRequireHTTPS:12005,ooeWebDialogClosed:12006,ooeDialogAlreadyOpened:12007,ooeEndUserAllow:12008,ooeEndUserIgnore:12009,ooeNotUILessDialog:12010,ooeCrossZone:12011,ooeNotSSOAgave:13e3,ooeSSOUserNotSignedIn:13001,ooeSSOUserAborted:13002,ooeSSOUnsupportedUserIdentity:13003,ooeSSOInvalidResourceUrl:13004,ooeSSOInvalidGrant:13005,ooeSSOClientError:13006,ooeSSOServerError:13007,ooeAddinIsAlreadyRequestingToken:13008,ooeSSOUserConsentNotSupportedByCurrentAddinCategory:13009,ooeSSOConnectionLost:13010,ooeResourceNotAllowed:13011,ooeSSOUnsupportedPlatform:13012,ooeSSOCallThrottled:13013,ooeAccessDenied:13990,ooeGeneralException:13991},initializeErrorMessages:function(t){e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:t.L_DataReadError,message:t.L_GetSelectionNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotMatchBinding},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:t.L_DataReadError,message:t.L_InvalidGetRowColumnCounts},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:t.L_DataReadError,message:t.L_SelectionNotSupportCoercionType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:t.L_DataReadError,message:t.L_InvalidGetStartRowColumn},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:t.L_DataReadError,message:t.L_NonUniformPartialGetNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:t.L_DataReadError,message:t.L_GetDataIsTooLarge},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:t.L_DataReadError,message:t.L_FileTypeNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:t.L_DataReadError,message:t.L_GetDataParametersConflict},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:t.L_DataReadError,message:t.L_InvalidGetColumns},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:t.L_DataReadError,message:t.L_InvalidGetRows},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:t.L_DataReadError,message:t.L_InvalidReadForBlankRow},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:t.L_DataWriteError,message:t.L_UnsupportedDataObject},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:t.L_DataWriteError,message:t.L_CannotWriteToSelection},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:t.L_DataWriteError,message:t.L_DataNotMatchSelection},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:t.L_DataWriteError,message:t.L_OverwriteWorksheetData},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:t.L_DataWriteError,message:t.L_DataNotMatchBindingSize},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:t.L_DataWriteError,message:t.L_InvalidSetStartRowColumn},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:t.L_InvalidFormat,message:t.L_InvalidDataFormat},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchCoercionType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchBindingType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:t.L_DataWriteError,message:t.L_SetDataIsTooLarge},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:t.L_DataWriteError,message:t.L_NonUniformPartialSetNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:t.L_DataWriteError,message:t.L_InvalidSetColumns},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:t.L_DataWriteError,message:t.L_InvalidSetRows},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:t.L_DataWriteError,message:t.L_SetDataParametersConflict},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:t.L_BindingCreationError,message:t.L_SelectionCannotBound},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:t.L_InvalidBindingError,message:t.L_BindingNotExist},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:t.L_BindingCreationError,message:t.L_BindingToMultipleSelection},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidSelectionForBindingType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnThisBindingType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:t.L_BindingCreationError,message:t.L_NamedItemNotFound},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:t.L_BindingCreationError,message:t.L_MultipleNamedItemFound},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidNamedItemForBindingType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:t.L_InvalidBinding,message:t.L_UnknownBindingType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnMatrixData},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:t.L_InvalidBinding,message:t.L_InvalidColumnsForBinding},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:t.L_ReadSettingsError,message:t.L_SettingNameNotExist},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:t.L_SaveSettingsError,message:t.L_SettingsCannotSave},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:t.L_SettingsStaleError,message:t.L_SettingsAreStale},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:t.L_HostError,message:t.L_OperationNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:t.L_InternalError,message:t.L_InternalErrorDescription},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:t.L_PermissionDenied,message:t.L_DocumentReadOnly},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:t.L_EventRegistrationError,message:t.L_EventHandlerNotExist},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:t.L_InvalidAPICall,message:t.L_InvalidApiCallInContext},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:t.L_ShuttingDown,message:t.L_ShuttingDown},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:t.L_UnsupportedEnumeration,message:t.L_UnsupportedEnumerationMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:t.L_IndexOutOfRange,message:t.L_IndexOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:t.L_APINotSupported,message:t.L_BrowserAPINotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:t.L_APICallFailed,message:t.L_RequestTimeout},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidOrTimedOutSession]={name:t.L_InvalidOrTimedOutSession,message:t.L_InvalidOrTimedOutSessionMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiArguments]={name:t.L_APICallFailed,message:t.L_InvalidApiArgumentsMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeWorkbookHidden]={name:t.L_APICallFailed,message:t.L_WorkbookHiddenMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeWriteNotSupportedWhenModalDialogOpen]={name:t.L_APICallFailed,message:t.L_WriteNotSupportedWhenModalDialogOpen},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:t.L_APICallFailed,message:t.L_TooManyIncompleteRequests},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:t.L_APICallFailed,message:t.L_RequestTokenUnavailable},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={name:t.L_APICallFailed,message:t.L_ActivityLimitReached},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestPayloadSizeLimitExceeded]={name:t.L_APICallFailed,message:t.L_RequestPayloadSizeLimitExceededMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeResponsePayloadSizeLimitExceeded]={name:t.L_APICallFailed,message:t.L_ResponsePayloadSizeLimitExceededMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:t.L_InvalidNode,message:t.L_CustomXmlNodeNotFound},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:t.L_CustomXmlError,message:t.L_CustomXmlError},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={name:t.L_CustomXmlExceedQuotaName,message:t.L_CustomXmlExceedQuotaMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={name:t.L_CustomXmlOutOfDateName,message:t.L_CustomXmlOutOfDateMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:t.L_PermissionDenied,message:t.L_NoCapability},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:t.L_CannotNavigateTo,message:t.L_CannotNavigateTo},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:t.L_SpecifiedIdNotExist,message:t.L_SpecifiedIdNotExist},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:t.L_NavOutOfBound,message:t.L_NavOutOfBound},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:t.L_DataWriteReminder,message:t.L_CellDataAmountBeyondLimits},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:t.L_MissingParameter,message:t.L_ElementMissing},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:t.L_PermissionDenied,message:t.L_NoCapability},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:t.L_InvalidValue,message:t.L_InvalidCellsValue},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:t.L_InvalidValue,message:t.L_InvalidTableOptionValue},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:t.L_InvalidValue,message:t.L_InvalidFormatValue},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_RowIndexOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_ColIndexOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:t.L_OutOfRange,message:t.L_FormatValueOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:t.L_FormattingReminder,message:t.L_CellFormatAmountBeyondLimits},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:t.L_MemoryLimit,message:t.L_CloseFileBeforeRetrieve},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:t.L_NetworkProblem,message:t.L_NetworkProblemRetrieveFile},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:t.L_InvalidValue,message:t.L_SliceSizeNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened]={name:t.L_DisplayDialogError,message:t.L_DialogAlreadyOpened},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidWidth]={name:t.L_IndexOutOfRange,message:t.L_IndexOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidHeight]={name:t.L_IndexOutOfRange,message:t.L_IndexOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavigationError]={name:t.L_DisplayDialogError,message:t.L_NetworkProblem},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidScheme]={name:t.L_DialogNavigateError,message:t.L_DialogInvalidScheme},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeAppDomains]={name:t.L_DisplayDialogError,message:t.L_DialogAddressNotTrusted},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequireHTTPS]={name:t.L_DisplayDialogError,message:t.L_DialogRequireHTTPS},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeEndUserIgnore]={name:t.L_DisplayDialogError,message:t.L_UserClickIgnore},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCrossZone]={name:t.L_DisplayDialogError,message:t.L_NewWindowCrossZoneErrorString},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNotSSOAgave]={name:t.L_APINotSupported,message:t.L_InvalidSSOAddinMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOUserNotSignedIn]={name:t.L_UserNotSignedIn,message:t.L_UserNotSignedIn},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOUserAborted]={name:t.L_UserAborted,message:t.L_UserAbortedMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOUnsupportedUserIdentity]={name:t.L_UnsupportedUserIdentity,message:t.L_UnsupportedUserIdentityMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOInvalidResourceUrl]={name:t.L_InvalidResourceUrl,message:t.L_InvalidResourceUrlMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOInvalidGrant]={name:t.L_InvalidGrant,message:t.L_InvalidGrantMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOClientError]={name:t.L_SSOClientError,message:t.L_SSOClientErrorMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOServerError]={name:t.L_SSOServerError,message:t.L_SSOServerErrorMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeAddinIsAlreadyRequestingToken]={name:t.L_AddinIsAlreadyRequestingToken,message:t.L_AddinIsAlreadyRequestingTokenMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOUserConsentNotSupportedByCurrentAddinCategory]={name:t.L_SSOUserConsentNotSupportedByCurrentAddinCategory,message:t.L_SSOUserConsentNotSupportedByCurrentAddinCategoryMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOConnectionLost]={name:t.L_SSOConnectionLostError,message:t.L_SSOConnectionLostErrorMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOUnsupportedPlatform]={name:t.L_APINotSupported,message:t.L_SSOUnsupportedPlatform},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOCallThrottled]={name:t.L_APICallFailed,message:t.L_RequestTokenUnavailable},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationCancelled]={name:t.L_OperationCancelledError,message:t.L_OperationCancelledErrorMessage}}}}(),function(e){!function(e){var t=function(){return function(){}}();e.RequirementVersion=t;var n=function(){return function(e){this.isSetSupported=function(e,t){if(void 0==e)return!1;void 0==t&&(t=0);var n=this._setMap._sets;if(n.hasOwnProperty(e.toLowerCase())){var i=n[e.toLowerCase()];try{var o=this._getVersion(i);t+="";var r=this._getVersion(t);if(o.major>0&&o.major>r.major)return!0;if(o.major>0&&o.minor>=0&&o.major==r.major&&o.minor>=r.minor)return!0}catch(e){return!1}}return!1},this._getVersion=function(e){var t=(e+="").split("."),n=0,i=0;if(t.length<2&&isNaN(Number(e)))throw"version format incorrect";if(n=Number(t[0]),t.length>=2&&(i=Number(t[1])),isNaN(n)||isNaN(i))throw"version format incorrect";return{minor:i,major:n}},this._setMap=e,this.isSetSupported=this.isSetSupported.bind(this)}}();e.RequirementMatrix=n;var i=function(){return function(e){this._addSetMap=function(e){for(var t in e)this._sets[t]=e[t]},this._sets=e}}();e.DefaultSetRequirement=i;var o=function(e){function t(){return e.call(this,{dialogapi:1.1})||this}return __extends(t,e),t}(i);e.DefaultRequiredDialogSetRequirement=o;var r=function(e){function t(){return e.call(this,{dialogorigin:1.1})||this}return __extends(t,e),t}(i);e.DefaultOptionalDialogSetRequirement=r;var a=function(e){function t(){return e.call(this,{bindingevents:1.1,documentevents:1.1,excelapi:1.1,matrixbindings:1.1,matrixcoercion:1.1,selection:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1,textbindings:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(i);e.ExcelClientDefaultSetRequirement=a;var s=function(e){function t(){var t=e.call(this)||this;return t._addSetMap({imagecoercion:1.1}),t}return __extends(t,e),t}(a);e.ExcelClientV1DefaultSetRequirement=s;var c=function(e){function t(){return e.call(this,{mailbox:1.3})||this}return __extends(t,e),t}(i);e.OutlookClientDefaultSetRequirement=c;var l=function(e){function t(){return e.call(this,{bindingevents:1.1,compressedfile:1.1,customxmlparts:1.1,documentevents:1.1,file:1.1,htmlcoercion:1.1,matrixbindings:1.1,matrixcoercion:1.1,ooxmlcoercion:1.1,pdffile:1.1,selection:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1,textbindings:1.1,textcoercion:1.1,textfile:1.1,wordapi:1.1})||this}return __extends(t,e),t}(i);e.WordClientDefaultSetRequirement=l;var u=function(e){function t(){var t=e.call(this)||this;return t._addSetMap({customxmlparts:1.2,wordapi:1.2,imagecoercion:1.1}),t}return __extends(t,e),t}(l);e.WordClientV1DefaultSetRequirement=u;var d=function(e){function t(){return e.call(this,{activeview:1.1,compressedfile:1.1,documentevents:1.1,file:1.1,pdffile:1.1,selection:1.1,settings:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(i);e.PowerpointClientDefaultSetRequirement=d;var f=function(e){function t(){var t=e.call(this)||this;return t._addSetMap({imagecoercion:1.1}),t}return __extends(t,e),t}(d);e.PowerpointClientV1DefaultSetRequirement=f;var p=function(e){function t(){return e.call(this,{selection:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(i);e.ProjectClientDefaultSetRequirement=p;var h=function(e){function t(){return e.call(this,{bindingevents:1.1,documentevents:1.1,matrixbindings:1.1,matrixcoercion:1.1,selection:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1,textbindings:1.1,textcoercion:1.1,file:1.1})||this}return __extends(t,e),t}(i);e.ExcelWebDefaultSetRequirement=h;var m=function(e){function t(){return e.call(this,{compressedfile:1.1,documentevents:1.1,file:1.1,imagecoercion:1.1,matrixcoercion:1.1,ooxmlcoercion:1.1,pdffile:1.1,selection:1.1,settings:1.1,tablecoercion:1.1,textcoercion:1.1,textfile:1.1})||this}return __extends(t,e),t}(i);e.WordWebDefaultSetRequirement=m;var g=function(e){function t(){return e.call(this,{activeview:1.1,settings:1.1})||this}return __extends(t,e),t}(i);e.PowerpointWebDefaultSetRequirement=g;var y=function(e){function t(){return e.call(this,{mailbox:1.3})||this}return __extends(t,e),t}(i);e.OutlookWebDefaultSetRequirement=y;var O=function(e){function t(){return e.call(this,{activeview:1.1,documentevents:1.1,selection:1.1,settings:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(i);e.SwayWebDefaultSetRequirement=O;var v=function(e){function t(){return e.call(this,{bindingevents:1.1,partialtablebindings:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1})||this}return __extends(t,e),t}(i);e.AccessWebDefaultSetRequirement=v;var b=function(e){function t(){return e.call(this,{bindingevents:1.1,documentevents:1.1,matrixbindings:1.1,matrixcoercion:1.1,selection:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1,textbindings:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(i);e.ExcelIOSDefaultSetRequirement=b;var _=function(e){function t(){return e.call(this,{bindingevents:1.1,compressedfile:1.1,customxmlparts:1.1,documentevents:1.1,file:1.1,htmlcoercion:1.1,matrixbindings:1.1,matrixcoercion:1.1,ooxmlcoercion:1.1,pdffile:1.1,selection:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1,textbindings:1.1,textcoercion:1.1,textfile:1.1})||this}return __extends(t,e),t}(i);e.WordIOSDefaultSetRequirement=_;var S=function(e){function t(){var t=e.call(this)||this;return t._addSetMap({customxmlparts:1.2,wordapi:1.2}),t}return __extends(t,e),t}(_);e.WordIOSV1DefaultSetRequirement=S;var A=function(e){function t(){return e.call(this,{activeview:1.1,compressedfile:1.1,documentevents:1.1,file:1.1,pdffile:1.1,selection:1.1,settings:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(i);e.PowerpointIOSDefaultSetRequirement=A;var D=function(e){function t(){return e.call(this,{mailbox:1.1})||this}return __extends(t,e),t}(i);e.OutlookIOSDefaultSetRequirement=D;var C=function(){function e(){}return e.initializeOsfDda=function(){OSF.OUtil.setNamespace("Requirement",OSF.DDA)},e.getDefaultRequirementMatrix=function(t){this.initializeDefaultSetMatrix();var o=void 0,r=t.get_requirementMatrix();if(void 0!=r&&r.length>0&&"undefined"!==typeof JSON){var a=JSON.parse(t.get_requirementMatrix().toLowerCase());try{a.hasOwnProperty("dialogorigin")||(a.dialogorigin=1.1)}catch(e){}o=new n(new i(a))}else{var s=e.getClientFullVersionString(t);o=void 0!=e.DefaultSetArrayMatrix&&void 0!=e.DefaultSetArrayMatrix[s]?new n(e.DefaultSetArrayMatrix[s]):new n(new i({}))}return o},e.getDefaultDialogRequirementMatrix=function(e){var t=void 0,a=e.get_dialogRequirementMatrix();if(void 0!=a&&a.length>0&&"undefined"!==typeof JSON){var s=JSON.parse(e.get_requirementMatrix().toLowerCase());t=new i(s)}else{t=new o;var c=e.get_requirementMatrix();if(void 0!=c&&c.length>0&&"undefined"!==typeof JSON){s=JSON.parse(c.toLowerCase());for(var l in t._sets)s.hasOwnProperty(l)&&(t._sets[l]=s[l]);var u=new r;for(var l in u._sets)s.hasOwnProperty(l)&&(t._sets[l]=s[l])}}try{!t._sets.hasOwnProperty("dialogorigin")&&window.opener&&(t._sets.dialogorigin=1.1)}catch(e){}return new n(t)},e.getClientFullVersionString=function(e){var t=e.get_appMinorVersion(),n="",i="",o=e.get_appName();return(1024==o||4096==o||8192==o||65536==o)&&1==e.get_appVersion()?i=4096==o&&t>=15?"16.00.01":"16.00":64==e.get_appName()?i=e.get_appVersion():(n=t<10?"0"+t:""+t,i=e.get_appVersion()+"."+n),e.get_appName()+"-"+i},e.initializeDefaultSetMatrix=function(){e.DefaultSetArrayMatrix[e.Excel_RCLIENT_1600]=new a,e.DefaultSetArrayMatrix[e.Word_RCLIENT_1600]=new l,e.DefaultSetArrayMatrix[e.PowerPoint_RCLIENT_1600]=new d,e.DefaultSetArrayMatrix[e.Excel_RCLIENT_1601]=new s,e.DefaultSetArrayMatrix[e.Word_RCLIENT_1601]=new u,e.DefaultSetArrayMatrix[e.PowerPoint_RCLIENT_1601]=new f,e.DefaultSetArrayMatrix[e.Outlook_RCLIENT_1600]=new c,e.DefaultSetArrayMatrix[e.Excel_WAC_1600]=new h,e.DefaultSetArrayMatrix[e.Word_WAC_1600]=new m,e.DefaultSetArrayMatrix[e.Outlook_WAC_1600]=new y,e.DefaultSetArrayMatrix[e.Outlook_WAC_1601]=new y,e.DefaultSetArrayMatrix[e.Project_RCLIENT_1600]=new p,e.DefaultSetArrayMatrix[e.Access_WAC_1600]=new v,e.DefaultSetArrayMatrix[e.PowerPoint_WAC_1600]=new g,e.DefaultSetArrayMatrix[e.Excel_IOS_1600]=new b,e.DefaultSetArrayMatrix[e.SWAY_WAC_1600]=new O,e.DefaultSetArrayMatrix[e.Word_IOS_1600]=new _,e.DefaultSetArrayMatrix[e.Word_IOS_16001]=new S,e.DefaultSetArrayMatrix[e.PowerPoint_IOS_1600]=new A,e.DefaultSetArrayMatrix[e.Outlook_IOS_1600]=new D},e.Excel_RCLIENT_1600="1-16.00",e.Excel_RCLIENT_1601="1-16.01",e.Word_RCLIENT_1600="2-16.00",e.Word_RCLIENT_1601="2-16.01",e.PowerPoint_RCLIENT_1600="4-16.00",e.PowerPoint_RCLIENT_1601="4-16.01",e.Outlook_RCLIENT_1600="8-16.00",e.Excel_WAC_1600="16-16.00",e.Word_WAC_1600="32-16.00",e.Outlook_WAC_1600="64-16.00",e.Outlook_WAC_1601="64-16.01",e.Project_RCLIENT_1600="128-16.00",e.Access_WAC_1600="256-16.00",e.PowerPoint_WAC_1600="512-16.00",e.Excel_IOS_1600="1024-16.00",e.SWAY_WAC_1600="2048-16.00",e.Word_IOS_1600="4096-16.00",e.Word_IOS_16001="4096-16.00.01",e.PowerPoint_IOS_1600="8192-16.00",e.Outlook_IOS_1600="65536-16.00",e.DefaultSetArrayMatrix={},e}();e.RequirementsMatrixFactory=C}(e.Requirement||(e.Requirement={}))}(OfficeExt||(OfficeExt={})),OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda(),Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"},Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"},OSF.NamespaceManager=function(){var e,t=!1;return{enableShortcut:function(){t||(window.Office?e=window.Office:OSF.OUtil.setNamespace("Office",window),window.Office=Microsoft.Office.WebExtension,t=!0)},disableShortcut:function(){t&&(e?window.Office=e:OSF.OUtil.unsetNamespace("Office",window),t=!1)}}}(),OSF.NamespaceManager.enableShortcut(),Microsoft.Office.WebExtension.useShortNamespace=function(e){e?OSF.NamespaceManager.enableShortcut():OSF.NamespaceManager.disableShortcut()},Microsoft.Office.WebExtension.select=function(e,t){var n;if(e&&"string"==typeof e){var i=e.indexOf("#");if(-1!=i){var o=e.substring(0,i),r=e.substring(i+1);switch(o){case"binding":case"bindings":r&&(n=new OSF.DDA.BindingPromise(r))}}}if(n)return n.onFail=t,n;if(t){var a=typeof t;if("function"!=a)throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,a);var s={};s[Microsoft.Office.WebExtension.Parameters.Callback]=t,OSF.DDA.issueAsyncResult(s,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))}},OSF.DDA.Context=function(e,t,n,i,o){if(OSF.OUtil.defineEnumerableProperties(this,{contentLanguage:{value:e.get_dataLocale()},displayLanguage:{value:e.get_appUILocale()},touchEnabled:{value:e.get_touchEnabled()},commerceAllowed:{value:e.get_commerceAllowed()},host:{value:OfficeExt.HostName.Host.getInstance().getHost()},platform:{value:OfficeExt.HostName.Host.getInstance().getPlatform()},isDialog:{value:OSF._OfficeAppFactory.getHostInfo().isDialog},diagnostics:{value:OfficeExt.HostName.Host.getInstance().getDiagnostics(e.get_hostFullVersion())}}),n&&OSF.OUtil.defineEnumerableProperty(this,"license",{value:n}),e.ui&&OSF.OUtil.defineEnumerableProperty(this,"ui",{value:e.ui}),e.auth&&OSF.OUtil.defineEnumerableProperty(this,"auth",{value:e.auth}),e.webAuth&&OSF.OUtil.defineEnumerableProperty(this,"webAuth",{value:e.webAuth}),e.application&&OSF.OUtil.defineEnumerableProperty(this,"application",{value:e.application}),e.extensionLifeCycle&&OSF.OUtil.defineEnumerableProperty(this,"extensionLifeCycle",{value:e.extensionLifeCycle}),e.messaging&&OSF.OUtil.defineEnumerableProperty(this,"messaging",{value:e.messaging}),e.ui&&e.ui.taskPaneAction&&OSF.OUtil.defineEnumerableProperty(this,"taskPaneAction",{value:e.ui.taskPaneAction}),e.ui&&e.ui.ribbonGallery&&OSF.OUtil.defineEnumerableProperty(this,"ribbonGallery",{value:e.ui.ribbonGallery}),e.get_isDialog()){var r=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultDialogRequirementMatrix(e);OSF.OUtil.defineEnumerableProperty(this,"requirements",{value:r})}else{if(t&&OSF.OUtil.defineEnumerableProperty(this,"document",{value:t}),i){var a=i.displayName||"appOM";delete i.displayName,OSF.OUtil.defineEnumerableProperty(this,a,{value:i})}e.get_officeTheme()?OSF.OUtil.defineEnumerableProperty(this,"officeTheme",{get:function(){return e.get_officeTheme()}}):o&&OSF.OUtil.defineEnumerableProperty(this,"officeTheme",{get:function(){return o()}});r=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(e);OSF.OUtil.defineEnumerableProperty(this,"requirements",{value:r})}},OSF.DDA.OutlookContext=function(e,t,n,i,o){OSF.DDA.OutlookContext.uber.constructor.call(this,e,null,n,i,o),t&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:t})},OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context),OSF.DDA.OutlookAppOm=function(e,t,n){},OSF.DDA.Application=function(e){},OSF.DDA.Document=function(e,t){var n;switch(e.get_clientMode()){case OSF.ClientMode.ReadOnly:n=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:n=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}t&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:t}),OSF.OUtil.defineMutableProperties(this,{mode:{value:n},url:{value:e.get_docUrl()}})},OSF.DDA.JsomDocument=function(e,t,n){OSF.DDA.JsomDocument.uber.constructor.call(this,e,n),t&&OSF.OUtil.defineEnumerableProperty(this,"bindings",{get:function(){return t}});var i=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[i.GetSelectedDataAsync,i.SetSelectedDataAsync]),OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))},OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document),OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{get:function(){var e;return OSF&&OSF._OfficeAppFactory&&(e=OSF._OfficeAppFactory.getContext()),e}}),OSF.DDA.License=function(e){OSF.OUtil.defineEnumerableProperty(this,"value",{value:e})},OSF.DDA.ApiMethodCall=function(e,t,n,i,o){var r=e.length,a=OSF.OUtil.delayExecutionAndCache((function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,o)}));this.verifyArguments=function(e,t){for(var n in e){var i=e[n],o=t[n];if(i.enum)switch(typeof o){case"string":if(OSF.OUtil.listContainsValue(i.enum,o))break;case"undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;default:throw a()}if(i.types&&!OSF.OUtil.listContainsValue(i.types,typeof o))throw a()}},this.extractRequiredArguments=function(t,n,i){if(t.length<r)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments);var o,s=[];for(o=0;o<r;o++)s.push(t[o]);this.verifyArguments(e,s);var c={};for(o=0;o<r;o++){var l=e[o],u=s[o];if(l.verify)if(!l.verify(u,n,i))throw a();c[l.name]=u}return c},this.fillOptions=function(e,n,i,o){for(var r in e=e||{},t)if(!OSF.OUtil.listContainsKey(e,r)){var a=void 0,s=t[r];s.calculate&&n&&(a=s.calculate(n,i,o)),a||void 0===s.defaultValue||(a=s.defaultValue),e[r]=a}return e},this.constructCallArgs=function(e,t,o,r){var a={};for(var s in e)a[s]=e[s];for(var c in t)a[c]=t[c];for(var l in n)a[l]=n[l](o,r);return i&&(a=i(a,o,r)),a}},OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA),OSF.DDA.AsyncResultEnum.Properties={Context:"Context",Value:"Value",Status:"Status",Error:"Error"},Microsoft.Office.WebExtension.AsyncResultStatus={Succeeded:"succeeded",Failed:"failed"},OSF.DDA.AsyncResultEnum.ErrorCode={Success:0,Failed:1},OSF.DDA.AsyncResultEnum.ErrorProperties={Name:"Name",Message:"Message",Code:"Code"},OSF.DDA.AsyncMethodNames={},OSF.DDA.AsyncMethodNames.addNames=function(e){for(var t in e){var n={};OSF.OUtil.defineEnumerableProperties(n,{id:{value:t},displayName:{value:e[t]}}),OSF.DDA.AsyncMethodNames[t]=n}},OSF.DDA.AsyncMethodCall=function(e,t,n,i,o,r,a){var s=e.length,c=new OSF.DDA.ApiMethodCall(e,t,n,r,a);this.verifyAndExtractCall=function(e,n,i){var o=c.extractRequiredArguments(e,n,i),r=function(e,n,i,o){if(e.length>s+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var r,a,l=e.length-1;l>=s;l--){var u=e[l];switch(typeof u){case"object":if(r)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);r=u;break;case"function":if(a)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);a=u;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument)}}if(r=c.fillOptions(r,n,i,o),a){if(r[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;r[Microsoft.Office.WebExtension.Parameters.Callback]=a}return c.verifyArguments(t,r),r}(e,o,n,i);return c.constructCallArgs(o,r,n,i)},this.processResponse=function(e,t,n,r){return e==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess?i?i(t,n,r):t:o?o(e,t):OSF.DDA.ErrorCodeManager.getErrorArgs(e)},this.getCallArgs=function(e){for(var t,n,i=e.length-1;i>=s;i--){var o=e[i];switch(typeof o){case"object":t=o;break;case"function":n=o}}return t=t||{},n&&(t[Microsoft.Office.WebExtension.Parameters.Callback]=n),t}},OSF.DDA.AsyncMethodCallFactory=function(){return{manufacture:function(e){var t=e.supportedOptions?OSF.OUtil.createObject(e.supportedOptions):[],n=e.privateStateCallbacks?OSF.OUtil.createObject(e.privateStateCallbacks):[];return new OSF.DDA.AsyncMethodCall(e.requiredArguments||[],t,n,e.onSucceeded,e.onFailed,e.checkCallArgs,e.method.displayName)}}}(),OSF.DDA.AsyncMethodCalls={},OSF.DDA.AsyncMethodCalls.define=function(e){OSF.DDA.AsyncMethodCalls[e.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(e)},OSF.DDA.Error=function(e,t,n){OSF.OUtil.defineEnumerableProperties(this,{name:{value:e},message:{value:t},code:{value:n}})},OSF.DDA.AsyncResult=function(e,t){OSF.OUtil.defineEnumerableProperties(this,{value:{value:e[OSF.DDA.AsyncResultEnum.Properties.Value]},status:{value:t?Microsoft.Office.WebExtension.AsyncResultStatus.Failed:Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded}}),e[OSF.DDA.AsyncResultEnum.Properties.Context]&&OSF.OUtil.defineEnumerableProperty(this,"asyncContext",{value:e[OSF.DDA.AsyncResultEnum.Properties.Context]}),t&&OSF.OUtil.defineEnumerableProperty(this,"error",{value:new OSF.DDA.Error(t[OSF.DDA.AsyncResultEnum.ErrorProperties.Name],t[OSF.DDA.AsyncResultEnum.ErrorProperties.Message],t[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])})},OSF.DDA.issueAsyncResult=function(e,t,n){var i=e[Microsoft.Office.WebExtension.Parameters.Callback];if(i){var o,r={};r[OSF.DDA.AsyncResultEnum.Properties.Context]=e[Microsoft.Office.WebExtension.Parameters.AsyncContext],t==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess?r[OSF.DDA.AsyncResultEnum.Properties.Value]=n:(o={},n=n||OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError),o[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=t||OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError,o[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=n.name||n,o[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=n.message||n),i(new OSF.DDA.AsyncResult(r,o))}},OSF.DDA.SyncMethodNames={},OSF.DDA.SyncMethodNames.addNames=function(e){for(var t in e){var n={};OSF.OUtil.defineEnumerableProperties(n,{id:{value:t},displayName:{value:e[t]}}),OSF.DDA.SyncMethodNames[t]=n}},OSF.DDA.SyncMethodCall=function(e,t,n,i,o){var r=e.length,a=new OSF.DDA.ApiMethodCall(e,t,n,i,o);this.verifyAndExtractCall=function(e,n,i){var o=a.extractRequiredArguments(e,n,i),s=function(e,n,i,o){if(e.length>r+1)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var s,c=e.length-1;c>=r;c--){var l=e[c];switch(typeof l){case"object":if(s)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);s=l;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument)}}return s=a.fillOptions(s,n,i,o),a.verifyArguments(t,s),s}(e,o,n,i);return a.constructCallArgs(o,s,n,i)}},OSF.DDA.SyncMethodCallFactory=function(){return{manufacture:function(e){var t=e.supportedOptions?OSF.OUtil.createObject(e.supportedOptions):[];return new OSF.DDA.SyncMethodCall(e.requiredArguments||[],t,e.privateStateCallbacks,e.checkCallArgs,e.method.displayName)}}}(),OSF.DDA.SyncMethodCalls={},OSF.DDA.SyncMethodCalls.define=function(e){OSF.DDA.SyncMethodCalls[e.method.id]=OSF.DDA.SyncMethodCallFactory.manufacture(e)},OSF.DDA.ListType=function(){var e={};return{setListType:function(t,n){e[t]=n},isListType:function(t){return OSF.OUtil.listContainsKey(e,t)},getDescriptor:function(t){return e[t]}}}(),OSF.DDA.HostParameterMap=function(e,t){var n={};function i(o,r){var a=o?{}:void 0;for(var s in o){var c,l=o[s];if(OSF.DDA.ListType.isListType(s))for(var u in c=[],l)c.push(i(l[u],r));else if(OSF.OUtil.listContainsKey(n,s))c=n[s][r](l);else if("fromHost"==r&&e.preserveNesting(s))c=i(l,r);else{var d=t[s];if(d){var f=d[r];f&&void 0===(c=f[l])&&(c=l)}else c=l}a[s]=c}return a}function o(n,o,r){var a,s=t[n][r];if("toHost"==r)a=function n(i,o){var r;for(var a in o){var s;if(void 0!=(s=e.isComplexType(a)?n(i,t[a].toHost):i[a])){r||(r={});var c=o[a];"self"==c&&(c=a),r[c]=e.pack(a,s)}}return r}(i(o,r),s);else if("fromHost"==r){a=i(function n(i,o,r){for(var a in r||(r={}),o){var s,c,l=o[a];if("self"==l)s=i;else{if("sourceData"==l){r[a]=i.toArray();continue}s=i[l]}if(null===s||void 0===s)r[a]=void 0;else if(s=e.unpack(a,s),e.isComplexType(a))c=t[a].fromHost,e.preserveNesting(a)?r[a]=n(s,c):n(s,c,r);else if(OSF.DDA.ListType.isListType(a)){(c={})[OSF.DDA.ListType.getDescriptor(a)]="self";var u=new Array(s.length);for(var d in s)u[d]=n(s[d],c);r[a]=u}else r[a]=s}return r}(o,s),r)}return a}n[Microsoft.Office.WebExtension.Parameters.Data]={toHost:function(e){if(null!=e&&void 0!==e.rows){var t={};t[OSF.DDA.TableDataProperties.TableRows]=e.rows,t[OSF.DDA.TableDataProperties.TableHeaders]=e.headers,e=t}return e},fromHost:function(e){return e}},n[Microsoft.Office.WebExtension.Parameters.SampleData]=n[Microsoft.Office.WebExtension.Parameters.Data],t||(t={}),this.addMapping=function(e,n){var i,o;if(n.map)for(var r in o={},i=n.map){var a=i[r];"self"==a&&(a=r),o[a]=r}else i=n.toHost,o=n.fromHost;var s=t[e];if(s){var c=s.toHost;for(var l in c)i[l]=c[l];for(var u in c=s.fromHost)o[u]=c[u]}else s=t[e]={};s.toHost=i,s.fromHost=o},this.toHost=function(e,t){return o(e,t,"toHost")},this.fromHost=function(e,t){return o(e,t,"fromHost")},this.self="self",this.sourceData="sourceData",this.addComplexType=function(t){e.addComplexType(t)},this.getDynamicType=function(t){return e.getDynamicType(t)},this.setDynamicType=function(t,n){e.setDynamicType(t,n)},this.dynamicTypes=n,this.doMapValues=function(e,t){return i(e,t)}},OSF.DDA.SpecialProcessor=function(e,t){this.addComplexType=function(t){e.push(t)},this.getDynamicType=function(e){return t[e]},this.setDynamicType=function(e,n){t[e]=n},this.isComplexType=function(t){return OSF.OUtil.listContainsValue(e,t)},this.isDynamicType=function(e){return OSF.OUtil.listContainsKey(t,e)},this.preserveNesting=function(e){var t=[];return OSF.DDA.PropertyDescriptors&&t.push(OSF.DDA.PropertyDescriptors.Subset),OSF.DDA.DataNodeEventProperties&&(t=t.concat([OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode])),OSF.OUtil.listContainsValue(t,e)},this.pack=function(e,n){return this.isDynamicType(e)?t[e].toHost(n):n},this.unpack=function(e,n){return this.isDynamicType(e)?t[e].fromHost(n):n}},OSF.DDA.getDecoratedParameterMap=function(e,t){var n=new OSF.DDA.HostParameterMap(e);n.self;function i(e){var t=null;if(e){t={};for(var n=e.length,i=0;i<n;i++)t[e[i].name]=e[i].value}return t}for(var o in n.define=function(e){var t={},o=i(e.toHost);e.invertible?t.map=o:e.canonical?t.toHost=t.fromHost=o:(t.toHost=o,t.fromHost=i(e.fromHost)),n.addMapping(e.type,t),e.isComplexType&&n.addComplexType(e.type)},t)n.define(t[o]);return n},OSF.OUtil.setNamespace("DispIdHost",OSF.DDA),OSF.DDA.DispIdHost.Methods={InvokeMethod:"invokeMethod",AddEventHandler:"addEventHandler",RemoveEventHandler:"removeEventHandler",OpenDialog:"openDialog",CloseDialog:"closeDialog",MessageParent:"messageParent",SendMessage:"sendMessage"},OSF.DDA.DispIdHost.Delegates={ExecuteAsync:"executeAsync",RegisterEventAsync:"registerEventAsync",UnregisterEventAsync:"unregisterEventAsync",ParameterMap:"parameterMap",OpenDialog:"openDialog",CloseDialog:"closeDialog",MessageParent:"messageParent",SendMessage:"sendMessage"},OSF.DDA.DispIdHost.Facade=function(e,t){var n={},i=OSF.DDA.AsyncMethodNames,o=OSF.DDA.MethodDispId,r={GoToByIdAsync:o.dispidNavigateToMethod,GetSelectedDataAsync:o.dispidGetSelectedDataMethod,SetSelectedDataAsync:o.dispidSetSelectedDataMethod,GetDocumentCopyChunkAsync:o.dispidGetDocumentCopyChunkMethod,ReleaseDocumentCopyAsync:o.dispidReleaseDocumentCopyMethod,GetDocumentCopyAsync:o.dispidGetDocumentCopyMethod,AddFromSelectionAsync:o.dispidAddBindingFromSelectionMethod,AddFromPromptAsync:o.dispidAddBindingFromPromptMethod,AddFromNamedItemAsync:o.dispidAddBindingFromNamedItemMethod,GetAllAsync:o.dispidGetAllBindingsMethod,GetByIdAsync:o.dispidGetBindingMethod,ReleaseByIdAsync:o.dispidReleaseBindingMethod,GetDataAsync:o.dispidGetBindingDataMethod,SetDataAsync:o.dispidSetBindingDataMethod,AddRowsAsync:o.dispidAddRowsMethod,AddColumnsAsync:o.dispidAddColumnsMethod,DeleteAllDataValuesAsync:o.dispidClearAllRowsMethod,RefreshAsync:o.dispidLoadSettingsMethod,SaveAsync:o.dispidSaveSettingsMethod,GetActiveViewAsync:o.dispidGetActiveViewMethod,GetFilePropertiesAsync:o.dispidGetFilePropertiesMethod,GetOfficeThemeAsync:o.dispidGetOfficeThemeMethod,GetDocumentThemeAsync:o.dispidGetDocumentThemeMethod,ClearFormatsAsync:o.dispidClearFormatsMethod,SetTableOptionsAsync:o.dispidSetTableOptionsMethod,SetFormatsAsync:o.dispidSetFormatsMethod,GetAccessTokenAsync:o.dispidGetAccessTokenMethod,GetAuthContextAsync:o.dispidGetAuthContextMethod,ExecuteRichApiRequestAsync:o.dispidExecuteRichApiRequestMethod,AppCommandInvocationCompletedAsync:o.dispidAppCommandInvocationCompletedMethod,CloseContainerAsync:o.dispidCloseContainerMethod,OpenBrowserWindow:o.dispidOpenBrowserWindow,CreateDocumentAsync:o.dispidCreateDocumentMethod,InsertFormAsync:o.dispidInsertFormMethod,ExecuteFeature:o.dispidExecuteFeature,QueryFeature:o.dispidQueryFeature,AddDataPartAsync:o.dispidAddDataPartMethod,GetDataPartByIdAsync:o.dispidGetDataPartByIdMethod,GetDataPartsByNameSpaceAsync:o.dispidGetDataPartsByNamespaceMethod,GetPartXmlAsync:o.dispidGetDataPartXmlMethod,GetPartNodesAsync:o.dispidGetDataPartNodesMethod,DeleteDataPartAsync:o.dispidDeleteDataPartMethod,GetNodeValueAsync:o.dispidGetDataNodeValueMethod,GetNodeXmlAsync:o.dispidGetDataNodeXmlMethod,GetRelativeNodesAsync:o.dispidGetDataNodesMethod,SetNodeValueAsync:o.dispidSetDataNodeValueMethod,SetNodeXmlAsync:o.dispidSetDataNodeXmlMethod,AddDataPartNamespaceAsync:o.dispidAddDataNamespaceMethod,GetDataPartNamespaceAsync:o.dispidGetDataUriByPrefixMethod,GetDataPartPrefixAsync:o.dispidGetDataPrefixByUriMethod,GetNodeTextAsync:o.dispidGetDataNodeTextMethod,SetNodeTextAsync:o.dispidSetDataNodeTextMethod,GetSelectedTask:o.dispidGetSelectedTaskMethod,GetTask:o.dispidGetTaskMethod,GetWSSUrl:o.dispidGetWSSUrlMethod,GetTaskField:o.dispidGetTaskFieldMethod,GetSelectedResource:o.dispidGetSelectedResourceMethod,GetResourceField:o.dispidGetResourceFieldMethod,GetProjectField:o.dispidGetProjectFieldMethod,GetSelectedView:o.dispidGetSelectedViewMethod,GetTaskByIndex:o.dispidGetTaskByIndexMethod,GetResourceByIndex:o.dispidGetResourceByIndexMethod,SetTaskField:o.dispidSetTaskFieldMethod,SetResourceField:o.dispidSetResourceFieldMethod,GetMaxTaskIndex:o.dispidGetMaxTaskIndexMethod,GetMaxResourceIndex:o.dispidGetMaxResourceIndexMethod,CreateTask:o.dispidCreateTaskMethod};for(var a in r)i[a]&&(n[i[a].id]=r[a]);i=OSF.DDA.SyncMethodNames;var s={MessageParent:(o=OSF.DDA.MethodDispId).dispidMessageParentMethod,SendMessage:o.dispidSendMessageMethod};for(var a in s)i[a]&&(n[i[a].id]=s[a]);i=Microsoft.Office.WebExtension.EventType;var c={SettingsChanged:(o=OSF.DDA.EventDispId).dispidSettingsChangedEvent,DocumentSelectionChanged:o.dispidDocumentSelectionChangedEvent,BindingSelectionChanged:o.dispidBindingSelectionChangedEvent,BindingDataChanged:o.dispidBindingDataChangedEvent,ActiveViewChanged:o.dispidActiveViewChangedEvent,OfficeThemeChanged:o.dispidOfficeThemeChangedEvent,DocumentThemeChanged:o.dispidDocumentThemeChangedEvent,AppCommandInvoked:o.dispidAppCommandInvokedEvent,DialogMessageReceived:o.dispidDialogMessageReceivedEvent,DialogParentMessageReceived:o.dispidDialogParentMessageReceivedEvent,ObjectDeleted:o.dispidObjectDeletedEvent,ObjectSelectionChanged:o.dispidObjectSelectionChangedEvent,ObjectDataChanged:o.dispidObjectDataChangedEvent,ContentControlAdded:o.dispidContentControlAddedEvent,RichApiMessage:o.dispidRichApiMessageEvent,ItemChanged:o.dispidOlkItemSelectedChangedEvent,RecipientsChanged:o.dispidOlkRecipientsChangedEvent,AppointmentTimeChanged:o.dispidOlkAppointmentTimeChangedEvent,RecurrenceChanged:o.dispidOlkRecurrenceChangedEvent,AttachmentsChanged:o.dispidOlkAttachmentsChangedEvent,EnhancedLocationsChanged:o.dispidOlkEnhancedLocationsChangedEvent,InfobarClicked:o.dispidOlkInfobarClickedEvent,TaskSelectionChanged:o.dispidTaskSelectionChangedEvent,ResourceSelectionChanged:o.dispidResourceSelectionChangedEvent,ViewSelectionChanged:o.dispidViewSelectionChangedEvent,DataNodeInserted:o.dispidDataNodeAddedEvent,DataNodeReplaced:o.dispidDataNodeReplacedEvent,DataNodeDeleted:o.dispidDataNodeDeletedEvent};for(var l in c)i[l]&&(n[i[l]]=c[l]);function u(e){return e==OSF.DDA.EventDispId.dispidObjectDeletedEvent||e==OSF.DDA.EventDispId.dispidObjectSelectionChangedEvent||e==OSF.DDA.EventDispId.dispidObjectDataChangedEvent||e==OSF.DDA.EventDispId.dispidContentControlAddedEvent}function d(e,t,n,i){if("number"!=typeof e)throw e;i||(i=t.getCallArgs(n)),OSF.DDA.issueAsyncResult(i,e,OSF.DDA.ErrorCodeManager.getErrorArgs(e))}this[OSF.DDA.DispIdHost.Methods.InvokeMethod]=function(i,o,r,a){var s;try{var c=i.id,l=OSF.DDA.AsyncMethodCalls[c];s=l.verifyAndExtractCall(o,r,a);var u=n[c],f=e(c),p=null;if(window.Excel&&window.Office.context.requirements.isSetSupported("RedirectV1Api")&&(window.Excel._RedirectV1APIs=!0),window.Excel&&window.Excel._RedirectV1APIs&&(p=window.Excel._V1APIMap[c])){var h=OSF.OUtil.shallowCopy(s);delete h[Microsoft.Office.WebExtension.Parameters.AsyncContext],p.preprocess&&(h=p.preprocess(h));var m=new window.Excel.RequestContext,g=p.call(m,h);m.sync().then((function(){var e=g.value,t=e.status;delete e.status,delete e["@odata.type"],p.postprocess&&(e=p.postprocess(e,h)),0!=t&&(e=OSF.DDA.ErrorCodeManager.getErrorArgs(t)),OSF.DDA.issueAsyncResult(s,t,e)})).catch((function(e){OSF.DDA.issueAsyncResult(s,OSF.DDA.ErrorCodeManager.errorCodes.ooeFailure,null)}))}else{var y;y=t.toHost?t.toHost(u,s):s;var O=(new Date).getTime();f[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({dispId:u,hostCallArgs:y,onCalling:function(){},onReceiving:function(){},onComplete:function(e,n){var i;i=e==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess&&t.fromHost?t.fromHost(u,n):n;var o=l.processResponse(e,i,r,s);OSF.DDA.issueAsyncResult(s,e,o),!OSF.AppTelemetry||OSF.ConstantNames&&OSF.ConstantNames.IsCustomFunctionsRuntime||OSF.AppTelemetry.onMethodDone(u,y,Math.abs((new Date).getTime()-O),e)}})}}catch(e){d(e,l,o,s)}},this[OSF.DDA.DispIdHost.Methods.AddEventHandler]=function(i,o,r,a){var s,c,l,f=!1;function p(e){var t;e==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess&&((f?o.addObjectEventHandler(c,s[Microsoft.Office.WebExtension.Parameters.Id],l):o.addEventHandler(c,l))||(e=OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed));e!=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess&&(t=OSF.DDA.ErrorCodeManager.getErrorArgs(e)),OSF.DDA.issueAsyncResult(s,e,t)}try{var h=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id];if(s=h.verifyAndExtractCall(i,r,o),c=s[Microsoft.Office.WebExtension.Parameters.EventType],l=s[Microsoft.Office.WebExtension.Parameters.Handler],a)return void p(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);var m=n[c],g=(f=u(m))?s[Microsoft.Office.WebExtension.Parameters.Id]:r.id||"";if(0==(f?o.getObjectEventHandlerCount(c,g):o.getEventHandlerCount(c)))(0,e(c)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync])({eventType:c,dispId:m,targetId:g,onCalling:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)},onReceiving:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)},onComplete:p,onEvent:function(e){var n=t.fromHost(m,e);f?o.fireObjectEvent(g,OSF.DDA.OMFactory.manufactureEventArgs(c,g,n)):o.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(c,r,n))}});else p(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)}catch(e){d(e,h,i,s)}},this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]=function(t,i,o){var r,a,s,c=!1;function l(e){var t;e!=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess&&(t=OSF.DDA.ErrorCodeManager.getErrorArgs(e)),OSF.DDA.issueAsyncResult(r,e,t)}try{var f=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id];a=(r=f.verifyAndExtractCall(t,o,i))[Microsoft.Office.WebExtension.Parameters.EventType],s=r[Microsoft.Office.WebExtension.Parameters.Handler];var p,h,m=n[a],g=(c=u(m))?r[Microsoft.Office.WebExtension.Parameters.Id]:o.id||"";null===s?(h=c?i.clearObjectEventHandlers(a,g):i.clearEventHandlers(a),p=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess):p=(h=c?i.removeObjectEventHandler(a,g,s):i.removeEventHandler(a,s))?OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess:OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist;var y=c?i.getObjectEventHandlerCount(a,g):i.getEventHandlerCount(a);if(h&&0==y)(0,e(a)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync])({eventType:a,dispId:m,targetId:g,onCalling:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)},onReceiving:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)},onComplete:l});else l(p)}catch(e){d(e,f,t,r)}},this[OSF.DDA.DispIdHost.Methods.OpenDialog]=function(i,o,r){var a,s,c=Microsoft.Office.WebExtension.EventType.DialogMessageReceived,l=Microsoft.Office.WebExtension.EventType.DialogEventReceived;function u(e){if(e!=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)n=OSF.DDA.ErrorCodeManager.getErrorArgs(e);else{var t={};t[Microsoft.Office.WebExtension.Parameters.Id]=s,t[Microsoft.Office.WebExtension.Parameters.Data]=o;var n=f.processResponse(e,t,r,a);OSF.DialogShownStatus.hasDialogShown=!0,o.clearEventHandlers(c),o.clearEventHandlers(l)}OSF.DDA.issueAsyncResult(a,e,n)}try{if(void 0!=c&&void 0!=l||u(OSF.DDA.ErrorCodeManager.ooeOperationNotSupported),null==OSF.DDA.AsyncMethodNames.DisplayDialogAsync)return void u(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);var f=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.DisplayDialogAsync.id];a=f.verifyAndExtractCall(i,r,o);var p=n[c],h=e(c),m=void 0!=h[OSF.DDA.DispIdHost.Delegates.OpenDialog]?h[OSF.DDA.DispIdHost.Delegates.OpenDialog]:h[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];s=JSON.stringify(a),OSF.DialogShownStatus.hasDialogShown||(o.clearQueuedEvent(c),o.clearQueuedEvent(l),o.clearQueuedEvent(Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived)),m({eventType:c,dispId:p,targetId:s,onCalling:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)},onReceiving:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)},onComplete:u,onEvent:function(e){var n=t.fromHost(p,e),i=OSF.DDA.OMFactory.manufactureEventArgs(c,r,n);if(i.type==l){var a=OSF.DDA.ErrorCodeManager.getErrorArgs(i.error),s={};s[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status||OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError,s[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=a.name||a,s[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=a.message||a,i.error=new OSF.DDA.Error(s[OSF.DDA.AsyncResultEnum.ErrorProperties.Name],s[OSF.DDA.AsyncResultEnum.ErrorProperties.Message],s[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])}o.fireOrQueueEvent(i),n[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogClosed&&(o.clearEventHandlers(c),o.clearEventHandlers(l),o.clearEventHandlers(Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived),OSF.DialogShownStatus.hasDialogShown=!1)}})}catch(e){d(e,f,i,a)}},this[OSF.DDA.DispIdHost.Methods.CloseDialog]=function(t,i,o,r){var a,s,c,l=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;try{var u=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.CloseAsync.id];a=u.verifyAndExtractCall(t,r,o),s=Microsoft.Office.WebExtension.EventType.DialogMessageReceived,c=Microsoft.Office.WebExtension.EventType.DialogEventReceived,o.clearEventHandlers(s),o.clearEventHandlers(c);var f=n[s],p=e(s);(void 0!=p[OSF.DDA.DispIdHost.Delegates.CloseDialog]?p[OSF.DDA.DispIdHost.Delegates.CloseDialog]:p[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync])({eventType:s,dispId:f,targetId:i,onCalling:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)},onReceiving:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)},onComplete:function(e){l=e,OSF.DialogShownStatus.hasDialogShown=!1}})}catch(e){d(e,u,t,a)}if(l!=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)throw OSF.OUtil.formatString(Strings.OfficeOM.L_FunctionCallFailed,OSF.DDA.AsyncMethodNames.CloseAsync.displayName,l)},this[OSF.DDA.DispIdHost.Methods.MessageParent]=function(t,i){var o=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.MessageParent.id].verifyAndExtractCall(t,i,{});return(0,e(OSF.DDA.SyncMethodNames.MessageParent.id)[OSF.DDA.DispIdHost.Delegates.MessageParent])({dispId:n[OSF.DDA.SyncMethodNames.MessageParent.id],hostCallArgs:o,onCalling:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)},onReceiving:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)}})},this[OSF.DDA.DispIdHost.Methods.SendMessage]=function(t,i,o){var r=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.SendMessage.id].verifyAndExtractCall(t,o,{});return(0,e(OSF.DDA.SyncMethodNames.SendMessage.id)[OSF.DDA.DispIdHost.Delegates.SendMessage])({dispId:n[OSF.DDA.SyncMethodNames.SendMessage.id],hostCallArgs:r,onCalling:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)},onReceiving:function(){OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)}})}},OSF.DDA.DispIdHost.addAsyncMethods=function(e,t,n){for(var i in t){var o=t[i],r=o.displayName;e[r]||OSF.OUtil.defineEnumerableProperty(e,r,{value:function(t){return function(){var i=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod];i(t,arguments,e,n)}}(o)})}},OSF.DDA.DispIdHost.addEventSupport=function(e,t,n){var i=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName,o=OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName;e[i]||OSF.OUtil.defineEnumerableProperty(e,i,{value:function(){var i=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler];i(arguments,t,e,n)}}),e[o]||OSF.OUtil.defineEnumerableProperty(e,o,{value:function(){var n=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler];n(arguments,t,e)}})},OSF.ShowWindowDialogParameterKeys={Url:"url",Width:"width",Height:"height",DisplayInIframe:"displayInIframe",HideTitle:"hideTitle",UseDeviceIndependentPixels:"useDeviceIndependentPixels",PromptBeforeOpen:"promptBeforeOpen",EnforceAppDomain:"enforceAppDomain",UrlNoHostInfo:"urlNoHostInfo"},OSF.HostThemeButtonStyleKeys={ButtonBorderColor:"buttonBorderColor",ButtonBackgroundColor:"buttonBackgroundColor"},OSF.OmexPageParameterKeys={AppName:"client",AppVersion:"cv",AppUILocale:"ui",AppDomain:"appDomain",StoreLocator:"rs",AssetId:"assetid",NotificationType:"notificationType",AppCorrelationId:"corr",AuthType:"authType",AppId:"appid",Scopes:"scopes"},OSF.AuthType={Anonymous:0,MSA:1,OrgId:2,ADAL:3},OSF.OmexMessageKeys={MessageType:"messageType",MessageValue:"messageValue"},OSF.OmexRemoveAddinMessageKeys={RemoveAddinResultCode:"resultCode",RemoveAddinResultValue:"resultValue"},OSF.OmexRemoveAddinResultCode={Success:0,ClientError:400,ServerError:500,UnknownError:600},function(e){!function(e){function t(e){if("undefined"!==typeof JSON)try{return JSON.stringify(e)}catch(e){}return""}function n(){try{var e=window.navigator.userAgent;return e.indexOf("MSIE ")>-1||e.indexOf("Trident/")>-1||e.indexOf("Edge/")>-1}catch(e){return i("Error happens in isInternetExplorer.",e),!1}}function i(e,n){OsfMsAjaxFactory.msAjaxDebug.trace(e+" Exception details: "+t(n))}e.parseAppContextFromWindowName=function(e,t){return OSF.OUtil.parseInfoFromWindowName(e,t,OSF.WindowNameItemKeys.AppContext)},e.serializeObjectToString=t,e.isHostTrusted=function(){return new RegExp("^https://[a-z0-9-]+.(officeapps.live|officeapps-df.live|partner.officewebapps).com/").test(OSF.getClientEndPoint()._targetUrl.toLowerCase())},e.addHostInfoAsQueryParam=function(e,t){if(!e)return null;var n,i="#",o=(e=e.trim()||"").split(i),r=o.shift(),a=o.join(i),s=r.split("?");return s.length>1?n=r+"&_host_Info="+t:s.length>0&&(n=r+"?_host_Info="+t),a?[n,i,a].join(""):n},e.getDomainForUrl=function(e){if(!e)return null;var t=document.createElement("a");return t.href=e,t.protocol+"//"+t.host},e.shouldUseLocalStorageToPassMessage=function(){try{for(var e=["Windows NT 6.1","Windows NT 6.2","Windows NT 6.3","Windows NT 10.0"],t=window.navigator.userAgent,o=0,r=e.length;o<r;o++)if(t.indexOf(e[o])>-1)return n();return!1}catch(e){return i("Error happens in shouldUseLocalStorageToPassMessage.",e),!1}},e.isInternetExplorer=n,e.removeMatchesFromLocalStorage=function(e){for(var t=OSF.OUtil.getLocalStorage(),n=t.getKeysWithPrefix(""),i=0,o=n.length;i<o;i++)for(var r=n[i],a=0,s=e.length;a<s;a++)if(e[a].test(r)){t.removeItem(r);break}},e.logExceptionToBrowserConsole=i,e.isTeamsWebView=function(){var e=navigator.userAgent;return/Teams\/((?:(\d+)\.)?(?:(\d+)\.)?(?:(\d+)\.\d+)).* Electron\/((?:(\d+)\.)?(?:(\d+)\.)?(?:(\d+)\.\d+))/.test(e)},e.getHostSecure=function(e){if("undefined"!==typeof e&&e){var t=void 0;try{var n=new URL(e);if(n&&(t=n.host),!n.protocol)throw"fallback";if("https:"!==n.protocol)return}catch(n){try{var i=document.createElement("a");if(i.href=e,"https:"!==i.protocol)return;var o=e.match(new RegExp("^https://[^/?#]+","i")),r=o&&1==o.length?o[0].toLowerCase():"",a=(i.protocol+"//"+i.hostname).toLowerCase();(i.protocol+"//"+i.host).toLowerCase()!==r&&a!=r||(t="443"==i.port?i.hostname:i.host)}catch(e){return}}return t?t.toLowerCase():void 0}};var o=function(){function e(){}return e.GatedCacheKeyPrefix="__OSF_GATED_OMEX.",e.AnonymousCacheKeyPrefix="__OSF_ANONYMOUS_OMEX.",e.UngatedCacheKeyPrefix="__OSF_OMEX.",e.ActivatedCacheKeyPrefix="__OSF_RUNTIME_.Activated.",e.AppinstallAuthenticated="appinstall_authenticated.",e.Entitlement="entitle.",e.AppState="appState.",e.AppDetails="appDetails.",e.AppInstallInfo="appInstallInfo.",e.AuthenticatedAppInstallInfoCacheKey=e.GatedCacheKeyPrefix+e.AppinstallAuthenticated+"{0}.{1}.{2}.{3}",e.EntitlementsKey=e.Entitlement+"{0}.{1}",e.AppStateCacheKey="{0}"+e.AppState+"{1}.{2}",e.AppDetailKey="{0}"+e.AppDetails+"{1}",e.AppInstallInfoKey="{0}"+e.AppInstallInfo+"{1}.{2}",e.ActivatedCacheKey=e.ActivatedCacheKeyPrefix+"{0}.{1}.{2}",e}();e.CacheConstants=o}(e.WACUtils||(e.WACUtils={}))}(OfficeExt||(OfficeExt={})),function(e){var t=function(){function e(){}return e.isInstanceOfType=function(e,t){if("undefined"===typeof t||null===t)return!1;if(t instanceof e)return!0;var n=t.constructor;return n&&"function"===typeof n&&n.__typeName&&"Object"!==n.__typeName||(n=Object),!(n!==e)||n.__typeName&&e.__typeName&&n.__typeName===e.__typeName},e}();e.MsAjaxTypeHelper=t;var n=function(){function e(){}return e.create=function(e,t){var n=new Error(e);if(n.message=e,t)for(var i in t)n[i]=t[i];return n.popStackFrame(),n},e.parameterCount=function(t){var n="Sys.ParameterCountException: "+(t||"Parameter count mismatch."),i=e.create(n,{name:"Sys.ParameterCountException"});return i.popStackFrame(),i},e.argument=function(t,n){var o="Sys.ArgumentException: "+(n||"Value does not fall within the expected range.");t&&(o+="\n"+i.format("Parameter name: {0}",t));var r=e.create(o,{name:"Sys.ArgumentException",paramName:t});return r.popStackFrame(),r},e.argumentNull=function(t,n){var o="Sys.ArgumentNullException: "+(n||"Value cannot be null.");t&&(o+="\n"+i.format("Parameter name: {0}",t));var r=e.create(o,{name:"Sys.ArgumentNullException",paramName:t});return r.popStackFrame(),r},e.argumentOutOfRange=function(t,n,o){var r="Sys.ArgumentOutOfRangeException: "+(o||"Specified argument was out of the range of valid values.");t&&(r+="\n"+i.format("Parameter name: {0}",t)),"undefined"!==typeof n&&null!==n&&(r+="\n"+i.format("Actual value was {0}.",n));var a=e.create(r,{name:"Sys.ArgumentOutOfRangeException",paramName:t,actualValue:n});return a.popStackFrame(),a},e.argumentType=function(t,n,o,r){var a="Sys.ArgumentTypeException: ";a+=r||(n&&o?i.format("Object of type '{0}' cannot be converted to type '{1}'.",n.getName?n.getName():n,o.getName?o.getName():o):"Object cannot be converted to the required type."),t&&(a+="\n"+i.format("Parameter name: {0}",t));var s=e.create(a,{name:"Sys.ArgumentTypeException",paramName:t,actualType:n,expectedType:o});return s.popStackFrame(),s},e.argumentUndefined=function(t,n){var o="Sys.ArgumentUndefinedException: "+(n||"Value cannot be undefined.");t&&(o+="\n"+i.format("Parameter name: {0}",t));var r=e.create(o,{name:"Sys.ArgumentUndefinedException",paramName:t});return r.popStackFrame(),r},e.invalidOperation=function(t){var n="Sys.InvalidOperationException: "+(t||"Operation is not valid due to the current state of the object."),i=e.create(n,{name:"Sys.InvalidOperationException"});return i.popStackFrame(),i},e}();e.MsAjaxError=n;var i=function(){function e(){}return e.format=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=e;return i.replace(/{(\d+)}/gm,(function(e,n){var i=parseInt(n,10);return void 0===t[i]?"{"+n+"}":t[i]}))},e.startsWith=function(e,t){return e.substr(0,t.length)===t},e}();e.MsAjaxString=i;var o=function(){function e(){}return e.trace=function(e){"undefined"!==typeof Debug&&Debug.writeln&&Debug.writeln(e),window.console&&window.console.log&&window.console.log(e),window.opera&&window.opera.postError&&window.opera.postError(e),window.debugService&&window.debugService.trace&&window.debugService.trace(e);var t=document.getElementById("TraceConsole");t&&"TEXTAREA"===t.tagName.toUpperCase()&&(t.innerHTML+=e+"\n")},e}();if(e.MsAjaxDebug=o,!OsfMsAjaxFactory.isMsAjaxLoaded()){var r=function(e,t,n){void 0!==e.__typeName&&null!==e.__typeName||(e.__typeName=t),void 0!==e.__class&&null!==e.__class||(e.__class=n)};r(Function,"Function",!0),r(Error,"Error",!0),r(Object,"Object",!0),r(String,"String",!0),r(Boolean,"Boolean",!0),r(Date,"Date",!0),r(Number,"Number",!0),r(RegExp,"RegExp",!0),r(Array,"Array",!0),Function.createCallback||(Function.createCallback=function(e,t){var n=Function._validateParams(arguments,[{name:"method",type:Function},{name:"context",mayBeNull:!0}]);if(n)throw n;return function(){var n=arguments.length;if(n>0){for(var i=[],o=0;o<n;o++)i[o]=arguments[o];return i[n]=t,e.apply(this,i)}return e.call(this,t)}}),Function.createDelegate||(Function.createDelegate=function(e,t){var n=Function._validateParams(arguments,[{name:"instance",mayBeNull:!0},{name:"method",type:Function}]);if(n)throw n;return function(){return t.apply(e,arguments)}}),Function._validateParams||(Function._validateParams=function(e,t,n){var i,o=t.length;if(n=n||"undefined"===typeof n,i=Function._validateParameterCount(e,t,n))return i.popStackFrame(),i;for(var r=0,a=e.length;r<a;r++){var s=t[Math.min(r,o-1)],c=s.name;if(s.parameterArray)c+="["+(r-o+1)+"]";else if(!n&&r>=o)break;if(i=Function._validateParameter(e[r],s,c))return i.popStackFrame(),i}return null}),Function._validateParameterCount||(Function._validateParameterCount=function(e,t,i){var o,r,a=t.length,s=e.length;if(s<a){var c=a;for(o=0;o<a;o++){var l=t[o];(l.optional||l.parameterArray)&&c--}s<c&&(r=!0)}else if(i&&s>a)for(r=!0,o=0;o<a;o++)if(t[o].parameterArray){r=!1;break}if(r){var u=n.parameterCount();return u.popStackFrame(),u}return null}),Function._validateParameter||(Function._validateParameter=function(e,t,n){var i,o=t.type,r=!!t.integer,a=!!t.domElement,s=!!t.mayBeNull;if(i=Function._validateParameterType(e,o,r,a,s,n))return i.popStackFrame(),i;var c=t.elementType,l=!!t.elementMayBeNull;if(o===Array&&"undefined"!==typeof e&&null!==e&&(c||!l))for(var u=!!t.elementInteger,d=!!t.elementDomElement,f=0;f<e.length;f++){var p=e[f];if(i=Function._validateParameterType(p,c,u,d,l,n+"["+f+"]"))return i.popStackFrame(),i}return null}),Function._validateParameterType||(Function._validateParameterType=function(t,n,i,o,r,a){var s;return"undefined"===typeof t?r?null:((s=e.MsAjaxError.argumentUndefined(a)).popStackFrame(),s):null===t?r?null:((s=e.MsAjaxError.argumentNull(a)).popStackFrame(),s):n&&!e.MsAjaxTypeHelper.isInstanceOfType(n,t)?((s=e.MsAjaxError.argumentType(a,typeof t,n)).popStackFrame(),s):null}),window.Type||(window.Type=Function),Type.registerNamespace||(Type.registerNamespace=function(e){for(var t=e.split("."),n=window,i=0;i<t.length;i++)n[t[i]]=n[t[i]]||{},n=n[t[i]]}),Type.prototype.registerClass||(Type.prototype.registerClass=function(e){({})}),"undefined"===typeof Sys&&Type.registerNamespace("Sys"),Error.prototype.popStackFrame||(Error.prototype.popStackFrame=function(){if(0!==arguments.length)throw n.parameterCount();if("undefined"!==typeof this.stack&&null!==this.stack&&"undefined"!==typeof this.fileName&&null!==this.fileName&&"undefined"!==typeof this.lineNumber&&null!==this.lineNumber){for(var e=this.stack.split("\n"),t=e[0],i=this.fileName+":"+this.lineNumber;"undefined"!==typeof t&&null!==t&&-1===t.indexOf(i);)e.shift(),t=e[0];var o=e[1];if("undefined"!==typeof o&&null!==o){var r=o.match(/@(.*):(\d+)$/);"undefined"!==typeof r&&null!==r&&(this.fileName=r[1],this.lineNumber=parseInt(r[2]),e.shift(),this.stack=e.join("\n"))}}}),OsfMsAjaxFactory.msAjaxError=n,OsfMsAjaxFactory.msAjaxString=i,OsfMsAjaxFactory.msAjaxDebug=o}}(OfficeExt||(OfficeExt={})),OSF.OUtil.setNamespace("Microsoft",window),OSF.OUtil.setNamespace("Office",Microsoft),OSF.OUtil.setNamespace("Common",Microsoft.Office),Microsoft.Office.Common.InvokeType={async:0,sync:1,asyncRegisterEvent:2,asyncUnregisterEvent:3,syncRegisterEvent:4,syncUnregisterEvent:5},OSF.SerializerVersion={MsAjax:0,Browser:1},function(e){e.appSpecificCheckOrigin=function(e,t,n,i){return!1}}(OfficeExt||(OfficeExt={})),Microsoft.Office.Common.InvokeType={async:0,sync:1,asyncRegisterEvent:2,asyncUnregisterEvent:3,syncRegisterEvent:4,syncUnregisterEvent:5},Microsoft.Office.Common.InvokeResultCode={noError:0,errorInRequest:-1,errorHandlingRequest:-2,errorInResponse:-3,errorHandlingResponse:-4,errorHandlingRequestAccessDenied:-5,errorHandlingMethodCallTimedout:-6},Microsoft.Office.Common.MessageType={request:0,response:1},Microsoft.Office.Common.ActionType={invoke:0,registerEvent:1,unregisterEvent:2},Microsoft.Office.Common.ResponseType={forCalling:0,forEventing:1},Microsoft.Office.Common.HostTrustStatus={unknown:0,untrusted:1,nothttps:2,trusted:3},Microsoft.Office.Common.MethodObject=function(e,t,n){this._method=e,this._invokeType=t,this._blockingOthers=n},Microsoft.Office.Common.MethodObject.prototype={getMethod:function(){return this._method},getInvokeType:function(){return this._invokeType},getBlockingFlag:function(){return this._blockingOthers}},Microsoft.Office.Common.EventMethodObject=function(e,t){this._registerMethodObject=e,this._unregisterMethodObject=t},Microsoft.Office.Common.EventMethodObject.prototype={getRegisterMethodObject:function(){return this._registerMethodObject},getUnregisterMethodObject:function(){return this._unregisterMethodObject}},Microsoft.Office.Common.ServiceEndPoint=function(e){var t=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:!1}]);if(t)throw t;this._methodObjectList={},this._eventHandlerProxyList={},this._Id=e,this._conversations={},this._policyManager=null,this._appDomains={},this._onHandleRequestError=null},Microsoft.Office.Common.ServiceEndPoint.prototype={registerMethod:function(e,t,n,i){var o=Function._validateParams(arguments,[{name:"methodName",type:String,mayBeNull:!1},{name:"method",type:Function,mayBeNull:!1},{name:"invokeType",type:Number,mayBeNull:!1},{name:"blockingOthers",type:Boolean,mayBeNull:!1}]);if(o)throw o;if(n!==Microsoft.Office.Common.InvokeType.async&&n!==Microsoft.Office.Common.InvokeType.sync)throw OsfMsAjaxFactory.msAjaxError.argument("invokeType");var r=new Microsoft.Office.Common.MethodObject(t,n,i);this._methodObjectList[e]=r},unregisterMethod:function(e){var t=Function._validateParams(arguments,[{name:"methodName",type:String,mayBeNull:!1}]);if(t)throw t;delete this._methodObjectList[e]},registerEvent:function(e,t,n){var i=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:!1},{name:"registerMethod",type:Function,mayBeNull:!1},{name:"unregisterMethod",type:Function,mayBeNull:!1}]);if(i)throw i;var o=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(t,Microsoft.Office.Common.InvokeType.syncRegisterEvent,!1),new Microsoft.Office.Common.MethodObject(n,Microsoft.Office.Common.InvokeType.syncUnregisterEvent,!1));this._methodObjectList[e]=o},registerEventEx:function(e,t,n,i,o){var r=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:!1},{name:"registerMethod",type:Function,mayBeNull:!1},{name:"registerMethodInvokeType",type:Number,mayBeNull:!1},{name:"unregisterMethod",type:Function,mayBeNull:!1},{name:"unregisterMethodInvokeType",type:Number,mayBeNull:!1}]);if(r)throw r;var a=new Microsoft.Office.Common.EventMethodObject(new Microsoft.Office.Common.MethodObject(t,n,!1),new Microsoft.Office.Common.MethodObject(i,o,!1));this._methodObjectList[e]=a},unregisterEvent:function(e){var t=Function._validateParams(arguments,[{name:"eventName",type:String,mayBeNull:!1}]);if(t)throw t;this.unregisterMethod(e)},registerConversation:function(e,t,n,i){var o=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:!1},{name:"conversationUrl",type:String,mayBeNull:!1,optional:!0},{name:"appDomains",type:Object,mayBeNull:!0,optional:!0},{name:"serializerVersion",type:Number,mayBeNull:!0,optional:!0}]);if(o)throw o;if(n){if(!(n instanceof Array))throw OsfMsAjaxFactory.msAjaxError.argument("appDomains");this._appDomains[e]=n}this._conversations[e]={url:t,serializerVersion:i}},unregisterConversation:function(e){var t=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:!1}]);if(t)throw t;delete this._conversations[e]},setPolicyManager:function(e){var t=Function._validateParams(arguments,[{name:"policyManager",type:Object,mayBeNull:!1}]);if(t)throw t;if(!e.checkPermission)throw OsfMsAjaxFactory.msAjaxError.argument("policyManager");this._policyManager=e},getPolicyManager:function(){return this._policyManager},dispose:function(){this._methodObjectList=null,this._eventHandlerProxyList=null,this._Id=null,this._conversations=null,this._policyManager=null,this._appDomains=null,this._onHandleRequestError=null}},Microsoft.Office.Common.ClientEndPoint=function(e,t,n,i){var o=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:!1},{name:"targetWindow",mayBeNull:!1},{name:"targetUrl",type:String,mayBeNull:!1},{name:"serializerVersion",type:Number,mayBeNull:!0,optional:!0}]);if(o)throw o;try{if(!t.postMessage)throw OsfMsAjaxFactory.msAjaxError.argument("targetWindow")}catch(e){if(!Object.prototype.hasOwnProperty.call(t,"postMessage"))throw OsfMsAjaxFactory.msAjaxError.argument("targetWindow")}this._conversationId=e,this._targetWindow=t,this._targetUrl=n,this._callingIndex=0,this._callbackList={},this._eventHandlerList={},this._serializerVersion=null!=i?i:OSF.SerializerVersion.Browser,this._checkReceiverOriginAndRun=null,this._hostTrustCheckStatus=Microsoft.Office.Common.HostTrustStatus.unknown,this._checkStatusLogged=!1},Microsoft.Office.Common.ClientEndPoint.prototype={invoke:function(e,t,n){var i=Function._validateParams(arguments,[{name:"targetMethodName",type:String,mayBeNull:!1},{name:"callback",type:Function,mayBeNull:!0},{name:"param",mayBeNull:!0}]);if(i)throw i;var o=this,r=function(){var i=o._callingIndex++,r=new Date,a={callback:t,createdOn:r.getTime()};n&&"object"===typeof n&&"number"===typeof n.__timeout__&&(a.timeout=n.__timeout__,delete n.__timeout__),o._callbackList[i]=a;try{if(o._hostTrustCheckStatus!==Microsoft.Office.Common.HostTrustStatus.trusted&&"ContextActivationManager_getAppContextAsync"!==e)throw"Access Denied";var s=new Microsoft.Office.Common.Request(e,Microsoft.Office.Common.ActionType.invoke,o._conversationId,i,n),c=Microsoft.Office.Common.MessagePackager.envelope(s,o._serializerVersion);o._targetWindow.postMessage(c,o._targetUrl),Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer()}catch(e){try{null!==t&&t(Microsoft.Office.Common.InvokeResultCode.errorInRequest,e)}finally{delete o._callbackList[i]}}};o._checkReceiverOriginAndRun?o._checkReceiverOriginAndRun(r):(o._hostTrustCheckStatus=Microsoft.Office.Common.HostTrustStatus.trusted,r())},registerForEvent:function(e,t,n,i){var o=Function._validateParams(arguments,[{name:"targetEventName",type:String,mayBeNull:!1},{name:"eventHandler",type:Function,mayBeNull:!1},{name:"callback",type:Function,mayBeNull:!0},{name:"data",mayBeNull:!0,optional:!0}]);if(o)throw o;var r=this._callingIndex++,a=new Date;this._callbackList[r]={callback:n,createdOn:a.getTime()};try{var s=new Microsoft.Office.Common.Request(e,Microsoft.Office.Common.ActionType.registerEvent,this._conversationId,r,i),c=Microsoft.Office.Common.MessagePackager.envelope(s,this._serializerVersion);this._targetWindow.postMessage(c,this._targetUrl),Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer(),this._eventHandlerList[e]=t}catch(e){try{null!==n&&n(Microsoft.Office.Common.InvokeResultCode.errorInRequest,e)}finally{delete this._callbackList[r]}}},unregisterForEvent:function(e,t,n){var i=Function._validateParams(arguments,[{name:"targetEventName",type:String,mayBeNull:!1},{name:"callback",type:Function,mayBeNull:!0},{name:"data",mayBeNull:!0,optional:!0}]);if(i)throw i;var o=this._callingIndex++,r=new Date;this._callbackList[o]={callback:t,createdOn:r.getTime()};try{var a=new Microsoft.Office.Common.Request(e,Microsoft.Office.Common.ActionType.unregisterEvent,this._conversationId,o,n),s=Microsoft.Office.Common.MessagePackager.envelope(a,this._serializerVersion);this._targetWindow.postMessage(s,this._targetUrl),Microsoft.Office.Common.XdmCommunicationManager._startMethodTimeoutTimer()}catch(e){try{null!==t&&t(Microsoft.Office.Common.InvokeResultCode.errorInRequest,e)}finally{delete this._callbackList[o]}}finally{delete this._eventHandlerList[e]}}},Microsoft.Office.Common.XdmCommunicationManager=function(){var e=[],t=null,n=null,i=!1,o=null,r=65e3,a={},s={},c=!1;function l(){null!==n?i||(e.length>0?u(e.shift()):(clearInterval(n),n=null)):OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready.")}function u(e){i=e.getInvokeBlockingFlag(),e.invoke(),t=(new Date).getTime()}function d(){if(o){var e,t,n=0,i=new Date;for(var a in s)for(var c in(e=s[a])._callbackList){var l=e._callbackList[c];if((t=l.timeout?l.timeout:r)>=0&&Math.abs(i.getTime()-l.createdOn)>=t)try{l.callback&&l.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout,null)}finally{delete e._callbackList[c]}else n++}0===n&&(clearInterval(o),o=null)}else OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready.")}function f(){i=!1}function p(e,t){var n=!1;if(!t||"null"===t||!t.length||!e||!(e instanceof Array)||!e.length)return n;var i=document.createElement("a"),o=document.createElement("a");i.href=t;for(var r=0;r<e.length&&!n;r++)-1!==e[r].indexOf("://")&&(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)?n=g(t,e[r]):(o.href=e[r],n=y(i,o)));return n}function h(e){if(!e||"null"===e)return!1;var t=new Array("^office-int\\.com$","^officeapps\\.live-int\\.com$","^.*\\.dod\\.online\\.office365\\.us$","^.*\\.gov\\.online\\.office365\\.us$","^.*\\.officeapps\\.live\\.com$","^.*\\.officeapps\\.live-int\\.com$","^.*\\.officeapps-df\\.live\\.com$","^.*\\.online\\.office\\.de$","^.*\\.partner\\.officewebapps\\.cn$","^.*\\.office\\.net$","^"+document.domain.replace(new RegExp("\\.","g"),"\\.")+"$");return new RegExp(t.join("|")).test(e)}function m(e,t){if(!e||!t||"null"===e||"null"===t)return!1;var n,i;OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)?(n=OSF.OUtil.parseUrl(e,!0),i=OSF.OUtil.parseUrl(t,!0)):((n=document.createElement("a")).href=e,(i=document.createElement("a")).href=t);var o=n.protocol===i.protocol,r=n.port===i.port,a=i.hostname,s=n.hostname,c=a===s,l=!1;return!c&&a.length>s.length+1&&(l=a.slice(-(s.length+1))==="."+s),r&&o&&(c||l)}function g(e,t){return y(OSF.OUtil.parseUrl(e,!0),OSF.OUtil.parseUrl(t,!0))}function y(e,t){return e.hostname==t.hostname&&e.protocol==t.protocol&&O(e,t)}function O(e,t){return e.port==t.port||""==e.port&&"http:"==e.protocol&&"80"==t.port||""==e.port&&"https:"==e.protocol&&"443"==t.port||""==t.port&&"http:"==t.protocol&&"80"==e.port||""==t.port&&"https:"==t.protocol&&"443"==e.port}function v(o){if(OSF&&""!=o.data){var r,c=OSF.SerializerVersion.Browser,d=o.data;try{c=null!=(r=Microsoft.Office.Common.MessagePackager.unenvelope(d,OSF.SerializerVersion.Browser))._serializerVersion?r._serializerVersion:c}catch(e){return}if(r._messageType===Microsoft.Office.Common.MessageType.request){var O=null==o.origin||"null"===o.origin?r._origin:o.origin;try{var v=function(e){for(var t in a)if(a[t]._conversations[e])return a[t];throw OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."),OsfMsAjaxFactory.msAjaxError.argument("conversationId")}(r._conversationId),b=v._conversations[r._conversationId];c=null!=b.serializerVersion?b.serializerVersion:c;var _=[b.url].concat(v._appDomains[r._conversationId]);if(!p(_,o.origin))if(!OfficeExt.appSpecificCheckOrigin(_,o,r._origin,p))if(!m(b.url,o.origin))throw"Failed origin check";var S=null!=r._data?r._data:{};S.SecurityOrigin=o.origin;var A=v.getPolicyManager();if(A&&!A.checkPermission(r._conversationId,r._actionName,S))throw"Access Denied";var D=function(e,t){var n=e._methodObjectList[t._actionName];if(!n)throw OsfMsAjaxFactory.msAjaxDebug.trace("The specified method is not registered on service endpoint:"+t._actionName),OsfMsAjaxFactory.msAjaxError.argument("messageObject");return t._actionType===Microsoft.Office.Common.ActionType.invoke?n:t._actionType===Microsoft.Office.Common.ActionType.registerEvent?n.getRegisterMethodObject():n.getUnregisterMethodObject()}(v,r),C=new Microsoft.Office.Common.InvokeCompleteCallback(o.source,O,r._actionName,r._conversationId,r._correlationId,f,c),P=new Microsoft.Office.Common.Invoker(D,S,C,v._eventHandlerProxyList,r._conversationId,r._actionName,c),I=!0;null==n&&((null==t||(new Date).getTime()-t>10)&&!i?(u(P),I=!1):n=setInterval(l,10)),I&&function(t){e.push(t)}(P)}catch(e){v&&v._onHandleRequestError&&v._onHandleRequestError(r,e);var E=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest;"Access Denied"==e&&(E=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied);var F=new Microsoft.Office.Common.Response(r._actionName,r._conversationId,r._correlationId,E,Microsoft.Office.Common.ResponseType.forCalling,e),M=Microsoft.Office.Common.MessagePackager.envelope(F,c),x=!1;try{x=!(!o.source||!o.source.postMessage)}catch(e){}var R=!1;if(window.location.href&&o.origin&&"null"!==o.origin&&m(window.location.href,o.origin))R=!0;else if(o.origin&&"null"!==o.origin)if(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)){R=h(OSF.OUtil.parseUrl(o.origin,!0).hostname)}else{var w=document.createElement("a");w.href=o.origin,R=h(w.hostname)}x&&R&&o.source.postMessage(M,O)}}else{if(r._messageType!==Microsoft.Office.Common.MessageType.response)return;var N=function(e){var t=s[e];return t||OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."),t}(r._conversationId);if(!N)return;if(N._serializerVersion=c,!function(e,t){var n,i,o=!1;return e&&t&&"null"!==e&&"null"!==t&&e.length&&t.length?(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)?o=g(e,t):(n=document.createElement("a"),i=document.createElement("a"),n.href=e,i.href=t,o=y(n,i)),o):o}(N._targetUrl,o.origin))throw"Failed orgin check";if(r._responseType===Microsoft.Office.Common.ResponseType.forCalling){var T=N._callbackList[r._correlationId];if(T)try{T.callback&&T.callback(r._errorCode,r._data)}finally{delete N._callbackList[r._correlationId]}}else{var j=N._eventHandlerList[r._actionName];void 0!==j&&null!==j&&j(r._data)}}}}function b(){c||(!function(e){if(window.addEventListener)window.addEventListener("message",e,!1);else{if(!(navigator.userAgent.indexOf("MSIE")>-1&&window.attachEvent))throw OsfMsAjaxFactory.msAjaxDebug.trace("Browser doesn't support the required API."),OsfMsAjaxFactory.msAjaxError.argument("Browser");window.attachEvent("onmessage",e)}}(v),c=!0)}return{connect:function(e,t,n,i){var o=s[e];return o||(b(),o=new Microsoft.Office.Common.ClientEndPoint(e,t,n,i),s[e]=o),o},getClientEndPoint:function(e){var t=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:!1}]);if(t)throw t;return s[e]},createServiceEndPoint:function(e){b();var t=new Microsoft.Office.Common.ServiceEndPoint(e);return a[e]=t,t},getServiceEndPoint:function(e){var t=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:!1}]);if(t)throw t;return a[e]},deleteClientEndPoint:function(e){var t=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:!1}]);if(t)throw t;delete s[e]},deleteServiceEndPoint:function(e){var t=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:!1}]);if(t)throw t;delete a[e]},urlCompare:function(e,t){return y(e,t)},checkUrlWithAppDomains:function(e,t){return p(e,t)},isTargetSubdomainOfSourceLocation:function(e,t){return m(e,t)},_setMethodTimeout:function(e){var t=Function._validateParams(arguments,[{name:"methodTimeout",type:Number,mayBeNull:!1}]);if(t)throw t;r=e<=0?65e3:e},_startMethodTimeoutTimer:function(){o||(o=setInterval(d,2e3))},isHostNameValidWacDomain:function(e){return h(e)},_hasSamePort:function(e,t){return O(e,t)}}}(),Microsoft.Office.Common.Message=function(e,t,n,i,o){var r=Function._validateParams(arguments,[{name:"messageType",type:Number,mayBeNull:!1},{name:"actionName",type:String,mayBeNull:!1},{name:"conversationId",type:String,mayBeNull:!1},{name:"correlationId",mayBeNull:!1},{name:"data",mayBeNull:!0,optional:!0}]);if(r)throw r;this._messageType=e,this._actionName=t,this._conversationId=n,this._correlationId=i,this._origin=window.location.origin,this._data="undefined"==typeof o?null:o},Microsoft.Office.Common.Message.prototype={getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getOrigin:function(){return this._origin},getData:function(){return this._data},getMessageType:function(){return this._messageType}},Microsoft.Office.Common.Request=function(e,t,n,i,o){Microsoft.Office.Common.Request.uber.constructor.call(this,Microsoft.Office.Common.MessageType.request,e,n,i,o),this._actionType=t},OSF.OUtil.extend(Microsoft.Office.Common.Request,Microsoft.Office.Common.Message),Microsoft.Office.Common.Request.prototype.getActionType=function(){return this._actionType},Microsoft.Office.Common.Response=function(e,t,n,i,o,r){Microsoft.Office.Common.Response.uber.constructor.call(this,Microsoft.Office.Common.MessageType.response,e,t,n,r),this._errorCode=i,this._responseType=o},OSF.OUtil.extend(Microsoft.Office.Common.Response,Microsoft.Office.Common.Message),Microsoft.Office.Common.Response.prototype.getErrorCode=function(){return this._errorCode},Microsoft.Office.Common.Response.prototype.getResponseType=function(){return this._responseType},Microsoft.Office.Common.MessagePackager={envelope:function(e,t){return"object"===typeof e&&(e._serializerVersion=OSF.SerializerVersion.Browser),JSON.stringify(e)},unenvelope:function(e,t){return JSON.parse(e)}},Microsoft.Office.Common.ResponseSender=function(e,t,n,i,o,r,a){var s=Function._validateParams(arguments,[{name:"requesterWindow",mayBeNull:!1},{name:"requesterUrl",type:String,mayBeNull:!1},{name:"actionName",type:String,mayBeNull:!1},{name:"conversationId",type:String,mayBeNull:!1},{name:"correlationId",mayBeNull:!1},{name:"responsetype",type:Number,maybeNull:!1},{name:"serializerVersion",type:Number,maybeNull:!0,optional:!0}]);if(s)throw s;this._requesterWindow=e,this._requesterUrl=t,this._actionName=n,this._conversationId=i,this._correlationId=o,this._invokeResultCode=Microsoft.Office.Common.InvokeResultCode.noError,this._responseType=r;var c=this;this._send=function(e){var t=function(e,t){var n=OSF.OUtil.parseUrl(e),i=OSF.OUtil.parseUrl(t);if(!(n&&n.hostname&&i&&i.hostname)){var o="Failed to execute 'postMessage' on 'DOMWindow': The target origin provided or the recipient window's origin are undefined.";return console.log(o),!1}if(!Microsoft.Office.Common.XdmCommunicationManager.urlCompare(n,i)){o="Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('"+(n?n.protocol+"//"+n.hostname+(n.port?":"+n.port:""):"undefined")+"') does not match the recipient window's origin ('"+(i?i.protocol+"//"+i.hostname+(i.port?":"+i.port:""):"undefined")+"').";return console.log(o),!1}return!0};try{if("dialogMessageReceived"===c._actionName&&"*"!==e.targetOrigin){if(e.targetOrigin&&!t(e.targetOrigin,c._requesterUrl))return}else if("dialogParentMessageReceived"===c._actionName&&e.targetOrigin&&"*"!==e.targetOrigin&&!t(e.targetOrigin,c._requesterUrl))return;var n=new Microsoft.Office.Common.Response(c._actionName,c._conversationId,c._correlationId,c._invokeResultCode,c._responseType,e),i=Microsoft.Office.Common.MessagePackager.envelope(n,a);c._requesterWindow.postMessage(i,c._requesterUrl)}catch(e){OsfMsAjaxFactory.msAjaxDebug.trace("ResponseSender._send error:"+e.message)}}},Microsoft.Office.Common.ResponseSender.prototype={getRequesterWindow:function(){return this._requesterWindow},getRequesterUrl:function(){return this._requesterUrl},getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getSend:function(){return this._send},setResultCode:function(e){this._invokeResultCode=e}},Microsoft.Office.Common.InvokeCompleteCallback=function(e,t,n,i,o,r,a){Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(this,e,t,n,i,o,Microsoft.Office.Common.ResponseType.forCalling,a),this._postCallbackHandler=r;var s=this;this._send=function(e,t){void 0!=t&&(s._invokeResultCode=t);try{var n=new Microsoft.Office.Common.Response(s._actionName,s._conversationId,s._correlationId,s._invokeResultCode,s._responseType,e),i=Microsoft.Office.Common.MessagePackager.envelope(n,a);s._requesterWindow.postMessage(i,s._requesterUrl),s._postCallbackHandler()}catch(e){OsfMsAjaxFactory.msAjaxDebug.trace("InvokeCompleteCallback._send error:"+e.message)}}},OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback,Microsoft.Office.Common.ResponseSender),Microsoft.Office.Common.Invoker=function(e,t,n,i,o,r,a){var s=Function._validateParams(arguments,[{name:"methodObject",mayBeNull:!1},{name:"paramValue",mayBeNull:!0},{name:"invokeCompleteCallback",mayBeNull:!1},{name:"eventHandlerProxyList",mayBeNull:!0},{name:"conversationId",type:String,mayBeNull:!1},{name:"eventName",type:String,mayBeNull:!1},{name:"serializerVersion",type:Number,mayBeNull:!0,optional:!0}]);if(s)throw s;this._methodObject=e,this._param=t,this._invokeCompleteCallback=n,this._eventHandlerProxyList=i,this._conversationId=o,this._eventName=r,this._serializerVersion=a},Microsoft.Office.Common.Invoker.prototype={invoke:function(){try{var e;switch(this._methodObject.getInvokeType()){case Microsoft.Office.Common.InvokeType.async:this._methodObject.getMethod()(this._param,this._invokeCompleteCallback.getSend());break;case Microsoft.Office.Common.InvokeType.sync:e=this._methodObject.getMethod()(this._param),this._invokeCompleteCallback.getSend()(e);break;case Microsoft.Office.Common.InvokeType.syncRegisterEvent:var t=this._createEventHandlerProxyObject(this._invokeCompleteCallback);e=this._methodObject.getMethod()(t.getSend(),this._param),this._eventHandlerProxyList[this._conversationId+this._eventName]=t.getSend(),this._invokeCompleteCallback.getSend()(e);break;case Microsoft.Office.Common.InvokeType.syncUnregisterEvent:var n=this._eventHandlerProxyList[this._conversationId+this._eventName];e=this._methodObject.getMethod()(n,this._param),delete this._eventHandlerProxyList[this._conversationId+this._eventName],this._invokeCompleteCallback.getSend()(e);break;case Microsoft.Office.Common.InvokeType.asyncRegisterEvent:var i=this._createEventHandlerProxyObject(this._invokeCompleteCallback);this._methodObject.getMethod()(i.getSend(),this._invokeCompleteCallback.getSend(),this._param),this._eventHandlerProxyList[this._callerId+this._eventName]=i.getSend();break;case Microsoft.Office.Common.InvokeType.asyncUnregisterEvent:var o=this._eventHandlerProxyList[this._callerId+this._eventName];this._methodObject.getMethod()(o,this._invokeCompleteCallback.getSend(),this._param),delete this._eventHandlerProxyList[this._callerId+this._eventName]}}catch(e){this._invokeCompleteCallback.setResultCode(Microsoft.Office.Common.InvokeResultCode.errorInResponse),this._invokeCompleteCallback.getSend()(e)}},getInvokeBlockingFlag:function(){return this._methodObject.getBlockingFlag()},_createEventHandlerProxyObject:function(e){return new Microsoft.Office.Common.ResponseSender(e.getRequesterWindow(),e.getRequesterUrl(),e.getActionName(),e.getConversationId(),e.getCorrelationId(),Microsoft.Office.Common.ResponseType.forEventing,this._serializerVersion)}},OSF.OUtil.setNamespace("WAC",OSF.DDA),OSF.DDA.WAC.UniqueArguments={Data:"Data",Properties:"Properties",BindingRequest:"DdaBindingsMethod",BindingResponse:"Bindings",SingleBindingResponse:"singleBindingResponse",GetData:"DdaGetBindingData",AddRowsColumns:"DdaAddRowsColumns",SetData:"DdaSetBindingData",ClearFormats:"DdaClearBindingFormats",SetFormats:"DdaSetBindingFormats",SettingsRequest:"DdaSettingsMethod",BindingEventSource:"ddaBinding",ArrayData:"ArrayData"},OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC),OSF.DDA.WAC.Delegate.SpecialProcessor=function(){var e=[OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,OSF.DDA.WAC.UniqueArguments.BindingRequest,OSF.DDA.WAC.UniqueArguments.BindingResponse,OSF.DDA.WAC.UniqueArguments.GetData,OSF.DDA.WAC.UniqueArguments.AddRowsColumns,OSF.DDA.WAC.UniqueArguments.SetData,OSF.DDA.WAC.UniqueArguments.ClearFormats,OSF.DDA.WAC.UniqueArguments.SetFormats,OSF.DDA.WAC.UniqueArguments.SettingsRequest,OSF.DDA.WAC.UniqueArguments.BindingEventSource];OSF.DDA.WAC.Delegate.SpecialProcessor.uber.constructor.call(this,e,{})},OSF.OUtil.extend(OSF.DDA.WAC.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor),OSF.DDA.WAC.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.WAC.Delegate.SpecialProcessor,[]),OSF.OUtil.setNamespace("WAC",OSF.DDA),OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC),OSF.DDA.WAC.getDelegateMethods=function(){var e={};return e[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.WAC.Delegate.executeAsync,e[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.WAC.Delegate.registerEventAsync,e[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.WAC.Delegate.unregisterEventAsync,e[OSF.DDA.DispIdHost.Delegates.OpenDialog]=OSF.DDA.WAC.Delegate.openDialog,e[OSF.DDA.DispIdHost.Delegates.ValidateTaskpaneDomain]=OSF.DDA.WAC.Delegate.validateTaskpaneDomain,e[OSF.DDA.DispIdHost.Delegates.MessageParent]=OSF.DDA.WAC.Delegate.messageParent,e[OSF.DDA.DispIdHost.Delegates.SendMessage]=OSF.DDA.WAC.Delegate.sendMessage,e[OSF.DDA.DispIdHost.Delegates.CloseDialog]=OSF.DDA.WAC.Delegate.closeDialog,e},OSF.DDA.WAC.Delegate.version=1,OSF.DDA.WAC.Delegate.executeAsync=function(e){e.hostCallArgs||(e.hostCallArgs={}),e.hostCallArgs.DdaMethod={ControlId:OSF._OfficeAppFactory.getId(),Version:OSF.DDA.WAC.Delegate.version,DispatchId:e.dispId},e.hostCallArgs.__timeout__=-1,e.onCalling&&e.onCalling(),OSF.getClientEndPoint()&&OSF.getClientEndPoint().invoke("executeMethod",(function(t,n){var i;if(e.onReceiving&&e.onReceiving(),t==Microsoft.Office.Common.InvokeResultCode.noError)OSF.DDA.WAC.Delegate.version=n.Version,i=n.Error;else switch(t){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:i=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:i=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}e.onComplete&&e.onComplete(i,n)}),e.hostCallArgs)},OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent=function(e,t){var n=(new Date).getTime();return function(i,o){var r;if(t.onReceiving&&t.onReceiving(),i!=Microsoft.Office.Common.InvokeResultCode.noError)switch(i){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:r=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:r=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}else r=o?o.Error?o.Error:OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess:OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;t.onComplete&&t.onComplete(r),OSF.AppTelemetry&&OSF.AppTelemetry.onRegisterDone(e,t.dispId,Math.abs((new Date).getTime()-n),r)}},OSF.DDA.WAC.Delegate.registerEventAsync=function(e){e.onCalling&&e.onCalling(),OSF.getClientEndPoint()&&OSF.getClientEndPoint().registerForEvent(OSF.DDA.getXdmEventName(e.targetId,e.eventType),(function(t){e.onEvent&&e.onEvent(t),OSF.AppTelemetry&&OSF.AppTelemetry.onEventDone(e.dispId)}),OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!0,e),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:e.dispId,targetId:e.targetId})},OSF.DDA.WAC.Delegate.unregisterEventAsync=function(e){e.onCalling&&e.onCalling(),OSF.getClientEndPoint()&&OSF.getClientEndPoint().unregisterForEvent(OSF.DDA.getXdmEventName(e.targetId,e.eventType),OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!1,e),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:e.dispId,targetId:e.targetId})},OSF.OUtil.setNamespace("WebApp",OSF),OSF.OUtil.setNamespace("Messaging",OSF),OSF.OUtil.setNamespace("ExtensionLifeCycle",OSF),OSF.OUtil.setNamespace("TaskPaneAction",OSF),OSF.OUtil.setNamespace("RibbonGallery",OSF),OSF.WebApp.AddHostInfoAndXdmInfo=function(e){return OSF._OfficeAppFactory.getWindowLocationSearch&&OSF._OfficeAppFactory.getWindowLocationHash?e+OSF._OfficeAppFactory.getWindowLocationSearch()+OSF._OfficeAppFactory.getWindowLocationHash():e},OSF.WebApp._UpdateLinksForHostAndXdmInfo=function(){for(var e=document.querySelectorAll("a[data-officejs-navigate]"),t=0;t<e.length;t++)OSF.WebApp._isGoodUrl(e[t].href)&&(e[t].href=OSF.WebApp.AddHostInfoAndXdmInfo(e[t].href));var n=document.querySelectorAll("form[data-officejs-navigate]");for(t=0;t<n.length;t++){var i=n[t];OSF.WebApp._isGoodUrl(i.action)&&(i.action=OSF.WebApp.AddHostInfoAndXdmInfo(i.action))}},OSF.WebApp._isGoodUrl=function(e){if("undefined"==typeof e)return!1;var t=(e=e.trim()).indexOf(":"),n=t>0?e.substr(0,t):null,i=null===n||("http"===n.toLowerCase()||"https"===n.toLowerCase());return i=i&&"#"!=e&&"/"!=e&&""!=e&&e!=OSF._OfficeAppFactory.getWebAppState().webAppUrl},OSF.InitializationHelper=function(e,t,n,i,o){this._hostInfo=e,this._webAppState=t,this._context=n,this._settings=i,this._hostFacade=o,this._appContext={},this._tabbableElements="a[href]:not([tabindex='-1']),area[href]:not([tabindex='-1']),button:not([disabled]):not([tabindex='-1']),input:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),textarea:not([disabled]):not([tabindex='-1']),*[tabindex]:not([tabindex='-1']),*[contenteditable]:not([disabled]):not([tabindex='-1'])",this._initializeSettings=function(e,t){var n=e.get_settings(),i=OSF.OUtil.getSessionStorage();if(i){var o=i.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());o?n=JSON.parse(o):(o=JSON.stringify(n),i.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),o))}var r=OSF.DDA.SettingsManager.deserializeSettings(n);return t?new OSF.DDA.RefreshableSettings(r):new OSF.DDA.Settings(r)};!function(e){var t=window.open;e.open=function(e,n,i){var o=null;try{o=t(e,n,i)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppCommonMessage("Exception happens at windowOpen."+e)}if(!o){var r={strUrl:e,strWindowName:n,strWindowFeatures:i};OSF._OfficeAppFactory.getClientEndPoint()&&OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost",null,r)}return o}}(window)},OSF.InitializationHelper.prototype.saveAndSetDialogInfo=function(e){var t=OSF.OUtil.getSessionStorage();if(t){if(e||(e=OSF.OUtil.parseHostInfoFromWindowName(!0,OSF._OfficeAppFactory.getWindowName())),e&&e.indexOf("isDialog")>-1){var n=function(){var e=OSF.OUtil.parseXdmInfo(!0);return e?e.split("|")[1]:null}();return null!=n&&t.setItem(n+"IsDialog","true"),void(this._hostInfo.isDialog=!0)}this._hostInfo.isDialog=null!=t.getItem(OSF.OUtil.getXdmFieldValue(OSF.XdmFieldName.AppId,!1)+"IsDialog")}},OSF.InitializationHelper.prototype.getAppContext=function(e,t){OSF.AppTelemetry&&OSF.AppTelemetry.logAppCommonMessage("OsfControl activation lifecycle: getAppContext got called.");var n=this,i=function(e,i){var o;if(i._appName===OSF.AppName.ExcelWebApp){var r=i._settings;for(var a in o={},r){var s=r[a];o[s[0]]=s[1]}}else o=i._settings;if(i._appName===OSF.AppName.OutlookWebApp&&i._requirementMatrix&&-1==i._requirementMatrix.indexOf("react")&&(OSF.AgaveHostAction.SendTelemetryEvent=void 0),!n._hostInfo.isDialog||null==window.opener){var c=window.location.origin;n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,OSF.AgaveHostAction.UpdateTargetUrl,c])}if(0!==e||void 0==i._id||void 0==i._appName||void 0==i._appVersion||void 0==i._appUILocale||void 0==i._dataLocale||void 0==i._docUrl||void 0==i._clientMode||void 0==i._settings||void 0==i._reason){var l="Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+e+", exception: "+i;throw OSF.AppTelemetry&&OSF.AppTelemetry.logAppException(l),l}n._appContext=i;var u=i._appInstanceId?i._appInstanceId:i._id,d=0;void 0!=i._appMinorVersion&&(d=i._appMinorVersion);var f=void 0;void 0!=i._requirementMatrix&&(f=i._requirementMatrix),i.eToken=i.eToken?i.eToken:"";var p=new OSF.OfficeAppContext(i._id,i._appName,i._appVersion,i._appUILocale,i._dataLocale,i._docUrl,i._clientMode,o,i._reason,i._osfControlType,i._eToken,i._correlationId,u,!1,!0,d,f,i._hostCustomMessage,i._hostFullVersion,i._clientWindowHeight,i._clientWindowWidth,i._addinName,i._appDomains,i._dialogRequirementMatrix,i._featureGates,void 0,i._initialDisplayMode);p._wacHostEnvironment=i._wacHostEnvironment||"0",p._isFromWacAutomation=!!i._isFromWacAutomation,OSF.AppTelemetry&&OSF.AppTelemetry.initialize(p),t(p)};try{if(this._hostInfo.isDialog&&null!=window.opener)i(0,OfficeExt.WACUtils.parseAppContextFromWindowName(!1,OSF._OfficeAppFactory.getWindowName()));else this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync",i,this._webAppState.id)}catch(e){throw OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:["+e+"]"),e}},OSF.InitializationHelper.prototype.isHostOriginTrusted=function(e){},OSF.InitializationHelper.prototype.checkReceiverOriginAndRun=function(e){var t=this,n=OSF.OUtil.parseUrl(t._webAppState.clientEndPoint._targetUrl,!1),i="https:"==n.protocol;if(t._webAppState.clientEndPoint._hostTrustCheckStatus===Microsoft.Office.Common.HostTrustStatus.unknown&&(i||(t._webAppState.clientEndPoint._hostTrustCheckStatus=Microsoft.Office.Common.HostTrustStatus.nothttps),t._webAppState.clientEndPoint._hostTrustCheckStatus!=Microsoft.Office.Common.HostTrustStatus.nothttps)){var o=Microsoft.Office.Common.XdmCommunicationManager.isHostNameValidWacDomain(n.hostname);t.isHostOriginTrusted&&(o=o||t.isHostOriginTrusted(n.hostname)),o&&(t._webAppState.clientEndPoint._hostTrustCheckStatus=Microsoft.Office.Common.HostTrustStatus.trusted)}if(t._webAppState.clientEndPoint._checkStatusLogged||null==t._hostInfo||void 0===t._hostInfo||(OSF.AppTelemetry.onCheckWACHost(t._webAppState.clientEndPoint._hostTrustCheckStatus,t._webAppState.id,t._hostInfo.hostType,t._hostInfo.hostPlatform,t._webAppState.clientEndPoint._targetUrl),t._webAppState.clientEndPoint._checkStatusLogged=!0),t._webAppState.clientEndPoint._hostTrustCheckStatus!=Microsoft.Office.Common.HostTrustStatus.trusted){var r=function(){var o=OSF._OfficeAppFactory.getLoadScriptHelper().getOfficeJsBasePath().match(/^https?:\/\/[^:/?#]*(?::([0-9]+))?/);if(o&&o[0]){var r=OSF._OfficeAppFactory.getLoadScriptHelper().getOfficeJsBasePath()+"AgaveErrorUX/index.html#",a={error:"NotTrustedWAC",locale:OSF.getSupportedLocale(t._hostInfo.hostLocale,OSF.ConstantNames.DefaultLocale),hostname:n.hostname,noHttps:!i,validate:!1},s=document.createElement("iframe");s.style.visibility="hidden",s.style.height="0",s.style.width="0",OSF.OUtil.addEventListener(window,"message",(function n(i){if(i.source==s.contentWindow&&i.origin==o[0])try{var c=JSON.parse(i.data);Function._validateParams(c,[{name:"hostUserTrusted",type:Boolean,mayBeNull:!1}]);!0===c.hostUserTrusted?(t._webAppState.clientEndPoint._hostTrustCheckStatus=Microsoft.Office.Common.HostTrustStatus.trusted,OSF.OUtil.removeEventListener(window,"message",n),document.body.removeChild(s)):(a.validate=!1,window.location.replace(r+encodeURIComponent(JSON.stringify(a)))),e()}catch(e){document.body.innerHTML=Strings.OfficeOM.L_NotTrustedWAC}})),a.validate=!0,s.setAttribute("src",r+encodeURIComponent(JSON.stringify(a))),s.onload=function(){var e={hostname:n.hostname,noHttps:!i};s.contentWindow.postMessage(JSON.stringify(e),o[0])},document.body.appendChild(s)}else document.body.innerHTML=Strings.OfficeOM.L_NotTrustedWAC;if(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)&&!i)throw new Error("NotHttps")};if(document.body)r();else{var a=!1;document.addEventListener("DOMContentLoaded",(function(){a||(a=!0,r())}))}}else e()},OSF.InitializationHelper.prototype.setAgaveHostCommunication=function(){try{var e=this,t=OSF.OUtil.parseXdmInfoWithGivenFragment(!1,OSF._OfficeAppFactory.getWindowLocationHash());if(!t&&OSF._OfficeAppFactory.getWindowName&&(t=OSF.OUtil.parseXdmInfoFromWindowName(!1,OSF._OfficeAppFactory.getWindowName())),t){var n=OSF.OUtil.getInfoItems(t);void 0!=n&&n.length>=3&&(e._webAppState.conversationID=n[0],e._webAppState.id=n[1],e._webAppState.webAppUrl=n[2].indexOf(":")>=0?n[2]:decodeURIComponent(n[2]))}e._webAppState.wnd=null!=window.opener?window.opener:window.parent;var i=OSF.OUtil.parseSerializerVersionWithGivenFragment(!1,OSF._OfficeAppFactory.getWindowLocationHash());if(isNaN(i)&&OSF._OfficeAppFactory.getWindowName&&(i=OSF.OUtil.parseSerializerVersionFromWindowName(!1,OSF._OfficeAppFactory.getWindowName())),e._webAppState.serializerVersion=i,this._hostInfo.isDialog&&null!=window.opener)return;e._webAppState.clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(e._webAppState.conversationID,e._webAppState.wnd,e._webAppState.webAppUrl,e._webAppState.serializerVersion),e._webAppState.serviceEndPoint=Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(e._webAppState.id),e._webAppState.clientEndPoint._checkReceiverOriginAndRun=function(t){e.checkReceiverOriginAndRun(t)};var o=e._webAppState.conversationID+OSF.SharedConstants.NotificationConversationIdSuffix;e._webAppState.serviceEndPoint.registerConversation(o,e._webAppState.webAppUrl);e._webAppState.serviceEndPoint.registerMethod("Office_notifyAgave",(function(t){var n;switch(n="string"==typeof t?t:t[0]){case OSF.AgaveHostAction.Select:e._webAppState.focused=!0;break;case OSF.AgaveHostAction.UnSelect:e._webAppState.focused=!1;break;case OSF.AgaveHostAction.TabIn:case OSF.AgaveHostAction.CtrlF6In:window.focus();var i=document.querySelectorAll(e._tabbableElements);OSF.OUtil.focusToFirstTabbable(i,!1)||(window.blur(),e._webAppState.focused=!1,e._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[e._webAppState.id,OSF.AgaveHostAction.ExitNoFocusable]));break;case OSF.AgaveHostAction.TabInShift:window.focus();i=document.querySelectorAll(e._tabbableElements);OSF.OUtil.focusToFirstTabbable(i,!0)||(window.blur(),e._webAppState.focused=!1,e._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[e._webAppState.id,OSF.AgaveHostAction.ExitNoFocusableShift]));break;case OSF.AgaveHostAction.SendMessage:if(window.Office.context.messaging.onMessage){var o=t[1];window.Office.context.messaging.onMessage(o)}break;case OSF.AgaveHostAction.TaskPaneHeaderButtonClicked:window.Office.context.ui.taskPaneAction.onHeaderButtonClick&&window.Office.context.ui.taskPaneAction.onHeaderButtonClick();break;default:OsfMsAjaxFactory.msAjaxDebug.trace("actionId "+n+" notifyAgave is wrong.")}}),Microsoft.Office.Common.InvokeType.async,!1),e.addOrRemoveEventListenersForWindow(!0)}catch(e){throw OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception thrown in setAgaveHostCommunication. Exception:["+e+"]"),e}},OSF.InitializationHelper.prototype.addOrRemoveEventListenersForWindow=function(e){var t=this,n=function(){t._webAppState.focused||(t._webAppState.focused=!0),t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.Select])},i=function(){OSF&&(t._webAppState.focused&&(t._webAppState.focused=!1),t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.UnSelect]))},o=function(e){if(e.preventDefault=e.preventDefault||function(){e.returnValue=!1},117==e.keyCode&&(e.ctrlKey||e.metaKey)){e.preventDefault();var n=OSF.AgaveHostAction.CtrlF6Exit;e.shiftKey&&(n=OSF.AgaveHostAction.CtrlF6ExitShift),t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,n])}else if(9==e.keyCode){var i=t._appContext._appSettings&&(t._appContext._appSettings.PowerPointModernSlideShowEnabled||!1)&&t._appContext._appName==OSF.AppName.PowerpointWebApp&&t._appContext._clientMode==OSF.ClientMode.ReadOnly&&t._appContext._osfControlType==OSF.OsfControlType.DocumentLevel;i||e.preventDefault();var o=document.querySelectorAll(t._tabbableElements);OSF.OUtil.focusToNextTabbable(o,e.target||e.srcElement,e.shiftKey)?i&&e.preventDefault():t._hostInfo.isDialog?OSF.OUtil.focusToFirstTabbable(o,e.shiftKey):e.shiftKey?i||t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.TabExitShift]):OSF.OUtil.checkFlight(OSF.FlightNames.SetFocusToTaskpaneIsEnabled)&&e.target&&"BODY"===e.target.tagName.toUpperCase()?OSF.OUtil.focusToFirstTabbable(o,e.shiftKey):i||t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.TabExit])}else if(27==e.keyCode)e.preventDefault(),t.dismissDialogNotification&&t.dismissDialogNotification(),t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.EscExit]);else if(113==e.keyCode)e.preventDefault(),t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.F2Exit]);else if((e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)&&e.keyCode>=1&&e.keyCode<=255){var r={keyCode:e.keyCode,shiftKey:e.shiftKey,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey};t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.KeyboardShortcuts,r])}},r=function(e){117==e.keyCode&&e.ctrlKey&&(e.preventDefault?e.preventDefault():e.returnValue=!1)};e?(OSF.OUtil.addEventListener(window,"focus",n),OSF.OUtil.addEventListener(window,"blur",i),OSF.OUtil.addEventListener(window,"keydown",o),OSF.OUtil.addEventListener(window,"keypress",r)):(OSF.OUtil.removeEventListener(window,"focus",n),OSF.OUtil.removeEventListener(window,"blur",i),OSF.OUtil.removeEventListener(window,"keydown",o),OSF.OUtil.removeEventListener(window,"keypress",r))},OSF.InitializationHelper.prototype.initWebDialog=function(e){if(e.get_isDialog()){if(OSF.DDA.UI.ChildUI){var t=null!=window.opener;e.ui=new OSF.DDA.UI.ChildUI(t),t&&this.registerMessageReceivedEventForWindowDialog&&this.registerMessageReceivedEventForWindowDialog()}}else OSF.DDA.UI.ParentUI&&(e.ui=new OSF.DDA.UI.ParentUI,OfficeExt.Container&&OSF.DDA.DispIdHost.addAsyncMethods(e.ui,[OSF.DDA.AsyncMethodNames.CloseContainerAsync]))},OSF.InitializationHelper.prototype.initWebAuth=function(e){OSF.DDA.Auth&&(e.auth=new OSF.DDA.Auth,OSF.DDA.DispIdHost.addAsyncMethods(e.auth,[OSF.DDA.AsyncMethodNames.GetAccessTokenAsync]))},OSF.InitializationHelper.prototype.initWebAuthImplicit=function(e){OSF.DDA.WebAuth&&(e.webAuth=new OSF.DDA.WebAuth,OSF.DDA.DispIdHost.addAsyncMethods(e.webAuth,[OSF.DDA.AsyncMethodNames.GetAuthContextAsync]))},OSF.getClientEndPoint=function(){return OSF._OfficeAppFactory.getInitializationHelper()._webAppState.clientEndPoint},OSF.InitializationHelper.prototype.prepareRightAfterWebExtensionInitialize=function(){if(this._hostInfo.isDialog){window.focus();var e=document.querySelectorAll(this._tabbableElements);OSF.OUtil.focusToFirstTabbable(e,!1)||(window.blur(),this._webAppState.focused=!1,this._webAppState.clientEndPoint&&this._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[this._webAppState.id,OSF.AgaveHostAction.ExitNoFocusable]))}},OSF.Messaging.sendMessage=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.SendMessage,e])},OSF.ExtensionLifeCycle.launchExtensionComponent=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.LaunchExtensionComponent,e])},OSF.ExtensionLifeCycle.stopExtensionComponent=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.StopExtensionComponent,e])},OSF.ExtensionLifeCycle.restartExtensionComponent=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.RestartExtensionComponent,e])},OSF.TaskPaneAction.enableHeaderButton=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.EnableTaskPaneHeaderButton,e])},OSF.TaskPaneAction.disableHeaderButton=function(){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.DisableTaskPaneHeaderButton])},OSF.RibbonGallery.refreshRibbon=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.RefreshRibbonGallery,e])},function(e){var t=function(){function e(e){this._table=e,this._fields={}}return Object.defineProperty(e.prototype,"Fields",{get:function(){return this._fields},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Table",{get:function(){return this._table},enumerable:!0,configurable:!0}),e.prototype.SerializeFields=function(){},e.prototype.SetSerializedField=function(e,t){"undefined"!==typeof t&&null!==t&&(this._serializedFields[e]=t.toString())},e.prototype.SerializeRow=function(){return this._serializedFields={},this.SetSerializedField("Table",this._table),this.SerializeFields(),JSON.stringify(this._serializedFields)},e}();e.BaseUsageData=t;var n=function(e){function t(){return e.call(this,"AppActivated")||this}return __extends(t,e),Object.defineProperty(t.prototype,"CorrelationId",{get:function(){return this.Fields.CorrelationId},set:function(e){this.Fields.CorrelationId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SessionId",{get:function(){return this.Fields.SessionId},set:function(e){this.Fields.SessionId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppId",{get:function(){return this.Fields.AppId},set:function(e){this.Fields.AppId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppInstanceId",{get:function(){return this.Fields.AppInstanceId},set:function(e){this.Fields.AppInstanceId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppURL",{get:function(){return this.Fields.AppURL},set:function(e){this.Fields.AppURL=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AssetId",{get:function(){return this.Fields.AssetId},set:function(e){this.Fields.AssetId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Browser",{get:function(){return this.Fields.Browser},set:function(e){this.Fields.Browser=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"UserId",{get:function(){return this.Fields.UserId},set:function(e){this.Fields.UserId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Host",{get:function(){return this.Fields.Host},set:function(e){this.Fields.Host=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"HostVersion",{get:function(){return this.Fields.HostVersion},set:function(e){this.Fields.HostVersion=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ClientId",{get:function(){return this.Fields.ClientId},set:function(e){this.Fields.ClientId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppSizeWidth",{get:function(){return this.Fields.AppSizeWidth},set:function(e){this.Fields.AppSizeWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppSizeHeight",{get:function(){return this.Fields.AppSizeHeight},set:function(e){this.Fields.AppSizeHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Message",{get:function(){return this.Fields.Message},set:function(e){this.Fields.Message=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"DocUrl",{get:function(){return this.Fields.DocUrl},set:function(e){this.Fields.DocUrl=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"OfficeJSVersion",{get:function(){return this.Fields.OfficeJSVersion},set:function(e){this.Fields.OfficeJSVersion=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"HostJSVersion",{get:function(){return this.Fields.HostJSVersion},set:function(e){this.Fields.HostJSVersion=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"WacHostEnvironment",{get:function(){return this.Fields.WacHostEnvironment},set:function(e){this.Fields.WacHostEnvironment=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"IsFromWacAutomation",{get:function(){return this.Fields.IsFromWacAutomation},set:function(e){this.Fields.IsFromWacAutomation=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("CorrelationId",this.CorrelationId),this.SetSerializedField("SessionId",this.SessionId),this.SetSerializedField("AppId",this.AppId),this.SetSerializedField("AppInstanceId",this.AppInstanceId),this.SetSerializedField("AppURL",this.AppURL),this.SetSerializedField("AssetId",this.AssetId),this.SetSerializedField("Browser",this.Browser),this.SetSerializedField("UserId",this.UserId),this.SetSerializedField("Host",this.Host),this.SetSerializedField("HostVersion",this.HostVersion),this.SetSerializedField("ClientId",this.ClientId),this.SetSerializedField("AppSizeWidth",this.AppSizeWidth),this.SetSerializedField("AppSizeHeight",this.AppSizeHeight),this.SetSerializedField("Message",this.Message),this.SetSerializedField("DocUrl",this.DocUrl),this.SetSerializedField("OfficeJSVersion",this.OfficeJSVersion),this.SetSerializedField("HostJSVersion",this.HostJSVersion),this.SetSerializedField("WacHostEnvironment",this.WacHostEnvironment),this.SetSerializedField("IsFromWacAutomation",this.IsFromWacAutomation)},t}(t);e.AppActivatedUsageData=n;var i=function(e){function t(){return e.call(this,"ScriptLoad")||this}return __extends(t,e),Object.defineProperty(t.prototype,"CorrelationId",{get:function(){return this.Fields.CorrelationId},set:function(e){this.Fields.CorrelationId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SessionId",{get:function(){return this.Fields.SessionId},set:function(e){this.Fields.SessionId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ScriptId",{get:function(){return this.Fields.ScriptId},set:function(e){this.Fields.ScriptId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"StartTime",{get:function(){return this.Fields.StartTime},set:function(e){this.Fields.StartTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ResponseTime",{get:function(){return this.Fields.ResponseTime},set:function(e){this.Fields.ResponseTime=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("CorrelationId",this.CorrelationId),this.SetSerializedField("SessionId",this.SessionId),this.SetSerializedField("ScriptId",this.ScriptId),this.SetSerializedField("StartTime",this.StartTime),this.SetSerializedField("ResponseTime",this.ResponseTime)},t}(t);e.ScriptLoadUsageData=i;var o=function(e){function t(){return e.call(this,"AppClosed")||this}return __extends(t,e),Object.defineProperty(t.prototype,"CorrelationId",{get:function(){return this.Fields.CorrelationId},set:function(e){this.Fields.CorrelationId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SessionId",{get:function(){return this.Fields.SessionId},set:function(e){this.Fields.SessionId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"FocusTime",{get:function(){return this.Fields.FocusTime},set:function(e){this.Fields.FocusTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppSizeFinalWidth",{get:function(){return this.Fields.AppSizeFinalWidth},set:function(e){this.Fields.AppSizeFinalWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppSizeFinalHeight",{get:function(){return this.Fields.AppSizeFinalHeight},set:function(e){this.Fields.AppSizeFinalHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"OpenTime",{get:function(){return this.Fields.OpenTime},set:function(e){this.Fields.OpenTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"CloseMethod",{get:function(){return this.Fields.CloseMethod},set:function(e){this.Fields.CloseMethod=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("CorrelationId",this.CorrelationId),this.SetSerializedField("SessionId",this.SessionId),this.SetSerializedField("FocusTime",this.FocusTime),this.SetSerializedField("AppSizeFinalWidth",this.AppSizeFinalWidth),this.SetSerializedField("AppSizeFinalHeight",this.AppSizeFinalHeight),this.SetSerializedField("OpenTime",this.OpenTime),this.SetSerializedField("CloseMethod",this.CloseMethod)},t}(t);e.AppClosedUsageData=o;var r=function(e){function t(){return e.call(this,"APIUsage")||this}return __extends(t,e),Object.defineProperty(t.prototype,"CorrelationId",{get:function(){return this.Fields.CorrelationId},set:function(e){this.Fields.CorrelationId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SessionId",{get:function(){return this.Fields.SessionId},set:function(e){this.Fields.SessionId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"APIType",{get:function(){return this.Fields.APIType},set:function(e){this.Fields.APIType=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"APIID",{get:function(){return this.Fields.APIID},set:function(e){this.Fields.APIID=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Parameters",{get:function(){return this.Fields.Parameters},set:function(e){this.Fields.Parameters=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ResponseTime",{get:function(){return this.Fields.ResponseTime},set:function(e){this.Fields.ResponseTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ErrorType",{get:function(){return this.Fields.ErrorType},set:function(e){this.Fields.ErrorType=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("CorrelationId",this.CorrelationId),this.SetSerializedField("SessionId",this.SessionId),this.SetSerializedField("APIType",this.APIType),this.SetSerializedField("APIID",this.APIID),this.SetSerializedField("Parameters",this.Parameters),this.SetSerializedField("ResponseTime",this.ResponseTime),this.SetSerializedField("ErrorType",this.ErrorType)},t}(t);e.APIUsageUsageData=r;var a=function(e){function t(){return e.call(this,"AppInitialization")||this}return __extends(t,e),Object.defineProperty(t.prototype,"CorrelationId",{get:function(){return this.Fields.CorrelationId},set:function(e){this.Fields.CorrelationId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SessionId",{get:function(){return this.Fields.SessionId},set:function(e){this.Fields.SessionId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SuccessCode",{get:function(){return this.Fields.SuccessCode},set:function(e){this.Fields.SuccessCode=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Message",{get:function(){return this.Fields.Message},set:function(e){this.Fields.Message=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("CorrelationId",this.CorrelationId),this.SetSerializedField("SessionId",this.SessionId),this.SetSerializedField("SuccessCode",this.SuccessCode),this.SetSerializedField("Message",this.Message)},t}(t);e.AppInitializationUsageData=a;var s=function(e){function t(){return e.call(this,"CheckWACHost")||this}return __extends(t,e),Object.defineProperty(t.prototype,"isWacKnownHost",{get:function(){return this.Fields.isWacKnownHost},set:function(e){this.Fields.isWacKnownHost=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"instanceId",{get:function(){return this.Fields.instanceId},set:function(e){this.Fields.instanceId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hostType",{get:function(){return this.Fields.hostType},set:function(e){this.Fields.hostType=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hostPlatform",{get:function(){return this.Fields.hostPlatform},set:function(e){this.Fields.hostPlatform=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wacDomain",{get:function(){return this.Fields.wacDomain},set:function(e){this.Fields.wacDomain=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("isWacKnownHost",this.isWacKnownHost),this.SetSerializedField("instanceId",this.instanceId),this.SetSerializedField("hostType",this.hostType),this.SetSerializedField("hostPlatform",this.hostPlatform),this.SetSerializedField("wacDomain",this.wacDomain)},t}(t);e.CheckWACHostUsageData=s}(OSFLog||(OSFLog={})),function(e){"use strict";!function(e){e[e.info=0]="info",e[e.warning=1]="warning",e[e.error=2]="error"}(e.TraceLevel||(e.TraceLevel={})),function(e){e[e.none=0]="none",e[e.flush=1]="flush"}(e.SendFlag||(e.SendFlag={})),e.allowUploadingData=function(){},e.sendLog=function(e,t,n){};var t=function(){function e(){}return e.prototype.writeLog=function(e){},e.prototype.loadProxyFrame=function(){},e}();OSF.Logger||(OSF.Logger=e),e.ulsEndpoint=function(){try{return new t}catch(e){return null}}()}(Logger||(Logger={})),function(e){var t=[{name:"AppActivated",enabled:!0,critical:!0,points:[{name:"Browser",type:"string"},{name:"Message",type:"string"},{name:"Host",type:"string"},{name:"AppSizeWidth",type:"int64"},{name:"AppSizeHeight",type:"int64"},{name:"IsFromWacAutomation",type:"string"}]},{name:"ScriptLoad",enabled:!0,critical:!1,points:[{name:"ScriptId",type:"string"},{name:"StartTime",type:"double"},{name:"ResponseTime",type:"double"}]},{name:"APIUsage",enabled:function(){if(!OSF._OfficeAppFactory||!OSF._OfficeAppFactory.getHostInfo)return!1;var e=OSF._OfficeAppFactory.getHostInfo();if(!e)return!1;switch(e.hostType){case"outlook":switch(e.hostPlatform){case"mac":case"web":return!0;default:return!1}default:return!1}}(),critical:!1,points:[{name:"APIType",type:"string"},{name:"APIID",type:"int64"},{name:"Parameters",type:"string"},{name:"ResponseTime",type:"int64"},{name:"ErrorType",type:"int64"}]},{name:"AppInitialization",enabled:!0,critical:!1,points:[{name:"SuccessCode",type:"int64"},{name:"Message",type:"string"}]},{name:"AppClosed",enabled:!0,critical:!1,points:[{name:"FocusTime",type:"int64"},{name:"AppSizeFinalWidth",type:"int64"},{name:"AppSizeFinalHeight",type:"int64"},{name:"OpenTime",type:"int64"}]},{name:"CheckWACHost",enabled:!0,critical:!1,points:[{name:"isWacKnownHost",type:"int64"},{name:"solutionId",type:"string"},{name:"hostType",type:"string"},{name:"hostPlatform",type:"string"},{name:"correlationId",type:"string"}]}];function n(e,t){var n=void 0===t.rename?t.name:t.rename,i=void 0;switch(t.type){case"string":i=oteljs.makeStringDataField(n,e);break;case"double":"string"===typeof e&&(e=parseFloat(e)),i=oteljs.makeDoubleDataField(n,e);break;case"int64":"string"===typeof e&&(e=parseInt(e)),i=oteljs.makeInt64DataField(n,e);break;case"boolean":"string"===typeof e&&(e="true"===e),i=oteljs.makeBooleanDataField(n,e)}return i}function i(e){for(var n=0,i=t;n<i.length;n++){var o=i[n];if(o.name===e)return o}}function o(e,t){(function(e){var t=i(e);return void 0!==t&&t.enabled})(e)&&"undefined"!==typeof OTel&&OTel.OTelLogger.onTelemetryLoaded((function(){var o=function(e,t){var o=i(e);if(void 0!==o){for(var r=[],a=0,s=o.points;a<s.length;a++){var c=s[a],l=t[c.name];if(void 0!==l){var u=n(l,c);void 0!==u&&r.push(u)}}var d={dataCategories:oteljs.DataCategories.ProductServiceUsage};return o.critical&&(d.samplingPolicy=oteljs.SamplingPolicy.CriticalBusinessImpact),d.diagnosticLevel=oteljs.DiagnosticLevel.NecessaryServiceDataEvent,{eventName:"Office.Extensibility.OfficeJs."+e+"X",dataFields:r,eventFlags:d}}}(e,t);void 0!==o&&Microsoft.Office.WebExtension.sendTelemetryEvent(o)}))}var r=function(){function e(){}return e.prototype.getAriaCDNLocation=function(){return OSF._OfficeAppFactory.getLoadScriptHelper().getOfficeJsBasePath()+"ariatelemetry/aria-web-telemetry.js"},e.getInstance=function(){return void 0===e.AriaLoggerObj&&(e.AriaLoggerObj=new e),e.AriaLoggerObj},e.prototype.isIUsageData=function(e){return void 0!==e.Fields},e.prototype.shouldSendDirectToAria=function(e,t){var n;if(!e)return!1;if("win32"===e.toLowerCase())n=[16,0,11601];else{if("mac"!==e.toLowerCase())return!0;n=[16,28]}if(!t)return!1;for(var i=t.split("."),o=0;o<n.length&&o<i.length;o++){var r=parseInt(i[o],10);if(isNaN(r))return!1;if(r<n[o])return!0;if(r>n[o])return!1}return!1},e.prototype.isDirectToAriaEnabled=function(){if(void 0===this.EnableDirectToAria||null===this.EnableDirectToAria){var e=void 0,t=void 0;OSF._OfficeAppFactory&&OSF._OfficeAppFactory.getHostInfo&&(e=OSF._OfficeAppFactory.getHostInfo().hostPlatform),window.external&&"undefined"!==typeof window.external.GetContext&&"undefined"!==typeof window.external.GetContext().GetHostFullVersion&&(t=window.external.GetContext().GetHostFullVersion()),this.EnableDirectToAria=this.shouldSendDirectToAria(e,t)}return this.EnableDirectToAria},e.prototype.sendTelemetry=function(t,n){e.EnableSendingTelemetryWithLegacyAria&&this.isDirectToAriaEnabled()&&OSF.OUtil.loadScript(this.getAriaCDNLocation(),(function(){try{if(!this.ALogger){this.ALogger=AWTLogManager.initialize("db334b301e7b474db5e0f02f07c51a47-a1b5bc36-1bbe-482f-a64a-c2d9cb606706-7439")}var e=new AWTEventProperties;for(var i in e.setName("Office.Extensibility.OfficeJS."+t),n)"table"!==i.toLowerCase()&&e.setProperty(i,n[i]);var o=new Date;e.setProperty("Date",o.toISOString()),this.ALogger.logEvent(e)}catch(e){}}),1e3),e.EnableSendingTelemetryWithOTel&&o(t,n)},e.prototype.logData=function(e){this.isIUsageData(e)?this.sendTelemetry(e.Table,e.Fields):this.sendTelemetry(e.Table,e)},e.EnableSendingTelemetryWithOTel=!0,e.EnableSendingTelemetryWithLegacyAria=!1,e}();e.AriaLogger=r}(OSFAriaLogger||(OSFAriaLogger={})),function(e){"use strict";var t,n=OSF.OUtil.Guid.generateNewGuid(),i="",o=new RegExp("^https?://store\\.office(ppe|-int)?\\.com/","i");e.enableTelemetry=!0;var r=function(){return function(){}}();e.AppInfo=r;var a=function(){return function(e,t){this.name=e,this.handler=t}}(),s=function(){function e(){this.clientIDKey="Office API client",this.logIdSetKey="Office App Log Id Set"}return e.prototype.getClientId=function(){var e=this.getValue(this.clientIDKey);return(!e||e.length<=0||e.length>40)&&(e=OSF.OUtil.Guid.generateNewGuid(),this.setValue(this.clientIDKey,e)),e},e.prototype.saveLog=function(e,t){var n=this.getValue(this.logIdSetKey);n=(n&&n.length>0?n+";":"")+e,this.setValue(this.logIdSetKey,n),this.setValue(e,t)},e.prototype.enumerateLog=function(e,t){var n=this.getValue(this.logIdSetKey);if(n){var i=n.split(";");for(var o in i){var r=i[o],a=this.getValue(r);a&&(e&&e(r,a),t&&this.remove(r))}t&&this.remove(this.logIdSetKey)}},e.prototype.getValue=function(e){var t=OSF.OUtil.getLocalStorage(),n="";return t&&(n=t.getItem(e)),n},e.prototype.setValue=function(e,t){var n=OSF.OUtil.getLocalStorage();n&&n.setItem(e,t)},e.prototype.remove=function(e){var t=OSF.OUtil.getLocalStorage();if(t)try{t.removeItem(e)}catch(e){}},e}(),c=function(){function t(){}return t.prototype.LogData=function(t){if(e.enableTelemetry)try{OSFAriaLogger.AriaLogger.getInstance().logData(t)}catch(e){}},t.prototype.LogRawData=function(t){if(e.enableTelemetry)try{OSFAriaLogger.AriaLogger.getInstance().logData(JSON.parse(t))}catch(e){}},t}();function l(e){return e&&(e=e.replace(/[{}]/g,"").toLowerCase()),e||""}function u(e,t){var o=new OSFLog.AppInitializationUsageData;o.CorrelationId=l(i),o.SessionId=n,o.SuccessCode=e?1:0,o.Message=t,(new c).LogData(o)}function d(){var e=0!=(OSF._OfficeAppFactory.getHostInfo().flags&OSF.HostInfoFlags.PublicAddin);return e||!!t&&p(OSF._OfficeAppFactory.getHostInfo().hostPlatform,t.hostVersion)}function f(e,t){return d()||t!==e?t:"PRIVATE"}function p(e,t){var n=!1,i=/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.exec(t);if(i){var o=parseInt(i[1]),r=parseInt(i[2]),a=parseInt(i[3]);"win32"==e?(o<16||16==o&&a<14225)&&(n=!0):"mac"==e&&(o<16||16==o&&(r<52||52==r&&a<808))&&(n=!0)}return n}e.initialize=function(i){if(e.enableTelemetry&&!t){t=new r,i.get_hostFullVersion()?t.hostVersion=i.get_hostFullVersion():t.hostVersion=i.get_appVersion(),t.appId=d()?i.get_id():"PRIVATE",t.browser=window.navigator.userAgent,t.correlationId=l(i.get_correlationId()),t.clientId=(new s).getClientId(),t.appInstanceId=i.get_appInstanceId(),t.appInstanceId&&(t.appInstanceId=l(t.appInstanceId),t.appInstanceId=f(i.get_id(),t.appInstanceId)),t.message=i.get_hostCustomMessage(),t.officeJSVersion=OSF.ConstantNames.FileVersion,t.hostJSVersion="0.0.0.0",i._wacHostEnvironment&&(t.wacHostEnvironment=i._wacHostEnvironment),void 0!==i._isFromWacAutomation&&null!==i._isFromWacAutomation&&(t.isFromWacAutomation=i._isFromWacAutomation.toString().toLowerCase());var c=i.get_docUrl();t.docUrl=o.test(c)?c:"";var u=location.href;u&&(u=u.split("?")[0].split("#")[0]),t.appURL="",function(e,t){var n,i;t.assetId="",t.userId="";try{n=decodeURIComponent(e);var o=(i=(new DOMParser).parseFromString(n,"text/xml")).getElementsByTagName("t")[0].attributes.getNamedItem("cid"),r=i.getElementsByTagName("t")[0].attributes.getNamedItem("oid");o&&o.nodeValue?t.userId=o.nodeValue:r&&r.nodeValue&&(t.userId=r.nodeValue),t.assetId=i.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}catch(e){}finally{n=null,i=null,null}}(i.get_eToken(),t),t.sessionId=n,"undefined"!==typeof OTel&&OTel.OTelLogger.initialize(t),function(){var t=new Date,n=null,i=0,o=!1,r=function(){document.hasFocus()?null==n&&(n=new Date):n&&(i+=Math.abs((new Date).getTime()-n.getTime()),n=null)},s=[];s.push(new a("focus",r)),s.push(new a("blur",r)),s.push(new a("focusout",r)),s.push(new a("focusin",r));var c=function(){for(var r=0;r<s.length;r++)OSF.OUtil.removeEventListener(window,s[r].name,s[r].handler);s.length=0,o||(document.hasFocus()&&n&&(i+=Math.abs((new Date).getTime()-n.getTime()),n=null),e.onAppClosed(Math.abs((new Date).getTime()-t.getTime()),i),o=!0)};s.push(new a("beforeunload",c)),s.push(new a("unload",c));for(var l=0;l<s.length;l++)OSF.OUtil.addEventListener(window,s[l].name,s[l].handler);r()}(),e.onAppActivated()}},e.onAppActivated=function(){if(t){(new s).enumerateLog((function(e,t){return(new c).LogRawData(t)}),!0);var e=new OSFLog.AppActivatedUsageData;e.SessionId=n,e.AppId=t.appId,e.AssetId=t.assetId,e.AppURL="",e.UserId="",e.ClientId=t.clientId,e.Browser=t.browser,e.HostVersion=t.hostVersion,e.CorrelationId=l(t.correlationId),e.AppSizeWidth=window.innerWidth,e.AppSizeHeight=window.innerHeight,e.AppInstanceId=t.appInstanceId,e.Message=t.message,e.DocUrl=t.docUrl,e.OfficeJSVersion=t.officeJSVersion,e.HostJSVersion=t.hostJSVersion,t.wacHostEnvironment&&(e.WacHostEnvironment=t.wacHostEnvironment),void 0!==t.isFromWacAutomation&&null!==t.isFromWacAutomation&&(e.IsFromWacAutomation=t.isFromWacAutomation),(new c).LogData(e)}},e.onScriptDone=function(e,t,i,o){var r=new OSFLog.ScriptLoadUsageData;r.CorrelationId=l(o),r.SessionId=n,r.ScriptId=e,r.StartTime=t,r.ResponseTime=i,(new c).LogData(r)},e.onCallDone=function(e,o,r,a,s){if(t&&function(){if(!OSF._OfficeAppFactory||!OSF._OfficeAppFactory.getHostInfo)return!1;var e=OSF._OfficeAppFactory.getHostInfo();if(!e)return!1;switch(e.hostType){case"outlook":switch(e.hostPlatform){case"mac":case"web":return!0;default:return!1}default:return!1}}()&&function(e,t){if("method"===t)switch(e){case 3:case 4:case 38:case 37:case 10:case 12:return!0;default:return!1}return!1}(o,e)){var u=new OSFLog.APIUsageUsageData;u.CorrelationId=l(i),u.SessionId=n,u.APIType=e,u.APIID=o,u.Parameters=r,u.ResponseTime=a,u.ErrorType=s,(new c).LogData(u)}},e.onMethodDone=function(e,t,n,i){var o=null;if(t)if("number"==typeof t)o=String(t);else if("object"===typeof t)for(var r in t)null!==o?o+=",":o="","number"==typeof t[r]&&(o+=String(t[r]));else o="";OSF.AppTelemetry.onCallDone("method",e,o,n,i)},e.onPropertyDone=function(e,t){OSF.AppTelemetry.onCallDone("property",-1,e,t)},e.onCheckWACHost=function(e,t,n,i,o){var r=new OSFLog.CheckWACHostUsageData;r.isWacKnownHost=e,r.instanceId=t,r.hostType=n,r.hostPlatform=i,r.wacDomain="",(new c).LogData(r)},e.onEventDone=function(e,t){OSF.AppTelemetry.onCallDone("event",e,null,0,t)},e.onRegisterDone=function(e,t,n,i){OSF.AppTelemetry.onCallDone(e?"registerevent":"unregisterevent",t,null,n,i)},e.onAppClosed=function(e,o){if(t){var r=new OSFLog.AppClosedUsageData;r.CorrelationId=l(i),r.SessionId=n,r.FocusTime=o,r.OpenTime=e,r.AppSizeFinalWidth=window.innerWidth,r.AppSizeFinalHeight=window.innerHeight,(new s).saveLog(n,r.SerializeRow())}},e.setOsfControlAppCorrelationId=function(e){i=l(e)},e.doAppInitializationLogging=u,e.logAppCommonMessage=function(e){u(!1,e)},e.logAppException=function(e){u(!0,e)},e.canSendAddinId=d,e.getCompliantAppInstanceId=f,e._isComplianceExceptedHost=p,OSF.AppTelemetry=e}(OSFAppTelemetry||(OSFAppTelemetry={})),Microsoft.Office.WebExtension.EventType={},OSF.EventDispatch=function(e){if(this._eventHandlers={},this._objectEventHandlers={},this._queuedEventsArgs={},null!=e)for(var t=0;t<e.length;t++){var n=e[t];"objectDeleted"==n||"objectSelectionChanged"==n||"objectDataChanged"==n||"contentControlAdded"==n?this._objectEventHandlers[n]={}:this._eventHandlers[n]=[],this._queuedEventsArgs[n]=[]}},OSF.EventDispatch.prototype={getSupportedEvents:function(){var e=[];for(var t in this._eventHandlers)e.push(t);for(var t in this._objectEventHandlers)e.push(t);return e},supportsEvent:function(e){for(var t in this._eventHandlers)if(e==t)return!0;for(var t in this._objectEventHandlers)if(e==t)return!0;return!1},hasEventHandler:function(e,t){var n=this._eventHandlers[e];if(n&&n.length>0)for(var i=0;i<n.length;i++)if(n[i]===t)return!0;return!1},hasObjectEventHandler:function(e,t,n){var i=this._objectEventHandlers[e];if(null!=i)for(var o=i[t],r=0;null!=o&&r<o.length;r++)if(o[r]===n)return!0;return!1},addEventHandler:function(e,t){if("function"!=typeof t)return!1;var n=this._eventHandlers[e];return!(!n||this.hasEventHandler(e,t))&&(n.push(t),!0)},addObjectEventHandler:function(e,t,n){if("function"!=typeof n)return!1;var i=this._objectEventHandlers[e];return!(!i||this.hasObjectEventHandler(e,t,n))&&(null==i[t]&&(i[t]=[]),i[t].push(n),!0)},addEventHandlerAndFireQueuedEvent:function(e,t){var n=0==this._eventHandlers[e].length,i=this.addEventHandler(e,t);return n&&i&&this.fireQueuedEvent(e),i},removeEventHandler:function(e,t){var n=this._eventHandlers[e];if(n&&n.length>0)for(var i=0;i<n.length;i++)if(n[i]===t)return n.splice(i,1),!0;return!1},removeObjectEventHandler:function(e,t,n){var i=this._objectEventHandlers[e];if(null!=i)for(var o=i[t],r=0;null!=o&&r<o.length;r++)if(o[r]===n)return o.splice(r,1),!0;return!1},clearEventHandlers:function(e){return"undefined"!=typeof this._eventHandlers[e]&&this._eventHandlers[e].length>0&&(this._eventHandlers[e]=[],!0)},clearObjectEventHandlers:function(e,t){return null!=this._objectEventHandlers[e]&&null!=this._objectEventHandlers[e][t]&&(this._objectEventHandlers[e][t]=[],!0)},getEventHandlerCount:function(e){return void 0!=this._eventHandlers[e]?this._eventHandlers[e].length:-1},getObjectEventHandlerCount:function(e,t){return null==this._objectEventHandlers[e]||null==this._objectEventHandlers[e][t]?0:this._objectEventHandlers[e][t].length},fireEvent:function(e){if(void 0==e.type)return!1;var t=e.type;if(t&&this._eventHandlers[t]){for(var n=this._eventHandlers[t],i=0;i<n.length;i++)n[i](e);return!0}return!1},fireObjectEvent:function(e,t){if(void 0==t.type)return!1;var n=t.type;if(n&&this._objectEventHandlers[n]){var i=this._objectEventHandlers[n][e];if(null!=i){for(var o=0;o<i.length;o++)i[o](t);return!0}}return!1},fireOrQueueEvent:function(e){var t=e.type;if(t&&this._eventHandlers[t]){var n=this._eventHandlers[t],i=this._queuedEventsArgs[t];return 0==n.length?i.push(e):this.fireEvent(e),!0}return!1},fireQueuedEvent:function(e){if(e&&this._eventHandlers[e]){var t=this._eventHandlers[e],n=this._queuedEventsArgs[e];if(t.length>0){for(var i=t[0];n.length>0;){i(n.shift())}return!0}}return!1},clearQueuedEvent:function(e){e&&this._eventHandlers[e]&&(this._queuedEventsArgs[e]&&(this._queuedEventsArgs[e]=[]))}},OSF.DDA.OMFactory=OSF.DDA.OMFactory||{},OSF.DDA.OMFactory.manufactureEventArgs=function(e,t,n){var i;switch(e){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:i=new OSF.DDA.DocumentSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:i=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(n,t.document),n[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:i=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(n,t.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:i=new OSF.DDA.SettingsChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:i=new OSF.DDA.ActiveViewChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:i=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:i=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:i=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(n);break;case Microsoft.Office.WebExtension.EventType.ObjectDeleted:case Microsoft.Office.WebExtension.EventType.ObjectSelectionChanged:case Microsoft.Office.WebExtension.EventType.ObjectDataChanged:case Microsoft.Office.WebExtension.EventType.ContentControlAdded:i=new OSF.DDA.ObjectEventArgs(e,n[Microsoft.Office.WebExtension.Parameters.Id]);break;case Microsoft.Office.WebExtension.EventType.RichApiMessage:i=new OSF.DDA.RichApiMessageEventArgs(e,n);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:i=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(n[OSF.DDA.DataNodeEventProperties.NewNode]),n[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:i=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(n[OSF.DDA.DataNodeEventProperties.OldNode]),this.manufactureDataNode(n[OSF.DDA.DataNodeEventProperties.NewNode]),n[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:i=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(n[OSF.DDA.DataNodeEventProperties.OldNode]),this.manufactureDataNode(n[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),n[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:i=new OSF.DDA.TaskSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:i=new OSF.DDA.ResourceSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:i=new OSF.DDA.ViewSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.DialogMessageReceived:i=new OSF.DDA.DialogEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived:i=new OSF.DDA.DialogParentEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.ItemChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));i=new OSF.DDA.OlkItemSelectedChangedEventArgs(n),t.initialize(i.initialData),"win32"!=OSF._OfficeAppFactory.getHostInfo().hostPlatform&&"mac"!=OSF._OfficeAppFactory.getHostInfo().hostPlatform||t.setCurrentItemNumber(i.itemNumber.itemNumber);break;case Microsoft.Office.WebExtension.EventType.RecipientsChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));i=new OSF.DDA.OlkRecipientsChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.AppointmentTimeChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));i=new OSF.DDA.OlkAppointmentTimeChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.RecurrenceChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));i=new OSF.DDA.OlkRecurrenceChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.AttachmentsChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));i=new OSF.DDA.OlkAttachmentsChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.EnhancedLocationsChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));i=new OSF.DDA.OlkEnhancedLocationsChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.InfobarClicked:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));i=new OSF.DDA.OlkInfobarClickedEventArgs(n);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e))}return i},OSF.DDA.AsyncMethodNames.addNames({AddHandlerAsync:"addHandlerAsync",RemoveHandlerAsync:"removeHandlerAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,enum:Microsoft.Office.WebExtension.EventType,verify:function(e,t,n){return n.supportsEvent(e)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,enum:Microsoft.Office.WebExtension.EventType,verify:function(e,t,n){return n.supportsEvent(e)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]}),OSF.DialogShownStatus={hasDialogShown:!1,isWindowDialog:!1},OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{DialogMessageReceivedEvent:"DialogMessageReceivedEvent"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DialogMessageReceived:"dialogMessageReceived",DialogEventReceived:"dialogEventReceived"}),OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{MessageType:"messageType",MessageContent:"messageContent",MessageOrigin:"messageOrigin"}),OSF.DDA.DialogEventType={},OSF.OUtil.augmentList(OSF.DDA.DialogEventType,{DialogClosed:"dialogClosed",NavigationFailed:"naviationFailed"}),OSF.DDA.AsyncMethodNames.addNames({DisplayDialogAsync:"displayDialogAsync",CloseAsync:"close"}),OSF.DDA.SyncMethodNames.addNames({MessageParent:"messageParent",MessageChild:"messageChild",SendMessage:"sendMessage",AddMessageHandler:"addEventHandler"}),OSF.DDA.UI.ParentUI=function(){var e;e=null!=Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived?new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DialogMessageReceived,Microsoft.Office.WebExtension.EventType.DialogEventReceived,Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived]):new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DialogMessageReceived,Microsoft.Office.WebExtension.EventType.DialogEventReceived]);var t=OSF.DDA.AsyncMethodNames.DisplayDialogAsync.displayName,n=this;n[t]||OSF.OUtil.defineEnumerableProperty(n,t,{value:function(){var t=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.OpenDialog];t(arguments,e,n)}}),OSF.OUtil.finalizeProperties(this)},OSF.DDA.UI.ChildUI=function(e){var t=OSF.DDA.SyncMethodNames.MessageParent.displayName,n=this;n[t]||OSF.OUtil.defineEnumerableProperty(n,t,{value:function(){var e=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.MessageParent];return e(arguments,n)}});var i=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;n[i]||"undefined"==typeof OSF.DialogParentMessageEventDispatch||OSF.DDA.DispIdHost.addEventSupport(n,OSF.DialogParentMessageEventDispatch,e),OSF.OUtil.finalizeProperties(this)},OSF.DialogHandler=function(){},OSF.DDA.DialogEventArgs=function(e){e[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogMessageReceived?OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DialogMessageReceived},message:{value:e[OSF.DDA.PropertyDescriptors.MessageContent]},origin:{value:e[OSF.DDA.PropertyDescriptors.MessageOrigin]}}):OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DialogEventReceived},error:{value:e[OSF.DDA.PropertyDescriptors.MessageType]}})},OSF.DDA.DialogParentEventArgs=function(e){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived},message:{value:e[OSF.DDA.PropertyDescriptors.MessageContent]},origin:{value:e[OSF.DDA.PropertyDescriptors.MessageOrigin]}})},OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.DisplayDialogAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Url,types:["string"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Width,value:{types:["number"],defaultValue:99}},{name:Microsoft.Office.WebExtension.Parameters.Height,value:{types:["number"],defaultValue:99}},{name:Microsoft.Office.WebExtension.Parameters.RequireHTTPs,value:{types:["boolean"],defaultValue:!0}},{name:Microsoft.Office.WebExtension.Parameters.DisplayInIframe,value:{types:["boolean"],defaultValue:!1}},{name:Microsoft.Office.WebExtension.Parameters.HideTitle,value:{types:["boolean"],defaultValue:!1}},{name:Microsoft.Office.WebExtension.Parameters.UseDeviceIndependentPixels,value:{types:["boolean"],defaultValue:!1}},{name:Microsoft.Office.WebExtension.Parameters.PromptBeforeOpen,value:{types:["boolean"],defaultValue:!0}},{name:Microsoft.Office.WebExtension.Parameters.EnforceAppDomain,value:{types:["boolean"],defaultValue:!0}},{name:Microsoft.Office.WebExtension.Parameters.UrlNoHostInfo,value:{types:["boolean"],defaultValue:!1}}],privateStateCallbacks:[],onSucceeded:function(e,t,n){var i=e[Microsoft.Office.WebExtension.Parameters.Id],o=e[Microsoft.Office.WebExtension.Parameters.Data],r=new OSF.DialogHandler,a=OSF.DDA.AsyncMethodNames.CloseAsync.displayName;OSF.OUtil.defineEnumerableProperty(r,a,{value:function(){var e=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.CloseDialog];e(arguments,i,o,r)}});var s=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;if(OSF.OUtil.defineEnumerableProperty(r,s,{value:function(){var e=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.AddMessageHandler.id],t=e.verifyAndExtractCall(arguments,r,o),n=t[Microsoft.Office.WebExtension.Parameters.EventType],i=t[Microsoft.Office.WebExtension.Parameters.Handler];return o.addEventHandlerAndFireQueuedEvent(n,i)}}),!0===OSF.DDA.UI.EnableSendMessageDialogAPI){var c=OSF.DDA.SyncMethodNames.SendMessage.displayName;OSF.OUtil.defineEnumerableProperty(r,c,{value:function(){var e=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.SendMessage];return e(arguments,o,r)}})}if(!0===OSF.DDA.UI.EnableMessageChildDialogAPI){var l=OSF.DDA.SyncMethodNames.MessageChild.displayName;OSF.OUtil.defineEnumerableProperty(r,l,{value:function(){var e=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.SendMessage];return e(arguments,o,r)}})}return r},checkCallArgs:function(e,t,n){return e[Microsoft.Office.WebExtension.Parameters.Width]<=0&&(e[Microsoft.Office.WebExtension.Parameters.Width]=1),!e[Microsoft.Office.WebExtension.Parameters.UseDeviceIndependentPixels]&&e[Microsoft.Office.WebExtension.Parameters.Width]>100&&(e[Microsoft.Office.WebExtension.Parameters.Width]=99),e[Microsoft.Office.WebExtension.Parameters.Height]<=0&&(e[Microsoft.Office.WebExtension.Parameters.Height]=1),!e[Microsoft.Office.WebExtension.Parameters.UseDeviceIndependentPixels]&&e[Microsoft.Office.WebExtension.Parameters.Height]>100&&(e[Microsoft.Office.WebExtension.Parameters.Height]=99),e[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]||(e[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]=!0),e}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.CloseAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[]}),OSF.DDA.SyncMethodCalls.define({method:OSF.DDA.SyncMethodNames.MessageParent,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.MessageToParent,types:["string","number","boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.TargetOrigin,value:{types:["string"],defaultValue:""}}]}),OSF.DDA.SyncMethodCalls.define({method:OSF.DDA.SyncMethodNames.AddMessageHandler,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,enum:Microsoft.Office.WebExtension.EventType,verify:function(e,t,n){return n.supportsEvent(e)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[]}),OSF.DDA.SyncMethodCalls.define({method:OSF.DDA.SyncMethodNames.SendMessage,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.MessageContent,types:["string"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.TargetOrigin,value:{types:["string"],defaultValue:""}}],privateStateCallbacks:[]}),OSF.OUtil.setNamespace("Marshaling",OSF.DDA),OSF.OUtil.setNamespace("Dialog",OSF.DDA.Marshaling),OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys={MessageType:"messageType",MessageContent:"messageContent",MessageOrigin:"messageOrigin",TargetOrigin:"targetOrigin"},OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys={MessageType:"messageType",MessageContent:"messageContent",MessageOrigin:"messageOrigin",TargetOrigin:"targetOrigin"},OSF.DDA.Marshaling.MessageParentKeys={MessageToParent:"messageToParent",TargetOrigin:"targetOrigin"},OSF.DDA.Marshaling.DialogNotificationShownEventType={DialogNotificationShown:"dialogNotificationShown"},OSF.DDA.Marshaling.SendMessageKeys={MessageContent:"messageContent",TargetOrigin:"targetOrigin"},function(e){!function(e){var t="excel",n="word",i="powerpoint",o="outlook",r="visio";e.getDialogCssManager=function(e){switch(e){case t:case n:case i:case o:case r:default:return new a}return null};var a=function(){function e(){this.overlayElementCSS=["position: absolute","top: 0","left: 0","width: 100%","height: 100%","background-color: rgba(198, 198, 198, 0.5)","z-index: 99998"],this.dialogNotificationPanelCSS=["width: 100%","height: 190px","position: absolute","z-index: 99999","background-color: rgba(255, 255, 255, 1)","left: 0px","top: 50%","margin-top: -95px"],this.newWindowNotificationTextPanelCSS=["margin: 20px 14px","font-family: Segoe UI,Arial,Verdana,sans-serif","font-size: 14px","height: 100px","line-height: 100px"],this.newWindowNotificationTextSpanCSS=["display: inline-block","line-height: normal","vertical-align: middle"],this.crossZoneNotificationTextPanelCSS=["margin: 20px 14px","font-family: Segoe UI,Arial,Verdana,sans-serif","font-size: 14px","height: 100px"],this.dialogNotificationButtonPanelCSS="margin:0px 9px",this.buttonStyleCSS=["text-align: center","width: 70px","height: 25px","font-size: 14px","font-family: Segoe UI,Arial,Verdana,sans-serif","margin: 0px 5px","border-width: 1px","border-style: solid"]}return e.prototype.getOverlayElementCSS=function(){return this.overlayElementCSS.join(";")},e.prototype.getDialogNotificationPanelCSS=function(){return this.dialogNotificationPanelCSS.join(";")},e.prototype.getNewWindowNotificationTextPanelCSS=function(){return this.newWindowNotificationTextPanelCSS.join(";")},e.prototype.getNewWindowNotificationTextSpanCSS=function(){return this.newWindowNotificationTextSpanCSS.join(";")},e.prototype.getCrossZoneNotificationTextPanelCSS=function(){return this.crossZoneNotificationTextPanelCSS.join(";")},e.prototype.getDialogNotificationButtonPanelCSS=function(){return this.dialogNotificationButtonPanelCSS},e.prototype.getDialogButtonCSS=function(){return this.buttonStyleCSS.join(";")},e}();e.DefaultDialogCSSManager=a}(e.WacCommonUICssManager||(e.WacCommonUICssManager={}))}(OfficeExt||(OfficeExt={})),function(e){!function(t){!function(t){var n=null,i=null,o=null,r=null,a=null,s=!1,c=-1,l=null,u=e.WACUtils.shouldUseLocalStorageToPassMessage(),d={dispId:OSF.DDA.EventDispId.dispidDialogNotificationShownInAddinEvent,eventType:OSF.DDA.Marshaling.DialogNotificationShownEventType.DialogNotificationShown,onComplete:null,onCalling:null};function f(e,t){var n=t.message,i=t.targetOrigin;if(i)e.postMessage(n,i);else{var o=OSF._OfficeAppFactory.getInitializationHelper()._appContext._appDomains,r=window.location.origin;if(r||(r=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),o)for(var a=0;a<o.length&&-1!==o[a].indexOf("://");a++)e.postMessage(n,o[a]);Microsoft.Office.Common.XdmCommunicationManager.checkUrlWithAppDomains(o,r)||e.postMessage(n,r)}}function p(t,n){var i=!1,a=e.WacCommonUICssManager.getDialogCssManager(n);o=S(a),document.body.insertBefore(o,document.body.firstChild),(r=function(t,n){var i=document.createElement("div");i.style.cssText=t.getDialogNotificationPanelCSS(),C(i);var o=document.createElement("div");o.style.cssText=t.getCrossZoneNotificationTextPanelCSS(),o.id="dialogNotificationTextPanel";var r=document.createElement("a");r.id="configureBrowserLink",r.href="#",r.innerText=Strings.OfficeOM.L_NewWindowCrossZoneConfigureBrowserLink,r.setAttribute("onclick","window.open('https://support.microsoft.com/en-us/help/17479/windows-internet-explorer-11-change-security-privacy-settings', '_blank', 'fullscreen=1')");var a=document.createElement("span");Strings.OfficeOM.L_NewWindowCrossZone&&(a.innerHTML=OSF.OUtil.formatString(Strings.OfficeOM.L_NewWindowCrossZone,r.outerHTML,e.WACUtils.getDomainForUrl(n)));return o.appendChild(a),i.appendChild(o),i}(a,t)).id="crossZoneNotification";var c=A(a),l=y(a,Strings.OfficeOM.L_DialogOK?Strings.OfficeOM.L_DialogOK:"OK");c.appendChild(l),r.appendChild(c),document.body.insertBefore(r,document.body.firstChild),s=!0,l.onclick=function(){b()},l.addEventListener("keydown",(function(e){9==e.keyCode?(document.getElementById("configureBrowserLink").focus(),e.preventDefault(),e.stopPropagation()):13==e.keyCode&&(i=!0,e.preventDefault(),e.stopPropagation())}),!1),l.addEventListener("keyup",(function(e){13==e.keyCode&&i&&(i=!1,b(),e.preventDefault(),e.stopPropagation())}),!1),document.getElementById("configureBrowserLink").addEventListener("keydown",(function(e){9==e.keyCode&&(l.focus(),e.preventDefault(),e.stopPropagation())}),!1),window.focus(),l.focus()}function h(e){if(e.source==n)try{var t=e.origin;if(!function(e,t,n){if(void 0===n&&(n=!0),!e||!t)return!1;var i=OSF.OUtil.parseUrl(e),o=OSF.OUtil.parseUrl(t),r=OSF._OfficeAppFactory.getInitializationHelper()._appContext._appDomains;if(!("https:"===i.protocol))return!1;var a=i.protocol===o.protocol&&i.hostname===o.hostname&&i.port===o.port,s=Microsoft.Office.Common.XdmCommunicationManager.checkUrlWithAppDomains(r,e),c=a||s;return!c&&n&&(c=Microsoft.Office.Common.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(t,e)),c}(t,OSF._OfficeAppFactory.getInitializationHelper()._appContext._addInSourceUrl,!0))throw new Error("Received a message from a dialog with an untrusted domain.");var o={};o[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType]=OSF.DialogMessageType.DialogMessageReceived,o[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageContent]=e.data,o[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageOrigin]=t,i(o)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Error happened during receive message handler."+e)}}function m(e){var t=OSF._OfficeAppFactory.getInitializationHelper()._webAppState.id+"messageParentKey";if(e.key==t)try{var n={};n[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType]=OSF.DialogMessageType.DialogMessageReceived,n[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageContent]=e.newValue,n[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageOrigin]=e.origin,i(n)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Error happened during storage changed handler."+e)}}function g(t){var o=OSF._OfficeAppFactory.getInitializationHelper()._hostInfo,r=(OSF.OUtil.checkFlight(OSF.FlightTreatmentNames.IsPrivateAddin)?[o.hostType,o.hostPlatform,o.hostSpecificFileVersion,o.hostLocale,o.osfControlAppCorrelationId,"isDialog",o.disableLogging?"disableLogging":"",o.flags&OSF.HostInfoFlags.PublicAddin]:[o.hostType,o.hostPlatform,o.hostSpecificFileVersion,o.hostLocale,o.osfControlAppCorrelationId,"isDialog",o.disableLogging?"disableLogging":""]).join("$"),s=OSF._OfficeAppFactory.getInitializationHelper()._appContext;s._taskpaneUrl=window.location.origin,s._taskpaneUrl||(s._taskpaneUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""));var l=t[OSF.ShowWindowDialogParameterKeys.Url];t[OSF.ShowWindowDialogParameterKeys.UrlNoHostInfo]||(l=e.WACUtils.addHostInfoAsQueryParam(l,r));var d=JSON.parse(window.name);d[OSF.WindowNameItemKeys.HostInfo]=r,d[OSF.WindowNameItemKeys.AppContext]=s;var f=t[OSF.ShowWindowDialogParameterKeys.Width]*screen.width/100,g=t[OSF.ShowWindowDialogParameterKeys.Height]*screen.height/100,y="width="+f+", height="+g+", left="+(s._clientWindowWidth/2-f/2)+", top="+(s._clientWindowHeight/2-g/2)+",channelmode=no,directories=no,fullscreen=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes,toolbar=no";if(null==(n=window.open(l,e.WACUtils.serializeObjectToString(d),y)))return OSF.AppTelemetry.logAppCommonMessage("Encountered cross zone issue in displayDialogAsync api."),_(),p(l,o.hostType),void a(OSF.DDA.ErrorCodeManager.errorCodes.ooeCrossZone);u?window.addEventListener("storage",m):window.addEventListener("message",h),c=window.setInterval((function(){try{if(null==n||n.closed){window.clearInterval(c),u?window.removeEventListener("storage",m):window.removeEventListener("message",h);var e={};e[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType]=OSF.DialogMessageType.DialogClosed,i(e)}}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Error happened during check or handle window close."+e)}}),1e3),null!=a?a(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess):OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("showDialogCallback can not be null.")}function y(e,t){var n=document.createElement("input");n.setAttribute("type","button"),n.style.cssText=e.getDialogButtonCSS(),n.style.borderColor="#ababab",n.style.backgroundColor="#ffffff",n.setAttribute("value",t);var i=function(){O(n)},o=function(){v(n)};return n.addEventListener("mouseover",i),n.addEventListener("focus",i),n.addEventListener("mouseout",o),n.addEventListener("focusout",o),n}function O(e){null!=l?(e.style.borderColor=l.HostButtonBorderColor,e.style.backgroundColor=l.HostButtonBackgroundColor):OSF.CommonUI&&OSF.CommonUI.HostButtonBorderColor&&OSF.CommonUI.HostButtonBackgroundColor?(e.style.borderColor=OSF.CommonUI.HostButtonBorderColor,e.style.backgroundColor=OSF.CommonUI.HostButtonBackgroundColor):e.style.backgroundColor="#ccc"}function v(e){e.style.borderColor="#ababab",e.style.backgroundColor="#ffffff"}function b(){d.onCalling=function(e){_(),D(e)},OSF.DDA.WAC.Delegate.unregisterEventAsync(d)}function _(){null!=r&&(document.body.removeChild(r),r=null),null!=o&&(document.body.removeChild(o),o=null)}function S(e){var t=document.createElement("div");return t.style.cssText=e.getOverlayElementCSS(),t}function A(e){var t=document.createElement("div");return t.style.cssText=e.getDialogNotificationButtonPanelCSS(),"rtl"==document.documentElement.getAttribute("dir")?t.style.cssFloat="left":t.style.cssFloat="right",t}function D(e){if(e!=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess){var t=document.querySelectorAll(OSF._OfficeAppFactory.getInitializationHelper()._tabbableElements);OSF.OUtil.focusToFirstTabbable(t,!1)}}function C(e){e.setAttribute("role","dialog"),e.setAttribute("aria-describedby","dialogNotificationTextPanel")}t.setHostThemeButtonStyle=function(e){var t=e.input;null!=t&&(l={HostButtonBorderColor:t[OSF.HostThemeButtonStyleKeys.ButtonBorderColor],HostButtonBackgroundColor:t[OSF.HostThemeButtonStyleKeys.ButtonBackgroundColor]}),e.completed()},t.removeEventListenersForDialog=function(e){OSF._OfficeAppFactory.getInitializationHelper().addOrRemoveEventListenersForWindow(!1),e.completed()},t.handleNewWindowDialog=function(t){try{if(!function(e){var t=OSF._OfficeAppFactory.getInitializationHelper()._appContext._appDomains,n=e[OSF.ShowWindowDialogParameterKeys.Url],i=Microsoft.Office.Common.XdmCommunicationManager.checkUrlWithAppDomains(t,n);if(!i)return OSF._OfficeAppFactory.getInitializationHelper()._appContext._addInSourceUrl&&Microsoft.Office.Common.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(OSF._OfficeAppFactory.getInitializationHelper()._appContext._addInSourceUrl,n);return i}(t))return void a(OSF.DDA.ErrorCodeManager.errorCodes.ooeAppDomains);if(!t[OSF.ShowWindowDialogParameterKeys.PromptBeforeOpen])return void g(t);s=!1;var n=!1,i=OSF._OfficeAppFactory.getInitializationHelper()._hostInfo,c=e.WacCommonUICssManager.getDialogCssManager(i.hostType),l=OSF.OUtil.formatString(Strings.OfficeOM.L_ShowWindowDialogNotification,OSF._OfficeAppFactory.getInitializationHelper()._appContext._addinName);o=S(c);var u=function(e){var t=[];try{for(;e.firstChild&&null!=e.firstChild;)t.push(e.firstChild),e.removeChild(e.firstChild)}catch(e){}return t}(document.body);document.body.appendChild(o),(r=function(e,t){var n=document.createElement("div");n.style.cssText=e.getDialogNotificationPanelCSS(),C(n);var i=document.createElement("div");i.style.cssText=e.getNewWindowNotificationTextPanelCSS(),i.id="dialogNotificationTextPanel","rtl"==document.documentElement.getAttribute("dir")?i.style.paddingRight="30px":i.style.paddingLeft="30px";var o=document.createElement("span");return o.style.cssText=e.getNewWindowNotificationTextSpanCSS(),o.innerText=t,i.appendChild(o),n.appendChild(i),n}(c,l)).id="newWindowNotificaiton";var f=A(c),p=y(c,Strings.OfficeOM.L_ShowWindowDialogNotificationAllow),h=y(c,Strings.OfficeOM.L_ShowWindowDialogNotificationIgnore);function m(e,t){try{for(var n=0;n<t.length;n++)e.appendChild(t[n])}catch(e){}}function P(e){d.onCalling=function(e){_(),D(e),a(OSF.DDA.ErrorCodeManager.errorCodes.ooeEndUserIgnore)},OSF.DDA.WAC.Delegate.unregisterEventAsync(d),m(document.body,u),u=[],e.preventDefault(),e.stopPropagation()}f.appendChild(p),f.appendChild(h),r.appendChild(f),document.body.insertBefore(r,document.body.firstChild),p.onclick=function(e){g(t),s||b(),m(document.body,u),u=[],e.preventDefault(),e.stopPropagation()},h.onclick=P,p.addEventListener("keydown",(function(e){e.shiftKey&&9==e.keyCode&&(v(p),O(h),h.focus(),e.preventDefault(),e.stopPropagation())}),!1),h.addEventListener("keydown",(function(e){e.shiftKey||9!=e.keyCode?13==e.keyCode&&(n=!0,e.preventDefault(),e.stopPropagation()):(v(h),O(p),p.focus(),e.preventDefault(),e.stopPropagation())}),!1),h.addEventListener("keyup",(function(e){13==e.keyCode&&n&&(n=!1,P(e))}),!1),window.focus(),d.onCalling=function(e){p.focus()},OSF.DDA.WAC.Delegate.registerEventAsync(d)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception happens at new window dialog."+e),a(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError)}},t.closeDialog=function(e){try{if(null!=n){var t=OSF._OfficeAppFactory.getInitializationHelper()._appContext._appDomains;if(t)for(var i=0;i<t.length&&-1!==t[i].indexOf("://");i++)n.postMessage("osfDialogInternal:action=closeDialog",t[i]);null==n||n.closed||n.close(),u?window.removeEventListener("storage",m):window.removeEventListener("message",h),window.clearInterval(c),n=null,e(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)}else e(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError)}catch(t){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception happens at close window dialog."+t),e(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError)}},t.messageParent=function(e){var t=e.hostCallArgs[Microsoft.Office.WebExtension.Parameters.MessageToParent],n=e.hostCallArgs[Microsoft.Office.WebExtension.Parameters.TargetOrigin]||null;if(u)try{var i=OSF._OfficeAppFactory.getInitializationHelper()._webAppState.id+"messageParentKey";window.localStorage.setItem(i,t)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Error happened during messageParent method:"+e)}else f(window.opener,{message:t,targetOrigin:n})},t.sendMessage=function(e){if(null!=n){var t=e.hostCallArgs,i=t[Microsoft.Office.WebExtension.Parameters.TargetOrigin]||null;delete t[Microsoft.Office.WebExtension.Parameters.TargetOrigin],"string"!=typeof t&&(t=JSON.stringify(t)),f(n,{message:t,targetOrigin:i})}},t.postDialogMessage=f,t.registerMessageReceivedEvent=function(){window.addEventListener("message",(function(t){var n=t.origin;if(t.source==window.opener&&(!0===window.office_disable_receive_dialog_message_prompt||e.AddinNativeAction.Dialog.validateTaskpaneDomain(n,!0)))if("string"===typeof t.data&&t.data.indexOf("osfDialogInternal:action=closeDialog")>-1)window.close();else{var i=t.data,o=typeof i;if(i&&("object"==o||"string"==o)){var r="string"==o?JSON.parse(i):i,a={};a[OSF.DDA.PropertyDescriptors.MessageContent]=r.messageContent,a[OSF.DDA.PropertyDescriptors.MessageOrigin]=t.origin;var s=OSF.DDA.OMFactory.manufactureEventArgs(Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived,null,a);OSF.DialogParentMessageEventDispatch.fireEvent(s)}}}))},t.setHandlerAndShowDialogCallback=function(e,t){i=e,a=t},t.escDismissDialogNotification=function(){try{r&&"newWindowNotificaiton"==r.id&&a&&a(OSF.DDA.ErrorCodeManager.errorCodes.ooeEndUserIgnore)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Error happened during executing displayDialogAsync callback."+e)}b()},t.showCrossZoneNotification=p,t.getWithExpiry=function(e,t){var n=e.getItem(t);if(!n)return"undefined";var i=JSON.parse(n);return i.expiry&&i.value?(new Date).getTime()>i.expiry?(e.removeItem(t),"undefined"):i.value:"undefined"},t.setWithExpiry=function(e,t,n){var i={value:n,expiry:(new Date).getTime()+864e5};e.setItem(t,JSON.stringify(i))},t.getLocalStorage=function(){return e.SafeStorage?new e.SafeStorage(window.localStorage):window.localStorage},t.getSessionStorage=function(){return e.SafeStorage?new e.SafeStorage(window.sessionStorage):window.sessionStorage},t.getUrlProtocolHostnamePort=function(e){var t=e.port?":"+e.port:"";return e.protocol+"//"+e.hostname+t},t.validateTaskpaneDomain=function(e,t){try{if(!e)return!1;t||(t=!0);var n=window.location.origin;n||(n=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""));var i=OSF.OUtil.parseUrl(n,!0),o=OSF.OUtil.parseUrl(e,!0);if(!i.protocol||!i.hostname||!o.protocol||!o.hostname||void 0===o.port)return!1;var r=function(e,t){return e.hostname==t.hostname&&e.protocol==t.protocol&&function(e,t){return e.port==t.port||""==e.port&&"http:"==e.protocol&&"80"==t.port||""==e.port&&"https:"==e.protocol&&"443"==t.port||""==t.port&&"http:"==t.protocol&&"80"==e.port||""==t.port&&"https:"==t.protocol&&"443"==e.port}(e,t)}(i,o),a=!1;if(t&&(a=Microsoft.Office.Common.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(e,n)),r||a)return!0;var s=this.getLocalStorage(),c=this.getSessionStorage(),l="_trusts_"+(o.protocol+"//"+o.hostname+(o.port?":"+o.port:"")),u=this.getWithExpiry(s,l),d=this.getWithExpiry(c,l);if("true"===u)return!0;if("false"===d)return!1;var f=this.getUrlProtocolHostnamePort(o),p=this.getUrlProtocolHostnamePort(i),h='You are about to send and receive potentially sensitive information from "'+p+'". Only click OK if you trust the following website recieving the sensitive information: "'+f+'".';return Strings.OfficeOM.L_ConfirmDialogApiTrustsParent&&(h=Strings.OfficeOM.L_ConfirmDialogApiTrustsParent.replace("{0}",p).replace("{1}",f)),window.confirm(h)?(this.setWithExpiry(s,l,"true"),this.setWithExpiry(c,l,"true"),!0):(this.setWithExpiry(s,l,"false"),this.setWithExpiry(c,l,"false"),!1)}catch(e){return OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Error happened during validateTaskpaneDomain method:"+e),!1}}}(t.Dialog||(t.Dialog={}))}(e.AddinNativeAction||(e.AddinNativeAction={}))}(OfficeExt||(OfficeExt={})),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDialogMessageReceivedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.DialogMessageReceivedEvent),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.MessageType,value:OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType},{name:OSF.DDA.PropertyDescriptors.MessageContent,value:OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageContent},{name:OSF.DDA.PropertyDescriptors.MessageOrigin,value:OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageOrigin}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDialogParentMessageReceivedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.MessageType,value:OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys.MessageType},{name:OSF.DDA.PropertyDescriptors.MessageContent,value:OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys.MessageContent},{name:OSF.DDA.PropertyDescriptors.MessageOrigin,value:OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys.MessageOrigin}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidMessageParentMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.MessageToParent,value:OSF.DDA.Marshaling.MessageParentKeys.MessageToParent},{name:Microsoft.Office.WebExtension.Parameters.TargetOrigin,value:OSF.DDA.Marshaling.MessageParentKeys.TargetOrigin}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSendMessageMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.MessageContent,value:OSF.DDA.Marshaling.SendMessageKeys.MessageContent},{name:Microsoft.Office.WebExtension.Parameters.TargetOrigin,value:OSF.DDA.Marshaling.MessageParentKeys.TargetOrigin}]}),OSF.DDA.WAC.Delegate.openDialog=function(e){var t=JSON.parse(e.targetId),n=OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!0,e);function i(e){var t={Error:e};try{n(Microsoft.Office.Common.InvokeResultCode.noError,t)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception happens at showDialogCallback."+e)}}if(OSF.DialogShownStatus.hasDialogShown)i(OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened);else{var o=t[OSF.ShowWindowDialogParameterKeys.Url].toLowerCase(),r=window.location.href.toLowerCase();if(OSF.AppTelemetry){var a=!1,s=!1,c=!1,l=!1,u="",d="";if(OSF.OUtil){var f=OSF.OUtil.parseUrl(o),p=OSF.OUtil.parseUrl(r);a=f.protocol===p.protocol&&f.hostname===p.hostname&&f.port===p.port,u=OSF.OUtil.getHostnamePortionForLogging(f.hostname),a?d=u:(d=OSF.OUtil.getHostnamePortionForLogging(p.hostname),s=Microsoft.Office.Common.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(o,r),c=Microsoft.Office.Common.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(r,o));var h=OSF._OfficeAppFactory.getInitializationHelper()._appContext._appDomains;l=Microsoft.Office.Common.XdmCommunicationManager.checkUrlWithAppDomains(h,o)}var m="openDialog isInline: "+t[OSF.ShowWindowDialogParameterKeys.DisplayInIframe].toString()+", taskpaneHostname: "+d+", dialogHostName: "+u+", isSameDomain: "+a.toString()+", parentIsSubdomain: "+s.toString()+", childIsSubdomain: "+c.toString()+", isAppDomain: "+l.toString();OSF.AppTelemetry.logAppCommonMessage(m)}null!=o&&"https://"===o.substr(0,"https://".length)?t[OSF.ShowWindowDialogParameterKeys.DisplayInIframe]?(OSF.DialogShownStatus.isWindowDialog=!1,OSF.DDA.WAC.Delegate.registerEventAsync(e)):(OSF.DialogShownStatus.isWindowDialog=!0,OfficeExt.AddinNativeAction.Dialog.setHandlerAndShowDialogCallback((function(t){e.onEvent&&e.onEvent(t),OSF.AppTelemetry&&OSF.AppTelemetry.onEventDone(e.dispId)}),i),OfficeExt.AddinNativeAction.Dialog.handleNewWindowDialog(t)):"http://"===o.substr(0,"http://".length)?i(OSF.DDA.ErrorCodeManager.errorCodes.ooeRequireHTTPS):i(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidScheme)}},OSF.DDA.WAC.Delegate.validateTaskpaneDomain=function(e,t){return OfficeExt.AddinNativeAction.Dialog.validateTaskpaneDomain(e,t)},OSF.DDA.WAC.Delegate.messageParent=function(e){var t=e.hostCallArgs.targetOrigin,n=!!t;if(n&&"*"!=t){var i=OfficeExt.AddinNativeAction.Dialog.getLocalStorage(),o=OfficeExt.AddinNativeAction.Dialog.getSessionStorage(),r="_trusts_",a=OSF.OUtil.parseUrl(t,!0);r+=a.protocol+"//"+a.hostname+(a.port?":"+a.port:""),OfficeExt.AddinNativeAction.Dialog.setWithExpiry(i,r,"true"),OfficeExt.AddinNativeAction.Dialog.setWithExpiry(o,r,"true")}if(null!=window.opener){if(!n){var s=OSF._OfficeAppFactory.getInitializationHelper()._appContext._taskpaneUrl;if(s){if(!OfficeExt.AddinNativeAction.Dialog.validateTaskpaneDomain(s,!0)){var c="messageParent called but the taskpane domain is untrusted: "+s;throw OSF.AppTelemetry&&OSF.AppTelemetry.logAppException(c),new Error(c)}}else s=window.location.origin;e.hostCallArgs.targetOrigin=s}OfficeExt.AddinNativeAction.Dialog.messageParent(e)}else OSF.DDA.WAC.Delegate.executeAsync(e)},OSF.DDA.WAC.Delegate.sendMessage=function(e){OSF.DialogShownStatus.hasDialogShown&&(OSF.DialogShownStatus.isWindowDialog?OfficeExt.AddinNativeAction.Dialog.sendMessage(e):OSF.DDA.WAC.Delegate.executeAsync(e))},OSF.DDA.WAC.Delegate.closeDialog=function(e){var t=OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!1,e);function n(e){var n={Error:e};try{t(Microsoft.Office.Common.InvokeResultCode.noError,n)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception happens at closeDialogCallback."+e)}}OSF.DialogShownStatus.hasDialogShown?OSF.DialogShownStatus.isWindowDialog?(e.onCalling&&e.onCalling(),OfficeExt.AddinNativeAction.Dialog.closeDialog(n)):OSF.DDA.WAC.Delegate.unregisterEventAsync(e):n(OSF.DDA.ErrorCodeManager.errorCodes.ooeWebDialogClosed)},OSF.InitializationHelper.prototype.dismissDialogNotification=function(){OfficeExt.AddinNativeAction.Dialog.escDismissDialogNotification()},OSF.InitializationHelper.prototype.registerMessageReceivedEventForWindowDialog=function(){OfficeExt.AddinNativeAction.Dialog.registerMessageReceivedEvent()},Microsoft.Office.WebExtension.BindingType={Table:"table",Text:"text",Matrix:"matrix"},OSF.DDA.BindingProperties={Id:"BindingId",Type:Microsoft.Office.WebExtension.Parameters.BindingType},OSF.OUtil.augmentList(OSF.DDA.ListDescriptors,{BindingList:"BindingList"}),OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{Subset:"subset",BindingProperties:"BindingProperties"}),OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList,OSF.DDA.PropertyDescriptors.BindingProperties),OSF.DDA.BindingPromise=function(e,t){this._id=e,OSF.OUtil.defineEnumerableProperty(this,"onFail",{get:function(){return t},set:function(e){var n=typeof e;if("undefined"!=n&&"function"!=n)throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,n);t=e}})},OSF.DDA.BindingPromise.prototype={_fetch:function(e){if(this.binding)e&&e(this.binding);else if(!this._binding){var t=this;Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id,(function(n){n.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded?(OSF.OUtil.defineEnumerableProperty(t,"binding",{value:n.value}),e&&e(t.binding)):t.onFail&&t.onFail(n)}))}return this},getDataAsync:function(){var e=arguments;return this._fetch((function(t){t.getDataAsync.apply(t,e)})),this},setDataAsync:function(){var e=arguments;return this._fetch((function(t){t.setDataAsync.apply(t,e)})),this},addHandlerAsync:function(){var e=arguments;return this._fetch((function(t){t.addHandlerAsync.apply(t,e)})),this},removeHandlerAsync:function(){var e=arguments;return this._fetch((function(t){t.removeHandlerAsync.apply(t,e)})),this}},OSF.DDA.BindingFacade=function(e){this._eventDispatches=[],OSF.OUtil.defineEnumerableProperty(this,"document",{value:e});var t=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[t.AddFromSelectionAsync,t.AddFromNamedItemAsync,t.GetAllAsync,t.GetByIdAsync,t.ReleaseByIdAsync])},OSF.DDA.UnknownBinding=function(e,t){OSF.OUtil.defineEnumerableProperties(this,{document:{value:t},id:{value:e}})},OSF.DDA.Binding=function(e,t){OSF.OUtil.defineEnumerableProperties(this,{document:{value:t},id:{value:e}});var n=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[n.GetDataAsync,n.SetDataAsync]);var i=Microsoft.Office.WebExtension.EventType,o=t.bindings._eventDispatches;o[e]||(o[e]=new OSF.EventDispatch([i.BindingSelectionChanged,i.BindingDataChanged]));var r=o[e];OSF.DDA.DispIdHost.addEventSupport(this,r)},OSF.DDA.generateBindingId=function(){return"UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+(new Date).getTime()},OSF.DDA.OMFactory=OSF.DDA.OMFactory||{},OSF.DDA.OMFactory.manufactureBinding=function(e,t){var n,i=e[OSF.DDA.BindingProperties.Id],o=e[OSF.DDA.BindingProperties.RowCount],r=e[OSF.DDA.BindingProperties.ColumnCount],a=e[OSF.DDA.BindingProperties.HasHeaders];switch(e[OSF.DDA.BindingProperties.Type]){case Microsoft.Office.WebExtension.BindingType.Text:n=new OSF.DDA.TextBinding(i,t);break;case Microsoft.Office.WebExtension.BindingType.Matrix:n=new OSF.DDA.MatrixBinding(i,t,o,r);break;case Microsoft.Office.WebExtension.BindingType.Table:n=new(function(){return OSF.DDA.ExcelDocument&&Microsoft.Office.WebExtension.context.document&&Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument}()&&OSF.DDA.ExcelTableBinding?OSF.DDA.ExcelTableBinding:OSF.DDA.TableBinding)(i,t,o,r,a);break;default:n=new OSF.DDA.UnknownBinding(i,t)}return n},OSF.DDA.AsyncMethodNames.addNames({AddFromSelectionAsync:"addFromSelectionAsync",AddFromNamedItemAsync:"addFromNamedItemAsync",GetAllAsync:"getAllAsync",GetByIdAsync:"getByIdAsync",ReleaseByIdAsync:"releaseByIdAsync",GetDataAsync:"getDataAsync",SetDataAsync:"setDataAsync"}),function(){function e(e){return OSF.DDA.OMFactory.manufactureBinding(e,Microsoft.Office.WebExtension.context.document)}function t(e){return e.id}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,enum:Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:["string"],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:["object"],defaultValue:null}}],privateStateCallbacks:[],onSucceeded:e}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,types:["string"]},{name:Microsoft.Office.WebExtension.Parameters.BindingType,enum:Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:["string"],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:["object"],defaultValue:null}}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:function(){return!0}}],onSucceeded:e}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetAllAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(t){return OSF.OUtil.mapList(t[OSF.DDA.ListDescriptors.BindingList],e)}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:["string"]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:e}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:["string"]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(e,t,n){var i=n[Microsoft.Office.WebExtension.Parameters.Id];delete t._eventDispatches[i]}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{enum:Microsoft.Office.WebExtension.CoercionType,calculate:function(e,t){return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)}}},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{enum:Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{enum:Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:["object","string"],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:["object"],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:["number"],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:["number"],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:{types:["number"],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:{types:["number"],defaultValue:0}}],checkCallArgs:function(e,t,n){if(0==e[Microsoft.Office.WebExtension.Parameters.StartRow]&&0==e[Microsoft.Office.WebExtension.Parameters.StartColumn]&&0==e[Microsoft.Office.WebExtension.Parameters.RowCount]&&0==e[Microsoft.Office.WebExtension.Parameters.ColumnCount]&&(delete e[Microsoft.Office.WebExtension.Parameters.StartRow],delete e[Microsoft.Office.WebExtension.Parameters.StartColumn],delete e[Microsoft.Office.WebExtension.Parameters.RowCount],delete e[Microsoft.Office.WebExtension.Parameters.ColumnCount]),e[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)&&(e[Microsoft.Office.WebExtension.Parameters.StartRow]||e[Microsoft.Office.WebExtension.Parameters.StartColumn]||e[Microsoft.Office.WebExtension.Parameters.RowCount]||e[Microsoft.Office.WebExtension.Parameters.ColumnCount]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return e},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:t}],onSucceeded:function(e,t,n){var i=e[Microsoft.Office.WebExtension.Parameters.Data];return OSF.DDA.TableDataProperties&&i&&(void 0!=i[OSF.DDA.TableDataProperties.TableRows]||void 0!=i[OSF.DDA.TableDataProperties.TableHeaders])&&(i=OSF.DDA.OMFactory.manufactureTableData(i)),void 0==(i=OSF.DDA.DataCoercion.coerceData(i,n[Microsoft.Office.WebExtension.Parameters.CoercionType]))?null:i}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["string","object","number","boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{enum:Microsoft.Office.WebExtension.CoercionType,calculate:function(e){return OSF.DDA.DataCoercion.determineCoercionType(e[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:["object","string"],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:["object"],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:["number"],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:["number"],defaultValue:0}}],checkCallArgs:function(e,t,n){if(0==e[Microsoft.Office.WebExtension.Parameters.StartRow]&&0==e[Microsoft.Office.WebExtension.Parameters.StartColumn]&&(delete e[Microsoft.Office.WebExtension.Parameters.StartRow],delete e[Microsoft.Office.WebExtension.Parameters.StartColumn]),e[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)&&(e[Microsoft.Office.WebExtension.Parameters.StartRow]||e[Microsoft.Office.WebExtension.Parameters.StartColumn]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return e},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:t}]})}(),OSF.OUtil.augmentList(OSF.DDA.BindingProperties,{RowCount:"BindingRowCount",ColumnCount:"BindingColumnCount",HasHeaders:"HasHeaders"}),OSF.DDA.MatrixBinding=function(e,t,n,i){OSF.DDA.MatrixBinding.uber.constructor.call(this,e,t),OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Matrix},rowCount:{value:n||0},columnCount:{value:i||0}})},OSF.OUtil.extend(OSF.DDA.MatrixBinding,OSF.DDA.Binding),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.GetData,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:"CoerceType"},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:"ValueFormat"},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:"FilterType"},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:"Rows"},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:"Columns"},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:"StartRow"},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:"StartCol"},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:"RowCount"},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:"ColCount"}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SetData,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:"CoerceType"},{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:"Rows"},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:"Columns"},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:"StartRow"},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:"StartCol"},{name:Microsoft.Office.WebExtension.Parameters.ImageLeft,value:"ImageLeft"},{name:Microsoft.Office.WebExtension.Parameters.ImageTop,value:"ImageTop"},{name:Microsoft.Office.WebExtension.Parameters.ImageWidth,value:"ImageWidth"},{name:Microsoft.Office.WebExtension.Parameters.ImageHeight,value:"ImageHeight"}]}),OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.BindingProperties),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.BindingRequest,toHost:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,value:"ItemName"},{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.BindingType,value:"BindingType"},{name:Microsoft.Office.WebExtension.Parameters.PromptText,value:"PromptText"},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:"Columns"},{name:Microsoft.Office.WebExtension.Parameters.SampleData,value:"SampleData"},{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:"FailOnCollision"}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.BindingType,toHost:[{name:Microsoft.Office.WebExtension.BindingType.Text,value:2},{name:Microsoft.Office.WebExtension.BindingType.Matrix,value:3},{name:Microsoft.Office.WebExtension.BindingType.Table,value:1}],invertible:!0}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.BindingProperties,fromHost:[{name:OSF.DDA.BindingProperties.Id,value:"Name"},{name:OSF.DDA.BindingProperties.Type,value:"BindingType"},{name:OSF.DDA.BindingProperties.RowCount,value:"RowCount"},{name:OSF.DDA.BindingProperties.ColumnCount,value:"ColCount"},{name:OSF.DDA.BindingProperties.HasHeaders,value:"HasHeaders"}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:0}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseBindingMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,fromHost:[{name:OSF.DDA.ListDescriptors.BindingList,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.GetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetBindingDataMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddRowsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.AddRowsColumns,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddColumnsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.AddRowsColumns,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidClearAllRowsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.AddRowsColumns,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.Subset,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:"StartRow"},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:"StartCol"},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:"RowCount"},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:"ColCount"}]}),OSF.DDA.AsyncMethodNames.addNames({GetSelectedDataAsync:"getSelectedDataAsync",SetSelectedDataAsync:"setSelectedDataAsync"}),function(){OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,enum:Microsoft.Office.WebExtension.CoercionType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{enum:Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{enum:Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}}],privateStateCallbacks:[],onSucceeded:function(e,t,n){var i=e[Microsoft.Office.WebExtension.Parameters.Data];return OSF.DDA.TableDataProperties&&i&&(void 0!=i[OSF.DDA.TableDataProperties.TableRows]||void 0!=i[OSF.DDA.TableDataProperties.TableHeaders])&&(i=OSF.DDA.OMFactory.manufactureTableData(i)),void 0==(i=OSF.DDA.DataCoercion.coerceData(i,n[Microsoft.Office.WebExtension.Parameters.CoercionType]))?null:i}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["string","object","number","boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{enum:Microsoft.Office.WebExtension.CoercionType,calculate:function(e){return OSF.DDA.DataCoercion.determineCoercionType(e[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.ImageLeft,value:{types:["number","boolean"],defaultValue:!1}},{name:Microsoft.Office.WebExtension.Parameters.ImageTop,value:{types:["number","boolean"],defaultValue:!1}},{name:Microsoft.Office.WebExtension.Parameters.ImageWidth,value:{types:["number","boolean"],defaultValue:!1}},{name:Microsoft.Office.WebExtension.Parameters.ImageHeight,value:{types:["number","boolean"],defaultValue:!1}}],privateStateCallbacks:[]})}(),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.GetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.SettingsManager={SerializedSettings:"serializedSettings",RefreshingSettings:"refreshingSettings",DateJSONPrefix:"Date(",DataJSONSuffix:")",serializeSettings:function(e){return OSF.OUtil.serializeSettings(e)},deserializeSettings:function(e){return OSF.OUtil.deserializeSettings(e)}},OSF.DDA.Settings=function(e){e=e||{};var t=function(e){var t=OSF.OUtil.getSessionStorage();if(t){var n=OSF.DDA.SettingsManager.serializeSettings(e),i=JSON?JSON.stringify(n):Sys.Serialization.JavaScriptSerializer.serialize(n);t.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),i)}};OSF.OUtil.defineEnumerableProperties(this,{get:{value:function(t){var n=Function._validateParams(arguments,[{name:"name",type:String,mayBeNull:!1}]);if(n)throw n;var i=e[t];return"undefined"===typeof i?null:i}},set:{value:function(n,i){var o=Function._validateParams(arguments,[{name:"name",type:String,mayBeNull:!1},{name:"value",mayBeNull:!0}]);if(o)throw o;e[n]=i,t(e)}},remove:{value:function(n){var i=Function._validateParams(arguments,[{name:"name",type:String,mayBeNull:!1}]);if(i)throw i;delete e[n],t(e)}}}),OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.SaveAsync],e)},OSF.DDA.RefreshableSettings=function(e){OSF.DDA.RefreshableSettings.uber.constructor.call(this,e),OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.RefreshAsync],e),OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]))},OSF.OUtil.extend(OSF.DDA.RefreshableSettings,OSF.DDA.Settings),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{SettingsChanged:"settingsChanged"}),OSF.DDA.SettingsChangedEventArgs=function(e){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.SettingsChanged},settings:{value:e}})},OSF.DDA.AsyncMethodNames.addNames({RefreshAsync:"refreshAsync",SaveAsync:"saveAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RefreshAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.RefreshingSettings,value:function(e,t){return t}}],onSucceeded:function(e,t,n){var i=e[OSF.DDA.SettingsManager.SerializedSettings],o=OSF.DDA.SettingsManager.deserializeSettings(i),r=n[OSF.DDA.SettingsManager.RefreshingSettings];for(var a in r)t.remove(a);for(var a in o)t.set(a,o[a]);return t}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SaveAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:{types:["boolean"],defaultValue:!0}}],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:function(e,t){return OSF.DDA.SettingsManager.serializeSettings(t)}}]}),OSF.DDA.WAC.SettingsTranslator=function(){return{read:function(e){var t=OSF.DDA.ExcelDocument&&Microsoft.Office.WebExtension.context.document&&Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument,n={},i=e.Settings;for(var o in i){var r=i[o];t?n[r.Name]=r.Value:n[r[0]]=r[1]}return n},write:function(e){var t=[];for(var n in e){var i=[];i[0]=n,i[1]=e[n],t.push(i)}return t}}}(),OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(OSF.DDA.SettingsManager.SerializedSettings,{toHost:OSF.DDA.WAC.SettingsTranslator.write,fromHost:OSF.DDA.WAC.SettingsTranslator.read}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SettingsRequest,toHost:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:"OverwriteIfStale"},{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.WAC.UniqueArguments.Properties}],invertible:!0}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidLoadSettingsMethod,fromHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.WAC.UniqueArguments.Properties}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSaveSettingsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SettingsRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidSettingsChangedEvent}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DocumentSelectionChanged:"documentSelectionChanged"}),OSF.DDA.DocumentSelectionChangedEventArgs=function(e){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged},document:{value:e}})},OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{ObjectDeleted:"objectDeleted"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{ObjectSelectionChanged:"objectSelectionChanged"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{ObjectDataChanged:"objectDataChanged"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{ContentControlAdded:"contentControlAdded"}),OSF.DDA.ObjectEventArgs=function(e,t){OSF.OUtil.defineEnumerableProperties(this,{type:{value:e},object:{value:t}})},OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent}),OSF.DDA.AsyncMethodNames.addNames({ExecuteRichApiRequestAsync:"executeRichApiRequestAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[]}),OSF.OUtil.setNamespace("RichApi",OSF.DDA),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.ArrayData}],fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}]}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{RichApiMessage:"richApiMessage"}),OSF.DDA.RichApiMessageEventArgs=function(e,t){var n=t[Microsoft.Office.WebExtension.Parameters.Data],i=[];if(n)for(var o=0;o<n.length;o++){var r=n[o];r.toArray&&(r=r.toArray()),i.push({messageCategory:r[0],messageType:r[1],targetId:r[2],message:r[3],id:r[4],isRemoteOverride:r[5]})}OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.RichApiMessage},entries:{value:i}})},function(e){var t=function(){function e(){this._eventDispatch=null,this._registerHandlers=[],this._eventDispatch=new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.RichApiMessage]),OSF.DDA.DispIdHost.addEventSupport(this,this._eventDispatch)}return e.prototype.register=function(e){var t=this;return this._registerWithHostPromise||(this._registerWithHostPromise=new Office.Promise((function(e,n){t.addHandlerAsync(Microsoft.Office.WebExtension.EventType.RichApiMessage,(function(e){t._registerHandlers.forEach((function(t){t&&t(e)}))}),(function(t){"failed"==t.status?n(t.error):e()}))}))),this._registerWithHostPromise.then((function(){t._registerHandlers.push(e)}))},e}();e.RichApiMessageManager=t}(OfficeExt||(OfficeExt={})),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidRichApiMessageEvent,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.ArrayData}],fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.ArrayData}]}),function(e){!function(t){var n=function(){function n(){var e=this;this._pseudoDocument=null,this._eventDispatch=null,this._processAppCommandInvocation=function(t){var n=e._verifyManifestCallback(t.callbackName);if(n.errorCode==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess){var i=e._constructEventObjectForCallback(t);i?window.setTimeout((function(){n.callback(i)}),0):e._invokeAppCommandCompletedMethod(t.appCommandId,OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError,"")}else e._invokeAppCommandCompletedMethod(t.appCommandId,n.errorCode,"")}}return n.initializeOsfDda=function(){OSF.DDA.AsyncMethodNames.addNames({AppCommandInvocationCompletedAsync:"appCommandInvocationCompletedAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:["string"]},{name:Microsoft.Office.WebExtension.Parameters.Status,types:["number"]},{name:Microsoft.Office.WebExtension.Parameters.AppCommandInvocationCompletedData,types:["string"]}]}),OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{AppCommandInvokedEvent:"AppCommandInvokedEvent"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{AppCommandInvoked:"appCommandInvoked"}),OSF.OUtil.setNamespace("AppCommand",OSF.DDA),OSF.DDA.AppCommand.AppCommandInvokedEventArgs=e.AppCommand.AppCommandInvokedEventArgs},n.prototype.initializeAndChangeOnce=function(e){t.registerDdaFacade(),this._pseudoDocument={},OSF.DDA.DispIdHost.addAsyncMethods(this._pseudoDocument,[OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync]),this._eventDispatch=new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.AppCommandInvoked]);OSF.DDA.DispIdHost.addEventSupport(this._pseudoDocument,this._eventDispatch),this._pseudoDocument.addHandlerAsync(Microsoft.Office.WebExtension.EventType.AppCommandInvoked,this._processAppCommandInvocation,(function(t){e&&("succeeded"==t.status?e(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess):e(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError))}))},n.prototype._verifyManifestCallback=function(e){var t={callback:null,errorCode:OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCallback};e=e.trim();try{var n=this._getCallbackFunc(e);if("function"!=typeof n)return t}catch(e){return t}return{callback:n,errorCode:OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess}},n.prototype._getCallbackFuncFromWindow=function(e){for(var t=e.split("."),n=window,i=0;i<t.length-1;i++){if(!n[t[i]]||"object"!=typeof n[t[i]]&&"function"!=typeof n[t[i]])return null;n=n[t[i]]}return n[t[t.length-1]]},n.prototype._getCallbackFuncFromActionAssociateTable=function(e){var t=e.toUpperCase();return Office.actions._association.mappings[t]},n.prototype._getCallbackFunc=function(e){var t=this._getCallbackFuncFromWindow(e);return t||(t=this._getCallbackFuncFromActionAssociateTable(e)),t},n.prototype._invokeAppCommandCompletedMethod=function(e,t,n){this._pseudoDocument.appCommandInvocationCompletedAsync(e,t,n)},n.prototype._constructEventObjectForCallback=function(e){var t=this,n=new o;try{var i=JSON.parse(e.eventObjStr);this._translateEventObjectInternal(i,n),Object.defineProperty(n,"completed",{value:function(i){n.completedContext=i;var o=JSON.stringify(n);t._invokeAppCommandCompletedMethod(e.appCommandId,OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess,o)},enumerable:!0})}catch(e){n=null}return n},n.prototype._translateEventObjectInternal=function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];"object"==typeof i&&null!=i?(OSF.OUtil.defineEnumerableProperty(t,n,{value:{}}),this._translateEventObjectInternal(i,t[n])):Object.defineProperty(t,n,{value:i,enumerable:!0,writable:!0})}},n.prototype._constructObjectByTemplate=function(e,t){var n={};if(!e||!t)return n;for(var i in e)if(e.hasOwnProperty(i)&&(n[i]=null,null!=t[i])){var o=e[i],r=t[i],a=typeof r;"object"==typeof o&&null!=o?n[i]=this._constructObjectByTemplate(o,r):"number"!=a&&"string"!=a&&"boolean"!=a||(n[i]=r)}return n},n.instance=function(){return null==n._instance&&(n._instance=new n),n._instance},n._instance=null,n}();t.AppCommandManager=n;var i=function(){function e(e,t,n){this.type=Microsoft.Office.WebExtension.EventType.AppCommandInvoked,this.appCommandId=e,this.callbackName=t,this.eventObjStr=n}return e.create=function(n){return new e(n[t.AppCommandInvokedEventEnums.AppCommandId],n[t.AppCommandInvokedEventEnums.CallbackName],n[t.AppCommandInvokedEventEnums.EventObjStr])},e}();t.AppCommandInvokedEventArgs=i;var o=function(){return function(){}}();t.AppCommandCallbackEventArgs=o,t.AppCommandInvokedEventEnums={AppCommandId:"appCommandId",CallbackName:"callbackName",EventObjStr:"eventObjStr"}}(e.AppCommand||(e.AppCommand={}))}(OfficeExt||(OfficeExt={})),OfficeExt.AppCommand.AppCommandManager.initializeOsfDda(),OSF.OUtil.setNamespace("Marshaling",OSF.DDA),OSF.OUtil.setNamespace("AppCommand",OSF.DDA.Marshaling),function(e){e[e.AppCommandId=0]="AppCommandId",e[e.CallbackName=1]="CallbackName",e[e.EventObjStr=2]="EventObjStr"}(OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys||(OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys={})),OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys=OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys,function(e){e[e.Id=0]="Id",e[e.Status=1]="Status",e[e.Data=2]="Data"}(OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys||(OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys={})),OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys=OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys,function(e){!function(t){t.registerDdaFacade=function(){if(OSF.DDA.WAC){var t=OSF.DDA.WAC.Delegate.ParameterMap;t.define({type:OSF.DDA.MethodDispId.dispidAppCommandInvocationCompletedMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys.Id},{name:Microsoft.Office.WebExtension.Parameters.Status,value:OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys.Status},{name:Microsoft.Office.WebExtension.Parameters.AppCommandInvocationCompletedData,value:OSF.DDA.Marshaling.AppCommand.AppCommandCompletedMethodParameterKeys.Data}]}),t.define({type:OSF.DDA.EventDispId.dispidAppCommandInvokedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.AppCommandInvokedEvent,value:t.self}]}),t.addComplexType(OSF.DDA.EventDescriptors.AppCommandInvokedEvent),t.define({type:OSF.DDA.EventDescriptors.AppCommandInvokedEvent,fromHost:[{name:e.AppCommand.AppCommandInvokedEventEnums.AppCommandId,value:OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys.AppCommandId},{name:e.AppCommand.AppCommandInvokedEventEnums.CallbackName,value:OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys.CallbackName},{name:e.AppCommand.AppCommandInvokedEventEnums.EventObjStr,value:OSF.DDA.Marshaling.AppCommand.AppCommandInvokedEventKeys.EventObjStr}]})}}}(e.AppCommand||(e.AppCommand={}))}(OfficeExt||(OfficeExt={})),function(e){var t=function(){return function(e,t){OSF.DDA.VisioDocument.uber.constructor.call(this,e,new OSF.DDA.BindingFacade(this),t),OSF.OUtil.finalizeProperties(this)}}();e.VisioDocument=t}(OSFVisioWAC||(OSFVisioWAC={})),OSF.DDA.VisioDocument=OSFVisioWAC.VisioDocument,OSF.OUtil.extend(OSF.DDA.VisioDocument,OSF.DDA.JsomDocument),OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function(e,t,n){OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM),e.doc=new OSF.DDA.VisioDocument(e,this._initializeSettings(e,!0)),OSF.DDA.DispIdHost.addAsyncMethods(OSF.DDA.RichApi,[OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync]),OSF.DDA.RichApi.richApiMessageManager=new OfficeExt.RichApiMessageManager,t()},OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function(e){this.prepareApiSurface(e),Microsoft.Office.WebExtension.initialize(this.getInitializationReason(e))},OSF.InitializationHelper.prototype.prepareApiSurface=function(e){OSF.WebApp._UpdateLinksForHostAndXdmInfo();var t=new OSF.DDA.License(e.get_eToken());this.initWebDialog(e),this.initWebAuth(e),OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(e,e.doc,t));var n=OSF.DDA.WAC.getDelegateMethods,i=OSF.DDA.WAC.Delegate.ParameterMap;OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(n,i)),OfficeExt.AppCommand.AppCommandManager.instance().initializeAndChangeOnce()},OSF.InitializationHelper.prototype.getInitializationReason=function(e){return e.get_reason()};var OfficeExtension;__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();!function(e){var t;!function(e){e.OfficeRequire=function(){return null}()}(e._Internal||(e._Internal={})),function(e){!function(t){t.Init=function(){return function(){"use strict";function t(e){return"function"===typeof e}var n,i=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=0,r=function(e,t){u[o]=e,u[o+1]=t,2===(o+=2)&&(n?n(d):l())};var a=("undefined"!==typeof window?window:void 0)||{},s=(a.MutationObserver||a.WebKitMutationObserver,"undefined"!==typeof process&&"[object process]"==={}.toString.call(process)),c="undefined"!==typeof Uint8ClampedArray&&"undefined"!==typeof importScripts&&"undefined"!==typeof MessageChannel;var l,u=new Array(1e3);function d(){for(var e=0;e<o;e+=2){(0,u[e])(u[e+1]),u[e]=void 0,u[e+1]=void 0}o=0}function f(){}l=s?function(){var e=process.nextTick,t=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);return Array.isArray(t)&&"0"===t[1]&&"10"===t[2]&&(e=window.setImmediate),function(){e(d)}}():c?function(){var e=new MessageChannel;return e.port1.onmessage=d,function(){e.port2.postMessage(0)}}():function(){return function(){setTimeout(d,1)}}();var p=new _;function h(e,n){if(n.constructor===e.constructor)!function(e,t){1===t._state?y(e,t._result):2===t._state?O(e,t._result):v(t,void 0,(function(t){m(e,t)}),(function(t){O(e,t)}))}(e,n);else{var i=function(e){try{return e.then}catch(e){return p.error=e,p}}(n);i===p?O(e,p.error):void 0===i?y(e,n):t(i)?function(e,t,n){r((function(e){var i=!1,o=function(e,t,n,i){try{e.call(t,n,i)}catch(e){return e}}(n,t,(function(n){i||(i=!0,t!==n?m(e,n):y(e,n))}),(function(t){i||(i=!0,O(e,t))}),e._label);!i&&o&&(i=!0,O(e,o))}),e)}(e,n,i):y(e,n)}}function m(e,t){e===t?O(e,function(){return new TypeError("You cannot resolve a promise with itself")}()):!function(e){return"function"===typeof e||"object"===typeof e&&null!==e}(t)?y(e,t):h(e,t)}function g(e){e._onerror&&e._onerror(e._result),b(e)}function y(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&r(b,e))}function O(e,t){void 0===e._state&&(e._state=2,e._result=t,r(g,e))}function v(e,t,n,i){var o=e._subscribers,a=o.length;e._onerror=null,o[a]=t,o[a+1]=n,o[a+2]=i,0===a&&e._state&&r(b,e)}function b(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var i,o,r=e._result,a=0;a<t.length;a+=3)i=t[a],o=t[a+n],i?A(n,i,o,r):o(r);e._subscribers.length=0}}function _(){this.error=null}var S=new _;function A(e,n,i,o){var r,a,s,c,l=t(i);if(l){if((r=function(e,t){try{return e(t)}catch(e){return S.error=e,S}}(i,o))===S?(c=!0,a=r.error,r=null):s=!0,n===r)return void O(n,function(){return new TypeError("A promises callback cannot return that same promise.")}())}else r=o,s=!0;void 0!==n._state||(l&&s?m(n,r):c?O(n,a):1===e?y(n,r):2===e&&O(n,r))}function D(e,t){this._instanceConstructor=e,this.promise=new e(f),this._validateInput(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._init(),0===this.length?y(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&y(this.promise,this._result))):O(this.promise,this._validationError())}D.prototype._validateInput=function(e){return i(e)},D.prototype._validationError=function(){return new e.Error("Array Methods must be provided an Array")},D.prototype._init=function(){this._result=new Array(this.length)};var C=D;D.prototype._enumerate=function(){for(var e=this.length,t=this.promise,n=this._input,i=0;void 0===t._state&&i<e;i++)this._eachEntry(n[i],i)},D.prototype._eachEntry=function(e,t){var n=this._instanceConstructor;!function(e){return"object"===typeof e&&null!==e}(e)?(this._remaining--,this._result[t]=e):e.constructor===n&&void 0!==e._state?(e._onerror=null,this._settledAt(e._state,t,e._result)):this._willSettleAt(n.resolve(e),t)},D.prototype._settledAt=function(e,t,n){var i=this.promise;void 0===i._state&&(this._remaining--,2===e?O(i,n):this._result[t]=n),0===this._remaining&&y(i,this._result)},D.prototype._willSettleAt=function(e,t){var n=this;v(e,void 0,(function(e){n._settledAt(1,t,e)}),(function(e){n._settledAt(2,t,e)}))};var P=function(e){return new C(this,e).promise};var I=function(e){var t=new this(f);if(!i(e))return O(t,new TypeError("You must pass an array to race.")),t;var n=e.length;function o(e){m(t,e)}function r(e){O(t,e)}for(var a=0;void 0===t._state&&a<n;a++)v(this.resolve(e[a]),void 0,o,r);return t};var E=function(e){if(e&&"object"===typeof e&&e.constructor===this)return e;var t=new this(f);return m(t,e),t};var F=function(e){var t=new this(f);return O(t,e),t},M=0;var x=R;function R(e){this._id=M++,this._state=void 0,this._result=void 0,this._subscribers=[],f!==e&&(t(e)||function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof R||function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}(),function(e,t){try{t((function(t){m(e,t)}),(function(t){O(e,t)}))}catch(t){O(e,t)}}(this,e))}return R.all=P,R.race=I,R.resolve=E,R.reject=F,R._setScheduler=function(e){n=e},R._setAsap=function(e){r=e},R._asap=r,R.prototype={constructor:R,then:function(e,t){var n=this,i=n._state;if(1===i&&!e||2===i&&!t)return this;var o=new this.constructor(f),a=n._result;if(i){var s=arguments[i-1];r((function(){A(i,o,s,a)}))}else v(n,o,e,t);return o},catch:function(e){return this.then(null,e)}},x}.call(this)}}(e.PromiseImpl||(e.PromiseImpl={}))}(e._Internal||(e._Internal={})),function(e){e.OfficePromise=function(){return"undefined"===typeof window&&"function"===typeof Promise?Promise:"undefined"!==typeof window&&window.Promise?function(){var e=window.navigator.userAgent,t=e.indexOf("Edge/");return t>=0&&(e=e.substring(t+5,e.length))<"14.14393"}()?e.PromiseImpl.Init():window.Promise:e.PromiseImpl.Init()}()}(t=e._Internal||(e._Internal={}));var n=t.OfficePromise;e.Promise=n}(OfficeExtension||(OfficeExtension={})),function(e){var t=function(){function e(){}return e.prototype._resolveRequestUrlAndHeaderInfo=function(){return l._createPromiseFromResult(null)},e.prototype._createRequestExecutorOrNull=function(){return null},Object.defineProperty(e.prototype,"eventRegistration",{get:function(){return null},enumerable:!0,configurable:!0}),e}();e.SessionBase=t;var n=function(){function e(){}return e.setCustomSendRequestFunc=function(t){e.s_customSendRequestFunc=t},e.xhrSendRequestFunc=function(e){return l.createPromise((function(t,n){var o=new XMLHttpRequest;if(o.open(e.method,e.url),o.onload=function(){var e={statusCode:o.status,headers:l._parseHttpResponseHeaders(o.getAllResponseHeaders()),body:o.responseText};t(e)},o.onerror=function(){n(new i.RuntimeError({code:r.connectionFailure,httpStatusCode:o.status,message:l._getResourceString(a.connectionFailureWithStatus,o.statusText)}))},e.headers)for(var s in e.headers)o.setRequestHeader(s,e.headers[s]);o.send(l._getRequestBodyText(e))}))},e.fetchSendRequestFunc=function(e){var t=l._getRequestBodyText(e);return""===t&&(t=void 0),fetch(e.url,{method:e.method,headers:e.headers,body:t}).then((function(e){return e.text().then((function(t){var n=e.status,i={};return e.headers.forEach((function(e,t){i[t]=e})),{statusCode:n,headers:i,body:t}}))}))},e.sendRequest=function(t){e.validateAndNormalizeRequest(t);var n=e.s_customSendRequestFunc;return n||(n="undefined"!==typeof fetch?e.fetchSendRequestFunc:e.xhrSendRequestFunc),n(t)},e.setCustomSendLocalDocumentRequestFunc=function(t){e.s_customSendLocalDocumentRequestFunc=t},e.sendLocalDocumentRequest=function(t){return e.validateAndNormalizeRequest(t),(e.s_customSendLocalDocumentRequestFunc||e.officeJsSendLocalDocumentRequestFunc)(t)},e.officeJsSendLocalDocumentRequestFunc=function(e){e=l._validateLocalDocumentRequest(e);var t=l._buildRequestMessageSafeArray(e);return l.createPromise((function(e,n){OSF.DDA.RichApi.executeRichApiRequestAsync(t,(function(t){var n;n="succeeded"==t.status?{statusCode:c.getResponseStatusCode(t),headers:c.getResponseHeaders(t),body:c.getResponseBody(t)}:c.buildHttpResponseFromOfficeJsError(t.error.code,t.error.message),l.log("Response:"),l.log(JSON.stringify(n)),e(n)}))}))},e.validateAndNormalizeRequest=function(e){if(l.isNullOrUndefined(e))throw i.RuntimeError._createInvalidArgError({argumentName:"request"});l.isNullOrEmptyString(e.method)&&(e.method="GET"),e.method=e.method.toUpperCase()},e.logRequest=function(t){if(l._logEnabled){if(l.log("---HTTP Request---"),l.log(t.method+" "+t.url),t.headers)for(var n in t.headers)l.log(n+": "+t.headers[n]);e._logBodyEnabled&&l.log(l._getRequestBodyText(t))}},e.logResponse=function(t){if(l._logEnabled){if(l.log("---HTTP Response---"),l.log(""+t.statusCode),t.headers)for(var n in t.headers)l.log(n+": "+t.headers[n]);e._logBodyEnabled&&l.log(t.body)}},e._logBodyEnabled=!1,e}();e.HttpUtility=n;var i,o=function(){function e(e){var t=this;this.m_bridge=e,this.m_promiseResolver={},this.m_handlers=[],this.m_bridge.onMessageFromHost=function(e){var n=JSON.parse(e);if(3==n.type){var i=n.message;if(i&&i.entries)for(var o=0;o<i.entries.length;o++){var r=i.entries[o];if(Array.isArray(r)){var a={messageCategory:r[0],messageType:r[1],targetId:r[2],message:r[3],id:r[4]};i.entries[o]=a}}}t.dispatchMessage(n)}}return e.init=function(t){if("object"===typeof t&&t){var i=new e(t);e.s_instance=i,n.setCustomSendLocalDocumentRequestFunc((function(t){t=l._validateLocalDocumentRequest(t);var n=0;l.isReadonlyRestRequest(t.method)||(n=1);var o=t.url.indexOf("?");if(o>=0){var r=t.url.substr(o+1),a=l._parseRequestFlagsAndCustomDataFromQueryStringIfAny(r);a.flags>=0&&(n=a.flags)}"string"===typeof t.body&&(t.body=JSON.parse(t.body));var s={id:e.nextId(),type:1,flags:n,message:t};return i.sendMessageToHostAndExpectResponse(s).then((function(e){return e.message}))}));for(var o=0;o<e.s_onInitedHandlers.length;o++)e.s_onInitedHandlers[o](i)}},Object.defineProperty(e,"instance",{get:function(){return e.s_instance},enumerable:!0,configurable:!0}),e.prototype.sendMessageToHost=function(e){this.m_bridge.sendMessageToHost(JSON.stringify(e))},e.prototype.sendMessageToHostAndExpectResponse=function(e){var t=this,n=l.createPromise((function(n,i){t.m_promiseResolver[e.id]=n}));return this.m_bridge.sendMessageToHost(JSON.stringify(e)),n},e.prototype.addHostMessageHandler=function(e){this.m_handlers.push(e)},e.prototype.removeHostMessageHandler=function(e){var t=this.m_handlers.indexOf(e);t>=0&&this.m_handlers.splice(t,1)},e.onInited=function(t){e.s_onInitedHandlers.push(t),e.s_instance&&t(e.s_instance)},e.prototype.dispatchMessage=function(e){if("number"===typeof e.id){var t=this.m_promiseResolver[e.id];if(t)return t(e),void delete this.m_promiseResolver[e.id]}for(var n=0;n<this.m_handlers.length;n++)this.m_handlers[n](e)},e.nextId=function(){return e.s_nextId++},e.s_onInitedHandlers=[],e.s_nextId=1,e}();e.HostBridge=o,"object"===typeof _richApiNativeBridge&&_richApiNativeBridge&&o.init(_richApiNativeBridge),function(e){var t=function(t){function n(e){var i=t.call(this,"string"===typeof e?e:e.message)||this;if(Object.setPrototypeOf(i,n.prototype),i.name="RichApi.Error","string"===typeof e?i.message=e:(i.code=e.code,i.message=e.message,i.traceMessages=e.traceMessages||[],i.innerError=e.innerError||null,i.debugInfo=i._createDebugInfo(e.debugInfo||{}),i.httpStatusCode=e.httpStatusCode,i.data=e.data),l.isNullOrUndefined(i.httpStatusCode)||200===i.httpStatusCode){var o={};o[r.accessDenied]=401,o[r.connectionFailure]=500,o[r.generalException]=500,o[r.invalidArgument]=400,o[r.invalidObjectPath]=400,o[r.invalidOrTimedOutSession]=408,o[r.invalidRequestContext]=400,o[r.timeout]=408,o[r.valueNotLoaded]=400,i.httpStatusCode=o[i.code]}return l.isNullOrUndefined(i.httpStatusCode)&&(i.httpStatusCode=500),i}return __extends(n,t),n.prototype.toString=function(){return this.code+": "+this.message},n.prototype._createDebugInfo=function(t){var n={code:this.code,message:this.message,toString:function(){return JSON.stringify(this)}};for(var i in t)n[i]=t[i];return this.innerError&&(this.innerError instanceof e.RuntimeError?n.innerError=this.innerError.debugInfo:n.innerError=this.innerError),n},n._createInvalidArgError=function(t){return new e.RuntimeError({code:r.invalidArgument,httpStatusCode:400,message:l.isNullOrEmptyString(t.argumentName)?l._getResourceString(a.invalidArgumentGeneric):l._getResourceString(a.invalidArgument,t.argumentName),debugInfo:t.errorLocation?{errorLocation:t.errorLocation}:{},innerError:t.innerError})},n}(Error);e.RuntimeError=t}(i=e._Internal||(e._Internal={})),e.Error=i.RuntimeError;var r=function(){function e(){}return e.apiNotFound="ApiNotFound",e.accessDenied="AccessDenied",e.generalException="GeneralException",e.activityLimitReached="ActivityLimitReached",e.invalidArgument="InvalidArgument",e.connectionFailure="ConnectionFailure",e.timeout="Timeout",e.invalidOrTimedOutSession="InvalidOrTimedOutSession",e.invalidObjectPath="InvalidObjectPath",e.invalidRequestContext="InvalidRequestContext",e.valueNotLoaded="ValueNotLoaded",e.requestPayloadSizeLimitExceeded="RequestPayloadSizeLimitExceeded",e.responsePayloadSizeLimitExceeded="ResponsePayloadSizeLimitExceeded",e.writeNotSupportedWhenModalDialogOpen="WriteNotSupportedWhenModalDialogOpen",e}();e.CoreErrorCodes=r;var a=function(){function e(){}return e.apiNotFoundDetails="ApiNotFoundDetails",e.connectionFailureWithStatus="ConnectionFailureWithStatus",e.connectionFailureWithDetails="ConnectionFailureWithDetails",e.invalidArgument="InvalidArgument",e.invalidArgumentGeneric="InvalidArgumentGeneric",e.timeout="Timeout",e.invalidOrTimedOutSessionMessage="InvalidOrTimedOutSessionMessage",e.invalidSheetName="InvalidSheetName",e.invalidObjectPath="InvalidObjectPath",e.invalidRequestContext="InvalidRequestContext",e.valueNotLoaded="ValueNotLoaded",e}();e.CoreResourceStrings=a;var s=function(){function e(){}return e.flags="flags",e.sourceLibHeader="SdkVersion",e.processQuery="ProcessQuery",e.localDocument="http://document.localhost/",e.localDocumentApiPrefix="http://document.localhost/_api/",e.customData="customdata",e}();e.CoreConstants=s;var c=function(){function e(){}return e.buildMessageArrayForIRequestExecutor=function(t,n,i,o){var r=JSON.stringify(i.Body);l.log("Request:"),l.log(r);var a={};return l._copyHeaders(i.Headers,a),a[s.sourceLibHeader]=o,e.buildRequestMessageSafeArray(t,n,"POST",s.processQuery,a,r)},e.buildResponseOnSuccess=function(e,t){var n={HttpStatusCode:200,ErrorCode:"",ErrorMessage:"",Headers:null,Body:null};return n.Body=JSON.parse(e),n.Headers=t,n},e.buildResponseOnError=function(t,n){var i={HttpStatusCode:500,ErrorCode:"",ErrorMessage:"",Headers:null,Body:null};return i.ErrorCode=r.generalException,i.ErrorMessage=n,t==e.OfficeJsErrorCode_ooeNoCapability?(i.ErrorCode=r.accessDenied,i.HttpStatusCode=401):t==e.OfficeJsErrorCode_ooeActivityLimitReached?(i.ErrorCode=r.activityLimitReached,i.HttpStatusCode=429):t==e.OfficeJsErrorCode_ooeInvalidOrTimedOutSession?(i.ErrorCode=r.invalidOrTimedOutSession,i.HttpStatusCode=408,i.ErrorMessage=l._getResourceString(a.invalidOrTimedOutSessionMessage)):t==e.OfficeJsErrorCode_ooeRequestPayloadSizeLimitExceeded?(i.ErrorCode=r.requestPayloadSizeLimitExceeded,i.HttpStatusCode=400):t==e.OfficeJsErrorCode_ooeResponsePayloadSizeLimitExceeded?(i.ErrorCode=r.responsePayloadSizeLimitExceeded,i.HttpStatusCode=400):t==e.OfficeJsErrorCode_ooeWriteNotSupportedWhenModalDialogOpen?(i.ErrorCode=r.writeNotSupportedWhenModalDialogOpen,i.HttpStatusCode=400):t==e.OfficeJsErrorCode_ooeInvalidSheetName&&(i.ErrorCode=r.invalidRequestContext,i.HttpStatusCode=400,i.ErrorMessage=l._getResourceString(a.invalidSheetName)),i},e.buildHttpResponseFromOfficeJsError=function(t,n){var i=500,o={error:{}};return o.error.code=r.generalException,o.error.message=n,t===e.OfficeJsErrorCode_ooeNoCapability?(i=403,o.error.code=r.accessDenied):t===e.OfficeJsErrorCode_ooeActivityLimitReached&&(i=429,o.error.code=r.activityLimitReached),{statusCode:i,headers:{},body:JSON.stringify(o)}},e.buildRequestMessageSafeArray=function(e,t,n,i,o,r){var a=[];if(o)for(var s in o)a.push(s),a.push(o[s]);return[e,n,i,a,r,0,t,"","","","","",""]},e.getResponseBody=function(t){return e.getResponseBodyFromSafeArray(t.value.data)},e.getResponseHeaders=function(t){return e.getResponseHeadersFromSafeArray(t.value.data)},e.getResponseBodyFromSafeArray=function(e){var t=e[2];return"string"===typeof t?t:t.join("")},e.getResponseHeadersFromSafeArray=function(e){var t=e[1];if(!t)return null;for(var n={},i=0;i<t.length-1;i+=2)n[t[i]]=t[i+1];return n},e.getResponseStatusCode=function(t){return e.getResponseStatusCodeFromSafeArray(t.value.data)},e.getResponseStatusCodeFromSafeArray=function(e){return e[0]},e.OfficeJsErrorCode_ooeInvalidOrTimedOutSession=5012,e.OfficeJsErrorCode_ooeActivityLimitReached=5102,e.OfficeJsErrorCode_ooeNoCapability=7e3,e.OfficeJsErrorCode_ooeRequestPayloadSizeLimitExceeded=5103,e.OfficeJsErrorCode_ooeResponsePayloadSizeLimitExceeded=5104,e.OfficeJsErrorCode_ooeWriteNotSupportedWhenModalDialogOpen=5016,e.OfficeJsErrorCode_ooeInvalidSheetName=1014,e}();e.RichApiMessageUtility=c,function(e){e.getPromiseType=function(){if("undefined"!==typeof Promise)return Promise;if("undefined"!==typeof Office&&Office.Promise)return Office.Promise;if("undefined"!==typeof OfficeExtension&&OfficeExtension.Promise)return OfficeExtension.Promise;throw new e.Error("No Promise implementation found")}}(i=e._Internal||(e._Internal={}));var l=function(){function e(){}return e.log=function(t){e._logEnabled&&"undefined"!==typeof console&&console.log&&console.log(t)},e.checkArgumentNull=function(t,n){if(e.isNullOrUndefined(t))throw i.RuntimeError._createInvalidArgError({argumentName:n})},e.isNullOrUndefined=function(e){return null===e||"undefined"===typeof e},e.isUndefined=function(e){return"undefined"===typeof e},e.isNullOrEmptyString=function(e){return null===e||("undefined"===typeof e||0==e.length)},e.isPlainJsonObject=function(t){if(e.isNullOrUndefined(t))return!1;if("object"!==typeof t)return!1;if("[object Object]"!==Object.prototype.toString.apply(t))return!1;if(t.constructor&&!Object.prototype.hasOwnProperty.call(t,"constructor")&&!Object.prototype.hasOwnProperty.call(t.constructor.prototype,"hasOwnProperty"))return!1;for(var n in t)if(!Object.prototype.hasOwnProperty.call(t,n))return!1;return!0},e.trim=function(e){return e.replace(new RegExp("^\\s+|\\s+$","g"),"")},e.caseInsensitiveCompareString=function(t,n){return e.isNullOrUndefined(t)?e.isNullOrUndefined(n):!e.isNullOrUndefined(n)&&t.toUpperCase()==n.toUpperCase()},e.isReadonlyRestRequest=function(t){return e.caseInsensitiveCompareString(t,"GET")},e._getResourceString=function(t,n){var i;if("undefined"!==typeof window&&window.Strings&&window.Strings.OfficeOM){var o="L_"+t,r=window.Strings.OfficeOM[o];r&&(i=r)}if(i||(i=e.s_resourceStringValues[t]),i||(i=t),!e.isNullOrUndefined(n))if(Array.isArray(n)){var a=n;i=e._formatString(i,a)}else i=i.replace("{0}",n);return i},e._formatString=function(e,t){return e.replace(/\{\d\}/g,(function(e){var n=parseInt(e.substr(1,e.length-2));if(n<t.length)return t[n];throw i.RuntimeError._createInvalidArgError({argumentName:"format"})}))},Object.defineProperty(e,"Promise",{get:function(){return i.getPromiseType()},enumerable:!0,configurable:!0}),e.createPromise=function(t){return new e.Promise(t)},e._createPromiseFromResult=function(t){return e.createPromise((function(e,n){e(t)}))},e._createPromiseFromException=function(t){return e.createPromise((function(e,n){n(t)}))},e._createTimeoutPromise=function(t){return e.createPromise((function(e,n){setTimeout((function(){e(null)}),t)}))},e._createInvalidArgError=function(e){return i.RuntimeError._createInvalidArgError(e)},e._isLocalDocumentUrl=function(t){return e._getLocalDocumentUrlPrefixLength(t)>0},e._getLocalDocumentUrlPrefixLength=function(e){for(var t=["http://document.localhost","https://document.localhost","//document.localhost"],n=e.toLowerCase().trim(),i=0;i<t.length;i++){if(n===t[i])return t[i].length;if(n.substr(0,t[i].length+1)===t[i]+"/")return t[i].length+1}return 0},e._validateLocalDocumentRequest=function(t){var n=e._getLocalDocumentUrlPrefixLength(t.url);if(n<=0)throw i.RuntimeError._createInvalidArgError({argumentName:"request"});var o=t.url.substr(n),r=o.toLowerCase();return"_api"===r?o="":"_api/"===r.substr(0,"_api/".length)&&(o=o.substr("_api/".length)),{method:t.method,url:o,headers:t.headers,body:t.body}},e._parseRequestFlagsAndCustomDataFromQueryStringIfAny=function(e){for(var t={flags:-1,customData:""},n=e.split("&"),i=0;i<n.length;i++){var o=n[i].split("=");if(o[0].toLowerCase()===s.flags){var r=parseInt(o[1]);r&=8191,t.flags=r}else o[0].toLowerCase()===s.customData&&(t.customData=decodeURIComponent(o[1]))}return t},e._getRequestBodyText=function(e){var t="";return"string"===typeof e.body?t=e.body:e.body&&"object"===typeof e.body&&(t=JSON.stringify(e.body)),t},e._parseResponseBody=function(t){if("string"===typeof t.body){var n=e.trim(t.body);return JSON.parse(n)}return t.body},e._buildRequestMessageSafeArray=function(t){var n=0;e.isReadonlyRestRequest(t.method)||(n=1);var i="";if(t.url.substr(0,s.processQuery.length).toLowerCase()===s.processQuery.toLowerCase()){var o=t.url.indexOf("?");if(o>0){var r=t.url.substr(o+1),a=e._parseRequestFlagsAndCustomDataFromQueryStringIfAny(r);a.flags>=0&&(n=a.flags),i=a.customData}}return c.buildRequestMessageSafeArray(i,n,t.method,t.url,t.headers,e._getRequestBodyText(t))},e._parseHttpResponseHeaders=function(t){var n={};if(!e.isNullOrEmptyString(t))for(var i=new RegExp("\r?\n"),o=t.split(i),r=0;r<o.length;r++){var a=o[r];if(null!=a){var s=a.indexOf(":");if(s>0){var c=a.substr(0,s),l=a.substr(s+1);c=e.trim(c),l=e.trim(l),n[c.toUpperCase()]=l}}}return n},e._parseErrorResponse=function(t){var n=null;if(e.isPlainJsonObject(t.body))n=t.body;else if(!e.isNullOrEmptyString(t.body)){var i=e.trim(t.body);try{n=JSON.parse(i)}catch(t){e.log("Error when parse "+i)}}var o=t.statusCode.toString();if(e.isNullOrUndefined(n)||"object"!==typeof n||!n.error)return e._createDefaultErrorResponse(o);var r=n.error,a=r.innerError;return a&&a.code?e._createErrorResponse(a.code,o,a.message):r.code?e._createErrorResponse(r.code,o,r.message):e._createDefaultErrorResponse(o)},e._createDefaultErrorResponse=function(t){return{errorCode:r.connectionFailure,errorMessage:e._getResourceString(a.connectionFailureWithStatus,t)}},e._createErrorResponse=function(t,n,i){return{errorCode:t,errorMessage:e._getResourceString(a.connectionFailureWithDetails,[n,t,i])}},e._copyHeaders=function(e,t){if(e&&t)for(var n in e)t[n]=e[n]},e.addResourceStringValues=function(t){for(var n in t)e.s_resourceStringValues[n]=t[n]},e._logEnabled=!1,e.s_resourceStringValues={ApiNotFoundDetails:"The method or property {0} is part of the {1} requirement set, which is not available in your version of {2}.",ConnectionFailureWithStatus:"The request failed with status code of {0}.",ConnectionFailureWithDetails:"The request failed with status code of {0}, error code {1} and the following error message: {2}",InvalidArgument:"The argument '{0}' doesn't work for this situation, is missing, or isn't in the right format.",InvalidObjectPath:'The object path \'{0}\' isn\'t working for what you\'re trying to do. If you\'re using the object across multiple "context.sync" calls and outside the sequential execution of a ".run" batch, please use the "context.trackedObjects.add()" and "context.trackedObjects.remove()" methods to manage the object\'s lifetime.',InvalidRequestContext:"Cannot use the object across different request contexts.",Timeout:"The operation has timed out.",ValueNotLoaded:'The value of the result object has not been loaded yet. Before reading the value property, call "context.sync()" on the associated request context.'},e}();e.CoreUtility=l;var u=function(){function e(){}return e.setMock=function(t){e.s_isMock=t},e.isMock=function(){return e.s_isMock},e}();e.TestUtility=u,e._internalConfig={showDisposeInfoInDebugInfo:!1,showInternalApiInDebugInfo:!1,enableEarlyDispose:!0,alwaysPolyfillClientObjectUpdateMethod:!1,alwaysPolyfillClientObjectRetrieveMethod:!1,enableConcurrentFlag:!0,enableUndoableFlag:!0,appendTypeNameToObjectPathInfo:!1,enablePreviewExecution:!1},e.config={extendedErrorLogging:!1};var d=function(){function t(){}return t.createSetPropertyAction=function(t,n,i,o,r){S.validateObjectPath(n);var a={Id:t._nextId(),ActionType:4,Name:i,ObjectPathId:n._objectPath.objectPathInfo.Id,ArgumentInfo:{}},s=[o],c=S.setMethodArguments(t,a.ArgumentInfo,s);S.validateReferencedObjectPaths(c);var l=new p(a,0,r);if(l.referencedObjectPath=n._objectPath,l.referencedArgumentObjectPaths=c,e._internalConfig.enablePreviewExecution&&0!==(16&r)){var u={Id:t._nextId(),ActionType:4,Name:i,ObjectId:"",ObjectType:"",Arguments:[o]};n._addPreviewExecutionAction(u)}return n._addAction(l)},t.createQueryAction=function(e,t,n,i){S.validateObjectPath(t);var o={Id:e._nextId(),ActionType:2,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,QueryInfo:n},r=new p(o,1,4);return r.referencedObjectPath=t._objectPath,t._addAction(r,i)},t.createQueryAsJsonAction=function(e,t,n,i){S.validateObjectPath(t);var o={Id:e._nextId(),ActionType:7,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,QueryInfo:n},r=new p(o,1,4);return r.referencedObjectPath=t._objectPath,t._addAction(r,i)},t.createUpdateAction=function(e,t,n){S.validateObjectPath(t);var i={Id:e._nextId(),ActionType:9,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,ObjectState:n},o=new p(i,0,0);return o.referencedObjectPath=t._objectPath,t._addAction(o)},t}();e.CommonActionFactory=d;var f=function(){function t(e,t){this.m_contextBase=e,this.m_objectPath=t}return Object.defineProperty(t.prototype,"_objectPath",{get:function(){return this.m_objectPath},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_context",{get:function(){return this.m_contextBase},enumerable:!0,configurable:!0}),t.prototype._addAction=function(e,t){var n=this;return void 0===t&&(t=null),l.createPromise((function(i,o){n._context._addServiceApiAction(e,t,i,o)}))},t.prototype._addPreviewExecutionAction=function(e){},t.prototype._retrieve=function(t,n){var i=e._internalConfig.alwaysPolyfillClientObjectRetrieveMethod;i||(i=!S.isSetSupported("RichApiRuntime","1.1"));var o=m._parseQueryOption(t);return i?d.createQueryAction(this._context,this,o,n):d.createQueryAsJsonAction(this._context,this,o,n)},t.prototype._recursivelyUpdate=function(t){var n=e._internalConfig.alwaysPolyfillClientObjectUpdateMethod;n||(n=!S.isSetSupported("RichApiRuntime","1.2"));try{var o=this[_.scalarPropertyNames];o||(o=[]);var s=this[_.scalarPropertyUpdateable];if(!s){s=[];for(var c=0;c<o.length;c++)s.push(!1)}var u=this[_.navigationPropertyNames];u||(u=[]);var f={},p={},h=0;for(var m in t){var g=o.indexOf(m);if(g>=0){if(!s[g])throw new i.RuntimeError({code:r.invalidArgument,httpStatusCode:400,message:l._getResourceString(A.attemptingToSetReadOnlyProperty,m),debugInfo:{errorLocation:m}});f[m]=t[m],++h}else{if(!(u.indexOf(m)>=0))throw new i.RuntimeError({code:r.invalidArgument,httpStatusCode:400,message:l._getResourceString(A.propertyDoesNotExist,m),debugInfo:{errorLocation:m}});p[m]=t[m]}}if(h>0)if(n)for(c=0;c<o.length;c++){var y=f[m=o[c]];S.isUndefined(y)||d.createSetPropertyAction(this._context,this,m,y)}else d.createUpdateAction(this._context,this,f);for(var m in p){var O=this[m],v=p[m];O._recursivelyUpdate(v)}}catch(e){throw new i.RuntimeError({code:r.invalidArgument,httpStatusCode:400,message:l._getResourceString(a.invalidArgument,"properties"),debugInfo:{errorLocation:this._className+".update"},innerError:e})}},t}();e.ClientObjectBase=f;var p=function(){function e(e,t,n){this.m_actionInfo=e,this.m_operationType=t,this.m_flags=n}return Object.defineProperty(e.prototype,"actionInfo",{get:function(){return this.m_actionInfo},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"operationType",{get:function(){return this.m_operationType},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flags",{get:function(){return this.m_flags},enumerable:!0,configurable:!0}),e}();e.Action=p;var h=function(){function t(e,t,n,i,o,r){this.m_objectPathInfo=e,this.m_parentObjectPath=t,this.m_isCollection=n,this.m_isInvalidAfterRequest=i,this.m_isValid=!0,this.m_operationType=o,this.m_flags=r}return Object.defineProperty(t.prototype,"id",{get:function(){var e=this.m_objectPathInfo.ArgumentInfo;if(e){var t=e.Arguments;if(t)return t[0]}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this.m_parentObjectPath;if(e)return e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentId",{get:function(){return this.parent?this.parent.id:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectPathInfo",{get:function(){return this.m_objectPathInfo},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"operationType",{get:function(){return this.m_operationType},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flags",{get:function(){return this.m_flags},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isCollection",{get:function(){return this.m_isCollection},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isInvalidAfterRequest",{get:function(){return this.m_isInvalidAfterRequest},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentObjectPath",{get:function(){return this.m_parentObjectPath},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"argumentObjectPaths",{get:function(){return this.m_argumentObjectPaths},set:function(e){this.m_argumentObjectPaths=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isValid",{get:function(){return this.m_isValid},set:function(e){this.m_isValid=e,!e&&6===this.m_objectPathInfo.ObjectPathType&&this.m_savedObjectPathInfo&&(t.copyObjectPathInfo(this.m_savedObjectPathInfo.pathInfo,this.m_objectPathInfo),this.m_parentObjectPath=this.m_savedObjectPathInfo.parent,this.m_isValid=!0,this.m_savedObjectPathInfo=null)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"originalObjectPathInfo",{get:function(){return this.m_originalObjectPathInfo},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"getByIdMethodName",{get:function(){return this.m_getByIdMethodName},set:function(e){this.m_getByIdMethodName=e},enumerable:!0,configurable:!0}),t.prototype._updateAsNullObject=function(){this.resetForUpdateUsingObjectData(),this.m_objectPathInfo.ObjectPathType=7,this.m_objectPathInfo.Name="",this.m_parentObjectPath=null},t.prototype.saveOriginalObjectPathInfo=function(){e.config.extendedErrorLogging&&!this.m_originalObjectPathInfo&&(this.m_originalObjectPathInfo={},t.copyObjectPathInfo(this.m_objectPathInfo,this.m_originalObjectPathInfo))},t.prototype.updateUsingObjectData=function(e,n){var i=e[_.referenceId];if(!l.isNullOrEmptyString(i)){if(!this.m_savedObjectPathInfo&&!this.isInvalidAfterRequest&&t.isRestorableObjectPath(this.m_objectPathInfo.ObjectPathType)){var o={};t.copyObjectPathInfo(this.m_objectPathInfo,o),this.m_savedObjectPathInfo={pathInfo:o,parent:this.m_parentObjectPath}}return this.saveOriginalObjectPathInfo(),this.resetForUpdateUsingObjectData(),this.m_objectPathInfo.ObjectPathType=6,this.m_objectPathInfo.Name=i,delete this.m_objectPathInfo.ParentObjectPathId,void(this.m_parentObjectPath=null)}if(n){var r=n[_.collectionPropertyPath];if(!l.isNullOrEmptyString(r)&&n.context){var a=S.tryGetObjectIdFromLoadOrRetrieveResult(e);if(!l.isNullOrUndefined(a)){for(var s=r.split("."),c=n.context[s[0]],u=1;u<s.length;u++)c=c[s[u]];return this.saveOriginalObjectPathInfo(),this.resetForUpdateUsingObjectData(),this.m_parentObjectPath=c._objectPath,this.m_objectPathInfo.ParentObjectPathId=this.m_parentObjectPath.objectPathInfo.Id,this.m_objectPathInfo.ObjectPathType=5,this.m_objectPathInfo.Name="",void(this.m_objectPathInfo.ArgumentInfo.Arguments=[a])}}}var d=this.parentObjectPath&&this.parentObjectPath.isCollection,f=this.getByIdMethodName;if(d||!l.isNullOrEmptyString(f)){a=S.tryGetObjectIdFromLoadOrRetrieveResult(e);if(!l.isNullOrUndefined(a))return this.saveOriginalObjectPathInfo(),this.resetForUpdateUsingObjectData(),l.isNullOrEmptyString(f)?(this.m_objectPathInfo.ObjectPathType=5,this.m_objectPathInfo.Name=""):(this.m_objectPathInfo.ObjectPathType=3,this.m_objectPathInfo.Name=f),void(this.m_objectPathInfo.ArgumentInfo.Arguments=[a])}},t.prototype.resetForUpdateUsingObjectData=function(){this.m_isInvalidAfterRequest=!1,this.m_isValid=!0,this.m_operationType=1,this.m_flags=4,this.m_objectPathInfo.ArgumentInfo={},this.m_argumentObjectPaths=null,this.m_getByIdMethodName=null},t.isRestorableObjectPath=function(e){return 1===e||5===e||3===e||4===e},t.copyObjectPathInfo=function(e,t){t.Id=e.Id,t.ArgumentInfo=e.ArgumentInfo,t.Name=e.Name,t.ObjectPathType=e.ObjectPathType,t.ParentObjectPathId=e.ParentObjectPathId},t}();e.ObjectPath=h;var m=function(){function e(){this.m_nextId=0}return e.prototype._nextId=function(){return++this.m_nextId},e.prototype._addServiceApiAction=function(e,t,n,i){this.m_serviceApiQueue||(this.m_serviceApiQueue=new v(this)),this.m_serviceApiQueue.add(e,t,n,i)},e._parseQueryOption=function(t){var n={};if("string"===typeof t){var o=t;n.Select=S._parseSelectExpand(o)}else if(Array.isArray(t))n.Select=t;else if("object"===typeof t){var r=t;if(e.isLoadOption(r)){if("string"===typeof r.select)n.Select=S._parseSelectExpand(r.select);else if(Array.isArray(r.select))n.Select=r.select;else if(!S.isNullOrUndefined(r.select))throw i.RuntimeError._createInvalidArgError({argumentName:"option.select"});if("string"===typeof r.expand)n.Expand=S._parseSelectExpand(r.expand);else if(Array.isArray(r.expand))n.Expand=r.expand;else if(!S.isNullOrUndefined(r.expand))throw i.RuntimeError._createInvalidArgError({argumentName:"option.expand"});if("number"===typeof r.top)n.Top=r.top;else if(!S.isNullOrUndefined(r.top))throw i.RuntimeError._createInvalidArgError({argumentName:"option.top"});if("number"===typeof r.skip)n.Skip=r.skip;else if(!S.isNullOrUndefined(r.skip))throw i.RuntimeError._createInvalidArgError({argumentName:"option.skip"})}else n=e.parseStrictLoadOption(t)}else if(!S.isNullOrUndefined(t))throw i.RuntimeError._createInvalidArgError({argumentName:"option"});return n},e.isLoadOption=function(e){if(!S.isUndefined(e.select)&&("string"===typeof e.select||Array.isArray(e.select)))return!0;if(!S.isUndefined(e.expand)&&("string"===typeof e.expand||Array.isArray(e.expand)))return!0;if(!S.isUndefined(e.top)&&"number"===typeof e.top)return!0;if(!S.isUndefined(e.skip)&&"number"===typeof e.skip)return!0;for(var t in e)return!1;return!0},e.parseStrictLoadOption=function(t){var n={Select:[]};return e.parseStrictLoadOptionHelper(n,"","option",t),n},e.combineQueryPath=function(e,t,n){return 0===e.length?t:e+n+t},e.parseStrictLoadOptionHelper=function(t,n,o,r){for(var a in r){var s=r[a];if("$all"===a){if("boolean"!==typeof s)throw i.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(o,a,".")});s&&t.Select.push(e.combineQueryPath(n,"*","/"))}else if("$top"===a){if("number"!==typeof s||n.length>0)throw i.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(o,a,".")});t.Top=s}else if("$skip"===a){if("number"!==typeof s||n.length>0)throw i.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(o,a,".")});t.Skip=s}else if("boolean"===typeof s)s&&t.Select.push(e.combineQueryPath(n,a,"/"));else{if("object"!==typeof s)throw i.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(o,a,".")});e.parseStrictLoadOptionHelper(t,e.combineQueryPath(n,a,"/"),e.combineQueryPath(o,a,"."),s)}}},e}();e.ClientRequestContextBase=m;var g=function(){function e(e){this.m_objectPath=e}return e.prototype._handleResult=function(e){l.isNullOrUndefined(e)?this.m_objectPath._updateAsNullObject():this.m_objectPath.updateUsingObjectData(e,null)},e}(),y=function(){function t(e){this.m_contextBase=e,this.m_actions=[],this.m_actionResultHandler={},this.m_referencedObjectPaths={},this.m_instantiatedObjectPaths={},this.m_preSyncPromises=[],this.m_previewExecutionActions=[]}return t.prototype.addAction=function(e){this.m_actions.push(e),1==e.actionInfo.ActionType&&(this.m_instantiatedObjectPaths[e.actionInfo.ObjectPathId]=e)},t.prototype.addPreviewExecutionAction=function(e){this.m_previewExecutionActions.push(e)},Object.defineProperty(t.prototype,"hasActions",{get:function(){return this.m_actions.length>0},enumerable:!0,configurable:!0}),t.prototype._getLastAction=function(){return this.m_actions[this.m_actions.length-1]},t.prototype.ensureInstantiateObjectPath=function(e){if(e){if(this.m_instantiatedObjectPaths[e.objectPathInfo.Id])return;if(this.ensureInstantiateObjectPath(e.parentObjectPath),this.ensureInstantiateObjectPaths(e.argumentObjectPaths),!this.m_instantiatedObjectPaths[e.objectPathInfo.Id]){var t={Id:this.m_contextBase._nextId(),ActionType:1,Name:"",ObjectPathId:e.objectPathInfo.Id},n=new p(t,1,4);n.referencedObjectPath=e,this.addReferencedObjectPath(e),this.addAction(n);var i=new g(e);this.addActionResultHandler(n,i)}}},t.prototype.ensureInstantiateObjectPaths=function(e){if(e)for(var t=0;t<e.length;t++)this.ensureInstantiateObjectPath(e[t])},t.prototype.addReferencedObjectPath=function(e){if(e&&!this.m_referencedObjectPaths[e.objectPathInfo.Id]){if(!e.isValid)throw new i.RuntimeError({code:r.invalidObjectPath,httpStatusCode:400,message:l._getResourceString(a.invalidObjectPath,S.getObjectPathExpression(e)),debugInfo:{errorLocation:S.getObjectPathExpression(e)}});for(;e;)this.m_referencedObjectPaths[e.objectPathInfo.Id]=e,3==e.objectPathInfo.ObjectPathType&&this.addReferencedObjectPaths(e.argumentObjectPaths),e=e.parentObjectPath}},t.prototype.addReferencedObjectPaths=function(e){if(e)for(var t=0;t<e.length;t++)this.addReferencedObjectPath(e[t])},t.prototype.addActionResultHandler=function(e,t){this.m_actionResultHandler[e.actionInfo.Id]=t},t.prototype.aggregrateRequestFlags=function(e,t,n){return 0===t&&(e|=1,0===(2&n)&&(e&=-17),0===(8&n)&&(e&=-257),e&=-5),1&n&&(e|=2),0===(4&n)&&(e&=-5),e},t.prototype.finallyNormalizeFlags=function(t){return 0===(1&t)&&(t&=-17,t&=-257),e._internalConfig.enableConcurrentFlag||(t&=-5),e._internalConfig.enableUndoableFlag||(t&=-17),S.isSetSupported("RichApiRuntimeFlag","1.1")||(t&=-5,t&=-17),S.isSetSupported("RichApiRuntimeFlag","1.2")||(t&=-257),"number"===typeof this.m_flagsForTesting&&(t=this.m_flagsForTesting),t},t.prototype.buildRequestMessageBodyAndRequestFlags=function(){e._internalConfig.enableEarlyDispose&&t._calculateLastUsedObjectPathIds(this.m_actions);var n=276,i={};for(var o in this.m_referencedObjectPaths)n=this.aggregrateRequestFlags(n,this.m_referencedObjectPaths[o].operationType,this.m_referencedObjectPaths[o].flags),i[o]=this.m_referencedObjectPaths[o].objectPathInfo;for(var r=[],a=!1,s=0;s<this.m_actions.length;s++){var c=this.m_actions[s];3===c.actionInfo.ActionType&&c.actionInfo.Name===_.keepReference&&(a=!0),n=this.aggregrateRequestFlags(n,c.operationType,c.flags),r.push(c.actionInfo)}n=this.finallyNormalizeFlags(n);var l={AutoKeepReference:this.m_contextBase._autoCleanup&&a,Actions:r,ObjectPaths:i};return this.m_previewExecutionActions.length>0&&(l.PreviewExecutionActions=this.m_previewExecutionActions,n|=4096),{body:l,flags:n}},t.prototype.processResponse=function(e){if(e)for(var t=0;t<e.length;t++){var n=e[t],i=this.m_actionResultHandler[n.ActionId];i&&i._handleResult(n.Value)}},t.prototype.invalidatePendingInvalidObjectPaths=function(){for(var e in this.m_referencedObjectPaths)this.m_referencedObjectPaths[e].isInvalidAfterRequest&&(this.m_referencedObjectPaths[e].isValid=!1)},t.prototype._addPreSyncPromise=function(e){this.m_preSyncPromises.push(e)},Object.defineProperty(t.prototype,"_preSyncPromises",{get:function(){return this.m_preSyncPromises},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_actions",{get:function(){return this.m_actions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_objectPaths",{get:function(){return this.m_referencedObjectPaths},enumerable:!0,configurable:!0}),t.prototype._removeKeepReferenceAction=function(e){for(var t=this.m_actions.length-1;t>=0;t--){var n=this.m_actions[t].actionInfo;if(n.ObjectPathId===e&&3===n.ActionType&&n.Name===_.keepReference){this.m_actions.splice(t,1);break}}},t._updateLastUsedActionIdOfObjectPathId=function(e,n,i){for(;n;){if(e[n.objectPathInfo.Id])return;e[n.objectPathInfo.Id]=i;var o=n.argumentObjectPaths;if(o)for(var r=o.length,a=0;a<r;a++)t._updateLastUsedActionIdOfObjectPathId(e,o[a],i);n=n.parentObjectPath}},t._calculateLastUsedObjectPathIds=function(e){for(var n={},i=e.length,o=i-1;o>=0;--o){var r=(f=e[o]).actionInfo.Id;f.referencedObjectPath&&t._updateLastUsedActionIdOfObjectPathId(n,f.referencedObjectPath,r);var a=f.referencedArgumentObjectPaths;if(a)for(var s=a.length,c=0;c<s;c++)t._updateLastUsedActionIdOfObjectPathId(n,a[c],r)}var l={};for(var u in n){var d=l[r=n[u]];d||(d=[],l[r]=d),d.push(parseInt(u))}for(o=0;o<i;o++){var f,p=l[(f=e[o]).actionInfo.Id];p&&p.length>0?f.actionInfo.L=p:f.actionInfo.L&&delete f.actionInfo.L}},t}();e.ClientRequestBase=y;var O=function(){function e(e){this.m_type=e}return Object.defineProperty(e.prototype,"value",{get:function(){if(!this.m_isLoaded)throw new i.RuntimeError({code:r.valueNotLoaded,httpStatusCode:400,message:l._getResourceString(a.valueNotLoaded),debugInfo:{errorLocation:"clientResult.value"}});return this.m_value},enumerable:!0,configurable:!0}),e.prototype._handleResult=function(e){this.m_isLoaded=!0,"object"===typeof e&&e&&e._IsNull||(1===this.m_type?this.m_value=S.adjustToDateTime(e):this.m_value=e)},e}();e.ClientResult=O;var v=function(){function e(e){this.m_context=e,this.m_actions=[]}return e.prototype.add=function(e,t,n,i){var o=this;this.m_actions.push({action:e,resultHandler:t,resolve:n,reject:i}),1===this.m_actions.length&&setTimeout((function(){return o.processActions()}),0)},e.prototype.processActions=function(){var e=this;if(0!==this.m_actions.length){var t=this.m_actions;this.m_actions=[];for(var n=new y(this.m_context),i=0;i<t.length;i++){var o=t[i];n.ensureInstantiateObjectPath(o.action.referencedObjectPath),n.ensureInstantiateObjectPaths(o.action.referencedArgumentObjectPaths),n.addAction(o.action),n.addReferencedObjectPath(o.action.referencedObjectPath),n.addReferencedObjectPaths(o.action.referencedArgumentObjectPaths)}var r=n.buildRequestMessageBodyAndRequestFlags(),a=r.body,c=r.flags,u={Url:s.localDocumentApiPrefix,Headers:null,Body:a};l.log("Request:"),l.log(JSON.stringify(a)),(new b).executeAsync(this.m_context._customData,c,u).then((function(i){e.processResponse(n,t,i)})).catch((function(e){for(var n=0;n<t.length;n++){t[n].reject(e)}}))}},e.prototype.processResponse=function(e,t,n){var i=this.getErrorFromResponse(n),o=null;n.Body.Results?o=n.Body.Results:n.Body.ProcessedResults&&n.Body.ProcessedResults.Results&&(o=n.Body.ProcessedResults.Results),o||(o=[]),this.processActionResults(e,t,o,i)},e.prototype.getErrorFromResponse=function(e){return l.isNullOrEmptyString(e.ErrorCode)?e.Body&&e.Body.Error?new i.RuntimeError({code:e.Body.Error.Code,httpStatusCode:e.Body.Error.HttpStatusCode,message:e.Body.Error.Message}):null:new i.RuntimeError({code:e.ErrorCode,httpStatusCode:e.HttpStatusCode,message:e.ErrorMessage})},e.prototype.processActionResults=function(e,t,n,i){e.processResponse(n);for(var o=0;o<t.length;o++){for(var r=t[o],a=r.action.actionInfo.Id,s=!1,c=0;c<n.length;c++)if(a==n[c].ActionId){var l=n[c].Value;r.resultHandler&&(r.resultHandler._handleResult(l),l=r.resultHandler.value),r.resolve&&r.resolve(l),s=!0;break}!s&&r.reject&&(i?r.reject(i):r.reject("No response for the action."))}},e}(),b=function(){function e(){}return e.prototype.getRequestUrl=function(e,t){return"/"!=e.charAt(e.length-1)&&(e+="/"),e=(e+=s.processQuery)+"?"+s.flags+"="+t.toString()},e.prototype.executeAsync=function(t,i,o){var r={method:"POST",url:this.getRequestUrl(o.Url,i),headers:{},body:o.Body};if(r.headers[s.sourceLibHeader]=e.SourceLibHeaderValue,r.headers["CONTENT-TYPE"]="application/json",o.Headers)for(var a in o.Headers)r.headers[a]=o.Headers[a];return(l._isLocalDocumentUrl(r.url)?n.sendLocalDocumentRequest:n.sendRequest)(r).then((function(e){var t;if(200===e.statusCode)t={HttpStatusCode:e.statusCode,ErrorCode:null,ErrorMessage:null,Headers:e.headers,Body:l._parseResponseBody(e)};else{l.log("Error Response:"+e.body);var n=l._parseErrorResponse(e);t={HttpStatusCode:e.statusCode,ErrorCode:n.errorCode,ErrorMessage:n.errorMessage,Headers:e.headers,Body:null}}return t}))},e.SourceLibHeaderValue="officejs-rest",e}();e.HttpRequestExecutor=b;var _=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.collectionPropertyPath="_collectionPropertyPath",t.id="Id",t.idLowerCase="id",t.idPrivate="_Id",t.keepReference="_KeepReference",t.objectPathIdPrivate="_ObjectPathId",t.referenceId="_ReferenceId",t.items="_Items",t.itemsLowerCase="items",t.scalarPropertyNames="_scalarPropertyNames",t.scalarPropertyOriginalNames="_scalarPropertyOriginalNames",t.navigationPropertyNames="_navigationPropertyNames",t.scalarPropertyUpdateable="_scalarPropertyUpdateable",t.previewExecutionObjectId="_previewExecutionObjectId",t}(s);e.CommonConstants=_;var S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.validateObjectPath=function(e){for(var n=e._objectPath;n;){if(!n.isValid)throw new i.RuntimeError({code:r.invalidObjectPath,httpStatusCode:400,message:l._getResourceString(a.invalidObjectPath,t.getObjectPathExpression(n)),debugInfo:{errorLocation:t.getObjectPathExpression(n)}});n=n.parentObjectPath}},t.validateReferencedObjectPaths=function(e){if(e)for(var n=0;n<e.length;n++)for(var o=e[n];o;){if(!o.isValid)throw new i.RuntimeError({code:r.invalidObjectPath,httpStatusCode:400,message:l._getResourceString(a.invalidObjectPath,t.getObjectPathExpression(o))});o=o.parentObjectPath}},t._toCamelLowerCase=function(e){if(l.isNullOrEmptyString(e))return e;for(var t=0;t<e.length&&e.charCodeAt(t)>=65&&e.charCodeAt(t)<=90;)t++;return t<e.length?e.substr(0,t).toLowerCase()+e.substr(t):e.toLowerCase()},t.adjustToDateTime=function(e){if(l.isNullOrUndefined(e))return null;if("string"===typeof e)return new Date(e);if(Array.isArray(e)){for(var n=e,i=0;i<n.length;i++)n[i]=t.adjustToDateTime(n[i]);return n}throw l._createInvalidArgError({argumentName:"date"})},t.tryGetObjectIdFromLoadOrRetrieveResult=function(e){var t=e[_.id];return l.isNullOrUndefined(t)&&(t=e[_.idLowerCase]),l.isNullOrUndefined(t)&&(t=e[_.idPrivate]),t},t.getObjectPathExpression=function(e){for(var n="";e;){switch(e.objectPathInfo.ObjectPathType){case 1:n=n;break;case 2:n="new()"+(n.length>0?".":"")+n;break;case 3:n=t.normalizeName(e.objectPathInfo.Name)+"()"+(n.length>0?".":"")+n;break;case 4:n=t.normalizeName(e.objectPathInfo.Name)+(n.length>0?".":"")+n;break;case 5:n="getItem()"+(n.length>0?".":"")+n;break;case 6:n="_reference()"+(n.length>0?".":"")+n}e=e.parentObjectPath}return n},t.setMethodArguments=function(e,n,i){if(l.isNullOrUndefined(i))return null;var o=new Array,r=new Array,a=t.collectObjectPathInfos(e,i,o,r);return n.Arguments=i,a&&(n.ReferencedObjectPathIds=r),o},t.validateContext=function(e,t){if(e&&t&&t._context!==e)throw new i.RuntimeError({code:r.invalidRequestContext,httpStatusCode:400,message:l._getResourceString(a.invalidRequestContext)})},t.isSetSupported=function(e,t){return!("undefined"!==typeof window&&window.Office&&window.Office.context&&window.Office.context.requirements)||window.Office.context.requirements.isSetSupported(e,t)},t.throwIfApiNotSupported=function(e,n,o,s){if(t._doApiNotSupportedCheck&&!t.isSetSupported(n,o)){var c=l._getResourceString(a.apiNotFoundDetails,[e,n+" "+o,s]);throw new i.RuntimeError({code:r.apiNotFound,httpStatusCode:404,message:c,debugInfo:{errorLocation:e}})}},t.calculateApiFlags=function(e,n,i){return t.isSetSupported(n,i)||(e&=-3),e},t._parseSelectExpand=function(e){var t=[];if(!l.isNullOrEmptyString(e))for(var n=e.split(","),i=0;i<n.length;i++){var o=n[i];(o=r(o.trim())).length>0&&t.push(o)}return t;function r(e){var t=e.toLowerCase();if("items"===t||"items/"===t)return"*";return("items/"===t.substr(0,6)||"items."===t.substr(0,6))&&(e=e.substr(6)),e.replace(new RegExp("[/.]items[/.]","gi"),"/")}},t.changePropertyNameToCamelLowerCase=function(e){if(Array.isArray(e)){for(var n=[],i=0;i<e.length;i++)n.push(this.changePropertyNameToCamelLowerCase(e[i]));return n}if("object"===typeof e&&null!==e){n={};for(var o in e){var r=e[o];if(o===_.items){(n={})[_.itemsLowerCase]=this.changePropertyNameToCamelLowerCase(r);break}n[t._toCamelLowerCase(o)]=this.changePropertyNameToCamelLowerCase(r)}return n}return e},t.purifyJson=function(e){if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++)t.push(this.purifyJson(e[n]));return t}if("object"===typeof e&&null!==e){t={};for(var i in e)if(95!==i.charCodeAt(0)){var o=e[i];"object"===typeof o&&null!==o&&Array.isArray(o.items)&&(o=o.items),t[i]=this.purifyJson(o)}return t}return e},t.collectObjectPathInfos=function(e,n,i,o){for(var r=!1,a=0;a<n.length;a++)if(n[a]instanceof f){var s=n[a];t.validateContext(e,s),n[a]=s._objectPath.objectPathInfo.Id,o.push(s._objectPath.objectPathInfo.Id),i.push(s._objectPath),r=!0}else if(Array.isArray(n[a])){var c=new Array;t.collectObjectPathInfos(e,n[a],i,c)?(o.push(c),r=!0):o.push(0)}else l.isPlainJsonObject(n[a])?(o.push(0),t.replaceClientObjectPropertiesWithObjectPathIds(n[a],i)):o.push(0);return r},t.replaceClientObjectPropertiesWithObjectPathIds=function(e,n){var i,o;for(var r in e){var a=e[r];if(a instanceof f)n.push(a._objectPath),e[r]=((i={})[_.objectPathIdPrivate]=a._objectPath.objectPathInfo.Id,i);else if(Array.isArray(a))for(var s=0;s<a.length;s++)if(a[s]instanceof f){var c=a[s];n.push(c._objectPath),a[s]=((o={})[_.objectPathIdPrivate]=c._objectPath.objectPathInfo.Id,o)}else l.isPlainJsonObject(a[s])&&t.replaceClientObjectPropertiesWithObjectPathIds(a[s],n);else l.isPlainJsonObject(a)&&t.replaceClientObjectPropertiesWithObjectPathIds(a,n)}},t.normalizeName=function(e){return e.substr(0,1).toLowerCase()+e.substr(1)},t._doApiNotSupportedCheck=!1,t}(l);e.CommonUtility=S;var A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.propertyDoesNotExist="PropertyDoesNotExist",t.attemptingToSetReadOnlyProperty="AttemptingToSetReadOnlyProperty",t}(a);e.CommonResourceStrings=A;var D=function(e){function t(t){var n=e.call(this)||this;return n.m_shouldPolyfill=t,n}return __extends(t,e),t.prototype._handleResult=function(t){e.prototype._handleResult.call(this,t),this.m_shouldPolyfill&&(this.m_value=S.changePropertyNameToCamelLowerCase(this.m_value)),this.m_value=this.removeItemNodes(this.m_value)},t.prototype.removeItemNodes=function(e){return"object"===typeof e&&null!==e&&e[_.itemsLowerCase]&&(e=e[_.itemsLowerCase]),S.purifyJson(e)},t}(O);e.ClientRetrieveResult=D;var C=function(){function e(e){this.callback=e}return e.prototype._handleResult=function(e){this.callback&&this.callback()},e}(),P=function(e){function t(t){var n=e.call(this)||this;return n.callback=t,n}return __extends(t,e),t.prototype._handleResult=function(t){e.prototype._handleResult.call(this,t),this.callback()},t}(O);e.ClientResultCallback=P;var I=function(){function t(){}return t.invokeMethod=function(e,t,n,i,o,r){return void 0===n&&(n=0),void 0===i&&(i=[]),void 0===o&&(o=0),void 0===r&&(r=0),l.createPromise((function(r,a){var s=new O,c={Id:e._context._nextId(),ActionType:3,Name:t,ObjectPathId:e._objectPath.objectPathInfo.Id,ArgumentInfo:{}},l=S.setMethodArguments(e._context,c.ArgumentInfo,i),u=new p(c,n,o);u.referencedObjectPath=e._objectPath,u.referencedArgumentObjectPaths=l,e._context._addServiceApiAction(u,s,r,a)}))},t.invokeMethodWithClientResultCallback=function(e,t,n){var i=[];return l.createPromise((function(o,r){var a=new P(e),s={Id:t._context._nextId(),ActionType:3,Name:n,ObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}},c=S.setMethodArguments(t._context,s.ArgumentInfo,i),l=new p(s,0,0);l.referencedObjectPath=t._objectPath,l.referencedArgumentObjectPaths=c,t._context._addServiceApiAction(l,a,o,r)}))},t.invokeRetrieve=function(n,i){var o,r=e._internalConfig.alwaysPolyfillClientObjectRetrieveMethod;if(r||(r=!S.isSetSupported("RichApiRuntime","1.1")),"object"===typeof i[0]&&i[0].hasOwnProperty("$all")){if(!i[0].$all)throw e.Error._createInvalidArgError({});o=i[0]}else o=t._parseSelectOption(i);return n._retrieve(o,new D(r))},t._parseSelectOption=function(n){if(!n||!n[0])throw e.Error._createInvalidArgError({});var i=n[0]&&"string"!==typeof n[0]?n[0]:n;return Array.isArray(i)?i:t.parseRecursiveSelect(i)},t.parseRecursiveSelect=function(e){var t=function(e){return Object.keys(e).reduce((function(n,i){var o=e[i];return"object"===typeof o?n.concat(t(o).map((function(e){return i+"/"+e}))):o?n.concat(i):n}),[])};return t(e)},t.invokeRecursiveUpdate=function(e,t){return l.createPromise((function(n,i){e._recursivelyUpdate(t);var o={Id:e._context._nextId(),ActionType:5,Name:"Trace",ObjectPathId:0},r=new p(o,1,4);e._context._addServiceApiAction(r,null,n,i)}))},t.createRootServiceObject=function(e,t){var n={Id:t._nextId(),ObjectPathType:1,Name:""};return new e(t,new h(n,null,!1,!1,1,4))},t.createTopLevelServiceObject=function(e,t,n,i,o){var r={Id:t._nextId(),ObjectPathType:2,Name:n};return new e(t,new h(r,null,i,!1,1,4|o))},t.createPropertyObject=function(e,t,n,i,o){var r={Id:t._context._nextId(),ObjectPathType:4,Name:n,ParentObjectPathId:t._objectPath.objectPathInfo.Id},a=new h(r,t._objectPath,i,!1,1,4|o);return new e(t._context,a)},t.createIndexerObject=function(e,t,n){var i={Id:t._context._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};i.ArgumentInfo.Arguments=n;var o=new h(i,t._objectPath,!1,!1,1,4);return new e(t._context,o)},t.createMethodObject=function(e,t,n,i,o,r,a,s,c){var l={Id:t._context._nextId(),ObjectPathType:3,Name:n,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}},u=S.setMethodArguments(t._context,l.ArgumentInfo,o),d=new h(l,t._objectPath,r,a,i,c);return d.argumentObjectPaths=u,d.getByIdMethodName=s,new e(t._context,d)},t.createAndInstantiateMethodObject=function(e,t,n,i,o,r,a,s,c){return l.createPromise((function(l,u){var d={Id:t._context._nextId(),ObjectPathType:3,Name:n,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}},f=S.setMethodArguments(t._context,d.ArgumentInfo,o),m=new h(d,t._objectPath,r,a,i,c);m.argumentObjectPaths=f,m.getByIdMethodName=s;var g=new O,y={Id:t._context._nextId(),ActionType:1,Name:"",ObjectPathId:m.objectPathInfo.Id,QueryInfo:{}},v=new p(y,1,4);v.referencedObjectPath=m,t._context._addServiceApiAction(v,g,(function(){return l(new e(t._context,m))}),u)}))},t.createTraceAction=function(e,t){return l.createPromise((function(n,i){var o={Id:e._nextId(),ActionType:5,Name:"Trace",ObjectPathId:0},r=new p(o,1,4),a=new C(t);e._addServiceApiAction(r,a,n,i)}))},t.localDocumentContext=new m,t}();e.OperationalApiHelper=I;var E=function(){function e(e,t,n){this.eventId=e,this.targetId=t,this.eventArgumentTransform=n,this.registeredCallbacks=[]}return e.prototype.add=function(e){this.hasZero()&&G.getGenericEventRegistration().register(this.eventId,this.targetId,this.registerCallback),this.registeredCallbacks.push(e)},e.prototype.remove=function(e){var t=this.registeredCallbacks.lastIndexOf(e);-1!==t&&this.registeredCallbacks.splice(t,1)},e.prototype.removeAll=function(){this.registeredCallbacks=[],G.getGenericEventRegistration().unregister(this.eventId,this.targetId,this.registerCallback)},e.prototype.hasZero=function(){return 0===this.registeredCallbacks.length},Object.defineProperty(e.prototype,"registerCallback",{get:function(){var e=this;return this.outsideCallback||(this.outsideCallback=function(t){e.call(t)}),this.outsideCallback},enumerable:!0,configurable:!0}),e.prototype.call=function(t){var n=this;this.eventArgumentTransform(t).then((function(t){var i=n.registeredCallbacks.map((function(n){return e.callCallback(n,t)}));l.Promise.all(i)}))},e.callCallback=function(t,n){return l._createPromiseFromResult(null).then(e.wrapCallbackInFunction(t,n)).catch((function(e){l.log("Error when invoke handler: "+JSON.stringify(e))}))},e.wrapCallbackInFunction=function(e,t){return function(){return e(t)}},e}();e.GenericEventRegistryOperational=E;var F=function(){function e(){this.eventToTargetToHandlerMap={}}return Object.defineProperty(e,"globalEventRegistry",{get:function(){return e.singleton||(e.singleton=new e),e.singleton},enumerable:!0,configurable:!0}),e.getGlobalEventRegistry=function(t,n,i){var o=e.globalEventRegistry.eventToTargetToHandlerMap;o.hasOwnProperty(t)||(o[t]={});var r=o[t];return r.hasOwnProperty(n)||(r[n]=new E(t,n,i)),r[n]},e.singleton=void 0,e}();e.GlobalEventRegistryOperational=F;var M=function(){function e(e){this.genericEventInfo=e}return e.prototype.add=function(e){var t=this,n=void 0,i=l.createPromise((function(e){n=e}));return this.register(),this.createTrace((function(){var i=t.genericEventInfo.eventType,o=t.genericEventInfo.getTargetIdFunc();F.getGlobalEventRegistry(i,o,t.genericEventInfo.eventArgsTransformFunc).add(e),n()})),i},e.prototype.remove=function(e){var t=this;this.register(),this.createTrace((function(){var n=t.genericEventInfo.eventType,i=t.genericEventInfo.getTargetIdFunc();F.getGlobalEventRegistry(n,i,t.genericEventInfo.eventArgsTransformFunc).remove(e)}))},e.prototype.removeAll=function(){var e=this;this.unregister(),this.createTrace((function(){var t=e.genericEventInfo.eventType,n=e.genericEventInfo.getTargetIdFunc();F.getGlobalEventRegistry(t,n,e.genericEventInfo.eventArgsTransformFunc).removeAll()}))},e.prototype.createTrace=function(e){I.createTraceAction(this.genericEventInfo.object._context,e)},e.prototype.register=function(){I.invokeMethod(this.genericEventInfo.object,this.genericEventInfo.register,0,[],0),G.getGenericEventRegistration().isReady||G.getGenericEventRegistration().ready()},e.prototype.unregister=function(){I.invokeMethod(this.genericEventInfo.object,this.genericEventInfo.unregister)},e}();e.GenericEventHandlerOperational=M;var x=function(){function e(){}return e.invokeOn=function(e,t,n){var i=void 0,o=l.createPromise((function(e,t){i=e}));return e.add(t).then((function(){i({})})),o},e.invokeOff=function(t,n,i,o){if(!i&&!o){var r=Object.keys(t).map((function(e){return t[e]}));return e.invokeAllOff(r)}return i?(o?n.remove(o):n.removeAll(),l.createPromise((function(e,t){return e()}))):l._createPromiseFromException(i+" must be supplied if handler is supplied.")},e.invokeAllOff=function(e){return e.forEach((function(e){e.removeAll()})),l.createPromise((function(e,t){return e()}))},e}();e.EventHelper=x;var R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.propertyNotLoaded="PropertyNotLoaded",t.runMustReturnPromise="RunMustReturnPromise",t.cannotRegisterEvent="CannotRegisterEvent",t.invalidOrTimedOutSession="InvalidOrTimedOutSession",t.cannotUpdateReadOnlyProperty="CannotUpdateReadOnlyProperty",t}(r);e.ErrorCodes=R;var w=function(){function e(e){this.m_callback=e}return e.prototype._handleResult=function(e){this.m_callback&&this.m_callback()},e}(),N=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.createMethodAction=function(t,n,i,o,r,a){Y.validateObjectPath(n);var s={Id:t._nextId(),ActionType:3,Name:i,ObjectPathId:n._objectPath.objectPathInfo.Id,ArgumentInfo:{}},c=Y.setMethodArguments(t,s.ArgumentInfo,r);Y.validateReferencedObjectPaths(c);var l=Y._fixupApiFlags(a),u=new p(s,o,l);if(u.referencedObjectPath=n._objectPath,u.referencedArgumentObjectPaths=c,n._addAction(u),e._internalConfig.enablePreviewExecution&&0!==(16&l)){var d={Id:t._nextId(),ActionType:3,Name:i,Arguments:r,ObjectId:"",ObjectType:""};n._addPreviewExecutionAction(d)}return u},n.createRecursiveQueryAction=function(e,t,n){Y.validateObjectPath(t);var i={Id:e._nextId(),ActionType:6,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,RecursiveQueryInfo:n},o=new p(i,1,4);return o.referencedObjectPath=t._objectPath,t._addAction(o),o},n.createEnsureUnchangedAction=function(e,t,n){Y.validateObjectPath(t);var i={Id:e._nextId(),ActionType:8,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,ObjectState:n},o=new p(i,1,4);return o.referencedObjectPath=t._objectPath,t._addAction(o),o},n.createInstantiateAction=function(e,t){Y.validateObjectPath(t),e._pendingRequest.ensureInstantiateObjectPath(t._objectPath.parentObjectPath),e._pendingRequest.ensureInstantiateObjectPaths(t._objectPath.argumentObjectPaths);var n={Id:e._nextId(),ActionType:1,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id},i=new p(n,1,4);return i.referencedObjectPath=t._objectPath,t._addAction(i,new J(t),!0),i},n.createTraceAction=function(e,t,n){var i={Id:e._nextId(),ActionType:5,Name:"Trace",ObjectPathId:0},o=new p(i,1,4);return e._pendingRequest.addAction(o),n&&e._pendingRequest.addTrace(i.Id,t),o},n.createTraceMarkerForCallback=function(e,t){var i=n.createTraceAction(e,null,!1);e._pendingRequest.addActionResultHandler(i,new w(t))},n}(d);e.ActionFactory=N;var T=function(t){function n(n,i){var o=t.call(this,n,i)||this;return Y.checkArgumentNull(n,"context"),o.m_context=n,o._objectPath&&(!n._processingResult&&n._pendingRequest&&(N.createInstantiateAction(n,o),n._autoCleanup&&o._KeepReference&&n.trackedObjects._autoAdd(o)),e._internalConfig.appendTypeNameToObjectPathInfo&&o._objectPath.objectPathInfo&&o._className&&(o._objectPath.objectPathInfo.T=o._className)),o}return __extends(n,t),Object.defineProperty(n.prototype,"context",{get:function(){return this.m_context},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isNull",{get:function(){return("undefined"!==typeof this.m_isNull||!u.isMock())&&(Y.throwIfNotLoaded("isNull",this._isNull,null,this._isNull),this._isNull)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isNullObject",{get:function(){return("undefined"!==typeof this.m_isNull||!u.isMock())&&(Y.throwIfNotLoaded("isNullObject",this._isNull,null,this._isNull),this._isNull)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_isNull",{get:function(){return this.m_isNull},set:function(e){this.m_isNull=e,e&&this._objectPath&&this._objectPath._updateAsNullObject()},enumerable:!0,configurable:!0}),n.prototype._addAction=function(e,t,n){return void 0===t&&(t=null),n||(this.context._pendingRequest.ensureInstantiateObjectPath(this._objectPath),this.context._pendingRequest.ensureInstantiateObjectPaths(e.referencedArgumentObjectPaths)),this.context._pendingRequest.addAction(e),this.context._pendingRequest.addReferencedObjectPath(this._objectPath),this.context._pendingRequest.addReferencedObjectPaths(e.referencedArgumentObjectPaths),this.context._pendingRequest.addActionResultHandler(e,t),l._createPromiseFromResult(null)},n.prototype._addPreviewExecutionAction=function(e){if(!Y.isUndefined(this._className)){e.ObjectType=this._className;var t=Y._getPropertyValueWithoutCheckLoaded(this,H.idLowerCase);Y.isUndefined(t)&&(t=Y._getPropertyValueWithoutCheckLoaded(this,H.idPrivate)),Y.isUndefined(t)&&(t=Y._getPropertyValueWithoutCheckLoaded(this,H.previewExecutionObjectId)),e.ObjectId=t,this.context._pendingRequest.addPreviewExecutionAction(e)}},n.prototype._handleResult=function(e){this._isNull=Y.isNullOrUndefined(e),this.context.trackedObjects._autoTrackIfNecessaryWhenHandleObjectResultValue(this,e)},n.prototype._handleIdResult=function(e){this._isNull=Y.isNullOrUndefined(e),Y.fixObjectPathIfNecessary(this,e),this.context.trackedObjects._autoTrackIfNecessaryWhenHandleObjectResultValue(this,e)},n.prototype._handleRetrieveResult=function(e,t){this._handleIdResult(e)},n.prototype._recursivelySet=function(e,t,o,s,c){var u=e instanceof n,d=e;if(u){if(Object.getPrototypeOf(this)!==Object.getPrototypeOf(e))throw i.RuntimeError._createInvalidArgError({argumentName:"properties",errorLocation:this._className+".set"});e=JSON.parse(JSON.stringify(e))}try{for(var f,p=0;p<o.length;p++)f=o[p],e.hasOwnProperty(f)&&"undefined"!==typeof e[f]&&(this[f]=e[f]);for(p=0;p<s.length;p++)if(f=s[p],e.hasOwnProperty(f)&&"undefined"!==typeof e[f]){var h=u?d[f]:e[f];this[f].set(h,t)}var m=!u;t&&!Y.isNullOrUndefined(m)&&(m=t.throwOnReadOnly);for(p=0;p<c.length;p++)if(f=c[p],e.hasOwnProperty(f)&&"undefined"!==typeof e[f]&&m)throw new i.RuntimeError({code:r.invalidArgument,httpStatusCode:400,message:l._getResourceString(Z.cannotApplyPropertyThroughSetMethod,f),debugInfo:{errorLocation:f}});for(f in e)if(o.indexOf(f)<0&&s.indexOf(f)<0){var g=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),f);if(!g)throw new i.RuntimeError({code:r.invalidArgument,httpStatusCode:400,message:l._getResourceString(A.propertyDoesNotExist,f),debugInfo:{errorLocation:f}});if(m&&!g.set)throw new i.RuntimeError({code:r.invalidArgument,httpStatusCode:400,message:l._getResourceString(A.attemptingToSetReadOnlyProperty,f),debugInfo:{errorLocation:f}})}}catch(e){throw new i.RuntimeError({code:r.invalidArgument,httpStatusCode:400,message:l._getResourceString(a.invalidArgument,"properties"),debugInfo:{errorLocation:this._className+".set"},innerError:e})}},n}(f);e.ClientObject=T;var j=function(){function e(e){this.m_session=e}return e.prototype.executeAsync=function(e,t,n){var i={url:s.processQuery,method:"POST",headers:n.Headers,body:n.Body},r={id:o.nextId(),type:1,flags:t,message:i};return l.log(JSON.stringify(r)),this.m_session.sendMessageToHost(r).then((function(e){l.log("Received response: "+JSON.stringify(e));var t,n=e.message;if(200===n.statusCode)t={HttpStatusCode:n.statusCode,ErrorCode:null,ErrorMessage:null,Headers:n.headers,Body:l._parseResponseBody(n)};else{l.log("Error Response:"+n.body);var i=l._parseErrorResponse(n);t={HttpStatusCode:n.statusCode,ErrorCode:i.errorCode,ErrorMessage:i.errorMessage,Headers:n.headers,Body:null}}return t}))},e}(),U=function(e){function t(t){var n=e.call(this)||this;return n.m_bridge=t,n.m_bridge.addHostMessageHandler((function(e){3===e.type&&G.getGenericEventRegistration()._handleRichApiMessage(e.message)})),n}return __extends(t,e),t.getInstanceIfHostBridgeInited=function(){return o.instance?((l.isNullOrUndefined(t.s_instance)||t.s_instance.m_bridge!==o.instance)&&(t.s_instance=new t(o.instance)),t.s_instance):null},t.prototype._resolveRequestUrlAndHeaderInfo=function(){return l._createPromiseFromResult(null)},t.prototype._createRequestExecutorOrNull=function(){return l.log("NativeBridgeSession::CreateRequestExecutor"),new j(this)},Object.defineProperty(t.prototype,"eventRegistration",{get:function(){return G.getGenericEventRegistration()},enumerable:!0,configurable:!0}),t.prototype.sendMessageToHost=function(e){return this.m_bridge.sendMessageToHostAndExpectResponse(e)},t}(t);e.HostBridgeSession=U;var k=function(n){function o(e){var r=n.call(this)||this;if(r.m_customRequestHeaders={},r.m_batchMode=0,r._onRunFinishedNotifiers=[],t._overrideSession)r.m_requestUrlAndHeaderInfoResolver=t._overrideSession;else if((Y.isNullOrUndefined(e)||"string"===typeof e&&0===e.length)&&((e=o.defaultRequestUrlAndHeaders)||(e={url:s.localDocument,headers:{}})),"string"===typeof e)r.m_requestUrlAndHeaderInfo={url:e,headers:{}};else if(o.isRequestUrlAndHeaderInfoResolver(e))r.m_requestUrlAndHeaderInfoResolver=e;else{if(!o.isRequestUrlAndHeaderInfo(e))throw i.RuntimeError._createInvalidArgError({argumentName:"url"});var a=e;r.m_requestUrlAndHeaderInfo={url:a.url,headers:{}},l._copyHeaders(a.headers,r.m_requestUrlAndHeaderInfo.headers)}return!r.m_requestUrlAndHeaderInfoResolver&&r.m_requestUrlAndHeaderInfo&&l._isLocalDocumentUrl(r.m_requestUrlAndHeaderInfo.url)&&U.getInstanceIfHostBridgeInited()&&(r.m_requestUrlAndHeaderInfo=null,r.m_requestUrlAndHeaderInfoResolver=U.getInstanceIfHostBridgeInited()),r.m_requestUrlAndHeaderInfoResolver instanceof t&&(r.m_session=r.m_requestUrlAndHeaderInfoResolver),r._processingResult=!1,r._customData=H.iterativeExecutor,r.sync=r.sync.bind(r),r}return __extends(o,n),Object.defineProperty(o.prototype,"session",{get:function(){return this.m_session},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"eventRegistration",{get:function(){return this.m_session?this.m_session.eventRegistration:i.officeJsEventRegistration},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_url",{get:function(){return this.m_requestUrlAndHeaderInfo?this.m_requestUrlAndHeaderInfo.url:null},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_pendingRequest",{get:function(){return null==this.m_pendingRequest&&(this.m_pendingRequest=new W(this)),this.m_pendingRequest},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"debugInfo",{get:function(){return{pendingStatements:new $(this._rootObjectPropertyName,this._pendingRequest._objectPaths,this._pendingRequest._actions,e._internalConfig.showDisposeInfoInDebugInfo).process()}},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"trackedObjects",{get:function(){return this.m_trackedObjects||(this.m_trackedObjects=new Q(this)),this.m_trackedObjects},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"requestHeaders",{get:function(){return this.m_customRequestHeaders},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"batchMode",{get:function(){return this.m_batchMode},enumerable:!0,configurable:!0}),o.prototype.ensureInProgressBatchIfBatchMode=function(){if(1===this.m_batchMode&&!this.m_explicitBatchInProgress)throw Y.createRuntimeError(r.generalException,l._getResourceString(Z.notInsideBatch),null)},o.prototype.load=function(e,t){Y.validateContext(this,e);var n=o._parseQueryOption(t);d.createQueryAction(this,e,n,e)},o.prototype.loadRecursive=function(e,t,n){if(!Y.isPlainJsonObject(t))throw i.RuntimeError._createInvalidArgError({argumentName:"options"});var r={};for(var a in t)r[a]=o._parseQueryOption(t[a]);var s=N.createRecursiveQueryAction(this,e,{Queries:r,MaxDepth:n});this._pendingRequest.addActionResultHandler(s,e)},o.prototype.trace=function(e){N.createTraceAction(this,e,!0)},o.prototype._processOfficeJsErrorResponse=function(e,t){},o.prototype.ensureRequestUrlAndHeaderInfo=function(){var e=this;return Y._createPromiseFromResult(null).then((function(){if(!e.m_requestUrlAndHeaderInfo)return e.m_requestUrlAndHeaderInfoResolver._resolveRequestUrlAndHeaderInfo().then((function(t){if(e.m_requestUrlAndHeaderInfo=t,e.m_requestUrlAndHeaderInfo||(e.m_requestUrlAndHeaderInfo={url:s.localDocument,headers:{}}),Y.isNullOrEmptyString(e.m_requestUrlAndHeaderInfo.url)&&(e.m_requestUrlAndHeaderInfo.url=s.localDocument),e.m_requestUrlAndHeaderInfo.headers||(e.m_requestUrlAndHeaderInfo.headers={}),"function"===typeof e.m_requestUrlAndHeaderInfoResolver._createRequestExecutorOrNull){var n=e.m_requestUrlAndHeaderInfoResolver._createRequestExecutorOrNull();n&&(e._requestExecutor=n)}}))}))},o.prototype.syncPrivateMain=function(){var e=this;return this.ensureRequestUrlAndHeaderInfo().then((function(){var t=e._pendingRequest;return e.m_pendingRequest=null,e.processPreSyncPromises(t).then((function(){return e.syncPrivate(t)}))}))},o.prototype.syncPrivate=function(e){var t=this;if(u.isMock())return l._createPromiseFromResult(null);if(!e.hasActions)return this.processPendingEventHandlers(e);var n=e.buildRequestMessageBodyAndRequestFlags(),o=n.body,r=n.flags;this._requestFlagModifier&&(r|=this._requestFlagModifier),this._requestExecutor||(l._isLocalDocumentUrl(this.m_requestUrlAndHeaderInfo.url)?this._requestExecutor=new X(this):this._requestExecutor=new b);var a=this._requestExecutor,s={};l._copyHeaders(this.m_requestUrlAndHeaderInfo.headers,s),l._copyHeaders(this.m_customRequestHeaders,s),delete this.m_customRequestHeaders[H.officeScriptEventId];var c={Url:this.m_requestUrlAndHeaderInfo.url,Headers:s,Body:o};e.invalidatePendingInvalidObjectPaths();var d=null,f=null;return this._lastSyncStart="undefined"===typeof performance?0:performance.now(),this._lastRequestFlags=r,a.executeAsync(this._customData,r,c).then((function(n){return t._lastSyncEnd="undefined"===typeof performance?0:performance.now(),d=t.processRequestExecutorResponseMessage(e,n),t.processPendingEventHandlers(e).catch((function(e){l.log("Error in processPendingEventHandlers"),l.log(JSON.stringify(e)),f=e}))})).then((function(){if(d)throw l.log("Throw error from response: "+JSON.stringify(d)),d;if(f){l.log("Throw error from ProcessEventHandler: "+JSON.stringify(f));var t=null;if(f instanceof i.RuntimeError)(t=f).traceMessages=e._responseTraceMessages;else{var n=null;n="string"===typeof f?f:f.message,Y.isNullOrEmptyString(n)&&(n=l._getResourceString(Z.cannotRegisterEvent)),t=new i.RuntimeError({code:R.cannotRegisterEvent,httpStatusCode:400,message:n,traceMessages:e._responseTraceMessages})}throw t}}))},o.prototype.processRequestExecutorResponseMessage=function(t,n){n.Body&&n.Body.TraceIds&&t._setResponseTraceIds(n.Body.TraceIds);var o=t._responseTraceMessages,r=null;if(n.Body){if(n.Body.Error&&n.Body.Error.ActionIndex>=0){var a=new $(this._rootObjectPropertyName,t._objectPaths,t._actions,!1,!0),s=a.processForDebugStatementInfo(n.Body.Error.ActionIndex);r={statement:s.statement,surroundingStatements:s.surroundingStatements,fullStatements:["Please enable config.extendedErrorLogging to see full statements."]},e.config.extendedErrorLogging&&(a=new $(this._rootObjectPropertyName,t._objectPaths,t._actions,!1,!1),r.fullStatements=a.process())}var c=null;if(n.Body.Results?c=n.Body.Results:n.Body.ProcessedResults&&n.Body.ProcessedResults.Results&&(c=n.Body.ProcessedResults.Results),c){this._processingResult=!0;try{t.processResponse(c)}finally{this._processingResult=!1}}}if(!Y.isNullOrEmptyString(n.ErrorCode))return new i.RuntimeError({code:n.ErrorCode,httpStatusCode:n.HttpStatusCode,message:n.ErrorMessage,traceMessages:o});if(n.Body&&n.Body.Error){var l={errorLocation:n.Body.Error.Location};return r&&(l.statement=r.statement,l.surroundingStatements=r.surroundingStatements,l.fullStatements=r.fullStatements),new i.RuntimeError({code:n.Body.Error.Code,httpStatusCode:n.Body.Error.HttpStatusCode,message:n.Body.Error.Message,traceMessages:o,debugInfo:l})}return null},o.prototype.processPendingEventHandlers=function(e){for(var t=Y._createPromiseFromResult(null),n=0;n<e._pendingProcessEventHandlers.length;n++){var i=e._pendingProcessEventHandlers[n];t=t.then(this.createProcessOneEventHandlersFunc(i,e))}return t},o.prototype.createProcessOneEventHandlersFunc=function(e,t){return function(){return e._processRegistration(t)}},o.prototype.processPreSyncPromises=function(e){for(var t=Y._createPromiseFromResult(null),n=0;n<e._preSyncPromises.length;n++){var i=e._preSyncPromises[n];t=t.then(this.createProcessOneProSyncFunc(i))}return t},o.prototype.createProcessOneProSyncFunc=function(e){return function(){return e}},o.prototype.sync=function(e){return u.isMock()?l._createPromiseFromResult(e):this.syncPrivateMain().then((function(){return e}))},o.prototype.batch=function(e){var t=this;if(1!==this.m_batchMode)return l._createPromiseFromException(Y.createRuntimeError(r.generalException,null,null));if(this.m_explicitBatchInProgress)return l._createPromiseFromException(Y.createRuntimeError(r.generalException,l._getResourceString(Z.pendingBatchInProgress),null));if(Y.isNullOrUndefined(e))return Y._createPromiseFromResult(null);this.m_explicitBatchInProgress=!0;var n,i,o,a=this.m_pendingRequest;this.m_pendingRequest=new W(this);try{n=e(this._rootObject,this)}catch(e){return this.m_explicitBatchInProgress=!1,this.m_pendingRequest=a,l._createPromiseFromException(e)}return"object"===typeof n&&n&&"function"===typeof n.then?o=Y._createPromiseFromResult(null).then((function(){return n})).then((function(e){return t.m_explicitBatchInProgress=!1,i=t.m_pendingRequest,t.m_pendingRequest=a,e})).catch((function(e){return t.m_explicitBatchInProgress=!1,i=t.m_pendingRequest,t.m_pendingRequest=a,l._createPromiseFromException(e)})):(this.m_explicitBatchInProgress=!1,i=this.m_pendingRequest,this.m_pendingRequest=a,o=Y._createPromiseFromResult(n)),o.then((function(e){return t.ensureRequestUrlAndHeaderInfo().then((function(){return t.syncPrivate(i)})).then((function(){return e}))}))},o._run=function(e,t,n,i,r,a){return void 0===n&&(n=3),void 0===i&&(i=5e3),o._runCommon("run",null,e,0,t,n,i,null,r,a)},o.isValidRequestInfo=function(e){return"string"===typeof e||o.isRequestUrlAndHeaderInfo(e)||o.isRequestUrlAndHeaderInfoResolver(e)},o.isRequestUrlAndHeaderInfo=function(e){return"object"===typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.getPrototypeOf({})&&!Y.isNullOrUndefined(e.url)},o.isRequestUrlAndHeaderInfoResolver=function(e){return"object"===typeof e&&null!==e&&"function"===typeof e._resolveRequestUrlAndHeaderInfo},o._runBatch=function(e,t,n,i,r,a,s,c){return void 0===r&&(r=3),void 0===a&&(a=5e3),o._runBatchCommon(0,e,t,n,r,a,i,s,c)},o._runExplicitBatch=function(e,t,n,i,r,a,s,c){return void 0===r&&(r=3),void 0===a&&(a=5e3),o._runBatchCommon(1,e,t,n,r,a,i,s,c)},o._runBatchCommon=function(e,t,n,i,r,a,s,c,l){var u,d;void 0===r&&(r=3),void 0===a&&(a=5e3);var f=null,p=null,h=0,m=null;if(n.length>0)if(o.isValidRequestInfo(n[0]))f=n[0],h=1;else if(Y.isPlainJsonObject(n[0])){if(null!=(f=(m=n[0]).session)&&!o.isValidRequestInfo(f))return o.createErrorPromise(t);p=m.previousObjects,h=1}if(n.length==h+1)d=n[h+0];else{if(null!=m||n.length!=h+2)return o.createErrorPromise(t);p=n[h+0],d=n[h+1]}if(null!=p)if(p instanceof T)u=function(){return p.context};else if(p instanceof o)u=function(){return p};else{if(!Array.isArray(p))return o.createErrorPromise(t);var g=p;if(0==g.length)return o.createErrorPromise(t);for(var y=0;y<g.length;y++){if(!(g[y]instanceof T))return o.createErrorPromise(t);if(g[y].context!=g[0].context)return o.createErrorPromise(t,Z.invalidRequestContext)}u=function(){return g[0].context}}else u=i;var O=null;return s&&(O=function(e){return s(m||{},e)}),o._runCommon(t,f,u,e,d,r,a,O,c,l)},o.createErrorPromise=function(e,t){return void 0===t&&(t=a.invalidArgument),l._createPromiseFromException(Y.createRuntimeError(t,l._getResourceString(t),e))},o._runCommon=function(n,i,r,a,s,c,u,d,f,p){t._overrideSession&&(i=t._overrideSession);var h,m,g,y=l.createPromise((function(e,t){e()})),O=!1;return y.then((function(){if((h=r(i))._autoCleanup)return new e.Promise((function(e,t){h._onRunFinishedNotifiers.push((function(){h._autoCleanup=!0,e()}))}));h._autoCleanup=!0})).then((function(){return"function"!==typeof s?o.createErrorPromise(n):(g=h.m_batchMode,h.m_batchMode=a,d&&d(h),e=s(1==a?h.batch.bind(h):h),(Y.isNullOrUndefined(e)||"function"!==typeof e.then)&&Y.throwError(Z.runMustReturnPromise),e);var e})).then((function(e){return 1===a?e:h.sync(e)})).then((function(e){O=!0,m=e})).catch((function(e){m=e})).then((function(){var e=h.trackedObjects._retrieveAndClearAutoCleanupList();for(var t in h._autoCleanup=!1,h.m_batchMode=g,e)e[t]._objectPath.isValid=!1;var n=0;if(Y._synchronousCleanup||o.isRequestUrlAndHeaderInfoResolver(i))return r();function r(){n++;var t=h.m_pendingRequest,i=h.m_batchMode,o=new W(h);h.m_pendingRequest=o,h.m_batchMode=0;try{for(var a in e)h.trackedObjects.remove(e[a])}finally{h.m_batchMode=i,h.m_pendingRequest=t}return h.syncPrivate(o).then((function(){f&&f(n)})).catch((function(){p&&p(n),n<c&&setTimeout((function(){r()}),u)}))}r()})).then((function(){h._onRunFinishedNotifiers&&h._onRunFinishedNotifiers.length>0&&h._onRunFinishedNotifiers.shift()();if(O)return m;throw m}))},o}(m);e.ClientRequestContext=k;var L=function(){function e(e,t){this.m_proxy=e,this.m_shouldPolyfill=t;var n=e[H.scalarPropertyNames],i=e[H.navigationPropertyNames],o=e[H.className],r=e[H.isCollection];if(n)for(var a=0;a<n.length;a++)Y.definePropertyThrowUnloadedException(this,o,n[a]);if(i)for(a=0;a<i.length;a++)Y.definePropertyThrowUnloadedException(this,o,i[a]);r&&Y.definePropertyThrowUnloadedException(this,o,H.itemsLowerCase)}return Object.defineProperty(e.prototype,"$proxy",{get:function(){return this.m_proxy},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"$isNullObject",{get:function(){if(!this.m_isLoaded)throw new i.RuntimeError({code:R.valueNotLoaded,httpStatusCode:400,message:l._getResourceString(Z.valueNotLoaded),debugInfo:{errorLocation:"retrieveResult.$isNullObject"}});return this.m_isNullObject},enumerable:!0,configurable:!0}),e.prototype.toJSON=function(){if(this.m_isLoaded)return this.m_isNullObject?null:(Y.isUndefined(this.m_json)&&(this.m_json=Y.purifyJson(this.m_value)),this.m_json)},e.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.prototype._handleResult=function(e){this.m_isLoaded=!0,null===e||"object"===typeof e&&e&&e._IsNull?(this.m_isNullObject=!0,e=null):this.m_isNullObject=!1,this.m_shouldPolyfill&&(e=Y.changePropertyNameToCamelLowerCase(e)),this.m_value=e,this.m_proxy._handleRetrieveResult(e,this)},e}(),H=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.getItemAt="GetItemAt",t.index="_Index",t.iterativeExecutor="IterativeExecutor",t.isTracked="_IsTracked",t.eventMessageCategory=65536,t.eventWorkbookId="Workbook",t.eventSourceRemote="Remote",t.proxy="$proxy",t.className="_className",t.isCollection="_isCollection",t.collectionPropertyPath="_collectionPropertyPath",t.objectPathInfoDoNotKeepReferenceFieldName="D",t.officeScriptEventId="X-OfficeScriptEventId",t.officeScriptFireRecordingEvent="X-OfficeScriptFireRecordingEvent",t}(_);e.Constants=H;var W=function(e){function t(t){var n=e.call(this,t)||this;return n.m_context=t,n.m_pendingProcessEventHandlers=[],n.m_pendingEventHandlerActions={},n.m_traceInfos={},n.m_responseTraceIds={},n.m_responseTraceMessages=[],n}return __extends(t,e),Object.defineProperty(t.prototype,"traceInfos",{get:function(){return this.m_traceInfos},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_responseTraceMessages",{get:function(){return this.m_responseTraceMessages},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_responseTraceIds",{get:function(){return this.m_responseTraceIds},enumerable:!0,configurable:!0}),t.prototype._setResponseTraceIds=function(e){if(e)for(var t=0;t<e.length;t++){var n=e[t];this.m_responseTraceIds[n]=n;var i=this.m_traceInfos[n];l.isNullOrUndefined(i)||this.m_responseTraceMessages.push(i)}},t.prototype.addTrace=function(e,t){this.m_traceInfos[e]=t},t.prototype._addPendingEventHandlerAction=function(e,t){this.m_pendingEventHandlerActions[e._id]||(this.m_pendingEventHandlerActions[e._id]=[],this.m_pendingProcessEventHandlers.push(e)),this.m_pendingEventHandlerActions[e._id].push(t)},Object.defineProperty(t.prototype,"_pendingProcessEventHandlers",{get:function(){return this.m_pendingProcessEventHandlers},enumerable:!0,configurable:!0}),t.prototype._getPendingEventHandlerActions=function(e){return this.m_pendingEventHandlerActions[e._id]},t}(y);e.ClientRequest=W;var B=function(){function e(e,t,n,i){var o=this;this.m_id=e._nextId(),this.m_context=e,this.m_name=n,this.m_handlers=[],this.m_registered=!1,this.m_eventInfo=i,this.m_callback=function(e){o.m_eventInfo.eventArgsTransformFunc(e).then((function(e){return o.fireEvent(e)}))}}return Object.defineProperty(e.prototype,"_registered",{get:function(){return this.m_registered},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_id",{get:function(){return this.m_id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_handlers",{get:function(){return this.m_handlers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_context",{get:function(){return this.m_context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_callback",{get:function(){return this.m_callback},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=N.createTraceAction(this.m_context,null,!1);return this.m_context._pendingRequest._addPendingEventHandlerAction(this,{id:t.actionInfo.Id,handler:e,operation:0}),new q(this.m_context,this,e)},e.prototype.remove=function(e){var t=N.createTraceAction(this.m_context,null,!1);this.m_context._pendingRequest._addPendingEventHandlerAction(this,{id:t.actionInfo.Id,handler:e,operation:1})},e.prototype.removeAll=function(){var e=N.createTraceAction(this.m_context,null,!1);this.m_context._pendingRequest._addPendingEventHandlerAction(this,{id:e.actionInfo.Id,handler:null,operation:2})},e.prototype._processRegistration=function(e){var t=this,n=l._createPromiseFromResult(null),i=e._getPendingEventHandlerActions(this);if(!i)return n;for(var o=[],r=0;r<this.m_handlers.length;r++)o.push(this.m_handlers[r]);var a=!1;for(r=0;r<i.length;r++)if(e._responseTraceIds[i[r].id])switch(a=!0,i[r].operation){case 0:o.push(i[r].handler);break;case 1:for(var s=o.length-1;s>=0;s--)if(o[s]===i[r].handler){o.splice(s,1);break}break;case 2:o=[]}return a&&(!this.m_registered&&o.length>0?n=n.then((function(){return t.m_eventInfo.registerFunc(t.m_callback)})).then((function(){return t.m_registered=!0})):this.m_registered&&0==o.length&&(n=n.then((function(){return t.m_eventInfo.unregisterFunc(t.m_callback)})).catch((function(e){l.log("Error when unregister event: "+JSON.stringify(e))})).then((function(){return t.m_registered=!1}))),n=n.then((function(){return t.m_handlers=o}))),n},e.prototype.fireEvent=function(e){for(var t=[],n=0;n<this.m_handlers.length;n++){var i=this.m_handlers[n],o=l._createPromiseFromResult(null).then(this.createFireOneEventHandlerFunc(i,e)).catch((function(e){l.log("Error when invoke handler: "+JSON.stringify(e))}));t.push(o)}l.Promise.all(t)},e.prototype.createFireOneEventHandlerFunc=function(e,t){return function(){return e(t)}},e}();e.EventHandlers=B;var q=function(){function e(e,t,n){this.m_context=e,this.m_allHandlers=t,this.m_handler=n}return Object.defineProperty(e.prototype,"context",{get:function(){return this.m_context},enumerable:!0,configurable:!0}),e.prototype.remove=function(){this.m_allHandlers&&this.m_handler&&(this.m_allHandlers.remove(this.m_handler),this.m_allHandlers=null,this.m_handler=null)},e}();e.EventHandlerResult=q,function(e){var t=function(){function t(){}return t.prototype.register=function(t,n,i){switch(t){case 4:return Y.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return Y.promisify((function(t){return e.addHandlerAsync(Office.EventType.BindingDataChanged,i,t)}))}));case 3:return Y.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return Y.promisify((function(t){return e.addHandlerAsync(Office.EventType.BindingSelectionChanged,i,t)}))}));case 2:return Y.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged,i,e)}));case 1:return Y.promisify((function(e){return Office.context.document.settings.addHandlerAsync(Office.EventType.SettingsChanged,i,e)}));case 5:return OSF.DDA.RichApi.richApiMessageManager.register(i);case 13:return Y.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ObjectDeleted,i,{id:n},e)}));case 14:return Y.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ObjectSelectionChanged,i,{id:n},e)}));case 15:return Y.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ObjectDataChanged,i,{id:n},e)}));case 16:return Y.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ContentControlAdded,i,{id:n},e)}));default:throw e.RuntimeError._createInvalidArgError({argumentName:"eventId"})}},t.prototype.unregister=function(t,n,i){switch(t){case 4:return Y.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return Y.promisify((function(t){return e.removeHandlerAsync(Office.EventType.BindingDataChanged,{handler:i},t)}))}));case 3:return Y.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return Y.promisify((function(t){return e.removeHandlerAsync(Office.EventType.BindingSelectionChanged,{handler:i},t)}))}));case 2:return Y.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.DocumentSelectionChanged,{handler:i},e)}));case 1:return Y.promisify((function(e){return Office.context.document.settings.removeHandlerAsync(Office.EventType.SettingsChanged,{handler:i},e)}));case 5:return Y.promisify((function(e){return OSF.DDA.RichApi.richApiMessageManager.removeHandlerAsync("richApiMessage",{handler:i},e)}));case 13:return Y.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectDeleted,{id:n,handler:i},e)}));case 14:return Y.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectSelectionChanged,{id:n,handler:i},e)}));case 15:return Y.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectDataChanged,{id:n,handler:i},e)}));case 16:return Y.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ContentControlAdded,{id:n,handler:i},e)}));default:throw e.RuntimeError._createInvalidArgError({argumentName:"eventId"})}},t}();e.officeJsEventRegistration=new t}(i=e._Internal||(e._Internal={}));var V=function(){function e(e,t){this.m_handlersByEventByTarget={},this.m_registerEventImpl=e,this.m_unregisterEventImpl=t}return e.getTargetIdOrDefault=function(e){return Y.isNullOrUndefined(e)?"":e},e.prototype.getHandlers=function(t,n){n=e.getTargetIdOrDefault(n);var i=this.m_handlersByEventByTarget[t];i||(i={},this.m_handlersByEventByTarget[t]=i);var o=i[n];return o||(o=[],i[n]=o),o},e.prototype.callHandlers=function(e,t,n){for(var i=this.getHandlers(e,t),o=0;o<i.length;o++)i[o](n)},e.prototype.hasHandlers=function(e,t){return this.getHandlers(e,t).length>0},e.prototype.register=function(e,t,n){if(!n)throw i.RuntimeError._createInvalidArgError({argumentName:"handler"});var o=this.getHandlers(e,t);return o.push(n),1===o.length?this.m_registerEventImpl(e,t):Y._createPromiseFromResult(null)},e.prototype.unregister=function(e,t,n){if(!n)throw i.RuntimeError._createInvalidArgError({argumentName:"handler"});for(var o=this.getHandlers(e,t),r=o.length-1;r>=0;r--)if(o[r]===n){o.splice(r,1);break}return 0===o.length?this.m_unregisterEventImpl(e,t):Y._createPromiseFromResult(null)},e}();e.EventRegistration=V;var G=function(){function e(){this.m_eventRegistration=new V(this._registerEventImpl.bind(this),this._unregisterEventImpl.bind(this)),this.m_richApiMessageHandler=this._handleRichApiMessage.bind(this)}return e.prototype.ready=function(){var t=this;return this.m_ready||(e._testReadyImpl?this.m_ready=e._testReadyImpl().then((function(){t.m_isReady=!0})):o.instance?this.m_ready=Y._createPromiseFromResult(null).then((function(){t.m_isReady=!0})):this.m_ready=i.officeJsEventRegistration.register(5,"",this.m_richApiMessageHandler).then((function(){t.m_isReady=!0}))),this.m_ready},Object.defineProperty(e.prototype,"isReady",{get:function(){return this.m_isReady},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t,n){var i=this;return this.ready().then((function(){return i.m_eventRegistration.register(e,t,n)}))},e.prototype.unregister=function(e,t,n){var i=this;return this.ready().then((function(){return i.m_eventRegistration.unregister(e,t,n)}))},e.prototype._registerEventImpl=function(e,t){return Y._createPromiseFromResult(null)},e.prototype._unregisterEventImpl=function(e,t){return Y._createPromiseFromResult(null)},e.prototype._handleRichApiMessage=function(e){if(e&&e.entries)for(var t=0;t<e.entries.length;t++){var n=e.entries[t];if(n.messageCategory==H.eventMessageCategory){l._logEnabled&&l.log(JSON.stringify(n));var i=n.messageType,o=n.targetId;if(this.m_eventRegistration.hasHandlers(i,o)){var r=JSON.parse(n.message);n.isRemoteOverride&&(r.source=H.eventSourceRemote),this.m_eventRegistration.callHandlers(i,o,r)}}}},e.getGenericEventRegistration=function(){return e.s_genericEventRegistration||(e.s_genericEventRegistration=new e),e.s_genericEventRegistration},e.richApiMessageEventCategory=65536,e}();e.GenericEventRegistration=G,e._testSetRichApiMessageReadyImpl=function(e){G._testReadyImpl=e},e._testTriggerRichApiMessageEvent=function(e){G.getGenericEventRegistration()._handleRichApiMessage(e)};var z=function(e){function t(t,n,i,o){var r=e.call(this,t,n,i,o)||this;return r.m_genericEventInfo=o,r}return __extends(t,e),t.prototype.add=function(e){var t=this;return 0==this._handlers.length&&this.m_genericEventInfo.registerFunc&&this.m_genericEventInfo.registerFunc(),G.getGenericEventRegistration().isReady||this._context._pendingRequest._addPreSyncPromise(G.getGenericEventRegistration().ready()),N.createTraceMarkerForCallback(this._context,(function(){t._handlers.push(e),1==t._handlers.length&&G.getGenericEventRegistration().register(t.m_genericEventInfo.eventType,t.m_genericEventInfo.getTargetIdFunc(),t._callback)})),new q(this._context,this,e)},t.prototype.remove=function(e){var t=this;1==this._handlers.length&&this.m_genericEventInfo.unregisterFunc&&this.m_genericEventInfo.unregisterFunc(),N.createTraceMarkerForCallback(this._context,(function(){for(var n=t._handlers,i=n.length-1;i>=0;i--)if(n[i]===e){n.splice(i,1);break}0==n.length&&G.getGenericEventRegistration().unregister(t.m_genericEventInfo.eventType,t.m_genericEventInfo.getTargetIdFunc(),t._callback)}))},t.prototype.removeAll=function(){},t}(B);e.GenericEventHandlers=z;var J=function(){function e(e){this.m_clientObject=e}return e.prototype._handleResult=function(e){this.m_clientObject._handleIdResult(e)},e}(),K=function(){function e(){}return e.createGlobalObjectObjectPath=function(e){var t={Id:e._nextId(),ObjectPathType:1,Name:""};return new h(t,null,!1,!1,1,4)},e.createNewObjectObjectPath=function(e,t,n,i){var o={Id:e._nextId(),ObjectPathType:2,Name:t};return new h(o,null,n,!1,1,Y._fixupApiFlags(i))},e.createPropertyObjectPath=function(e,t,n,i,o,r){var a={Id:e._nextId(),ObjectPathType:4,Name:n,ParentObjectPathId:t._objectPath.objectPathInfo.Id};return new h(a,t._objectPath,i,o,1,Y._fixupApiFlags(r))},e.createIndexerObjectPath=function(e,t,n){var i={Id:e._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return i.ArgumentInfo.Arguments=n,new h(i,t._objectPath,!1,!1,1,4)},e.createIndexerObjectPathUsingParentPath=function(e,t,n){var i={Id:e._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:t.objectPathInfo.Id,ArgumentInfo:{}};return i.ArgumentInfo.Arguments=n,new h(i,t,!1,!1,1,4)},e.createMethodObjectPath=function(e,t,n,i,o,r,a,s,c){var l={Id:e._nextId(),ObjectPathType:3,Name:n,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}},u=Y.setMethodArguments(e,l.ArgumentInfo,o),d=new h(l,t._objectPath,r,a,i,Y._fixupApiFlags(c));return d.argumentObjectPaths=u,d.getByIdMethodName=s,d},e.createReferenceIdObjectPath=function(e,t){var n={Id:e._nextId(),ObjectPathType:6,Name:t,ArgumentInfo:{}};return new h(n,null,!1,!1,1,4)},e.createChildItemObjectPathUsingIndexerOrGetItemAt=function(t,n,i,o,r){var a=Y.tryGetObjectIdFromLoadOrRetrieveResult(o);return t&&!Y.isNullOrUndefined(a)?e.createChildItemObjectPathUsingIndexer(n,i,o):e.createChildItemObjectPathUsingGetItemAt(n,i,o,r)},e.createChildItemObjectPathUsingIndexer=function(e,t,n){var i=Y.tryGetObjectIdFromLoadOrRetrieveResult(n),o=o={Id:e._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return o.ArgumentInfo.Arguments=[i],new h(o,t._objectPath,!1,!1,1,4)},e.createChildItemObjectPathUsingGetItemAt=function(e,t,n,i){var o=n[H.index];o&&(i=o);var r={Id:e._nextId(),ObjectPathType:3,Name:H.getItemAt,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return r.ArgumentInfo.Arguments=[i],new h(r,t._objectPath,!1,!1,1,4)},e}();e.ObjectPathFactory=K;var X=function(){function t(e){this.m_context=e}return t.prototype.executeAsync=function(n,i,o){var r=this,a=c.buildMessageArrayForIRequestExecutor(n,i,o,t.SourceLibHeaderValue);return new e.Promise((function(e,t){OSF.DDA.RichApi.executeRichApiRequestAsync(a,(function(t){var n;l.log("Response:"),l.log(JSON.stringify(t)),"succeeded"==t.status?n=c.buildResponseOnSuccess(c.getResponseBody(t),c.getResponseHeaders(t)):(n=c.buildResponseOnError(t.error.code,t.error.message),r.m_context._processOfficeJsErrorResponse(t.error.code,n)),e(n)}))}))},t.SourceLibHeaderValue="officejs",t}(),Q=function(){function e(e){this._autoCleanupList={},this.m_context=e}return e.prototype.add=function(e){var t=this;Array.isArray(e)?e.forEach((function(e){return t._addCommon(e,!0)})):this._addCommon(e,!0)},e.prototype._autoAdd=function(e){this._addCommon(e,!1),this._autoCleanupList[e._objectPath.objectPathInfo.Id]=e},e.prototype._autoTrackIfNecessaryWhenHandleObjectResultValue=function(e,t){this.m_context._autoCleanup&&!e[H.isTracked]&&e!==this.m_context._rootObject&&t&&!Y.isNullOrEmptyString(t[H.referenceId])&&(this._autoCleanupList[e._objectPath.objectPathInfo.Id]=e,e[H.isTracked]=!0)},e.prototype._addCommon=function(e,t){if(e[H.isTracked])t&&this.m_context._autoCleanup&&delete this._autoCleanupList[e._objectPath.objectPathInfo.Id];else{var n=e[H.referenceId];if(e._objectPath.objectPathInfo[H.objectPathInfoDoNotKeepReferenceFieldName])throw Y.createRuntimeError(r.generalException,l._getResourceString(Z.objectIsUntracked),null);Y.isNullOrEmptyString(n)&&e._KeepReference&&(e._KeepReference(),N.createInstantiateAction(this.m_context,e),t&&this.m_context._autoCleanup&&delete this._autoCleanupList[e._objectPath.objectPathInfo.Id],e[H.isTracked]=!0)}},e.prototype.remove=function(e){var t=this;Array.isArray(e)?e.forEach((function(e){return t._removeCommon(e)})):this._removeCommon(e)},e.prototype._removeCommon=function(e){e._objectPath.objectPathInfo[H.objectPathInfoDoNotKeepReferenceFieldName]=!0,e.context._pendingRequest._removeKeepReferenceAction(e._objectPath.objectPathInfo.Id);var t=e[H.referenceId];if(!Y.isNullOrEmptyString(t)){var n=this.m_context._rootObject;n._RemoveReference&&n._RemoveReference(t)}delete e[H.isTracked]},e.prototype._retrieveAndClearAutoCleanupList=function(){var e=this._autoCleanupList;return this._autoCleanupList={},e},e}();e.TrackedObjects=Q;var $=function(){function t(e,t,n,i,o){e||(e="root"),this.m_globalObjName=e,this.m_referencedObjectPaths=t,this.m_actions=n,this.m_statements=[],this.m_variableNameForObjectPathMap={},this.m_variableNameToObjectPathMap={},this.m_declaredObjectPathMap={},this.m_showDispose=i,this.m_removePII=o}return t.prototype.process=function(){this.m_showDispose&&W._calculateLastUsedObjectPathIds(this.m_actions);for(var e=0;e<this.m_actions.length;e++)this.processOneAction(this.m_actions[e]);return this.m_statements},t.prototype.processForDebugStatementInfo=function(e){this.m_showDispose&&W._calculateLastUsedObjectPathIds(this.m_actions);this.m_statements=[];for(var t=-1,n=0;n<this.m_actions.length&&(this.processOneAction(this.m_actions[n]),e==n&&(t=this.m_statements.length-1),!(t>=0&&this.m_statements.length>t+5+1));n++);if(t<0)return null;var i=t-5;i<0&&(i=0);var o=t+1+5;o>this.m_statements.length&&(o=this.m_statements.length);var r=[];0!=i&&r.push("...");for(var a=i;a<t;a++)r.push(this.m_statements[a]);r.push("// >>>>>"),r.push(this.m_statements[t]),r.push("// <<<<<");for(var s=t+1;s<o;s++)r.push(this.m_statements[s]);return o<this.m_statements.length&&r.push("..."),{statement:this.m_statements[t],surroundingStatements:r}},t.prototype.processOneAction=function(e){switch(e.actionInfo.ActionType){case 1:this.processInstantiateAction(e);break;case 3:this.processMethodAction(e);break;case 2:this.processQueryAction(e);break;case 7:this.processQueryAsJsonAction(e);break;case 6:this.processRecursiveQueryAction(e);break;case 4:this.processSetPropertyAction(e);break;case 5:this.processTraceAction(e);break;case 8:this.processEnsureUnchangedAction(e);break;case 9:this.processUpdateAction(e)}},t.prototype.processInstantiateAction=function(e){var t=e.actionInfo.ObjectPathId,n=this.m_referencedObjectPaths[t],i=this.getObjVarName(t);if(this.m_declaredObjectPathMap[t]){o="// Instantiate {"+i+"}";o=this.appendDisposeCommentIfRelevant(o,e),this.m_statements.push(o)}else{var o="var "+i+" = "+this.buildObjectPathExpressionWithParent(n)+";";o=this.appendDisposeCommentIfRelevant(o,e),this.m_statements.push(o),this.m_declaredObjectPathMap[t]=i}},t.prototype.processMethodAction=function(t){var n=t.actionInfo.Name;if("_KeepReference"===n){if(!e._internalConfig.showInternalApiInDebugInfo)return;n="track"}var i=this.getObjVarName(t.actionInfo.ObjectPathId)+"."+Y._toCamelLowerCase(n)+"("+this.buildArgumentsExpression(t.actionInfo.ArgumentInfo)+");";i=this.appendDisposeCommentIfRelevant(i,t),this.m_statements.push(i)},t.prototype.processQueryAction=function(e){var t=this.buildQueryExpression(e),n=this.getObjVarName(e.actionInfo.ObjectPathId)+".load("+t+");";n=this.appendDisposeCommentIfRelevant(n,e),this.m_statements.push(n)},t.prototype.processQueryAsJsonAction=function(e){var t=this.buildQueryExpression(e),n=this.getObjVarName(e.actionInfo.ObjectPathId)+".retrieve("+t+");";n=this.appendDisposeCommentIfRelevant(n,e),this.m_statements.push(n)},t.prototype.processRecursiveQueryAction=function(e){var t="";e.actionInfo.RecursiveQueryInfo&&(t=JSON.stringify(e.actionInfo.RecursiveQueryInfo));var n=this.getObjVarName(e.actionInfo.ObjectPathId)+".loadRecursive("+t+");";n=this.appendDisposeCommentIfRelevant(n,e),this.m_statements.push(n)},t.prototype.processSetPropertyAction=function(e){var t=this.getObjVarName(e.actionInfo.ObjectPathId)+"."+Y._toCamelLowerCase(e.actionInfo.Name)+" = "+this.buildArgumentsExpression(e.actionInfo.ArgumentInfo)+";";t=this.appendDisposeCommentIfRelevant(t,e),this.m_statements.push(t)},t.prototype.processTraceAction=function(e){var t="context.trace();";t=this.appendDisposeCommentIfRelevant(t,e),this.m_statements.push(t)},t.prototype.processEnsureUnchangedAction=function(e){var t=this.getObjVarName(e.actionInfo.ObjectPathId)+".ensureUnchanged("+JSON.stringify(e.actionInfo.ObjectState)+");";t=this.appendDisposeCommentIfRelevant(t,e),this.m_statements.push(t)},t.prototype.processUpdateAction=function(e){var t=this.getObjVarName(e.actionInfo.ObjectPathId)+".update("+JSON.stringify(e.actionInfo.ObjectState)+");";t=this.appendDisposeCommentIfRelevant(t,e),this.m_statements.push(t)},t.prototype.appendDisposeCommentIfRelevant=function(e,t){var n=this;if(this.m_showDispose){var i=t.actionInfo.L;if(i&&i.length>0)return e+" // And then dispose {"+i.map((function(e){return n.getObjVarName(e)})).join(", ")+"}"}return e},t.prototype.buildQueryExpression=function(e){if(e.actionInfo.QueryInfo){var t={};return t.select=e.actionInfo.QueryInfo.Select,t.expand=e.actionInfo.QueryInfo.Expand,t.skip=e.actionInfo.QueryInfo.Skip,t.top=e.actionInfo.QueryInfo.Top,"undefined"===typeof t.top&&"undefined"===typeof t.skip&&"undefined"===typeof t.expand?"undefined"===typeof t.select?"":JSON.stringify(t.select):JSON.stringify(t)}return""},t.prototype.buildObjectPathExpressionWithParent=function(e){return(5==e.objectPathInfo.ObjectPathType||3==e.objectPathInfo.ObjectPathType||4==e.objectPathInfo.ObjectPathType)&&e.objectPathInfo.ParentObjectPathId?this.getObjVarName(e.objectPathInfo.ParentObjectPathId)+"."+this.buildObjectPathExpression(e):this.buildObjectPathExpression(e)},t.prototype.buildObjectPathExpression=function(e){var t=this.buildObjectPathInfoExpression(e.objectPathInfo),n=e.originalObjectPathInfo;return n&&(t=t+" /* originally "+this.buildObjectPathInfoExpression(n)+" */"),t},t.prototype.buildObjectPathInfoExpression=function(e){switch(e.ObjectPathType){case 1:return"context."+this.m_globalObjName;case 5:return"getItem("+this.buildArgumentsExpression(e.ArgumentInfo)+")";case 3:return Y._toCamelLowerCase(e.Name)+"("+this.buildArgumentsExpression(e.ArgumentInfo)+")";case 2:return e.Name+".newObject()";case 7:return"null";case 4:return Y._toCamelLowerCase(e.Name);case 6:return"context."+this.m_globalObjName+"._getObjectByReferenceId("+JSON.stringify(e.Name)+")"}},t.prototype.buildArgumentsExpression=function(e){var t="";if(!e.Arguments||0===e.Arguments.length)return t;if(this.m_removePII)return"undefined"===typeof e.Arguments[0]?t:"...";for(var n=0;n<e.Arguments.length;n++)n>0&&(t+=", "),t+=this.buildArgumentLiteral(e.Arguments[n],e.ReferencedObjectPathIds?e.ReferencedObjectPathIds[n]:null);return"undefined"===t&&(t=""),t},t.prototype.buildArgumentLiteral=function(e,t){return"number"==typeof e&&e===t?this.getObjVarName(t):JSON.stringify(e)},t.prototype.getObjVarNameBase=function(e){var t="v",n=this.m_referencedObjectPaths[e];if(n)switch(n.objectPathInfo.ObjectPathType){case 1:t=this.m_globalObjName;break;case 4:t=Y._toCamelLowerCase(n.objectPathInfo.Name);break;case 3:var i=n.objectPathInfo.Name;i.length>3&&"Get"===i.substr(0,3)&&(i=i.substr(3)),t=Y._toCamelLowerCase(i);break;case 5:var o=this.getObjVarNameBase(n.objectPathInfo.ParentObjectPathId);t="s"===o.charAt(o.length-1)?o.substr(0,o.length-1):o+"Item"}return t},t.prototype.getObjVarName=function(e){if(this.m_variableNameForObjectPathMap[e])return this.m_variableNameForObjectPathMap[e];var t=this.getObjVarNameBase(e);if(!this.m_variableNameToObjectPathMap[t])return this.m_variableNameForObjectPathMap[e]=t,this.m_variableNameToObjectPathMap[t]=e,t;for(var n=1;this.m_variableNameToObjectPathMap[t+n.toString()];)n++;return t+=n.toString(),this.m_variableNameForObjectPathMap[e]=t,this.m_variableNameToObjectPathMap[t]=e,t},t}(),Z=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.cannotRegisterEvent="CannotRegisterEvent",t.connectionFailureWithStatus="ConnectionFailureWithStatus",t.connectionFailureWithDetails="ConnectionFailureWithDetails",t.propertyNotLoaded="PropertyNotLoaded",t.runMustReturnPromise="RunMustReturnPromise",t.moreInfoInnerError="MoreInfoInnerError",t.cannotApplyPropertyThroughSetMethod="CannotApplyPropertyThroughSetMethod",t.invalidOperationInCellEditMode="InvalidOperationInCellEditMode",t.objectIsUntracked="ObjectIsUntracked",t.customFunctionDefintionMissing="CustomFunctionDefintionMissing",t.customFunctionImplementationMissing="CustomFunctionImplementationMissing",t.customFunctionNameContainsBadChars="CustomFunctionNameContainsBadChars",t.customFunctionNameCannotSplit="CustomFunctionNameCannotSplit",t.customFunctionUnexpectedNumberOfEntriesInResultBatch="CustomFunctionUnexpectedNumberOfEntriesInResultBatch",t.customFunctionCancellationHandlerMissing="CustomFunctionCancellationHandlerMissing",t.customFunctionInvalidFunction="CustomFunctionInvalidFunction",t.customFunctionInvalidFunctionMapping="CustomFunctionInvalidFunctionMapping",t.customFunctionWindowMissing="CustomFunctionWindowMissing",t.customFunctionDefintionMissingOnWindow="CustomFunctionDefintionMissingOnWindow",t.pendingBatchInProgress="PendingBatchInProgress",t.notInsideBatch="NotInsideBatch",t.cannotUpdateReadOnlyProperty="CannotUpdateReadOnlyProperty",t}(A);e.ResourceStrings=Z,l.addResourceStringValues({CannotRegisterEvent:"The event handler cannot be registered.",PropertyNotLoaded:"The property '{0}' is not available. Before reading the property's value, call the load method on the containing object and call \"context.sync()\" on the associated request context.",RunMustReturnPromise:'The batch function passed to the ".run" method didn\'t return a promise. The function must return a promise, so that any automatically-tracked objects can be released at the completion of the batch operation. Typically, you return a promise by returning the response from "context.sync()".',InvalidOrTimedOutSessionMessage:"Your Office Online session has expired or is invalid. To continue, refresh the page.",InvalidOperationInCellEditMode:"Excel is in cell-editing mode. Please exit the edit mode by pressing ENTER or TAB or selecting another cell, and then try again.",InvalidSheetName:"The request cannot be processed because the specified worksheet cannot be found. Please try again.",CustomFunctionDefintionMissing:"A property with the name '{0}' that represents the function's definition must exist on Excel.Script.CustomFunctions.",CustomFunctionDefintionMissingOnWindow:"A property with the name '{0}' that represents the function's definition must exist on the window object.",CustomFunctionImplementationMissing:"The property with the name '{0}' on Excel.Script.CustomFunctions that represents the function's definition must contain a 'call' property that implements the function.",CustomFunctionNameContainsBadChars:"The function name may only contain letters, digits, underscores, and periods.",CustomFunctionNameCannotSplit:"The function name must contain a non-empty namespace and a non-empty short name.",CustomFunctionUnexpectedNumberOfEntriesInResultBatch:"The batching function returned a number of results that doesn't match the number of parameter value sets that were passed into it.",CustomFunctionCancellationHandlerMissing:"The cancellation handler onCanceled is missing in the function. The handler must be present as the function is defined as cancelable.",CustomFunctionInvalidFunction:"The property with the name '{0}' that represents the function's definition is not a valid function.",CustomFunctionInvalidFunctionMapping:"The property with the name '{0}' on CustomFunctionMappings that represents the function's definition is not a valid function.",CustomFunctionWindowMissing:"The window object was not found.",PendingBatchInProgress:"There is a pending batch in progress. The batch method may not be called inside another batch, or simultaneously with another batch.",NotInsideBatch:"Operations may not be invoked outside of a batch method.",CannotUpdateReadOnlyProperty:"The property '{0}' is read-only and it cannot be updated.",ObjectIsUntracked:"The object is untracked."});var Y=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.fixObjectPathIfNecessary=function(e,t){e&&e._objectPath&&t&&e._objectPath.updateUsingObjectData(t,e)},n.load=function(e,t){return e.context.load(e,t),e},n.loadAndSync=function(e,t){return e.context.load(e,t),e.context.sync().then((function(){return e}))},n.retrieve=function(t,i){var o=e._internalConfig.alwaysPolyfillClientObjectRetrieveMethod;o||(o=!n.isSetSupported("RichApiRuntime","1.1"));var r=new L(t,o);return t._retrieve(i,r),r},n.retrieveAndSync=function(e,t){var i=n.retrieve(e,t);return e.context.sync().then((function(){return i}))},n.toJson=function(e,t,i,o){var r={};for(var a in t){"undefined"!==typeof(s=t[a])&&(r[a]=s)}for(var a in i){var s;"undefined"!==typeof(s=i[a])&&(s[n.fieldName_isCollection]&&"undefined"!==typeof s[n.fieldName_m__items]?r[a]=s.toJSON().items:r[a]=s.toJSON())}return o&&(r.items=o.map((function(e){return e.toJSON()}))),r},n.throwError=function(e,t,n){throw new i.RuntimeError({code:e,httpStatusCode:400,message:l._getResourceString(e,t),debugInfo:n?{errorLocation:n}:void 0})},n.createRuntimeError=function(e,t,n,o,r){return new i.RuntimeError({code:e,httpStatusCode:o,message:t,debugInfo:{errorLocation:n},data:r})},n.throwIfNotLoaded=function(e,t,i,o){if(!o&&l.isUndefined(t)&&e.charCodeAt(0)!=n.s_underscoreCharCode&&!n.s_suppressPropertyNotLoadedException)throw n.createPropertyNotLoadedException(i,e)},n._getPropertyValueWithoutCheckLoaded=function(e,t){n.s_suppressPropertyNotLoadedException=!0;try{return e[t]}finally{n.s_suppressPropertyNotLoadedException=!1}},n.createPropertyNotLoadedException=function(e,t){return new i.RuntimeError({code:R.propertyNotLoaded,httpStatusCode:400,message:l._getResourceString(Z.propertyNotLoaded,t),debugInfo:e?{errorLocation:e+"."+t}:void 0})},n.createCannotUpdateReadOnlyPropertyException=function(e,t){return new i.RuntimeError({code:R.cannotUpdateReadOnlyProperty,httpStatusCode:400,message:l._getResourceString(Z.cannotUpdateReadOnlyProperty,t),debugInfo:e?{errorLocation:e+"."+t}:void 0})},n.promisify=function(t){return new e.Promise((function(e,n){t((function(t){"failed"==t.status?n(t.error):e(t.value)}))}))},n._addActionResultHandler=function(e,t,n){e.context._pendingRequest.addActionResultHandler(t,n)},n._handleNavigationPropertyResults=function(e,t,n){for(var i=0;i<n.length-1;i+=2)l.isUndefined(t[n[i+1]])||e[n[i]]._handleResult(t[n[i+1]])},n._fixupApiFlags=function(e){return"boolean"===typeof e&&(e=e?1:0),e},n.definePropertyThrowUnloadedException=function(e,t,i){Object.defineProperty(e,i,{configurable:!0,enumerable:!0,get:function(){throw n.createPropertyNotLoadedException(t,i)},set:function(){throw n.createCannotUpdateReadOnlyPropertyException(t,i)}})},n.defineReadOnlyPropertyWithValue=function(e,t,i){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return i},set:function(){throw n.createCannotUpdateReadOnlyPropertyException(null,t)}})},n.processRetrieveResult=function(e,t,i,o){if(!l.isNullOrUndefined(t))if(o){var r=t[H.itemsLowerCase];if(Array.isArray(r)){for(var a=[],s=0;s<r.length;s++){var c=o(r[s],s),u={};u[H.proxy]=c,c._handleRetrieveResult(r[s],u),a.push(u)}n.defineReadOnlyPropertyWithValue(i,H.itemsLowerCase,a)}}else{var d=e[H.scalarPropertyNames],f=e[H.navigationPropertyNames],p=e[H.className];if(d)for(s=0;s<d.length;s++){var h=t[m=d[s]];l.isUndefined(h)?n.definePropertyThrowUnloadedException(i,p,m):n.defineReadOnlyPropertyWithValue(i,m,h)}if(f)for(s=0;s<f.length;s++){var m;h=t[m=f[s]];if(l.isUndefined(h))n.definePropertyThrowUnloadedException(i,p,m);else{var g=e[m],y={};g._handleRetrieveResult(h,y),y[H.proxy]=g,Array.isArray(y[H.itemsLowerCase])&&(y=y[H.itemsLowerCase]),n.defineReadOnlyPropertyWithValue(i,m,y)}}}},n.setMockData=function(e,t,i,o){if(l.isNullOrUndefined(t))e._handleResult(t);else{if(e[H.scalarPropertyOriginalNames]){for(var r={},a=e[H.scalarPropertyOriginalNames],s=e[H.scalarPropertyNames],c=0;c<s.length;c++)"undefined"!==typeof t[s[c]]&&(r[a[c]]=t[s[c]]);e._handleResult(r)}if(e[H.navigationPropertyNames]){var u=e[H.navigationPropertyNames];for(c=0;c<u.length;c++)if("undefined"!==typeof t[u[c]]){var d=e[u[c]];d.setMockData&&d.setMockData(t[u[c]])}}if(e[H.isCollection]&&i){var f=Array.isArray(t)?t:t[H.itemsLowerCase];if(Array.isArray(f)){var p=[];for(c=0;c<f.length;c++){var h=i(f,c);n.setMockData(h,f[c]),p.push(h)}o(p)}}}},n.applyMixin=function(e,t){Object.getOwnPropertyNames(t.prototype).forEach((function(n){"constructor"!==n&&Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n))}))},n.ensureTypeInitialized=function(e){var t=new k;new e(t,K.createNewObjectObjectPath(t,"Temp",!1,0))},n.fieldName_m__items="m__items",n.fieldName_isCollection="_isCollection",n._synchronousCleanup=!1,n.s_underscoreCharCode="_".charCodeAt(0),n.s_suppressPropertyNotLoadedException=!1,n}(S);e.Utility=Y;var ee=function(){function e(){}return e.invokeMethod=function(e,t,n,i,o,r){var a=N.createMethodAction(e.context,e,t,n,i,o),s=new O(r);return Y._addActionResultHandler(e,a,s),s},e.invokeEnsureUnchanged=function(e,t){N.createEnsureUnchangedAction(e.context,e,t)},e.invokeSetProperty=function(e,t,n,i){N.createSetPropertyAction(e.context,e,t,n,i)},e.createRootServiceObject=function(e,t){return new e(t,K.createGlobalObjectObjectPath(t))},e.createObjectFromReferenceId=function(e,t,n){return new e(t,K.createReferenceIdObjectPath(t,n))},e.createTopLevelServiceObject=function(e,t,n,i,o){return new e(t,K.createNewObjectObjectPath(t,n,i,o))},e.createPropertyObject=function(e,t,n,i,o){var r=K.createPropertyObjectPath(t.context,t,n,i,!1,o);return new e(t.context,r)},e.createIndexerObject=function(e,t,n){var i=K.createIndexerObjectPath(t.context,t,n);return new e(t.context,i)},e.createMethodObject=function(e,t,n,i,o,r,a,s,c){var l=K.createMethodObjectPath(t.context,t,n,i,o,r,a,s,c);return new e(t.context,l)},e.createChildItemObject=function(e,t,n,i,o){var r=K.createChildItemObjectPathUsingIndexerOrGetItemAt(t,n.context,n,i,o);return new e(n.context,r)},e}();e.BatchApiHelper=ee;var te=function(){function t(e){if(this.m_namespaceMap={},this.m_namespace=e.metadata.name,this.m_targetNamespaceObject=e.targetNamespaceObject,this.m_namespaceMap[this.m_namespace]=e.targetNamespaceObject,e.namespaceMap)for(var t in e.namespaceMap)this.m_namespaceMap[t]=e.namespaceMap[t];this.m_defaultApiSetName=e.metadata.defaultApiSetName,this.m_hostName=e.metadata.hostName;var n=e.metadata;if(n.enumTypes)for(var i=0;i<n.enumTypes.length;i++)this.buildEnumType(n.enumTypes[i]);if(n.apiSets){for(i=0;i<n.apiSets.length;i++){var o=n.apiSets[i];Array.isArray(o)&&(n.apiSets[i]={version:o[0],name:o[1]||this.m_defaultApiSetName})}this.m_apiSets=n.apiSets}if(this.m_strings=n.strings,n.clientObjectTypes)for(i=0;i<n.clientObjectTypes.length;i++){o=n.clientObjectTypes[i];Array.isArray(o)&&(this.ensureArraySize(o,11),n.clientObjectTypes[i]={name:this.getString(o[0]),behaviorFlags:o[1],collectionPropertyPath:this.getString(o[6]),newObjectServerTypeFullName:this.getString(o[9]),newObjectApiFlags:o[10],childItemTypeFullName:this.getString(o[7]),scalarProperties:o[2],navigationProperties:o[3],scalarMethods:o[4],navigationMethods:o[5],events:o[8]}),this.buildClientObjectType(n.clientObjectTypes[i],e.fullyInitialize)}}return t.prototype.ensureArraySize=function(e,t){for(var n=t-e.length;n>0;)e.push(0),n--},t.prototype.getString=function(e){return"number"===typeof e?e>0?this.m_strings[e-1]:null:e},t.prototype.buildEnumType=function(e){var t;if(Array.isArray(e)){(t={name:e[0],fields:e[2]}).fields||(t.fields={});var n=e[1];if(Array.isArray(n))for(var i=0;i<n.length;i++)t.fields[n[i]]=this.toSimpleCamelUpperCase(n[i])}else t=e;this.m_targetNamespaceObject[t.name]=t.fields},t.prototype.buildClientObjectType=function(n,i){var o=this,r=function(t,i){T.apply(this,arguments),o.m_targetNamespaceObject[n.name]._typeInited||(o.buildPrototype(o.m_targetNamespaceObject[n.name],n),o.m_targetNamespaceObject[n.name]._typeInited=!0),e._internalConfig.appendTypeNameToObjectPathInfo&&this._objectPath&&this._objectPath.objectPathInfo&&this._className&&(this._objectPath.objectPathInfo.T=this._className)};(this.m_targetNamespaceObject[n.name]=r,this.extendsType(r,T),this.buildNewObject(r,n),0!==(2&n.behaviorFlags)&&(r.prototype._KeepReference=function(){ee.invokeMethod(this,"_KeepReference",1,[],0,0)}),0!==(32&n.behaviorFlags))&&this.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_StaticCustomize").call(null,r);i&&(this.buildPrototype(r,n),r._typeInited=!0)},t.prototype.extendsType=function(e,t){function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},t.prototype.findObjectUnderPath=function(t,n,i){for(var o=t,r=i;r<n.length;r++){if("object"!==typeof o)throw new e.Error("Cannot find "+n.join("."));o=o[n[r]]}return o},t.prototype.getFunction=function(t){var n=this.resolveObjectByFullName(t);if("function"!==typeof n)throw new e.Error("Cannot find function or type: "+t);return n},t.prototype.resolveObjectByFullName=function(e){var t=e.split(".");if(1===t.length)return this.m_targetNamespaceObject[t[0]];var n=t[0];return n===this.m_namespace?this.findObjectUnderPath(this.m_targetNamespaceObject,t,1):this.m_namespaceMap[n]?this.findObjectUnderPath(this.m_namespaceMap[n],t,1):this.findObjectUnderPath(this.m_targetNamespaceObject,t,0)},t.prototype.evaluateSimpleExpression=function(t,n){if(Y.isNullOrUndefined(t))return null;var i=t.split(".");if(3===i.length&&"OfficeExtension"===i[0]&&"Constants"===i[1])return H[i[2]];if("this"===i[0]){for(var o=n,r=1;r<i.length;r++)o="toString()"==i[r]?o.toString():"()"===i[r].substr(i[r].length-2)?o[i[r].substr(0,i[r].length-2)]():o[i[r]];return o}throw new e.Error("Cannot evaluate: "+t)},t.prototype.evaluateEventTargetId=function(e,t){return Y.isNullOrEmptyString(e)?"":this.evaluateSimpleExpression(e,t)},t.prototype.isAllDigits=function(e){for(var t="0".charCodeAt(0),n="9".charCodeAt(0),i=0;i<e.length;i++)if(e.charCodeAt(i)<t||e.charCodeAt(i)>n)return!1;return!0},t.prototype.evaluateEventType=function(t){if(Y.isNullOrEmptyString(t))return 0;if(this.isAllDigits(t))return parseInt(t);var n=this.resolveObjectByFullName(t);if("number"!==typeof n)throw new e.Error("Invalid event type: "+t);return n},t.prototype.buildPrototype=function(e,t){this.buildScalarProperties(e,t),this.buildNavigationProperties(e,t),this.buildScalarMethods(e,t),this.buildNavigationMethods(e,t),this.buildEvents(e,t),this.buildHandleResult(e,t),this.buildHandleIdResult(e,t),this.buildHandleRetrieveResult(e,t),this.buildLoad(e,t),this.buildRetrieve(e,t),this.buildSetMockData(e,t),this.buildEnsureUnchanged(e,t),this.buildUpdate(e,t),this.buildSet(e,t),this.buildToJSON(e,t),this.buildItems(e,t),this.buildTypeMetadataInfo(e,t),this.buildTrackUntrack(e,t),this.buildMixin(e,t)},t.prototype.toSimpleCamelUpperCase=function(e){return e.substr(0,1).toUpperCase()+e.substr(1)},t.prototype.ensureOriginalName=function(e){null===e.originalName&&(e.originalName=this.toSimpleCamelUpperCase(e.name))},t.prototype.getFieldName=function(e){return"m_"+e.name},t.prototype.throwIfApiNotSupported=function(e,t){if(this.m_apiSets&&t.apiSetInfoOrdinal>0){var n=this.m_apiSets[t.apiSetInfoOrdinal-1];n&&Y.throwIfApiNotSupported(e.name+"."+t.name,n.name,n.version,this.m_hostName)}},t.prototype.buildScalarProperties=function(e,t){if(Array.isArray(t.scalarProperties))for(var n=0;n<t.scalarProperties.length;n++){var i=t.scalarProperties[n];Array.isArray(i)&&(this.ensureArraySize(i,6),t.scalarProperties[n]={name:this.getString(i[0]),behaviorFlags:i[1],apiSetInfoOrdinal:i[2],originalName:this.getString(i[3]),setMethodApiFlags:i[4],undoableApiSetInfoOrdinal:i[5]}),this.buildScalarProperty(e,t,t.scalarProperties[n])}},t.prototype.calculateApiFlags=function(e,t){if(t>0){var n=this.m_apiSets[t-1];n&&(e=S.calculateApiFlags(e,n.name,n.version))}return e},t.prototype.buildScalarProperty=function(e,n,i){this.ensureOriginalName(i);var o=this,r=this.getFieldName(i),a={get:function(){return Y.throwIfNotLoaded(i.name,this[r],n.name,this._isNull),o.throwIfApiNotSupported(n,i),this[r]},enumerable:!0,configurable:!0};0===(2&i.behaviorFlags)&&(a.set=function(e){if(4&i.behaviorFlags&&o.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+i.originalName+"_Set").call(this,this,e).handled)return;this[r]=e;var a=o.calculateApiFlags(i.setMethodApiFlags,i.undoableApiSetInfoOrdinal);ee.invokeSetProperty(this,i.originalName,e,a)}),Object.defineProperty(e.prototype,i.name,a)},t.prototype.buildNavigationProperties=function(e,t){if(Array.isArray(t.navigationProperties))for(var n=0;n<t.navigationProperties.length;n++){var i=t.navigationProperties[n];Array.isArray(i)&&(this.ensureArraySize(i,8),t.navigationProperties[n]={name:this.getString(i[0]),behaviorFlags:i[2],apiSetInfoOrdinal:i[3],originalName:this.getString(i[4]),getMethodApiFlags:i[5],setMethodApiFlags:i[6],propertyTypeFullName:this.getString(i[1]),undoableApiSetInfoOrdinal:i[7]}),this.buildNavigationProperty(e,t,t.navigationProperties[n])}},t.prototype.buildNavigationProperty=function(e,n,i){this.ensureOriginalName(i);var o=this,r=this.getFieldName(i),a={get:function(){(this[o.getFieldName(i)]||(o.throwIfApiNotSupported(n,i),this[r]=ee.createPropertyObject(o.getFunction(i.propertyTypeFullName),this,i.originalName,0!==(16&i.behaviorFlags),i.getMethodApiFlags)),64&i.behaviorFlags)&&o.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+i.originalName+"_Get").call(this,this,this[r]);return this[r]},enumerable:!0,configurable:!0};0===(2&i.behaviorFlags)&&(a.set=function(e){if(4&i.behaviorFlags&&o.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+i.originalName+"_Set").call(this,this,e).handled)return;this[r]=e;var a=o.calculateApiFlags(i.setMethodApiFlags,i.undoableApiSetInfoOrdinal);ee.invokeSetProperty(this,i.originalName,e,a)}),Object.defineProperty(e.prototype,i.name,a)},t.prototype.buildScalarMethods=function(e,t){if(Array.isArray(t.scalarMethods))for(var n=0;n<t.scalarMethods.length;n++){var i=t.scalarMethods[n];Array.isArray(i)&&(this.ensureArraySize(i,7),t.scalarMethods[n]={name:this.getString(i[0]),behaviorFlags:i[2],apiSetInfoOrdinal:i[3],originalName:this.getString(i[5]),apiFlags:i[4],parameterCount:i[1],undoableApiSetInfoOrdinal:i[6]}),this.buildScalarMethod(e,t,t.scalarMethods[n])}},t.prototype.buildScalarMethod=function(e,n,i){this.ensureOriginalName(i);var o=this;e.prototype[i.name]=function(){var e=[];if(64&i.behaviorFlags&&i.parameterCount>0){for(var r=0;r<i.parameterCount-1;r++)e.push(arguments[r]);var a=[];for(r=i.parameterCount-1;r<arguments.length;r++)a.push(arguments[r]);e.push(a)}else for(r=0;r<arguments.length;r++)e.push(arguments[r]);if(1&i.behaviorFlags){var s=o.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+i.originalName),c=[this];for(r=0;r<e.length;r++)c.push(e[r]);var l=s.apply(this,c),u=l.handled,d=l.result;if(u)return d}o.throwIfApiNotSupported(n,i);var f=0;32&i.behaviorFlags&&(f=1);var p=0;2&i.behaviorFlags&&(p=1);var h=o.calculateApiFlags(i.apiFlags,i.undoableApiSetInfoOrdinal);return ee.invokeMethod(this,i.originalName,p,e,h,f)}},t.prototype.buildNavigationMethods=function(e,t){if(Array.isArray(t.navigationMethods))for(var n=0;n<t.navigationMethods.length;n++){var i=t.navigationMethods[n];Array.isArray(i)&&(this.ensureArraySize(i,9),t.navigationMethods[n]={name:this.getString(i[0]),behaviorFlags:i[3],apiSetInfoOrdinal:i[4],originalName:this.getString(i[6]),apiFlags:i[5],parameterCount:i[2],returnTypeFullName:this.getString(i[1]),returnObjectGetByIdMethodName:this.getString(i[7]),undoableApiSetInfoOrdinal:i[8]}),this.buildNavigationMethod(e,t,t.navigationMethods[n])}},t.prototype.buildNavigationMethod=function(e,n,i){this.ensureOriginalName(i);var o=this;e.prototype[i.name]=function(){var e=[];if(64&i.behaviorFlags&&i.parameterCount>0){for(var r=0;r<i.parameterCount-1;r++)e.push(arguments[r]);var a=[];for(r=i.parameterCount-1;r<arguments.length;r++)a.push(arguments[r]);e.push(a)}else for(r=0;r<arguments.length;r++)e.push(arguments[r]);if(1&i.behaviorFlags){var s=o.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+i.originalName),c=[this];for(r=0;r<e.length;r++)c.push(e[r]);var l=s.apply(this,c),u=l.handled,d=l.result;if(u)return d}if(o.throwIfApiNotSupported(n,i),0!==(16&i.behaviorFlags))return ee.createIndexerObject(o.getFunction(i.returnTypeFullName),this,e);var f=0;2&i.behaviorFlags&&(f=1);var p=o.calculateApiFlags(i.apiFlags,i.undoableApiSetInfoOrdinal);return ee.createMethodObject(o.getFunction(i.returnTypeFullName),this,i.originalName,f,e,0!==(4&i.behaviorFlags),0!==(8&i.behaviorFlags),i.returnObjectGetByIdMethodName,p)}},t.prototype.buildHandleResult=function(e,n){var i=this;e.prototype._handleResult=function(e){if(T.prototype._handleResult.call(this,e),!Y.isNullOrUndefined(e)){if(Y.fixObjectPathIfNecessary(this,e),8&n.behaviorFlags)i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_HandleResult").call(this,this,e);if(n.scalarProperties)for(var o=0;o<n.scalarProperties.length;o++)Y.isUndefined(e[n.scalarProperties[o].originalName])||(0!==(8&n.scalarProperties[o].behaviorFlags)?this[i.getFieldName(n.scalarProperties[o])]=Y.adjustToDateTime(e[n.scalarProperties[o].originalName]):this[i.getFieldName(n.scalarProperties[o])]=e[n.scalarProperties[o].originalName]);if(n.navigationProperties){for(var r=[],a=0;a<n.navigationProperties.length;a++)r.push(n.navigationProperties[a].name),r.push(n.navigationProperties[a].originalName);Y._handleNavigationPropertyResults(this,e,r)}if(0!==(1&n.behaviorFlags)){var s=i.hasIndexMethod(n);if(!Y.isNullOrUndefined(e[H.items])){this.m__items=[];for(var c=e[H.items],l=i.getFunction(n.childItemTypeFullName),u=0;u<c.length;u++){var d=ee.createChildItemObject(l,s,this,c[u],u);d._handleResult(c[u]),this.m__items.push(d)}}}}}},t.prototype.buildHandleRetrieveResult=function(e,t){var n=this;e.prototype._handleRetrieveResult=function(e,i){if(T.prototype._handleRetrieveResult.call(this,e,i),!Y.isNullOrUndefined(e)){if(t.scalarProperties)for(var o=0;o<t.scalarProperties.length;o++)8&t.scalarProperties[o].behaviorFlags&&(Y.isNullOrUndefined(e[t.scalarProperties[o].name])||(e[t.scalarProperties[o].name]=Y.adjustToDateTime(e[t.scalarProperties[o].name])));if(1&t.behaviorFlags){var r=n.hasIndexMethod(t),a=n.getFunction(t.childItemTypeFullName),s=this;Y.processRetrieveResult(s,e,i,(function(e,t){return ee.createChildItemObject(a,r,s,e,t)}))}else Y.processRetrieveResult(this,e,i)}}},t.prototype.buildHandleIdResult=function(e,n){var i=this;e.prototype._handleIdResult=function(e){if(T.prototype._handleIdResult.call(this,e),!Y.isNullOrUndefined(e)){if(16&n.behaviorFlags)i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_HandleIdResult").call(this,this,e);if(n.scalarProperties)for(var o=0;o<n.scalarProperties.length;o++){var r=n.scalarProperties[o].originalName;"Id"!==r&&"_Id"!==r&&"_ReferenceId"!==r||Y.isNullOrUndefined(e[n.scalarProperties[o].originalName])||(this[i.getFieldName(n.scalarProperties[o])]=e[n.scalarProperties[o].originalName])}}}},t.prototype.buildLoad=function(e,t){e.prototype.load=function(e){return Y.load(this,e)}},t.prototype.buildRetrieve=function(e,t){e.prototype.retrieve=function(e){return Y.retrieve(this,e)}},t.prototype.buildNewObject=function(e,t){Y.isNullOrEmptyString(t.newObjectServerTypeFullName)||(e.newObject=function(n){return ee.createTopLevelServiceObject(e,n,t.newObjectServerTypeFullName,0!==(1&t.behaviorFlags),t.newObjectApiFlags)})},t.prototype.buildSetMockData=function(e,t){var n=this;if(1&t.behaviorFlags){var i=n.hasIndexMethod(t);e.prototype.setMockData=function(e){var o=this;Y.setMockData(o,e,(function(e,r){return ee.createChildItemObject(n.getFunction(t.childItemTypeFullName),i,o,e,r)}),(function(e){o.m__items=e}))}}else e.prototype.setMockData=function(e){Y.setMockData(this,e)}},t.prototype.buildEnsureUnchanged=function(e,t){e.prototype.ensureUnchanged=function(e){ee.invokeEnsureUnchanged(this,e)}},t.prototype.buildUpdate=function(e,t){e.prototype.update=function(e){this._recursivelyUpdate(e)}},t.prototype.buildSet=function(e,t){if(0===(1&t.behaviorFlags)){var n=[],i=[];if(t.scalarProperties)for(var o=0;o<t.scalarProperties.length;o++)0===(2&t.scalarProperties[o].behaviorFlags)&&0!==(1&t.scalarProperties[o].behaviorFlags)?i.push(t.scalarProperties[o].name):n.push(t.scalarProperties[o].name);var r=[];if(t.navigationProperties)for(o=0;o<t.navigationProperties.length;o++)0!==(16&t.navigationProperties[o].behaviorFlags)||0===(1&t.navigationProperties[o].behaviorFlags)||0===(32&t.navigationProperties[o].behaviorFlags)?n.push(t.navigationProperties[o].name):r.push(t.navigationProperties[o].name);0===r.length&&0===i.length||(e.prototype.set=function(e,t){this._recursivelySet(e,t,i,r,n)})}},t.prototype.buildItems=function(e,t){0!==(1&t.behaviorFlags)&&Object.defineProperty(e.prototype,"items",{get:function(){return Y.throwIfNotLoaded("items",this.m__items,t.name,this._isNull),this.m__items},enumerable:!0,configurable:!0})},t.prototype.buildToJSON=function(e,t){var n=this;0===(1&t.behaviorFlags)?e.prototype.toJSON=function(){var e={};if(t.scalarProperties)for(var i=0;i<t.scalarProperties.length;i++)0!==(1&t.scalarProperties[i].behaviorFlags)&&(e[t.scalarProperties[i].name]=this[n.getFieldName(t.scalarProperties[i])]);var o={};if(t.navigationProperties)for(i=0;i<t.navigationProperties.length;i++)0!==(1&t.navigationProperties[i].behaviorFlags)&&(o[t.navigationProperties[i].name]=this[n.getFieldName(t.navigationProperties[i])]);return Y.toJson(this,e,o)}:e.prototype.toJSON=function(){return Y.toJson(this,{},{},this.m__items)}},t.prototype.buildTypeMetadataInfo=function(e,t){Object.defineProperty(e.prototype,"_className",{get:function(){return t.name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_isCollection",{get:function(){return 0!==(1&t.behaviorFlags)},enumerable:!0,configurable:!0}),Y.isNullOrEmptyString(t.collectionPropertyPath)||Object.defineProperty(e.prototype,"_collectionPropertyPath",{get:function(){return t.collectionPropertyPath},enumerable:!0,configurable:!0}),t.scalarProperties&&t.scalarProperties.length>0&&(Object.defineProperty(e.prototype,"_scalarPropertyNames",{get:function(){return this.m__scalarPropertyNames||(this.m__scalarPropertyNames=t.scalarProperties.map((function(e){return e.name}))),this.m__scalarPropertyNames},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_scalarPropertyOriginalNames",{get:function(){return this.m__scalarPropertyOriginalNames||(this.m__scalarPropertyOriginalNames=t.scalarProperties.map((function(e){return e.originalName}))),this.m__scalarPropertyOriginalNames},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_scalarPropertyUpdateable",{get:function(){return this.m__scalarPropertyUpdateable||(this.m__scalarPropertyUpdateable=t.scalarProperties.map((function(e){return 0===(2&e.behaviorFlags)}))),this.m__scalarPropertyUpdateable},enumerable:!0,configurable:!0})),t.navigationProperties&&t.navigationProperties.length>0&&Object.defineProperty(e.prototype,"_navigationPropertyNames",{get:function(){return this.m__navigationPropertyNames||(this.m__navigationPropertyNames=t.navigationProperties.map((function(e){return e.name}))),this.m__navigationPropertyNames},enumerable:!0,configurable:!0})},t.prototype.buildTrackUntrack=function(e,t){2&t.behaviorFlags&&(e.prototype.track=function(){return this.context.trackedObjects.add(this),this},e.prototype.untrack=function(){return this.context.trackedObjects.remove(this),this})},t.prototype.buildMixin=function(e,t){if(4&t.behaviorFlags){var n=this.getFunction(t.name+"Custom");Y.applyMixin(e,n)}},t.prototype.getOnEventName=function(e){return"_"===e[0]?"_on"+e.substr(1):"on"+e},t.prototype.buildEvents=function(e,t){if(t.events)for(var n=0;n<t.events.length;n++){var i=t.events[n];Array.isArray(i)&&(this.ensureArraySize(i,7),t.events[n]={name:this.getString(i[0]),behaviorFlags:i[1],apiSetInfoOrdinal:i[2],typeExpression:this.getString(i[3]),targetIdExpression:this.getString(i[4]),register:this.getString(i[5]),unregister:this.getString(i[6])}),this.buildEvent(e,t,t.events[n])}},t.prototype.buildEvent=function(e,t,n){1&n.behaviorFlags?this.buildV0Event(e,t,n):this.buildV2Event(e,t,n)},t.prototype.buildV2Event=function(e,n,i){var o=this,r=this.getOnEventName(i.name),a=this.getFieldName(i);Object.defineProperty(e.prototype,r,{get:function(){if(!this[a]){o.throwIfApiNotSupported(n,i);var e=this,r=null;"null"!==i.register&&(r=this[i.register].bind(this));var s=null;"null"!==i.unregister&&(s=this[i.unregister].bind(this));var c=null;2&i.behaviorFlags&&(c=o.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+i.name+"_EventArgsTransform"));var l=o.evaluateEventType(i.typeExpression);this[a]=new z(this.context,this,i.name,{eventType:l,getTargetIdFunc:function(){return o.evaluateEventTargetId(i.targetIdExpression,e)},registerFunc:r,unregisterFunc:s,eventArgsTransformFunc:function(t){return c&&(t=c.call(e,e,t)),Y._createPromiseFromResult(t)}})}return this[a]},enumerable:!0,configurable:!0})},t.prototype.buildV0Event=function(e,n,i){var o=this,r=this.getOnEventName(i.name),a=this.getFieldName(i);Object.defineProperty(e.prototype,r,{get:function(){if(!this[a]){o.throwIfApiNotSupported(n,i);var e=this,r=null;if(Y.isNullOrEmptyString(i.register)){var s=o.evaluateEventType(i.typeExpression);r=function(t){var n=o.evaluateEventTargetId(i.targetIdExpression,e);return e.context.eventRegistration.register(s,n,t)}}else if("null"!==i.register){var c=o.getFunction(i.register);r=function(t){return c.call(e,e,t)}}var l=null;if(Y.isNullOrEmptyString(i.unregister)){var u=o.evaluateEventType(i.typeExpression);l=function(t){var n=o.evaluateEventTargetId(i.targetIdExpression,e);return e.context.eventRegistration.unregister(u,n,t)}}else if("null"!==i.unregister){var d=o.getFunction(i.unregister);l=function(t){return d.call(e,e,t)}}var f=null;2&i.behaviorFlags&&(f=o.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+i.name+"_EventArgsTransform"));this[a]=new B(this.context,this,i.name,{registerFunc:r,unregisterFunc:l,eventArgsTransformFunc:function(t){return f&&(t=f.call(e,e,t)),Y._createPromiseFromResult(t)}})}return this[a]},enumerable:!0,configurable:!0})},t.prototype.hasIndexMethod=function(e){var t=!1;if(e.navigationMethods)for(var n=0;n<e.navigationMethods.length;n++)if(0!==(16&e.navigationMethods[n].behaviorFlags)){t=!0;break}return t},t.CustomizationCodeNamespace="_CC",t}();e.LibraryBuilder=te;var ne,ie=1,oe=function(e){return e.DdaMethod.Version=ie,e},re=function(e){return ie=e.Version,e.Error&&(e.error={},e.error.Code=e.Error),e};!function(e){e.SendingId="sId",e.RespondingId="rId",e.CommandKey="command",e.SessionInfoKey="sessionInfo",e.ParamsKey="params",e.ApiReadyCommand="apiready",e.ExecuteMethodCommand="executeMethod",e.GetAppContextCommand="getAppContext",e.RegisterEventCommand="registerEvent",e.UnregisterEventCommand="unregisterEvent",e.FireEventCommand="fireEvent"}(ne||(ne={}));var ae=function(){function e(){}return e.sessionContext="sc",e.embeddingPageOrigin="EmbeddingPageOrigin",e.embeddingPageSessionInfo="EmbeddingPageSessionInfo",e}();e.EmbeddedConstants=ae;var se=function(e){function t(t,n){var i=e.call(this)||this;return i.m_chosenWindow=null,i.m_chosenOrigin=null,i.m_enabled=!0,i.m_onMessageHandler=i._onMessage.bind(i),i.m_callbackList={},i.m_id=0,i.m_timeoutId=-1,i.m_appContext=null,i.m_url=t,i.m_options=n,i.m_options||(i.m_options={sessionKey:Math.random().toString()}),i.m_options.sessionKey||(i.m_options.sessionKey=Math.random().toString()),i.m_options.container||(i.m_options.container=document.body),i.m_options.timeoutInMilliseconds||(i.m_options.timeoutInMilliseconds=6e4),i.m_options.height||(i.m_options.height="400px"),i.m_options.width||(i.m_options.width="100%"),i.m_options.webApplication&&i.m_options.webApplication.accessToken&&i.m_options.webApplication.accessTokenTtl||(i.m_options.webApplication=null),i}return __extends(t,e),t.prototype._getIFrameSrc=function(){var e=window.location.protocol+"//"+window.location.host,t=ae.embeddingPageOrigin+"="+encodeURIComponent(e)+"&"+ae.embeddingPageSessionInfo+"="+encodeURIComponent(this.m_options.sessionKey),n=!1;(this.m_url.toLowerCase().indexOf("/_layouts/preauth.aspx")>0||this.m_url.toLowerCase().indexOf("/_layouts/15/preauth.aspx")>0)&&(n=!0);var i=document.createElement("a");if(i.href=this.m_url,this.m_options.webApplication){var o=ae.embeddingPageOrigin+"="+e+"&"+ae.embeddingPageSessionInfo+"="+this.m_options.sessionKey;0===i.search.length||"?"===i.search?i.search="?"+ae.sessionContext+"="+encodeURIComponent(o):i.search=i.search+"&"+ae.sessionContext+"="+encodeURIComponent(o)}else n?0===i.hash.length||"#"===i.hash?i.hash="#"+t:i.hash=i.hash+"&"+t:0===i.search.length||"?"===i.search?i.search="?"+t:i.search=i.search+"&"+t;return i.href},t.prototype.init=function(){var e=this;window.addEventListener("message",this.m_onMessageHandler);var t=this._getIFrameSrc();return l.createPromise((function(n,i){var o=document.createElement("iframe");if(e.m_options.id&&(o.id=e.m_options.id,o.name=e.m_options.id),o.style.height=e.m_options.height,o.style.width=e.m_options.width,e.m_options.webApplication){var s=document.createElement("form");s.setAttribute("action",t),s.setAttribute("method","post"),s.setAttribute("target",o.name),e.m_options.container.appendChild(s);var c=document.createElement("input");c.setAttribute("type","hidden"),c.setAttribute("name","access_token"),c.setAttribute("value",e.m_options.webApplication.accessToken),s.appendChild(c);var u=document.createElement("input");u.setAttribute("type","hidden"),u.setAttribute("name","access_token_ttl"),u.setAttribute("value",e.m_options.webApplication.accessTokenTtl),s.appendChild(u),e.m_options.container.appendChild(o),s.submit()}else o.src=t,e.m_options.container.appendChild(o);e.m_timeoutId=window.setTimeout((function(){e.close();var t=Y.createRuntimeError(r.timeout,l._getResourceString(a.timeout),"EmbeddedSession.init");i(t)}),e.m_options.timeoutInMilliseconds),e.m_promiseResolver=n}))},t.prototype._invoke=function(e,t,n){this.m_enabled?(oe&&(n=oe(n)),this._sendMessageWithCallback(this.m_id++,e,n,(function(e){re&&(e=re(e));var n=e.Error;delete e.Error,t(n||0,e)}))):t(5001,null)},t.prototype.close=function(){window.removeEventListener("message",this.m_onMessageHandler),window.clearTimeout(this.m_timeoutId),this.m_enabled=!1},Object.defineProperty(t.prototype,"eventRegistration",{get:function(){return this.m_sessionEventManager||(this.m_sessionEventManager=new V(this._registerEventImpl.bind(this),this._unregisterEventImpl.bind(this))),this.m_sessionEventManager},enumerable:!0,configurable:!0}),t.prototype._createRequestExecutorOrNull=function(){return new ce(this)},t.prototype._resolveRequestUrlAndHeaderInfo=function(){return l._createPromiseFromResult(null)},t.prototype._registerEventImpl=function(e,t){var n=this;return l.createPromise((function(i,o){n._sendMessageWithCallback(n.m_id++,ne.RegisterEventCommand,{EventId:e,TargetId:t},(function(){i(null)}))}))},t.prototype._unregisterEventImpl=function(e,t){var n=this;return l.createPromise((function(i,o){n._sendMessageWithCallback(n.m_id++,ne.UnregisterEventCommand,{EventId:e,TargetId:t},(function(){i()}))}))},t.prototype._onMessage=function(e){var t=this;if(this.m_enabled&&(!this.m_chosenWindow||this.m_chosenWindow===e.source&&this.m_chosenOrigin===e.origin)){var n=e.data;if(n&&n[ne.CommandKey]===ne.ApiReadyCommand)!this.m_chosenWindow&&this._isValidDescendant(e.source)&&n[ne.SessionInfoKey]===this.m_options.sessionKey&&(this.m_chosenWindow=e.source,this.m_chosenOrigin=e.origin,this._sendMessageWithCallback(this.m_id++,ne.GetAppContextCommand,null,(function(e){t._setupContext(e),window.clearTimeout(t.m_timeoutId),t.m_promiseResolver()})));else if(n&&n[ne.CommandKey]===ne.FireEventCommand){var i=n[ne.ParamsKey],o=i.EventId,r=i.TargetId,a=i.Data;if(this.m_sessionEventManager)for(var s=this.m_sessionEventManager.getHandlers(o,r),c=0;c<s.length;c++)s[c](a)}else if(n&&n.hasOwnProperty(ne.RespondingId)){var l=n[ne.RespondingId],u=this.m_callbackList[l];"function"===typeof u&&u(n[ne.ParamsKey]),delete this.m_callbackList[l]}}},t.prototype._sendMessageWithCallback=function(e,t,n,i){this.m_callbackList[e]=i;var o={};o[ne.SendingId]=e,o[ne.CommandKey]=t,o[ne.ParamsKey]=n,this.m_chosenWindow.postMessage(JSON.stringify(o),this.m_chosenOrigin)},t.prototype._isValidDescendant=function(e){function t(n){if(n===e)return!0;for(var i=0,o=n.frames.length;i<o;i++)if(t(n.frames[i]))return!0;return!1}for(var n=(this.m_options.container||document.body).getElementsByTagName("iframe"),i=0,o=n.length;i<o;i++)if(t(n[i].contentWindow))return!0;return!1},t.prototype._setupContext=function(e){this.m_appContext=e},t}(t);e.EmbeddedSession=se;var ce=function(){function e(e){this.m_session=e}return e.prototype.executeAsync=function(t,n,i){var o=this,r=c.buildMessageArrayForIRequestExecutor(t,n,i,e.SourceLibHeaderValue);return l.createPromise((function(t,n){o.m_session._invoke(ne.ExecuteMethodCommand,(function(e,n){var i;l.log("Response:"),l.log(JSON.stringify(n)),i=0==e?c.buildResponseOnSuccess(c.getResponseBodyFromSafeArray(n.Data),c.getResponseHeadersFromSafeArray(n.Data)):c.buildResponseOnError(n.error.Code,n.error.Message),t(i)}),e._transformMessageArrayIntoParams(r))}))},e._transformMessageArrayIntoParams=function(t){return{ArrayData:t,DdaMethod:{DispatchId:e.DispidExecuteRichApiRequestMethod}}},e.DispidExecuteRichApiRequestMethod=93,e.SourceLibHeaderValue="Embedded",e}()}(OfficeExtension||(OfficeExtension={}));__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();var OfficeFirstPartyAuth,OfficeCore,Office,__awaiter=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(a,s)}c((i=i.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}};!function(e){OfficeExtension.BatchApiHelper.createPropertyObject,OfficeExtension.BatchApiHelper.createMethodObject,OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject;var t=OfficeExtension.BatchApiHelper.createTopLevelServiceObject,n=(OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod),i=(OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined),o=(OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson),r=OfficeExtension.Utility.fixObjectPathIfNecessary,a=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),s=function(s){function c(){return null!==s&&s.apply(this,arguments)||this}return __extends(c,s),Object.defineProperty(c.prototype,"_className",{get:function(){return"BiShim"},enumerable:!0,configurable:!0}),c.prototype.initialize=function(e){n(this,"Initialize",0,[e],0,0)},c.prototype.getData=function(){return n(this,"getData",1,[],4,0)},c.prototype.setVisualObjects=function(e){n(this,"setVisualObjects",0,[e],2,0)},c.prototype.setVisualObjectsToPersist=function(e){n(this,"setVisualObjectsToPersist",0,[e],2,0)},c.prototype._handleResult=function(e){(s.prototype._handleResult.call(this,e),i(e))||r(this,e)},c.prototype._handleRetrieveResult=function(e,t){s.prototype._handleRetrieveResult.call(this,e,t),a(this,e,t)},c.newObject=function(n){return t(e.BiShim,n,"Microsoft.AgaveVisual.BiShim",!1,4)},c.prototype.toJSON=function(){return o(this,{},{})},c}(OfficeExtension.ClientObject);e.BiShim=s,function(e){e.generalException1="GeneralException"}(e.AgaveVisualErrorCodes||(e.AgaveVisualErrorCodes={}))}(OfficeCore||(OfficeCore={})),function(e){OfficeExtension.BatchApiHelper.createPropertyObject;var t=OfficeExtension.BatchApiHelper.createMethodObject,n=(OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject,OfficeExtension.BatchApiHelper.createTopLevelServiceObject),i=(OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod),o=OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,r=(OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined),a=OfficeExtension.Utility.isUndefined,s=OfficeExtension.Utility.throwIfNotLoaded,c=(OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load),l=OfficeExtension.Utility.retrieve,u=OfficeExtension.Utility.toJson,d=OfficeExtension.Utility.fixObjectPathIfNecessary,f=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),p=function(o){function a(){return null!==o&&o.apply(this,arguments)||this}return __extends(a,o),Object.defineProperty(a.prototype,"_className",{get:function(){return"FlightingService"},enumerable:!0,configurable:!0}),a.prototype.getClientSessionId=function(){return i(this,"GetClientSessionId",1,[],4,0)},a.prototype.getDeferredFlights=function(){return i(this,"GetDeferredFlights",1,[],4,0)},a.prototype.getFeature=function(n,i,o,r){return t(e.ABType,this,"GetFeature",1,[n,i,o,r],!1,!1,null,4)},a.prototype.getFeatureGate=function(n,i){return t(e.ABType,this,"GetFeatureGate",1,[n,i],!1,!1,null,4)},a.prototype.resetOverride=function(e){i(this,"ResetOverride",0,[e],0,0)},a.prototype.setOverride=function(e,t,n){i(this,"SetOverride",0,[e,t,n],0,0)},a.prototype._handleResult=function(e){(o.prototype._handleResult.call(this,e),r(e))||d(this,e)},a.prototype._handleRetrieveResult=function(e,t){o.prototype._handleRetrieveResult.call(this,e,t),f(this,e,t)},a.newObject=function(t){return n(e.FlightingService,t,"Microsoft.Experiment.FlightingService",!1,4)},a.prototype.toJSON=function(){return u(this,{},{})},a}(OfficeExtension.ClientObject);e.FlightingService=p;var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_className",{get:function(){return"ABType"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyNames",{get:function(){return["value"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return s("value",this._V,"ABType",this._isNull),this._V},enumerable:!0,configurable:!0}),t.prototype._handleResult=function(t){if(e.prototype._handleResult.call(this,t),!r(t)){var n=t;d(this,n),a(n.Value)||(this._V=n.Value)}},t.prototype.load=function(e){return c(this,e)},t.prototype.retrieve=function(e){return l(this,e)},t.prototype._handleRetrieveResult=function(t,n){e.prototype._handleRetrieveResult.call(this,t,n),f(this,t,n)},t.prototype.toJSON=function(){return u(this,{value:this._V},{})},t.prototype.ensureUnchanged=function(e){o(this,e)},t}(OfficeExtension.ClientObject);e.ABType=h,function(e){e.boolean="Boolean",e.integer="Integer",e.string="String"}(e.FeatureType||(e.FeatureType={})),function(e){e.generalException="GeneralException"}(e.ExperimentErrorCodes||(e.ExperimentErrorCodes={}))}(OfficeCore||(OfficeCore={})),function(e){e.OfficeOnlineDomainList=["*.dod.online.office365.us","*.gov.online.office365.us","*.officeapps-df.live.com","*.officeapps.live.com","*.online.office.de","*.partner.officewebapps.cn"],e.isHostOriginTrusted=function(){if("undefined"===typeof window.external||"undefined"===typeof window.external.GetContext){var t=OSF.getClientEndPoint()._targetUrl,n=function(e){return e.split("/")[2].split(":")[0].split("?")[0]}(t);return 0!=t.indexOf("https:")||e.OfficeOnlineDomainList.forEach((function(e){if(0==e.indexOf("*.")&&(e=e.substring(2)),n.indexOf(e)==n.length-e.length)return!0})),!1}return!0}}(OfficeCore||(OfficeCore={})),function(e){var t=function(){function t(e){this.context=e}return Object.defineProperty(t.prototype,"roamingSettings",{get:function(){return this.m_roamingSettings||(this.m_roamingSettings=e.AuthenticationService.newObject(this.context).roamingSettings),this.m_roamingSettings},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tap",{get:function(){return this.m_tap||(this.m_tap=e.Tap.newObject(this.context)),this.m_tap},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"skill",{get:function(){return this.m_skill||(this.m_skill=e.Skill.newObject(this.context)),this.m_skill},enumerable:!0,configurable:!0}),t}();e.FirstPartyApis=t;var n=function(n){function i(e){return n.call(this,e)||this}return __extends(i,n),Object.defineProperty(i.prototype,"firstParty",{get:function(){return this.m_firstPartyApis||(this.m_firstPartyApis=new t(this)),this.m_firstPartyApis},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"flighting",{get:function(){return this.flightingService},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"telemetry",{get:function(){return this.m_telemetry||(this.m_telemetry=e.TelemetryService.newObject(this)),this.m_telemetry},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ribbon",{get:function(){return this.m_ribbon||(this.m_ribbon=e.DynamicRibbon.newObject(this)),this.m_ribbon},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bi",{get:function(){return this.m_biShim||(this.m_biShim=e.BiShim.newObject(this)),this.m_biShim},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"flightingService",{get:function(){return this.m_flightingService||(this.m_flightingService=e.FlightingService.newObject(this)),this.m_flightingService},enumerable:!0,configurable:!0}),i}(OfficeExtension.ClientRequestContext);e.RequestContext=n,e.run=function(t,n){return OfficeExtension.ClientRequestContext._runBatch("OfficeCore.run",arguments,(function(t){return new e.RequestContext(t)}))}}(OfficeCore||(OfficeCore={})),function(e){!function(e){function t(){var e=new OfficeCore.RequestContext;return"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(e._customData="WacPartition"),e}e.isFeatureEnabled=function(e,n){return __awaiter(this,void 0,void 0,(function(){var i,o,r;return __generator(this,(function(a){switch(a.label){case 0:return i=t(),o=OfficeCore.License.newObject(i),r=o.isFeatureEnabled(e,n),[4,i.sync()];case 1:return a.sent(),[2,r.value]}}))}))},e.getFeatureTier=function(e,n){return __awaiter(this,void 0,void 0,(function(){var i,o,r;return __generator(this,(function(a){switch(a.label){case 0:return i=t(),o=OfficeCore.License.newObject(i),r=o.getFeatureTier(e,n),[4,i.sync()];case 1:return a.sent(),[2,r.value]}}))}))},e.isFreemiumUpsellEnabled=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i;return __generator(this,(function(o){switch(o.label){case 0:return e=t(),n=OfficeCore.License.newObject(e),i=n.isFreemiumUpsellEnabled(),[4,e.sync()];case 1:return o.sent(),[2,i.value]}}))}))},e.launchUpsellExperience=function(e){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return n=t(),OfficeCore.License.newObject(n).launchUpsellExperience(e),[4,n.sync()];case 1:return i.sent(),[2]}}))}))},e.onFeatureStateChanged=function(e,n){return __awaiter(this,void 0,void 0,(function(){var i,o,r,a;return __generator(this,(function(s){switch(s.label){case 0:return i=t(),o=OfficeCore.License.newObject(i),(r=o.getLicenseFeature(e)).onStateChanged.add(n),a=function(){return r.onStateChanged.remove(n),null},[4,i.sync()];case 1:return s.sent(),[2,a]}}))}))},e.getMsaDeviceTicket=function(e,n,i){return __awaiter(this,void 0,void 0,(function(){var o,r,a;return __generator(this,(function(s){switch(s.label){case 0:return o=t(),r=OfficeCore.License.newObject(o),a=r.getMsaDeviceTicket(e,n,i),[4,o.sync()];case 1:return s.sent(),[2,a.value]}}))}))}}(e.license||(e.license={}))}(Office||(Office={})),function(e){OfficeExtension.BatchApiHelper.createPropertyObject,OfficeExtension.BatchApiHelper.createMethodObject,OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject;var t,n=OfficeExtension.BatchApiHelper.createTopLevelServiceObject,i=(OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod),o=(OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined),r=(OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson),a=OfficeExtension.Utility.fixObjectPathIfNecessary,s=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),c=(OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags,function(c){function l(){return null!==c&&c.apply(this,arguments)||this}return __extends(l,c),Object.defineProperty(l.prototype,"_className",{get:function(){return"Skill"},enumerable:!0,configurable:!0}),l.prototype.executeAction=function(e,t,n){return i(this,"ExecuteAction",1,[e,t,n],5,0)},l.prototype.notifyPaneEvent=function(e,t){i(this,"NotifyPaneEvent",1,[e,t],5,0)},l.prototype.registerHostSkillEvent=function(){i(this,"RegisterHostSkillEvent",0,[],1,0)},l.prototype.testFireEvent=function(){i(this,"TestFireEvent",0,[],1,0)},l.prototype.unregisterHostSkillEvent=function(){i(this,"UnregisterHostSkillEvent",0,[],1,0)},l.prototype._handleResult=function(e){(c.prototype._handleResult.call(this,e),o(e))||a(this,e)},l.prototype._handleRetrieveResult=function(e,t){c.prototype._handleRetrieveResult.call(this,e,t),s(this,e,t)},l.newObject=function(t){return n(e.Skill,t,"Microsoft.SkillApi.Skill",!1,4)},Object.defineProperty(l.prototype,"onHostSkillEvent",{get:function(){var e=this;return this.m_hostSkillEvent||(this.m_hostSkillEvent=new OfficeExtension.GenericEventHandlers(this.context,this,"HostSkillEvent",{eventType:65538,registerFunc:function(){return e.registerHostSkillEvent()},unregisterFunc:function(){return e.unregisterHostSkillEvent()},getTargetIdFunc:function(){return""},eventArgsTransformFunc:function(n){var i=t.Skill_HostSkillEvent_EventArgsTransform(e,n);return OfficeExtension.Utility._createPromiseFromResult(i)}})),this.m_hostSkillEvent},enumerable:!0,configurable:!0}),l.prototype.toJSON=function(){return r(this,{},{})},l}(OfficeExtension.ClientObject));e.Skill=c,function(e){e.Skill_HostSkillEvent_EventArgsTransform=function(e,t){return{type:t.type,data:t.data}}}(t=e._CC||(e._CC={})),function(e){e.generalException="GeneralException"}(e.SkillErrorCodes||(e.SkillErrorCodes={}))}(OfficeCore||(OfficeCore={})),function(e){OfficeExtension.BatchApiHelper.createPropertyObject,OfficeExtension.BatchApiHelper.createMethodObject,OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject;var t=OfficeExtension.BatchApiHelper.createTopLevelServiceObject,n=(OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod),i=(OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined),o=(OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported),r=(OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson),a=OfficeExtension.Utility.fixObjectPathIfNecessary,s=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),c=(OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags,function(c){function l(){return null!==c&&c.apply(this,arguments)||this}return __extends(l,c),Object.defineProperty(l.prototype,"_className",{get:function(){return"TelemetryService"},enumerable:!0,configurable:!0}),l.prototype.sendCustomerContent=function(e,t,i,r,a){o("TelemetryService.sendCustomerContent","Telemetry","1.3","OfficeCore"),n(this,"SendCustomerContent",1,[e,t,i,r,a],4,0)},l.prototype.sendTelemetryEvent=function(e,t,i,o,r){n(this,"SendTelemetryEvent",1,[e,t,i,o,r],4,0)},l.prototype._handleResult=function(e){(c.prototype._handleResult.call(this,e),i(e))||a(this,e)},l.prototype._handleRetrieveResult=function(e,t){c.prototype._handleRetrieveResult.call(this,e,t),s(this,e,t)},l.newObject=function(n){return t(e.TelemetryService,n,"Microsoft.Telemetry.TelemetryService",!1,4)},l.prototype.toJSON=function(){return r(this,{},{})},l}(OfficeExtension.ClientObject));e.TelemetryService=c,function(e){e.unset="Unset",e.string="String",e.boolean="Boolean",e.int64="Int64",e.double="Double"}(e.DataFieldType||(e.DataFieldType={})),function(e){e.generalException="GeneralException"}(e.TelemetryErrorCodes||(e.TelemetryErrorCodes={}))}(OfficeCore||(OfficeCore={})),function(e){var t=!1;function n(n){return new OfficeExtension.CoreUtility.Promise((function(o,r){if(OSF.WebAuth&&"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform){var a,s=!1;try{if(!Office||!Office.context||!Office.context.webAuth)return void r({code:"GetAuthContextAsyncMissing",message:"undefined"!==typeof Strings&&Strings.OfficeOM.L_ImplicitGetAuthContextMissing?Strings.OfficeOM.L_ImplicitGetAuthContextMissing:""});Office.context.webAuth.getAuthContextAsync((function(c){if("succeeded"===c.status){s=!0;var l=c.value;if(!l||l.isAnonymous)return void r({code:"CannotGetAuthContext",message:"undefined"!==typeof Strings&&Strings.OfficeOM.L_ImplicitGetAuthContextMissing?Strings.OfficeOM.L_ImplicitGetAuthContextMissing:""});var u="msa"===l.authorityType.toLowerCase();OSF.WebAuth.config={authFlow:e.authFlow,authVersion:e.authVersion?e.authVersion:null,debugging:e.debugging,authority:e.authorityOverride?e.authorityOverride:l.authority,idp:l.authorityType.toLowerCase(),appIds:[u&&l.msaAppId?l.msaAppId:l.appId],redirectUri:n||null,upn:l.upn,telemetryInstance:"otel",autoPopup:e.autoPopup,enableConsoleLogging:e.debugging},OSF.WebAuth.load().then((function(e){t=!0,i(e,!0),o()})).catch((function(e){i(e,!1),r({code:"PackageNotLoaded",message:e||("undefined"!==typeof Strings&&Strings.OfficeOM.L_ImplicitNotLoaded?Strings.OfficeOM.L_ImplicitNotLoaded:"")})}));var d=n||window.location.href.split("?")[0],f=sessionStorage.getItem("officeWebAuthReplyUrls");f||""===f?f=d:f+=", "+d,f&&sessionStorage.setItem("officeWebAuthReplyUrls",f)}else OSF.WebAuth.config=null,a=JSON.stringify(c),r({code:"CannotGetAuthContext",message:a})}))}catch(e){a=e,OSF.WebAuth.config=null,OSF.WebAuth.load().then((function(){o()})).catch((function(){r({code:s?"CannotGetAuthContext":"FailedToLoad",message:a})}))}}else o()}))}function i(t,n){e.debugging&&console.log("Logging WebAuthJs load event"),"undefined"!==typeof OTel&&OTel.OTelLogger.onTelemetryLoaded((function(){var e=[oteljs.makeStringDataField("IdentityProvider",OSF.WebAuth.config.idp),oteljs.makeStringDataField("AppId",OSF.WebAuth.config.appIds[0]),oteljs.makeBooleanDataField("Js","undefined"!==typeof Implicit||"undefined"!==typeof BrowserAuth),oteljs.makeBooleanDataField("Result",n)];if(OSF.WebAuth.config.telemetry)for(var i in OSF.WebAuth.config.telemetry)e.push(oteljs.makeStringDataField(i,OSF.WebAuth.config.telemetry[i]));if(t&&t.Telemetry)for(var i in t.Telemetry)if(t.Telemetry[i])switch(i){case"succeeded":e.push(oteljs.makeBooleanDataField(i,t.Telemetry[i]));break;case"loadedApplicationCount":case"timeToLoad":e.push(oteljs.makeInt64DataField(i,t.Telemetry[i]));break;default:e.push(oteljs.makeStringDataField(i,t.Telemetry[i]))}OTel.OTelLogger.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.OfficeFirstPartyAuth.Load",dataFields:e,eventFlags:{dataCategories:oteljs.DataCategories.ProductServiceUsage}})}))}function o(t,n,i,o,r){e.debugging&&console.log("Logging WebAuthJs acquire event"),"undefined"!==typeof OTel&&OTel.OTelLogger.onTelemetryLoaded((function(){var e=[oteljs.makeStringDataField("IdentityProvider",OSF.WebAuth.config.idp),oteljs.makeStringDataField("AppId",OSF.WebAuth.config.appIds[0]),oteljs.makeStringDataField("Target",i),oteljs.makeBooleanDataField("Popup","boolean"===typeof o&&o),oteljs.makeBooleanDataField("Result",n),oteljs.makeStringDataField("Error",r)];if(OSF.WebAuth.config.telemetry)for(var a in OSF.WebAuth.config.telemetry)e.push(oteljs.makeStringDataField(a,OSF.WebAuth.config.telemetry[a]));if(t&&t.Telemetry)for(var a in t.Telemetry)if(t.Telemetry[a])switch(a){case"succeeded":e.push(oteljs.makeBooleanDataField(a,t.Telemetry[a]));break;case"timeToGetToken":e.push(oteljs.makeInt64DataField(a,t.Telemetry[a]));break;default:e.push(oteljs.makeStringDataField(a,t.Telemetry[a]))}OTel.OTelLogger.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.OfficeFirstPartyAuth.GetAccessToken",dataFields:e,eventFlags:{dataCategories:oteljs.DataCategories.ProductServiceUsage}})}))}e.authFlow="implicit",e.autoPopup=!1,e.debugging=!1,e.load=n,e.getAccessToken=function(n,i){return new OfficeExtension.CoreUtility.Promise((function(r,a){if("web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform)Office.context.webAuth.getAuthContextAsync((function(s){var c=!1;"succeeded"===s.status&&(s.value.supportsAuthToken&&(c=!0));if(c){var l=new OfficeCore.RequestContext,u=OfficeCore.AuthenticationService.newObject(l);l._customData="WacPartition";var d=u.getAccessToken(n,null);l.sync().then((function(){r(d.value)}))}else OSF.WebAuth&&t?OSF.WebAuth.config.appIds[0]&&OSF.WebAuth.getToken(n.resource,OSF.WebAuth.config.appIds[0],OSF._OfficeAppFactory.getHostInfo().osfControlAppCorrelationId,i&&i.popup?i.popup:null).then((function(e){o(e,!0,n.resource,i&&i.popup?i.popup:null),r({accessToken:e.Token,tokenIdenityType:"msa"==OSF.WebAuth.config.idp.toLowerCase()?OfficeCore.IdentityType.microsoftAccount:OfficeCore.IdentityType.organizationAccount})})).catch((function(e){o(e,!1,n.resource,i&&i.popup?i.popup:null,e.ErrorCode),a({code:e.ErrorCode,message:e.ErrorMessage})})):function(t,n){e.debugging&&console.log("Logging WebAuthJs unexpected acquire event");"undefined"!==typeof OTel&&OTel.OTelLogger.onTelemetryLoaded((function(){var e=[oteljs.makeBooleanDataField("Loaded",t),oteljs.makeInt64DataField("LoadAttempts",n)];OTel.OTelLogger.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.OfficeFirstPartyAuth.UnexpectedAcquire",dataFields:e,eventFlags:{dataCategories:oteljs.DataCategories.ProductServiceUsage}})}))}(t,OSF.WebAuth.loadAttempts)}));else{var s=new OfficeCore.RequestContext,c=OfficeCore.AuthenticationService.newObject(s),l=c.onTokenReceived.add((function(e){if(!OfficeExtension.CoreUtility.isNullOrUndefined(e))if(l.remove(),s.sync().catch((function(){})),0==e.code)r(e.tokenValue);else if(OfficeExtension.CoreUtility.isNullOrUndefined(e.errorInfo))a({code:e.code});else try{a(JSON.parse(e.errorInfo))}catch(t){a({code:e.code,message:e.errorInfo})}return null}));s.sync().then((function(){var e=c.getAccessToken(n,c._targetId);return s.sync().then((function(){if(OfficeExtension.CoreUtility.isNullOrUndefined(e.value))return null;var t=e.value.accessToken;OfficeExtension.CoreUtility.isNullOrUndefined(t)||r(e.value)}))})).catch((function(e){a(e)}))}}))},e.getPrimaryIdentityInfo=function(){var e=new OfficeCore.RequestContext,t=OfficeCore.AuthenticationService.newObject(e);e._customData="WacPartition";var n=t.getPrimaryIdentityInfo();return e.sync().then((function(){return n.value}))},e.getIdentities=function(){var e=new OfficeCore.RequestContext,t=OfficeCore.AuthenticationService.newObject(e).getIdentities();return e.sync().then((function(){return t.value}))},"undefined"!==typeof window&&window.OSF&&function(){try{if("undefined"===typeof window||!window.sessionStorage)return;var e=sessionStorage.getItem("officeWebAuthReplyUrls");null!==e&&-1!==e.indexOf(window.location.origin+window.location.pathname)&&n()}catch(e){console.error(e)}}()}(OfficeFirstPartyAuth||(OfficeFirstPartyAuth={})),function(e){var t=OfficeExtension.BatchApiHelper.createPropertyObject,n=OfficeExtension.BatchApiHelper.createMethodObject,i=OfficeExtension.BatchApiHelper.createIndexerObject,o=(OfficeExtension.BatchApiHelper.createRootServiceObject,OfficeExtension.BatchApiHelper.createTopLevelServiceObject),r=OfficeExtension.BatchApiHelper.createChildItemObject,a=OfficeExtension.BatchApiHelper.invokeMethod,s=OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,c=OfficeExtension.BatchApiHelper.invokeSetProperty,l=OfficeExtension.Utility.isNullOrUndefined,u=OfficeExtension.Utility.isUndefined,d=OfficeExtension.Utility.throwIfNotLoaded,f=OfficeExtension.Utility.throwIfApiNotSupported,p=OfficeExtension.Utility.load,h=OfficeExtension.Utility.retrieve,m=OfficeExtension.Utility.toJson,g=OfficeExtension.Utility.fixObjectPathIfNecessary,y=OfficeExtension.Utility._handleNavigationPropertyResults,O=OfficeExtension.Utility.adjustToDateTime,v=OfficeExtension.Utility.processRetrieveResult,b=OfficeExtension.Utility.setMockData,_=OfficeExtension.CommonUtility.calculateApiFlags;!function(e){e.organizationAccount="OrganizationAccount",e.microsoftAccount="MicrosoftAccount",e.unsupported="Unsupported"}(e.IdentityType||(e.IdentityType={}));var S=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return __extends(i,n),Object.defineProperty(i.prototype,"_className",{get:function(){return"AuthenticationService"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_navigationPropertyNames",{get:function(){return["roamingSettings"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"roamingSettings",{get:function(){return this._R||(this._R=t(e.RoamingSettingCollection,this,"RoamingSettings",!1,4)),this._R},enumerable:!0,configurable:!0}),i.prototype.getAccessToken=function(e,t){return a(this,"GetAccessToken",1,[e,t],5,0)},i.prototype.getIdentities=function(){return f("AuthenticationService.getIdentities","FirstPartyAuthentication","1.3","Office"),a(this,"GetIdentities",1,[],5,0)},i.prototype.getPrimaryIdentityInfo=function(){return f("AuthenticationService.getPrimaryIdentityInfo","FirstPartyAuthentication","1.2","Office"),a(this,"GetPrimaryIdentityInfo",1,[],5,0)},i.prototype._handleResult=function(e){if(n.prototype._handleResult.call(this,e),!l(e)){var t=e;g(this,t),y(this,t,["roamingSettings","RoamingSettings"])}},i.prototype.load=function(e){return p(this,e)},i.prototype.retrieve=function(e){return h(this,e)},i.prototype._handleRetrieveResult=function(e,t){n.prototype._handleRetrieveResult.call(this,e,t),v(this,e,t)},i.newObject=function(t){return o(e.AuthenticationService,t,"Microsoft.Authentication.AuthenticationService",!1,4)},Object.defineProperty(i.prototype,"onTokenReceived",{get:function(){var e=this;return f("AuthenticationService.onTokenReceived","FirstPartyAuthentication","1.2","Office"),this.m_tokenReceived||(this.m_tokenReceived=new OfficeExtension.GenericEventHandlers(this.context,this,"TokenReceived",{eventType:3001,registerFunc:function(){return OfficeExtension.Utility._createPromiseFromResult(null)},unregisterFunc:function(){return OfficeExtension.Utility._createPromiseFromResult(null)},getTargetIdFunc:function(){return e._targetId},eventArgsTransformFunc:function(t){var n=A.AuthenticationService_TokenReceived_EventArgsTransform(e,t);return OfficeExtension.Utility._createPromiseFromResult(n)}})),this.m_tokenReceived},enumerable:!0,configurable:!0}),i.prototype.toJSON=function(){return m(this,{},{})},i}(OfficeExtension.ClientObject);e.AuthenticationService=S;var A,D=function(){function e(){}return Object.defineProperty(e.prototype,"_targetId",{get:function(){return void 0==this.m_targetId&&("undefined"!==typeof OSF&&OSF.OUtil?this.m_targetId=OSF.OUtil.Guid.generateNewGuid():this.m_targetId=""+this.context._nextId()),this.m_targetId},enumerable:!0,configurable:!0}),e}();e.AuthenticationServiceCustom=D,OfficeExtension.Utility.applyMixin(S,D),function(e){e.AuthenticationService_TokenReceived_EventArgsTransform=function(e,t){var n=t;return{tokenValue:n.tokenValue,code:n.code,errorInfo:n.errorInfo}}}(A=e._CC||(e._CC={}));var C=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_className",{get:function(){return"RoamingSetting"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyNames",{get:function(){return["id","value"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyOriginalNames",{get:function(){return["Id","Value"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyUpdateable",{get:function(){return[!1,!0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return d("id",this._I,"RoamingSetting",this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return d("value",this._V,"RoamingSetting",this._isNull),this._V},set:function(e){this._V=e,c(this,"Value",e,0)},enumerable:!0,configurable:!0}),t.prototype.set=function(e,t){this._recursivelySet(e,t,["value"],[],[])},t.prototype.update=function(e){this._recursivelyUpdate(e)},t.prototype._handleResult=function(t){if(e.prototype._handleResult.call(this,t),!l(t)){var n=t;g(this,n),u(n.Id)||(this._I=n.Id),u(n.Value)||(this._V=n.Value)}},t.prototype.load=function(e){return p(this,e)},t.prototype.retrieve=function(e){return h(this,e)},t.prototype._handleIdResult=function(t){e.prototype._handleIdResult.call(this,t),l(t)||u(t.Id)||(this._I=t.Id)},t.prototype._handleRetrieveResult=function(t,n){e.prototype._handleRetrieveResult.call(this,t,n),v(this,t,n)},t.prototype.toJSON=function(){return m(this,{id:this._I,value:this._V},{})},t.prototype.setMockData=function(e){b(this,e)},t.prototype.ensureUnchanged=function(e){s(this,e)},t}(OfficeExtension.ClientObject);e.RoamingSetting=C;var P=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return __extends(i,t),Object.defineProperty(i.prototype,"_className",{get:function(){return"RoamingSettingCollection"},enumerable:!0,configurable:!0}),i.prototype.getItem=function(t){return n(e.RoamingSetting,this,"GetItem",1,[t],!1,!1,null,4)},i.prototype.getItemOrNullObject=function(t){return n(e.RoamingSetting,this,"GetItemOrNullObject",1,[t],!1,!1,null,4)},i.prototype._handleResult=function(e){(t.prototype._handleResult.call(this,e),l(e))||g(this,e)},i.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},i.prototype.toJSON=function(){return m(this,{},{})},i}(OfficeExtension.ClientObject);e.RoamingSettingCollection=P,function(e){e.ariaBrowserPipeUrl="AriaBrowserPipeUrl",e.ariaUploadUrl="AriaUploadUrl",e.ariaVNextUploadUrl="AriaVNextUploadUrl",e.lokiAutoDiscoverUrl="LokiAutoDiscoverUrl"}(e.ServiceProvider||(e.ServiceProvider={}));var I=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"ServiceUrlProvider"},enumerable:!0,configurable:!0}),n.prototype.getServiceUrl=function(e,t){return a(this,"GetServiceUrl",1,[e,t],4,0)},n.prototype._handleResult=function(e){(t.prototype._handleResult.call(this,e),l(e))||g(this,e)},n.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},n.newObject=function(t){return o(e.ServiceUrlProvider,t,"Microsoft.DesktopCompliance.ServiceUrlProvider",!1,4)},n.prototype.toJSON=function(){return m(this,{},{})},n}(OfficeExtension.ClientObject);e.ServiceUrlProvider=I;var E=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"LinkedIn"},enumerable:!0,configurable:!0}),n.prototype.isEnabledForOffice=function(){return a(this,"IsEnabledForOffice",1,[],4,0)},n.prototype.recordLinkedInSettingsCompliance=function(e,t){a(this,"RecordLinkedInSettingsCompliance",0,[e,t],0,0)},n.prototype._handleResult=function(e){(t.prototype._handleResult.call(this,e),l(e))||g(this,e)},n.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},n.newObject=function(t){return o(e.LinkedIn,t,"Microsoft.DesktopCompliance.LinkedIn",!1,4)},n.prototype.toJSON=function(){return m(this,{},{})},n}(OfficeExtension.ClientObject);e.LinkedIn=E;var F=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"NetworkUsage"},enumerable:!0,configurable:!0}),n.prototype.isInDisconnectedMode=function(){return a(this,"IsInDisconnectedMode",1,[],4,0)},n.prototype.isInOnlineMode=function(){return a(this,"IsInOnlineMode",1,[],4,0)},n.prototype._handleResult=function(e){(t.prototype._handleResult.call(this,e),l(e))||g(this,e)},n.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},n.newObject=function(t){return o(e.NetworkUsage,t,"Microsoft.DesktopCompliance.NetworkUsage",!1,4)},n.prototype.toJSON=function(){return m(this,{},{})},n}(OfficeExtension.ClientObject);e.NetworkUsage=F;var M=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return __extends(r,i),Object.defineProperty(r.prototype,"_className",{get:function(){return"DynamicRibbon"},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"_navigationPropertyNames",{get:function(){return["buttons"]},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"buttons",{get:function(){return this._B||(this._B=t(e.RibbonButtonCollection,this,"Buttons",!0,4)),this._B},enumerable:!0,configurable:!0}),r.prototype.executeRequestCreate=function(e){f("DynamicRibbon.executeRequestCreate","DynamicRibbon","1.2","Office"),a(this,"ExecuteRequestCreate",1,[e],4,0)},r.prototype.executeRequestUpdate=function(e){a(this,"ExecuteRequestUpdate",1,[e],4,0)},r.prototype.getButton=function(t){return n(e.RibbonButton,this,"GetButton",1,[t],!1,!1,null,4)},r.prototype.getTab=function(t){return n(e.RibbonTab,this,"GetTab",1,[t],!1,!1,null,4)},r.prototype._handleResult=function(e){if(i.prototype._handleResult.call(this,e),!l(e)){var t=e;g(this,t),y(this,t,["buttons","Buttons"])}},r.prototype.load=function(e){return p(this,e)},r.prototype.retrieve=function(e){return h(this,e)},r.prototype._handleRetrieveResult=function(e,t){i.prototype._handleRetrieveResult.call(this,e,t),v(this,e,t)},r.newObject=function(t){return o(e.DynamicRibbon,t,"Microsoft.DynamicRibbon.DynamicRibbon",!1,4)},r.prototype.toJSON=function(){return m(this,{},{buttons:this._B})},r}(OfficeExtension.ClientObject);e.DynamicRibbon=M;var x=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_className",{get:function(){return"RibbonTab"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyNames",{get:function(){return["id"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyOriginalNames",{get:function(){return["Id"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return d("id",this._I,"RibbonTab",this._isNull),this._I},enumerable:!0,configurable:!0}),t.prototype.setVisibility=function(e){a(this,"SetVisibility",0,[e],0,0)},t.prototype._handleResult=function(t){if(e.prototype._handleResult.call(this,t),!l(t)){var n=t;g(this,n),u(n.Id)||(this._I=n.Id)}},t.prototype.load=function(e){return p(this,e)},t.prototype.retrieve=function(e){return h(this,e)},t.prototype._handleIdResult=function(t){e.prototype._handleIdResult.call(this,t),l(t)||u(t.Id)||(this._I=t.Id)},t.prototype._handleRetrieveResult=function(t,n){e.prototype._handleRetrieveResult.call(this,t,n),v(this,t,n)},t.prototype.toJSON=function(){return m(this,{id:this._I},{})},t.prototype.setMockData=function(e){b(this,e)},t.prototype.ensureUnchanged=function(e){s(this,e)},t}(OfficeExtension.ClientObject);e.RibbonTab=x;var R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_className",{get:function(){return"RibbonButton"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyNames",{get:function(){return["id","enabled","label"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyOriginalNames",{get:function(){return["Id","Enabled","Label"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyUpdateable",{get:function(){return[!1,!0,!1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return d("enabled",this._E,"RibbonButton",this._isNull),this._E},set:function(e){this._E=e,c(this,"Enabled",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return d("id",this._I,"RibbonButton",this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){return d("label",this._L,"RibbonButton",this._isNull),this._L},enumerable:!0,configurable:!0}),t.prototype.set=function(e,t){this._recursivelySet(e,t,["enabled"],[],[])},t.prototype.update=function(e){this._recursivelyUpdate(e)},t.prototype.setEnabled=function(e){a(this,"SetEnabled",0,[e],0,0)},t.prototype._handleResult=function(t){if(e.prototype._handleResult.call(this,t),!l(t)){var n=t;g(this,n),u(n.Enabled)||(this._E=n.Enabled),u(n.Id)||(this._I=n.Id),u(n.Label)||(this._L=n.Label)}},t.prototype.load=function(e){return p(this,e)},t.prototype.retrieve=function(e){return h(this,e)},t.prototype._handleIdResult=function(t){e.prototype._handleIdResult.call(this,t),l(t)||u(t.Id)||(this._I=t.Id)},t.prototype._handleRetrieveResult=function(t,n){e.prototype._handleRetrieveResult.call(this,t,n),v(this,t,n)},t.prototype.toJSON=function(){return m(this,{enabled:this._E,id:this._I,label:this._L},{})},t.prototype.setMockData=function(e){b(this,e)},t.prototype.ensureUnchanged=function(e){s(this,e)},t}(OfficeExtension.ClientObject);e.RibbonButton=R;var w=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"RibbonButtonCollection"},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_isCollection",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"items",{get:function(){return d("items",this.m__items,"RibbonButtonCollection",this._isNull),this.m__items},enumerable:!0,configurable:!0}),n.prototype.getCount=function(){return a(this,"GetCount",1,[],4,0)},n.prototype.getItem=function(t){return i(e.RibbonButton,this,[t])},n.prototype._handleResult=function(n){if(t.prototype._handleResult.call(this,n),!l(n)){var i=n;if(g(this,i),!l(i[OfficeExtension.Constants.items])){this.m__items=[];for(var o=i[OfficeExtension.Constants.items],a=0;a<o.length;a++){var s=r(e.RibbonButton,!0,this,o[a],a);s._handleResult(o[a]),this.m__items.push(s)}}}},n.prototype.load=function(e){return p(this,e)},n.prototype.retrieve=function(e){return h(this,e)},n.prototype._handleRetrieveResult=function(n,i){var o=this;t.prototype._handleRetrieveResult.call(this,n,i),v(this,n,i,(function(t,n){return r(e.RibbonButton,!0,o,t,n)}))},n.prototype.toJSON=function(){return m(this,{},{},this.m__items)},n.prototype.setMockData=function(t){var n=this;b(this,t,(function(t,i){return r(e.RibbonButton,!0,n,t,i)}),(function(e){return n.m__items=e}))},n}(OfficeExtension.ClientObject);e.RibbonButtonCollection=w,function(e){e.shortTime="ShortTime",e.longTime="LongTime",e.shortDate="ShortDate",e.longDate="LongDate"}(e.TimeStringFormat||(e.TimeStringFormat={}));var N=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"LocaleApi"},enumerable:!0,configurable:!0}),n.prototype.formatDateTimeString=function(e,t,n){return a(this,"FormatDateTimeString",1,[e,t,n],4,0)},n.prototype.getLocaleDateTimeFormattingInfo=function(e){return a(this,"GetLocaleDateTimeFormattingInfo",1,[e],4,0)},n.prototype._handleResult=function(e){(t.prototype._handleResult.call(this,e),l(e))||g(this,e)},n.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},n.newObject=function(t){return o(e.LocaleApi,t,"Microsoft.LocaleApi.LocaleApi",!1,4)},n.prototype.toJSON=function(){return m(this,{},{})},n}(OfficeExtension.ClientObject);e.LocaleApi=N;var T=function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return __extends(o,i),Object.defineProperty(o.prototype,"_className",{get:function(){return"Comment"},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_scalarPropertyNames",{get:function(){return["id","text","created","level","resolved","author","mentions"]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_scalarPropertyOriginalNames",{get:function(){return["Id","Text","Created","Level","Resolved","Author","Mentions"]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_scalarPropertyUpdateable",{get:function(){return[!1,!0,!1,!1,!0,!1,!1]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_navigationPropertyNames",{get:function(){return["parent","parentOrNullObject","replies"]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"parent",{get:function(){return this._P||(this._P=t(e.Comment,this,"Parent",!1,4)),this._P},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"parentOrNullObject",{get:function(){return this._Pa||(this._Pa=t(e.Comment,this,"ParentOrNullObject",!1,4)),this._Pa},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"replies",{get:function(){return this._R||(this._R=t(e.CommentCollection,this,"Replies",!0,4)),this._R},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"author",{get:function(){return d("author",this._A,"Comment",this._isNull),this._A},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"created",{get:function(){return d("created",this._C,"Comment",this._isNull),this._C},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"id",{get:function(){return d("id",this._I,"Comment",this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"level",{get:function(){return d("level",this._L,"Comment",this._isNull),this._L},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"mentions",{get:function(){return d("mentions",this._M,"Comment",this._isNull),this._M},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"resolved",{get:function(){return d("resolved",this._Re,"Comment",this._isNull),this._Re},set:function(e){this._Re=e,c(this,"Resolved",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"text",{get:function(){return d("text",this._T,"Comment",this._isNull),this._T},set:function(e){this._T=e,c(this,"Text",e,0)},enumerable:!0,configurable:!0}),o.prototype.set=function(e,t){this._recursivelySet(e,t,["text","resolved"],[],["parent","parentOrNullObject","replies"])},o.prototype.update=function(e){this._recursivelyUpdate(e)},o.prototype.delete=function(){a(this,"Delete",0,[],0,0)},o.prototype.getParentOrSelf=function(){return n(e.Comment,this,"GetParentOrSelf",1,[],!1,!1,null,4)},o.prototype.getRichText=function(e){return a(this,"GetRichText",1,[e],4,0)},o.prototype.reply=function(t,i){return n(e.Comment,this,"Reply",0,[t,i],!1,!1,null,0)},o.prototype.setRichText=function(e,t){return a(this,"SetRichText",0,[e,t],0,0)},o.prototype._handleResult=function(e){if(i.prototype._handleResult.call(this,e),!l(e)){var t=e;g(this,t),u(t.Author)||(this._A=t.Author),u(t.Created)||(this._C=O(t.Created)),u(t.Id)||(this._I=t.Id),u(t.Level)||(this._L=t.Level),u(t.Mentions)||(this._M=t.Mentions),u(t.Resolved)||(this._Re=t.Resolved),u(t.Text)||(this._T=t.Text),y(this,t,["parent","Parent","parentOrNullObject","ParentOrNullObject","replies","Replies"])}},o.prototype.load=function(e){return p(this,e)},o.prototype.retrieve=function(e){return h(this,e)},o.prototype._handleIdResult=function(e){i.prototype._handleIdResult.call(this,e),l(e)||u(e.Id)||(this._I=e.Id)},o.prototype._handleRetrieveResult=function(e,t){if(i.prototype._handleRetrieveResult.call(this,e,t),!l(e)){var n=e;u(n.Created)||(n.created=O(n.created)),v(this,e,t)}},o.prototype.toJSON=function(){return m(this,{author:this._A,created:this._C,id:this._I,level:this._L,mentions:this._M,resolved:this._Re,text:this._T},{replies:this._R})},o.prototype.setMockData=function(e){b(this,e)},o.prototype.ensureUnchanged=function(e){s(this,e)},o}(OfficeExtension.ClientObject);e.Comment=T;var j=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"CommentCollection"},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_isCollection",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"items",{get:function(){return d("items",this.m__items,"CommentCollection",this._isNull),this.m__items},enumerable:!0,configurable:!0}),n.prototype.getCount=function(){return a(this,"GetCount",1,[],4,0)},n.prototype.getItem=function(t){return i(e.Comment,this,[t])},n.prototype._handleResult=function(n){if(t.prototype._handleResult.call(this,n),!l(n)){var i=n;if(g(this,i),!l(i[OfficeExtension.Constants.items])){this.m__items=[];for(var o=i[OfficeExtension.Constants.items],a=0;a<o.length;a++){var s=r(e.Comment,!0,this,o[a],a);s._handleResult(o[a]),this.m__items.push(s)}}}},n.prototype.load=function(e){return p(this,e)},n.prototype.retrieve=function(e){return h(this,e)},n.prototype._handleRetrieveResult=function(n,i){var o=this;t.prototype._handleRetrieveResult.call(this,n,i),v(this,n,i,(function(t,n){return r(e.Comment,!0,o,t,n)}))},n.prototype.toJSON=function(){return m(this,{},{},this.m__items)},n.prototype.setMockData=function(t){var n=this;b(this,t,(function(t,i){return r(e.Comment,!0,n,t,i)}),(function(e){return n.m__items=e}))},n}(OfficeExtension.ClientObject);e.CommentCollection=j,function(e){e.plain="Plain",e.markdown="Markdown",e.delta="Delta"}(e.CommentTextFormat||(e.CommentTextFormat={})),function(e){e.placeHolderRendered="PlaceHolderRendered",e.initialCardRendered="InitialCardRendered"}(e.PersonaCardPerfPoint||(e.PersonaCardPerfPoint={})),function(e){e.notSet="NotSet",e.free="Free",e.idle="Idle",e.busy="Busy",e.idleBusy="IdleBusy",e.doNotDisturb="DoNotDisturb",e.unalertable="Unalertable",e.unavailable="Unavailable"}(e.UnifiedCommunicationAvailability||(e.UnifiedCommunicationAvailability={})),function(e){e.online="Online",e.notOnline="NotOnline",e.away="Away",e.busy="Busy",e.beRightBack="BeRightBack",e.onThePhone="OnThePhone",e.outToLunch="OutToLunch",e.inAMeeting="InAMeeting",e.outOfOffice="OutOfOffice",e.doNotDisturb="DoNotDisturb",e.inAConference="InAConference",e.getting="Getting",e.notABuddy="NotABuddy",e.disconnected="Disconnected",e.notInstalled="NotInstalled",e.urgentInterruptionsOnly="UrgentInterruptionsOnly",e.mayBeAvailable="MayBeAvailable",e.idle="Idle",e.inPresentation="InPresentation"}(e.UnifiedCommunicationStatus||(e.UnifiedCommunicationStatus={})),function(e){e.free="Free",e.busy="Busy",e.idle="Idle",e.doNotDistrub="DoNotDistrub",e.blocked="Blocked",e.notSet="NotSet",e.outOfOffice="OutOfOffice"}(e.UnifiedCommunicationPresence||(e.UnifiedCommunicationPresence={})),function(e){e.unknown="Unknown",e.free="Free",e.busy="Busy",e.elsewhere="Elsewhere",e.tentative="Tentative",e.outOfOffice="OutOfOffice"}(e.FreeBusyCalendarState||(e.FreeBusyCalendarState={})),function(e){e.unknown="Unknown",e.enterprise="Enterprise",e.contact="Contact",e.bot="Bot",e.phoneOnly="PhoneOnly",e.oneOff="OneOff",e.distributionList="DistributionList",e.personalDistributionList="PersonalDistributionList",e.anonymous="Anonymous",e.unifiedGroup="UnifiedGroup"}(e.PersonaType||(e.PersonaType={})),function(e){e.workPhone="WorkPhone",e.homePhone="HomePhone",e.mobilePhone="MobilePhone",e.businessFax="BusinessFax",e.otherPhone="OtherPhone"}(e.PhoneType||(e.PhoneType={})),function(e){e.workAddress="WorkAddress",e.homeAddress="HomeAddress",e.otherAddress="OtherAddress"}(e.AddressType||(e.AddressType={})),function(e){e.unknown="Unknown",e.individual="Individual",e.group="Group"}(e.MemberType||(e.MemberType={}));var U,k=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return __extends(i,t),Object.defineProperty(i.prototype,"_className",{get:function(){return"MemberInfoList"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyNames",{get:function(){return["isWarmedUp","isWarmingUp"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyOriginalNames",{get:function(){return["IsWarmedUp","IsWarmingUp"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isWarmedUp",{get:function(){return d("isWarmedUp",this._I,"MemberInfoList",this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isWarmingUp",{get:function(){return d("isWarmingUp",this._Is,"MemberInfoList",this._isNull),this._Is},enumerable:!0,configurable:!0}),i.prototype.getPersonaForMember=function(t){return n(e.Persona,this,"GetPersonaForMember",1,[t],!1,!1,null,4)},i.prototype.items=function(){return a(this,"Items",1,[],4,0)},i.prototype._handleResult=function(e){if(t.prototype._handleResult.call(this,e),!l(e)){var n=e;g(this,n),u(n.IsWarmedUp)||(this._I=n.IsWarmedUp),u(n.IsWarmingUp)||(this._Is=n.IsWarmingUp)}},i.prototype.load=function(e){return p(this,e)},i.prototype.retrieve=function(e){return h(this,e)},i.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},i.prototype.toJSON=function(){return m(this,{isWarmedUp:this._I,isWarmingUp:this._Is},{})},i.prototype.setMockData=function(e){b(this,e)},i.prototype.ensureUnchanged=function(e){s(this,e)},i}(OfficeExtension.ClientObject);e.MemberInfoList=k,function(e){e.hostId="HostId",e.type="Type",e.photo="Photo",e.personaInfo="PersonaInfo",e.unifiedCommunicationInfo="UnifiedCommunicationInfo",e.organization="Organization",e.unifiedGroupInfo="UnifiedGroupInfo",e.members="Members",e.membership="Membership",e.capabilities="Capabilities",e.customizations="Customizations",e.viewableSources="ViewableSources",e.placeholder="Placeholder"}(U=e.PersonaDataUpdated||(e.PersonaDataUpdated={}));var L=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_className",{get:function(){return"PersonaActions"},enumerable:!0,configurable:!0}),t.prototype.addContact=function(){a(this,"AddContact",0,[],0,0)},t.prototype.callPhoneNumber=function(e){a(this,"CallPhoneNumber",0,[e],0,0)},t.prototype.composeEmail=function(e){a(this,"ComposeEmail",0,[e],0,0)},t.prototype.composeInstantMessage=function(e){a(this,"ComposeInstantMessage",0,[e],0,0)},t.prototype.editContact=function(){a(this,"EditContact",0,[],0,0)},t.prototype.editContactByIdentifier=function(e){a(this,"EditContactByIdentifier",0,[e],0,0)},t.prototype.editUnifiedGroup=function(){a(this,"EditUnifiedGroup",0,[],0,0)},t.prototype.getChangePhotoUrlAndOpenInBrowser=function(){a(this,"GetChangePhotoUrlAndOpenInBrowser",0,[],0,0)},t.prototype.hideHoverCardForPersona=function(){a(this,"HideHoverCardForPersona",0,[],0,0)},t.prototype.joinUnifiedGroup=function(){a(this,"JoinUnifiedGroup",0,[],0,0)},t.prototype.leaveUnifiedGroup=function(){a(this,"LeaveUnifiedGroup",0,[],0,0)},t.prototype.openGroupCalendar=function(){a(this,"OpenGroupCalendar",0,[],0,0)},t.prototype.openLinkContactUx=function(){a(this,"OpenLinkContactUx",0,[],0,0)},t.prototype.openOutlookProperties=function(){a(this,"OpenOutlookProperties",0,[],0,0)},t.prototype.pinPersonaToQuickContacts=function(){a(this,"PinPersonaToQuickContacts",0,[],0,0)},t.prototype.scheduleMeeting=function(){a(this,"ScheduleMeeting",0,[],0,0)},t.prototype.showContactCard=function(e,t,n,i,o,r){a(this,"ShowContactCard",0,[e,t,n,i,o,r],0,0)},t.prototype.showContextMenu=function(e,t,n,i,o,r){a(this,"ShowContextMenu",0,[e,t,n,i,o,r],0,0)},t.prototype.showExpandedCard=function(e,t,n,i,o,r){a(this,"ShowExpandedCard",0,[e,t,n,i,o,r],0,0)},t.prototype.showHoverCardForPersona=function(e,t,n,i,o,r){a(this,"ShowHoverCardForPersona",0,[e,t,n,i,o,r],0,0)},t.prototype.startAudioCall=function(){a(this,"StartAudioCall",0,[],0,0)},t.prototype.startVideoCall=function(){a(this,"StartVideoCall",0,[],0,0)},t.prototype.subscribeToGroup=function(){a(this,"SubscribeToGroup",0,[],0,0)},t.prototype.toggleTagForAlerts=function(){a(this,"ToggleTagForAlerts",0,[],0,0)},t.prototype.unsubscribeFromGroup=function(){a(this,"UnsubscribeFromGroup",0,[],0,0)},t.prototype._handleResult=function(t){(e.prototype._handleResult.call(this,t),l(t))||g(this,t)},t.prototype._handleRetrieveResult=function(t,n){e.prototype._handleRetrieveResult.call(this,t,n),v(this,t,n)},t.prototype.toJSON=function(){return m(this,{},{})},t}(OfficeExtension.ClientObject);e.PersonaActions=L;var H=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_className",{get:function(){return"PersonaInfoSource"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyNames",{get:function(){return["displayName","email","emailAddresses","sipAddresses","birthday","birthdays","title","jobInfoDepartment","companyName","office","linkedTitles","linkedDepartments","linkedCompanyNames","linkedOffices","phones","addresses","webSites","notes"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyOriginalNames",{get:function(){return["DisplayName","Email","EmailAddresses","SipAddresses","Birthday","Birthdays","Title","JobInfoDepartment","CompanyName","Office","LinkedTitles","LinkedDepartments","LinkedCompanyNames","LinkedOffices","Phones","Addresses","WebSites","Notes"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"addresses",{get:function(){return d("addresses",this._A,"PersonaInfoSource",this._isNull),this._A},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"birthday",{get:function(){return d("birthday",this._B,"PersonaInfoSource",this._isNull),this._B},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"birthdays",{get:function(){return d("birthdays",this._Bi,"PersonaInfoSource",this._isNull),this._Bi},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"companyName",{get:function(){return d("companyName",this._C,"PersonaInfoSource",this._isNull),this._C},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"displayName",{get:function(){return d("displayName",this._D,"PersonaInfoSource",this._isNull),this._D},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"email",{get:function(){return d("email",this._E,"PersonaInfoSource",this._isNull),this._E},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"emailAddresses",{get:function(){return d("emailAddresses",this._Em,"PersonaInfoSource",this._isNull),this._Em},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"jobInfoDepartment",{get:function(){return d("jobInfoDepartment",this._J,"PersonaInfoSource",this._isNull),this._J},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"linkedCompanyNames",{get:function(){return d("linkedCompanyNames",this._L,"PersonaInfoSource",this._isNull),this._L},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"linkedDepartments",{get:function(){return d("linkedDepartments",this._Li,"PersonaInfoSource",this._isNull),this._Li},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"linkedOffices",{get:function(){return d("linkedOffices",this._Lin,"PersonaInfoSource",this._isNull),this._Lin},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"linkedTitles",{get:function(){return d("linkedTitles",this._Link,"PersonaInfoSource",this._isNull),this._Link},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"notes",{get:function(){return d("notes",this._N,"PersonaInfoSource",this._isNull),this._N},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"office",{get:function(){return d("office",this._O,"PersonaInfoSource",this._isNull),this._O},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"phones",{get:function(){return d("phones",this._P,"PersonaInfoSource",this._isNull),this._P},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sipAddresses",{get:function(){return d("sipAddresses",this._S,"PersonaInfoSource",this._isNull),this._S},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return d("title",this._T,"PersonaInfoSource",this._isNull),this._T},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"webSites",{get:function(){return d("webSites",this._W,"PersonaInfoSource",this._isNull),this._W},enumerable:!0,configurable:!0}),t.prototype._handleResult=function(t){if(e.prototype._handleResult.call(this,t),!l(t)){var n=t;g(this,n),u(n.Addresses)||(this._A=n.Addresses),u(n.Birthday)||(this._B=n.Birthday),u(n.Birthdays)||(this._Bi=n.Birthdays),u(n.CompanyName)||(this._C=n.CompanyName),u(n.DisplayName)||(this._D=n.DisplayName),u(n.Email)||(this._E=n.Email),u(n.EmailAddresses)||(this._Em=n.EmailAddresses),u(n.JobInfoDepartment)||(this._J=n.JobInfoDepartment),u(n.LinkedCompanyNames)||(this._L=n.LinkedCompanyNames),u(n.LinkedDepartments)||(this._Li=n.LinkedDepartments),u(n.LinkedOffices)||(this._Lin=n.LinkedOffices),u(n.LinkedTitles)||(this._Link=n.LinkedTitles),u(n.Notes)||(this._N=n.Notes),u(n.Office)||(this._O=n.Office),u(n.Phones)||(this._P=n.Phones),u(n.SipAddresses)||(this._S=n.SipAddresses),u(n.Title)||(this._T=n.Title),u(n.WebSites)||(this._W=n.WebSites)}},t.prototype.load=function(e){return p(this,e)},t.prototype.retrieve=function(e){return h(this,e)},t.prototype._handleRetrieveResult=function(t,n){e.prototype._handleRetrieveResult.call(this,t,n),v(this,t,n)},t.prototype.toJSON=function(){return m(this,{addresses:this._A,birthday:this._B,birthdays:this._Bi,companyName:this._C,displayName:this._D,email:this._E,emailAddresses:this._Em,jobInfoDepartment:this._J,linkedCompanyNames:this._L,linkedDepartments:this._Li,linkedOffices:this._Lin,linkedTitles:this._Link,notes:this._N,office:this._O,phones:this._P,sipAddresses:this._S,title:this._T,webSites:this._W},{})},t.prototype.setMockData=function(e){b(this,e)},t.prototype.ensureUnchanged=function(e){s(this,e)},t}(OfficeExtension.ClientObject);e.PersonaInfoSource=H;var W=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return __extends(i,n),Object.defineProperty(i.prototype,"_className",{get:function(){return"PersonaInfo"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyNames",{get:function(){return["displayName","email","emailAddresses","sipAddresses","birthday","birthdays","title","jobInfoDepartment","companyName","office","linkedTitles","linkedDepartments","linkedCompanyNames","linkedOffices","webSites","notes","isPersonResolved"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyOriginalNames",{get:function(){return["DisplayName","Email","EmailAddresses","SipAddresses","Birthday","Birthdays","Title","JobInfoDepartment","CompanyName","Office","LinkedTitles","LinkedDepartments","LinkedCompanyNames","LinkedOffices","WebSites","Notes","IsPersonResolved"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_navigationPropertyNames",{get:function(){return["sources"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"sources",{get:function(){return this._So||(this._So=t(e.PersonaInfoSource,this,"Sources",!1,4)),this._So},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"birthday",{get:function(){return d("birthday",this._B,"PersonaInfo",this._isNull),this._B},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"birthdays",{get:function(){return d("birthdays",this._Bi,"PersonaInfo",this._isNull),this._Bi},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"companyName",{get:function(){return d("companyName",this._C,"PersonaInfo",this._isNull),this._C},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayName",{get:function(){return d("displayName",this._D,"PersonaInfo",this._isNull),this._D},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"email",{get:function(){return d("email",this._E,"PersonaInfo",this._isNull),this._E},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"emailAddresses",{get:function(){return d("emailAddresses",this._Em,"PersonaInfo",this._isNull),this._Em},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isPersonResolved",{get:function(){return d("isPersonResolved",this._I,"PersonaInfo",this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"jobInfoDepartment",{get:function(){return d("jobInfoDepartment",this._J,"PersonaInfo",this._isNull),this._J},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"linkedCompanyNames",{get:function(){return d("linkedCompanyNames",this._L,"PersonaInfo",this._isNull),this._L},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"linkedDepartments",{get:function(){return d("linkedDepartments",this._Li,"PersonaInfo",this._isNull),this._Li},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"linkedOffices",{get:function(){return d("linkedOffices",this._Lin,"PersonaInfo",this._isNull),this._Lin},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"linkedTitles",{get:function(){return d("linkedTitles",this._Link,"PersonaInfo",this._isNull),this._Link},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"notes",{get:function(){return d("notes",this._N,"PersonaInfo",this._isNull),this._N},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"office",{get:function(){return d("office",this._O,"PersonaInfo",this._isNull),this._O},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"sipAddresses",{get:function(){return d("sipAddresses",this._S,"PersonaInfo",this._isNull),this._S},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return d("title",this._T,"PersonaInfo",this._isNull),this._T},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"webSites",{get:function(){return d("webSites",this._W,"PersonaInfo",this._isNull),this._W},enumerable:!0,configurable:!0}),i.prototype.getAddresses=function(){return a(this,"GetAddresses",1,[],4,0)},i.prototype.getPhones=function(){return a(this,"GetPhones",1,[],4,0)},i.prototype._handleResult=function(e){if(n.prototype._handleResult.call(this,e),!l(e)){var t=e;g(this,t),u(t.Birthday)||(this._B=O(t.Birthday)),u(t.Birthdays)||(this._Bi=O(t.Birthdays)),u(t.CompanyName)||(this._C=t.CompanyName),u(t.DisplayName)||(this._D=t.DisplayName),u(t.Email)||(this._E=t.Email),u(t.EmailAddresses)||(this._Em=t.EmailAddresses),u(t.IsPersonResolved)||(this._I=t.IsPersonResolved),u(t.JobInfoDepartment)||(this._J=t.JobInfoDepartment),u(t.LinkedCompanyNames)||(this._L=t.LinkedCompanyNames),u(t.LinkedDepartments)||(this._Li=t.LinkedDepartments),u(t.LinkedOffices)||(this._Lin=t.LinkedOffices),u(t.LinkedTitles)||(this._Link=t.LinkedTitles),u(t.Notes)||(this._N=t.Notes),u(t.Office)||(this._O=t.Office),u(t.SipAddresses)||(this._S=t.SipAddresses),u(t.Title)||(this._T=t.Title),u(t.WebSites)||(this._W=t.WebSites),y(this,t,["sources","Sources"])}},i.prototype.load=function(e){return p(this,e)},i.prototype.retrieve=function(e){return h(this,e)},i.prototype._handleRetrieveResult=function(e,t){if(n.prototype._handleRetrieveResult.call(this,e,t),!l(e)){var i=e;u(i.Birthday)||(i.birthday=O(i.birthday)),u(i.Birthdays)||(i.birthdays=O(i.birthdays)),v(this,e,t)}},i.prototype.toJSON=function(){return m(this,{birthday:this._B,birthdays:this._Bi,companyName:this._C,displayName:this._D,email:this._E,emailAddresses:this._Em,isPersonResolved:this._I,jobInfoDepartment:this._J,linkedCompanyNames:this._L,linkedDepartments:this._Li,linkedOffices:this._Lin,linkedTitles:this._Link,notes:this._N,office:this._O,sipAddresses:this._S,title:this._T,webSites:this._W},{sources:this._So})},i.prototype.setMockData=function(e){b(this,e)},i.prototype.ensureUnchanged=function(e){s(this,e)},i}(OfficeExtension.ClientObject);e.PersonaInfo=W;var B=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_className",{get:function(){return"PersonaUnifiedCommunicationInfo"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyNames",{get:function(){return["availability","status","isSelf","isTagged","customStatusString","isBlocked","presenceTooltip","isOutOfOffice","outOfOfficeNote","timezone","meetingLocation","meetingSubject","timezoneBias","idleStartTime","overallCapability","isOnBuddyList","presenceNote","voiceMailUri","availabilityText","availabilityTooltip","isDurationInAvailabilityText","freeBusyStatus","calendarState","presence"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyOriginalNames",{get:function(){return["Availability","Status","IsSelf","IsTagged","CustomStatusString","IsBlocked","PresenceTooltip","IsOutOfOffice","OutOfOfficeNote","Timezone","MeetingLocation","MeetingSubject","TimezoneBias","IdleStartTime","OverallCapability","IsOnBuddyList","PresenceNote","VoiceMailUri","AvailabilityText","AvailabilityTooltip","IsDurationInAvailabilityText","FreeBusyStatus","CalendarState","Presence"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"availability",{get:function(){return d("availability",this._A,"PersonaUnifiedCommunicationInfo",this._isNull),this._A},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"availabilityText",{get:function(){return d("availabilityText",this._Av,"PersonaUnifiedCommunicationInfo",this._isNull),this._Av},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"availabilityTooltip",{get:function(){return d("availabilityTooltip",this._Ava,"PersonaUnifiedCommunicationInfo",this._isNull),this._Ava},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"calendarState",{get:function(){return d("calendarState",this._C,"PersonaUnifiedCommunicationInfo",this._isNull),this._C},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"customStatusString",{get:function(){return d("customStatusString",this._Cu,"PersonaUnifiedCommunicationInfo",this._isNull),this._Cu},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"freeBusyStatus",{get:function(){return d("freeBusyStatus",this._F,"PersonaUnifiedCommunicationInfo",this._isNull),this._F},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"idleStartTime",{get:function(){return d("idleStartTime",this._I,"PersonaUnifiedCommunicationInfo",this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isBlocked",{get:function(){return d("isBlocked",this._Is,"PersonaUnifiedCommunicationInfo",this._isNull),this._Is},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDurationInAvailabilityText",{get:function(){return d("isDurationInAvailabilityText",this._IsD,"PersonaUnifiedCommunicationInfo",this._isNull),this._IsD},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isOnBuddyList",{get:function(){return d("isOnBuddyList",this._IsO,"PersonaUnifiedCommunicationInfo",this._isNull),this._IsO},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isOutOfOffice",{get:function(){return d("isOutOfOffice",this._IsOu,"PersonaUnifiedCommunicationInfo",this._isNull),this._IsOu},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSelf",{get:function(){return d("isSelf",this._IsS,"PersonaUnifiedCommunicationInfo",this._isNull),this._IsS},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isTagged",{get:function(){return d("isTagged",this._IsT,"PersonaUnifiedCommunicationInfo",this._isNull),this._IsT},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"meetingLocation",{get:function(){return d("meetingLocation",this._M,"PersonaUnifiedCommunicationInfo",this._isNull),this._M},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"meetingSubject",{get:function(){return d("meetingSubject",this._Me,"PersonaUnifiedCommunicationInfo",this._isNull),this._Me},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"outOfOfficeNote",{get:function(){return d("outOfOfficeNote",this._O,"PersonaUnifiedCommunicationInfo",this._isNull),this._O},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"overallCapability",{get:function(){return d("overallCapability",this._Ov,"PersonaUnifiedCommunicationInfo",this._isNull),this._Ov},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"presence",{get:function(){return d("presence",this._P,"PersonaUnifiedCommunicationInfo",this._isNull),this._P},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"presenceNote",{get:function(){return d("presenceNote",this._Pr,"PersonaUnifiedCommunicationInfo",this._isNull),this._Pr},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"presenceTooltip",{get:function(){return d("presenceTooltip",this._Pre,"PersonaUnifiedCommunicationInfo",this._isNull),this._Pre},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return d("status",this._S,"PersonaUnifiedCommunicationInfo",this._isNull),this._S},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"timezone",{get:function(){return d("timezone",this._T,"PersonaUnifiedCommunicationInfo",this._isNull),this._T},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"timezoneBias",{get:function(){return d("timezoneBias",this._Ti,"PersonaUnifiedCommunicationInfo",this._isNull),this._Ti},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"voiceMailUri",{get:function(){return d("voiceMailUri",this._V,"PersonaUnifiedCommunicationInfo",this._isNull),this._V},enumerable:!0,configurable:!0}),t.prototype._handleResult=function(t){if(e.prototype._handleResult.call(this,t),!l(t)){var n=t;g(this,n),u(n.Availability)||(this._A=n.Availability),u(n.AvailabilityText)||(this._Av=n.AvailabilityText),u(n.AvailabilityTooltip)||(this._Ava=n.AvailabilityTooltip),u(n.CalendarState)||(this._C=n.CalendarState),u(n.CustomStatusString)||(this._Cu=n.CustomStatusString),u(n.FreeBusyStatus)||(this._F=n.FreeBusyStatus),u(n.IdleStartTime)||(this._I=O(n.IdleStartTime)),u(n.IsBlocked)||(this._Is=n.IsBlocked),u(n.IsDurationInAvailabilityText)||(this._IsD=n.IsDurationInAvailabilityText),u(n.IsOnBuddyList)||(this._IsO=n.IsOnBuddyList),u(n.IsOutOfOffice)||(this._IsOu=n.IsOutOfOffice),u(n.IsSelf)||(this._IsS=n.IsSelf),u(n.IsTagged)||(this._IsT=n.IsTagged),u(n.MeetingLocation)||(this._M=n.MeetingLocation),u(n.MeetingSubject)||(this._Me=n.MeetingSubject),u(n.OutOfOfficeNote)||(this._O=n.OutOfOfficeNote),u(n.OverallCapability)||(this._Ov=n.OverallCapability),u(n.Presence)||(this._P=n.Presence),u(n.PresenceNote)||(this._Pr=n.PresenceNote),u(n.PresenceTooltip)||(this._Pre=n.PresenceTooltip),u(n.Status)||(this._S=n.Status),u(n.Timezone)||(this._T=n.Timezone),u(n.TimezoneBias)||(this._Ti=n.TimezoneBias),u(n.VoiceMailUri)||(this._V=n.VoiceMailUri)}},t.prototype.load=function(e){return p(this,e)},t.prototype.retrieve=function(e){return h(this,e)},t.prototype._handleRetrieveResult=function(t,n){if(e.prototype._handleRetrieveResult.call(this,t,n),!l(t)){var i=t;u(i.IdleStartTime)||(i.idleStartTime=O(i.idleStartTime)),v(this,t,n)}},t.prototype.toJSON=function(){return m(this,{availability:this._A,availabilityText:this._Av,availabilityTooltip:this._Ava,calendarState:this._C,customStatusString:this._Cu,freeBusyStatus:this._F,idleStartTime:this._I,isBlocked:this._Is,isDurationInAvailabilityText:this._IsD,isOnBuddyList:this._IsO,isOutOfOffice:this._IsOu,isSelf:this._IsS,isTagged:this._IsT,meetingLocation:this._M,meetingSubject:this._Me,outOfOfficeNote:this._O,overallCapability:this._Ov,presence:this._P,presenceNote:this._Pr,presenceTooltip:this._Pre,status:this._S,timezone:this._T,timezoneBias:this._Ti,voiceMailUri:this._V},{})},t.prototype.setMockData=function(e){b(this,e)},t.prototype.ensureUnchanged=function(e){s(this,e)},t}(OfficeExtension.ClientObject);e.PersonaUnifiedCommunicationInfo=B;var q=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_className",{get:function(){return"PersonaPhotoInfo"},enumerable:!0,configurable:!0}),t.prototype.getImageUri=function(e){return a(this,"getImageUri",1,[e],4,0)},t.prototype.getImageUriWithMetadata=function(e){return a(this,"getImageUriWithMetadata",1,[e],4,0)},t.prototype.getPlaceholderUri=function(e){return a(this,"getPlaceholderUri",1,[e],4,0)},t.prototype.setPlaceholderColor=function(e){a(this,"setPlaceholderColor",0,[e],0,0)},t.prototype._handleResult=function(t){(e.prototype._handleResult.call(this,t),l(t))||g(this,t)},t.prototype._handleRetrieveResult=function(t,n){e.prototype._handleRetrieveResult.call(this,t,n),v(this,t,n)},t.prototype.toJSON=function(){return m(this,{},{})},t}(OfficeExtension.ClientObject);e.PersonaPhotoInfo=q;var V=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"PersonaCollection"},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_isCollection",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"items",{get:function(){return d("items",this.m__items,"PersonaCollection",this._isNull),this.m__items},enumerable:!0,configurable:!0}),n.prototype.getCount=function(){return a(this,"GetCount",1,[],4,0)},n.prototype.getItem=function(t){return i(e.Persona,this,[t])},n.prototype._handleResult=function(n){if(t.prototype._handleResult.call(this,n),!l(n)){var i=n;if(g(this,i),!l(i[OfficeExtension.Constants.items])){this.m__items=[];for(var o=i[OfficeExtension.Constants.items],a=0;a<o.length;a++){var s=r(e.Persona,!0,this,o[a],a);s._handleResult(o[a]),this.m__items.push(s)}}}},n.prototype.load=function(e){return p(this,e)},n.prototype.retrieve=function(e){return h(this,e)},n.prototype._handleRetrieveResult=function(n,i){var o=this;t.prototype._handleRetrieveResult.call(this,n,i),v(this,n,i,(function(t,n){return r(e.Persona,!0,o,t,n)}))},n.prototype.toJSON=function(){return m(this,{},{},this.m__items)},n.prototype.setMockData=function(t){var n=this;b(this,t,(function(t,i){return r(e.Persona,!0,n,t,i)}),(function(e){return n.m__items=e}))},n}(OfficeExtension.ClientObject);e.PersonaCollection=V;var G=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return __extends(i,n),Object.defineProperty(i.prototype,"_className",{get:function(){return"PersonaOrganizationInfo"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyNames",{get:function(){return["isWarmedUp","isWarmingUp"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyOriginalNames",{get:function(){return["IsWarmedUp","IsWarmingUp"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_navigationPropertyNames",{get:function(){return["hierarchy","manager","directReports"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"directReports",{get:function(){return this._D||(this._D=t(e.PersonaCollection,this,"DirectReports",!0,4)),this._D},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"hierarchy",{get:function(){return this._H||(this._H=t(e.PersonaCollection,this,"Hierarchy",!0,4)),this._H},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"manager",{get:function(){return this._M||(this._M=t(e.Persona,this,"Manager",!1,4)),this._M},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isWarmedUp",{get:function(){return d("isWarmedUp",this._I,"PersonaOrganizationInfo",this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isWarmingUp",{get:function(){return d("isWarmingUp",this._Is,"PersonaOrganizationInfo",this._isNull),this._Is},enumerable:!0,configurable:!0}),i.prototype._handleResult=function(e){if(n.prototype._handleResult.call(this,e),!l(e)){var t=e;g(this,t),u(t.IsWarmedUp)||(this._I=t.IsWarmedUp),u(t.IsWarmingUp)||(this._Is=t.IsWarmingUp),y(this,t,["directReports","DirectReports","hierarchy","Hierarchy","manager","Manager"])}},i.prototype.load=function(e){return p(this,e)},i.prototype.retrieve=function(e){return h(this,e)},i.prototype._handleRetrieveResult=function(e,t){n.prototype._handleRetrieveResult.call(this,e,t),v(this,e,t)},i.prototype.toJSON=function(){return m(this,{isWarmedUp:this._I,isWarmingUp:this._Is},{})},i.prototype.setMockData=function(e){b(this,e)},i.prototype.ensureUnchanged=function(e){s(this,e)},i}(OfficeExtension.ClientObject);e.PersonaOrganizationInfo=G,function(e){e.email="Email",e.workPhone="WorkPhone",e.workPhone2="WorkPhone2",e.workFax="WorkFax",e.mobilePhone="MobilePhone",e.homePhone="HomePhone",e.homePhone2="HomePhone2",e.otherPhone="OtherPhone",e.sipAddress="SipAddress",e.profile="Profile",e.office="Office",e.company="Company",e.workAddress="WorkAddress",e.homeAddress="HomeAddress",e.otherAddress="OtherAddress",e.birthday="Birthday"}(e.CustomizedData||(e.CustomizedData={}));var z=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_className",{get:function(){return"UnifiedGroupInfo"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyNames",{get:function(){return["description","oneDrive","oneNote","isPublic","amIOwner","amIMember","amISubscribed","memberCount","ownerCount","hasGuests","site","planner","classification","subscriptionEnabled"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyOriginalNames",{get:function(){return["Description","OneDrive","OneNote","IsPublic","AmIOwner","AmIMember","AmISubscribed","MemberCount","OwnerCount","HasGuests","Site","Planner","Classification","SubscriptionEnabled"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyUpdateable",{get:function(){return[!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"amIMember",{get:function(){return d("amIMember",this._A,"UnifiedGroupInfo",this._isNull),this._A},set:function(e){this._A=e,c(this,"AmIMember",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"amIOwner",{get:function(){return d("amIOwner",this._Am,"UnifiedGroupInfo",this._isNull),this._Am},set:function(e){this._Am=e,c(this,"AmIOwner",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"amISubscribed",{get:function(){return d("amISubscribed",this._AmI,"UnifiedGroupInfo",this._isNull),this._AmI},set:function(e){this._AmI=e,c(this,"AmISubscribed",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"classification",{get:function(){return d("classification",this._C,"UnifiedGroupInfo",this._isNull),this._C},set:function(e){this._C=e,c(this,"Classification",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"description",{get:function(){return d("description",this._D,"UnifiedGroupInfo",this._isNull),this._D},set:function(e){this._D=e,c(this,"Description",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasGuests",{get:function(){return d("hasGuests",this._H,"UnifiedGroupInfo",this._isNull),this._H},set:function(e){this._H=e,c(this,"HasGuests",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPublic",{get:function(){return d("isPublic",this._I,"UnifiedGroupInfo",this._isNull),this._I},set:function(e){this._I=e,c(this,"IsPublic",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"memberCount",{get:function(){return d("memberCount",this._M,"UnifiedGroupInfo",this._isNull),this._M},set:function(e){this._M=e,c(this,"MemberCount",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"oneDrive",{get:function(){return d("oneDrive",this._O,"UnifiedGroupInfo",this._isNull),this._O},set:function(e){this._O=e,c(this,"OneDrive",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"oneNote",{get:function(){return d("oneNote",this._On,"UnifiedGroupInfo",this._isNull),this._On},set:function(e){this._On=e,c(this,"OneNote",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ownerCount",{get:function(){return d("ownerCount",this._Ow,"UnifiedGroupInfo",this._isNull),this._Ow},set:function(e){this._Ow=e,c(this,"OwnerCount",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"planner",{get:function(){return d("planner",this._P,"UnifiedGroupInfo",this._isNull),this._P},set:function(e){this._P=e,c(this,"Planner",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"site",{get:function(){return d("site",this._S,"UnifiedGroupInfo",this._isNull),this._S},set:function(e){this._S=e,c(this,"Site",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subscriptionEnabled",{get:function(){return d("subscriptionEnabled",this._Su,"UnifiedGroupInfo",this._isNull),this._Su},set:function(e){this._Su=e,c(this,"SubscriptionEnabled",e,0)},enumerable:!0,configurable:!0}),t.prototype.set=function(e,t){this._recursivelySet(e,t,["description","oneDrive","oneNote","isPublic","amIOwner","amIMember","amISubscribed","memberCount","ownerCount","hasGuests","site","planner","classification","subscriptionEnabled"],[],[])},t.prototype.update=function(e){this._recursivelyUpdate(e)},t.prototype._handleResult=function(t){if(e.prototype._handleResult.call(this,t),!l(t)){var n=t;g(this,n),u(n.AmIMember)||(this._A=n.AmIMember),u(n.AmIOwner)||(this._Am=n.AmIOwner),u(n.AmISubscribed)||(this._AmI=n.AmISubscribed),u(n.Classification)||(this._C=n.Classification),u(n.Description)||(this._D=n.Description),u(n.HasGuests)||(this._H=n.HasGuests),u(n.IsPublic)||(this._I=n.IsPublic),u(n.MemberCount)||(this._M=n.MemberCount),u(n.OneDrive)||(this._O=n.OneDrive),u(n.OneNote)||(this._On=n.OneNote),u(n.OwnerCount)||(this._Ow=n.OwnerCount),u(n.Planner)||(this._P=n.Planner),u(n.Site)||(this._S=n.Site),u(n.SubscriptionEnabled)||(this._Su=n.SubscriptionEnabled)}},t.prototype.load=function(e){return p(this,e)},t.prototype.retrieve=function(e){return h(this,e)},t.prototype._handleRetrieveResult=function(t,n){e.prototype._handleRetrieveResult.call(this,t,n),v(this,t,n)},t.prototype.toJSON=function(){return m(this,{amIMember:this._A,amIOwner:this._Am,amISubscribed:this._AmI,classification:this._C,description:this._D,hasGuests:this._H,isPublic:this._I,memberCount:this._M,oneDrive:this._O,oneNote:this._On,ownerCount:this._Ow,planner:this._P,site:this._S,subscriptionEnabled:this._Su},{})},t.prototype.setMockData=function(e){b(this,e)},t.prototype.ensureUnchanged=function(e){s(this,e)},t}(OfficeExtension.ClientObject);e.UnifiedGroupInfo=z;var J;!function(e){e[e.immediate=0]="immediate",e[e.load=3]="load"}(J=e.PersonaPromiseType||(e.PersonaPromiseType={}));var K=function(){return function(){}}();e.PersonaInfoAndSource=K;var X=function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return __extends(o,i),Object.defineProperty(o.prototype,"_className",{get:function(){return"Persona"},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_scalarPropertyNames",{get:function(){return["hostId","type","capabilities","diagnosticId","instanceId"]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_scalarPropertyOriginalNames",{get:function(){return["HostId","Type","Capabilities","DiagnosticId","InstanceId"]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_navigationPropertyNames",{get:function(){return["photo","personaInfo","unifiedCommunicationInfo","organization","unifiedGroupInfo","actions"]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"actions",{get:function(){return this._A||(this._A=t(e.PersonaActions,this,"Actions",!1,4)),this._A},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"organization",{get:function(){return this._O||(this._O=t(e.PersonaOrganizationInfo,this,"Organization",!1,4)),this._O},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"personaInfo",{get:function(){return this._P||(this._P=t(e.PersonaInfo,this,"PersonaInfo",!1,4)),this._P},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"photo",{get:function(){return this._Ph||(this._Ph=t(e.PersonaPhotoInfo,this,"Photo",!1,4)),this._Ph},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"unifiedCommunicationInfo",{get:function(){return this._U||(this._U=t(e.PersonaUnifiedCommunicationInfo,this,"UnifiedCommunicationInfo",!1,4)),this._U},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"unifiedGroupInfo",{get:function(){return this._Un||(this._Un=t(e.UnifiedGroupInfo,this,"UnifiedGroupInfo",!1,4)),this._Un},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"capabilities",{get:function(){return d("capabilities",this._C,"Persona",this._isNull),this._C},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"diagnosticId",{get:function(){return d("diagnosticId",this._D,"Persona",this._isNull),this._D},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"hostId",{get:function(){return d("hostId",this._H,"Persona",this._isNull),this._H},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"instanceId",{get:function(){return d("instanceId",this._I,"Persona",this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"type",{get:function(){return d("type",this._T,"Persona",this._isNull),this._T},enumerable:!0,configurable:!0}),o.prototype.set=function(e,t){this._recursivelySet(e,t,[],["unifiedGroupInfo"],["actions","organization","personaInfo","photo","unifiedCommunicationInfo"])},o.prototype.update=function(e){this._recursivelyUpdate(e)},o.prototype.dispose=function(){a(this,"Dispose",0,[],0,0)},o.prototype.getCustomizations=function(){return a(this,"GetCustomizations",1,[],4,0)},o.prototype.getMembers=function(){return n(e.MemberInfoList,this,"GetMembers",1,[],!1,!1,null,4)},o.prototype.getMembership=function(){return n(e.MemberInfoList,this,"GetMembership",1,[],!1,!1,null,4)},o.prototype.getViewableSources=function(){return a(this,"GetViewableSources",1,[],4,0)},o.prototype.reportTimeForRender=function(e,t){a(this,"ReportTimeForRender",0,[e,t],0,0)},o.prototype.warmup=function(e){a(this,"Warmup",0,[e],0,0)},o.prototype._handleResult=function(e){if(i.prototype._handleResult.call(this,e),!l(e)){var t=e;g(this,t),u(t.Capabilities)||(this._C=t.Capabilities),u(t.DiagnosticId)||(this._D=t.DiagnosticId),u(t.HostId)||(this._H=t.HostId),u(t.InstanceId)||(this._I=t.InstanceId),u(t.Type)||(this._T=t.Type),y(this,t,["actions","Actions","organization","Organization","personaInfo","PersonaInfo","photo","Photo","unifiedCommunicationInfo","UnifiedCommunicationInfo","unifiedGroupInfo","UnifiedGroupInfo"])}},o.prototype.load=function(e){return p(this,e)},o.prototype.retrieve=function(e){return h(this,e)},o.prototype._handleRetrieveResult=function(e,t){i.prototype._handleRetrieveResult.call(this,e,t),v(this,e,t)},o.prototype.toJSON=function(){return m(this,{capabilities:this._C,diagnosticId:this._D,hostId:this._H,instanceId:this._I,type:this._T},{organization:this._O,personaInfo:this._P,unifiedCommunicationInfo:this._U,unifiedGroupInfo:this._Un})},o.prototype.setMockData=function(e){b(this,e)},o.prototype.ensureUnchanged=function(e){s(this,e)},o}(OfficeExtension.ClientObject);e.Persona=X;var Q=function(){function t(){}return t.prototype.performAsyncOperation=function(e,t,n,i){var o=this;e!=J.immediate?i().then((function(e){if(e)n();else{var r=o;r.load("hostId"),r.context.sync().then((function(){var e=r.hostId;o.getPersonaLifetime().then((function(o){var a=function(s){return new OfficeExtension.CoreUtility.Promise((function(c,l){if(s.sendingPersonaHostId==e)for(var u=0;u<s.dataUpdated.length;++u){var d=s.dataUpdated[u];if(t==d)return void i().then((function(e){e&&(n(),o.onPersonaUpdated.remove(a),r.context.sync()),c(e)}))}c(!1)}))};o.onPersonaUpdated.add(a),r.context.sync()}))}))}})):n()},t.prototype.getOrganizationAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,i){var o=t;t.performAsyncOperation(e,U.organization,(function(){var e=o.organization;e.load("*"),o.context.sync().then((function(){n(e)}))}),(function(){return new OfficeExtension.CoreUtility.Promise((function(e,t){var n=o.organization;n.load("isWarmedUp"),o.context.sync().then((function(){e(n.isWarmedUp)}))}))}))}))},t.prototype.getIsPersonaInfoResolvedCheck=function(){var e=this;return new OfficeExtension.CoreUtility.Promise((function(t,n){var i=e.personaInfo;i.load("isPersonResolved"),e.context.sync().then((function(){t(i.isPersonResolved)}))}))},t.prototype.getPersonaInfoAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,i){var o=t;t.performAsyncOperation(e,U.personaInfo,(function(){var e=o.personaInfo;e.load(),o.context.sync().then((function(){n(e)}))}),(function(){return t.getIsPersonaInfoResolvedCheck()}))}))},t.prototype.getPersonaInfoWithSourceAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,i){var o=t;t.performAsyncOperation(e,U.personaInfo,(function(){var e=new K;e.info=o.personaInfo,e.info.load(),e.source=o.personaInfo.sources,e.source.load(),o.context.sync().then((function(){n(e)}))}),(function(){return t.getIsPersonaInfoResolvedCheck()}))}))},t.prototype.getUnifiedCommunicationInfo=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,i){var o=t;t.performAsyncOperation(e,U.personaInfo,(function(){var e=o.unifiedCommunicationInfo;e.load("*"),o.context.sync().then((function(){n(e)}))}),(function(){return t.getIsPersonaInfoResolvedCheck()}))}))},t.prototype.getUnifiedGroupInfoAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,i){var o=t;t.performAsyncOperation(e,U.personaInfo,(function(){var e=o.unifiedGroupInfo;e.load("*"),o.context.sync().then((function(){n(e)}))}),(function(){return t.getIsPersonaInfoResolvedCheck()}))}))},t.prototype.getTypeAsync=function(t){var n=this;return new OfficeExtension.CoreUtility.Promise((function(i,o){var r=n;n.performAsyncOperation(t,U.personaInfo,(function(){r.load("type"),r.context.sync().then((function(){i(e.PersonaType[r.type.valueOf()])}))}),(function(){return n.getIsPersonaInfoResolvedCheck()}))}))},t.prototype.getCustomizationsAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,i){var o=t;t.performAsyncOperation(e,U.personaInfo,(function(){var e=o.getCustomizations();o.context.sync().then((function(){n(e.value)}))}),(function(){return t.getIsPersonaInfoResolvedCheck()}))}))},t.prototype.getMembersAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,i){var o=t;t.performAsyncOperation(e,U.members,(function(){var e=o.getMembers();e.load("isWarmedUp"),o.context.sync().then((function(){n(e)}))}),(function(){return new OfficeExtension.CoreUtility.Promise((function(e,t){var n=o.getMembers();n.load("isWarmedUp"),o.context.sync().then((function(){e(n.isWarmedUp)}))}))}))}))},t.prototype.getMembershipAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,i){var o=t;t.performAsyncOperation(e,U.membership,(function(){var e=o.getMembership();e.load("*"),o.context.sync().then((function(){n(e)}))}),(function(){return new OfficeExtension.CoreUtility.Promise((function(e){var t=o.getMembership();t.load("isWarmedUp"),o.context.sync().then((function(){e(t.isWarmedUp)}))}))}))}))},t.prototype.getPersonaLifetime=function(){var e=this;return new OfficeExtension.CoreUtility.Promise((function(t,n){var i=e;i.load("instanceId"),i.context.sync().then((function(){new ee(i.context,i.instanceId).getPersonaLifetime().then((function(e){t(e)}))}))}))},t}();e.PersonaCustom=Q,OfficeExtension.Utility.applyMixin(X,Q);var $=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return __extends(i,t),Object.defineProperty(i.prototype,"_className",{get:function(){return"PersonaLifetime"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyNames",{get:function(){return["instanceId"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyOriginalNames",{get:function(){return["InstanceId"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"instanceId",{get:function(){return d("instanceId",this._I,"PersonaLifetime",this._isNull),this._I},enumerable:!0,configurable:!0}),i.prototype.getPersona=function(t){return n(e.Persona,this,"GetPersona",1,[t],!1,!1,null,4)},i.prototype.getPersonaForOrgByEntryId=function(t,i,o,r){return n(e.Persona,this,"GetPersonaForOrgByEntryId",1,[t,i,o,r],!1,!1,null,4)},i.prototype.getPersonaForOrgEntry=function(t,i,o,r){return n(e.Persona,this,"GetPersonaForOrgEntry",1,[t,i,o,r],!1,!1,null,4)},i.prototype.getPolicies=function(){return a(this,"GetPolicies",1,[],4,0)},i.prototype.getTextScaleFactor=function(){return a(this,"GetTextScaleFactor",1,[],4,0)},i.prototype._RegisterPersonaUpdatedEvent=function(){a(this,"_RegisterPersonaUpdatedEvent",0,[],0,0)},i.prototype._UnregisterPersonaUpdatedEvent=function(){a(this,"_UnregisterPersonaUpdatedEvent",0,[],0,0)},i.prototype._handleResult=function(e){if(t.prototype._handleResult.call(this,e),!l(e)){var n=e;g(this,n),u(n.InstanceId)||(this._I=n.InstanceId)}},i.prototype.load=function(e){return p(this,e)},i.prototype.retrieve=function(e){return h(this,e)},i.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},Object.defineProperty(i.prototype,"onPersonaUpdated",{get:function(){var e=this;return this.m_personaUpdated||(this.m_personaUpdated=new OfficeExtension.GenericEventHandlers(this.context,this,"PersonaUpdated",{eventType:3502,registerFunc:function(){return e._RegisterPersonaUpdatedEvent()},unregisterFunc:function(){return e._UnregisterPersonaUpdatedEvent()},getTargetIdFunc:function(){return e.instanceId},eventArgsTransformFunc:function(e){var t={dataUpdated:e.dataUpdated,sendingPersonaHostId:e.sendingPersonaHostId};return OfficeExtension.Utility._createPromiseFromResult(t)}})),this.m_personaUpdated},enumerable:!0,configurable:!0}),i.prototype.toJSON=function(){return m(this,{instanceId:this._I},{})},i.prototype.setMockData=function(e){b(this,e)},i.prototype.ensureUnchanged=function(e){s(this,e)},i}(OfficeExtension.ClientObject);e.PersonaLifetime=$;var Z=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_className",{get:function(){return"LokiTokenProvider"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyNames",{get:function(){return["emailOrUpn","instanceId"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyOriginalNames",{get:function(){return["EmailOrUpn","InstanceId"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"emailOrUpn",{get:function(){return d("emailOrUpn",this._E,"LokiTokenProvider",this._isNull),this._E},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"instanceId",{get:function(){return d("instanceId",this._I,"LokiTokenProvider",this._isNull),this._I},enumerable:!0,configurable:!0}),t.prototype.requestClientAccessToken=function(){a(this,"RequestClientAccessToken",0,[],0,0)},t.prototype.requestIdentityUniqueId=function(){a(this,"RequestIdentityUniqueId",0,[],0,0)},t.prototype.requestToken=function(){a(this,"RequestToken",0,[],0,0)},t.prototype._RegisterClientAccessTokenAvailableEvent=function(){a(this,"_RegisterClientAccessTokenAvailableEvent",0,[],0,0)},t.prototype._RegisterIdentityUniqueIdAvailableEvent=function(){a(this,"_RegisterIdentityUniqueIdAvailableEvent",0,[],0,0)},t.prototype._RegisterLokiTokenAvailableEvent=function(){a(this,"_RegisterLokiTokenAvailableEvent",0,[],0,0)},t.prototype._UnregisterClientAccessTokenAvailableEvent=function(){a(this,"_UnregisterClientAccessTokenAvailableEvent",0,[],0,0)},t.prototype._UnregisterIdentityUniqueIdAvailableEvent=function(){a(this,"_UnregisterIdentityUniqueIdAvailableEvent",0,[],0,0)},t.prototype._UnregisterLokiTokenAvailableEvent=function(){a(this,"_UnregisterLokiTokenAvailableEvent",0,[],0,0)},t.prototype._handleResult=function(t){if(e.prototype._handleResult.call(this,t),!l(t)){var n=t;g(this,n),u(n.EmailOrUpn)||(this._E=n.EmailOrUpn),u(n.InstanceId)||(this._I=n.InstanceId)}},t.prototype.load=function(e){return p(this,e)},t.prototype.retrieve=function(e){return h(this,e)},t.prototype._handleRetrieveResult=function(t,n){e.prototype._handleRetrieveResult.call(this,t,n),v(this,t,n)},Object.defineProperty(t.prototype,"onClientAccessTokenAvailable",{get:function(){var e=this;return this.m_clientAccessTokenAvailable||(this.m_clientAccessTokenAvailable=new OfficeExtension.GenericEventHandlers(this.context,this,"ClientAccessTokenAvailable",{eventType:3505,registerFunc:function(){return e._RegisterClientAccessTokenAvailableEvent()},unregisterFunc:function(){return e._UnregisterClientAccessTokenAvailableEvent()},getTargetIdFunc:function(){return e.instanceId},eventArgsTransformFunc:function(e){var t={clientAccessToken:e.clientAccessToken,isAvailable:e.isAvailable,tokenTTLInSeconds:e.tokenTTLInSeconds};return OfficeExtension.Utility._createPromiseFromResult(t)}})),this.m_clientAccessTokenAvailable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onIdentityUniqueIdAvailable",{get:function(){var e=this;return this.m_identityUniqueIdAvailable||(this.m_identityUniqueIdAvailable=new OfficeExtension.GenericEventHandlers(this.context,this,"IdentityUniqueIdAvailable",{eventType:3504,registerFunc:function(){return e._RegisterIdentityUniqueIdAvailableEvent()},unregisterFunc:function(){return e._UnregisterIdentityUniqueIdAvailableEvent()},getTargetIdFunc:function(){return e.instanceId},eventArgsTransformFunc:function(e){var t={isAvailable:e.isAvailable,uniqueId:e.uniqueId};return OfficeExtension.Utility._createPromiseFromResult(t)}})),this.m_identityUniqueIdAvailable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onLokiTokenAvailable",{get:function(){var e=this;return this.m_lokiTokenAvailable||(this.m_lokiTokenAvailable=new OfficeExtension.GenericEventHandlers(this.context,this,"LokiTokenAvailable",{eventType:3503,registerFunc:function(){return e._RegisterLokiTokenAvailableEvent()},unregisterFunc:function(){return e._UnregisterLokiTokenAvailableEvent()},getTargetIdFunc:function(){return e.instanceId},eventArgsTransformFunc:function(e){var t={isAvailable:e.isAvailable,lokiAutoDiscoverUrl:e.lokiAutoDiscoverUrl,lokiToken:e.lokiToken};return OfficeExtension.Utility._createPromiseFromResult(t)}})),this.m_lokiTokenAvailable},enumerable:!0,configurable:!0}),t.prototype.toJSON=function(){return m(this,{emailOrUpn:this._E,instanceId:this._I},{})},t.prototype.setMockData=function(e){b(this,e)},t.prototype.ensureUnchanged=function(e){s(this,e)},t}(OfficeExtension.ClientObject);e.LokiTokenProvider=Z;var Y=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return __extends(i,t),Object.defineProperty(i.prototype,"_className",{get:function(){return"LokiTokenProviderFactory"},enumerable:!0,configurable:!0}),i.prototype.getLokiTokenProvider=function(t){return n(e.LokiTokenProvider,this,"GetLokiTokenProvider",1,[t],!1,!1,null,4)},i.prototype._handleResult=function(e){(t.prototype._handleResult.call(this,e),l(e))||g(this,e)},i.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},i.newObject=function(t){return o(e.LokiTokenProviderFactory,t,"Microsoft.People.LokiTokenProviderFactory",!1,4)},i.prototype.toJSON=function(){return m(this,{},{})},i}(OfficeExtension.ClientObject);e.LokiTokenProviderFactory=Y;var ee=function(){function t(e,t){this.context=e,this.instanceId=t}return Object.defineProperty(t.prototype,"serviceContext",{get:function(){return this.m_serviceConext||(this.m_serviceConext=e.ServiceContext.newObject(this.context)),this.m_serviceConext},enumerable:!0,configurable:!0}),t.prototype.getPersonaLifetime=function(){var e=this;return new OfficeExtension.CoreUtility.Promise((function(t,n){var i=e.serviceContext.getPersonaLifetime(e.instanceId);e.context.sync().then((function(){i.load("instanceId"),e.context.sync().then((function(){t(i)}))}))}))},t.prototype.getInitialPersona=function(){var e=this;return new OfficeExtension.CoreUtility.Promise((function(t,n){var i=e.serviceContext.getInitialPersona(e.instanceId);e.context.sync().then((function(){t(i)}))}))},t.prototype.getLokiTokenProvider=function(){var e=this;return new OfficeExtension.CoreUtility.Promise((function(t,n){var i=e.serviceContext.getLokiTokenProvider(e.instanceId);e.context.sync().then((function(){i.load("instanceId"),e.context.sync().then((function(){t(i)}))}))}))},t}();e.PeopleApiContext=ee;var te=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return __extends(i,t),Object.defineProperty(i.prototype,"_className",{get:function(){return"ServiceContext"},enumerable:!0,configurable:!0}),i.prototype.accountEmailOrUpn=function(e){return a(this,"AccountEmailOrUpn",1,[e],4,0)},i.prototype.dispose=function(e){a(this,"Dispose",0,[e],0,0)},i.prototype.getInitialPersona=function(t){return n(e.Persona,this,"GetInitialPersona",1,[t],!1,!1,null,4)},i.prototype.getLokiTokenProvider=function(t){return n(e.LokiTokenProvider,this,"GetLokiTokenProvider",1,[t],!1,!1,null,4)},i.prototype.getPersonaLifetime=function(t){return n(e.PersonaLifetime,this,"GetPersonaLifetime",1,[t],!1,!1,null,4)},i.prototype.getPersonaPolicies=function(){return a(this,"GetPersonaPolicies",1,[],4,0)},i.prototype._handleResult=function(e){(t.prototype._handleResult.call(this,e),l(e))||g(this,e)},i.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},i.newObject=function(t){return o(e.ServiceContext,t,"Microsoft.People.ServiceContext",!1,4)},i.prototype.toJSON=function(){return m(this,{},{})},i}(OfficeExtension.ClientObject);e.ServiceContext=te;var ne=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"RichapiPcxFeatureChecks"},enumerable:!0,configurable:!0}),n.prototype.isAddChangePhotoLinkOnLpcPersonaImageFlightEnabled=function(){return a(this,"IsAddChangePhotoLinkOnLpcPersonaImageFlightEnabled",1,[],4,0)},n.prototype._handleResult=function(e){(t.prototype._handleResult.call(this,e),l(e))||g(this,e)},n.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},n.newObject=function(t){return o(e.RichapiPcxFeatureChecks,t,"Microsoft.People.RichapiPcxFeatureChecks",!1,4)},n.prototype.toJSON=function(){return m(this,{},{})},n}(OfficeExtension.ClientObject);e.RichapiPcxFeatureChecks=ne;var ie=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"Tap"},enumerable:!0,configurable:!0}),n.prototype.getEnterpriseUserInfo=function(){return a(this,"GetEnterpriseUserInfo",1,[],5,0)},n.prototype.getMruFriendlyPath=function(e){return a(this,"GetMruFriendlyPath",1,[e],5,0)},n.prototype.launchFileUrlInOfficeApp=function(e,t){return a(this,"LaunchFileUrlInOfficeApp",1,[e,t],5,0)},n.prototype.performLocalSearch=function(e,t,n,i){return a(this,"PerformLocalSearch",1,[e,t,n,i],5,0)},n.prototype.readSearchCache=function(e,t,n){return a(this,"ReadSearchCache",1,[e,t,n],5,0)},n.prototype.writeSearchCache=function(e,t,n){return a(this,"WriteSearchCache",1,[e,t,n],5,0)},n.prototype._handleResult=function(e){(t.prototype._handleResult.call(this,e),l(e))||g(this,e)},n.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},n.newObject=function(t){return o(e.Tap,t,"Microsoft.TapRichApi.Tap",!1,4)},n.prototype.toJSON=function(){return m(this,{},{})},n}(OfficeExtension.ClientObject);e.Tap=ie,function(e){e.unknown="Unknown",e.chart="Chart",e.smartArt="SmartArt",e.table="Table",e.image="Image",e.slide="Slide",e.ole="OLE",e.text="Text"}(e.ObjectType||(e.ObjectType={}));var oe=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"AppRuntimePersistenceService"},enumerable:!0,configurable:!0}),n.prototype.getAppRuntimeStartState=function(){return a(this,"GetAppRuntimeStartState",1,[],4,0)},n.prototype.setAppRuntimeStartState=function(e){a(this,"SetAppRuntimeStartState",0,[e],_(2,"SharedRuntimeInternal","1.2"),0)},n.prototype._handleResult=function(e){(t.prototype._handleResult.call(this,e),l(e))||g(this,e)},n.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},n.newObject=function(t){return o(e.AppRuntimePersistenceService,t,"Microsoft.AppRuntime.AppRuntimePersistenceService",!1,4)},n.prototype.toJSON=function(){return m(this,{},{})},n}(OfficeExtension.ClientObject);e.AppRuntimePersistenceService=oe;var re,ae=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"AppRuntimeService"},enumerable:!0,configurable:!0}),n.prototype.getAppRuntimeState=function(){return a(this,"GetAppRuntimeState",1,[],4,0)},n.prototype.setAppRuntimeState=function(e){a(this,"SetAppRuntimeState",0,[e],_(2,"SharedRuntimeInternal","1.2"),0)},n.prototype._handleResult=function(e){(t.prototype._handleResult.call(this,e),l(e))||g(this,e)},n.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},n.newObject=function(t){return o(e.AppRuntimeService,t,"Microsoft.AppRuntime.AppRuntimeService",!1,4)},Object.defineProperty(n.prototype,"onVisibilityChanged",{get:function(){return this.m_visibilityChanged||(this.m_visibilityChanged=new OfficeExtension.GenericEventHandlers(this.context,this,"VisibilityChanged",{eventType:65539,registerFunc:function(){return OfficeExtension.Utility._createPromiseFromResult(null)},unregisterFunc:function(){return OfficeExtension.Utility._createPromiseFromResult(null)},getTargetIdFunc:function(){return""},eventArgsTransformFunc:function(e){var t={visibility:e.visibility};return OfficeExtension.Utility._createPromiseFromResult(t)}})),this.m_visibilityChanged},enumerable:!0,configurable:!0}),n.prototype.toJSON=function(){return m(this,{},{})},n}(OfficeExtension.ClientObject);e.AppRuntimeService=ae,function(e){e.inactive="Inactive",e.background="Background",e.visible="Visible"}(e.AppRuntimeState||(e.AppRuntimeState={})),function(e){e.hidden="Hidden",e.visible="Visible"}(e.Visibility||(e.Visibility={})),function(e){e.unknown="Unknown",e.basic="Basic",e.premium="Premium"}(re=e.LicenseFeatureTier||(e.LicenseFeatureTier={}));var se=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return __extends(i,t),Object.defineProperty(i.prototype,"_className",{get:function(){return"License"},enumerable:!0,configurable:!0}),i.prototype.getFeatureTier=function(e,t){return a(this,"GetFeatureTier",1,[e,t],4,0)},i.prototype.getLicenseFeature=function(t){return n(e.LicenseFeature,this,"GetLicenseFeature",1,[t],!1,!1,null,4)},i.prototype.getMsaDeviceTicket=function(e,t,n){return a(this,"GetMsaDeviceTicket",1,[e,t,n],5,0)},i.prototype.isFeatureEnabled=function(e,t){return a(this,"IsFeatureEnabled",1,[e,t],4,0)},i.prototype.isFreemiumUpsellEnabled=function(){return a(this,"IsFreemiumUpsellEnabled",1,[],4,0)},i.prototype.launchUpsellExperience=function(e){a(this,"LaunchUpsellExperience",1,[e],4,0)},i.prototype._TestFireStateChangedEvent=function(e){a(this,"_TestFireStateChangedEvent",0,[e],1,0)},i.prototype._handleResult=function(e){(t.prototype._handleResult.call(this,e),l(e))||g(this,e)},i.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},i.newObject=function(t){return o(e.License,t,"Microsoft.Office.Licensing.License",!1,4)},i.prototype.toJSON=function(){return m(this,{},{})},i}(OfficeExtension.ClientObject);e.License=se;var ce=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_className",{get:function(){return"LicenseFeature"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyNames",{get:function(){return["id"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyOriginalNames",{get:function(){return["Id"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return d("id",this._I,"LicenseFeature",this._isNull),this._I},enumerable:!0,configurable:!0}),t.prototype._RegisterStateChange=function(){a(this,"_RegisterStateChange",1,[],4,0)},t.prototype._UnregisterStateChange=function(){a(this,"_UnregisterStateChange",1,[],4,0)},t.prototype._handleResult=function(t){if(e.prototype._handleResult.call(this,t),!l(t)){var n=t;g(this,n),u(n.Id)||(this._I=n.Id)}},t.prototype.load=function(e){return p(this,e)},t.prototype.retrieve=function(e){return h(this,e)},t.prototype._handleIdResult=function(t){e.prototype._handleIdResult.call(this,t),l(t)||u(t.Id)||(this._I=t.Id)},t.prototype._handleRetrieveResult=function(t,n){e.prototype._handleRetrieveResult.call(this,t,n),v(this,t,n)},Object.defineProperty(t.prototype,"onStateChanged",{get:function(){var e=this;return this.m_stateChanged||(this.m_stateChanged=new OfficeExtension.GenericEventHandlers(this.context,this,"StateChanged",{eventType:1,registerFunc:function(){return e._RegisterStateChange()},unregisterFunc:function(){return e._UnregisterStateChange()},getTargetIdFunc:function(){return e.id},eventArgsTransformFunc:function(t){var n=A.LicenseFeature_StateChanged_EventArgsTransform(e,t);return OfficeExtension.Utility._createPromiseFromResult(n)}})),this.m_stateChanged},enumerable:!0,configurable:!0}),t.prototype.toJSON=function(){return m(this,{id:this._I},{})},t.prototype.setMockData=function(e){b(this,e)},t.prototype.ensureUnchanged=function(e){s(this,e)},t}(OfficeExtension.ClientObject);e.LicenseFeature=ce,function(e){e.LicenseFeature_StateChanged_EventArgsTransform=function(e,t){var n={feature:t.featureName,isEnabled:t.isEnabled,tier:t.tierName};return t.tierName&&(n.tier=0==t.tierName?re.unknown:1==t.tierName?re.basic:2==t.tierName?re.premium:t.tierName),n}}(A=e._CC||(e._CC={}));var le=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"MsaDeviceTicketOptions"},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_scalarPropertyNames",{get:function(){return["scopes"]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_scalarPropertyOriginalNames",{get:function(){return["Scopes"]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_scalarPropertyUpdateable",{get:function(){return[!0]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"scopes",{get:function(){return d("scopes",this._S,"MsaDeviceTicketOptions",this._isNull),this._S},set:function(e){this._S=e,c(this,"Scopes",e,0)},enumerable:!0,configurable:!0}),n.prototype.set=function(e,t){this._recursivelySet(e,t,["scopes"],[],[])},n.prototype.update=function(e){this._recursivelyUpdate(e)},n.prototype._handleResult=function(e){if(t.prototype._handleResult.call(this,e),!l(e)){var n=e;g(this,n),u(n.Scopes)||(this._S=n.Scopes)}},n.prototype.load=function(e){return p(this,e)},n.prototype.retrieve=function(e){return h(this,e)},n.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},n.newObject=function(t){return o(e.MsaDeviceTicketOptions,t,"Microsoft.Office.Licensing.MsaDeviceTicketOptions",!1,4)},n.prototype.toJSON=function(){return m(this,{scopes:this._S},{})},n.prototype.setMockData=function(e){b(this,e)},n.prototype.ensureUnchanged=function(e){s(this,e)},n}(OfficeExtension.ClientObject);e.MsaDeviceTicketOptions=le;var ue=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"DialogPage"},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_scalarPropertyNames",{get:function(){return["_Id"]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_scalarPropertyOriginalNames",{get:function(){return["_Id"]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_Id",{get:function(){return d("_Id",this.__I,"DialogPage",this._isNull),this.__I},enumerable:!0,configurable:!0}),n.prototype.close=function(){a(this,"Close",1,[],4,0)},n.prototype.readyToShow=function(){a(this,"ReadyToShow",1,[],4,0)},n.prototype.registerOnShow=function(){a(this,"RegisterOnShow",1,[],4,0)},n.prototype.sendMessageToHost=function(e){a(this,"SendMessageToHost",1,[e],4,0)},n.prototype.unregisterOnShow=function(){a(this,"UnregisterOnShow",1,[],4,0)},n.prototype._handleResult=function(e){if(t.prototype._handleResult.call(this,e),!l(e)){var n=e;g(this,n),u(n._Id)||(this.__I=n._Id)}},n.prototype.load=function(e){return p(this,e)},n.prototype._handleIdResult=function(e){t.prototype._handleIdResult.call(this,e),l(e)||u(e._Id)||(this.__I=e._Id)},n.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),v(this,e,n)},n.newObject=function(t){return o(e.DialogPage,t,"Microsoft.Office.DialogPage.DialogPage",!1,4)},Object.defineProperty(n.prototype,"onOnShowEvent",{get:function(){var e=this;return this.m_onShowEvent||(this.m_onShowEvent=new OfficeExtension.GenericEventHandlers(this.context,this,"OnShowEvent",{eventType:1,registerFunc:function(){return e.registerOnShow()},unregisterFunc:function(){return e.unregisterOnShow()},getTargetIdFunc:function(){return e._Id},eventArgsTransformFunc:function(e){return OfficeExtension.Utility._createPromiseFromResult({})}})),this.m_onShowEvent},enumerable:!0,configurable:!0}),n.prototype.toJSON=function(){return m(this,{},{})},n}(OfficeExtension.ClientObject);e.DialogPage=ue,function(e){e.apiNotAvailable="ApiNotAvailable",e.clientError="ClientError",e.controlIdNotFound="ControlIdNotFound",e.entryIdRequired="EntryIdRequired",e.generalException="GeneralException",e.hostRestartNeeded="HostRestartNeeded",e.instanceNotFound="InstanceNotFound",e.interactiveFlowAborted="InteractiveFlowAborted",e.invalidArgument="InvalidArgument",e.invalidGrant="InvalidGrant",e.invalidResourceUrl="InvalidResourceUrl",e.invalidRibbonDefinition="InvalidRibbonDefinition",e.objectNotFound="ObjectNotFound",e.resourceNotSupported="ResourceNotSupported",e.serverError="ServerError",e.serviceUrlNotFound="ServiceUrlNotFound",e.sharedRuntimeNotAvailable="SharedRuntimeNotAvailable",e.ticketInvalidParams="TicketInvalidParams",e.ticketNetworkError="TicketNetworkError",e.ticketUnauthorized="TicketUnauthorized",e.ticketUninitialized="TicketUninitialized",e.ticketUnknownError="TicketUnknownError",e.unexpectedError="UnexpectedError",e.unsupportedUserIdentity="UnsupportedUserIdentity",e.userNotSignedIn="UserNotSignedIn"}(e.ErrorCodes||(e.ErrorCodes={})),e.Interfaces||(e.Interfaces={})}(OfficeCore||(OfficeCore={})),function(e){var t,n;!function(e){e.hidden="Hidden",e.taskpane="Taskpane"}(t=e.VisibilityMode||(e.VisibilityMode={})),function(e){e.none="None",e.load="Load"}(n=e.StartupBehavior||(e.StartupBehavior={})),function(e){function i(e){var t=new OfficeCore.RequestContext;return t._requestFlagModifier|=64,e&&(t._customData="WacPartition"),t}function o(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return t=i(!0),OfficeCore.AppRuntimeService.newObject(t).setAppRuntimeState(e),[4,t.sync()];case 1:return n.sent(),[2]}}))}))}var r;function a(e){return e===OfficeCore.Visibility.visible?t.taskpane:t.hidden}e.setStartupBehavior=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o;return __generator(this,(function(r){switch(r.label){case 0:if(e!==n.load&&e!==n.none)throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument,null,null);return t=e==n.load?OfficeCore.AppRuntimeState.background:OfficeCore.AppRuntimeState.inactive,o=i(!1),OfficeCore.AppRuntimePersistenceService.newObject(o).setAppRuntimeStartState(t),[4,o.sync()];case 1:return r.sent(),[2]}}))}))},e.getStartupBehavior=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,r;return __generator(this,(function(a){switch(a.label){case 0:return e=i(!1),t=OfficeCore.AppRuntimePersistenceService.newObject(e),o=t.getAppRuntimeStartState(),[4,e.sync()];case 1:return a.sent(),r=o.value,[2,r==OfficeCore.AppRuntimeState.inactive?n.none:n.load]}}))}))},e._getState=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(o){switch(o.label){case 0:return e=i(!0),t=OfficeCore.AppRuntimeService.newObject(e),n=t.getAppRuntimeState(),[4,e.sync()];case 1:return o.sent(),[2,n.value]}}))}))},e.showAsTaskpane=function(){return o(OfficeCore.AppRuntimeState.visible)},e.hide=function(){return o(OfficeCore.AppRuntimeState.background)},e.onVisibilityModeChanged=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,o=this;return __generator(this,(function(s){switch(s.label){case 0:return t=function(){if(!r){var e=i(!0);r=OfficeCore.AppRuntimeService.newObject(e)}return r}(),n=t.onVisibilityChanged.add((function(t){if(e){var n={visibilityMode:a(t.visibility)};e(n)}return null})),[4,t.context.sync()];case 1:return s.sent(),[2,function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return n.remove(),[4,t.context.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))}}(e.addin||(e.addin={}))}(Office||(Office={})),function(e){!function(e){function t(){var e=new OfficeCore.RequestContext;return"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(e._customData="WacPartition"),e}e.requestUpdate=function(e){var n=t(),i=n.ribbon;function o(e){void 0!==e.controls&&void 0!==e.controls.length&&e.controls.length&&e.controls.filter((function(e){return!!e.id})).forEach((function(e){var t=i.getButton(e.id);void 0!==e.enabled&&null!==e.enabled&&(t.enabled=e.enabled)}))}return e.tabs.filter((function(e){return!!e.id})).forEach((function(e){var t=i.getTab(e.id);void 0!==e.visible&&null!==e.visible&&t.setVisibility(e.visible),e.groups&&e.groups.length?e.groups.filter((function(e){return!!e.id})).forEach((function(e){o(e)})):o(e)})),n.sync()},e.requestCreateControls=function(e){var n=t();return n.ribbon.executeRequestCreate(JSON.stringify(e)),function(e){return new Promise((function(t,n){return setTimeout((function(){return t()}),e)}))}(250).then((function(){return n.sync()}))}}(e.ribbon||(e.ribbon={}))}(Office||(Office={})),function(e){var t;OfficeExtension.BatchApiHelper.createPropertyObject,OfficeExtension.BatchApiHelper.createMethodObject,OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject,OfficeExtension.BatchApiHelper.createTopLevelServiceObject,OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod,OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined,OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson,OfficeExtension.Utility.fixObjectPathIfNecessary,OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult,OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags;!function(e){e.generalException="GeneralException"}(t||(t={}));new OfficeExtension.LibraryBuilder({metadata:{version:"1.0.0",name:"OfficeCore",defaultApiSetName:"OfficeSharedApi",hostName:"Office",apiSets:[],strings:["AddinInternalService"],enumTypes:[],clientObjectTypes:[[1,0,0,0,[["notifyActionHandlerReady",0,2,0,4]],0,0,0,0,"Microsoft.InternalService.AddinInternalService",4]]},targetNamespaceObject:e})}(OfficeCore||(OfficeCore={})),function(e){var t;!function(t){var n,i=OfficeExtension.Utility.isNullOrUndefined;function o(e){if(e){var t=e.toUpperCase(),o=n.mappings[t];if(!i(o)&&"function"===typeof o)return o}throw OfficeExtension.Utility.createRuntimeError("invalidOperation","sourceData","ActionProxy._getFunction")}function r(e){try{OfficeExtension.Utility.log("ActionProxy._handleMessage"),OfficeExtension.Utility.checkArgumentNull(e,"args");for(var t=e.entries,n=0;n<t.length;n++)if(2===t[n].messageCategory)if("string"===typeof t[n].message&&(t[n].message=JSON.parse(t[n].message)),1e3===t[n].messageType){var i=null,r=o(t[n].message[0]);if(t[n].message.length>=2){var s=t[n].message[1];s&&(i=a(s)?JSON.parse(s):s)}"undefined"!==typeof OSF&&OSF.AppTelemetry&&OSF.AppTelemetry.CallOnAppActivatedIfPending&&OSF.AppTelemetry.CallOnAppActivatedIfPending(),r.apply(null,[i])}else OfficeExtension.Utility.log("ActionProxy._handleMessage unknown message type "+t[n].messageType)}catch(e){throw function(e){var t=function(e){var t="Unknown Error";if(e)try{e.toString&&(t=e.toString()),t=t+" "+JSON.stringify(e)}catch(e){t="Unexpected Error"}return t}(e);OfficeExtension.Utility.log(t)}(e),e}return OfficeExtension.Utility._createPromiseFromResult(null)}function a(e){return"string"===typeof e&&"{"===e[0]}function s(){try{Microsoft.Office.WebExtension.onReadyInternal().then((function(){return function(){if("undefined"!==typeof OSF&&OSF.DDA&&OSF.DDA.RichApi&&OSF.DDA.RichApi.richApiMessageManager)return(new OfficeExtension.ClientRequestContext).eventRegistration.register(5,"",r)}()})).then((function(){var e=OSF._OfficeAppFactory.getHostInfo();return"web"===e.hostPlatform&&"word"!==e.hostType&&"excel"!==e.hostType?void 0:function(){var e=new OfficeExtension.ClientRequestContext,t=OfficeCore.AddinInternalService.newObject(e);return e._customData="WacPartition",t.notifyActionHandlerReady(),e.sync()}()}))}catch(e){}}!function(){OfficeExtension.Utility.log("ActionProxy.initOnce"),"undefined"!=typeof e.actions&&function(e){n=e}(e.actions._association),"undefined"!==typeof document&&(document.readyState&&"loading"!==document.readyState?(OfficeExtension.Utility.log("ActionProxy.initOnce: document.readyState is not loading state"),s()):document.addEventListener&&document.addEventListener("DOMContentLoaded",(function(){OfficeExtension.Utility.log("ActionProxy.initOnce: DOMContentLoaded event triggered"),s()}))),OfficeExtension.HostBridge.onInited((function(e){!function(e){e.addHostMessageHandler((function(e){3===e.type&&r(e.message)}))}(e)}))}()}(t||(t={}))}(Office||(Office={})),function(e){!function(e){e.close=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return e=new OfficeCore.RequestContext,OfficeCore.DialogPage.newObject(e).close(),[4,e.sync()];case 1:return t.sent(),[2]}}))}))},e.readyToShow=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return e=new OfficeCore.RequestContext,OfficeCore.DialogPage.newObject(e).readyToShow(),[4,e.sync()];case 1:return t.sent(),[2]}}))}))},e.onShow=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,i;return __generator(this,(function(o){switch(o.label){case 0:return t=new OfficeCore.RequestContext,(n=OfficeCore.DialogPage.newObject(t)).onOnShowEvent.add(e),i=function(){return n.onOnShowEvent.remove(e),null},[4,t.sync()];case 1:return o.sent(),[2,i]}}))}))},e.sendMessageToHost=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return t=new OfficeCore.RequestContext,OfficeCore.DialogPage.newObject(t).sendMessageToHost(e),[4,t.sync()];case 1:return n.sent(),[2]}}))}))}}(e.dialogPage||(e.dialogPage={}))}(Office||(Office={}));var Visio;__extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();!function(e){var t=OfficeExtension.BatchApiHelper.createPropertyObject,n=OfficeExtension.BatchApiHelper.createMethodObject,i=OfficeExtension.BatchApiHelper.createIndexerObject,o=(OfficeExtension.BatchApiHelper.createRootServiceObject,OfficeExtension.BatchApiHelper.createTopLevelServiceObject,OfficeExtension.BatchApiHelper.createChildItemObject),r=OfficeExtension.BatchApiHelper.invokeMethod,a=OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,s=OfficeExtension.BatchApiHelper.invokeSetProperty,c=OfficeExtension.Utility.isNullOrUndefined,l=OfficeExtension.Utility.isUndefined,u=OfficeExtension.Utility.throwIfNotLoaded,d=(OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load),f=OfficeExtension.Utility.retrieve,p=OfficeExtension.Utility.toJson,h=OfficeExtension.Utility.fixObjectPathIfNecessary,m=OfficeExtension.Utility._handleNavigationPropertyResults,g=(OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),y=OfficeExtension.Utility.setMockData,O=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return __extends(i,n),Object.defineProperty(i.prototype,"_className",{get:function(){return"Application"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyNames",{get:function(){return["name","userName","isVisible"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyOriginalNames",{get:function(){return["Name","UserName","IsVisible"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyUpdateable",{get:function(){return[!1,!0,!0]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_navigationPropertyNames",{get:function(){return["activeDocument","activePage","documents"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"activeDocument",{get:function(){return this._A||(this._A=t(e.Document,this,"ActiveDocument",!1,4)),this._A},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"activePage",{get:function(){return this._Ac||(this._Ac=t(e.Page,this,"ActivePage",!1,4)),this._Ac},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"documents",{get:function(){return this._D||(this._D=t(e.DocumentCollection,this,"Documents",!0,4)),this._D},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isVisible",{get:function(){return u("isVisible",this._I,"Application",this._isNull),this._I},set:function(e){this._I=e,s(this,"IsVisible",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"name",{get:function(){return u("name",this._N,"Application",this._isNull),this._N},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"userName",{get:function(){return u("userName",this._U,"Application",this._isNull),this._U},set:function(e){this._U=e,s(this,"UserName",e,0)},enumerable:!0,configurable:!0}),i.prototype.set=function(e,t){this._recursivelySet(e,t,["userName","isVisible"],["activeDocument","activePage"],["documents"])},i.prototype.update=function(e){this._recursivelyUpdate(e)},i.prototype.getStencilInfo=function(e,t){return r(this,"GetStencilInfo",1,[e,t],4,0)},i.prototype._handleResult=function(e){if(n.prototype._handleResult.call(this,e),!c(e)){var t=e;h(this,t),l(t.IsVisible)||(this._I=t.IsVisible),l(t.Name)||(this._N=t.Name),l(t.UserName)||(this._U=t.UserName),m(this,t,["activeDocument","ActiveDocument","activePage","ActivePage","documents","Documents"])}},i.prototype.load=function(e){return d(this,e)},i.prototype.retrieve=function(e){return f(this,e)},i.prototype._handleRetrieveResult=function(e,t){n.prototype._handleRetrieveResult.call(this,e,t),g(this,e,t)},i.prototype.toJSON=function(){return p(this,{isVisible:this._I,name:this._N,userName:this._U},{activeDocument:this._A,activePage:this._Ac,documents:this._D})},i.prototype.setMockData=function(e){y(this,e)},i.prototype.ensureUnchanged=function(e){a(this,e)},i}(OfficeExtension.ClientObject);e.Application=O;var v=function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return __extends(o,i),Object.defineProperty(o.prototype,"_className",{get:function(){return"Document"},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_scalarPropertyNames",{get:function(){return["description","fullName","id","index","name"]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_scalarPropertyOriginalNames",{get:function(){return["Description","FullName","ID","Index","Name"]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_scalarPropertyUpdateable",{get:function(){return[!0,!1,!1,!1,!1]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_navigationPropertyNames",{get:function(){return["application","pages"]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"application",{get:function(){return this._A||(this._A=t(e.Application,this,"Application",!1,4)),this._A},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"pages",{get:function(){return this._P||(this._P=t(e.PageCollection,this,"Pages",!0,4)),this._P},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"description",{get:function(){return u("description",this._D,"Document",this._isNull),this._D},set:function(e){this._D=e,s(this,"Description",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"fullName",{get:function(){return u("fullName",this._F,"Document",this._isNull),this._F},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"id",{get:function(){return u("id",this._I,"Document",this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"index",{get:function(){return u("index",this._In,"Document",this._isNull),this._In},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"name",{get:function(){return u("name",this._N,"Document",this._isNull),this._N},enumerable:!0,configurable:!0}),o.prototype.set=function(e,t){this._recursivelySet(e,t,["description"],["application"],["pages"])},o.prototype.update=function(e){this._recursivelyUpdate(e)},o.prototype.close=function(){r(this,"Close",1,[],4,0)},o.prototype.getActivePage=function(){return n(e.Page,this,"GetActivePage",1,[],!1,!1,null,4)},o.prototype.setActivePage=function(e){r(this,"SetActivePage",1,[e],4,0)},o.prototype.showTaskPane=function(e,t,n){r(this,"ShowTaskPane",1,[e,t,n],4,0)},o.prototype._RegisterDataVisualizerDiagramOperationCompletedEvent=function(){r(this,"_RegisterDataVisualizerDiagramOperationCompletedEvent",0,[],0,0)},o.prototype._RegisterSelectionChangedEvent=function(){r(this,"_RegisterSelectionChangedEvent",0,[],0,0)},o.prototype._RegisterShapeAddedEvent=function(){r(this,"_RegisterShapeAddedEvent",0,[],0,0)},o.prototype._UnregisterDataVisualizerDiagramOperationCompletedEvent=function(){r(this,"_UnregisterDataVisualizerDiagramOperationCompletedEvent",0,[],0,0)},o.prototype._UnregisterSelectionChangedEvent=function(){r(this,"_UnregisterSelectionChangedEvent",0,[],0,0)},o.prototype._UnregisterShapeAddedEvent=function(){r(this,"_UnregisterShapeAddedEvent",0,[],0,0)},o.prototype._handleResult=function(e){if(i.prototype._handleResult.call(this,e),!c(e)){var t=e;h(this,t),l(t.Description)||(this._D=t.Description),l(t.FullName)||(this._F=t.FullName),l(t.ID)||(this._I=t.ID),l(t.Index)||(this._In=t.Index),l(t.Name)||(this._N=t.Name),m(this,t,["application","Application","pages","Pages"])}},o.prototype.load=function(e){return d(this,e)},o.prototype.retrieve=function(e){return f(this,e)},o.prototype._handleRetrieveResult=function(e,t){i.prototype._handleRetrieveResult.call(this,e,t),g(this,e,t)},Object.defineProperty(o.prototype,"onDataVisualizerDiagramOperationCompleted",{get:function(){var e=this;return this.m_dataVisualizerDiagramOperationCompleted||(this.m_dataVisualizerDiagramOperationCompleted=new OfficeExtension.GenericEventHandlers(this.context,this,"DataVisualizerDiagramOperationCompleted",{eventType:3,registerFunc:function(){e._RegisterDataVisualizerDiagramOperationCompletedEvent()},unregisterFunc:function(){e._UnregisterDataVisualizerDiagramOperationCompletedEvent()},getTargetIdFunc:function(){return""},eventArgsTransformFunc:function(e){var t={dataValidationErrors:e.dataValidationErrors,diagramID:e.diagramId,operationType:e.operationType,pageID:e.pageId,resultMessage:e.resultMessage,resultTitle:e.resultTitle,resultType:e.resultType,tabularData:e.tabularData};return OfficeExtension.Utility._createPromiseFromResult(t)}})),this.m_dataVisualizerDiagramOperationCompleted},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"onSelectionChanged",{get:function(){var e=this;return this.m_selectionChanged||(this.m_selectionChanged=new OfficeExtension.GenericEventHandlers(this.context,this,"SelectionChanged",{eventType:2,registerFunc:function(){e._RegisterSelectionChangedEvent()},unregisterFunc:function(){e._UnregisterSelectionChangedEvent()},getTargetIdFunc:function(){return""},eventArgsTransformFunc:function(e){var t={pageID:e.pageID,shapeIDs:e.shapeIDs};return OfficeExtension.Utility._createPromiseFromResult(t)}})),this.m_selectionChanged},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"onShapeAdded",{get:function(){var e=this;return this.m_shapeAdded||(this.m_shapeAdded=new OfficeExtension.EventHandlers(this.context,this,"ShapeAdded",{registerFunc:function(t){return e.context.eventRegistration.register(1,"",t)},unregisterFunc:function(t){return e.context.eventRegistration.unregister(1,"",t)},eventArgsTransformFunc:function(e){return OfficeExtension.Utility._createPromiseFromResult(e.ddaBinding.Object)}})),this.m_shapeAdded},enumerable:!0,configurable:!0}),o.prototype.toJSON=function(){return p(this,{description:this._D,fullName:this._F,id:this._I,index:this._In,name:this._N},{application:this._A,pages:this._P})},o.prototype.setMockData=function(e){y(this,e)},o.prototype.ensureUnchanged=function(e){a(this,e)},o}(OfficeExtension.ClientObject);e.Document=v;var b=function(t){function a(){return null!==t&&t.apply(this,arguments)||this}return __extends(a,t),Object.defineProperty(a.prototype,"_className",{get:function(){return"DocumentCollection"},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"_isCollection",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"items",{get:function(){return u("items",this.m__items,"DocumentCollection",this._isNull),this.m__items},enumerable:!0,configurable:!0}),a.prototype.add=function(t){return n(e.Document,this,"Add",1,[t],!1,!0,null,4)},a.prototype.getCount=function(){return r(this,"GetCount",1,[],4,0)},a.prototype.getItem=function(t){return i(e.Document,this,[t])},a.prototype.getItemOrNullObject=function(t){return n(e.Document,this,"GetItemOrNullObject",1,[t],!1,!1,null,4)},a.prototype._handleResult=function(n){if(t.prototype._handleResult.call(this,n),!c(n)){var i=n;if(h(this,i),!c(i[OfficeExtension.Constants.items])){this.m__items=[];for(var r=i[OfficeExtension.Constants.items],a=0;a<r.length;a++){var s=o(e.Document,!0,this,r[a],a);s._handleResult(r[a]),this.m__items.push(s)}}}},a.prototype.load=function(e){return d(this,e)},a.prototype.retrieve=function(e){return f(this,e)},a.prototype._handleRetrieveResult=function(n,i){var r=this;t.prototype._handleRetrieveResult.call(this,n,i),g(this,n,i,(function(t,n){return o(e.Document,!0,r,t,n)}))},a.prototype.toJSON=function(){return p(this,{},{},this.m__items)},a.prototype.setMockData=function(t){var n=this;y(this,t,(function(t,i){return o(e.Document,!0,n,t,i)}),(function(e){return n.m__items=e}))},a}(OfficeExtension.ClientObject);e.DocumentCollection=b;var _=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return __extends(i,n),Object.defineProperty(i.prototype,"_className",{get:function(){return"Page"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyNames",{get:function(){return["index","name","id"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyOriginalNames",{get:function(){return["Index","Name","ID"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_navigationPropertyNames",{get:function(){return["shapes","application","document","dataVisualizerDiagrams"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"application",{get:function(){return this._A||(this._A=t(e.Application,this,"Application",!1,4)),this._A},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"dataVisualizerDiagrams",{get:function(){return this._D||(this._D=t(e.DataVisualizerDiagramCollection,this,"DataVisualizerDiagrams",!0,4)),this._D},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"document",{get:function(){return this._Do||(this._Do=t(e.Document,this,"Document",!1,4)),this._Do},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"shapes",{get:function(){return this._S||(this._S=t(e.ShapeCollection,this,"Shapes",!0,4)),this._S},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"id",{get:function(){return u("id",this._I,"Page",this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"index",{get:function(){return u("index",this._In,"Page",this._isNull),this._In},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"name",{get:function(){return u("name",this._N,"Page",this._isNull),this._N},enumerable:!0,configurable:!0}),i.prototype.set=function(e,t){this._recursivelySet(e,t,[],["application","document"],["dataVisualizerDiagrams","shapes"])},i.prototype.update=function(e){this._recursivelyUpdate(e)},i.prototype.boundingBox=function(e,t,n,i,o){r(this,"BoundingBox",1,[e,t,n,i,o],4,0)},i.prototype._handleResult=function(e){if(n.prototype._handleResult.call(this,e),!c(e)){var t=e;h(this,t),l(t.ID)||(this._I=t.ID),l(t.Index)||(this._In=t.Index),l(t.Name)||(this._N=t.Name),m(this,t,["application","Application","dataVisualizerDiagrams","DataVisualizerDiagrams","document","Document","shapes","Shapes"])}},i.prototype.load=function(e){return d(this,e)},i.prototype.retrieve=function(e){return f(this,e)},i.prototype._handleRetrieveResult=function(e,t){n.prototype._handleRetrieveResult.call(this,e,t),g(this,e,t)},i.prototype.toJSON=function(){return p(this,{id:this._I,index:this._In,name:this._N},{application:this._A,dataVisualizerDiagrams:this._D,document:this._Do,shapes:this._S})},i.prototype.setMockData=function(e){y(this,e)},i.prototype.ensureUnchanged=function(e){a(this,e)},i}(OfficeExtension.ClientObject);e.Page=_;var S=function(t){function a(){return null!==t&&t.apply(this,arguments)||this}return __extends(a,t),Object.defineProperty(a.prototype,"_className",{get:function(){return"PageCollection"},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"_isCollection",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"items",{get:function(){return u("items",this.m__items,"PageCollection",this._isNull),this.m__items},enumerable:!0,configurable:!0}),a.prototype.add=function(t){return n(e.Page,this,"Add",1,[t],!1,!0,null,4)},a.prototype.getCount=function(){return r(this,"GetCount",1,[],4,0)},a.prototype.getItem=function(t){return i(e.Page,this,[t])},a.prototype.getItemOrNullObject=function(t){return n(e.Page,this,"GetItemOrNullObject",1,[t],!1,!1,null,4)},a.prototype._handleResult=function(n){if(t.prototype._handleResult.call(this,n),!c(n)){var i=n;if(h(this,i),!c(i[OfficeExtension.Constants.items])){this.m__items=[];for(var r=i[OfficeExtension.Constants.items],a=0;a<r.length;a++){var s=o(e.Page,!0,this,r[a],a);s._handleResult(r[a]),this.m__items.push(s)}}}},a.prototype.load=function(e){return d(this,e)},a.prototype.retrieve=function(e){return f(this,e)},a.prototype._handleRetrieveResult=function(n,i){var r=this;t.prototype._handleRetrieveResult.call(this,n,i),g(this,n,i,(function(t,n){return o(e.Page,!0,r,t,n)}))},a.prototype.toJSON=function(){return p(this,{},{},this.m__items)},a.prototype.setMockData=function(t){var n=this;y(this,t,(function(t,i){return o(e.Page,!0,n,t,i)}),(function(e){return n.m__items=e}))},a}(OfficeExtension.ClientObject);e.PageCollection=S;var A=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return __extends(i,n),Object.defineProperty(i.prototype,"_className",{get:function(){return"Shape"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyNames",{get:function(){return["name","id","text","isCallout","isDataGraphicCallout","isOpenForTextEdit","objType","isBoundToData"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyOriginalNames",{get:function(){return["Name","Id","Text","IsCallout","IsDataGraphicCallout","IsOpenForTextEdit","ObjType","IsBoundToData"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_navigationPropertyNames",{get:function(){return["application","document"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"application",{get:function(){return this._A||(this._A=t(e.Application,this,"Application",!1,4)),this._A},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"document",{get:function(){return this._D||(this._D=t(e.Document,this,"Document",!1,4)),this._D},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"id",{get:function(){return u("id",this._I,"Shape",this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isBoundToData",{get:function(){return u("isBoundToData",this._Is,"Shape",this._isNull),this._Is},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isCallout",{get:function(){return u("isCallout",this._IsC,"Shape",this._isNull),this._IsC},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isDataGraphicCallout",{get:function(){return u("isDataGraphicCallout",this._IsD,"Shape",this._isNull),this._IsD},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isOpenForTextEdit",{get:function(){return u("isOpenForTextEdit",this._IsO,"Shape",this._isNull),this._IsO},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"name",{get:function(){return u("name",this._N,"Shape",this._isNull),this._N},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"objType",{get:function(){return u("objType",this._O,"Shape",this._isNull),this._O},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"text",{get:function(){return u("text",this._T,"Shape",this._isNull),this._T},enumerable:!0,configurable:!0}),i.prototype.set=function(e,t){this._recursivelySet(e,t,[],["application","document"],[])},i.prototype.update=function(e){this._recursivelyUpdate(e)},i.prototype.boundingBox=function(e,t,n,i,o){r(this,"BoundingBox",1,[e,t,n,i,o],4,0)},i.prototype._handleResult=function(e){if(n.prototype._handleResult.call(this,e),!c(e)){var t=e;h(this,t),l(t.Id)||(this._I=t.Id),l(t.IsBoundToData)||(this._Is=t.IsBoundToData),l(t.IsCallout)||(this._IsC=t.IsCallout),l(t.IsDataGraphicCallout)||(this._IsD=t.IsDataGraphicCallout),l(t.IsOpenForTextEdit)||(this._IsO=t.IsOpenForTextEdit),l(t.Name)||(this._N=t.Name),l(t.ObjType)||(this._O=t.ObjType),l(t.Text)||(this._T=t.Text),m(this,t,["application","Application","document","Document"])}},i.prototype.load=function(e){return d(this,e)},i.prototype.retrieve=function(e){return f(this,e)},i.prototype._handleIdResult=function(e){n.prototype._handleIdResult.call(this,e),c(e)||l(e.Id)||(this._I=e.Id)},i.prototype._handleRetrieveResult=function(e,t){n.prototype._handleRetrieveResult.call(this,e,t),g(this,e,t)},i.prototype.toJSON=function(){return p(this,{id:this._I,isBoundToData:this._Is,isCallout:this._IsC,isDataGraphicCallout:this._IsD,isOpenForTextEdit:this._IsO,name:this._N,objType:this._O,text:this._T},{application:this._A,document:this._D})},i.prototype.setMockData=function(e){y(this,e)},i.prototype.ensureUnchanged=function(e){a(this,e)},i}(OfficeExtension.ClientObject);e.Shape=A;var D=function(t){function a(){return null!==t&&t.apply(this,arguments)||this}return __extends(a,t),Object.defineProperty(a.prototype,"_className",{get:function(){return"ShapeCollection"},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"_isCollection",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"items",{get:function(){return u("items",this.m__items,"ShapeCollection",this._isNull),this.m__items},enumerable:!0,configurable:!0}),a.prototype.add=function(t){return n(e.Shape,this,"Add",1,[t],!1,!0,null,4)},a.prototype.getCount=function(){return r(this,"GetCount",1,[],4,0)},a.prototype.getItem=function(t){return i(e.Shape,this,[t])},a.prototype.getItemOrNullObject=function(t){return n(e.Shape,this,"GetItemOrNullObject",1,[t],!1,!1,null,4)},a.prototype._handleResult=function(n){if(t.prototype._handleResult.call(this,n),!c(n)){var i=n;if(h(this,i),!c(i[OfficeExtension.Constants.items])){this.m__items=[];for(var r=i[OfficeExtension.Constants.items],a=0;a<r.length;a++){var s=o(e.Shape,!0,this,r[a],a);s._handleResult(r[a]),this.m__items.push(s)}}}},a.prototype.load=function(e){return d(this,e)},a.prototype.retrieve=function(e){return f(this,e)},a.prototype._handleRetrieveResult=function(n,i){var r=this;t.prototype._handleRetrieveResult.call(this,n,i),g(this,n,i,(function(t,n){return o(e.Shape,!0,r,t,n)}))},a.prototype.toJSON=function(){return p(this,{},{},this.m__items)},a.prototype.setMockData=function(t){var n=this;y(this,t,(function(t,i){return o(e.Shape,!0,n,t,i)}),(function(e){return n.m__items=e}))},a}(OfficeExtension.ClientObject);e.ShapeCollection=D;var C=function(t){function a(){return null!==t&&t.apply(this,arguments)||this}return __extends(a,t),Object.defineProperty(a.prototype,"_className",{get:function(){return"DataVisualizerDiagramCollection"},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"_isCollection",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"items",{get:function(){return u("items",this.m__items,"DataVisualizerDiagramCollection",this._isNull),this.m__items},enumerable:!0,configurable:!0}),a.prototype.add=function(t,i){return n(e.DataVisualizerDiagram,this,"Add",1,[t,i],!1,!0,null,4)},a.prototype.addPreferred=function(t,i){return n(e.DataVisualizerDiagram,this,"AddPreferred",0,[t,i],!1,!1,null,0)},a.prototype.getCount=function(){return r(this,"GetCount",1,[],4,0)},a.prototype.getItem=function(t){return i(e.DataVisualizerDiagram,this,[t])},a.prototype.getItemAt=function(t){return n(e.DataVisualizerDiagram,this,"GetItemAt",1,[t],!1,!1,null,4)},a.prototype.getItemOrNullObject=function(t){return n(e.DataVisualizerDiagram,this,"GetItemOrNullObject",1,[t],!1,!1,null,4)},a.prototype._handleResult=function(n){if(t.prototype._handleResult.call(this,n),!c(n)){var i=n;if(h(this,i),!c(i[OfficeExtension.Constants.items])){this.m__items=[];for(var r=i[OfficeExtension.Constants.items],a=0;a<r.length;a++){var s=o(e.DataVisualizerDiagram,!0,this,r[a],a);s._handleResult(r[a]),this.m__items.push(s)}}}},a.prototype.load=function(e){return d(this,e)},a.prototype.retrieve=function(e){return f(this,e)},a.prototype._handleRetrieveResult=function(n,i){var r=this;t.prototype._handleRetrieveResult.call(this,n,i),g(this,n,i,(function(t,n){return o(e.DataVisualizerDiagram,!0,r,t,n)}))},a.prototype.toJSON=function(){return p(this,{},{},this.m__items)},a.prototype.setMockData=function(t){var n=this;y(this,t,(function(t,i){return o(e.DataVisualizerDiagram,!0,n,t,i)}),(function(e){return n.m__items=e}))},a}(OfficeExtension.ClientObject);e.DataVisualizerDiagramCollection=C;var P=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return __extends(i,n),Object.defineProperty(i.prototype,"_className",{get:function(){return"DataVisualizerDiagram"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyNames",{get:function(){return["id","mappings","type","dataHeaders"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_scalarPropertyOriginalNames",{get:function(){return["ID","Mappings","Type","DataHeaders"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_navigationPropertyNames",{get:function(){return["page"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"page",{get:function(){return this._P||(this._P=t(e.Page,this,"Page",!1,4)),this._P},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"dataHeaders",{get:function(){return u("dataHeaders",this._D,"DataVisualizerDiagram",this._isNull),this._D},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"id",{get:function(){return u("id",this._I,"DataVisualizerDiagram",this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"mappings",{get:function(){return u("mappings",this._M,"DataVisualizerDiagram",this._isNull),this._M},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"type",{get:function(){return u("type",this._T,"DataVisualizerDiagram",this._isNull),this._T},enumerable:!0,configurable:!0}),i.prototype.set=function(e,t){this._recursivelySet(e,t,[],["page"],[])},i.prototype.delete=function(){r(this,"Delete",1,[],4,0)},i.prototype.getDataColumnValuesAsString=function(e){return r(this,"GetDataColumnValuesAsString",1,[e],4,0)},i.prototype.setConnection=function(e){r(this,"SetConnection",1,[e],4,0)},i.prototype.update=function(e,t,n){r(this,"Update",1,[e,t,n],4,0)},i.prototype.updateMappings=function(e){r(this,"UpdateMappings",1,[e],4,0)},i.prototype._handleResult=function(e){if(n.prototype._handleResult.call(this,e),!c(e)){var t=e;h(this,t),l(t.DataHeaders)||(this._D=t.DataHeaders),l(t.ID)||(this._I=t.ID),l(t.Mappings)||(this._M=t.Mappings),l(t.Type)||(this._T=t.Type),m(this,t,["page","Page"])}},i.prototype.load=function(e){return d(this,e)},i.prototype.retrieve=function(e){return f(this,e)},i.prototype._handleRetrieveResult=function(e,t){n.prototype._handleRetrieveResult.call(this,e,t),g(this,e,t)},i.prototype.toJSON=function(){return p(this,{dataHeaders:this._D,id:this._I,mappings:this._M,type:this._T},{page:this._P})},i.prototype.setMockData=function(e){y(this,e)},i.prototype.ensureUnchanged=function(e){a(this,e)},i}(OfficeExtension.ClientObject);e.DataVisualizerDiagram=P,function(e){e.shapeAdded="ShapeAdded",e.selectionChanged="SelectionChanged",e.dataVisualizerDiagramOperationCompleted="DataVisualizerDiagramOperationCompleted"}(e.EventType||(e.EventType={})),function(e){e.none="None",e.dataVisualizerProcessMappings="DataVisualizerProcessMappings",e.dataVisualizerOrgChartMappings="DataVisualizerOrgChartMappings"}(e.TaskPaneType||(e.TaskPaneType={})),function(e){e.success="Success",e.unexpected="Unexpected",e.validationError="ValidationError",e.conflictError="ConflictError"}(e.DataVisualizerDiagramResultType||(e.DataVisualizerDiagramResultType={})),function(e){e.unknown="Unknown",e.create="Create",e.updateMappings="UpdateMappings",e.updateData="UpdateData",e.update="Update",e.delete="Delete"}(e.DataVisualizerDiagramOperationType||(e.DataVisualizerDiagramOperationType={})),function(e){e.unknown="Unknown",e.basicFlowchart="BasicFlowchart",e.crossFunctionalFlowchart_Horizontal="CrossFunctionalFlowchart_Horizontal",e.crossFunctionalFlowchart_Vertical="CrossFunctionalFlowchart_Vertical",e.audit="Audit",e.orgChart="OrgChart",e.network="Network"}(e.DataVisualizerDiagramType||(e.DataVisualizerDiagramType={})),function(e){e.unknown="Unknown",e.string="String",e.number="Number",e.date="Date",e.currency="Currency"}(e.ColumnType||(e.ColumnType={})),function(e){e.unknown="Unknown",e.excel="Excel"}(e.DataSourceType||(e.DataSourceType={})),function(e){e.horizontal="Horizontal",e.vertical="Vertical"}(e.CrossFunctionalFlowchartOrientation||(e.CrossFunctionalFlowchartOrientation={})),function(e){e.unknown="Unknown",e.pageDefault="PageDefault",e.flowchart_TopToBottom="Flowchart_TopToBottom",e.flowchart_LeftToRight="Flowchart_LeftToRight",e.radial="Radial",e.flowchart_BottomToTop="Flowchart_BottomToTop",e.flowchart_RightToLeft="Flowchart_RightToLeft",e.circular="Circular",e.wideTree_DownThenRight="WideTree_DownThenRight",e.wideTree_RightThenDown="WideTree_RightThenDown",e.wideTree_RightThenUp="WideTree_RightThenUp",e.wideTree_UpThenRight="WideTree_UpThenRight",e.wideTree_UpThenLeft="WideTree_UpThenLeft",e.wideTree_LeftThenUp="WideTree_LeftThenUp",e.wideTree_LeftThenDown="WideTree_LeftThenDown",e.wideTree_DownThenLeft="WideTree_DownThenLeft",e.parentDefault="ParentDefault",e.hierarchy_TopToBottomLeft="Hierarchy_TopToBottomLeft",e.hierarchy_TopToBottomCenter="Hierarchy_TopToBottomCenter",e.hierarchy_TopToBottomRight="Hierarchy_TopToBottomRight",e.hierarchy_BottomToTopLeft="Hierarchy_BottomToTopLeft",e.hierarchy_BottomToTopCenter="Hierarchy_BottomToTopCenter",e.hierarchy_BottomToTopRight="Hierarchy_BottomToTopRight",e.hierarchy_LeftToRightTop="Hierarchy_LeftToRightTop",e.hierarchy_LeftToRightMiddle="Hierarchy_LeftToRightMiddle",e.hierarchy_LeftToRightBottom="Hierarchy_LeftToRightBottom",e.hierarchy_RightToLeftTop="Hierarchy_RightToLeftTop",e.hierarchy_RightToLeftMiddle="Hierarchy_RightToLeftMiddle",e.hierarchy_RightToLeftBottom="Hierarchy_RightToLeftBottom",e.orgChart_HorizontalCenter="OrgChart_HorizontalCenter",e.orgChart_HorizontalCenter_LeftToRight="OrgChart_HorizontalCenter_LeftToRight",e.orgChart_Hybrid_HorizontalCenter_VerticalRight="OrgChart_Hybrid_HorizontalCenter_VerticalRight",e.orgChart_SideBySide="OrgChart_SideBySide"}(e.LayoutVariant||(e.LayoutVariant={})),function(e){e.none="None",e.columnNotMapped="ColumnNotMapped",e.uniqueIdColumnError="UniqueIdColumnError",e.swimlaneColumnError="SwimlaneColumnError",e.delimiterError="DelimiterError",e.connectorColumnError="ConnectorColumnError",e.connectorColumnMappedElsewhere="ConnectorColumnMappedElsewhere",e.connectorLabelColumnMappedElsewhere="ConnectorLabelColumnMappedElsewhere",e.connectorColumnAndConnectorLabelMappedElsewhere="ConnectorColumnAndConnectorLabelMappedElsewhere"}(e.DataValidationErrorType||(e.DataValidationErrorType={})),function(e){e.fromTarget="FromTarget",e.toTarget="ToTarget"}(e.ConnectorDirection||(e.ConnectorDirection={})),function(e){e.generalException="GeneralException"}(e.ErrorCodes||(e.ErrorCodes={})),e.Interfaces||(e.Interfaces={})}(Visio||(Visio={})),function(e){var t=function(t){function n(n){var i=t.call(this,n)||this;return i.m_document=new e.Document(i,OfficeExtension.ObjectPathFactory.createGlobalObjectObjectPath(i)),i._rootObject=i.m_document,i}return __extends(n,t),Object.defineProperty(n.prototype,"document",{get:function(){return this.m_document},enumerable:!0,configurable:!0}),n}(OfficeCore.RequestContext);e.RequestContext=t,e.run=function(t,n,i){return OfficeExtension.ClientRequestContext._runBatch("Visio.run",arguments,(function(t){return new e.RequestContext(t)}))}}(Visio||(Visio={})),OSFAriaLogger.AriaLogger.EnableSendingTelemetryWithOTel=!0,OSFAriaLogger.AriaLogger.EnableSendingTelemetryWithLegacyAria=!1,OfficeExtension.Utility._doApiNotSupportedCheck=!0; |