Mini Kabibi Habibi

Current Path : C:/Program Files/Microsoft Office/root/Office16/
Upload File :
Current File : C:/Program Files/Microsoft Office/root/Office16/olk-launchevent-host.win32.bundle

/*
 * Office JavaScript API library
 *
 * Copyright (c) Microsoft Corporation.  All rights reserved.
 *
 * Your use of this file is governed by the license terms for the Microsoft Office JavaScript (Office.js) API library: https://github.com/OfficeDev/office-js/blob/release/LICENSE.md
 *
 * This file also contains the following Promise implementation (with a few small modifications):
 *      * @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
 */
var OSFPerformance,CustomFunctionMappings,CustomFunctions,Strings;!function(e){e.now=function(){return"undefined"!=typeof performance&&performance.now?performance.now():0},e.getTotalJSHeapSize=function(){return"undefined"!=typeof performance&&performance.memory?performance.memory.totalJSHeapSize:0},e.getUsedJSHeapSize=function(){return"undefined"!=typeof performance&&performance.memory?performance.memory.usedJSHeapSize:0},e.getJSHeapSizeLimit=function(){return"undefined"!=typeof performance&&performance.memory?performance.memory.jsHeapSizeLimit:0},e.officeExecuteStartDate=e.officeExecuteStartDate||Date.now(),e.officeExecuteStart=e.officeExecuteStart||0,e.officeExecuteEnd=e.officeExecuteEnd||0,e.hostInitializationStart=0,e.hostInitializationEnd=0,e.totalJSHeapSize=0,e.usedJSHeapSize=0,e.jsHeapSizeLimit=0,e.createOMEnd=0,e.hostSpecificFileName="",e.getAppContextStart=0,e.getAppContextEnd=0,e.getAppContextXdmStart=0,e.getAppContextXdmEnd=0,e.officeOnReady=0}(OSFPerformance||(OSFPerformance={})),function(e){e.definePropertyOnNamespace=function(e,t,n){Object.defineProperty(e,t,{get:function(){return n()},configurable:!0,enumerable:!0})}}(OSF||(OSF={})),OSFPerformance.hostInitializationStart=OSFPerformance.now(),function(e){!function(e){function t(){return e.m_association||(e.m_association=new OSF.Association),e.m_association}e.m_association=e.m_association,e.associate=function(){OTel&&OTel.OTelLogger&&OTel.OTelLogger.onTelemetryLoaded((function(){Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.ApiCall",dataFields:[oteljs.makeStringDataField("Api","Office.actions.associate")],eventFlags:{dataCategories:2,diagnosticLevel:110}})})),t().associate.apply(t(),arguments)},OSF.definePropertyOnNamespace(e,"_association",t)}(e.actions||(e.actions={}))}(Office||(Office={})),function(e){!function(e){e[e.Select=0]="Select",e[e.UnSelect=1]="UnSelect",e[e.CancelDialog=2]="CancelDialog",e[e.InsertAgave=3]="InsertAgave",e[e.CtrlF6In=4]="CtrlF6In",e[e.CtrlF6Exit=5]="CtrlF6Exit",e[e.CtrlF6ExitShift=6]="CtrlF6ExitShift",e[e.SelectWithError=7]="SelectWithError",e[e.NotifyHostError=8]="NotifyHostError",e[e.RefreshAddinCommands=9]="RefreshAddinCommands",e[e.PageIsReady=10]="PageIsReady",e[e.TabIn=11]="TabIn",e[e.TabInShift=12]="TabInShift",e[e.TabExit=13]="TabExit",e[e.TabExitShift=14]="TabExitShift",e[e.EscExit=15]="EscExit",e[e.F2Exit=16]="F2Exit",e[e.ExitNoFocusable=17]="ExitNoFocusable",e[e.ExitNoFocusableShift=18]="ExitNoFocusableShift",e[e.MouseEnter=19]="MouseEnter",e[e.MouseLeave=20]="MouseLeave",e[e.UpdateTargetUrl=21]="UpdateTargetUrl",e[e.InstallCustomFunctions=22]="InstallCustomFunctions",e[e.SendTelemetryEvent=23]="SendTelemetryEvent",e[e.UninstallCustomFunctions=24]="UninstallCustomFunctions",e[e.SendMessage=25]="SendMessage",e[e.LaunchExtensionComponent=26]="LaunchExtensionComponent",e[e.StopExtensionComponent=27]="StopExtensionComponent",e[e.RestartExtensionComponent=28]="RestartExtensionComponent",e[e.EnableTaskPaneHeaderButton=29]="EnableTaskPaneHeaderButton",e[e.DisableTaskPaneHeaderButton=30]="DisableTaskPaneHeaderButton",e[e.TaskPaneHeaderButtonClicked=31]="TaskPaneHeaderButtonClicked",e[e.RemoveAppCommandsAddin=32]="RemoveAppCommandsAddin",e[e.RefreshRibbonGallery=33]="RefreshRibbonGallery",e[e.GetOriginalControlId=34]="GetOriginalControlId",e[e.OfficeJsReady=35]="OfficeJsReady",e[e.InsertDevManifest=36]="InsertDevManifest",e[e.InsertDevManifestError=37]="InsertDevManifestError",e[e.SendCustomerContent=38]="SendCustomerContent",e[e.KeyboardShortcuts=39]="KeyboardShortcuts",e[e.CloseSDXDialog=42]="CloseSDXDialog",e[e.ResizeSDXDialog=43]="ResizeSDXDialog",e[e.SendNonStandardEvent=44]="SendNonStandardEvent"}(e.AgaveHostAction||(e.AgaveHostAction={}))}(OSF||(OSF={})),function(e){var t=function(){function t(){var t=this;this._processAppCommandInvocation=function(e){var n=t._verifyManifestCallback(e.callbackName);if(0==n.errorCode){var i=t._constructEventObjectForCallback(e);i?window.setTimeout((function(){n.callback(i)}),0):t._invokeAppCommandCompletedMethod(e.appCommandId,5001,"")}else t._invokeAppCommandCompletedMethod(e.appCommandId,n.errorCode,"")},this._eventDispatch=new e.EventDispatch([{type:e.EventType.AppCommandInvoked,id:e.EventDispId.dispidAppCommandInvokedEvent,getTargetId:function(){return""},fromSafeArrayHost:function(t){return{type:e.EventType.AppCommandInvoked,appCommandId:t[0],callbackName:t[1],eventObjStr:t[2]}},fromWebHost:function(t){return{type:e.EventType.AppCommandInvoked,appCommandId:t[0],callbackName:t[1],eventObjStr:t[2]}}}])}return t.prototype.initializeEventHandler=function(t){var n=this;this.addHandlerAsync(e.EventType.AppCommandInvoked,(function(e){n._processAppCommandInvocation(e)}),t)},t.prototype.appCommandInvocationCompletedAsync=function(t,n,i,r){e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(94,{fromSafeArrayHost:function(e){return e},fromWebHost:function(e){return e},toSafeArrayHost:function(){return[t,n,i]},toWebHost:function(){var e={};return e[0]=t,e[1]=n,e[2]=i,e}},r)},t.prototype.addHandlerAsync=function(t,n,i){e.EventHelper.addEventHandler(t,n,i,this._eventDispatch,void 0,e.OUtil.isPopupWindow())},t.prototype._verifyManifestCallback=function(e){var t={callback:null,errorCode:11101};e=e.trim();try{var n=this._getCallbackFunc(e);if("function"!=typeof n)return t}catch(e){return t}return{callback:n,errorCode:0}},t.prototype._getCallbackFuncFromActionAssociateTable=function(e){var t=e.toUpperCase();return Office.actions._association.mappings[t]},t.prototype._getCallbackFunc=function(e){return this._getCallbackFuncFromActionAssociateTable(e)},t.prototype._invokeAppCommandCompletedMethod=function(e,t,n){this.appCommandInvocationCompletedAsync(e,t,n,(function(e){e.status!==Office.AsyncResultStatus.Succeeded&&console.error("Failed to notify the host thta app command is completed")}))},t.prototype._constructEventObjectForCallback=function(e){var t,n,i=this;try{t=JSON.parse(e.eventObjStr),n=JSON.parse(e.eventObjStr)}catch(e){}return t||(t={}),n||(n={}),t.completed=function(t){n.completedContext=t;var r=JSON.stringify(n);i._invokeAppCommandCompletedMethod(e.appCommandId,0,r)},t},t.initialize=function(){null==t._instance&&(t._instance=new t,t._instance.initializeEventHandler((function(e){e.status!==Office.AsyncResultStatus.Succeeded&&console.error("Cannot initialize app command: "+JSON.stringify(e))})))},t._instance=null,t}();e.AppCommandManager=t}(OSF||(OSF={})),function(e){!function(e){e[e.Unsupported=0]="Unsupported",e[e.Excel=1]="Excel",e[e.Word=2]="Word",e[e.PowerPoint=4]="PowerPoint",e[e.Outlook=8]="Outlook",e[e.ExcelWebApp=16]="ExcelWebApp",e[e.WordWebApp=32]="WordWebApp",e[e.OutlookWebApp=64]="OutlookWebApp",e[e.Project=128]="Project",e[e.AccessWebApp=256]="AccessWebApp",e[e.PowerpointWebApp=512]="PowerpointWebApp",e[e.ExcelIOS=1024]="ExcelIOS",e[e.Sway=2048]="Sway",e[e.WordIOS=4096]="WordIOS",e[e.PowerPointIOS=8192]="PowerPointIOS",e[e.Access=16384]="Access",e[e.Lync=32768]="Lync",e[e.OutlookIOS=65536]="OutlookIOS",e[e.OneNoteWebApp=131072]="OneNoteWebApp",e[e.OneNote=262144]="OneNote",e[e.ExcelWinRT=524288]="ExcelWinRT",e[e.WordWinRT=1048576]="WordWinRT",e[e.PowerpointWinRT=2097152]="PowerpointWinRT",e[e.OutlookAndroid=4194304]="OutlookAndroid",e[e.OneNoteWinRT=8388608]="OneNoteWinRT",e[e.ExcelAndroid=8388609]="ExcelAndroid",e[e.VisioWebApp=8388610]="VisioWebApp",e[e.OneNoteIOS=8388611]="OneNoteIOS",e[e.WordAndroid=8388613]="WordAndroid",e[e.PowerpointAndroid=8388614]="PowerpointAndroid",e[e.Visio=8388615]="Visio",e[e.OneNoteAndroid=4194305]="OneNoteAndroid"}(e.AppName||(e.AppName={}))}(OSF||(OSF={})),function(e){var t=function(){function e(){this.m_mappings={},this.m_onchangeHandlers=[]}return e.prototype.associate=function(e,t){function n(e){"undefined"!=typeof console&&console.warn&&console.warn(e)}if(1==arguments.length&&"object"==typeof arguments[0]&&arguments[0]){var i=arguments[0];for(var r in i)this.associate(r,i[r])}else if(2==arguments.length){var o=arguments[0],a=arguments[1];if("string"!=typeof o)return void n("[InvalidArg] Function=associate");if("function"!=typeof a)return void n("[InvalidArg] Function=associate");var s=o.toUpperCase();this.m_mappings[s]&&n("[DuplicatedName] Function="+o),this.m_mappings[s]=a;for(var c=0;c<this.m_onchangeHandlers.length;c++)this.m_onchangeHandlers[c]()}else n("[InvalidArg] Function=associate")},e.prototype.onchange=function(e){e&&this.m_onchangeHandlers.push(e)},Object.defineProperty(e.prototype,"mappings",{get:function(){return this.m_mappings},enumerable:!0,configurable:!0}),e}();e.Association=t}(OSF||(OSF={})),function(e){var t=function(){function e(){}return e.prototype.invokeCallback=function(e,t,n,i,r){if(0==n){var o={status:Office.AsyncResultStatus.Succeeded,value:i,asyncContext:r};"function"==typeof t&&t(o)}else{var a={status:Office.AsyncResultStatus.Failed,error:{code:n},asyncContext:r};"function"==typeof t&&t(a)}},e}();e.AsyncMethodExecutor=t}(OSF||(OSF={})),function(e){var t=function(){function t(e){this._asyncMethodExecutor=e}return t.prototype.handleSafeArrayHostResponse=function(t,n,i,r,o,a,s){var c,l;if("number"==typeof(t=e.Utility.fromSafeArray(t))?(c=[],l=t):l=(c=t)[0],1==l)return null!=(u=c[1])&&(i[u[0]]=u[1]),!1;if(r){var u;if(0==l){if(c.length>2){u=[];for(var f=1;f<c.length;f++)u[f-1]=c[f]}else u=c[1];if(i.length>0&&null!=u){var d=u[u.length-1];i.length==d?u[u.length-1]=i:l=5001}}else u=c[1];var p=null;0==l&&(p=o.fromSafeArrayHost(u)),this._asyncMethodExecutor.invokeCallback(a,r,l,p,s)}return!0},t.prototype.handleWebHostResponse=function(e,t,n,i,r,o){var a=null;0==t&&(a=i.fromWebHost(e)),this._asyncMethodExecutor.invokeCallback(r,n,t,a,o)},t}();e.AsyncMethodExecutorHelper=t}(OSF||(OSF={})),function(e){!function(e){!function(e){!function(e){e.Context="Context",e.Value="Value",e.Status="Status",e.Error="Error"}(e.Properties||(e.Properties={})),function(e){e[e.Success=0]="Success",e[e.Failed=1]="Failed"}(e.ErrorCode||(e.ErrorCode={})),function(e){e.Name="Name",e.Message="Message",e.Code="Code"}(e.ErrorProperties||(e.ErrorProperties={}))}(e.AsyncResultEnum||(e.AsyncResultEnum={}));var t=function(e,t){this.value=e.Value,this.status=t?Office.AsyncResultStatus.Failed:Office.AsyncResultStatus.Succeeded,e.Context&&(this.asyncContext=e.Context),t&&(this.error=new n(t.Name,t.Message,t.Code))};e.AsyncResult=t;var n=function(e,t,n){this.name=e,this.message=t,this.code=n};e.Error=n}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){!function(t){t.createWebClientHostControllerHelper=function(t,n){return new e.WebClientHostControllerHelper(t,n)},t.createAsyncMethodExecutorHelper=function(t){return new e.AsyncMethodExecutorHelper(t)}}(e.BootStrapExtension||(e.BootStrapExtension={}))}(OSF||(OSF={})),function(e){!function(e){e.DefaultLocale="en-us",e.OfficeJS="office.js",e.OfficeDebugJS="office.debug.js",e.OfficeStringsId="OFFICESTRINGS",e.OfficeJsId="OFFICEJS",e.HostFileId="HOST",e.OfficeStringJS="office_strings.js",e.OfficeStringDebugJS="office_strings.debug.js",e.FileVersion="0.0.0.0"}(e.ConstantNames||(e.ConstantNames={}))}(OSF||(OSF={})),function(e){var t=function(){function e(){}return e.NotificationConversationIdSuffix="_ntf",e}();e.Constants=t}(OSF||(OSF={})),CustomFunctionMappings||(CustomFunctionMappings={}),function(e){e.delayInitialization=function(){CustomFunctionMappings.__delay__=!0},e._association=e._association||new OSF.Association,e.associate=function(){e._association.associate.apply(e._association,arguments),delete CustomFunctionMappings.__delay__}}(CustomFunctions||(CustomFunctions={})),function(e){!function(e){!function(e){var t={},n=!1;e.getErrorArgs=function(e){var i;n||(i=Strings.OfficeOM,t[1e3]={name:i.L_InvalidCoercion,message:i.L_CoercionTypeNotSupported},t[1001]={name:i.L_DataReadError,message:i.L_GetSelectionNotSupported},t[1002]={name:i.L_InvalidCoercion,message:i.L_CoercionTypeNotMatchBinding},t[1003]={name:i.L_DataReadError,message:i.L_InvalidGetRowColumnCounts},t[1004]={name:i.L_DataReadError,message:i.L_SelectionNotSupportCoercionType},t[1005]={name:i.L_DataReadError,message:i.L_InvalidGetStartRowColumn},t[1006]={name:i.L_DataReadError,message:i.L_NonUniformPartialGetNotSupported},t[1008]={name:i.L_DataReadError,message:i.L_GetDataIsTooLarge},t[1009]={name:i.L_DataReadError,message:i.L_FileTypeNotSupported},t[1010]={name:i.L_DataReadError,message:i.L_GetDataParametersConflict},t[1011]={name:i.L_DataReadError,message:i.L_InvalidGetColumns},t[1012]={name:i.L_DataReadError,message:i.L_InvalidGetRows},t[1013]={name:i.L_DataReadError,message:i.L_InvalidReadForBlankRow},t[2e3]={name:i.L_DataWriteError,message:i.L_UnsupportedDataObject},t[2001]={name:i.L_DataWriteError,message:i.L_CannotWriteToSelection},t[2002]={name:i.L_DataWriteError,message:i.L_DataNotMatchSelection},t[2003]={name:i.L_DataWriteError,message:i.L_OverwriteWorksheetData},t[2004]={name:i.L_DataWriteError,message:i.L_DataNotMatchBindingSize},t[2005]={name:i.L_DataWriteError,message:i.L_InvalidSetStartRowColumn},t[2006]={name:i.L_InvalidFormat,message:i.L_InvalidDataFormat},t[2007]={name:i.L_InvalidDataObject,message:i.L_DataNotMatchCoercionType},t[2008]={name:i.L_InvalidDataObject,message:i.L_DataNotMatchBindingType},t[2009]={name:i.L_DataWriteError,message:i.L_SetDataIsTooLarge},t[2010]={name:i.L_DataWriteError,message:i.L_NonUniformPartialSetNotSupported},t[2011]={name:i.L_DataWriteError,message:i.L_InvalidSetColumns},t[2012]={name:i.L_DataWriteError,message:i.L_InvalidSetRows},t[2013]={name:i.L_DataWriteError,message:i.L_SetDataParametersConflict},t[3e3]={name:i.L_BindingCreationError,message:i.L_SelectionCannotBound},t[3002]={name:i.L_InvalidBindingError,message:i.L_BindingNotExist},t[3003]={name:i.L_BindingCreationError,message:i.L_BindingToMultipleSelection},t[3004]={name:i.L_BindingCreationError,message:i.L_InvalidSelectionForBindingType},t[3005]={name:i.L_InvalidBindingOperation,message:i.L_OperationNotSupportedOnThisBindingType},t[3006]={name:i.L_BindingCreationError,message:i.L_NamedItemNotFound},t[3007]={name:i.L_BindingCreationError,message:i.L_MultipleNamedItemFound},t[3008]={name:i.L_BindingCreationError,message:i.L_InvalidNamedItemForBindingType},t[3009]={name:i.L_InvalidBinding,message:i.L_UnknownBindingType},t[3010]={name:i.L_InvalidBindingOperation,message:i.L_OperationNotSupportedOnMatrixData},t[3011]={name:i.L_InvalidBinding,message:i.L_InvalidColumnsForBinding},t[4e3]={name:i.L_ReadSettingsError,message:i.L_SettingNameNotExist},t[4001]={name:i.L_SaveSettingsError,message:i.L_SettingsCannotSave},t[4002]={name:i.L_SettingsStaleError,message:i.L_SettingsAreStale},t[5e3]={name:i.L_HostError,message:i.L_OperationNotSupported},t[5001]={name:i.L_InternalError,message:i.L_InternalErrorDescription},t[5002]={name:i.L_PermissionDenied,message:i.L_DocumentReadOnly},t[5003]={name:i.L_EventRegistrationError,message:i.L_EventHandlerNotExist},t[5004]={name:i.L_InvalidAPICall,message:i.L_InvalidApiCallInContext},t[5005]={name:i.L_ShuttingDown,message:i.L_ShuttingDown},t[5007]={name:i.L_UnsupportedEnumeration,message:i.L_UnsupportedEnumerationMessage},t[5008]={name:i.L_IndexOutOfRange,message:i.L_IndexOutOfRange},t[5009]={name:i.L_APINotSupported,message:i.L_BrowserAPINotSupported},t[5011]={name:i.L_APICallFailed,message:i.L_RequestTimeout},t[5012]={name:i.L_InvalidOrTimedOutSession,message:i.L_InvalidOrTimedOutSessionMessage},t[5013]={name:i.L_APICallFailed,message:i.L_InvalidApiArgumentsMessage},t[5015]={name:i.L_APICallFailed,message:i.L_WorkbookHiddenMessage},t[5016]={name:i.L_APICallFailed,message:i.L_WriteNotSupportedWhenModalDialogOpen},t[5017]={name:i.L_APICallFailed,message:i.L_UndoNotSupportedMessage},t[5100]={name:i.L_APICallFailed,message:i.L_TooManyIncompleteRequests},t[5101]={name:i.L_APICallFailed,message:i.L_RequestTokenUnavailable},t[5102]={name:i.L_APICallFailed,message:i.L_ActivityLimitReached},t[5103]={name:i.L_APICallFailed,message:i.L_RequestPayloadSizeLimitExceededMessage},t[5104]={name:i.L_APICallFailed,message:i.L_ResponsePayloadSizeLimitExceededMessage},t[6e3]={name:i.L_InvalidNode,message:i.L_CustomXmlNodeNotFound},t[6100]={name:i.L_CustomXmlError,message:i.L_CustomXmlError},t[6101]={name:i.L_CustomXmlExceedQuotaName,message:i.L_CustomXmlExceedQuotaMessage},t[6102]={name:i.L_CustomXmlOutOfDateName,message:i.L_CustomXmlOutOfDateMessage},t[7e3]={name:i.L_PermissionDenied,message:i.L_NoCapability},t[7001]={name:i.L_CannotNavigateTo,message:i.L_CannotNavigateTo},t[7002]={name:i.L_SpecifiedIdNotExist,message:i.L_SpecifiedIdNotExist},t[7004]={name:i.L_NavOutOfBound,message:i.L_NavOutOfBound},t[2014]={name:i.L_DataWriteReminder,message:i.L_CellDataAmountBeyondLimits},t[8e3]={name:i.L_MissingParameter,message:i.L_ElementMissing},t[8001]={name:i.L_PermissionDenied,message:i.L_NoCapability},t[8010]={name:i.L_InvalidValue,message:i.L_InvalidCellsValue},t[8011]={name:i.L_InvalidValue,message:i.L_InvalidTableOptionValue},t[8012]={name:i.L_InvalidValue,message:i.L_InvalidFormatValue},t[8020]={name:i.L_OutOfRange,message:i.L_RowIndexOutOfRange},t[8021]={name:i.L_OutOfRange,message:i.L_ColIndexOutOfRange},t[8022]={name:i.L_OutOfRange,message:i.L_FormatValueOutOfRange},t[8023]={name:i.L_FormattingReminder,message:i.L_CellFormatAmountBeyondLimits},t[1e4]={name:i.L_UserNotSignedIn,message:i.L_UserNotSignedIn},t[11e3]={name:i.L_MemoryLimit,message:i.L_CloseFileBeforeRetrieve},t[11001]={name:i.L_NetworkProblem,message:i.L_NetworkProblemRetrieveFile},t[11002]={name:i.L_InvalidValue,message:i.L_SliceSizeNotSupported},t[12007]={name:i.L_DisplayDialogError,message:i.L_DialogAlreadyOpened},t[12e3]={name:i.L_IndexOutOfRange,message:i.L_IndexOutOfRange},t[12001]={name:i.L_IndexOutOfRange,message:i.L_IndexOutOfRange},t[12002]={name:i.L_DisplayDialogError,message:i.L_NetworkProblem},t[12003]={name:i.L_DialogNavigateError,message:i.L_DialogInvalidScheme},t[12004]={name:i.L_DisplayDialogError,message:i.L_DialogAddressNotTrusted},t[12005]={name:i.L_DisplayDialogError,message:i.L_DialogRequireHTTPS},t[12009]={name:i.L_DisplayDialogError,message:i.L_UserClickIgnore},t[12011]={name:i.L_DisplayDialogError,message:i.L_NewWindowCrossZoneErrorString},t[13e3]={name:i.L_APINotSupported,message:i.L_InvalidSSOAddinMessage},t[13001]={name:i.L_UserNotSignedIn,message:i.L_UserNotSignedIn},t[13002]={name:i.L_UserAborted,message:i.L_UserAbortedMessage},t[13003]={name:i.L_UnsupportedUserIdentity,message:i.L_UnsupportedUserIdentityMessage},t[13004]={name:i.L_InvalidResourceUrl,message:i.L_InvalidResourceUrlMessage},t[13005]={name:i.L_InvalidGrant,message:i.L_InvalidGrantMessage},t[13006]={name:i.L_SSOClientError,message:i.L_SSOClientErrorMessage},t[13007]={name:i.L_SSOServerError,message:i.L_SSOServerErrorMessage},t[13008]={name:i.L_AddinIsAlreadyRequestingToken,message:i.L_AddinIsAlreadyRequestingTokenMessage},t[13009]={name:i.L_SSOUserConsentNotSupportedByCurrentAddinCategory,message:i.L_SSOUserConsentNotSupportedByCurrentAddinCategoryMessage},t[13010]={name:i.L_SSOConnectionLostError,message:i.L_SSOConnectionLostErrorMessage},t[13012]={name:i.L_APINotSupported,message:i.L_SSOUnsupportedPlatform},t[13013]={name:i.L_APICallFailed,message:i.L_RequestTokenUnavailable},t[5014]={name:i.L_OperationCancelledError,message:i.L_OperationCancelledErrorMessage},n=!0);var r=t[e];return r?(r.name||(r.name=t[5001].name),r.message||(r.message=t[5001].message)):r=t[5001],r},e.addErrorMessage=function(e,n){t[e]=n}}(e.ErrorCodeManager||(e.ErrorCodeManager={}))}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){var t=function(){function e(e){if(this._eventInfos={},this._queuedEventsArgs={},this._eventHandlers={},this._queuedEventsArgs={},null!=e)for(var t=0;t<e.length;t++)if("string"==typeof e[t]){var n=e[t];this._eventHandlers[n]=[],this._queuedEventsArgs[n]=[]}else{n=e[t].type;this._eventInfos[n]=e[t],this._eventHandlers[n]=[],this._queuedEventsArgs[n]=[]}}return e.prototype.getSupportedEvents=function(){var e=[];for(var t in this._eventHandlers)e.push(t);return e},e.prototype.supportsEvent=function(e){for(var t in this._eventHandlers)if(e==t)return!0;return!1},e.prototype.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},e.prototype.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)},e.prototype.addEventHandlerAndFireQueuedEvent=function(e,t){var n=this._eventHandlers[e],i=!n||0==n.length,r=this.addEventHandler(e,t);return i&&r&&this.fireQueuedEvent(e),r},e.prototype.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},e.prototype.clearEventHandlers=function(e){return void 0!==this._eventHandlers[e]&&this._eventHandlers[e].length>0&&(this._eventHandlers[e]=[],!0)},e.prototype.getEventHandlerCount=function(e){return null!=this._eventHandlers[e]?this._eventHandlers[e].length:-1},e.prototype.getEventInfo=function(e){return this._eventInfos[e]},e.prototype.fireEvent=function(e){if(null==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},e.prototype.fireOrQueueEvent=function(e){if(null==e.type)return!1;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},e.prototype.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},e.prototype.clearQueuedEvent=function(e){e&&this._eventHandlers[e]&&(this._queuedEventsArgs[e]&&(this._queuedEventsArgs[e]=[]))},e}();e.EventDispatch=t}(OSF||(OSF={})),function(e){!function(e){e.dispidEventMin=0,e.dispidInitializeEvent=0,e.dispidSettingsChangedEvent=1,e.dispidDocumentSelectionChangedEvent=2,e.dispidBindingSelectionChangedEvent=3,e.dispidBindingDataChangedEvent=4,e.dispidDocumentOpenEvent=5,e.dispidDocumentCloseEvent=6,e.dispidActiveViewChangedEvent=7,e.dispidDocumentThemeChangedEvent=8,e.dispidOfficeThemeChangedEvent=9,e.dispidDialogMessageReceivedEvent=10,e.dispidDialogNotificationShownInAddinEvent=11,e.dispidDialogParentMessageReceivedEvent=12,e.dispidObjectDeletedEvent=13,e.dispidObjectSelectionChangedEvent=14,e.dispidObjectDataChangedEvent=15,e.dispidContentControlAddedEvent=16,e.dispidLiveShareStateChangedEvent=17,e.dispidActivationStatusChangedEvent=32,e.dispidRichApiMessageEvent=33,e.dispidAppCommandInvokedEvent=39,e.dispidOnSdxSendMessageEvent=40,e.dispidDataNodeAddedEvent=60,e.dispidDataNodeReplacedEvent=61,e.dispidDataNodeDeletedEvent=62}(e.EventDispId||(e.EventDispId={}))}(OSF||(OSF={})),function(e){var t=function(){function t(){}return t.addEventHandler=function(n,i,r,o,a,s){var c=0;function l(t){0==t&&(o.hasEventHandler(n,i)||o.addEventHandler(n,i)||(t=5010));e._OfficeAppFactory.getAsyncMethodExecutor().invokeCallback(c,r,t,null,a)}var u=o.getEventInfo(n);if(u)try{if(s)return void l(0);c=u.id;var f=u.getTargetId();if(0==o.getEventHandlerCount(n))e._OfficeAppFactory.getAsyncMethodExecutor().registerEventAsync(c,u.type,f,(function(e){o.fireEvent(e)}),u,(function(t){l(e.Utility.getErrorCodeFromAsyncResult(t))}),a);else l(0)}catch(e){t.onException(c,e,r)}else l(5010)},t.removeEventHandler=function(n,i,r,o,a,s){var c=0;function l(t){e._OfficeAppFactory.getAsyncMethodExecutor().invokeCallback(c,r,t,null,a)}var u=o.getEventInfo(n);if(u)try{c=u.id;var f=u.getTargetId(),d=0,p=!0;null===i?(p=o.clearEventHandlers(n),d=0):d=(p=o.removeEventHandler(n,i))?0:5003;var h=o.getEventHandlerCount(n);if(p&&0==h)e._OfficeAppFactory.getAsyncMethodExecutor().unregisterEventAsync(c,u.type,f,(function(t){l(e.Utility.getErrorCodeFromAsyncResult(t))}),a);else l(d)}catch(e){t.onException(c,e,r)}else l(5010)},t.onException=function(t,n,i){if("number"!=typeof n)throw n;e._OfficeAppFactory.getAsyncMethodExecutor().invokeCallback(t,i,n,null)},t}();e.EventHelper=t}(OSF||(OSF={})),function(e){!function(e){e.ActiveViewChanged="activeViewChanged",e.AppCommandInvoked="appCommandInvoked",e.RichApiMessage="richApiMessage",e.DocumentSelectionChanged="documentSelectionChanged",e.BindingSelectionChanged="bindingSelectionChanged",e.BindingDataChanged="bindingDataChanged",e.OfficeThemeChanged="officeThemeChanged",e.DocumentThemeChanged="documentThemeChanged",e.LiveShareStateChanged="liveShareStateChanged",e.DataNodeDeleted="nodeDeleted",e.DataNodeInserted="nodeInserted",e.DataNodeReplaced="nodeReplaced",e.DialogMessageReceived="dialogMessageReceived",e.DialogParentMessageReceived="dialogParentMessageReceived",e.DialogParentEventReceived="dialogParentEventReceived",e.DialogEventReceived="dialogEventReceived",e.NodeDeleted="nodeDeleted",e.NodeInserted="nodeInserted",e.NodeReplaced="nodeReplaced",e.SettingsChanged="settingsChanged"}(e.EventType||(e.EventType={}))}(OSF||(OSF={})),function(e){!function(t){var n=function(){function t(){this.platformRemappings={web:Office.PlatformType.OfficeOnline,winrt:Office.PlatformType.Universal,win32:Office.PlatformType.PC,mac:Office.PlatformType.Mac,ios:Office.PlatformType.iOS,android:Office.PlatformType.Android},this.camelCaseMappings={powerpoint:Office.HostType.PowerPoint,onenote:Office.HostType.OneNote},this.hostInfo=e._OfficeAppFactory.getHostInfo()}return t.prototype.capitalizeFirstLetter=function(e){return e?e[0].toUpperCase()+e.slice(1).toLowerCase():e},t.getInstance=function(){return void 0===t.hostObj&&(t.hostObj=new t),t.hostObj},t.prototype.getPlatform=function(e){if(this.hostInfo&&this.hostInfo.hostPlatform){var t=this.hostInfo.hostPlatform.toLowerCase();if(this.platformRemappings[t])return this.platformRemappings[t]}return null},t.prototype.getHost=function(e){if(this.hostInfo&&this.hostInfo.hostType){var t=this.hostInfo.hostType.toLowerCase();if(this.camelCaseMappings[t])return this.camelCaseMappings[t];if(t=this.capitalizeFirstLetter(this.hostInfo.hostType),Office.HostType[t])return Office.HostType[t]}return null},t.prototype.getDefaultVersion=function(){return this.getHost()?"16.0.0000.0000":null},t.prototype.getDiagnostics=function(e){return{host:this.getHost(),version:e||this.getDefaultVersion(),platform:this.getPlatform()}},t}();t.Host=n}(e.HostName||(e.HostName={}))}(OSF||(OSF={})),function(e){!function(e){e[e.SharedApp=1]="SharedApp",e[e.CustomFunction=2]="CustomFunction",e[e.ProtectedDocDisable=4]="ProtectedDocDisable",e[e.ExperimentJsEnabled=8]="ExperimentJsEnabled",e[e.PublicAddin=16]="PublicAddin",e[e.BundleJsEnabled=32]="BundleJsEnabled",e[e.IsMos=64]="IsMos",e[e.IsMonarch=128]="IsMonarch"}(e.HostInfoFlags||(e.HostInfoFlags={}))}(OSF||(OSF={})),function(e){!function(e){e.excel="excel",e.word="word"}(e.HostInfoHostType||(e.HostInfoHostType={}))}(OSF||(OSF={})),function(e){!function(e){e.web="web",e.winrt="winrt",e.win32="win32",e.mac="mac",e.ios="ios",e.android="android"}(e.HostInfoPlatform||(e.HostInfoPlatform={}))}(OSF||(OSF={})),function(e){var t=function(){function t(e,t,n,i){this._hostInfo=e,this._webAppState=t,this._context=n,this._hostFacade=i}return t.prototype.saveAndSetDialogInfo=function(e){},t.prototype.setAgaveHostCommunication=function(){},t.prototype.createClientHostController=function(){return null},t.prototype.createAsyncMethodExecutor=function(){return null},t.prototype.createClientSettingsManager=function(){return null},t.prototype.createSettings=function(t){var n=e.OUtil.getSessionStorage();if(n){var i=n.getItem(e._OfficeAppFactory.getCachedSessionSettingsKey());i?t=JSON.parse(i):(i=JSON.stringify(t),n.setItem(e._OfficeAppFactory.getCachedSessionSettingsKey(),i))}var r=e.OUtil.deserializeSettings(t),o=this.createClientSettingsManager();return new Office.Settings(r,o)},t.prototype.prepareApiSurface=function(t){var n=t.get_featureGates();n&&(Microsoft.Office.WebExtension.FeatureGates=n),e.BootStrapExtension.prepareApiSurface&&e.BootStrapExtension.prepareApiSurface(),e.BootStrapExtension.prepareHostSpecificSurface&&e.BootStrapExtension.prepareHostSpecificSurface(),OSFPerformance.createOMEnd=OSFPerformance.now()},t.prototype.getTabbableElements=function(){return null},t}();e.InitializationHelper=t}(OSF||(OSF={})),function(e){!function(e){e.Inserted="inserted",e.DocumentOpened="documentOpened"}(e.InitializationReason||(e.InitializationReason={}))}(OSF||(OSF={})),OSF||(OSF={}),function(e){!function(t){var n,i=null,r=!1,o=["excel","word","powerpoint","onenote","outlook","visio","office-common","office.common","office","officebase"],a=[".js",".debug.js"],s="_osfDisableHostCheck",c=function(){try{return document.currentScript}catch(e){return null}}();function l(){return u(),n.trustedTypesOptIn}function u(){if(!n){var e=function(e){var t=null!=e?e.src:null;if(!t)return null;for(var n=t.toLowerCase(),i=0;i<o.length;i++)for(var r=0;r<a.length;r++){var c=o[i]+a[r],l=n.indexOf(c);if(l>=0&&(0===l||"/"===t.charAt(l-1)||"\\"===t.charAt(l-1))&&(l+c.length===t.length||"?"===t.charAt(l+c.length))){var u=t.substring(0,l),f=n.indexOf(".debug.js",l)>0,d=e.getAttribute("data-is-sdx"),p="1"===d||"true"===d,h=e.getAttribute("data-enable-trusted-types"),g="1"===h||"true"===h;return{basePath:u,name:c,isDebugJs:f,isSdx:p,disableHostCheck:window.hasOwnProperty(s)&&!0===window._osfDisableHostCheck,trustedTypesOptIn:g}}}return null};if(!(n=e(c))){for(var t=document.getElementsByTagName("script"),i=t.length,r=0;r<i;r++)if(n=e(t[r]))return;n={basePath:"",name:"",isDebugJs:!1,isSdx:!1,disableHostCheck:!1,trustedTypesOptIn:!1}}}}t.getHostBundleJsBasePath=function(){return u(),n.basePath},t.getHostBundleJsName=function(){return u(),n.name},t.getOfficeStringJsName=function(){return u(),n.isDebugJs?e.ConstantNames.OfficeStringDebugJS:e.ConstantNames.OfficeStringJS},t.isSdx=function(){return u(),n.isSdx},t.disableHostCheck=function(){return u(),n.disableHostCheck},t.trustedTypesOptIn=l,t.loadScriptWithBasename=function(t,i,r){u();var o=t+(n.isDebugJs?".debug.js":".js");o=o.toLowerCase();var a=n.basePath+o;e.OUtil.loadScript(a,i,d())};var f=["https://alcdn.msauth.net/browser-1p/2.28.1/js/msal-browser-1p.min.js"];function d(){if(!r){r=!0;try{if(!l()||!window.trustedTypes||!window.trustedTypes.createPolicy)return null;var e=c.src,t=new URL(e).origin.toLowerCase();if(!t)return null;i=window.trustedTypes.createPolicy("officejs",{createScriptURL:function(e){var n=e.toLowerCase(),i=new URL(n).origin;if(t&&t===i)return e;for(var r=0,o=f;r<o.length;r++){if(n===o[r])return e}throw new Error("Untrusted script URL")}})}catch(e){}}return i}t.getTrustedTypesPolicy=d}(e.LoadScriptHelper||(e.LoadScriptHelper={}))}(OSF||(OSF={})),function(e){!function(t){!function(t){t.getAuthContextAsync=function(t){function n(e){var t=e.userObjectId||"",n=e.tenantId||"",i=e.userPrincipalName||"";return{userObjectId:t,tenantId:n,userPrincipalName:i,authorityType:e.authorityType||"",authorityBaseUrl:e.authorityBaseUrl||"",puid:e.puid||"",loginHint:e.loginHint||i}}var i={toSafeArrayHost:function(){return[]},fromSafeArrayHost:function(e){try{return n(JSON.parse(e))}catch(e){return null}},toWebHost:function(){return{}},fromWebHost:function(e){return n(e)}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(205,i,t)}}(t.Auth||(t.Auth={}))}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){var t;!function(e){e[e.MaxLiveShareStateDataSizeInBytes=1024]="MaxLiveShareStateDataSizeInBytes"}(t=e.LiveShareStateParams||(e.LiveShareStateParams={}));var n=function(){function e(e){var t=this;e=e||null,this._liveShareState=e,this._eventDispatch=new OSF.EventDispatch([{id:OSF.EventDispId.dispidLiveShareStateChangedEvent,type:OSF.EventType.LiveShareStateChanged,getTargetId:function(){return""},fromSafeArrayHost:function(e){return{type:OSF.EventType.LiveShareStateChanged,liveShareState:t}},fromWebHost:function(e){return{type:OSF.EventType.LiveShareStateChanged,liveShareState:t}}}])}return e.prototype.get=function(){return this._liveShareState},e.prototype.set=function(e){if((new TextEncoder).encode(e).length>t.MaxLiveShareStateDataSizeInBytes)throw new Error("State data size is limited to "+t.MaxLiveShareStateDataSizeInBytes+" bytes.");this._liveShareState=e},e.prototype.addHandlerAsync=function(e,t,n){OSF.EventHelper.addEventHandler(e,t,n,this._eventDispatch)},e.prototype.removeHandlerAsync=function(e,t,n){OSF.EventHelper.removeEventHandler(e,t,n,this._eventDispatch)},e}();e.LiveShareState=n}(Office||(Office={})),function(e){var t={"ar-sa":!0,"bg-bg":!0,"bn-in":!0,"ca-es":!0,"cs-cz":!0,"da-dk":!0,"de-de":!0,"el-gr":!0,"en-us":!0,"es-es":!0,"et-ee":!0,"eu-es":!0,"fa-ir":!0,"fi-fi":!0,"fr-fr":!0,"gl-es":!0,"he-il":!0,"hi-in":!0,"hr-hr":!0,"hu-hu":!0,"id-id":!0,"it-it":!0,"ja-jp":!0,"kk-kz":!0,"ko-kr":!0,"lo-la":!0,"lt-lt":!0,"lv-lv":!0,"ms-my":!0,"nb-no":!0,"nl-nl":!0,"nn-no":!0,"pl-pl":!0,"pt-br":!0,"pt-pt":!0,"ro-ro":!0,"ru-ru":!0,"sk-sk":!0,"sl-si":!0,"sr-cyrl-cs":!0,"sr-cyrl-rs":!0,"sr-latn-cs":!0,"sr-latn-rs":!0,"sv-se":!0,"th-th":!0,"tr-tr":!0,"uk-ua":!0,"ur-pk":!0,"vi-vn":!0,"zh-cn":!0,"zh-tw":!0},n={ar:"ar-sa",bg:"bg-bg",bn:"bn-in",ca:"ca-es",cs:"cs-cz",da:"da-dk",de:"de-de",el:"el-gr",en:"en-us",es:"es-es",et:"et-ee",eu:"eu-es",fa:"fa-ir",fi:"fi-fi",fr:"fr-fr",gl:"gl-es",he:"he-il",hi:"hi-in",hr:"hr-hr",hu:"hu-hu",id:"id-id",it:"it-it",ja:"ja-jp",kk:"kk-kz",ko:"ko-kr",lo:"lo-la",lt:"lt-lt",lv:"lv-lv",ms:"ms-my",nb:"nb-no",nl:"nl-nl",nn:"nn-no",pl:"pl-pl",pt:"pt-br",ro:"ro-ro",ru:"ru-ru",sk:"sk-sk",sl:"sl-si",sr:"sr-cyrl-cs",sv:"sv-se",th:"th-th",tr:"tr-tr",uk:"uk-ua",ur:"ur-pk",vi:"vi-vn",zh:"zh-cn"};e.getSupportedLocale=function(e,i){if(void 0===i&&(i="en-us"),!e)return i;var r;if((e=e.toLowerCase())in t)r=e;else{var o=e.split("-",1);o&&o.length>0&&(r=n[o[0]])}return r||(r=i),r}}(OSF||(OSF={})),function(e){e.OfficeOM||(e.OfficeOM={})}(Strings||(Strings={})),function(e){!function(t){var n;t.ensureOfficeStringsJs=function(){return n||(n=1==e.OUtil.getLibraryReleaseVehicle()?new Office.Promise((function(e,t){e()})):new Office.Promise((function(n,i){if(e._OfficeAppFactory.getHostInfo().hostLocale){var r=e.LoadScriptHelper.getHostBundleJsBasePath()+e._OfficeAppFactory.getHostInfo().hostLocale+"/"+e.LoadScriptHelper.getOfficeStringJsName();e.OUtil.loadScript(r,(function(r){if(r)n();else{var o=e.LoadScriptHelper.getHostBundleJsBasePath()+e.ConstantNames.DefaultLocale+"/"+e.LoadScriptHelper.getOfficeStringJsName();t.loadScript(o,(function(t){t?n():i(new Error("Cannot load "+e.ConstantNames.OfficeStringJS))}),e.LoadScriptHelper.getTrustedTypesPolicy())}}),e.LoadScriptHelper.getTrustedTypesPolicy())}else i(new Error("No host locale"))}))),n}}(e.OUtil||(e.OUtil={}))}(OSF||(OSF={})),function(e){!function(t){!function(t){var n;OSF.definePropertyOnNamespace(t,"url",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_docUrl()})),OSF.definePropertyOnNamespace(t,"mode",(function(){return 0==OSF._OfficeAppFactory.getOfficeAppContext().get_clientMode()?e.DocumentMode.ReadOnly:e.DocumentMode.ReadWrite})),OSF.definePropertyOnNamespace(t,"settings",(function(){if(!n){var e=OSF._OfficeAppFactory.getOfficeAppContext().get_settingsFunc()();n=OSF._OfficeAppFactory.getInitializationHelper().createSettings(e)}return n})),t.goToByIdAsync=function(t,n,i,r){var o={};o[e.GoToType.Binding]=0,o[e.GoToType.NamedItem]=1,o[e.GoToType.Slide]=2,o[e.GoToType.Index]=3;var a={};a[e.SelectionMode.Default]=0,a[e.SelectionMode.Selected]=1,a[e.SelectionMode.None]=2;var s=o[n],c=0,l=r;"function"==typeof i?l=i:void 0!==i&&(c=a[i]);var u={toSafeArrayHost:function(){return[t,s,c]},fromSafeArrayHost:function(e){return e},toWebHost:function(){return{DdaGoToByIdMethod:{Id:t,GoToType:s,SelectionMode:c}}},fromWebHost:function(e){return e}};OSF._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(82,u,l)}}(t.document||(t.document={}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(e){!function(e){e.sendMessage=function(e){if(OSF._OfficeAppFactory.getHostInfo().hostPlatform==OSF.HostInfoPlatform.web){var t=OSF._OfficeAppFactory.getWebAppState();t.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t.id,OSF.AgaveHostAction.SendMessage,e])}else{var n=JSON.stringify(e);OSF._OfficeAppFactory.getClientHostController().execute(208,[n],null)}},e.registerOnMessageEventHandler=function(t){if(OSF._OfficeAppFactory.getHostInfo().hostPlatform==OSF.HostInfoPlatform.web)e.onMessage=t;else{OSF._OfficeAppFactory.getClientHostController().registerEvent(OSF.EventDispId.dispidOnSdxSendMessageEvent,"","",(function(e,n){var i=n.toArray();t(JSON.parse(i[0]))}),null)}}}(e.messaging||(e.messaging={}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(t){var n,i;OSF.definePropertyOnNamespace(t,"contentLanguage",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_dataLocale()})),OSF.definePropertyOnNamespace(t,"displayLanguage",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_appUILocale()})),OSF.definePropertyOnNamespace(t,"partitionKey",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_partitionKey()})),OSF.definePropertyOnNamespace(t,"isDialog",(function(){return OSF._OfficeAppFactory.getHostInfo().isDialog})),OSF.definePropertyOnNamespace(t,"touchEnabled",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_touchEnabled()})),OSF.definePropertyOnNamespace(t,"commerceAllowed",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_commerceAllowed()})),OSF.definePropertyOnNamespace(t,"host",(function(){return OSF.HostName.Host.getInstance().getHost()})),OSF.definePropertyOnNamespace(t,"platform",(function(){return OSF.HostName.Host.getInstance().getPlatform()})),OSF.definePropertyOnNamespace(t,"diagnostics",(function(){return OSF.HostName.Host.getInstance().getDiagnostics(OSF._OfficeAppFactory.getOfficeAppContext().get_hostFullVersion())})),OSF.definePropertyOnNamespace(t,"requirements",(function(){if(!n){var e=OSF._OfficeAppFactory.getOfficeAppContext();e&&(n=e.get_isDialog()?OSF.Requirement.RequirementsMatrixFactory.getDefaultDialogRequirementMatrix(e):OSF.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(e))}return n})),OSF.definePropertyOnNamespace(t,"officeTheme",(function(){var e=OSF._OfficeAppFactory.getOfficeAppContext().get_officeThemeFunc();return e?"function"==typeof e?e():e:void 0})),OSF.definePropertyOnNamespace(t,"webAuth",(function(){if(OSF.DDA.WebAuth)return OSF.DDA.WebAuth})),OSF.definePropertyOnNamespace(t,"auth",(function(){if(OSF.DDA.Auth)return OSF.DDA.Auth})),OSF.definePropertyOnNamespace(t,"license",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_eToken()})),OSF.definePropertyOnNamespace(t,"hostSettings",(function(){if(!i){var t=OSF._OfficeAppFactory.getOfficeAppContext().get_hostSettingsFunc();if(void 0!==t){var n=t(),r=OSF.OUtil.deserializeSettings(n);i=new e.Settings(r,void 0)}}return i}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(e){!function(e){e.refreshRibbon=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.RefreshRibbonGallery,e])}}(e.ribbonGallery||(e.ribbonGallery={}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(e){!function(e){e.taskPaneAction||(e.taskPaneAction={})}(e.ui||(e.ui={}))}(e.context||(e.context={}))}(Office||(Office={}));var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};!function(e){function t(){e._officeOnReadyState.officeOnReadyPromise||(e._officeOnReadyState.officeOnReadyPromise=new e.Promise((function(t,n){e._officeOnReadyState.officeOnReadyPromiseResolve=t})))}function n(n){return t(),n&&(e._officeOnReadyState.officeOnReadyFired?n(e._officeOnReadyState.officeOnReadyHostAndPlatformInfo):e._officeOnReadyState.officeOnReadyCallbacks.push(n)),e._officeOnReadyState.officeOnReadyPromise}e._officeOnReadyState=e._officeOnReadyState||{isOfficeOnReadyCalled:!1,officeOnReadyPromise:null,officeOnReadyPromiseResolve:null,officeOnReadyCallbacks:[],officeOnReadyHostAndPlatformInfo:null,officeOnReadyFired:!1},e.initialize=e.initialize,e.onReadyInternal=n,e.onReady=function(t){return e._officeOnReadyState.isOfficeOnReadyCalled=!0,n(t)},e.fireOnReady=function(n){for(t(),e._officeOnReadyState.officeOnReadyHostAndPlatformInfo=__assign({},n),e._officeOnReadyState.officeOnReadyFired=!0,OSFPerformance.officeOnReady=OSFPerformance.now();e._officeOnReadyState.officeOnReadyCallbacks.length>0;)e._officeOnReadyState.officeOnReadyCallbacks.shift()(e._officeOnReadyState.officeOnReadyHostAndPlatformInfo);e._officeOnReadyState.officeOnReadyPromiseResolve(e._officeOnReadyState.officeOnReadyHostAndPlatformInfo),e._officeOnReadyState.isOfficeOnReadyCalled||OSF.OUtil.waitForFunction((function(){return"function"==typeof e.initialize}),(function(t){t&&e.initialize(OSF._OfficeAppFactory.getOfficeAppContext().get_reason())}),400,50)}}(Office||(Office={})),function(e){var t=function(){function t(t,n,i,r,o,a,s,c,l,u,f,d,p,h,g,m,v,y,O,b,S,_,A,C,E,I,w,P,x,T,R,F,k){this._id=t,this._appName=n,this._appVersion=i,this._appUILocale=r,this._dataLocale=o,this._docUrl=a,this._clientMode=s,this._settingsFunc=c,this._reason=l,this._osfControlType=u,this._eToken=f,this._correlationId=d,this._appInstanceId=p,this._touchEnabled=h,this._commerceAllowed=g,this._appMinorVersion=m,this._requirementMatrix=v,this._hostCustomMessage=y,this._hostFullVersion=O,this._isDialog=e.OUtil.isDialog(),this._clientWindowHeight=b,this._clientWindowWidth=S,this._addinName=_,this._appDomains=A,this._dialogRequirementMatrix=C,this._featureGates=E,this._officeThemeFunc=I,this._initialDisplayMode=w,this._isFromWacAutomation=P,this._wopiHostOriginForSingleSignOn=x,this._hostSettingsFunc=T,this._isWeb=R,this._nestedAppAuthBridgeType=F,this._partitionKey=k}return t.prototype.get_id=function(){return this._id},t.prototype.get_appName=function(){return this._appName},t.prototype.get_appVersion=function(){return this._appVersion},t.prototype.get_appUILocale=function(){return this._appUILocale},t.prototype.get_dataLocale=function(){return this._dataLocale},t.prototype.get_docUrl=function(){return this._docUrl},t.prototype.get_clientMode=function(){return this._isWeb?this._clientMode:0==this._clientMode?Office.DocumentMode.ReadWrite:Office.DocumentMode.ReadOnly},t.prototype.get_settingsFunc=function(){return this._settingsFunc},t.prototype.get_reason=function(){return this._reason},t.prototype.get_osfControlType=function(){return this._osfControlType},t.prototype.get_eToken=function(){return this._eToken},t.prototype.get_correlationId=function(){return this._correlationId},t.prototype.get_appInstanceId=function(){return this._appInstanceId},t.prototype.get_touchEnabled=function(){return this._touchEnabled},t.prototype.get_commerceAllowed=function(){return this._commerceAllowed},t.prototype.get_appMinorVersion=function(){return this._appMinorVersion},t.prototype.get_requirementMatrix=function(){return this._requirementMatrix},t.prototype.get_dialogRequirementMatrix=function(){return this._dialogRequirementMatrix},t.prototype.get_hostCustomMessage=function(){return this._hostCustomMessage},t.prototype.get_hostFullVersion=function(){return this._hostFullVersion},t.prototype.get_isDialog=function(){return this._isDialog},t.prototype.get_clientWindowHeight=function(){return this._clientWindowHeight},t.prototype.get_clientWindowWidth=function(){return this._clientWindowWidth},t.prototype.get_addinName=function(){return this._addinName},t.prototype.get_appDomains=function(){return this._appDomains},t.prototype.get_taskpaneUrl=function(){return this._taskpaneUrl},t.prototype.set_taskpaneUrl=function(e){this._taskpaneUrl=e},t.prototype.get_featureGates=function(){return this._featureGates},t.prototype.get_officeThemeFunc=function(){return this._officeThemeFunc},t.prototype.get_initialDisplayMode=function(){return this._initialDisplayMode?this._initialDisplayMode:0},t.prototype.get_isFromWacAutomation=function(){return this._isFromWacAutomation},t.prototype.get_wopiHostOriginForSingleSignOn=function(){return this._wopiHostOriginForSingleSignOn},t.prototype.get_hostSettingsFunc=function(){return this._hostSettingsFunc},t.prototype.get_isWeb=function(){return this._isWeb},t.prototype.get_nestedAppAuthBridgeType=function(){return this._nestedAppAuthBridgeType},t.prototype.get_partitionKey=function(){return this._partitionKey},t}();e.OfficeAppContext=t}(OSF||(OSF={})),function(e){!function(t){t.retrieveHostInfo=function(){var t={isO15:!0,isRichClient:!0,hostType:"",hostPlatform:"",hostSpecificFileVersion:"",hostLocale:"",osfControlAppCorrelationId:"",isDialog:!1,disableLogging:!1,flags:0},n="_host_Info",i=null;try{if(window.external=window.external||{},"undefined"!=typeof agaveHost&&agaveHost.GetHostInfo&&(window.external.GetHostInfo=function(){return agaveHost.GetHostInfo()}),window.external.GetHostInfo){var r=window.external.GetHostInfo();if("isDialog"==r)t.isO15=!0,t.isDialog=!0;else{var o=r.split("_host_Info=");i=o.length>1?o[1]:r}}}catch(t){e.Utility.log(JSON.stringify(t))}if(!i)try{var a=window.name;if(a){var s=JSON.parse(a);i=s?s.hostInfo:null}}catch(t){e.Utility.log(JSON.stringify(t))}i||(i=e.Utility.getQueryStringValue(n));var c=e.OUtil.getSessionStorage();if(!i&&c.getItem("hostInfoValue")&&(i=c.getItem("hostInfoValue")),i){i=decodeURIComponent(i),t.isO15=!1;var l=i.split("$");void 0===l[2]&&(l=i.split("|")),t.hostType=void 0===l[0]?"":l[0].toLowerCase(),t.hostPlatform=void 0===l[1]?"":l[1].toLowerCase(),t.hostSpecificFileVersion=void 0===l[2]?"":l[2].toLowerCase(),t.hostLocale=void 0===l[3]?"":l[3].toLowerCase(),t.osfControlAppCorrelationId=void 0===l[4]?"":l[4],"telemetry"==t.osfControlAppCorrelationId&&(t.osfControlAppCorrelationId=""),t.isDialog=void 0!==l[5]&&"isDialog"==l[5],t.disableLogging=void 0!==l[6]&&"disableLogging"==l[6],t.flags="string"==typeof l[7]&&l[7].length>0?parseInt(l[7]):0,c.setItem("hostInfoValue",i)}else t.isO15=!0,t.hostLocale=e.Utility.getQueryStringValue("locale");return t}}(e._OfficeAppFactory||(e._OfficeAppFactory={}))}(OSF||(OSF={})),function(e){var t;!function(t){var n,i,r,o,a,s,c,l,u;"undefined"!=typeof window&&(window.location&&(n=window.location.hash,i=window.location.search),r=window.name);var f={0:"Unknown",1:"Hidden",2:"Taskpane",3:"Dialog"};function d(t,n){e.AppCommandManager.initialize();var i=t.get_appName(),r=null;0!=(o.flags&e.HostInfoFlags.SharedApp)&&(r={visibilityMode:f[t.get_initialDisplayMode()]}),Office.fireOnReady({host:e.HostName.Host.getInstance().getHost(i),platform:e.HostName.Host.getInstance().getPlatform(i),addin:r}),o.hostPlatform==e.HostInfoPlatform.web&&null!=a.clientEndPoint&&a.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[a.id,e.AgaveHostAction.OfficeJsReady,Date.now()]),n(t)}t.bootstrap=function(n,i){if(a={id:null,webAppUrl:null,conversationID:null,clientEndPoint:null,wnd:window.parent,focused:!1,serviceEndPoint:null},o=t.retrieveHostInfo(),function(){!0;try{if(o.disableLogging)return void!1;window.external=window.external||{},void 0===window.external.GetLoggingAllowed||window.external.GetLoggingAllowed()}catch(e){}}(),function(){if(o.hostPlatform===e.HostInfoPlatform.web)s=new e.WebInitializationHelper(o,a,null,null);else if(o.hostPlatform===e.HostInfoPlatform.win32)s=new e.RichClientInitializationHelper(o,a,null,null);else if(o.hostPlatform===e.HostInfoPlatform.ios||o.hostPlatform===e.HostInfoPlatform.mac){if(!(window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.Agave))throw e.Utility.createNotImplementedException();s=new e.WebkitInitializationHelper(o,a,null,null)}else o.hostPlatform===e.HostInfoPlatform.android||o.hostPlatform===e.HostInfoPlatform.winrt?s=new e.WebViewInitializationHelper(o,a,null,null):console.warn("Office.js is loaded inside in unknown host or platform "+o.hostPlatform)}(),s){o.hostPlatform===e.HostInfoPlatform.web&&s.saveAndSetDialogInfo(e.Utility.getQueryStringValue("_host_Info")),s.setAgaveHostCommunication(),OSFPerformance.getAppContextStart=OSFPerformance.now();s.getAppContext(window,(function(t){OSFPerformance.getAppContextEnd=OSFPerformance.now(),e.AppTelemetry.initialize(t),l=t,u=s.createClientHostController(),c=s.createAsyncMethodExecutor(),s.prepareApiSurface(t),e.BootStrapExtension.onGetAppContext?e.BootStrapExtension.onGetAppContext(t,a.wnd).then((function(){d(t,n)})):d(t,n)}),(function(e){i(e)}))}else i(new Error("Office.js cannot be initialized."))},t.getWindowName=function(){return r},t.getWindowLocationHash=function(){return n},t.getWindowLocationSearch=function(){return i},t.getAsyncMethodExecutor=function(){return c},t.getOfficeAppContext=function(){return l},t.getHostInfo=function(){return o},t.getCachedSessionSettingsKey=function(){return(null!=a.conversationID?a.conversationID:l.get_appInstanceId())+"CachedSessionSettings"},t.getWebAppState=function(){return a},t.getId=function(){return a.id},t.getInitializationHelper=function(){return s},t.getClientHostController=function(){return u}}(t=e._OfficeAppFactory||(e._OfficeAppFactory={})),e.getClientEndPoint=function(){return t.getWebAppState().clientEndPoint}}(OSF||(OSF={})),function(e){!function(e){e.Succeeded="succeeded",e.Failed="failed"}(e.AsyncResultStatus||(e.AsyncResultStatus={})),function(e){e.ReadOnly="readOnly",e.ReadWrite="readWrite"}(e.DocumentMode||(e.DocumentMode={})),function(e){e.Word="Word",e.Excel="Excel",e.PowerPoint="PowerPoint",e.Outlook="Outlook",e.OneNote="OneNote",e.Project="Project",e.Access="Access",e.Visio="Visio"}(e.HostType||(e.HostType={})),function(e){e.Inserted="inserted",e.DocumentOpened="documentOpened"}(e.InitializationReason||(e.InitializationReason={})),function(e){e.PC="PC",e.OfficeOnline="OfficeOnline",e.Mac="Mac",e.iOS="iOS",e.Android="Android",e.Universal="Universal"}(e.PlatformType||(e.PlatformType={})),function(e){e.Binding="binding",e.NamedItem="namedItem",e.Slide="slide",e.Index="index"}(e.GoToType||(e.GoToType={})),function(e){e.Default="default",e.Selected="selected",e.None="none"}(e.SelectionMode||(e.SelectionMode={})),function(e){e.Unformatted="unformatted",e.Formatted="formatted"}(e.ValueFormat||(e.ValueFormat={})),function(e){e.Text="text",e.Compressed="compressed",e.Pdf="pdf"}(e.FileType||(e.FileType={})),e.CoercionType={Html:"html",Matrix:"matrix",Ooxml:"ooxml",OoxmlPackage:"ooxmlPackage",PdfFile:"pdfFile",SlideRange:"slideRange",Table:"table",Text:"text"},function(e){e.Table="table",e.Text="text",e.Matrix="matrix"}(e.BindingType||(e.BindingType={})),function(e){e.OnlyVisible="onlyVisible",e.All="all"}(e.FilterType||(e.FilterType={})),function(e){e[e.All=0]="All",e[e.Data=1]="Data",e[e.Headers=2]="Headers"}(e.Table||(e.Table={})),function(e){e.Read="read",e.Edit="edit"}(e.ActiveView||(e.ActiveView={}))}(Office||(Office={}));var OfficeExt,OSFPerfUtil,__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){e.appSpecificCheckOrigin=function(e,t,n,i){return!1}}(OfficeExt||(OfficeExt={})),function(e){var t=function(){function e(e,t,n){this._method=e,this._invokeType=t,this._blockingOthers=n}return e.prototype.getMethod=function(){return this._method},e.prototype.getInvokeType=function(){return this._invokeType},e.prototype.getBlockingFlag=function(){return this._blockingOthers},e}();e.XdmMethodObject=t;var n=function(){function e(e,t){this._registerMethodObject=e,this._unregisterMethodObject=t}return e.prototype.getRegisterMethodObject=function(){return this._registerMethodObject},e.prototype.getUnregisterMethodObject=function(){return this._unregisterMethodObject},e}();e.XdmEventMethodObject=n;var i=function(){function i(e){this._methodObjectList={},this._eventHandlerProxyList={},this._conversations={},this._policyManager=null,this._appDomains={},this._onHandleRequestError=null,this._methodObjectList={},this._eventHandlerProxyList={},this._Id=e,this._conversations={},this._policyManager=null,this._appDomains={},this._onHandleRequestError=null}return i.prototype.registerMethod=function(n,i,r,o){if(0!==r&&1!==r)throw e.Utility.createArgumentException("invokeType");var a=new t(i,r,o);this._methodObjectList[n]=a},i.prototype.unregisterMethod=function(e){delete this._methodObjectList[e]},i.prototype.registerEvent=function(e,i,r){var o=new n(new t(i,4,!1),new t(r,5,!1));this._methodObjectList[e]=o},i.prototype.registerEventEx=function(e,i,r,o,a){var s=new n(new t(i,r,!1),new t(o,a,!1));this._methodObjectList[e]=s},i.prototype.unregisterEvent=function(e){this.unregisterMethod(e)},i.prototype.registerConversation=function(t,n,i){if(e.Utility.xdmDebugLog("registerConversation: cId="+t+" Url="+n),i){if(!Array.isArray(i))throw e.Utility.createArgumentException("appDomains");this._appDomains[t]=i}this._conversations[t]={url:n}},i.prototype.unregisterConversation=function(e){delete this._conversations[e]},i.prototype.setPolicyManager=function(t){if(!t.checkPermission)throw e.Utility.createArgumentException("policyManager");this._policyManager=t},i.prototype.getPolicyManager=function(){return this._policyManager},i.prototype.dispose=function(){this._methodObjectList=null,this._eventHandlerProxyList=null,this._Id=null,this._conversations=null,this._policyManager=null,this._appDomains=null,this._onHandleRequestError=null},i}();e.XdmServiceEndPoint=i;var r,o=function(){function e(e,t,n){this._callbackList={},this._eventHandlerList={},this._hostTrustCheckStatus=0,this._checkStatusLogged=!1,this._fHostTrusted=!1,this._conversationId=e,this._targetWindow=t,this._targetUrl=n,this._callingIndex=0,this._callbackList={},this._eventHandlerList={},this._checkReceiverOriginAndRun=null}return Object.defineProperty(e.prototype,"targetUrl",{get:function(){return this._targetUrl},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostTrustCheckStatus",{get:function(){return this._hostTrustCheckStatus},set:function(e){this._hostTrustCheckStatus=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fHostTrusted",{get:function(){return this._fHostTrusted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checkStatusLogged",{get:function(){return this._checkStatusLogged},set:function(e){this._checkStatusLogged=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checkReceiverOriginAndRun",{get:function(){return this._checkReceiverOriginAndRun},set:function(e){this._checkReceiverOriginAndRun=e},enumerable:!0,configurable:!0}),e.prototype.invoke=function(e,t,n){var i=this,o=function(){var o=i._callingIndex++,a=new Date,c={callback:t,createdOn:a.getTime()};n&&"object"==typeof n&&"number"==typeof n.__timeout__&&(c.timeout=n.__timeout__,delete n.__timeout__),i._callbackList[o]=c;try{if(3!==i._hostTrustCheckStatus&&"ContextActivationManager_getAppContextAsync"!==e)throw"Access Denied";var u=new s(e,0,i._conversationId,o,n),f=l.envelope(u);i._targetWindow.postMessage(f,i._targetUrl),r._startMethodTimeoutTimer()}catch(e){try{null!==t&&t(-1,e)}finally{delete i._callbackList[o]}}};this._checkReceiverOriginAndRun?this._checkReceiverOriginAndRun(o):(this._hostTrustCheckStatus=3,o())},e.prototype.registerForEvent=function(e,t,n,i){var o=this._callingIndex++,a=new Date;this._callbackList[o]={callback:n,createdOn:a.getTime()};try{var c=new s(e,1,this._conversationId,o,i),u=l.envelope(c);this._targetWindow.postMessage(u,this._targetUrl),r._startMethodTimeoutTimer(),this._eventHandlerList[e]=t}catch(e){try{null!==n&&n(-1,e)}finally{delete this._callbackList[o]}}},e.prototype.unregisterForEvent=function(e,t,n){var i=this._callingIndex++,o=new Date;this._callbackList[i]={callback:t,createdOn:o.getTime()};try{var a=new s(e,2,this._conversationId,i,n),c=l.envelope(a);this._targetWindow.postMessage(c,this._targetUrl),r._startMethodTimeoutTimer()}catch(e){try{null!==t&&t(-1,e)}finally{delete this._callbackList[i]}}finally{delete this._eventHandlerList[e]}},e}();e.XdmClientEndPoint=o,function(t){var n=[],r=null,a=null,s=!1,u={},p={},h=!1;function g(){null!==a?s||(n.length>0?m(n.shift()):(clearInterval(a),a=null)):e.Utility.xdmDebugLog("channel is not ready.")}function m(e){s=e.getInvokeBlockingFlag(),e.invoke(),r=(new Date).getTime()}function v(){s=!1}function y(t,n){var i=!1;if(!(n&&"null"!==n&&n.length&&t&&t instanceof Array&&t.length))return i;for(var r=0;r<t.length&&!i;r++)if(-1!==t[r].indexOf("://")){var o=e.OUtil.parseUrl(n,!0);i=S(e.OUtil.parseUrl(t[r],!0),o)}return i}function O(t){if(!t||"null"===t)return!1;var n=new Array("^outlook\\.office\\.com$","^outlook-sdf\\.office\\.com$","^outlook\\.office\\.com$","^outlook-sdf\\.office\\.com$","^outlook\\.live\\.com$","^outlook-sdf\\.live\\.com$","^consumer\\.live-int\\.com$","^outlook-tdf\\.live\\.com$","^sdfpilot\\.live\\.com$","^outlook\\.office365\\.us$","^outlook\\.office365\\.com$","^exchangelabs\\.live-int\\.com$","^.*\\.dod\\.online\\.office365\\.us$","^.*\\.gov\\.online\\.office365\\.us$","^.*\\.officeapps\\.live\\.com$","^.*\\.officeapps-df\\.live\\.com$","^"+document.domain.replace(new RegExp("\\.","g"),"\\.")+"$");return!0===e.OUtil.getCustomOfficeInitializationSettings().trustAllCloudEnvironments&&n.push("^partner\\.outlook\\.cn$","^.*\\.partner\\.officewebapps\\.cn$"),new RegExp(n.join("|")).test(t)}function b(t,n){if(!t||!n||"null"===t||"null"===n)return!1;var i=e.OUtil.parseUrl(t,!0),r=e.OUtil.parseUrl(n,!0);if(null==i||null==r)return!1;var o=i.protocol===r.protocol,a=i.port===r.port,s=r.hostname,c=i.hostname,l=s===c,u=!1;return!l&&s.length>c.length+1&&(u=s.slice(-(c.length+1))==="."+c),a&&o&&(l||u)}function S(e,t){return e.hostname==t.hostname&&e.protocol==t.protocol&&e.port==t.port}function _(t){if(""!=t.data){var i,o=t.data;try{i=l.unenvelope(o)}catch(e){return}if(e.Utility.xdmDebugLog(o),0===i._messageType){var h=null==t.origin||"null"===t.origin?i._origin:t.origin;try{var _=function(t){for(var n in u)if(u[n]._conversations[t])return u[n];throw e.Utility.createArgumentException("conversationId")}(i._conversationId);e.Utility.xdmDebugLog("_receive: request, origin="+h+" sourceURL:"+_._conversations[i._conversationId]);var A=_._conversations[i._conversationId];e.Utility.xdmDebugLog("_receive: request, origin="+h+" sourceURL:"+A.url);var C=[A.url].concat(_._appDomains[i._conversationId]);if(!y(C,t.origin))if(!OfficeExt.appSpecificCheckOrigin(C,t,i._origin,y))if(!b(A.url,t.origin))throw"Failed origin check";var E=_.getPolicyManager();if(E&&!E.checkPermission(i._conversationId,i._actionName,i._data))throw"Access Denied";var I=function(t,n){var i=t._methodObjectList[n._actionName];if(!i)throw e.Utility.xdmDebugLog("The specified method is not registered on service endpoint:"+n._actionName),e.Utility.createArgumentException("messageObject");return 0===n._actionType?i:1===n._actionType?i.getRegisterMethodObject():i.getUnregisterMethodObject()}(_,i),w=new f(t.source,h,i._actionName,i._conversationId,i._correlationId,v),P=new d(I,i._data,w,_._eventHandlerProxyList,i._conversationId,i._actionName),x=!0;null==a&&((null==r||(new Date).getTime()-r>10)&&!s?(m(P),x=!1):a=setInterval(g,10)),x&&function(e){n.push(e)}(P)}catch(n){_&&_._onHandleRequestError&&_._onHandleRequestError(i,n);var T=-2;"Access Denied"==n&&(T=-5);var R=new c(i._actionName,i._conversationId,i._correlationId,T,0,n),F=l.envelope(R),k=!1;try{k=!(!t.source||!t.source.postMessage)}catch(e){}var N=!1;if(window.location.href&&t.origin&&"null"!==t.origin&&b(window.location.href,t.origin))N=!0;else if(t.origin&&"null"!==t.origin)N=O(e.OUtil.parseUrl(t.origin,!0).hostname);k&&N&&t.source.postMessage(F,h)}}else{if(1!==i._messageType)return;var M=function(t){var n=p[t];return n||e.Utility.xdmDebugLog("Unknown conversation Id."),n}(i._conversationId);if(!M)return;if(e.Utility.xdmDebugLog("_receive: response, origin="+t.origin+" targetURL:"+M._targetUrl),U=M._targetUrl,H=t.origin,!(U&&H&&"null"!==U&&"null"!==H&&U.length&&H.length&&S(e.OUtil.parseUrl(U,!0),e.OUtil.parseUrl(H,!0))))throw"Failed orgin check";if(3==M._hostTrustCheckStatus&&(M._fHostTrusted=!0),0===i._responseType){var D=M._callbackList[i._correlationId];if(D)try{D.callback&&D.callback(i._errorCode,i._data)}finally{delete M._callbackList[i._correlationId]}}else{var j=M._eventHandlerList[i._actionName];null!=j&&j(i._data)}}}var U,H}function A(){h||(!function(t){if(window.addEventListener)window.addEventListener("message",t,!1);else{if(!(navigator.userAgent.indexOf("MSIE")>-1&&window.attachEvent))throw e.Utility.xdmDebugLog("Browser doesn't support the required API."),e.Utility.createArgumentException("Browser");window.attachEvent("onmessage",t)}}(_),h=!0)}t.connect=function(e,t,n){var i=p[e];return i||(A(),i=new o(e,t,n),p[e]=i),i},t.getClientEndPoint=function(e){return p[e]},t.createServiceEndPoint=function(e){A();var t=new i(e);return u[e]=t,t},t.getServiceEndPoint=function(e){return u[e]},t.deleteClientEndPoint=function(e){delete p[e]},t.deleteServiceEndPoint=function(e){delete u[e]},t.checkUrlWithAppDomains=function(e,t){return y(e,t)},t.isTargetSubdomainOfSourceLocation=function(e,t){return b(e,t)},t._setMethodTimeout=function(e){e<=0?65e3:e},t._startMethodTimeoutTimer=function(){},t.isHostNameValidWacDomain=function(e){return O(e)}}(r=e.XdmCommunicationManager||(e.XdmCommunicationManager={}));var a=function(){function e(e,t,n,i,r){this._messageType=e,this._actionName=t,this._conversationId=n,this._correlationId=i,this._origin=window.location.origin,this._data=void 0===r?null:r}return e.prototype.getActionName=function(){return this._actionName},e.prototype.getConversationId=function(){return this._conversationId},e.prototype.getCorrelationId=function(){return this._correlationId},e.prototype.getOrigin=function(){return this._origin},e.prototype.getData=function(){return this._data},e.prototype.getMessageType=function(){return this._messageType},e}(),s=function(e){function t(t,n,i,r,o){var a=e.call(this,0,t,i,r,o)||this;return a._actionType=n,a}return __extends(t,e),t.prototype.getActionType=function(){return this._actionType},t}(a),c=function(e){function t(t,n,i,r,o,a){var s=e.call(this,1,t,n,i,a)||this;return s._errorCode=r,s._responseType=o,s}return __extends(t,e),t.prototype.getErrorCode=function(){return this._errorCode},t.prototype.getResponseType=function(){return this._responseType},t}(a),l=function(){function e(){}return e.envelope=function(e){return JSON.stringify(e)},e.unenvelope=function(e){return JSON.parse(e)},e}(),u=function(){function t(t,n,i,r,o,a){var s=this;this._invokeResultCode=0,this._requesterWindow=t,this._requesterUrl=n,this._actionName=i,this._conversationId=r,this._correlationId=o,this._invokeResultCode=0,this._responseType=a,this._send=function(t){try{var n=new c(s._actionName,s._conversationId,s._correlationId,s._invokeResultCode,s._responseType,t),i=l.envelope(n);s._requesterWindow.postMessage(i,s._requesterUrl),e.Utility.xdmDebugLog("_send: requestUrl="+s._requesterUrl+" _actionName:"+s._actionName)}catch(t){e.Utility.xdmDebugLog("ResponseSender._send error:"+t.message)}}}return t.prototype.getRequesterWindow=function(){return this._requesterWindow},t.prototype.getRequesterUrl=function(){return this._requesterUrl},t.prototype.getActionName=function(){return this._actionName},t.prototype.getConversationId=function(){return this._conversationId},t.prototype.getCorrelationId=function(){return this._correlationId},t.prototype.getSend=function(){return this._send},t.prototype.setResultCode=function(e){this._invokeResultCode=e},t}(),f=function(t){function n(n,i,r,o,a,s){var u=t.call(this,n,i,r,o,a,0)||this;return u._postCallbackHandler=s,u._send=function(t,n){null!=n&&(u._invokeResultCode=n);try{var i=new c(u._actionName,u._conversationId,u._correlationId,u._invokeResultCode,u._responseType,t),r=l.envelope(i);u._requesterWindow.postMessage(r,u._requesterUrl),u._postCallbackHandler()}catch(t){e.Utility.xdmDebugLog("InvokeCompleteCallback._send error:"+t.message)}},u}return __extends(n,t),n}(u),d=function(){function e(e,t,n,i,r,o){this._callerId="",this._methodObject=e,this._param=t,this._invokeCompleteCallback=n,this._eventHandlerProxyList=i,this._conversationId=r,this._eventName=o}return e.prototype.invoke=function(){try{var e;switch(this._methodObject.getInvokeType()){case 0:this._methodObject.getMethod()(this._param,this._invokeCompleteCallback.getSend());break;case 1:e=this._methodObject.getMethod()(this._param),this._invokeCompleteCallback.getSend()(e);break;case 4: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 5: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 2: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 3:var r=this._eventHandlerProxyList[this._callerId+this._eventName];this._methodObject.getMethod()(r,this._invokeCompleteCallback.getSend(),this._param),delete this._eventHandlerProxyList[this._callerId+this._eventName]}}catch(e){this._invokeCompleteCallback.setResultCode(-3),this._invokeCompleteCallback.getSend()(e)}},e.prototype.getInvokeBlockingFlag=function(){return this._methodObject.getBlockingFlag()},e.prototype._createEventHandlerProxyObject=function(e){return new u(e.getRequesterWindow(),e.getRequesterUrl(),e.getActionName(),e.getConversationId(),e.getCorrelationId(),1)},e}()}(OSF||(OSF={})),function(e){function t(e,t){return t+="_Resource",void 0!==oteljs?[oteljs.makeDoubleDataField(t+"_responseEnd",e.responseEnd),oteljs.makeDoubleDataField(t+"_responseStart",e.responseStart),oteljs.makeDoubleDataField(t+"_startTime",e.startTime),oteljs.makeDoubleDataField(t+"_transferSize",e.transferSize)]:[]}e.sendPerformanceTelemetry=function(){if(OSF.AppTelemetry.enableTelemetry&&"undefined"!=typeof performance&&performance.getEntriesByType){var e,n,i=OSF.LoadScriptHelper.getHostBundleJsName().toLowerCase();performance.getEntriesByType("resource").forEach((function(t){var r=t.name.toLowerCase();OSF.Utility.stringEndsWith(r,i)?e=t:(OSF.Utility.stringEndsWith(r,OSF.ConstantNames.OfficeDebugJS)||OSF.Utility.stringEndsWith(r,OSF.ConstantNames.OfficeJS))&&(n=t)})),OTel.OTelLogger.onTelemetryLoaded((function(){var i=[];e&&(i=i.concat(t(e,"HostJs"))),n&&(i=i.concat(t(n,"OfficeJs"))),i=i.concat([oteljs.makeDoubleDataField("officeExecuteStartDate",OSFPerformance.officeExecuteStartDate),oteljs.makeDoubleDataField("officeExecuteStart",OSFPerformance.officeExecuteStart),oteljs.makeDoubleDataField("officeExecuteEnd",OSFPerformance.officeExecuteEnd),oteljs.makeDoubleDataField("hostInitializationStart",OSFPerformance.hostInitializationStart),oteljs.makeDoubleDataField("hostInitializationEnd",OSFPerformance.hostInitializationEnd),oteljs.makeDoubleDataField("totalJSHeapSize",OSFPerformance.totalJSHeapSize),oteljs.makeDoubleDataField("usedJSHeapSize",OSFPerformance.usedJSHeapSize),oteljs.makeDoubleDataField("jsHeapSizeLimit",OSFPerformance.jsHeapSizeLimit),oteljs.makeDoubleDataField("getAppContextStart",OSFPerformance.getAppContextStart),oteljs.makeDoubleDataField("getAppContextEnd",OSFPerformance.getAppContextEnd),oteljs.makeDoubleDataField("getAppContextXdmStart",OSFPerformance.getAppContextXdmStart),oteljs.makeDoubleDataField("getAppContextXdmEnd",OSFPerformance.getAppContextXdmEnd),oteljs.makeDoubleDataField("createOMEnd",OSFPerformance.createOMEnd),oteljs.makeDoubleDataField("officeOnReady",OSFPerformance.officeOnReady),oteljs.makeBooleanDataField("isSharedRuntime",0!=(OSF._OfficeAppFactory.getHostInfo().flags&OSF.HostInfoFlags.SharedApp))]),Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.JSPerformanceTelemetryV06",dataFields:i,eventFlags:{dataCategories:2,diagnosticLevel:110}})}))}}}(OSFPerfUtil||(OSFPerfUtil={})),function(e){!function(t){var n,i,r={};!function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];e.generateNewGuid=function(){for(var e="",n=(new Date).getTime(),i=0;i<32&&n>0;i++)8!=i&&12!=i&&16!=i&&20!=i||(e+="-"),e+=t[n%16],n=Math.floor(n/16);for(;i<32;i++)8!=i&&12!=i&&16!=i&&20!=i||(e+="-"),e+=t[Math.floor(16*Math.random())];return e}}(t.Guid||(t.Guid={})),t.loadScript=function(e,t,n,i){if(e&&t){var o=window.document,a=r[e];if(a)a.loaded?t(!0):a.pendingCallbacks.push(t);else{var s=o.createElement("script");s.type="text/javascript",a={loaded:!1,pendingCallbacks:[t],timer:null},r[e]=a;var c=function(){null!=a.timer&&(clearTimeout(a.timer),delete a.timer),a.loaded=!0;for(var e=a.pendingCallbacks.length,t=0;t<e;t++){a.pendingCallbacks.shift()(!0)}},l=function(){delete r[e],null!=a.timer&&(clearTimeout(a.timer),delete a.timer);for(var t=a.pendingCallbacks.length,n=0;n<t;n++){a.pendingCallbacks.shift()(!1)}};s.readyState?s.onreadystatechange=function(){"loaded"!=s.readyState&&"complete"!=s.readyState||(s.onreadystatechange=null,c())}:s.onload=c,s.onerror=l,i=i||3e4,a.timer=setTimeout(l,i),s.setAttribute("crossOrigin","anonymous"),s.src=n?n.createScriptURL(e):e,o.getElementsByTagName("head")[0].appendChild(s)}}},t.getSessionStorage=function(){if(!n){try{var t=window.sessionStorage}catch(e){t=null}n=new e.SafeStorage(t)}return n},t.getLocalStorage=function(){if(!i){try{var t=window.localStorage}catch(e){t=null}i=new e.SafeStorage(t)}return i},t.waitForFunction=function(e,t,n,i){var r,o=n,a=function(){o--,e()?t(!0):o>0?(r=window.setTimeout(a,i),o--):(window.clearTimeout(r),t(!1))};a()}}(e.OUtil||(e.OUtil={}))}(OSF||(OSF={})),function(e){e.Flights=[],e.DisabledChangeGates=[];e.FlightTreatmentNames={EnableMsal3SsoApi:"Microsoft.Office.SharedOnline.EnableMsal3SsoApi"},function(t){var n="&_flights=",i="&_disabledChangeGates=",r="_flights=",o="_disabledChangeGates=";function a(e,t){return e.substr(0,t.length)===t}function s(e,t,n,i){return a(e,t+"//"+n+":"+i)||a(e,n+":"+i)}t.isArray=function(e){return"[object Array]"===Object.prototype.toString.apply(e)},t.isFunction=function(e){return"[object Function]"===Object.prototype.toString.apply(e)},t.isDate=function(e){return"[object Date]"===Object.prototype.toString.apply(e)},t.addEventListener=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else{if(!e.attachEvent)throw new Error("Cannot attach event");e.attachEvent("on"+t,n)}},t.removeEventListener=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else{if(!e.detachEvent)throw new Error("Cannot remove event");e.detachEvent("on"+t,n)}};var c="Date(";function l(e){var t=[];try{t=JSON.parse(e)}catch(e){}return Array.isArray(t)||(t=[]),t}function u(e,n,i){try{var r=JSON.parse(n),o=null!=r?r[i]:null,a=t.getSessionStorage();if(!e&&a&&null!=r){var s=r.baseFrameName+i;o?a.setItem(s,o):o=a.getItem(s)}return o}catch(e){return null}}function f(e,n,i,r,o){var a=o.split(e),s=a.length>1?a[a.length-1]:null;i&&null!=s&&(s.indexOf("&")>=0&&(s=s.split("&")[0]),s=decodeURIComponent(s));var c=t.getSessionStorage();if(!r&&c){var l=window.name.indexOf(n);if(l>-1){var u=window.name.indexOf(";",l);-1==u&&(u=window.name.length);var f=window.name.substring(l,u);s?c.setItem(f,s):s=c.getItem(f)}}return s}function d(e,t){for(var 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}function p(e){if(e=d(e,"/"),e=d(e,"?"),"https://"==(e=d(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}function h(e){var t,n,i=[],r=[],o=e.length;for(t=0;t<o;t++)(n=e[t]).tabIndex?n.tabIndex>0?r.push(n):0===n.tabIndex&&i.push(n):i.push(n);return r=r.sort((function(e,t){var n=e.tabIndex-t.tabIndex;return 0===n&&(n=r.indexOf(e)-r.indexOf(t)),n})),[].concat(r,i)}t.serializeSettings=function(t){var n={};for(var i in t){var r=t[i];try{r=JSON.stringify(r,(function(t,n){return e.OUtil.isDate(this[t])?c+this[t].getTime()+")":n})),n[i]=r}catch(e){}}return n},t.deserializeSettings=function(e){var t={};for(var n in e=e||{}){var i=e[n];try{i=JSON.parse(i,(function(e,t){var n;return"string"==typeof t&&t&&t.length>6&&t.slice(0,5)===c&&")"===t.slice(-1)&&(n=new Date(parseInt(t.slice(5,-1))))?n:t})),t[n]=i}catch(e){}}return t},t.convertIntToCssHexColor=function(e){return"#"+(Number(e)+16777216).toString(16).slice(-6)},t.parseAppContextFromWindowName=function(e,n){return t.parseInfoFromWindowName(e,n,"appContext")},t.parseHostInfoFromWindowName=function(t,n){return e.OUtil.parseInfoFromWindowName(t,n,"hostInfo")},t.parseXdmInfo=function(e){var n=t.parseXdmInfoWithGivenFragment(e,window.location.hash);return n||(n=t.parseXdmInfoFromWindowName(e,window.name)),n},t.parseXdmInfoFromWindowName=function(t,n){return e.OUtil.parseInfoFromWindowName(t,n,"xdmInfo")},t.parseXdmInfoWithGivenFragment=function(t,n){return e.OUtil.parseInfoWithGivenFragment("&_xdm_Info=","_xdm_",!1,t,n)},t.parseFlights=function(e){var t=function(e,t){return l(f(n,r,!0,e,t))}(e,window.location.hash);return 0==t.length&&(t=function(e,t){return l(u(e,t,"flights"))}(e,window.name)),t},t.parseDisabledChangeGates=function(e){var t=function(e,t){return l(f(i,o,!0,e,t))}(e,window.location.hash);return 0==t.length&&(t=function(e,t){return l(u(e,t,"disabledChangeGates"))}(e,window.name)),t},t.checkFlight=function(t){return e.Flights&&e.Flights.indexOf(t)>=0},t.isChangeGateEnabled=function(t){return!e.DisabledChangeGates||-1===e.DisabledChangeGates.indexOf(t)},t.parseInfoFromWindowName=u,t.parseInfoWithGivenFragment=f,t.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},t.getInfoItems=function(e){var t=e.split("$");return void 0===t[1]&&(t=e.split("|")),void 0===t[1]&&(t=e.split("%7C")),t},t.getXdmFieldValue=function(t,n){var i="",r=e.OUtil.parseXdmInfo(n);if(r){var o=e.OUtil.getInfoItems(r);if(null!=o&&o.length>=3)switch(t){case"ConversationUrl":i=o[2];break;case"AppId":i=o[1]}}return i},t.parseUrl=function(t,n){if(void 0===n&&(n=!1),void 0!==t&&t){var i="NotHttps",r="undefined"!=typeof window&&void 0!==window.navigator&&window.navigator.userAgent.indexOf("Trident")>0,o=("undefined"!=typeof window&&void 0!==window.navigator&&window.navigator.userAgent.indexOf("Edge"),{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(r){var a=document.createElement("a");if(a.href=t,!(a&&a.protocol&&a.host&&a.hostname&&a.href&&p(a.href).toLowerCase()===p(t).toLowerCase()))throw"InvalidUrl";if(e.OUtil.checkFlight(2)&&n&&"https:"!=a.protocol)throw new Error(i);var c=function(e,t){return e&&t?"https:"==t.protocol&&s(e,"https:",t.hostname,"443")?":443":"http:"==t.protocol&&s(e,"http:",t.hostname,"80")?":80":"":""}(t,a);o.protocol=a.protocol,o.hostname=a.hostname,o.port=""==c?a.port:"",o.host=""!=c?a.hostname:a.host,o.pathname=(r?"/":"")+a.pathname,o.search=a.search,o.hash=a.hash,o.isPortPartOfUrl=s(t,a.protocol,a.hostname,a.port)}else{var l=new URL(t);if(l&&l.protocol&&l.host&&l.hostname){if(e.OUtil.checkFlight(2)&&n&&"https:"!=l.protocol)throw new Error(i);o.protocol=l.protocol,o.hostname=l.hostname,o.port=l.port,o.host=l.host,o.pathname=l.pathname,o.search=l.search,o.hash=l.hash,o.isPortPartOfUrl=l.host.lastIndexOf(":"+l.port)==l.host.length-l.port.length-1}}}catch(e){if(e.message===i)throw e}return o}},t.focusToFirstTabbable=function(e,t){var n,i,r=!1,o=function(e){r=!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=h(e),n=t?e.length-1:0,0===e.length)return null;for(;!r&&n>=0&&n<e.length;)i=e[n],window.focus(),i.addEventListener("focus",o),i.focus(),i.removeEventListener("focus",o),n=a(e.length,n,t),r||i!==document.activeElement||(r=!0);return r?i:null},t.focusToNextTabbable=function(e,t,n){var i,r,o,a=!1,s=function(e){a=!0},c=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=h(e),t),(r=c(e.length,i,n))<0)return null;for(;!a&&r>=0&&r<e.length;)(o=e[r]).addEventListener("focus",s),o.focus(),o.removeEventListener("focus",s),r=c(e.length,r,n),a||o!==document.activeElement||(a=!0);return a?o:null},t.defineMethodOnNamespace=function(e,t,n){e[t]=n},t.isDialog=function(){return e._OfficeAppFactory.getHostInfo().isDialog},t.isPopupWindow=function(){return e.OUtil.isDialog()&&e._OfficeAppFactory.getHostInfo().hostPlatform==e.HostInfoPlatform.web&&null!=window.opener},t.getHostPlatform=function(){return e._OfficeAppFactory.getHostInfo().hostPlatform},t.getCustomOfficeInitializationSettings=function(){return"object"==typeof officeInitializationSettings?officeInitializationSettings:{}};var g=0;t.getLibraryReleaseVehicle=function(){return g},t.setLibraryReleaseVehicle=function(e){g=e}}(e.OUtil||(e.OUtil={}))}(OSF||(OSF={})),function(e){!function(e){e.Callback="callback",e.AsyncContext="asyncContext",e.Data="data",e.MessageToParent="messageToParent",e.MessageContent="messageContent",e.MessageOrigin="messageOrigin",e.TargetOrigin="targetOrigin",e.AppCommandInvocationCompletedData="appCommandInvocationCompletedData"}(e.ParameterNames||(e.ParameterNames={}))}(OSF||(OSF={})),function(e){!function(t){var n=function(){};t.RequirementVersion=n;var i=function(){function e(e){this._setMap=e}return e.prototype.isSetSupported=function(e,t){if(null==e)return!1;null==t&&(t=0);var n=this._setMap._sets;if(n.hasOwnProperty(e.toLowerCase())){var i=n[e.toLowerCase()];try{var r=this._getVersion(i+"");t+="";var o=this._getVersion(t);if(r.major>0&&r.major>o.major)return!0;if(r.major>0&&r.minor>=0&&r.major==o.major&&r.minor>=o.minor)return!0}catch(e){return!1}}return!1},e.prototype._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}},e}();t.RequirementMatrix=i;var r=function(){function e(e){this._sets=e}return e.prototype._addSetMap=function(e){for(var t in e)this._sets[t]=e[t]},e}();t.DefaultSetRequirement=r;var o=function(e){function t(){return e.call(this,{dialogapi:1.1})||this}return __extends(t,e),t}(r);t.DefaultRequiredDialogSetRequirement=o;var a=function(e){function t(){return e.call(this,{dialogorigin:1.1})||this}return __extends(t,e),t}(r);t.DefaultOptionalDialogSetRequirement=a;var s=function(){function t(){}return t.getDefaultRequirementMatrix=function(t){var n=void 0,o=t.get_requirementMatrix();if(null!=o&&o.length>0){var a=JSON.parse(t.get_requirementMatrix().toLowerCase());if(e._OfficeAppFactory.getHostInfo().hostPlatform==e.HostInfoPlatform.web)try{var s="dialogorigin";a.hasOwnProperty(s)||(a[s]=1.1)}catch(e){}n=new i(new r(a))}else n=new i(new r({}));return n},t.getDefaultDialogRequirementMatrix=function(t){var n=void 0,s=t.get_dialogRequirementMatrix();if(null!=s&&s.length>0){var c=JSON.parse(t.get_requirementMatrix().toLowerCase());n=new r(c)}else{n=new o;var l=t.get_requirementMatrix();if(null!=l&&l.length>0&&"undefined"!=typeof JSON){c=JSON.parse(l.toLowerCase());for(var u in n._sets)c.hasOwnProperty(u)&&(n._sets[u]=c[u]);var f=new a;for(var u in f._sets)c.hasOwnProperty(u)&&(n._sets[u]=c[u])}}if(e._OfficeAppFactory.getHostInfo().hostPlatform==e.HostInfoPlatform.web)try{var d="dialogorigin";!n._sets.hasOwnProperty(d)&&window.opener&&(n._sets[d]=1.1)}catch(e){}return new i(n)},t}();t.RequirementsMatrixFactory=s}(e.Requirement||(e.Requirement={}))}(OSF||(OSF={})),function(e){!function(t){!function(t){var n;t.executeRichApiRequestAsync=function(t,n){var i={toSafeArrayHost:function(){return[t]},fromSafeArrayHost:function(e){return{data:e}},toWebHost:function(){return{ArrayData:t}},fromWebHost:function(e){return{data:e.Data}}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(93,i,n)},Object.defineProperty(t,"richApiMessageManager",{get:function(){return n||(n=new e.RichApiMessageManager),n}})}(t.RichApi||(t.RichApi={}))}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){var t=function(){function t(){this._registerHandlers=[],this._eventDispatch=new e.EventDispatch([{type:e.EventType.RichApiMessage,id:e.EventDispId.dispidRichApiMessageEvent,getTargetId:function(){return""},fromSafeArrayHost:function(e){var n=e;return t.transferEventArgument(n)},fromWebHost:function(e){var n=e.ArrayData;return t.transferEventArgument(n)}}])}return t.transferEventArgument=function(t){var n=[];if(t)for(var i=0;i<t.length;i++){var r=t[i];r.toArray&&(r=r.toArray()),n.push({messageCategory:r[0],messageType:r[1],targetId:r[2],message:r[3],id:r[4],isRemoteOverride:r[5]})}return{type:e.EventType.RichApiMessage,entries:n}},t.prototype.addHandlerAsync=function(t,n,i){e.EventHelper.addEventHandler(t,n,i,this._eventDispatch)},t.prototype.removeHandlerAsync=function(t,n,i){e.EventHelper.removeEventHandler(t,n,i,this._eventDispatch)},t.prototype.register=function(t){var n=this;return this._registerPromise||(this._registerPromise=new Office.Promise((function(t,i){n.addHandlerAsync(e.EventType.RichApiMessage,(function(e){n._registerHandlers.forEach((function(t){t&&t(e)}))}),(function(e){"failed"==e.status?i(e.error):t()}))}))),this._registerPromise.then((function(){n._registerHandlers.push(t)}))},t}();e.RichApiMessageManager=t}(OSF||(OSF={})),function(e){var t=function(){function t(){}return t.prototype.execute=function(e,t,n){"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.Execute(e,t,n,OsfOMToken):window.external.Execute(e,t,n)},t.prototype.registerEvent=function(e,t,n,i,r){"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.RegisterEvent(e,n,i,r,OsfOMToken):window.external.RegisterEvent(e,n,i,r)},t.prototype.unregisterEvent=function(e,t,n,i){"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.UnregisterEvent(e,n,i,OsfOMToken):window.external.UnregisterEvent(e,n,i)},t.prototype.closeSdxDialog=function(t){throw e.Utility.createNotImplementedException()},t.prototype.resizeSdxDialog=function(t,n){throw e.Utility.createNotImplementedException()},t}();e.RichClientHostController=t}(OSF||(OSF={})),function(e){var t=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.officeThemeTimeStamp=null,e.officeTheme=null,e}return __extends(n,t),n.prototype.getOsfControlContext=function(){if(!this._osfControlContext){var t="Warning: Office.js is loaded outside of Office client";try{if(!window.external)return console.error("There is no window.external."),e.Utility.trace(t),null;this._osfControlContext=window.external.GetContext()}catch(n){return console.error("Error when call window.external.GetContext() :"+JSON.stringify(n)),e.Utility.trace(t),null}}return this._osfControlContext},n.prototype.getAppContext=function(t,n,i){var r=this,o=this.getOsfControlContext();if(o){var a,s,c,l,u,f,d,p,h,g,m,v,y,O,b,S,_,A,C,E,I,w,P,x,T,R,F=0,k=!1;if((N=e.Utility.externalNativeFunctionExists)(typeof o.GetContextDataInJson))if("undefined"!=typeof OsfOMToken&&OsfOMToken)if((T=o.GetContextDataInJson(OsfOMToken))&&(R=JSON.parse(T)),R)a=R.appType,s=R.solutionRef,c=R.versionMajor,l=R.versionMinor,u=R.uiLocale,f=R.dataLocale,d=R.docUrl,p=R.clientMode,h=R.activationMode,m=R.controlType,v=R.eToken,y=R.correlationId,O=R.appInstanceId,b=R.touchEnabled,S=o.commerceAllowed,_=R.requirementMatrix,C=R.hostFullVersion,E=R.requirementMatrix,(M=R.featureGates)&&(I=JSON.parse(M)),F=R.initialDisplayMode,w=function(){var t={};if(R.settings)try{var n=JSON.parse(R.settings);if(n)for(var i=[n.names,n.values],r=i[0],o=i[1],a=0;a<r.length;a++)t[r[a]]=o[a]}catch(t){e.Utility.trace("Exception while parsing settings. Details: "+t)}return t},P=function(){var e=R.themeInfo;return r.getOfficeThemeFromInfoString(e)};else k=!0;else k=!0;else k=!0;if(k){a=o.GetAppType(),s=o.GetSolutionRef(),c=o.GetAppVersionMajor(),l=o.GetAppVersionMinor(),u=o.GetAppUILocale(),f=o.GetAppDataLocale(),d=o.GetDocUrl(),p=o.GetAppCapabilities(),h=o.GetActivationMode(),m=o.GetControlIntegrationLevel();try{v=o.GetSolutionToken()}catch(e){}var N;if((N=e.Utility.externalNativeFunctionExists)(typeof o.GetCorrelationId)&&(y=o.GetCorrelationId()),N(typeof o.GetInstanceId)&&(O=o.GetInstanceId()),N(typeof o.GetTouchEnabled)&&(b=o.GetTouchEnabled()),N(typeof o.GetCommerceAllowed)&&(S=o.GetCommerceAllowed()),N(typeof o.GetSupportedMatrix)&&(_=o.GetSupportedMatrix()),N(typeof o.GetHostCustomMessage)&&(A=o.GetHostCustomMessage()),N(typeof o.GetHostFullVersion)&&(C=o.GetHostFullVersion()),N(typeof o.GetDialogRequirementMatrix)&&(E=o.GetDialogRequirementMatrix()),N(typeof o.GetFeaturesForSolution))try{var M;(M=o.GetFeaturesForSolution())&&(I=JSON.parse(M))}catch(t){e.Utility.trace("Exception while creating the SDX FeatureGates object. Details: "+t)}N(typeof o.GetInitialDisplayMode)&&(F=o.GetInitialDisplayMode()),w=function(){return r.getSerializedSettings()},P=function(){return r.getOfficeTheme()},x=function(){return r.getSerializedHostSettings()}}g=2===h?Office.InitializationReason.DocumentOpened:Office.InitializationReason.Inserted,v=v?v.toString():"",n(new e.OfficeAppContext(s,a,c,u,f,d,p,w,g,m,v,y,O,b,S,l,_,A,C,void 0,void 0,void 0,void 0,E,I,P,F,void 0,void 0,x,!1,void 0,void 0))}else i(new Error("The Office.js is loaded outside of Office client"))},n.prototype.createClientHostController=function(){if(!this._clientHostController){if(this._hostInfo.hostPlatform!==e.HostInfoPlatform.win32)throw e.Utility.createNotImplementedException();this._clientHostController=new e.Win32RichClientHostController}return this._clientHostController},n.prototype.createAsyncMethodExecutor=function(){return new e.SafeArrayAsyncMethodExecutor(this._clientHostController)},n.prototype.createClientSettingsManager=function(){return new e.RichClientSettingsManager(this.getOsfControlContext())},n.prototype.getSerializedSettings=function(){var e=this.getOsfControlContext(),t=[],n=[];"undefined"!=typeof OsfOMToken&&OsfOMToken?e.GetSettings(OsfOMToken).Read(t,n):e.GetSettings().Read(t,n);for(var i={},r=0;r<t.length;r++)i[t[r]]=n[r];return i},n.prototype.getOfficeTheme=function(){var e=this.getOsfControlContext();if(e){if(!(this.officeTheme&&this.officeThemeTimeStamp&&(new Date).getTime()-this.officeThemeTimeStamp<n.officeThemeCacheValidPeriod)){var t=e.GetOfficeThemeInfo();this.officeTheme=this.getOfficeThemeFromInfoString(t),this.officeThemeTimeStamp=(new Date).getTime()}return this.officeTheme}},n.prototype.getOfficeThemeFromInfoString=function(t){var n=null;if(t)try{n=JSON.parse(t)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception while parsing officeThemeInfo. Details: "+t)}var i={};if(n){var r={bodyBackgroundColor:{name:"bodyBackgroundColor",convertToHex:!0},bodyForegroundColor:{name:"bodyForegroundColor",convertToHex:!0},controlBackgroundColor:{name:"controlBackgroundColor",convertToHex:!0},controlForegroundColor:{name:"controlForegroundColor",convertToHex:!0},primaryFontColor:{name:"bodyForegroundColor",convertToHex:!0},primaryBackgroundColor:{name:"bodyBackgroundColor",convertToHex:!0},secondaryFontColor:{name:"controlForegroundColor",convertToHex:!0},secondaryBackgroundColor:{name:"controlBackgroundColor",convertToHex:!0},fluentThemeData:{name:"fluentThemeData",convertToHex:!1}};for(var o in n){var a=!1,s=o;r[o]&&(s=r[o].name,a=r[o].convertToHex),i[s]=a?e.OUtil.convertIntToCssHexColor(n[o]):n[o]}}return i},n.prototype.getSerializedHostSettings=function(){var e=this.getOsfControlContext(),t=[],n=[];"function"==typeof e.GetSettings().ReadHost&&("undefined"!=typeof OsfOMToken&&OsfOMToken?e.GetSettings(OsfOMToken).ReadHost(t,n):e.GetSettings().ReadHost(t,n));for(var i={},r=0;r<t.length;r++)i[t[r]]=n[r];return i},n.officeThemeCacheValidPeriod=5e3,n}(e.InitializationHelper);e.RichClientInitializationHelper=t}(OSF||(OSF={})),function(e){var t=function(){function e(e){this._osfClientContext=e}return e.prototype.read=function(e){var t,n=this._osfClientContext;t="undefined"!=typeof OsfOMToken&&OsfOMToken?n.GetSettings(OsfOMToken):n.GetSettings();var i=function(){var n=[],i=[];t.Read(n,i);for(var r={},o=0;o<n.length;o++)r[n[o]]=i[o];e&&e(0,r)};t.RefreshAsync?t.RefreshAsync((function(){i()})):i()},e.prototype.write=function(e,t){var n=[],i=[];for(var r in e)n.push(r),i.push(e[r]);var o,a=this._osfClientContext;void 0!==(o="undefined"!=typeof OsfOMToken&&OsfOMToken?a.GetSettings(OsfOMToken):a.GetSettings()).WriteAsync?o.WriteAsync(n,i,t):(o.Write(n,i),t(0))},e}();e.RichClientSettingsManager=t}(OSF||(OSF={})),function(e){var t=function(t){function n(n){var i=t.call(this)||this;return i._clientHostController=n,i._asyncMethodExecutorHelper=e.BootStrapExtension.createAsyncMethodExecutorHelper(i),i}return __extends(n,t),n.prototype.executeAsync=function(t,n,i,r){var o=this;try{var a=new Array;this._clientHostController.execute(t,n.toSafeArrayHost(),(function(s,c){var l=e.Utility.fromSafeArray(s);return o._asyncMethodExecutorHelper.handleSafeArrayHostResponse(l,c,a,i,n,t,r)}))}catch(e){this.onException(e,t,i)}},n.prototype.registerEventAsync=function(t,n,i,r,o,a,s){var c=this;try{this._clientHostController.registerEvent(t,n,i,(function(t,n){var i=e.Utility.fromSafeArray(n),a=o.fromSafeArrayHost(i);r(a)}),(function(n){var i,r=e.Utility.fromSafeArray(n);return"number"==typeof r?([],i=r):i=r[0],c.invokeCallback(t,a,i,null,s),!0}))}catch(e){this.onException(e,t,a)}},n.prototype.unregisterEventAsync=function(t,n,i,r,o){var a=this;try{this._clientHostController.unregisterEvent(t,n,i,(function(n,i){var s,c=e.Utility.fromSafeArray(n);return"number"==typeof c?([],s=c):s=c[0],a.invokeCallback(t,r,s,null,o),!0}))}catch(e){this.onException(e,t,r)}},n.prototype.onException=function(t,n,i){var r,o=t.number;if(o)switch(o){case-2146828218:r=7e3;break;case-2147467259:r=n==e.EventDispId.dispidDialogMessageReceivedEvent?12007:5001;break;case-2146828283:case-2147209089:r=5010;break;case-2147208704:r=5100;break;case-2146827850:default:r=5001}i&&this.invokeCallback(n,i,r||5001,null)},n}(e.AsyncMethodExecutor);e.SafeArrayAsyncMethodExecutor=t}(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 r=this._internalStorage.key(i);0===r.indexOf(e)&&t.push(r)}}catch(e){}return t},e}();e.SafeStorage=t}(OSF||(OSF={})),function(e){var t=function(){function t(e,t){var n=this;this._clientSettingsManager=t,e=e||{},this._settings=e,this._eventDispatch=new OSF.EventDispatch([{id:OSF.EventDispId.dispidSettingsChangedEvent,type:OSF.EventType.SettingsChanged,getTargetId:function(){return""},fromSafeArrayHost:function(e){return{type:OSF.EventType.SettingsChanged,settings:n}},fromWebHost:function(e){return{type:OSF.EventType.SettingsChanged,settings:n}}}])}return t.prototype.cacheSessionSettings=function(e){var t=OSF.OUtil.getSessionStorage();if(t){var n=OSF.OUtil.serializeSettings(e),i=JSON.stringify(n);t.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),i)}},t.prototype.get=function(e){var t=this._settings[e];return void 0===t?null:t},t.prototype.set=function(e,t){this._settings[e]=t,this.cacheSessionSettings(this._settings)},t.prototype.remove=function(e){delete this._settings[e],this.cacheSessionSettings(this._settings)},t.prototype.saveAsync=function(e){var t=this._clientSettingsManager,n=OSF.OUtil.serializeSettings(this._settings);t.write(n,(function(t){var n=OSF.Utility.asyncResultFromErrorCode(t);e&&e(n)}))},t.prototype.refreshAsync=function(t){var n=this;this._clientSettingsManager.read((function(i,r){var o=OSF.Utility.asyncResultFromErrorCode(i);o.status===e.AsyncResultStatus.Succeeded&&(n._settings=OSF.OUtil.deserializeSettings(r),o.value=n),t&&t(o)}))},t.prototype.addHandlerAsync=function(e,t,n){OSF.EventHelper.addEventHandler(e,t,n,this._eventDispatch)},t.prototype.removeHandlerAsync=function(e,t,n){OSF.EventHelper.removeEventHandler(e,t,n,this._eventDispatch)},t.prototype.toJSON=function(){return this._settings},t}();e.Settings=t}(Office||(Office={}));var OSFWebkit,OSF,OTel,Microsoft,__awaiter=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){e.done?r(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,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};!function(e){var t=function(){function t(){}return t.isSovereignVersion=function(){return"undefined"!=typeof isOsfSovereignVersion&&!0===isOsfSovereignVersion},t.prototype.getEnvironmentName=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.getConfig()];case 1:return[2,null!=(e=t.sent())&&e.envName?e.envName:null]}}))}))},t.prototype.getEnvironmentType=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.getConfig()];case 1:return[2,null!=(e=t.sent())&&e.envType?e.envType:null]}}))}))},t.prototype.getTrustedHostOrigins=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.getConfig()];case 1:return[2,null!=(e=t.sent())?e.trustedHostOrigins:null]}}))}))},t.prototype.isConfigAvailable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.getConfig()];case 1:return[2,!!e.sent()]}}))}))},t.prototype.isSovereignHostTrusted=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return e?e===window.location.hostname?[2,!0]:[4,this.getTrustedHostOrigins()]:[2,!1];case 1:return(t=n.sent())&&0!=t.length?[2,new RegExp(t.join("|")).test(e)]:[2,!1]}}))}))},t.prototype.getConfigPath=function(){var t=e.LoadScriptHelper.getHostBundleJsBasePath();if(t){var n="/lib/",i=(t=t.toLowerCase()).indexOf(n);if(i>-1)return t.toLowerCase().substring(0,i+n.length)+"officeconfig.json"}return""},t.prototype.getConfig=function(){return this._configPromise||(this._configPromise=this.tryLoadConfig()),this._configPromise},t.prototype.tryLoadConfig=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,i,r,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:if(!(t=this.getConfigPath()))return[3,2];if(n=e.OUtil.getLocalStorage(),i=t+"_cache",r=n.getItem(i),o=null,r){try{o=JSON.parse(r)}catch(e){}if(864e5,a=(new Date).getTime(),o&&o.config&&o.createTime<=a&&o.createTime+864e5>=a)return[2,o.config]}return[4,this.downloadConfig(t)];case 1:return(s=c.sent())?(o={createTime:(new Date).getTime(),config:s},n.setItem(i,JSON.stringify(o))):o&&(s=o.config),[2,s];case 2:return[2,null]}}))}))},t.prototype.downloadConfig=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,fetch(e)];case 1:return[4,t.sent().json()];case 2:return[2,t.sent()];case 3:return t.sent(),[3,4];case 4:return[2,null]}}))}))},t}();e.SovereignHelper=t}(OSF||(OSF={})),function(e){!function(e){function t(e){return void 0===e||null===e}e.createParameterException=function(e){return new Error("Parameter count mismatch: "+e)},e.createArgumentException=function(e){return new Error("Invalid argument "+e)},e.createNotImplementedException=function(){return new Error("Not implemented yet")},e.log=function(e){console.log(e)},e.trace=function(e){console.log(e)},e.debugLog=function(e){console.log(e)},e.getQueryStringValue=function(e){if("undefined"!=typeof window&&window.location&&window.location.search){var t=new RegExp("[?&]"+e+"=([^&]*)").exec(window.location.search);if(t)return t[1]}return null},e.isNullOrUndefined=t,e.isNullOrEmpty=function(e){return!!t(e)||0===e.length},e.isInUnittest=function(){return"boolean"==typeof g_osfUnittest&&g_osfUnittest}}(e.Utility||(e.Utility={}))}(OSF||(OSF={})),function(e){e.isOfficeReactNative=function(){try{return"undefined"!=typeof OfficePlatformGlobal&&void 0!==OfficePlatformGlobal.ReactNativeReka}catch(e){return!1}},function(e){function t(e){return new Promise(e)}function n(e){var t=e,r=1;if(("object"==typeof e||"unknown"==typeof e)&&null!=e&&e.toArray)if(e.dimensions&&(r=e.dimensions()),2===r)t=i(e);else{var o=e.toArray();t=new Array(o.length);for(var a=0;a<o.length;a++)t[a]=n(o[a])}return t}function i(e){var t;try{var n=e.ubound(1),i=e.ubound(2);if(e=e.toArray(),1==n&&1==i)t=[e];else{t=[];for(var r=0;r<n;r++){for(var o=[],a=0;a<i;a++){var s=e[r*i+a];"{66e7831f-81b2-42e2-823c-89e872d541b3}"!=s&&o.push(s)}o.length>0&&t.push(o)}}}catch(e){}return t}e.xdmDebugLog=function(t){e._DebugXdm&&console.log(t)},e.enableDebugXdm=function(){e._DebugXdm=!0},e.createPromiseFromResult=function(e){return Promise.resolve(e)},e.createPromise=t,e.promisify=function(e,n){return t((function(t,i){e((function(e){0===e?t():i()})),setTimeout((function(){i()}),n)}))},e.compareVersions=function(e,t){var n,i=e.split("."),r=t.split(".");for(n in i){if(parseInt(i[n])<parseInt(r[n]))return!1;if(parseInt(i[n])>parseInt(r[n]))return!0}return!1},e.getErrorCodeFromAsyncResult=function(e){return e.status===Office.AsyncResultStatus.Succeeded?0:e.error&&e.error.code?e.error.code:5001},e.externalNativeFunctionExists=function(e){return"unknown"===e||"undefined"!==e},e.stringEndsWith=function(t,n){if(e.isNullOrUndefined(t))throw e.createArgumentException("value");if(e.isNullOrUndefined(n))throw e.createArgumentException("subString");return!(n.length>t.length)&&t.substr(t.length-n.length)===n},e.fromSafeArray=function(e){var t=e;if(("object"==typeof e||"unknown"==typeof e)&&null!=e&&e.toArray){var i=e.toArray();t=new Array(i.length);for(var r=0;r<i.length;r++)t[r]=n(i[r])}return t},e.twoDVBArrayToJaggedArray=i,e.asyncResultFromErrorCode=function(e){return Array.isArray(e)&&1===e.length&&(e=e[0]),0===e?{status:Office.AsyncResultStatus.Succeeded}:{status:Office.AsyncResultStatus.Failed,error:{code:e}}},e._DebugXdm=!1}(e.Utility||(e.Utility={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(n){var i=t.call(this)||this;return i._clientHostController=n,i._asyncMethodExecutorHelper=e.BootStrapExtension.createAsyncMethodExecutorHelper(i),i}return __extends(n,t),n.prototype.executeAsync=function(e,t,n,i){var r=this;this._clientHostController.execute(e,t.toWebHost(),(function(o,a){return n&&r._asyncMethodExecutorHelper.handleWebHostResponse(a,o,n,t,e,i),!0}))},n.prototype.registerEventAsync=function(e,t,n,i,r,o,a){var s=this;this._clientHostController.registerEvent(e,t,n,(function(e){var t=e,n=r.fromWebHost(t);i(n)}),(function(t,n){return o&&s.invokeCallback(e,o,t,null,a),!0}))},n.prototype.unregisterEventAsync=function(e,t,n,i,r){var o=this;this._clientHostController.unregisterEvent(e,t,n,(function(t,n){return i&&o.invokeCallback(e,i,t,null,r),!0}))},n}(e.AsyncMethodExecutor);e.WebAsyncMethodExecutor=t}(OSF||(OSF={})),function(e){!function(t){!function(t){t.getAuthContextAsync=function(t){e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(99,{toSafeArrayHost:function(){return[]},fromSafeArrayHost:function(e){return null},toWebHost:function(){return{}},fromWebHost:function(e){return e.authContext}},t)}}(t.WebAuth||(t.WebAuth={}))}(e.DDA||(e.DDA={})),function(t){var n;!function(e){e.AuthCode="authcode",e.Broker="broker",e.Implicit="implicit"}(n=t.AuthFlow||(t.AuthFlow={})),t.loadAttempts=0;var i="webauth/",r="webauth.browserauth.debug.js",o="webauth.browserauth.js",a=!1;t.load=function(){return t.config&&t.config.authFlow===n.AuthCode?(t.loadAttempts++,(a=t.config&&(!0===t.config.useMsal3||!1!==t.config.useMsal3&&e.OUtil.checkFlight(e.FlightTreatmentNames.EnableMsal3SsoApi)))&&(r="webauth.browserauth.msal3.debug.js",o="webauth.browserauth.msal3.js"),new Promise((function(n,s){var c=function(t,n,i){return new Promise((function(r,o){t?e.OUtil.loadScript(t,(function(e){if("boolean"!=typeof e||e)if(e instanceof Event&&e)o(new Event("loadScript: "+e.type+" '"+t+"'"));else if(i&&!n())var a=0,s=setInterval((function(){a+=500,!(n()||a>i)||(clearInterval(s),n())||o(new Event("Missing expected object after loaded."))}),500);else r(null);else o(new Event("loadScript: failed to load '"+t+"'"))}),e.LoadScriptHelper.getTrustedTypesPolicy(),i):r(null)}))},l=[c(t.config&&t.config.authVersion?e.LoadScriptHelper.getHostBundleJsBasePath()+i+t.config.authVersion+"/"+(t.config&&t.config.debugging?r:o):e.LoadScriptHelper.getHostBundleJsBasePath()+i+(t.config&&t.config.debugging?r:o),(function(){return!!BrowserAuth}),t.config.delayWebAuth)];a||l.push(c(t.config.msal,(function(){return!!msal}),t.config.delayMsal)),Promise.all(l).then((function(){t.config?BrowserAuth.Load(t.config,e._OfficeAppFactory.getHostInfo().osfControlAppCorrelationId).then((function(e){n(e)}),(function(e){s(e)})):s(new Event("config is empty."))}),(function(e){s(e)}))}))):new Promise((function(e,t){return t(new Event("'authcode' as authFlow is only supported"))}))},t.getToken=function(e,i,r,o,s,c){return t.config&&t.config.authFlow===n.AuthCode?a?BrowserAuth.GetToken({resource:e,scopes:i,applicationId:r,correlationId:o,popup:!!s,claims:c}):BrowserAuth.GetToken(e,r,o,!!s,!!s,!1,c):Promise.reject(new Event("'authcode' as authFlow is only supported"))}}(e.WebAuth||(e.WebAuth={}))}(OSF||(OSF={})),function(e){var t=function(){function t(t){this._delegateVersion=1,this._webAppState=t,this._webClientHostControllerHelper=e.BootStrapExtension.createWebClientHostControllerHelper(this._webAppState,this._delegateVersion)}return t.prototype.execute=function(e,t,n){var i=this,r=this._webClientHostControllerHelper.getHostCallArgs(e,t),o=this._webClientHostControllerHelper.getTargetMethodName(e);this._webAppState.clientEndPoint.invoke(o,(function(t,r){var o=0;if(0==t)i._delegateVersion=r.Version,o=i._webClientHostControllerHelper.parseErrorFromPayload(e,r);else switch(t){case-5:o=7e3;break;default:o=5001}n&&n(o,r)}),r)},t.prototype.registerEvent=function(e,t,n,i,r){this._webAppState.clientEndPoint.registerForEvent(this.getXdmEventName(n,t),(function(e){i&&i(e)}),this._getOnAfterRegisterEvent(!0,e,r),{controlId:this._webAppState.id,eventDispId:e,targetId:n,__timeout__:-1})},t.prototype.unregisterEvent=function(e,t,n,i){this._webAppState.clientEndPoint.unregisterForEvent(this.getXdmEventName(n,t),this._getOnAfterRegisterEvent(!1,e,i),{controlId:this._webAppState.id,eventDispId:e,targetId:n,__timeout__:-1})},t.prototype.messageParent=function(t){throw e.Utility.createNotImplementedException()},t.prototype.openDialog=function(t,n,i,r,o){throw e.Utility.createNotImplementedException()},t.prototype.closeDialog=function(t,n,i,r){throw e.Utility.createNotImplementedException()},t.prototype.sendMessage=function(t){throw e.Utility.createNotImplementedException()},t.prototype.closeSdxDialog=function(t){this._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[this._webAppState.id,e.AgaveHostAction.CloseSDXDialog,{InstanceId:this._webAppState.id,DialogCloseCallbackParam:t}])},t.prototype.resizeSdxDialog=function(t,n){this._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[this._webAppState.id,e.AgaveHostAction.ResizeSDXDialog,{InstanceId:this._webAppState.id,DialogWidth:t+"px",DialogHeight:n+"px"}])},t.prototype.getXdmEventName=function(t,n){return n==e.EventType.BindingSelectionChanged||n==e.EventType.BindingDataChanged||n==e.EventType.DataNodeDeleted||n==e.EventType.DataNodeInserted||n==e.EventType.DataNodeReplaced?t+"_"+n:n},t.prototype._getOnAfterRegisterEvent=function(t,n,i){var r=(new Date).getTime();return function(o,a){var s;if(0!=o)switch(o){case-5:s=7e3;break;default:s=5001}else s=a?a.Error?a.Error:0:5001;i&&i(s),e.AppTelemetry&&e.AppTelemetry.onRegisterDone(t,n,Math.abs((new Date).getTime()-r),s)}},t}();e.WebClientHostController=t}(OSF||(OSF={})),function(e){var t=function(){function e(e,t){this._webAppState=e,this._delegateVersion=t}return e.prototype.getHostCallArgs=function(e,t){var n=t;return n||(n={}),n.DdaMethod={ControlId:this.getControlId(),DispatchId:e,Version:this._delegateVersion},n.__timeout__=-1,n},e.prototype.getTargetMethodName=function(e){return"executeMethod"},e.prototype.parseErrorFromPayload=function(e,t){return t.Error},e.prototype.getControlId=function(){return this._webAppState.id},e}();e.WebClientHostControllerHelper=t}(OSF||(OSF={})),function(e){var t=function(){function t(){}return t.prototype.read=function(t){e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(75,{toSafeArrayHost:function(){return[]},fromSafeArrayHost:function(e){return null},toWebHost:function(){return{}},fromWebHost:function(e){return e.Properties.Settings}},(function(e){if(e.status===Office.AsyncResultStatus.Succeeded){for(var n={},i=0;i<e.value.length;i++){var r=e.value[i];Array.isArray(r)?n[r[0]]=r[1]:n[r.Name]=r.Value}t(0,n)}else{var o=e.error.code;t(o,{})}}))},t.prototype.write=function(t,n){var i=e._OfficeAppFactory.getAsyncMethodExecutor(),r=[];for(var o in t){var a=[];a.push(o),a.push(t[o]),r.push(a)}var s={toSafeArrayHost:function(){return null},fromSafeArrayHost:function(e){return null},toWebHost:function(){return{DdaSettingsMethod:{OverwriteIfStale:!0,Properties:r}}},fromWebHost:function(e){return null}};i.executeAsync(76,s,(function(e){if(e.status===Office.AsyncResultStatus.Succeeded)n(0);else{var t=e.error.code;n(t)}}))},t}();e.WebClientSettingsManager=t}(OSF||(OSF={})),function(e){var t=function(t){function n(e,n,i,r){var o=t.call(this,e,n,i,r)||this;return o._serializedSettings={},o._serializedHostSettings={},o._appContext={},o._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'])",o}return __extends(n,t),Object.defineProperty(n.prototype,"isHostOriginTrusted",{get:function(){return this._isHostOriginTrustedFunc},set:function(e){this._isHostOriginTrustedFunc=e},enumerable:!0,configurable:!0}),n.prototype.saveAndSetDialogInfo=function(t){var n,i=e.OUtil.getSessionStorage();if(i){if(t||(t=e.OUtil.parseHostInfoFromWindowName(!0,e._OfficeAppFactory.getWindowName())),t&&t.indexOf("isDialog")>-1){var r=(n=e.OUtil.parseXdmInfo(!0))?n.split("|")[1]:null;return null!=r&&i.setItem(r+"IsDialog","true"),void(this._hostInfo.isDialog=!0)}this._hostInfo.isDialog=null!=i.getItem(e.OUtil.getXdmFieldValue("AppId",!1)+"IsDialog")}},n.prototype.checkReceiverOriginAndRun=function(t){return __awaiter(this,void 0,void 0,(function(){var n,i,r,o,a,s,c,l,u,f;return __generator(this,(function(d){switch(d.label){case 0:return 3===(n=this)._webAppState.clientEndPoint.hostTrustCheckStatus?(t(),[2]):(i=e.OUtil.parseUrl(n._webAppState.clientEndPoint.targetUrl,!1),r="https:"==i.protocol,o=i.hostname,a="NotHttps",0!==n._webAppState.clientEndPoint.hostTrustCheckStatus?[3,4]:(r||(n._webAppState.clientEndPoint.hostTrustCheckStatus=2),2==n._webAppState.clientEndPoint.hostTrustCheckStatus?[3,4]:(s=!1,(c=e.SovereignHelper.isSovereignVersion())&&!0!==e.OUtil.getCustomOfficeInitializationSettings().trustAllCloudEnvironments||(s=e.XdmCommunicationManager.isHostNameValidWacDomain(o),n.isHostOriginTrusted&&(s=s||n.isHostOriginTrusted(o))),s||!c?[3,3]:(n._sovereignHelper||(n._sovereignHelper=new e.SovereignHelper),[4,(l=n._sovereignHelper).isConfigAvailable()]))));case 1:return d.sent()?[4,l.isSovereignHostTrusted(o)]:[2];case 2:s=d.sent(),d.label=3;case 3:s&&(n._webAppState.clientEndPoint.hostTrustCheckStatus=3),d.label=4;case 4:if(n._webAppState.clientEndPoint.checkStatusLogged||null==n._hostInfo||void 0===n._hostInfo||(e.AppTelemetry.onCheckWACHost(n._webAppState.clientEndPoint.hostTrustCheckStatus,n._webAppState.id,n._hostInfo.hostType,n._hostInfo.hostPlatform,n._webAppState.clientEndPoint.targetUrl),n._webAppState.clientEndPoint.checkStatusLogged=!0),3===n._webAppState.clientEndPoint.hostTrustCheckStatus||e.LoadScriptHelper.disableHostCheck())t();else{if(e.LoadScriptHelper.isSdx())throw new Error("Not supported host");u=function(){var i=e.LoadScriptHelper.getHostBundleJsBasePath().match(/^https?:\/\/[^:/?#]*(?::([0-9]+))?/);if(i&&i[0]){var s=e.LoadScriptHelper.getHostBundleJsBasePath()+"AgaveErrorUX/index.html#",c={error:"NotTrustedWAC",locale:e.getSupportedLocale(n._hostInfo.hostLocale,e.ConstantNames.DefaultLocale),hostname:o,noHttps:!r,validate:!1},l=document.createElement("iframe");l.style.visibility="hidden",l.style.height="0",l.style.width="0";var u=function(r){if(r.source==l.contentWindow&&r.origin==i[0])try{!0===JSON.parse(r.data).hostUserTrusted?(n._webAppState.clientEndPoint.hostTrustCheckStatus=3,e.OUtil.removeEventListener(window,"message",u),document.body.removeChild(l)):(c.validate=!1,window.location.replace(s+encodeURIComponent(JSON.stringify(c)))),t()}catch(t){e.OUtil.ensureOfficeStringsJs().then((function(){document.body.textContent=Strings.OfficeOM.L_NotTrustedWAC}))}};e.OUtil.addEventListener(window,"message",u),c.validate=!0,l.setAttribute("src",s+encodeURIComponent(JSON.stringify(c))),l.onload=function(){var e={hostname:o,noHttps:!r};l.contentWindow.postMessage(JSON.stringify(e),i[0])},document.body.appendChild(l)}else e.OUtil.ensureOfficeStringsJs().then((function(){document.body.textContent=Strings.OfficeOM.L_NotTrustedWAC}));if(e.OUtil.checkFlight(2)&&!r)throw new Error(a)},document.body?u():(f=!1,document.addEventListener("DOMContentLoaded",(function(){f||(f=!0,u())})))}return[2]}}))}))},n.prototype.setAgaveHostCommunication=function(){try{var t=this,n=e.OUtil.parseXdmInfoWithGivenFragment(!1,e._OfficeAppFactory.getWindowLocationHash());if(n||(n=e.OUtil.parseXdmInfoFromWindowName(!1,e._OfficeAppFactory.getWindowName())),n){var i=e.OUtil.getInfoItems(n);null!=i&&i.length>=3&&(t._webAppState.conversationID=i[0],t._webAppState.id=i[1],t._webAppState.webAppUrl=i[2].indexOf(":")>=0?i[2]:decodeURIComponent(i[2]))}if(t._webAppState.wnd=null!=window.opener?window.opener:window.parent,this._hostInfo.isDialog&&null!=window.opener)return;t._webAppState.clientEndPoint=e.XdmCommunicationManager.connect(t._webAppState.conversationID,t._webAppState.wnd,t._webAppState.webAppUrl),t._webAppState.serviceEndPoint=e.XdmCommunicationManager.createServiceEndPoint(t._webAppState.id),t._webAppState.clientEndPoint.checkReceiverOriginAndRun=function(e){t.checkReceiverOriginAndRun(e)};var r=t._webAppState.conversationID+e.Constants.NotificationConversationIdSuffix;t._webAppState.serviceEndPoint.registerConversation(r,t._webAppState.webAppUrl);t._webAppState.serviceEndPoint.registerMethod("Office_notifyAgave",(function(n){var i;switch(i="string"==typeof n?n:n[0]){case e.AgaveHostAction.Select:t._webAppState.focused=!0;break;case e.AgaveHostAction.UnSelect:t._webAppState.focused=!1;break;case e.AgaveHostAction.TabIn:case e.AgaveHostAction.CtrlF6In:window.focus();var r=document.querySelectorAll(t._tabbableElements);e.OUtil.focusToFirstTabbable(r,!1)||(window.blur(),t._webAppState.focused=!1,t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,e.AgaveHostAction.ExitNoFocusable]));break;case e.AgaveHostAction.TabInShift:window.focus();r=document.querySelectorAll(t._tabbableElements);e.OUtil.focusToFirstTabbable(r,!0)||(window.blur(),t._webAppState.focused=!1,t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,e.AgaveHostAction.ExitNoFocusableShift]));break;case e.AgaveHostAction.SendMessage:if(Office.context.messaging.onMessage){var o=n[1];Office.context.messaging.onMessage(o)}break;case e.AgaveHostAction.TaskPaneHeaderButtonClicked:Office.context.ui.taskPaneAction.onHeaderButtonClick&&Office.context.ui.taskPaneAction.onHeaderButtonClick();break;default:e.Utility.trace("actionId "+i+" notifyAgave is wrong.")}}),0,!1),t.addOrRemoveEventListenersForWindow(!0)}catch(t){throw e.AppTelemetry&&e.AppTelemetry.logAppException("Exception thrown in setAgaveHostCommunication. Exception:["+t+"]"),t}},n.prototype.getAppContext=function(t,n,i){var r=this,o=this,a=function(t,a){if(OSFPerformance.getAppContextXdmEnd=OSFPerformance.now(),a._appName===e.AppName.ExcelWebApp){for(var s=0,c=a._settings;s<c.length;s++){var l=c[s],u=l[0],f=l[1];r._serializedSettings[u]=f}for(var d=0,p=a._hostSettings;d<p.length;d++){var h=p[d];u=h[0],f=h[1];r._serializedHostSettings[u]=f}}else r._serializedSettings=a._settings||{},r._serializedHostSettings=a._hostSettings||{};if(!o._hostInfo.isDialog||null==window.opener){var g=window.location.href;o._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[o._webAppState.id,e.AgaveHostAction.UpdateTargetUrl,g])}if(0===t&&null!=a._id&&null!=a._appName&&null!=a._appVersion&&null!=a._appUILocale&&null!=a._dataLocale&&null!=a._docUrl&&null!=a._clientMode&&null!=a._reason){o._appContext=a;var m=a._appInstanceId?a._appInstanceId:a._id,v=0;null!=a._appMinorVersion&&(v=a._appMinorVersion);var y=void 0;null!=a._requirementMatrix&&(y=a._requirementMatrix),a.eToken=a.eToken?a.eToken:"";var O=new e.OfficeAppContext(a._id,a._appName,a._appVersion,a._appUILocale,a._dataLocale,a._docUrl,a._clientMode,(function(){return r._serializedSettings}),a._reason,a._osfControlType,a._eToken,a._correlationId,m,!1,!0,v,y,a._hostCustomMessage,a._hostFullVersion,a._clientWindowHeight,a._clientWindowWidth,a._addinName,a._appDomains,a._dialogRequirementMatrix,a._featureGates,a._officeTheme,a._initialDisplayMode,a._isFromWacAutomation,a._wopiHostOriginForSingleSignOn,(function(){return r._serializedHostSettings}),!0,a._nestedAppAuthBridgeType,a._partitionKey);O.set_taskpaneUrl(a._taskpaneUrl),n(O)}else{var b="Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+t+", exception: "+a;e.AppTelemetry&&e.AppTelemetry.logAppException(b),i(b)}};try{var s=!0;this._hostInfo.isDialog&&null!=window.opener&&(s=!1);var c=e.OUtil.parseAppContextFromWindowName(s,e._OfficeAppFactory.getWindowName());c?a(0,c):(OSFPerformance.getAppContextXdmStart=OSFPerformance.now(),this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync",a,this._webAppState.id))}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:["+t+"]"),i(t)}},n.prototype.createClientHostController=function(){return this._clientHostController||(this._clientHostController=new e.WebClientHostController(this._webAppState)),this._clientHostController},n.prototype.createAsyncMethodExecutor=function(){return new e.WebAsyncMethodExecutor(this._clientHostController)},n.prototype.createClientSettingsManager=function(){return new e.WebClientSettingsManager},n.prototype.addOrRemoveEventListenersForWindow=function(t){var n=this,i=function(){n._webAppState.focused||(n._webAppState.focused=!0),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.Select])},r=function(){e&&(n._webAppState.focused&&(n._webAppState.focused=!1),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.UnSelect]))},o=function(t){if(t.preventDefault=t.preventDefault||function(){t.returnValue=!1},117==t.keyCode&&(t.ctrlKey||t.metaKey)){t.preventDefault();var i=e.AgaveHostAction.CtrlF6Exit;t.shiftKey&&(i=e.AgaveHostAction.CtrlF6ExitShift),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,i])}else if(9==t.keyCode){t.preventDefault();var r=document.querySelectorAll(n._tabbableElements);e.OUtil.focusToNextTabbable(r,t.target||t.srcElement,t.shiftKey)||(n._hostInfo.isDialog?e.OUtil.focusToFirstTabbable(r,t.shiftKey):t.shiftKey?n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.TabExitShift]):n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.TabExit]))}else if(27==t.keyCode)t.preventDefault(),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.EscExit]);else if(113==t.keyCode)t.preventDefault(),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.F2Exit]);else if((t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)&&t.keyCode>=1&&t.keyCode<=255){var o={keyCode:t.keyCode,shiftKey:t.shiftKey,altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey};n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.KeyboardShortcuts,o])}},a=function(e){117==e.keyCode&&e.ctrlKey&&(e.preventDefault?e.preventDefault():e.returnValue=!1)};e.Utility._DebugXdm||(t?(e.OUtil.addEventListener(window,"focus",i),e.OUtil.addEventListener(window,"blur",r),e.OUtil.addEventListener(window,"keydown",o),e.OUtil.addEventListener(window,"keypress",a)):(e.OUtil.removeEventListener(window,"focus",i),e.OUtil.removeEventListener(window,"blur",r),e.OUtil.removeEventListener(window,"keydown",o),e.OUtil.removeEventListener(window,"keypress",a)))},n.prototype.getTabbableElements=function(){return this._tabbableElements},n}(e.InitializationHelper);e.WebInitializationHelper=t}(OSF||(OSF={})),function(e){var t=function(){function t(e,t){this._initializationHelper=e,this._scriptMessager=t}return t.prototype.read=function(e){this._initializationHelper.getAppContext(null,(function(t){if(e){var n=t.get_settingsFunc()();e(0,n)}}),(function(t){e&&e(5001,{})}))},t.prototype.write=function(t,n){var i={},r=[],o=[];for(var a in t)r.push(a),o.push(t[a]);i.keys=r,i.values=o;this._scriptMessager.invokeMethod(e.Webkit.MessageHandlerName,e.Webkit.MethodId.WriteSettings,i,(function(e){n&&n(e[0])}))},t}();e.WebkitClientSettingsManager=t}(OSF||(OSF={})),function(e){!function(t){t.MessageHandlerName="Agave",t.PopupMessageHandlerName="WefPopupHandler",function(e){e[e.Settings=0]="Settings",e[e.SolutionReferenceId=1]="SolutionReferenceId",e[e.AppType=2]="AppType",e[e.MajorVersion=3]="MajorVersion",e[e.MinorVersion=4]="MinorVersion",e[e.RevisionVersion=5]="RevisionVersion",e[e.APIVersionSequence=6]="APIVersionSequence",e[e.AppCapabilities=7]="AppCapabilities",e[e.APPUILocale=8]="APPUILocale",e[e.AppDataLocale=9]="AppDataLocale",e[e.BindingCount=10]="BindingCount",e[e.DocumentUrl=11]="DocumentUrl",e[e.ActivationMode=12]="ActivationMode",e[e.ControlIntegrationLevel=13]="ControlIntegrationLevel",e[e.SolutionToken=14]="SolutionToken",e[e.APISetVersion=15]="APISetVersion",e[e.CorrelationId=16]="CorrelationId",e[e.InstanceId=17]="InstanceId",e[e.TouchEnabled=18]="TouchEnabled",e[e.CommerceAllowed=19]="CommerceAllowed",e[e.RequirementMatrix=20]="RequirementMatrix",e[e.HostCustomMessage=21]="HostCustomMessage",e[e.HostFullVersion=22]="HostFullVersion",e[e.InitialDisplayMode=23]="InitialDisplayMode",e[e.FeatureGates=24]="FeatureGates",e[e.HostSettings=25]="HostSettings",e[e.OfficeThemeInfo=26]="OfficeThemeInfo"}(t.AppContextProperties||(t.AppContextProperties={})),function(e){e[e.Execute=1]="Execute",e[e.RegisterEvent=2]="RegisterEvent",e[e.UnregisterEvent=3]="UnregisterEvent",e[e.WriteSettings=4]="WriteSettings",e[e.GetContext=5]="GetContext",e[e.SendMessage=6]="SendMessage",e[e.MessageParent=7]="MessageParent",e[e.SendMessage2=8]="SendMessage2",e[e.MessageParent2=9]="MessageParent2",e[e.CloseSdxDialog=10]="CloseSdxDialog",e[e.ResizeSdxDialog=11]="ResizeSdxDialog"}(t.MethodId||(t.MethodId={}));var n=function(){function t(e){this.hostScriptProxy=e,this.useFullDialogAPI=!!window._enableFullDialogAPI,this.osfSupportsDialogOrigin=!!window._osfEnableDialogOrigin}return t.prototype.execute=function(t,n,i){var r={id:t,apiArgs:n};this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,e.Webkit.MethodId.Execute,r,(function(t){if(i){var n=[];if(e.OUtil.isArray(t))for(var r=0;r<t.length;r++){var o=t[r];e.OUtil.isArray(o)&&(o=new e.WebkitSafeArray(o)),n.unshift(o)}return i.apply(null,n)}}))},t.prototype.registerEvent=function(t,n,i,r,o){this.hostScriptProxy.registerEvent(e.Webkit.MessageHandlerName,e.Webkit.MethodId.RegisterEvent,t,i,(function(t){var n=t,i=0;e.OUtil.isArray(t)&&t.length>=2&&(n=t[0],i=t[1]),r&&r(i,new e.WebkitSafeArray(n))}),(function(t){if(o)return o(new e.WebkitSafeArray(t))}))},t.prototype.unregisterEvent=function(t,n,i,r){this.hostScriptProxy.unregisterEvent(e.Webkit.MessageHandlerName,e.Webkit.MethodId.UnregisterEvent,t,i,(function(t){return r(new e.WebkitSafeArray(t))}))},t.prototype.messageParent=function(t){var n,i;if(this.osfSupportsDialogOrigin&&t[e.ParameterNames.TargetOrigin]?(n=this.useFullDialogAPI?JSON.stringify(t):t[e.ParameterNames.MessageToParent],i=e.Webkit.MethodId.MessageParent2):(n=t[e.ParameterNames.MessageToParent],i=e.Webkit.MethodId.MessageParent),this.useFullDialogAPI)this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,i,n,null);else{var r={dialogMessage:{messageType:0,messageContent:n}},o=i==e.Webkit.MethodId.MessageParent2?t[e.ParameterNames.TargetOrigin]:window.location.origin;window.opener.postMessage(JSON.stringify(r),o)}},t.prototype.openDialog=function(n,i,r,o,a){if(this.useFullDialogAPI)this.registerEvent(n,i,r,o,a);else if(!t.popup||t.popup.closed){t.OpenDialogCallback=void 0;var s=JSON.parse(r),c=s.url;if(c){var l=c.split("#"),u="?";l[0].indexOf("?")>-1&&(u="&");var f="width="+screen.width*s.width/100+", height="+screen.height*s.height/100;l[0]=l[0].concat(u).concat("action=displayDialog");var d=l.join("#");t.popup=window.open(d,"",f),t.DialogEventListener=function(t){if(t.origin==window.location.origin)try{var i=JSON.parse(t.data);i.dialogMessage&&o(n,[0,i.dialogMessage.messageContent,t.origin])}catch(n){e.Utility.trace("messages received cannot be handlered. Message:"+t.data)}},t.OpenDialogCallback=function(e){0==e&&(window.addEventListener("message",t.DialogEventListener),t.interval=window.setInterval(p,1e3),t.NotifyError=function(e){o(n,[e])}),a(e)}}else a(12003)}else a(12007);function p(){try{(null==t.popup||t.popup.closed)&&(window.clearInterval(t.interval),window.removeEventListener("message",t.DialogEventListener),t.NotifyError=null,t.popup=null,o(n,[12006]))}catch(t){e.Utility.trace("Error happened when popup window closed.")}}},t.prototype.closeDialog=function(e,n,i,r){this.useFullDialogAPI?this.unregisterEvent(e,n,i,r):t.popup?(t.interval&&window.clearInterval(t.interval),t.popup.close(),t.popup=null,window.removeEventListener("message",t.DialogEventListener),t.NotifyError=null,r(0)):r(5001)},t.prototype.sendMessage=function(t){var n,i;this.osfSupportsDialogOrigin&&t[e.ParameterNames.TargetOrigin]?(n=JSON.stringify(t),i=e.Webkit.MethodId.SendMessage2):(n=t[e.ParameterNames.MessageContent],i=e.Webkit.MethodId.SendMessage,!isNaN(parseFloat(n))&&isFinite(n)&&(n=n.toString())),this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,i,n,null)},t.prototype.closeSdxDialog=function(t){var n=[t],i=e.Webkit.MethodId.CloseSdxDialog;this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,i,n,null)},t.prototype.resizeSdxDialog=function(t,n){var i=[t,n],r=e.Webkit.MethodId.ResizeSdxDialog;this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,r,i,null)},t}();t.WebkitHostController=n}(e.Webkit||(e.Webkit={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(e,n,i,r){var o=t.call(this,e,n,i,r)||this;return o._serializedSettings={},o._serializedHostSettings={},o.initializeWebkitMessaging(),o}return __extends(n,t),n.prototype.initializeWebkitMessaging=function(){e.ScriptMessaging=OSFWebkit.ScriptMessaging},n.prototype.getAppContext=function(t,n,i){var r,o=this;r=this._hostInfo.isDialog&&window.webkit.messageHandlers[e.Webkit.PopupMessageHandlerName]?e.Webkit.PopupMessageHandlerName:e.Webkit.MessageHandlerName,e.ScriptMessaging.GetScriptMessenger().invokeMethod(r,e.Webkit.MethodId.GetContext,[],(function(t){var i,r=e.Webkit.AppContextProperties,a=t[r.AppType],s=t[r.Settings];if(s&&2===s.length)for(var c=s[0],l=s[1],u=0;u<c.length;u++)o._serializedSettings[c[u]]=l[u];var f=t[r.HostSettings];if(f&&2===f.length)for(c=f[0],l=f[1],u=0;u<c.length;u++)o._serializedHostSettings[c[u]]=l[u];var d=t[r.SolutionReferenceId],p=t[r.MajorVersion],h=t[r.MinorVersion],g=t[r.AppCapabilities],m=t[r.APPUILocale],v=t[r.AppDataLocale],y=t[r.DocumentUrl],O=t[r.ActivationMode],b=t[r.ControlIntegrationLevel],S=t[r.SolutionToken];S=S?S.toString():"";var _,A=t[r.CorrelationId],C=t[r.InstanceId],E=t[r.TouchEnabled],I=t[r.CommerceAllowed],w=t[r.RequirementMatrix],P=t[r.HostCustomMessage],x=t[r.HostFullVersion],T=t[r.InitialDisplayMode],R=t[r.FeatureGates];if(R)try{_=JSON.parse(R)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception trying to parse FeatureGates."+t)}var F=null;if(t[r.OfficeThemeInfo])try{F=JSON.parse(t[r.OfficeThemeInfo])}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception while parsing officeThemeInfo. Details: "+t)}var k={};if(F){var N={bodyBackgroundColor:{name:"bodyBackgroundColor",convertToHex:!0},bodyForegroundColor:{name:"bodyForegroundColor",convertToHex:!0},controlBackgroundColor:{name:"controlBackgroundColor",convertToHex:!0},controlForegroundColor:{name:"controlForegroundColor",convertToHex:!0},primaryFontColor:{name:"bodyForegroundColor",convertToHex:!0},primaryBackgroundColor:{name:"bodyBackgroundColor",convertToHex:!0},secondaryFontColor:{name:"controlForegroundColor",convertToHex:!0},secondaryBackgroundColor:{name:"controlBackgroundColor",convertToHex:!0},fluentThemeData:{name:"fluentThemeData",convertToHex:!1}};for(var M in F){var D=!1,j=M;N[M]&&(j=N[M].name,D=N[M].convertToHex),k[j]=D?e.OUtil.convertIntToCssHexColor(F[M]):F[M]}}i=new e.OfficeAppContext(d,a,p,m,v,y,g,(function(){return o._serializedSettings}),O,b,S,A,C,E,I,h,w,P,x,void 0,void 0,void 0,void 0,void 0,_,k,T,void 0,void 0,(function(){return o._serializedHostSettings}),!1,void 0,void 0),n(i)}))},n.prototype.createClientHostController=function(){return this._clientHostController||(this._clientHostController=new e.Webkit.WebkitHostController(e.ScriptMessaging.GetScriptMessenger())),this._clientHostController},n.prototype.createAsyncMethodExecutor=function(){return new e.SafeArrayAsyncMethodExecutor(this.createClientHostController())},n.prototype.createClientSettingsManager=function(){return new e.WebkitClientSettingsManager(this,e.ScriptMessaging.GetScriptMessenger())},n}(e.InitializationHelper);e.WebkitInitializationHelper=t}(OSF||(OSF={})),function(e){var t=function(){function t(e){this.data=e,this.safeArrayFlag=this.isSafeArray(e)}return t.prototype.dimensions=function(){var e=0;return this.safeArrayFlag?e=this.data[0][0]:this.isArray()&&(e=2),e},t.prototype.getItem=function(){var e=null;e=this.safeArrayFlag?this.toArray():this.data;for(var t=0;t<arguments.length;t++)e=e[arguments[t]];return e},t.prototype.lbound=function(e){return 0},t.prototype.ubound=function(t){var n=0;if(this.safeArrayFlag)n=this.data[0][t];else if(this.isArray()){if(1==t)return this.data.length;if(2==t){if(e.OUtil.isArray(this.data[0]))return this.data[0].length;if(null!=this.data[0])return 1}}return n},t.prototype.toArray=function(){if(0==this.isArray())return this.data;for(var e=[],n=this.safeArrayFlag?1:0;n<this.data.length;n++){var i=this.data[n];this.isSafeArray(i)?e.push(new t(i)):e.push(i)}return e},t.prototype.isArray=function(){return e.OUtil.isArray(this.data)},t.prototype.isSafeArray=function(t){var n=!1;if(e.OUtil.isArray(t)&&e.OUtil.isArray(t[0])){var i=t[0],r=i[0];if(i.length!=r+1)return!1;for(var o=1,a=1;a<i.length;a++){var s=i[a];if(0==isFinite(s))return!1;o*=s}n=++o==t.length}return n},t}();e.WebkitSafeArray=t}(OSF||(OSF={})),function(e){!function(e){var t=null;e.agaveHostCallback=function(e,n){t.agaveHostCallback(e,n)},e.agaveHostEventCallback=function(e,n){t.agaveHostEventCallback(e,n)},e.GetScriptMessenger=function(){return null==t&&(t=i.IsSupportedByHost()?new i:new r("OSF.ScriptMessaging.agaveHostCallback","OSF.ScriptMessaging.agaveHostEventCallback")),t};var n=function(e,t,n){this.id=e,this.targetId=t,this.handler=n},i=function(){function e(){this.eventHandlers=[]}return e.IsSupportedByHost=function(){return!!window._osfHostAPI},e.prototype.invokeMethod=function(e,t,n,i){window._osfHostAPI(e,this.constructMessagingArgs(t,n),(function(e){var t=i(e);return void 0===t||!0===t}))},e.prototype.registerEvent=function(e,t,n,i,r,o){var a={id:n,targetId:i},s=window._osfHostRegisterEvent(e,this.constructMessagingArgs(t,a),(function(e){return r(e),!1}),(function(e){return o(e),!0}));this.eventHandlers.push({targetId:i,dispId:n,callbackId:s.eventCallbackId})},e.prototype.unregisterEvent=function(e,t,n,i,r){var o={id:n,targetId:i};window._osfHostAPI(e,this.constructMessagingArgs(t,o),(function(e){return r(e),!0}));for(var a=this.eventHandlers.length-1;a>=0;a--){var s=this.eventHandlers[a];s.dispId===n&&s.targetId===i&&(this.eventHandlers.splice(a,1),window._osfHostUnregisterCallback(s.callbackId))}},e.prototype.agaveHostCallback=function(e,t){},e.prototype.agaveHostEventCallback=function(e,t){},e.prototype.constructMessagingArgs=function(e,t){return{params:t,methodId:e}},e}(),r=function(){function e(t,n){this.callingIndex=0,this.callbackList={},this.eventHandlerList={},this.asyncMethodCallbackFunctionName=t,this.eventCallbackFunctionName=n,this.conversationId=e.getCurrentTimeMS().toString()}return e.prototype.invokeMethod=function(e,t,n,i){this.postWebkitMessage({},e,t,n,i)},e.prototype.registerEvent=function(e,t,i,r,o,a){var s={eventCallbackFunction:this.eventCallbackFunctionName},c={id:i,targetId:r},l=this.postWebkitMessage(s,e,t,c,a);this.eventHandlerList[l]=new n(i,r,o)},e.prototype.unregisterEvent=function(e,t,n,i,r){var o={id:n,targetId:i};for(var a in this.eventHandlerList)if(this.eventHandlerList.hasOwnProperty(a)){var s=this.eventHandlerList[a];s.id==n&&s.targetId==i&&delete this.eventHandlerList[a]}this.invokeMethod(e,t,o,r)},e.prototype.agaveHostCallback=function(e,t){var n=this.callbackList[e];if(n){var i=n(t);void 0!==i&&!0!==i||delete this.callbackList[e]}},e.prototype.agaveHostEventCallback=function(e,t){var n=this.eventHandlerList[e];n&&n.handler(t)},e.prototype.postWebkitMessage=function(t,n,i,r,o){t.methodId=i,t.params=r;var a="";o&&(a=this.generateCorrelationId(),this.callbackList[a]=o,t.callbackId=a,t.callbackFunction=this.asyncMethodCallbackFunctionName);var s=function(){window.webkit.messageHandlers[n].postMessage(JSON.stringify(t))},c=e.getCurrentTimeMS();return null==this.lastMessageTimestamp||c-this.lastMessageTimestamp>=e.MESSAGE_TIME_DELTA?(s(),this.lastMessageTimestamp=c):(this.lastMessageTimestamp+=e.MESSAGE_TIME_DELTA,setTimeout((function(){s()}),this.lastMessageTimestamp-c)),a},e.prototype.generateCorrelationId=function(){return++this.callingIndex,this.conversationId+this.callingIndex},e.getCurrentTimeMS=function(){return(new Date).getTime()},e.MESSAGE_TIME_DELTA=10,e}()}(e.ScriptMessaging||(e.ScriptMessaging={}))}(OSFWebkit||(OSFWebkit={})),function(e){var t=function(){function t(e,t){this._initializationHelper=e,this._scriptMessager=t}return t.prototype.read=function(e){this._initializationHelper.getAppContext(null,(function(t){if(e){var n=t.get_settingsFunc()();e(0,n)}}),(function(t){e&&e(5001,{})}))},t.prototype.write=function(t,n){var i={},r=[],o=[];for(var a in t)r.push(a),o.push(t[a]);i.keys=r,i.values=o;this._scriptMessager.invokeMethod(e.WebView.MessageHandlerName,e.WebView.MethodId.WriteSettings,i,(function(e){n&&n(e[0])}))},t}();e.WebViewClientSettingsManager=t}(OSF||(OSF={})),function(e){!function(t){t.MessageHandlerName="Agave",t.PopupMessageHandlerName="WefPopupHandler",function(e){e[e.Settings=0]="Settings",e[e.SolutionReferenceId=1]="SolutionReferenceId",e[e.AppType=2]="AppType",e[e.MajorVersion=3]="MajorVersion",e[e.MinorVersion=4]="MinorVersion",e[e.RevisionVersion=5]="RevisionVersion",e[e.APIVersionSequence=6]="APIVersionSequence",e[e.AppCapabilities=7]="AppCapabilities",e[e.APPUILocale=8]="APPUILocale",e[e.AppDataLocale=9]="AppDataLocale",e[e.BindingCount=10]="BindingCount",e[e.DocumentUrl=11]="DocumentUrl",e[e.ActivationMode=12]="ActivationMode",e[e.ControlIntegrationLevel=13]="ControlIntegrationLevel",e[e.SolutionToken=14]="SolutionToken",e[e.APISetVersion=15]="APISetVersion",e[e.CorrelationId=16]="CorrelationId",e[e.InstanceId=17]="InstanceId",e[e.TouchEnabled=18]="TouchEnabled",e[e.CommerceAllowed=19]="CommerceAllowed",e[e.RequirementMatrix=20]="RequirementMatrix",e[e.OfficeThemeInfo=21]="OfficeThemeInfo"}(t.AppContextProperties||(t.AppContextProperties={})),function(e){e[e.Execute=1]="Execute",e[e.RegisterEvent=2]="RegisterEvent",e[e.UnregisterEvent=3]="UnregisterEvent",e[e.WriteSettings=4]="WriteSettings",e[e.GetContext=5]="GetContext",e[e.OnKeydown=6]="OnKeydown",e[e.AddinInitialized=7]="AddinInitialized",e[e.OpenWindow=8]="OpenWindow",e[e.MessageParent=9]="MessageParent",e[e.SendMessage=10]="SendMessage"}(t.MethodId||(t.MethodId={}));var n=function(){function t(e){this.hostScriptProxy=e}return t.prototype.execute=function(t,n,i){var r=n;null==r&&(r=[]);var o={id:t,apiArgs:r};this.hostScriptProxy.invokeMethod(e.WebView.MessageHandlerName,e.WebView.MethodId.Execute,o,(function(t){var n=t;if(e.OUtil.isArray(t)&&t.length>=2){t[0];n=t[1]}if(i)return i(new e.WebkitSafeArray(n))}))},t.prototype.registerEvent=function(t,n,i,r,o){this.hostScriptProxy.registerEvent(e.WebView.MessageHandlerName,e.WebView.MethodId.RegisterEvent,t,i,(function(t){var n=t,i=0;e.OUtil.isArray(t)&&t.length>=2&&(i=t[0],n=t[1]),r&&r(i,new e.WebkitSafeArray(n))}),(function(t){if(o)return o(new e.WebkitSafeArray(t))}))},t.prototype.unregisterEvent=function(t,n,i,r){this.hostScriptProxy.unregisterEvent(e.WebView.MessageHandlerName,e.WebView.MethodId.UnregisterEvent,t,i,(function(t){return r(new e.WebkitSafeArray(t))}))},t.prototype.messageParent=function(t){var n={dialogMessage:{messageType:0,messageContent:t[e.ParameterNames.MessageToParent]}};window.opener.postMessage(JSON.stringify(n),window.location.origin)},t.prototype.openDialog=function(n,i,r,o,a){var s=JSON.parse(r),c=s.url;if(c){var l=c.split("#"),u="?";c.indexOf("?")>-1&&(u="&");var f="width="+screen.width*s.width/100+", height="+screen.height*s.height/100;l[0]=l[0].concat(u).concat("action=displayDialog");var d,p=l.join("#");t.popup=window.open(p,"",f),window.addEventListener("message",(function(i){if(i.source==t.popup)try{var r=JSON.parse(i.data);r.dialogMessage&&o(n,[0,r.dialogMessage.messageContent])}catch(t){e.Utility.trace("messages received cannot be handled. Message:"+i.data)}})),d=window.setInterval((function(){try{(null==t.popup||t.popup.closed)&&(window.clearInterval(d),o(n,[12006]))}catch(t){e.Utility.trace("Error happened when popup window closed.")}}),1e3),a(0)}},t.prototype.closeDialog=function(e,n,i,r){t.popup?(t.popup.close(),t.popup=null,r(0)):r(5001)},t.prototype.sendMessage=function(t){var n=t[e.ParameterNames.MessageContent];!isNaN(parseFloat(n))&&isFinite(n)&&(n=n.toString()),this.hostScriptProxy.invokeMethod(e.WebView.MessageHandlerName,e.WebView.MethodId.SendMessage,n,null)},t.prototype.closeSdxDialog=function(t){throw e.Utility.createNotImplementedException()},t.prototype.resizeSdxDialog=function(t,n){throw e.Utility.createNotImplementedException()},t}();t.WebViewHostController=n}(e.WebView||(e.WebView={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(e,n,i,r){var o=t.call(this,e,n,i,r)||this;return o._serializedSettings={},o.initializeWebViewMessaging(),o}return __extends(n,t),n.prototype.initializeWebViewMessaging=function(){e.ScriptMessaging=e.WebView.ScriptMessaging},n.prototype.getAppContext=function(t,n,i){var r,o=this;r=this._hostInfo.isDialog?e.WebView.PopupMessageHandlerName:e.WebView.MessageHandlerName,e.ScriptMessaging.GetScriptMessenger().invokeMethod(r,e.WebView.MethodId.GetContext,[],(function(t){var i,r=e.Webkit.AppContextProperties,a=t[r.AppType],s=t[r.Settings];if(s&&2===s.length)for(var c=s[0],l=s[1],u=0;u<c.length;u++)o._serializedSettings[c[u]]=l[u];var f=t[r.SolutionReferenceId],d=t[r.MajorVersion],p=t[r.MinorVersion],h=t[r.AppCapabilities],g=t[r.APPUILocale],m=t[r.AppDataLocale],v=t[r.DocumentUrl],y=t[r.ActivationMode],O=t[r.ControlIntegrationLevel],b=t[r.SolutionToken];b=b?b.toString():"";var S=t[r.CorrelationId],_=t[r.InstanceId],A=t[r.TouchEnabled],C=t[r.CommerceAllowed],E=t[r.RequirementMatrix],I=t[r.HostCustomMessage],w=t[r.HostFullVersion],P=t[r.InitialDisplayMode];i=new e.OfficeAppContext(f,a,d,g,m,v,h,(function(){return o._serializedSettings}),y,O,b,S,_,A,C,p,E,I,w,void 0,void 0,void 0,void 0,void 0,void 0,void 0,P,void 0,void 0,void 0,!1,void 0,void 0),n(i)}))},n.prototype.createClientHostController=function(){return this._clientHostController||(this._clientHostController=new e.WebView.WebViewHostController(e.ScriptMessaging.GetScriptMessenger())),this._clientHostController},n.prototype.createAsyncMethodExecutor=function(){return new e.SafeArrayAsyncMethodExecutor(this.createClientHostController())},n.prototype.createClientSettingsManager=function(){return new e.WebViewClientSettingsManager(this,e.ScriptMessaging.GetScriptMessenger())},n}(e.InitializationHelper);e.WebViewInitializationHelper=t}(OSF||(OSF={})),function(e){var t;!function(e){!function(e){e[e.MethodCallback=0]="MethodCallback",e[e.EventCallback=1]="EventCallback"}(e.CallbackType||(e.CallbackType={}));var t=function(e,t,n){this.callbackType=e,this.callbackId=t,this.params=n};e.CallbackData=t}(t||(t={})),function(n){var i=function(){function n(){}return n.getInstance=function(){return null==n.uniqueInstance&&(n.uniqueInstance=new n),n.uniqueInstance},n.prototype.postMessage=function(e,t){agaveHost.postMessage(t)},n.prototype.ReceiveMessage=function(n){switch(n.callbackType){case t.CallbackType.MethodCallback:e.WebView.ScriptMessaging.agaveHostCallback(n.callbackId,n.params);break;case t.CallbackType.EventCallback:e.WebView.ScriptMessaging.agaveHostEventCallback(n.callbackId,n.params)}},n}();n.Poster=i}(e.Android||(e.Android={})),function(n){var i=function(){function n(){window.addEventListener("message",this.OnReceiveMessage.bind(this))}return n.prototype.postMessage=function(e,t){window.parent.postMessage(t,"*")},n.prototype.OnReceiveMessage=function(n){if(n.source==window.parent&&window.parent==window.top&&n.origin.startsWith("ms-appx-web://")){var i;try{i=JSON.parse(n.data)}catch(e){return}switch(i.callbackType){case t.CallbackType.MethodCallback:e.WebView.ScriptMessaging.agaveHostCallback(i.callbackId,JSON.parse(i.params));break;case t.CallbackType.EventCallback:e.WebView.ScriptMessaging.agaveHostEventCallback(i.callbackId,JSON.parse(i.params))}}},n}();n.Poster=i}(e.WinRT||(e.WinRT={}))}(OSF||(OSF={})),function(e){!function(t){!function(t){var n=null;t.agaveHostCallback=function(e,t){n.agaveHostCallback(e,t)},t.agaveHostEventCallback=function(e,t){n.agaveHostEventCallback(e,t)},t.GetScriptMessenger=function(){if(null==n){var t=e._OfficeAppFactory.getHostInfo().hostPlatform;if(t===e.HostInfoPlatform.android)n=new r("OSF.ScriptMessaging.agaveHostCallback","OSF.ScriptMessaging.agaveHostEventCallback",e.Android.Poster.getInstance());else{if(t!==e.HostInfoPlatform.winrt)throw e.Utility.createNotImplementedException();n=new r("agaveHostCallback","agaveHostEventCallback",new e.WinRT.Poster)}}return n};var i=function(e,t,n){this.id=e,this.targetId=t,this.handler=n},r=function(){function e(t,n,i){this.callingIndex=0,this.callbackList={},this.eventHandlerList={},this.asyncMethodCallbackFunctionName=t,this.eventCallbackFunctionName=n,this.poster=i,this.conversationId=e.getCurrentTimeMS().toString()}return e.prototype.invokeMethod=function(e,t,n,i){this.postMessage({},e,t,n,i)},e.prototype.registerEvent=function(e,t,n,r,o,a){var s={eventCallbackFunction:this.eventCallbackFunctionName},c={id:n,targetId:r},l=this.postMessage(s,e,t,c,a);this.eventHandlerList[l]=new i(n,r,o)},e.prototype.unregisterEvent=function(e,t,n,i,r){var o={id:n,targetId:i};for(var a in this.eventHandlerList)if(this.eventHandlerList.hasOwnProperty(a)){var s=this.eventHandlerList[a];s.id==n&&s.targetId==i&&delete this.eventHandlerList[a]}this.invokeMethod(e,t,o,r)},e.prototype.agaveHostCallback=function(e,t){var n=this.callbackList[e];if(n){var i=n(t);void 0!==i&&!0!==i||delete this.callbackList[e]}},e.prototype.agaveHostEventCallback=function(e,t){var n=this.eventHandlerList[e];n&&n.handler(t)},e.prototype.postMessage=function(e,t,n,i,r){var o=this.generateCorrelationId();return this.callbackList[o]=r,e.methodId=n,e.params=i,e.callbackId=o,e.callbackFunction=this.asyncMethodCallbackFunctionName,this.poster.postMessage(t,JSON.stringify(e)),o},e.prototype.generateCorrelationId=function(){return++this.callingIndex,this.conversationId+this.callingIndex},e.getCurrentTimeMS=function(){return(new Date).getTime()},e.MESSAGE_TIME_DELTA=10,e}()}(t.ScriptMessaging||(t.ScriptMessaging={}))}(e.WebView||(e.WebView={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.prototype.messageParent=function(t){if(e.Utility.externalNativeFunctionExists(typeof window.external.MessageParent2))"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.MessageParent2(JSON.stringify(t),OsfOMToken):window.external.MessageParent2(JSON.stringify(t));else{var n=t[e.ParameterNames.MessageToParent];window.external.MessageParent(n)}},n.prototype.openDialog=function(e,t,n,i,r){this.registerEvent(e,t,n,i,r)},n.prototype.closeDialog=function(e,t,n,i){this.unregisterEvent(e,t,n,i)},n.prototype.sendMessage=function(t){if(e.Utility.externalNativeFunctionExists(typeof window.external.MessageChild2))"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.MessageChild2(JSON.stringify(t),OsfOMToken):window.external.MessageChild2(JSON.stringify(t));else{var n=t[e.ParameterNames.MessageContent];window.external.MessageChild(n)}},n.prototype.closeSdxDialog=function(t){e.Utility.externalNativeFunctionExists(typeof window.external.closeSdxDialog)&&window.external.closeSdxDialog(t)},n.prototype.resizeSdxDialog=function(t,n){e.Utility.externalNativeFunctionExists(typeof window.external.resizeSdxDialog)&&window.external.resizeSdxDialog(t,n)},n}(e.RichClientHostController);e.Win32RichClientHostController=t}(OSF||(OSF={})),function(e){var t=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.prototype.openDialog=function(t,i,r,o,a){if(!n.popup||n.popup.closed){window.dialogAPIErrorCode=void 0;var s=JSON.parse(r),c=s.url;if(c){var l=c.split("#"),u="?";l[0].indexOf("?")>-1&&(u="&");var f="width="+screen.width*s.width/100+", height="+screen.height*s.height/100;l[0]=l[0].concat(u).concat("action=displayDialog");var d=l.join("#");if(n.popup=window.open(d,"",f),n.DialogEventListener=function(i){if(i.source==n.popup)try{var r=JSON.parse(i.data);r.dialogMessage&&o(t,[0,r.dialogMessage.messageContent])}catch(t){e.Utility.trace("messages received cannot be handlered. Message:"+i.data)}},null!=n.popup&&null==window.dialogAPIErrorCode)window.addEventListener("message",n.DialogEventListener),n.interval=window.setInterval((function(){try{(null==n.popup||n.popup.closed)&&(window.clearInterval(n.interval),window.removeEventListener("message",n.DialogEventListener),n.NotifyError=null,o(t,[12006]))}catch(t){e.Utility.trace("Error happened when popup window closed.")}}),500),n.NotifyError=function(e){o(t,[e])},a(0);else{var p=5001;window.dialogAPIErrorCode&&(p=window.dialogAPIErrorCode),a(p)}}else a(12003)}else a(12007)},n.prototype.messageParent=function(t){var n={dialogMessage:{messageType:0,messageContent:t[e.ParameterNames.MessageToParent]}};window.opener.postMessage(JSON.stringify(n),window.location.origin)},n.prototype.closeDialog=function(e,t,i,r){n.popup?(n.interval&&window.clearInterval(n.interval),n.popup.close(),n.popup=null,window.removeEventListener("message",n.DialogEventListener),n.NotifyError=null,r(0)):r(5001)},n}(e.Webkit.WebkitHostController);e.MacRichClientHostController=t}(OSF||(OSF={})),function(e){var t;!function(e){!function(e){e.Init=function(){return function(){"use strict";function e(e){return"function"==typeof e}var t,n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,r=function(e,n){d[i]=e,d[i+1]=n,2===(i+=2)&&(t?t(p):c())};var o=("undefined"!=typeof window?window:void 0)||{},a=(o.MutationObserver||o.WebKitMutationObserver,"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)),s="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;var c,l,u,f,d=new Array(1e3);function p(){for(var e=0;e<i;e+=2){(0,d[e])(d[e+1]),d[e]=void 0,d[e+1]=void 0}i=0}function h(){}a?(u=process.nextTick,f=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/),Array.isArray(f)&&"0"===f[1]&&"10"===f[2]&&(u=setImmediate),c=function(){u(p)}):s?((l=new MessageChannel).port1.onmessage=p,c=function(){l.port2.postMessage(0)}):c=function(){setTimeout(p,1)};var g=void 0,m=new C;function v(t,n){if(n.constructor===t.constructor)!function(e,t){1===t._state?b(e,t._result):2===t._state?S(e,t._result):_(t,void 0,(function(t){y(e,t)}),(function(t){S(e,t)}))}(t,n);else{var i=function(e){try{return e.then}catch(e){return m.error=e,m}}(n);i===m?S(t,m.error):void 0===i?b(t,n):e(i)?function(e,t,n){r((function(e){var i=!1,r=function(e,t,n,i){try{e.call(t,n,i)}catch(e){return e}}(n,t,(function(n){i||(i=!0,t!==n?y(e,n):b(e,n))}),(function(t){i||(i=!0,S(e,t))}),e._label);!i&&r&&(i=!0,S(e,r))}),e)}(t,n,i):b(t,n)}}function y(e,t){var n;e===t?S(e,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(n=t)||"object"==typeof n&&null!==n?v(e,t):b(e,t)}function O(e){e._onerror&&e._onerror(e._result),A(e)}function b(e,t){e._state===g&&(e._result=t,e._state=1,0!==e._subscribers.length&&r(A,e))}function S(e,t){e._state===g&&(e._state=2,e._result=t,r(O,e))}function _(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(A,e)}function A(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var i,r,o=e._result,a=0;a<t.length;a+=3)i=t[a],r=t[a+n],i?I(n,i,r,o):r(o);e._subscribers.length=0}}function C(){this.error=null}var E=new C;function I(t,n,i,r){var o,a,s,c,l=e(i);if(l){if((o=function(e,t){try{return e(t)}catch(e){return E.error=e,E}}(i,r))===E?(c=!0,a=o.error,o=null):s=!0,n===o)return void S(n,new TypeError("A promises callback cannot return that same promise."))}else o=r,s=!0;n._state!==g||(l&&s?y(n,o):c?S(n,a):1===t?b(n,o):2===t&&S(n,o))}function w(e,t){var n=this;n._instanceConstructor=e,n.promise=new e(h),n._validateInput(t)?(n._input=t,n.length=t.length,n._remaining=t.length,n._init(),0===n.length?b(n.promise,n._result):(n.length=n.length||0,n._enumerate(),0===n._remaining&&b(n.promise,n._result))):S(n.promise,n._validationError())}w.prototype._validateInput=function(e){return n(e)},w.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},w.prototype._init=function(){this._result=new Array(this.length)};var P=w;w.prototype._enumerate=function(){for(var e=this,t=e.length,n=e.promise,i=e._input,r=0;n._state===g&&r<t;r++)e._eachEntry(i[r],r)},w.prototype._eachEntry=function(e,t){var n,i=this,r=i._instanceConstructor;"object"==typeof(n=e)&&null!==n?e.constructor===r&&e._state!==g?(e._onerror=null,i._settledAt(e._state,t,e._result)):i._willSettleAt(r.resolve(e),t):(i._remaining--,i._result[t]=e)},w.prototype._settledAt=function(e,t,n){var i=this,r=i.promise;r._state===g&&(i._remaining--,2===e?S(r,n):i._result[t]=n),0===i._remaining&&b(r,i._result)},w.prototype._willSettleAt=function(e,t){var n=this;_(e,void 0,(function(e){n._settledAt(1,t,e)}),(function(e){n._settledAt(2,t,e)}))};var x=function(e){return new P(this,e).promise};var T=function(e){var t=new this(h);if(!n(e))return S(t,new TypeError("You must pass an array to race.")),t;var i=e.length;function r(e){y(t,e)}function o(e){S(t,e)}for(var a=0;t._state===g&&a<i;a++)_(this.resolve(e[a]),void 0,r,o);return t};var R=function(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(h);return y(t,e),t};var F=function(e){var t=new this(h);return S(t,e),t},k=0;var N=M;function M(t){this._id=k++,this._state=void 0,this._result=void 0,this._subscribers=[],h!==t&&(e(t)||function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof M||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){y(e,t)}),(function(t){S(e,t)}))}catch(t){S(e,t)}}(this,t))}return M.all=x,M.race=T,M.resolve=R,M.reject=F,M._setScheduler=function(e){t=e},M._setAsap=function(e){r=e},M._asap=r,M.prototype={constructor:M,then:function(e,t){var n=this,i=n._state;if(1===i&&!e||2===i&&!t)return this;var o=new this.constructor(h),a=n._result;if(i){var s=arguments[i-1];r((function(){I(i,o,s,a)}))}else _(n,o,e,t);return o},catch:function(e){return this.then(null,e)}},N}.call(this)}}(e.PromiseImpl||(e.PromiseImpl={}))}(e._Internal||(e._Internal={})),function(e){e.OfficePromise=function(){if("undefined"==typeof window&&"function"==typeof Promise)return Promise;if("undefined"!=typeof window){if(window.Promise)return window.Promise;var t=e.PromiseImpl.Init();return window.Promise=t,t}}()}(t=e._Internal||(e._Internal={})),e.OfficePromise=t.OfficePromise,e.Promise=e.OfficePromise}(Office||(Office={})),function(e){!function(t){var n,i=e.OUtil.Guid.generateNewGuid(),r=new RegExp("^https?://store\\.office(ppe|-int)?\\.com/","i"),o=!1,a="PRIVATE";t.enableTelemetry=!0;var s=function(){};t.AppInfo=s;var c=function(){function t(){this.clientIDKey="Office API client",this.logIdSetKey="Office App Log Id Set"}return t.prototype.getClientId=function(){var t=this.getValue(this.clientIDKey);return(!t||t.length<=0||t.length>40)&&(t=e.OUtil.Guid.generateNewGuid(),this.setValue(this.clientIDKey,t)),t},t.prototype.getValue=function(t){var n=e.OUtil.getLocalStorage(),i="";return n&&(i=n.getItem(t)),i},t.prototype.setValue=function(t,n){var i=e.OUtil.getLocalStorage();i&&i.setItem(t,n)},t}();function l(e){return e&&(e=e.replace(/[{}]/g,"").toLowerCase()),e||""}function u(e){try{return JSON.parse(e)}catch(t){return e}}function f(){n&&(o||OTel.OTelLogger.onTelemetryLoaded((function(){var t=[],i=n.isMos?1:0;t=t.concat([oteljs.makeStringDataField("Browser",n.browser),oteljs.makeInt64DataField("AppSizeWidth",window.innerWidth),oteljs.makeInt64DataField("AppSizeHeight",window.innerHeight),oteljs.makeInt64DataField("IsMOS",i)]),e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10045620_CopilotAgentTelSettings")&&n.launchSource&&n.launchReason&&(t.push(oteljs.makeStringDataField("LaunchSource",n.launchSource)),t.push(oteljs.makeStringDataField("LaunchReason",n.launchReason))),Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.AppActivatedX",dataFields:t,eventFlags:{dataCategories:2,diagnosticLevel:110,samplingPolicy:191}})})))}function d(e,t){}function p(){var t=0!=(e._OfficeAppFactory.getHostInfo().flags&e.HostInfoFlags.PublicAddin);return t||!!n&&g(e._OfficeAppFactory.getHostInfo().hostPlatform,n.hostVersion)}function h(e,t){return p()||t!==e?t:a}function g(t,n){var i=!1,r=/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.exec(n);if(r){var o=parseInt(r[1]),a=parseInt(r[2]),s=parseInt(r[3]);t==e.HostInfoPlatform.win32?(o<16||16==o&&s<14225)&&(i=!0):t==e.HostInfoPlatform.mac&&(o<16||16==o&&(a<52||52==a&&s<808))&&(i=!0)}return i}function m(){return 0!=(e._OfficeAppFactory.getHostInfo().flags&e.HostInfoFlags.IsMos)}t.initialize=function(f){if(t.enableTelemetry&&!n){n=new s,f.get_hostFullVersion()?n.hostVersion=f.get_hostFullVersion():n.hostVersion=f.get_appVersion(),n.appId=p()?f.get_id():a,n.marketplaceType=f._marketplaceType,n.host=""+f.get_appName(),n.browser=window.navigator.userAgent,n.correlationId=l(f.get_correlationId()),n.clientId=(new c).getClientId(),n.appInstanceId=f.get_appInstanceId(),n.appInstanceId&&(n.appInstanceId=l(n.appInstanceId),n.appInstanceId=h(f.get_id(),n.appInstanceId)),n.message=f.get_hostCustomMessage(),n.officeJSVersion=e.ConstantNames.FileVersion,n.hostJSVersion="NA",f._wacHostEnvironment&&(n.wacHostEnvironment=f._wacHostEnvironment);var d=f.get_isFromWacAutomation();null!=d&&(n.isFromWacAutomation=d.toString().toLowerCase());var g=f.get_docUrl();n.docUrl=r.test(g)?g:"";var v=location.href;if(v&&(n.isPreload=-1!==v.indexOf("preload=1"),v=v.split("?")[0].split("#")[0]),n.isMos=m(),e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10045620_CopilotAgentTelSettings")){var y=f.get_settingsFunc()();y&&y.LaunchSource&&y.LaunchReason&&(n.launchSource=u(y.LaunchSource),n.launchReason=u(y.LaunchReason))}!function(t,n){n.assetId="",n.userId="";try{if(!e.Utility.isNullOrEmpty(t)){var i=decodeURIComponent(t),r=new DOMParser,o=void 0;if(e.LoadScriptHelper.trustedTypesOptIn()&&window.trustedTypes&&window.trustedTypes.createPolicy)o=window.trustedTypes.createPolicy("officejs-domparser",{createHTML:function(e){return e}}).createHTML(i);else o=i;var a=r.parseFromString(o,"text/xml"),s=a.getElementsByTagName("t")[0].attributes.getNamedItem("cid"),c=a.getElementsByTagName("t")[0].attributes.getNamedItem("oid");s&&s.nodeValue?n.userId=s.nodeValue:c&&c.nodeValue&&(n.userId=c.nodeValue),n.assetId=a.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}}catch(e){}}(f.get_eToken(),n),n.sessionId=i,OTel.OTelLogger.initialize(n),n.isPreload?o=!0:t.onAppActivated()}},t.onAppActivated=f,t.onScriptDone=function(e,t,n,i){},t.onCallDone=function(e,t,n,i,r){},t.onMethodDone=function(e,t,n,i){},t.onPropertyDone=function(t,n){e.AppTelemetry.onCallDone("property",-1,t,n,0)},t.onCheckWACHost=function(e,t,n,i,r){},t.onEventDone=function(t,n){e.AppTelemetry.onCallDone("event",t,null,0,n)},t.onRegisterDone=function(t,n,i,r){e.AppTelemetry.onCallDone(t?"registerevent":"unregisterevent",n,null,i,r)},t.onAppClosed=function(e,t){},t.setOsfControlAppCorrelationId=function(e){l(e)},t.doAppInitializationLogging=d,t.logAppCommonMessage=function(e){},t.logAppException=function(e){},t.CallOnAppActivatedIfPending=function(){o&&(o=!1,f())},t.canSendAddinId=p,t.getCompliantAppInstanceId=h,t._isComplianceExceptedHost=g,t.isMos=m}(e.AppTelemetry||(e.AppTelemetry={}))}(OSF||(OSF={})),function(e){var t=function(){function t(){}return t.loaded=function(){return!(void 0===t.logger)},t.create=function(t){var n,i={id:t.appId,marketplaceType:t.marketplaceType,assetId:t.assetId,officeJsVersion:t.officeJSVersion,hostJsVersion:t.hostJSVersion,browserToken:t.clientId,instanceId:t.appInstanceId,sessionId:t.sessionId},r=oteljs.Contracts.Office.System.SDX.getFields("SDX",i);if("web"===OSF._OfficeAppFactory.getHostInfo().hostPlatform)n=new e.SdxWacSink;else{if(!Office.context.requirements.isSetSupported("Telemetry","1.2"))return console.error("Cannot create telemetry sink successfully"),null;n=new e.RichApiSink,this.richApiSink=n}var o=new oteljs.SimpleTelemetryLogger(void 0,r);return o.addSink(n),o.setTenantToken("Office.Extensibility.OfficeJs","db334b301e7b474db5e0f02f07c51a47-a1b5bc36-1bbe-482f-a64a-c2d9cb606706-7439",1755),oteljs.onNotification().addListener((function(e){OSF.Utility.debugLog(e.message())})),o},t.checkAndResolvePromises=function(){t.loaded()&&(t.promises.forEach((function(e){e()})),t.promises=[])},t.initialize=function(e){t.Enabled?Office.onReadyInternal().then((function(){t.loaded()||(OSF.Utility.debugLog("Creating OTelLogger"),t.logger=t.create(e),t.checkAndResolvePromises())})):t.promises=[]},t.sendTelemetryEvent=function(e){t.onTelemetryLoaded((function(){try{t.logger.sendTelemetryEvent(e)}catch(e){console.error("Cannot send telemetry event: "+JSON.stringify(e))}}))},t.sendNonStandardEvent=function(e,n){t.onTelemetryLoaded((function(){try{t.logger.sendNonStandardEvent(e,n)}catch(e){console.error("Cannot send telemetry event: "+JSON.stringify(e))}}))},t.flushTelemetryQueue=function(){var e=this;return new Office.Promise((function(n){t.onTelemetryLoaded((function(){e.richApiSink?e.richApiSink.flushTelemetryQueue().then((function(){n()})):n()}))}))},t.onTelemetryLoaded=function(e){t.Enabled&&(t.loaded()?e():t.promises.push(e))},t.promises=[],t.Enabled=!0,t}();e.OTelLogger=t}(OTel||(OTel={})),function(e){var t=function(){function e(){var e=this;this._requestIsPending=!0,this._telemetryQueue=[],this.pause(1e3).then((function(){var t=e._telemetryQueue;e._telemetryQueue=[],e._requestIsPending=!1,e.processTelemetryEvents(t)}))}return e.prototype.sendTelemetryEvent=function(e){this._telemetryQueue.push([e,1]),this._requestIsPending||this.processWorkBacklog()},e.prototype.sendNonStandardEvent=function(e,t){this._telemetryQueue.push([e,t]),this._requestIsPending||this.processWorkBacklog()},e.prototype.flushTelemetryQueue=function(){var e=this;return new Office.Promise((function(t){var n=e._telemetryQueue;e._telemetryQueue=[],e.processTelemetryEvents(n).then((function(){t()}))}))},e.prototype.processWorkBacklog=function(){var e=this;this._requestIsPending=!0;var t=this._telemetryQueue;this._telemetryQueue=[],this.processTelemetryEvents(t).then(this.waitAndProcessMore.bind(this)).catch((function(t){oteljs.logError(1,"RichApiSink Error",t),e.waitAndProcessMore.bind(e)()}))},e.prototype.waitAndProcessMore=function(){var e=this;this.pause(1e3).then((function(){e._telemetryQueue.length>0&&setTimeout((function(){return e.processWorkBacklog()}),0),e._requestIsPending=!1})).catch((function(){}))},e.prototype.processTelemetryEvents=function(e){var t=this,n=new OfficeCore.RequestContext;return e.forEach((function(e){var i=e[0],r=e[1];if(i.telemetryProperties){var o=[];t.addDataFields(o,i.dataFields);var a=i.eventContract?i.eventContract.name:"";i.eventContract&&t.addDataFields(o,i.eventContract.dataFields),1===r?n.telemetry.sendTelemetryEvent(i.telemetryProperties,i.eventName,a,oteljs.getEffectiveEventFlags(i),o):n.telemetry.sendNonStandardEvent(i.telemetryProperties,i.eventName,a,oteljs.getEffectiveEventFlags(i),o,r)}})),n.sync().catch((function(){oteljs.logNotification(2,1,(function(){return"RichApi telemetry call failed."}))}))},e.prototype.addDataFields=function(e,t){t&&t.forEach((function(t){e.push({name:t.name,value:t.value,classification:t.classification?t.classification:4,type:t.dataType})}))},e.prototype.pause=function(e){return new Office.Promise((function(t){return setTimeout(t,e)}))},e}();e.RichApiSink=t}(OTel||(OTel={})),function(e){var t=function(){function e(){}return e.prototype.sendTelemetryEvent=function(e,t){try{if(e.dataFields&&e.dataFields.filter((function(e){var t=e.classification;return t&&4!==t&&1!==t})).length>0)return;var n=OSF._OfficeAppFactory.getId(),i=OSF.AgaveHostAction.SendTelemetryEvent;OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n,i,e])}catch(e){oteljs.logError(1,"AgaveWacSink",e)}},e.prototype.sendNonStandardEvent=function(e,t){try{if(1===t)throw new Error("Please call sendTelemetryEvent for events of type "+t);if(e.dataFields&&e.dataFields.filter((function(e){var t=e.classification;return t&&4!==t&&1!==t&&32!==t&&2048!==t})).length>0)return;var n=OSF._OfficeAppFactory.getId(),i=OSF.AgaveHostAction.SendNonStandardEvent;OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n,i,e])}catch(e){oteljs.logError(1,"AgaveWacSink",e)}},e}();e.SdxWacSink=t}(OTel||(OTel={})),function(e){var t,n=[];function i(e,t,n){OTel.OTelLogger.onTelemetryLoaded((function(){Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.AddinSpecialPermissionRequest",dataFields:[oteljs.makeStringDataField("invocationId",e),oteljs.makeStringDataField("methodPath",t),oteljs.makeStringDataField("params",n)],eventFlags:{dataCategories:2,diagnosticLevel:110}})}))}function r(e,t,n){OTel.OTelLogger.onTelemetryLoaded((function(){Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.AddinSpecialPermissionResponse",dataFields:[oteljs.makeStringDataField("invocationId",e),oteljs.makeBooleanDataField("isSuccessful",t),oteljs.makeStringDataField("error",n?JSON.stringify({name:n.name,code:n.code,message:n.message}):void 0)],eventFlags:{dataCategories:2,diagnosticLevel:110}})}))}try{for(var o=0,a=function(e){var t=Navigator.prototype[e];t&&(Navigator.prototype[e]=function(n,a,s){if(3===arguments.length&&Function.prototype.isPrototypeOf(a)&&Function.prototype.isPrototypeOf(s)){var c=(o++).toString();return i(c,"Navigator.prototype."+e,JSON.stringify([{audio:!!n.audio,video:!!n.video}])),t.apply(this,[n,function(){return r(c,!0),a.apply(this,arguments)},function(){return r(c,!1,arguments[0]),s.apply(this,arguments)}])}return t.apply(this,arguments)},n.push("Navigator.prototype."+e))},s=0,c=["getUserMedia","webkitGetUserMedia","mozGetUserMedia"];s<c.length;s++){a(c[s])}var l=MediaDevices.prototype.getUserMedia;l&&(MediaDevices.prototype.getUserMedia=function(e){var t=(o++).toString();return 1===arguments.length&&void 0!==e?(i(t,"MediaDevices.prototype.getUserMedia",JSON.stringify([{audio:!!e.audio,video:!!e.video}])),l.apply(this,arguments).then((function(){return r(t,!0),arguments[0]}),(function(){throw r(t,!1,arguments[0]),arguments[0]}))):l.apply(this,arguments)},n.push("MediaDevices.prototype.getUserMedia"));for(var u=function(e){var t=Geolocation.prototype[e];t&&(Geolocation.prototype[e]=function(n,a,s){for(var c=[],l=3;l<arguments.length;l++)c[l-3]=arguments[l];var u=(o++).toString(),f=!1;i(u,"Geolocation.prototype."+e,JSON.stringify([]));var d=Function.prototype.isPrototypeOf(n)?function(){return f||(r(u,!0),f=!0),n.apply(this,arguments)}:n,p=Function.prototype.isPrototypeOf(a)?function(){return f||(r(u,!1,arguments[0]),f=!0),a.apply(this,arguments)}:a;return t.apply(this,[d,p,s].concat(c))},n.push("Geolocation.prototype."+e))},f=0,d=["getCurrentPosition","watchPosition"];f<d.length;f++){u(d[f])}}catch(e){t=e.toString()}OTel.OTelLogger.onTelemetryLoaded((function(){Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.AddinSpecialPermissionHookInstall",dataFields:[oteljs.makeStringDataField("hooksInstalled",JSON.stringify(n)),oteljs.makeStringDataField("error",t)],eventFlags:{dataCategories:2,diagnosticLevel:110}})}))}(Office||(Office={})),function(e){!function(e){!function(e){e.FeatureGates={},e.EventType=OSF.EventType,e.sendTelemetryEvent=function(e){OTel.OTelLogger.sendTelemetryEvent(e)},e.sendNonStandardEvent=function(e,t){OTel.OTelLogger.sendNonStandardEvent(e,t)},e.flushTelemetryQueue=function(){return OTel.OTelLogger.flushTelemetryQueue()},e.telemetrySink=OTel.OTelLogger}(e.WebExtension||(e.WebExtension={}))}(e.Office||(e.Office={}))}(Microsoft||(Microsoft={})),function(e){e.sendTelemetryEvent=function(e){Microsoft.Office.WebExtension.sendTelemetryEvent(e)},e.sendNonStandardEvent=function(e,t){Microsoft.Office.WebExtension.sendNonStandardEvent(e,t)},e.flushTelemetryQueue=function(){return Microsoft.Office.WebExtension.flushTelemetryQueue()},e.telemetrySink=Microsoft.Office.WebExtension.telemetrySink,e.isTrustedHost=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,i;return __generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,6,,7]),OSF._OfficeAppFactory.getHostInfo().hostPlatform===OSF.HostInfoPlatform.web?[3,2]:[4,e.onReady()];case 1:return r.sent(),[2,!0];case 2:return null!=(t=OSF._OfficeAppFactory.getWebAppState().clientEndPoint)&&t.fHostTrusted||null!=document.referrer&&(n=OSF.OUtil.parseUrl(document.referrer,!1),"https:"==n.protocol&&OSF.XdmCommunicationManager.isHostNameValidWacDomain(n.hostname)&&!new RegExp("^"+document.domain.replace(new RegExp("\\.","g"),"\\.")+"$").test(n.hostname))?[2,!0]:null==t?[3,4]:[4,OSF.Utility.promisify((function(e){t.invoke("ContextActivationManager_getAppContextAsync",e,OSF._OfficeAppFactory.getWebAppState().id)}),1e4)];case 3:return r.sent(),[2,!0];case 4:return[2,!1];case 5:return[3,7];case 6:return i=r.sent(),OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception happens at Office.isTrustedHost."+i),[2,!1];case 7:return[2]}}))}))},Microsoft.Office.WebExtension.onReadyInternal=e.onReadyInternal}(Office||(Office={}));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.graph="graph",e.wfe="wfe"}(t=e.RemoteEndpointType||(e.RemoteEndpointType={}));var n=function(){function e(){}return e.prototype._resolveRequestUrlAndHeaderInfo=function(){return u._createPromiseFromResult(null)},e.prototype._createRequestExecutorOrNull=function(){return null},e.prototype.getEventRegistration=function(e){return null},e}();e.SessionBase=n;var i=function(){function e(){}return e.setCustomSendRequestFunc=function(t){e.s_customSendRequestFunc=t},e.xhrSendRequestFunc=function(e){return u.createPromise((function(t,n){var i=new XMLHttpRequest;if(i.open(e.method,e.url),i.onload=function(){var e={statusCode:i.status,headers:u._parseHttpResponseHeaders(i.getAllResponseHeaders()),body:i.responseText};t(e)},i.onerror=function(){n(new r.RuntimeError({code:a.connectionFailure,httpStatusCode:i.status,message:u._getResourceString(s.connectionFailureWithStatus,i.statusText)}))},e.headers)for(var o in e.headers)i.setRequestHeader(o,e.headers[o]);i.send(u._getRequestBodyText(e))}))},e.fetchSendRequestFunc=function(e){var t=u._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=u._validateLocalDocumentRequest(e);var t=u._buildRequestMessageSafeArray(e);return u.createPromise((function(e,n){OSF.DDA.RichApi.executeRichApiRequestAsync(t,(function(t){var n;n="succeeded"==t.status?{statusCode:l.getResponseStatusCode(t),headers:l.getResponseHeaders(t),body:l.getResponseBody(t)}:l.buildHttpResponseFromOfficeJsError(t.error.code,t.error.message),u.log("Response:"),u.log(JSON.stringify(n)),e(n)}))}))},e.validateAndNormalizeRequest=function(e){if(u.isNullOrUndefined(e))throw r.RuntimeError._createInvalidArgError({argumentName:"request"});u.isNullOrEmptyString(e.method)&&(e.method="GET"),e.method=e.method.toUpperCase();var t=!1;if("object"==typeof e.headers&&e.headers[c.testRequestNameHeader]&&(t=!0),!t){var n=f._getCurrentTestNameWithSequenceId();n&&(e.headers||(e.headers={}),e.headers[c.testRequestNameHeader]=n)}},e.logRequest=function(t){if(u._logEnabled){if(u.log("---HTTP Request---"),u.log(t.method+" "+t.url),t.headers)for(var n in t.headers)u.log(n+": "+t.headers[n]);e._logBodyEnabled&&u.log(u._getRequestBodyText(t))}},e.logResponse=function(t){if(u._logEnabled){if(u.log("---HTTP Response---"),u.log(""+t.statusCode),t.headers)for(var n in t.headers)u.log(n+": "+t.headers[n]);e._logBodyEnabled&&u.log(t.body)}},e._logBodyEnabled=!1,e}();e.HttpUtility=i;var r,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 r=0;r<i.entries.length;r++){var o=i.entries[r];if(Array.isArray(o)){var a={messageCategory:o[0],messageType:o[1],targetId:o[2],message:o[3],id:o[4]};i.entries[r]=a}}}t.dispatchMessage(n)}}return e.init=function(t){if("object"==typeof t&&t){var n=new e(t);e.s_instance=n,i.setCustomSendLocalDocumentRequestFunc((function(t){t=u._validateLocalDocumentRequest(t);var i=0;u.isReadonlyRestRequest(t.method)||(i=1);var r=t.url.indexOf("?");if(r>=0){var o=t.url.substr(r+1),a=u._parseRequestFlagsAndCustomDataFromQueryStringIfAny(o);a.flags>=0&&(i=a.flags)}"string"==typeof t.body&&(t.body=JSON.parse(t.body));var s={id:e.nextId(),type:1,flags:i,message:t};return n.sendMessageToHostAndExpectResponse(s).then((function(e){return e.message}))}));for(var r=0;r<e.s_onInitedHandlers.length;r++)e.s_onInitedHandlers[r](n)}},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=u.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),u.isNullOrUndefined(i.httpStatusCode)||200===i.httpStatusCode){var r={};r[a.accessDenied]=401,r[a.connectionFailure]=500,r[a.generalException]=500,r[a.invalidArgument]=400,r[a.invalidObjectPath]=400,r[a.invalidOrTimedOutSession]=408,r[a.invalidRequestContext]=400,r[a.timeout]=408,r[a.valueNotLoaded]=400,i.httpStatusCode=r[i.code]}return u.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:a.invalidArgument,httpStatusCode:400,message:u.isNullOrEmptyString(t.argumentName)?u._getResourceString(s.invalidArgumentGeneric):u._getResourceString(s.invalidArgument,t.argumentName),debugInfo:t.errorLocation?{errorLocation:t.errorLocation}:{},innerError:t.innerError})},n}(Error);e.RuntimeError=t}(r=e._Internal||(e._Internal={})),e.Error=r.RuntimeError;var a=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.undoNotSupported="UndoNotSupported",e}();e.CoreErrorCodes=a;var s=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=s;var c=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.testRequestNameHeader="x-test-request-name",e}();e.CoreConstants=c;var l=function(){function e(){}return e.buildMessageArrayForIRequestExecutor=function(t,n,i,r){var o=JSON.stringify(i.Body);u.log("Request:"),u.log(o);var a={};return u._copyHeaders(i.Headers,a),a[c.sourceLibHeader]=r,e.buildRequestMessageSafeArray(t,n,"POST",c.processQuery,a,o)},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=a.generalException,i.ErrorMessage=n,t==e.OfficeJsErrorCode_ooeNoCapability?(i.ErrorCode=a.accessDenied,i.HttpStatusCode=401):t==e.OfficeJsErrorCode_ooeActivityLimitReached?(i.ErrorCode=a.activityLimitReached,i.HttpStatusCode=429):t==e.OfficeJsErrorCode_ooeInvalidOrTimedOutSession?(i.ErrorCode=a.invalidOrTimedOutSession,i.HttpStatusCode=408,i.ErrorMessage=u._getResourceString(s.invalidOrTimedOutSessionMessage)):t==e.OfficeJsErrorCode_ooeRequestPayloadSizeLimitExceeded?(i.ErrorCode=a.requestPayloadSizeLimitExceeded,i.HttpStatusCode=400):t==e.OfficeJsErrorCode_ooeResponsePayloadSizeLimitExceeded?(i.ErrorCode=a.responsePayloadSizeLimitExceeded,i.HttpStatusCode=400):t==e.OfficeJsErrorCode_ooeWriteNotSupportedWhenModalDialogOpen?(i.ErrorCode=a.writeNotSupportedWhenModalDialogOpen,i.HttpStatusCode=400):t==e.OfficeJsErrorCode_ooeInvalidSheetName?(i.ErrorCode=a.invalidRequestContext,i.HttpStatusCode=400,i.ErrorMessage=u._getResourceString(s.invalidSheetName)):t==e.OfficeJsErrorCode_ooeUndoNotSupported&&(i.ErrorCode=a.undoNotSupported,i.HttpStatusCode=400),i},e.buildHttpResponseFromOfficeJsError=function(t,n){var i=500,r={error:{}};return r.error.code=a.generalException,r.error.message=n,t===e.OfficeJsErrorCode_ooeNoCapability?(i=403,r.error.code=a.accessDenied):t===e.OfficeJsErrorCode_ooeActivityLimitReached&&(i=429,r.error.code=a.activityLimitReached),{statusCode:i,headers:{},body:JSON.stringify(r)}},e.buildRequestMessageSafeArray=function(e,t,n,i,r,o){var a=[];if(r)for(var s in r)a.push(s),a.push(r[s]);return[e,n,i,a,o,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.OfficeJsErrorCode_ooeUndoNotSupported=5017,e}();e.RichApiMessageUtility=l,function(e){e.getPromiseType=function(){if("undefined"!=typeof Promise)return Promise;if(void 0!==Office&&Office.Promise)return Office.Promise;if(void 0!==OfficeExtension&&OfficeExtension.Promise)return OfficeExtension.Promise;throw new e.Error("No Promise implementation found")}}(r=e._Internal||(e._Internal={}));var u=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 r.RuntimeError._createInvalidArgError({argumentName:n})},e.isNullOrUndefined=function(e){return null===e||void 0===e},e.isUndefined=function(e){return void 0===e},e.isNullOrEmptyString=function(e){return null===e||(void 0===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 r="L_"+t,o=window.Strings.OfficeOM[r];o&&(i=o)}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 r.RuntimeError._createInvalidArgError({argumentName:"format"})}))},Object.defineProperty(e,"Promise",{get:function(){return r.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 r.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 r.RuntimeError._createInvalidArgError({argumentName:"request"});var i=t.url.substr(n),o=i.toLowerCase();return"_api"===o?i="":"_api/"===o.substr(0,"_api/".length)&&(i=i.substr("_api/".length)),{method:t.method,url:i,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 r=n[i].split("=");if(r[0].toLowerCase()===c.flags){var o=parseInt(r[1]);o&=65535,t.flags=o}else r[0].toLowerCase()===c.customData&&(t.customData=decodeURIComponent(r[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,c.processQuery.length).toLowerCase()===c.processQuery.toLowerCase()){var r=t.url.indexOf("?");if(r>0){var o=t.url.substr(r+1),a=e._parseRequestFlagsAndCustomDataFromQueryStringIfAny(o);a.flags>=0&&(n=a.flags),i=a.customData}}return l.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"),r=t.split(i),o=0;o<r.length;o++){var a=r[o];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=e._parseErrorResponseBody(t),i=t.statusCode.toString();if(e.isNullOrUndefined(n)||"object"!=typeof n||!n.error)return e._createDefaultErrorResponse(i);var r=n.error,o=r.innerError;return o&&o.code?e._createErrorResponse(o.code,i,o.message):r.code?e._createErrorResponse(r.code,i,r.message):e._createDefaultErrorResponse(i)},e._parseErrorResponseBody=function(t){if(e.isPlainJsonObject(t.body))return t.body;if(!e.isNullOrEmptyString(t.body)){var n=e.trim(t.body);try{return JSON.parse(n)}catch(t){e.log("Error when parse "+n)}}},e._createDefaultErrorResponse=function(t){return{errorCode:a.connectionFailure,errorMessage:e._getResourceString(s.connectionFailureWithStatus,t)}},e._createErrorResponse=function(t,n,i){return{errorCode:t,errorMessage:e._getResourceString(s.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=u;var f=function(){function e(){}return e.setMock=function(t){e.s_isMock=t},e.isMock=function(){return e.s_isMock},e._setCurrentTestName=function(t){e.s_currentTestName=t,e.s_currentTestSequenceId=0},e._getCurrentTestNameWithSequenceId=function(){return e.s_currentTestName?(e.s_currentTestSequenceId++,e.s_currentTestName+"."+e.s_currentTestSequenceId):null},e}();e.TestUtility=f,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,r,o){A.validateObjectPath(n);var a={Id:t._nextId(),ActionType:4,Name:i,ObjectPathId:n._objectPath.objectPathInfo.Id,ArgumentInfo:{}},s=[r],c=A.setMethodArguments(t,a.ArgumentInfo,s);A.validateReferencedObjectPaths(c);var l=new h(a,0,o);if(l.referencedObjectPath=n._objectPath,l.referencedArgumentObjectPaths=c,e._internalConfig.enablePreviewExecution&&0!=(16&o)){var u={Id:t._nextId(),ActionType:4,Name:i,ObjectId:"",ObjectType:"",Arguments:[r]};n._addPreviewExecutionAction(u)}return n._addAction(l)},t.createQueryAction=function(e,t,n,i){A.validateObjectPath(t);var r={Id:e._nextId(),ActionType:2,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,QueryInfo:n},o=new h(r,1,4);return o.referencedObjectPath=t._objectPath,t._addAction(o,i)},t.createQueryAsJsonAction=function(e,t,n,i){A.validateObjectPath(t);var r={Id:e._nextId(),ActionType:7,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,QueryInfo:n},o=new h(r,1,4);return o.referencedObjectPath=t._objectPath,t._addAction(o,i)},t.createUpdateAction=function(e,t,n){A.validateObjectPath(t);var i={Id:e._nextId(),ActionType:9,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,ObjectState:n},r=new h(i,0,0);return r.referencedObjectPath=t._objectPath,t._addAction(r)},t}();e.CommonActionFactory=d;var p=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),u.createPromise((function(i,r){n._context._addServiceApiAction(e,t,i,r)}))},t.prototype._addPreviewExecutionAction=function(e){},t.prototype._retrieve=function(t,n){var i=e._internalConfig.alwaysPolyfillClientObjectRetrieveMethod;i||(i=!A.isSetSupported("RichApiRuntime","1.1"));var r=m._parseQueryOption(t);return i?d.createQueryAction(this._context,this,r,n):d.createQueryAsJsonAction(this._context,this,r,n)},t.prototype._recursivelyUpdate=function(t){var n=e._internalConfig.alwaysPolyfillClientObjectUpdateMethod;n||(n=!A.isSetSupported("RichApiRuntime","1.2"));try{var i=this[_.scalarPropertyNames];i||(i=[]);var o=this[_.scalarPropertyUpdateable];if(!o){o=[];for(var c=0;c<i.length;c++)o.push(!1)}var l=this[_.navigationPropertyNames];l||(l=[]);var f={},p={},h=0;for(var g in t){var m=i.indexOf(g);if(m>=0){if(!o[m])throw new r.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:u._getResourceString(C.attemptingToSetReadOnlyProperty,g),debugInfo:{errorLocation:g}});f[g]=t[g],++h}else{if(!(l.indexOf(g)>=0))throw new r.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:u._getResourceString(C.propertyDoesNotExist,g),debugInfo:{errorLocation:g}});p[g]=t[g]}}if(h>0)if(n)for(c=0;c<i.length;c++){var v=f[g=i[c]];A.isUndefined(v)||d.createSetPropertyAction(this._context,this,g,v)}else d.createUpdateAction(this._context,this,f);for(var g in p){var y=this[g],O=p[g];y._recursivelyUpdate(O)}}catch(e){throw new r.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:u._getResourceString(s.invalidArgument,"properties"),debugInfo:{errorLocation:this._className+".update"},innerError:e})}},t}();e.ClientObjectBase=p;var h=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=h;var g=function(){function t(e,t,n,i,r,o){this.m_objectPathInfo=e,this.m_parentObjectPath=t,this.m_isCollection=n,this.m_isInvalidAfterRequest=i,this.m_isValid=!0,this.m_operationType=r,this.m_flags=o}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(!u.isNullOrEmptyString(i)){if(!this.m_savedObjectPathInfo&&!this.isInvalidAfterRequest&&t.isRestorableObjectPath(this.m_objectPathInfo.ObjectPathType)){var r={};t.copyObjectPathInfo(this.m_objectPathInfo,r),this.m_savedObjectPathInfo={pathInfo:r,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 o=n[_.collectionPropertyPath];if(!u.isNullOrEmptyString(o)&&n.context){var a=A.tryGetObjectIdFromLoadOrRetrieveResult(e);if(!u.isNullOrUndefined(a)){for(var s=o.split("."),c=n.context[s[0]],l=1;l<s.length;l++)c=c[s[l]];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 f=this.parentObjectPath&&this.parentObjectPath.isCollection,d=this.getByIdMethodName;if(f||!u.isNullOrEmptyString(d)){a=A.tryGetObjectIdFromLoadOrRetrieveResult(e);if(!u.isNullOrUndefined(a))return this.saveOriginalObjectPathInfo(),this.resetForUpdateUsingObjectData(),u.isNullOrEmptyString(d)?(this.m_objectPathInfo.ObjectPathType=5,this.m_objectPathInfo.Name=""):(this.m_objectPathInfo.ObjectPathType=3,this.m_objectPathInfo.Name=d),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=g;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 b(this)),this.m_serviceApiQueue.add(e,t,n,i)},e._parseQueryOption=function(t){var n={};if("string"==typeof t){var i=t;n.Select=A._parseSelectExpand(i)}else if(Array.isArray(t))n.Select=t;else if("object"==typeof t){var o=t;if(e.isLoadOption(o)){if("string"==typeof o.select)n.Select=A._parseSelectExpand(o.select);else if(Array.isArray(o.select))n.Select=o.select;else if(!A.isNullOrUndefined(o.select))throw r.RuntimeError._createInvalidArgError({argumentName:"option.select"});if("string"==typeof o.expand)n.Expand=A._parseSelectExpand(o.expand);else if(Array.isArray(o.expand))n.Expand=o.expand;else if(!A.isNullOrUndefined(o.expand))throw r.RuntimeError._createInvalidArgError({argumentName:"option.expand"});if("number"==typeof o.top)n.Top=o.top;else if(!A.isNullOrUndefined(o.top))throw r.RuntimeError._createInvalidArgError({argumentName:"option.top"});if("number"==typeof o.skip)n.Skip=o.skip;else if(!A.isNullOrUndefined(o.skip))throw r.RuntimeError._createInvalidArgError({argumentName:"option.skip"})}else n=e.parseStrictLoadOption(t)}else if(!A.isNullOrUndefined(t))throw r.RuntimeError._createInvalidArgError({argumentName:"option"});return n},e.isLoadOption=function(e){if(!A.isUndefined(e.select)&&("string"==typeof e.select||Array.isArray(e.select)))return!0;if(!A.isUndefined(e.expand)&&("string"==typeof e.expand||Array.isArray(e.expand)))return!0;if(!A.isUndefined(e.top)&&"number"==typeof e.top)return!0;if(!A.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,i,o){for(var a in o){var s=o[a];if("$all"===a){if("boolean"!=typeof s)throw r.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(i,a,".")});s&&t.Select.push(e.combineQueryPath(n,"*","/"))}else if("$top"===a){if("number"!=typeof s||n.length>0)throw r.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(i,a,".")});t.Top=s}else if("$skip"===a){if("number"!=typeof s||n.length>0)throw r.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(i,a,".")});t.Skip=s}else if("boolean"==typeof s)s&&t.Select.push(e.combineQueryPath(n,a,"/"));else{if("object"!=typeof s)throw r.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(i,a,".")});e.parseStrictLoadOptionHelper(t,e.combineQueryPath(n,a,"/"),e.combineQueryPath(i,a,"."),s)}}},e}();e.ClientRequestContextBase=m;var v=function(){function e(e){this.m_objectPath=e}return e.prototype._handleResult=function(e){u.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 h(t,1,4);n.referencedObjectPath=e,this.addReferencedObjectPath(e),this.addAction(n);var i=new v(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 r.RuntimeError({code:a.invalidObjectPath,httpStatusCode:400,message:u._getResourceString(s.invalidObjectPath,A.getObjectPathExpression(e)),debugInfo:{errorLocation:A.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),A.isSetSupported("RichApiRuntimeFlag","1.1")||(t&=-5,t&=-17),A.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 r in this.m_referencedObjectPaths)n=this.aggregrateRequestFlags(n,this.m_referencedObjectPaths[r].operationType,this.m_referencedObjectPaths[r].flags),i[r]=this.m_referencedObjectPaths[r].objectPathInfo;for(var o=[],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),o.push(c.actionInfo)}n=this.finallyNormalizeFlags(n);var l={AutoKeepReference:this.m_contextBase._autoCleanup&&a,Actions:o,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 r=n.argumentObjectPaths;if(r)for(var o=r.length,a=0;a<o;a++)t._updateLastUsedActionIdOfObjectPathId(e,r[a],i);n=n.parentObjectPath}},t._calculateLastUsedObjectPathIds=function(e){for(var n={},i=e.length,r=i-1;r>=0;--r){var o=(d=e[r]).actionInfo.Id;d.referencedObjectPath&&t._updateLastUsedActionIdOfObjectPathId(n,d.referencedObjectPath,o);var a=d.referencedArgumentObjectPaths;if(a)for(var s=a.length,c=0;c<s;c++)t._updateLastUsedActionIdOfObjectPathId(n,a[c],o)}var l={};for(var u in n){var f=l[o=n[u]];f||(f=[],l[o]=f),f.push(parseInt(u))}for(r=0;r<i;r++){var d,p=l[(d=e[r]).actionInfo.Id];p&&p.length>0?d.actionInfo.L=p:d.actionInfo.L&&delete d.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 r.RuntimeError({code:a.valueNotLoaded,httpStatusCode:400,message:u._getResourceString(s.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=A.adjustToDateTime(e):this.m_value=e)},e}();e.ClientResult=O;var b=function(){function e(e){this.m_context=e,this.m_actions=[]}return e.prototype.add=function(e,t,n,i){var r=this;this.m_actions.push({action:e,resultHandler:t,resolve:n,reject:i}),1===this.m_actions.length&&setTimeout((function(){return r.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 r=t[i];n.ensureInstantiateObjectPath(r.action.referencedObjectPath),n.ensureInstantiateObjectPaths(r.action.referencedArgumentObjectPaths),n.addAction(r.action),n.addReferencedObjectPath(r.action.referencedObjectPath),n.addReferencedObjectPaths(r.action.referencedArgumentObjectPaths)}var o=n.buildRequestMessageBodyAndRequestFlags(),a=o.body,s=o.flags,l={Url:c.localDocumentApiPrefix,Headers:null,Body:a};u.log("Request:"),u.log(JSON.stringify(a)),(new S).executeAsync(this.m_context._customData,s,l).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),r=null;n.Body.Results?r=n.Body.Results:n.Body.ProcessedResults&&n.Body.ProcessedResults.Results&&(r=n.Body.ProcessedResults.Results),r||(r=[]),this.processActionResults(e,t,r,i)},e.prototype.getErrorFromResponse=function(e){return u.isNullOrEmptyString(e.ErrorCode)?e.Body&&e.Body.Error?new r.RuntimeError({code:e.Body.Error.Code,httpStatusCode:e.Body.Error.HttpStatusCode,message:e.Body.Error.Message}):null:new r.RuntimeError({code:e.ErrorCode,httpStatusCode:e.HttpStatusCode,message:e.ErrorMessage})},e.prototype.processActionResults=function(e,t,n,i){e.processResponse(n);for(var r=0;r<t.length;r++){for(var o=t[r],a=o.action.actionInfo.Id,s=!1,c=0;c<n.length;c++)if(a==n[c].ActionId){var l=n[c].Value;o.resultHandler&&(o.resultHandler._handleResult(l),l=o.resultHandler.value),o.resolve&&o.resolve(l),s=!0;break}!s&&o.reject&&(i?o.reject(i):o.reject("No response for the action."))}},e}(),S=function(){function e(){}return e.prototype.getRequestUrl=function(e,n,i){void 0===i&&(i=t.graph.toString());var r=c.flags+"="+n.toString();switch(i){case t.graph.toString():"/"!=e.charAt(e.length-1)&&(e+="/"),e=(e+=c.processQuery)+"?"+r;break;case t.wfe.toString():e=(e=e+"&"+r)+"&wdRestPart=_api/"+c.processQuery}return e},e.prototype.executeAsync=function(n,r,o){var a=o.Headers?o.Headers[_.remoteEndpointTypeHeaderKey]:t.graph.toString(),s={method:"POST",url:this.getRequestUrl(o.Url,r,a),headers:{},body:o.Body};if(s.headers[c.sourceLibHeader]=e.SourceLibHeaderValue,s.headers["CONTENT-TYPE"]="application/json",o.Headers)for(var l in o.Headers)s.headers[l]=o.Headers[l];return(u._isLocalDocumentUrl(s.url)?i.sendLocalDocumentRequest:i.sendRequest)(s).then((function(e){var t;if(200===e.statusCode)t={HttpStatusCode:e.statusCode,ErrorCode:null,ErrorMessage:null,Headers:e.headers,Body:u._parseResponseBody(e)};else{u.log("Error Response:"+e.body);var n=u._parseErrorResponse(e);t={HttpStatusCode:e.statusCode,ErrorCode:n.errorCode,ErrorMessage:n.errorMessage,Headers:e.headers,Body:null,RawErrorResponseBody:u._parseErrorResponseBody(e)}}return t}))},e.SourceLibHeaderValue="officejs-rest",e}();e.HttpRequestExecutor=S;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.remoteEndpointTypeHeaderKey="X-EndpointType",t}(c);e.CommonConstants=_;var A=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 r.RuntimeError({code:a.invalidObjectPath,httpStatusCode:400,message:u._getResourceString(s.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 i=e[n];i;){if(!i.isValid)throw new r.RuntimeError({code:a.invalidObjectPath,httpStatusCode:400,message:u._getResourceString(s.invalidObjectPath,t.getObjectPathExpression(i))});i=i.parentObjectPath}},t._toCamelLowerCase=function(e){if(u.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(u.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 u._createInvalidArgError({argumentName:"date"})},t.tryGetObjectIdFromLoadOrRetrieveResult=function(e){var t=e[_.id];return u.isNullOrUndefined(t)&&(t=e[_.idLowerCase]),u.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(u.isNullOrUndefined(i))return null;var r=new Array,o=new Array,a=t.collectObjectPathInfos(e,i,r,o);return n.Arguments=i,a&&(n.ReferencedObjectPathIds=o),r},t.validateContext=function(e,t){if(e&&t&&t._context!==e)throw new r.RuntimeError({code:a.invalidRequestContext,httpStatusCode:400,message:u._getResourceString(s.invalidRequestContext)})},t.isSetSupported=function(e,n){return"function"==typeof t.isSetSupportedOverride?t.isSetSupportedOverride(e,n):!("undefined"!=typeof window&&window.Office&&window.Office.context&&window.Office.context.requirements)||window.Office.context.requirements.isSetSupported(e,n)},t.throwIfApiNotSupported=function(e,n,i,o){if(t._doApiNotSupportedCheck&&!t.isSetSupported(n,i)){var c=u._getResourceString(s.apiNotFoundDetails,[e,n+" "+i,o]);throw new r.RuntimeError({code:a.apiNotFound,httpStatusCode:404,message:c,debugInfo:{errorLocation:e}})}},t.calculateApiFlags=function(e,n,i){var r=window&&window.location&&window.location.href&&-1!==window.location.href.indexOf("eed0a086-3498-4f91-a377-1e0265ecc0cc");return("function"==typeof t.isSetSupportedOverride?t.isSetSupportedOverride(n,i):!r&&t.isSetSupported(n,i))||(e&=-3),e},t._parseSelectExpand=function(e){var t=[];if(!u.isNullOrEmptyString(e))for(var n=e.split(","),i=0;i<n.length;i++){var r=n[i];(r=o(r.trim())).length>0&&t.push(r)}return t;function o(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 r in e){var o=e[r];if(r===_.items){(n={})[_.itemsLowerCase]=this.changePropertyNameToCamelLowerCase(o);break}n[t._toCamelLowerCase(r)]=this.changePropertyNameToCamelLowerCase(o)}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 r=e[i];"object"==typeof r&&null!==r&&Array.isArray(r.items)&&(r=r.items),t[i]=this.purifyJson(r)}return t}return e},t.collectObjectPathInfos=function(e,n,i,r){for(var o=!1,a=0;a<n.length;a++)if(n[a]instanceof p){var s=n[a];t.validateContext(e,s),n[a]=s._objectPath.objectPathInfo.Id,r.push(s._objectPath.objectPathInfo.Id),i.push(s._objectPath),o=!0}else if(Array.isArray(n[a])){var c=new Array;t.collectObjectPathInfos(e,n[a],i,c)?(r.push(c),o=!0):r.push(0)}else u.isPlainJsonObject(n[a])?(r.push(0),t.replaceClientObjectPropertiesWithObjectPathIds(n[a],i)):r.push(0);return o},t.replaceClientObjectPropertiesWithObjectPathIds=function(e,n){var i,r;for(var o in e){var a=e[o];if(a instanceof p)n.push(a._objectPath),e[o]=((i={})[_.objectPathIdPrivate]=a._objectPath.objectPathInfo.Id,i);else if(Array.isArray(a))for(var s=0;s<a.length;s++)if(a[s]instanceof p){var c=a[s];n.push(c._objectPath),a[s]=((r={})[_.objectPathIdPrivate]=c._objectPath.objectPathInfo.Id,r)}else u.isPlainJsonObject(a[s])&&t.replaceClientObjectPropertiesWithObjectPathIds(a[s],n);else u.isPlainJsonObject(a)&&t.replaceClientObjectPropertiesWithObjectPathIds(a,n)}},t.normalizeName=function(e){return e.substr(0,1).toLowerCase()+e.substr(1)},t._doApiNotSupportedCheck=!1,t}(u);e.CommonUtility=A;var C=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.propertyDoesNotExist="PropertyDoesNotExist",t.attemptingToSetReadOnlyProperty="AttemptingToSetReadOnlyProperty",t}(s);e.CommonResourceStrings=C;var E=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}(a);e.ErrorCodes=E;var I=function(){function e(e){this.m_callback=e}return e.prototype._handleResult=function(e){this.m_callback&&this.m_callback()},e}(),w=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.createMethodAction=function(t,n,i,r,o,a){G.validateObjectPath(n);var s={Id:t._nextId(),ActionType:3,Name:i,ObjectPathId:n._objectPath.objectPathInfo.Id,ArgumentInfo:{}},c=G.setMethodArguments(t,s.ArgumentInfo,o);G.validateReferencedObjectPaths(c);var l=G._fixupApiFlags(a),u=new h(s,r,l);if(u.referencedObjectPath=n._objectPath,u.referencedArgumentObjectPaths=c,n._addAction(u),e._internalConfig.enablePreviewExecution&&0!=(16&l)){var f={Id:t._nextId(),ActionType:3,Name:i,Arguments:o,ObjectId:"",ObjectType:""};n._addPreviewExecutionAction(f)}return u},n.createRecursiveQueryAction=function(e,t,n){G.validateObjectPath(t);var i={Id:e._nextId(),ActionType:6,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,RecursiveQueryInfo:n},r=new h(i,1,4);return r.referencedObjectPath=t._objectPath,t._addAction(r),r},n.createEnsureUnchangedAction=function(e,t,n){G.validateObjectPath(t);var i={Id:e._nextId(),ActionType:8,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,ObjectState:n},r=new h(i,1,4);return r.referencedObjectPath=t._objectPath,t._addAction(r),r},n.createInstantiateAction=function(e,t){G.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 h(n,1,4);return i.referencedObjectPath=t._objectPath,t._addAction(i,new L(t),!0),i},n.createTraceAction=function(e,t,n){var i={Id:e._nextId(),ActionType:5,Name:"Trace",ObjectPathId:0},r=new h(i,1,4);return e._pendingRequest.addAction(r),n&&e._pendingRequest.addTrace(i.Id,t),r},n.createTraceMarkerForCallback=function(e,t){var i=n.createTraceAction(e,null,!1);e._pendingRequest.addActionResultHandler(i,new I(t))},n}(d);e.ActionFactory=w;var P=function(t){function n(n,i){var r=t.call(this,n,i)||this;return G.checkArgumentNull(n,"context"),r.m_context=n,r._objectPath&&(!n._processingResult&&n._pendingRequest&&(w.createInstantiateAction(n,r),n._autoCleanup&&r._KeepReference&&n.trackedObjects._autoAdd(r)),e._internalConfig.appendTypeNameToObjectPathInfo&&r._objectPath.objectPathInfo&&r._className&&(r._objectPath.objectPathInfo.T=r._className)),r}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(void 0!==this.m_isNull||!f.isMock())&&(G.throwIfNotLoaded("isNull",this._isNull,null,this._isNull),this._isNull)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isNullObject",{get:function(){return(void 0!==this.m_isNull||!f.isMock())&&(G.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),u._createPromiseFromResult(null)},n.prototype._addPreviewExecutionAction=function(e){if(!G.isUndefined(this._className)){e.ObjectType=this._className;var t=G._getPropertyValueWithoutCheckLoaded(this,k.idLowerCase);G.isUndefined(t)&&(t=G._getPropertyValueWithoutCheckLoaded(this,k.idPrivate)),G.isUndefined(t)&&(t=G._getPropertyValueWithoutCheckLoaded(this,k.previewExecutionObjectId)),e.ObjectId=t,this.context._pendingRequest.addPreviewExecutionAction(e)}},n.prototype._handleResult=function(e){this._isNull=G.isNullOrUndefined(e),this.context.trackedObjects._autoTrackIfNecessaryWhenHandleObjectResultValue(this,e)},n.prototype._handleIdResult=function(e){this._isNull=G.isNullOrUndefined(e),G.fixObjectPathIfNecessary(this,e),this.context.trackedObjects._autoTrackIfNecessaryWhenHandleObjectResultValue(this,e)},n.prototype._handleRetrieveResult=function(e,t){this._handleIdResult(e)},n.prototype._recursivelySet=function(e,t,i,o,c){var l=e instanceof n,f=e;if(l){if(Object.getPrototypeOf(this)!==Object.getPrototypeOf(e))throw r.RuntimeError._createInvalidArgError({argumentName:"properties",errorLocation:this._className+".set"});e=JSON.parse(JSON.stringify(e))}try{for(var d,p=0;p<i.length;p++)d=i[p],e.hasOwnProperty(d)&&void 0!==e[d]&&(this[d]=e[d]);for(p=0;p<o.length;p++)if(d=o[p],e.hasOwnProperty(d)&&void 0!==e[d]){var h=l?f[d]:e[d];this[d].set(h,t)}var g=!l;t&&!G.isNullOrUndefined(g)&&(g=t.throwOnReadOnly);for(p=0;p<c.length;p++)if(d=c[p],e.hasOwnProperty(d)&&void 0!==e[d]&&g)throw new r.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:u._getResourceString(V.cannotApplyPropertyThroughSetMethod,d),debugInfo:{errorLocation:d}});for(d in e)if(i.indexOf(d)<0&&o.indexOf(d)<0){var m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),d);if(!m)throw new r.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:u._getResourceString(C.propertyDoesNotExist,d),debugInfo:{errorLocation:d}});if(g&&!m.set)throw new r.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:u._getResourceString(C.attemptingToSetReadOnlyProperty,d),debugInfo:{errorLocation:d}})}}catch(e){throw new r.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:u._getResourceString(s.invalidArgument,"properties"),debugInfo:{errorLocation:this._className+".set"},innerError:e})}},n}(p);e.ClientObject=P;var x=function(){function e(e){this.m_session=e}return e.prototype.executeAsync=function(e,t,n){var i={url:c.processQuery,method:"POST",headers:n.Headers,body:n.Body},r="";n.Headers&&(r=n.Headers[k.officeControlId]);var a={id:o.nextId(),type:1,flags:t,controlId:r,message:i,customData:e};return u.log(JSON.stringify(a)),this.m_session.sendMessageToHost(a).then((function(e){u.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:u._parseResponseBody(n)};else{u.log("Error Response:"+n.body);var i=u._parseErrorResponse(n);t={HttpStatusCode:n.statusCode,ErrorCode:i.errorCode,ErrorMessage:i.errorMessage,Headers:n.headers,Body:null}}return t}))},e}(),T=function(e){function t(t){var n=e.call(this)||this;return n.m_bridge=t,n.m_bridge.addHostMessageHandler((function(e){if(3===e.type){var t=e.controlId;if(u.isNullOrEmptyString(t))U.getGenericEventRegistration(t)._handleRichApiMessage(e.message);else{var n=U.peekGenericEventRegistrationOrNull(t);n&&n._handleRichApiMessage(e.message),(n=U.peekGenericEventRegistrationOrNull(""))&&n._handleRichApiMessage(e.message)}}})),n}return __extends(t,e),t.getInstanceIfHostBridgeInited=function(){return o.instance?((u.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 u._createPromiseFromResult(null)},t.prototype._createRequestExecutorOrNull=function(){return u.log("NativeBridgeSession::CreateRequestExecutor"),new x(this)},t.prototype.getEventRegistration=function(e){return U.getGenericEventRegistration(e)},t.prototype.sendMessageToHost=function(e){return this.m_bridge.sendMessageToHostAndExpectResponse(e)},t}(n);e.HostBridgeSession=T;var R=function(t){function i(e){var o=t.call(this)||this;if(o.m_customRequestHeaders={},o.m_batchMode=0,o._onRunFinishedNotifiers=[],n._overrideSession)o.m_requestUrlAndHeaderInfoResolver=n._overrideSession;else if((G.isNullOrUndefined(e)||"string"==typeof e&&0===e.length)&&((e=i.defaultRequestUrlAndHeaders)||(e={url:c.localDocument,headers:{}})),"string"==typeof e)o.m_requestUrlAndHeaderInfo={url:e,headers:{}};else if(i.isRequestUrlAndHeaderInfoResolver(e))o.m_requestUrlAndHeaderInfoResolver=e;else{if(!i.isRequestUrlAndHeaderInfo(e))throw r.RuntimeError._createInvalidArgError({argumentName:"url"});var a=e;o.m_requestUrlAndHeaderInfo={url:a.url,headers:{}},u._copyHeaders(a.headers,o.m_requestUrlAndHeaderInfo.headers)}return!o.m_requestUrlAndHeaderInfoResolver&&o.m_requestUrlAndHeaderInfo&&u._isLocalDocumentUrl(o.m_requestUrlAndHeaderInfo.url)&&T.getInstanceIfHostBridgeInited()&&(o.m_requestUrlAndHeaderInfo=null,o.m_requestUrlAndHeaderInfoResolver=T.getInstanceIfHostBridgeInited()),o.m_requestUrlAndHeaderInfoResolver instanceof n&&(o.m_session=o.m_requestUrlAndHeaderInfoResolver),o._processingResult=!1,o._customData=k.iterativeExecutor,o.sync=o.sync.bind(o),o}return __extends(i,t),Object.defineProperty(i.prototype,"session",{get:function(){return this.m_session},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"eventRegistration",{get:function(){return this.m_session?this.m_session.getEventRegistration(this._controlId):r.officeJsEventRegistration},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_url",{get:function(){return this.m_requestUrlAndHeaderInfo?this.m_requestUrlAndHeaderInfo.url:null},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_pendingRequest",{get:function(){return null==this.m_pendingRequest&&(this.m_pendingRequest=new N(this)),this.m_pendingRequest},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_controlId",{get:function(){var e=this.m_customRequestHeaders[k.officeControlId];return u.isNullOrUndefined(e)&&(e=""),e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"debugInfo",{get:function(){return{pendingStatements:new J(this._rootObjectPropertyName,this._pendingRequest._objectPaths,this._pendingRequest._actions,e._internalConfig.showDisposeInfoInDebugInfo).process()}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"trackedObjects",{get:function(){return this.m_trackedObjects||(this.m_trackedObjects=new q(this)),this.m_trackedObjects},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"requestHeaders",{get:function(){return this.m_customRequestHeaders},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"batchMode",{get:function(){return this.m_batchMode},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"getAdditionalHeaders",{set:function(e){this.m_getAdditionalHeaders=e},enumerable:!0,configurable:!0}),i.prototype.ensureInProgressBatchIfBatchMode=function(){if(1===this.m_batchMode&&!this.m_explicitBatchInProgress)throw G.createRuntimeError(a.generalException,u._getResourceString(V.notInsideBatch),null)},i.prototype.load=function(e,t){G.validateContext(this,e);var n=i._parseQueryOption(t);d.createQueryAction(this,e,n,e)},i.prototype.loadRecursive=function(e,t,n){if(!G.isPlainJsonObject(t))throw r.RuntimeError._createInvalidArgError({argumentName:"options"});var o={};for(var a in t)o[a]=i._parseQueryOption(t[a]);var s=w.createRecursiveQueryAction(this,e,{Queries:o,MaxDepth:n});this._pendingRequest.addActionResultHandler(s,e)},i.prototype.trace=function(e){w.createTraceAction(this,e,!0)},i.prototype._processOfficeJsErrorResponse=function(e,t){},i.prototype.ensureRequestUrlAndHeaderInfo=function(){var e=this;return G._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:c.localDocument,headers:{}}),G.isNullOrEmptyString(e.m_requestUrlAndHeaderInfo.url)&&(e.m_requestUrlAndHeaderInfo.url=c.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)}}))}))},i.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)}))}))},i.prototype.syncPrivate=function(t){var n=this;if(f.isMock())return u._createPromiseFromResult(null);if(!t.hasActions)return this.processPendingEventHandlers(t);var i=t.buildRequestMessageBodyAndRequestFlags(),o=i.body,a=i.flags;this._requestFlagModifier&&(a|=this._requestFlagModifier),this._requestExecutor||(u._isLocalDocumentUrl(this.m_requestUrlAndHeaderInfo.url)?this._requestExecutor=new W(this):this._requestExecutor=new S);var s=this._requestExecutor,l={};u._copyHeaders(this.m_requestUrlAndHeaderInfo.headers,l),u._copyHeaders(this.m_customRequestHeaders,l),delete this.m_customRequestHeaders[k.officeScriptEventId],this.m_getAdditionalHeaders&&u._copyHeaders(this.m_getAdditionalHeaders(),l);var d=f._getCurrentTestNameWithSequenceId();d&&(l[c.testRequestNameHeader]=d);var p={Url:this.m_requestUrlAndHeaderInfo.url,Headers:l,Body:o};t.invalidatePendingInvalidObjectPaths();var h=null,g=null;return this._lastSyncStart="undefined"==typeof performance?Date.now():performance.now(),this._lastRequestFlags=a,s.executeAsync(this._customData,a,p).then((function(i){return n._lastSyncEnd="undefined"==typeof performance?Date.now():performance.now(),e.config.executePerfLogFunc&&e.config.executePerfLogFunc({syncStart:n._lastSyncStart,syncEnd:n._lastSyncEnd}),h=n.processRequestExecutorResponseMessage(t,i),n.processPendingEventHandlers(t).catch((function(e){u.log("Error in processPendingEventHandlers"),u.log(JSON.stringify(e)),g=e}))})).then((function(){if(h)throw u.log("Throw error from response: "+JSON.stringify(h)),h;if(g){u.log("Throw error from ProcessEventHandler: "+JSON.stringify(g));var e=null;if(g instanceof r.RuntimeError)(e=g).traceMessages=t._responseTraceMessages;else{var n=null;n="string"==typeof g?g:g.message,G.isNullOrEmptyString(n)&&(n=u._getResourceString(V.cannotRegisterEvent)),e=new r.RuntimeError({code:E.cannotRegisterEvent,httpStatusCode:400,message:n,traceMessages:t._responseTraceMessages})}throw e}}))},i.prototype.processRequestExecutorResponseMessage=function(t,n){n.Body&&n.Body.TraceIds&&t._setResponseTraceIds(n.Body.TraceIds);var i=t._responseTraceMessages,o=null;if(n.Body){if(n.Body.Error&&n.Body.Error.ActionIndex>=0){var a=new J(this._rootObjectPropertyName,t._objectPaths,t._actions,!1,!0),s=a.processForDebugStatementInfo(n.Body.Error.ActionIndex);o={statement:s.statement,surroundingStatements:s.surroundingStatements,fullStatements:["Please enable config.extendedErrorLogging to see full statements."]},e.config.extendedErrorLogging&&(a=new J(this._rootObjectPropertyName,t._objectPaths,t._actions,!1,!1),o.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(!G.isNullOrEmptyString(n.ErrorCode))return new r.RuntimeError({code:n.ErrorCode,httpStatusCode:n.HttpStatusCode,message:n.ErrorMessage,traceMessages:i,data:{responseBody:n.RawErrorResponseBody}});if(n.Body&&n.Body.Error){var l={errorLocation:n.Body.Error.Location};return o&&(l.statement=o.statement,l.surroundingStatements=o.surroundingStatements,l.fullStatements=o.fullStatements),new r.RuntimeError({code:n.Body.Error.Code,httpStatusCode:n.Body.Error.HttpStatusCode,message:n.Body.Error.Message,traceMessages:i,debugInfo:l})}return null},i.prototype.processPendingEventHandlers=function(e){for(var t=G._createPromiseFromResult(null),n=0;n<e._pendingProcessEventHandlers.length;n++){var i=e._pendingProcessEventHandlers[n];t=t.then(this.createProcessOneEventHandlersFunc(i,e))}return t},i.prototype.createProcessOneEventHandlersFunc=function(e,t){return function(){return e._processRegistration(t)}},i.prototype.processPreSyncPromises=function(e){for(var t=G._createPromiseFromResult(null),n=0;n<e._preSyncPromises.length;n++){var i=e._preSyncPromises[n];t=t.then(this.createProcessOneProSyncFunc(i))}return t},i.prototype.createProcessOneProSyncFunc=function(e){return function(){return e}},i.prototype.sync=function(e){return f.isMock()?u._createPromiseFromResult(e):this.syncPrivateMain().then((function(){return e}))},i.prototype.batch=function(e){var t=this;if(1!==this.m_batchMode)return u._createPromiseFromException(G.createRuntimeError(a.generalException,null,null));if(this.m_explicitBatchInProgress)return u._createPromiseFromException(G.createRuntimeError(a.generalException,u._getResourceString(V.pendingBatchInProgress),null));if(G.isNullOrUndefined(e))return G._createPromiseFromResult(null);this.m_explicitBatchInProgress=!0;var n,i,r,o=this.m_pendingRequest;this.m_pendingRequest=new N(this);try{n=e(this._rootObject,this)}catch(e){return this.m_explicitBatchInProgress=!1,this.m_pendingRequest=o,u._createPromiseFromException(e)}return"object"==typeof n&&n&&"function"==typeof n.then?r=G._createPromiseFromResult(null).then((function(){return n})).then((function(e){return t.m_explicitBatchInProgress=!1,i=t.m_pendingRequest,t.m_pendingRequest=o,e})).catch((function(e){return t.m_explicitBatchInProgress=!1,i=t.m_pendingRequest,t.m_pendingRequest=o,u._createPromiseFromException(e)})):(this.m_explicitBatchInProgress=!1,i=this.m_pendingRequest,this.m_pendingRequest=o,r=G._createPromiseFromResult(n)),r.then((function(e){return t.ensureRequestUrlAndHeaderInfo().then((function(){return t.syncPrivate(i)})).then((function(){return e}))}))},i._run=function(e,t,n,r,o,a){return void 0===n&&(n=3),void 0===r&&(r=5e3),i._runCommon("run",null,e,0,t,n,r,null,null,o,a)},i.isValidRequestInfo=function(e){return"string"==typeof e||i.isRequestUrlAndHeaderInfo(e)||i.isRequestUrlAndHeaderInfoResolver(e)},i.isRequestUrlAndHeaderInfo=function(e){return"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.getPrototypeOf({})&&!G.isNullOrUndefined(e.url)},i.isRequestUrlAndHeaderInfoResolver=function(e){return"object"==typeof e&&null!==e&&"function"==typeof e._resolveRequestUrlAndHeaderInfo},i._runBatch=function(e,t,n,r,o,a,s,c,l){return void 0===a&&(a=3),void 0===s&&(s=5e3),i._runBatchCommon(0,e,t,n,a,s,r,o,c,l)},i._runExplicitBatch=function(e,t,n,r,o,a,s,c,l){return void 0===a&&(a=3),void 0===s&&(s=5e3),i._runBatchCommon(1,e,t,n,a,s,r,o,c,l)},i._runBatchCommon=function(e,t,n,r,o,a,s,c,l,u){var f,d;void 0===o&&(o=3),void 0===a&&(a=5e3);var p=null,h=null,g=null,m=0,v=null;if(n.length>0)if(i.isValidRequestInfo(n[0]))p=n[0],m=1;else if(G.isPlainJsonObject(n[0])){if(null!=(p=(v=n[0]).session)&&!i.isValidRequestInfo(p))return i.createErrorPromise(t);h=v.getAdditionalHeaders,g=v.previousObjects,m=1}if(n.length==m+1)d=n[m+0];else{if(null!=v||n.length!=m+2)return i.createErrorPromise(t);g=n[m+0],d=n[m+1]}if(null!=g)if(g instanceof P)f=function(){return g.context};else if(g instanceof i)f=function(){return g};else{if(!Array.isArray(g))return i.createErrorPromise(t);var y=g;if(0==y.length)return i.createErrorPromise(t);for(var O=0;O<y.length;O++){if(!(y[O]instanceof P))return i.createErrorPromise(t);if(y[O].context!=y[0].context)return i.createErrorPromise(t,V.invalidRequestContext)}f=function(){return y[0].context}}else f=r;var b=null;s&&(b=function(e){return s(v||{},e)});var S=null;return c&&(S=function(e){return c(v||{},e)}),i._runCommon(t,p,f,e,d,o,a,b,S,l,u,h)},i.createErrorPromise=function(e,t){return void 0===t&&(t=s.invalidArgument),u._createPromiseFromException(G.createRuntimeError(t,u._getResourceString(t),e))},i._runCommon=function(t,r,o,a,s,c,l,f,d,p,h,g){n._overrideSession&&(r=n._overrideSession);var m,v,y,O=u.createPromise((function(e,t){e()})),b=!1;return O.then((function(){if((m=o(r)).getAdditionalHeaders=g,m._autoCleanup)return new e.Promise((function(e,t){m._onRunFinishedNotifiers.push((function(){m._autoCleanup=!0,e()}))}));m._autoCleanup=!0})).then((function(){return"function"!=typeof s?i.createErrorPromise(t):(y=m.m_batchMode,m.m_batchMode=a,f&&f(m),e=s(1==a?m.batch.bind(m):m),(G.isNullOrUndefined(e)||"function"!=typeof e.then)&&G.throwError(V.runMustReturnPromise),e);var e})).then((function(e){return 1===a?e:m.sync(e)})).then((function(e){b=!0,v=e})).catch((function(e){v=e})).then((function(){var e=m.trackedObjects._retrieveAndClearAutoCleanupList();for(var t in m._autoCleanup=!1,m.m_batchMode=y,e)e[t]._objectPath.isValid=!1;var n=0;if(G._synchronousCleanup||i.isRequestUrlAndHeaderInfoResolver(r))return o();function o(){n++;var t=m.m_pendingRequest,i=m.m_batchMode,r=new N(m);m.m_pendingRequest=r,m.m_batchMode=0;try{for(var a in e)m.trackedObjects.remove(e[a]);d&&d(m)}finally{m.m_batchMode=i,m.m_pendingRequest=t}return m.syncPrivate(r).then((function(){p&&p(n)})).catch((function(){h&&h(n),n<c&&setTimeout((function(){o()}),l)}))}o()})).then((function(){m._onRunFinishedNotifiers&&m._onRunFinishedNotifiers.length>0&&m._onRunFinishedNotifiers.shift()();if(b)return v;throw v}))},i}(m);e.ClientRequestContext=R;var F=function(){function e(e,t){this.m_proxy=e,this.m_shouldPolyfill=t;var n=e[k.scalarPropertyNames],i=e[k.navigationPropertyNames],r=e[k.className],o=e[k.isCollection];if(n)for(var a=0;a<n.length;a++)G.definePropertyThrowUnloadedException(this,r,n[a]);if(i)for(a=0;a<i.length;a++)G.definePropertyThrowUnloadedException(this,r,i[a]);o&&G.definePropertyThrowUnloadedException(this,r,k.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 r.RuntimeError({code:E.valueNotLoaded,httpStatusCode:400,message:u._getResourceString(V.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:(G.isUndefined(this.m_json)&&(this.m_json=G.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=G.changePropertyNameToCamelLowerCase(e)),this.m_value=e,this.m_proxy._handleRetrieveResult(e,this)},e}(),k=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.officeControlId="X-OfficeControlId",t}(_);e.Constants=k;var N=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];u.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=N;var M=function(){function e(e,t,n,i){var r=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){r.m_eventInfo.eventArgsTransformFunc(e).then((function(e){return r.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=w.createTraceAction(this.m_context,null,!1);return this.m_context._pendingRequest._addPendingEventHandlerAction(this,{id:t.actionInfo.Id,handler:e,operation:0}),new D(this.m_context,this,e)},e.prototype.remove=function(e){var t=w.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=w.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=u._createPromiseFromResult(null),i=e._getPendingEventHandlerActions(this);if(!i)return n;for(var r=[],o=0;o<this.m_handlers.length;o++)r.push(this.m_handlers[o]);var a=!1;for(o=0;o<i.length;o++)if(e._responseTraceIds[i[o].id])switch(a=!0,i[o].operation){case 0:r.push(i[o].handler);break;case 1:for(var s=r.length-1;s>=0;s--)if(r[s]===i[o].handler){r.splice(s,1);break}break;case 2:r=[]}return a&&(!this.m_registered&&r.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==r.length&&(n=n.then((function(){return t.m_eventInfo.unregisterFunc(t.m_callback)})).catch((function(e){u.log("Error when unregister event: "+JSON.stringify(e))})).then((function(){return t.m_registered=!1}))),n=n.then((function(){return t.m_handlers=r}))),n},e.prototype.fireEvent=function(e){for(var t=[],n=0;n<this.m_handlers.length;n++){var i=this.m_handlers[n],r=u._createPromiseFromResult(null).then(this.createFireOneEventHandlerFunc(i,e)).catch((function(e){u.log("Error when invoke handler: "+JSON.stringify(e))}));t.push(r)}u.Promise.all(t)},e.prototype.createFireOneEventHandlerFunc=function(e,t){return function(){return e(t)}},e}();e.EventHandlers=M;var D=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=D,function(e){var t=function(){function t(){}return t.prototype.register=function(t,n,i){switch(t){case 4:return G.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return G.promisify((function(t){return e.addHandlerAsync(Office.EventType.BindingDataChanged,i,t)}))}));case 3:return G.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return G.promisify((function(t){return e.addHandlerAsync(Office.EventType.BindingSelectionChanged,i,t)}))}));case 2:return G.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged,i,e)}));case 1:return G.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 G.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ObjectDeleted,i,{id:n},e)}));case 14:return G.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ObjectSelectionChanged,i,{id:n},e)}));case 15:return G.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ObjectDataChanged,i,{id:n},e)}));case 16:return G.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 G.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return G.promisify((function(t){return e.removeHandlerAsync(Office.EventType.BindingDataChanged,{handler:i},t)}))}));case 3:return G.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return G.promisify((function(t){return e.removeHandlerAsync(Office.EventType.BindingSelectionChanged,{handler:i},t)}))}));case 2:return G.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.DocumentSelectionChanged,{handler:i},e)}));case 1:return G.promisify((function(e){return Office.context.document.settings.removeHandlerAsync(Office.EventType.SettingsChanged,{handler:i},e)}));case 5:return G.promisify((function(e){return OSF.DDA.RichApi.richApiMessageManager.removeHandlerAsync("richApiMessage",{handler:i},e)}));case 13:return G.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectDeleted,{id:n,handler:i},e)}));case 14:return G.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectSelectionChanged,{id:n,handler:i},e)}));case 15:return G.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectDataChanged,{id:n,handler:i},e)}));case 16:return G.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}(r=e._Internal||(e._Internal={}));var j=function(){function e(e,t){this.m_handlersByEventByTarget={},this.m_registerEventImpl=e,this.m_unregisterEventImpl=t}return e.getTargetIdOrDefault=function(e){return G.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 r=i[n];return r||(r=[],i[n]=r),r},e.prototype.callHandlers=function(e,t,n){for(var i=this.getHandlers(e,t),r=0;r<i.length;r++)i[r](n)},e.prototype.hasHandlers=function(e,t){return this.getHandlers(e,t).length>0},e.prototype.register=function(e,t,n){if(!n)throw r.RuntimeError._createInvalidArgError({argumentName:"handler"});var i=this.getHandlers(e,t);return i.push(n),1===i.length?this.m_registerEventImpl(e,t):G._createPromiseFromResult(null)},e.prototype.unregister=function(e,t,n){if(!n)throw r.RuntimeError._createInvalidArgError({argumentName:"handler"});for(var i=this.getHandlers(e,t),o=i.length-1;o>=0;o--)if(i[o]===n){i.splice(o,1);break}return 0===i.length?this.m_unregisterEventImpl(e,t):G._createPromiseFromResult(null)},e}();e.EventRegistration=j;var U=function(){function e(){this.m_eventRegistration=new j(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=G._createPromiseFromResult(null).then((function(){t.m_isReady=!0})):this.m_ready=r.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 G._createPromiseFromResult(null)},e.prototype._unregisterEventImpl=function(e,t){return G._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==k.eventMessageCategory){u._logEnabled&&u.log(JSON.stringify(n));var i=n.messageType,r=n.targetId;if(this.m_eventRegistration.hasHandlers(i,r)){var o=JSON.parse(n.message);n.isRemoteOverride&&(o.source=k.eventSourceRemote),this.m_eventRegistration.callHandlers(i,r,o)}}}},e.getGenericEventRegistration=function(t){u.isNullOrUndefined(t)&&(t="");var n=e.s_genericEventRegistrations[t];return n||(n=new e,e.s_genericEventRegistrations[t]=n),n},e.peekGenericEventRegistrationOrNull=function(t){return u.isNullOrUndefined(t)&&(t=""),e.s_genericEventRegistrations[t]},e.richApiMessageEventCategory=65536,e.s_genericEventRegistrations={},e}();e.GenericEventRegistration=U,e._testSetRichApiMessageReadyImpl=function(e){U._testReadyImpl=e},e._testTriggerRichApiMessageEvent=function(e){U.getGenericEventRegistration("")._handleRichApiMessage(e)};var H=function(e){function t(t,n,i,r){var o=e.call(this,t,n,i,r)||this;return o.m_genericEventInfo=r,o}return __extends(t,e),t.prototype.add=function(e){var t=this;0==this._handlers.length&&this.m_genericEventInfo.registerFunc&&this.m_genericEventInfo.registerFunc();var n=this._context._controlId;return U.getGenericEventRegistration(n).isReady||this._context._pendingRequest._addPreSyncPromise(U.getGenericEventRegistration(n).ready()),w.createTraceMarkerForCallback(this._context,(function(){t._handlers.push(e),1==t._handlers.length&&U.getGenericEventRegistration(n).register(t.m_genericEventInfo.eventType,t.m_genericEventInfo.getTargetIdFunc(),t._callback)})),new D(this._context,this,e)},t.prototype.remove=function(e){var t=this;1==this._handlers.length&&this.m_genericEventInfo.unregisterFunc&&this.m_genericEventInfo.unregisterFunc();var n=this._context._controlId;w.createTraceMarkerForCallback(this._context,(function(){for(var i=t._handlers,r=i.length-1;r>=0;r--)if(i[r]===e){i.splice(r,1);break}0==i.length&&U.getGenericEventRegistration(n).unregister(t.m_genericEventInfo.eventType,t.m_genericEventInfo.getTargetIdFunc(),t._callback)}))},t.prototype.removeAll=function(){},t}(M);e.GenericEventHandlers=H;var L=function(){function e(e){this.m_clientObject=e}return e.prototype._handleResult=function(e){this.m_clientObject._handleIdResult(e)},e}(),B=function(){function e(){}return e.createGlobalObjectObjectPath=function(e){var t={Id:e._nextId(),ObjectPathType:1,Name:""};return new g(t,null,!1,!1,1,4)},e.createNewObjectObjectPath=function(e,t,n,i){var r={Id:e._nextId(),ObjectPathType:2,Name:t};return new g(r,null,n,!1,1,G._fixupApiFlags(i))},e.createPropertyObjectPath=function(e,t,n,i,r,o){var a={Id:e._nextId(),ObjectPathType:4,Name:n,ParentObjectPathId:t._objectPath.objectPathInfo.Id};return new g(a,t._objectPath,i,r,1,G._fixupApiFlags(o))},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 g(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 g(i,t,!1,!1,1,4)},e.createMethodObjectPath=function(e,t,n,i,r,o,a,s,c){var l={Id:e._nextId(),ObjectPathType:3,Name:n,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}},u=G.setMethodArguments(e,l.ArgumentInfo,r),f=new g(l,t._objectPath,o,a,i,G._fixupApiFlags(c));return f.argumentObjectPaths=u,f.getByIdMethodName=s,f},e.createReferenceIdObjectPath=function(e,t){var n={Id:e._nextId(),ObjectPathType:6,Name:t,ArgumentInfo:{}};return new g(n,null,!1,!1,1,4)},e.createChildItemObjectPathUsingIndexerOrGetItemAt=function(t,n,i,r,o){var a=G.tryGetObjectIdFromLoadOrRetrieveResult(r);return t&&!G.isNullOrUndefined(a)?e.createChildItemObjectPathUsingIndexer(n,i,r):e.createChildItemObjectPathUsingGetItemAt(n,i,r,o)},e.createChildItemObjectPathUsingIndexer=function(e,t,n){var i=G.tryGetObjectIdFromLoadOrRetrieveResult(n),r=r={Id:e._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return r.ArgumentInfo.Arguments=[i],new g(r,t._objectPath,!1,!1,1,4)},e.createChildItemObjectPathUsingGetItemAt=function(e,t,n,i){var r=n[k.index];r&&(i=r);var o={Id:e._nextId(),ObjectPathType:3,Name:k.getItemAt,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return o.ArgumentInfo.Arguments=[i],new g(o,t._objectPath,!1,!1,1,4)},e}();e.ObjectPathFactory=B;var W=function(){function t(e){this.m_context=e}return t.prototype.executeAsync=function(n,i,r){var o=this,a=l.buildMessageArrayForIRequestExecutor(n,i,r,t.SourceLibHeaderValue);return new e.Promise((function(e,t){OSF.DDA.RichApi.executeRichApiRequestAsync(a,(function(t){var n;u.log("Response:"),u.log(JSON.stringify(t)),"succeeded"==t.status?n=l.buildResponseOnSuccess(l.getResponseBody(t),l.getResponseHeaders(t)):(n=l.buildResponseOnError(t.error.code,t.error.message),o.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[k.isTracked]&&e!==this.m_context._rootObject&&t&&!G.isNullOrEmptyString(t[k.referenceId])&&(this._autoCleanupList[e._objectPath.objectPathInfo.Id]=e,e[k.isTracked]=!0)},e.prototype._addCommon=function(e,t){if(e[k.isTracked])t&&this.m_context._autoCleanup&&delete this._autoCleanupList[e._objectPath.objectPathInfo.Id];else{var n=e[k.referenceId];if(e._objectPath.objectPathInfo[k.objectPathInfoDoNotKeepReferenceFieldName])throw G.createRuntimeError(a.generalException,u._getResourceString(V.objectIsUntracked),null);G.isNullOrEmptyString(n)&&e._KeepReference&&(e._KeepReference(),w.createInstantiateAction(this.m_context,e),t&&this.m_context._autoCleanup&&delete this._autoCleanupList[e._objectPath.objectPathInfo.Id],e[k.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[k.objectPathInfoDoNotKeepReferenceFieldName]=!0,e.context._pendingRequest._removeKeepReferenceAction(e._objectPath.objectPathInfo.Id);var t=e[k.referenceId];if(!G.isNullOrEmptyString(t)){var n=this.m_context._rootObject;n._RemoveReference&&n._RemoveReference(t)}delete e[k.isTracked]},e.prototype._retrieveAndClearAutoCleanupList=function(){var e=this._autoCleanupList;return this._autoCleanupList={},e},e}();e.TrackedObjects=q;var J=function(){function t(e,t,n,i,r){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=r}return t.prototype.process=function(){this.m_showDispose&&N._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&&N._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 r=t+1+5;r>this.m_statements.length&&(r=this.m_statements.length);var o=[];0!=i&&o.push("...");for(var a=i;a<t;a++)o.push(this.m_statements[a]);o.push("// >>>>>"),o.push(this.m_statements[t]),o.push("// <<<<<");for(var s=t+1;s<r;s++)o.push(this.m_statements[s]);return r<this.m_statements.length&&o.push("..."),{statement:this.m_statements[t],surroundingStatements:o}},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]){r="// Instantiate {"+i+"}";r=this.appendDisposeCommentIfRelevant(r,e),this.m_statements.push(r)}else{var r="var "+i+" = "+this.buildObjectPathExpressionWithParent(n)+";";r=this.appendDisposeCommentIfRelevant(r,e),this.m_statements.push(r),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)+"."+G._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)+"."+G._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,void 0===t.top&&void 0===t.skip&&void 0===t.expand?void 0===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 G._toCamelLowerCase(e.Name)+"("+this.buildArgumentsExpression(e.ArgumentInfo)+")";case 2:return e.Name+".newObject()";case 7:return"null";case 4:return G._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 void 0===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=G._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=G._toCamelLowerCase(i);break;case 5:var r=this.getObjVarNameBase(n.objectPathInfo.ParentObjectPathId);t="s"===r.charAt(r.length-1)?r.substr(0,r.length-1):r+"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}(),V=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}(C);e.ResourceStrings=V,u.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 G=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 r=e._internalConfig.alwaysPolyfillClientObjectRetrieveMethod;r||(r=!n.isSetSupported("RichApiRuntime","1.1"));var o=new F(t,r);return t._retrieve(i,o),o},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,r){var o={};for(var a in t){void 0!==(s=t[a])&&(o[a]=s)}for(var a in i){var s;void 0!==(s=i[a])&&(s[n.fieldName_isCollection]&&void 0!==s[n.fieldName_m__items]?o[a]=s.toJSON().items:o[a]=s.toJSON())}return r&&(o.items=r.map((function(e){return e.toJSON()}))),o},n.throwError=function(e,t,n){throw new r.RuntimeError({code:e,httpStatusCode:400,message:u._getResourceString(e,t),debugInfo:n?{errorLocation:n}:void 0})},n.createRuntimeError=function(e,t,n,i,o){return new r.RuntimeError({code:e,httpStatusCode:i,message:t,debugInfo:{errorLocation:n},data:o})},n.throwIfNotLoaded=function(e,t,i,r){if(!r&&u.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 r.RuntimeError({code:E.propertyNotLoaded,httpStatusCode:400,message:u._getResourceString(V.propertyNotLoaded,t),debugInfo:e?{errorLocation:e+"."+t}:void 0})},n.createCannotUpdateReadOnlyPropertyException=function(e,t){return new r.RuntimeError({code:E.cannotUpdateReadOnlyProperty,httpStatusCode:400,message:u._getResourceString(V.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)u.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,r){if(!u.isNullOrUndefined(t))if(r){var o=t[k.itemsLowerCase];if(Array.isArray(o)){for(var a=[],s=0;s<o.length;s++){var c=r(o[s],s),l={};l[k.proxy]=c,c._handleRetrieveResult(o[s],l),a.push(l)}n.defineReadOnlyPropertyWithValue(i,k.itemsLowerCase,a)}}else{var f=e[k.scalarPropertyNames],d=e[k.navigationPropertyNames],p=e[k.className];if(f)for(s=0;s<f.length;s++){var h=t[g=f[s]];u.isUndefined(h)?n.definePropertyThrowUnloadedException(i,p,g):n.defineReadOnlyPropertyWithValue(i,g,h)}if(d)for(s=0;s<d.length;s++){var g;h=t[g=d[s]];if(u.isUndefined(h))n.definePropertyThrowUnloadedException(i,p,g);else{var m=e[g],v={};m._handleRetrieveResult(h,v),v[k.proxy]=m,Array.isArray(v[k.itemsLowerCase])&&(v=v[k.itemsLowerCase]),n.defineReadOnlyPropertyWithValue(i,g,v)}}}},n.setMockData=function(e,t,i,r){if(u.isNullOrUndefined(t))e._handleResult(t);else{if(e[k.scalarPropertyOriginalNames]){for(var o={},a=e[k.scalarPropertyOriginalNames],s=e[k.scalarPropertyNames],c=0;c<s.length;c++)void 0!==t[s[c]]&&(o[a[c]]=t[s[c]]);e._handleResult(o)}if(e[k.navigationPropertyNames]){var l=e[k.navigationPropertyNames];for(c=0;c<l.length;c++)if(void 0!==t[l[c]]){var f=e[l[c]];f.setMockData&&f.setMockData(t[l[c]])}}if(e[k.isCollection]&&i){var d=Array.isArray(t)?t:t[k.itemsLowerCase];if(Array.isArray(d)){var p=[];for(c=0;c<d.length;c++){var h=i(d,c);n.setMockData(h,d[c]),p.push(h)}r(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 R;new e(t,B.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}(A);e.Utility=G;var z=function(){function e(){}return e.invokeMethod=function(e,t,n,i,r,o){var a=w.createMethodAction(e.context,e,t,n,i,r),s=new O(o);return G._addActionResultHandler(e,a,s),s},e.invokeEnsureUnchanged=function(e,t){w.createEnsureUnchangedAction(e.context,e,t)},e.invokeSetProperty=function(e,t,n,i){w.createSetPropertyAction(e.context,e,t,n,i)},e.createRootServiceObject=function(e,t){return new e(t,B.createGlobalObjectObjectPath(t))},e.createObjectFromReferenceId=function(e,t,n){return new e(t,B.createReferenceIdObjectPath(t,n))},e.createTopLevelServiceObject=function(e,t,n,i,r){return new e(t,B.createNewObjectObjectPath(t,n,i,r))},e.createPropertyObject=function(e,t,n,i,r){var o=B.createPropertyObjectPath(t.context,t,n,i,!1,r);return new e(t.context,o)},e.createIndexerObject=function(e,t,n){var i=B.createIndexerObjectPath(t.context,t,n);return new e(t.context,i)},e.createMethodObject=function(e,t,n,i,r,o,a,s,c){var l=B.createMethodObjectPath(t.context,t,n,i,r,o,a,s,c);return new e(t.context,l)},e.createChildItemObject=function(e,t,n,i,r){var o=B.createChildItemObjectPathUsingIndexerOrGetItemAt(t,n.context,n,i,r);return new e(n.context,o)},e}();e.BatchApiHelper=z;var Q=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 r=n.apiSets[i];Array.isArray(r)&&(n.apiSets[i]={version:r[0],name:r[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++){r=n.clientObjectTypes[i];Array.isArray(r)&&(this.ensureArraySize(r,11),n.clientObjectTypes[i]={name:this.getString(r[0]),behaviorFlags:r[1],collectionPropertyPath:this.getString(r[6]),newObjectServerTypeFullName:this.getString(r[9]),newObjectApiFlags:r[10],childItemTypeFullName:this.getString(r[7]),scalarProperties:r[2],navigationProperties:r[3],scalarMethods:r[4],navigationMethods:r[5],events:r[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 r=this,o=function(t,i){P.apply(this,arguments),r.m_targetNamespaceObject[n.name]._typeInited||(r.buildPrototype(r.m_targetNamespaceObject[n.name],n),r.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]=o,this.extendsType(o,P),this.buildNewObject(o,n),0!=(2&n.behaviorFlags)&&(o.prototype._KeepReference=function(){z.invokeMethod(this,"_KeepReference",1,[],0,0)}),0!=(32&n.behaviorFlags))&&this.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_StaticCustomize").call(null,o);i&&(this.buildPrototype(o,n),o._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 r=t,o=i;o<n.length;o++){if("object"!=typeof r)throw new e.Error("Cannot find "+n.join("."));r=r[n[o]]}return r},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(G.isNullOrUndefined(t))return null;var i=t.split(".");if(3===i.length&&"OfficeExtension"===i[0]&&"Constants"===i[1])return k[i[2]];if("this"===i[0]){for(var r=n,o=1;o<i.length;o++)r="toString()"==i[o]?r.toString():"()"===i[o].substr(i[o].length-2)?r[i[o].substr(0,i[o].length-2)]():r[i[o]];return r}throw new e.Error("Cannot evaluate: "+t)},t.prototype.evaluateEventTargetId=function(e,t){return G.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(G.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&&G.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=A.calculateApiFlags(e,n.name,n.version))}return e},t.prototype.buildScalarProperty=function(e,n,i){this.ensureOriginalName(i);var r=this,o=this.getFieldName(i),a={get:function(){return G.throwIfNotLoaded(i.name,this[o],n.name,this._isNull),r.throwIfApiNotSupported(n,i),this[o]},enumerable:!0,configurable:!0};0==(2&i.behaviorFlags)&&(a.set=function(e){if(4&i.behaviorFlags&&r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+i.originalName+"_Set").call(this,this,e).handled)return;this[o]=e;var a=r.calculateApiFlags(i.setMethodApiFlags,i.undoableApiSetInfoOrdinal);z.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 r=this,o=this.getFieldName(i),a={get:function(){(this[r.getFieldName(i)]||(r.throwIfApiNotSupported(n,i),this[o]=z.createPropertyObject(r.getFunction(i.propertyTypeFullName),this,i.originalName,0!=(16&i.behaviorFlags),i.getMethodApiFlags)),64&i.behaviorFlags)&&r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+i.originalName+"_Get").call(this,this,this[o]);return this[o]},enumerable:!0,configurable:!0};0==(2&i.behaviorFlags)&&(a.set=function(e){if(4&i.behaviorFlags&&r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+i.originalName+"_Set").call(this,this,e).handled)return;this[o]=e;var a=r.calculateApiFlags(i.setMethodApiFlags,i.undoableApiSetInfoOrdinal);z.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 r=this;e.prototype[i.name]=function(){var e=[];if(64&i.behaviorFlags&&i.parameterCount>0){for(var o=0;o<i.parameterCount-1;o++)e.push(arguments[o]);var a=[];for(o=i.parameterCount-1;o<arguments.length;o++)a.push(arguments[o]);e.push(a)}else for(o=0;o<arguments.length;o++)e.push(arguments[o]);if(1&i.behaviorFlags){var s=r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+i.originalName),c=[this];for(o=0;o<e.length;o++)c.push(e[o]);var l=s.apply(this,c),u=l.handled,f=l.result;if(u)return f}r.throwIfApiNotSupported(n,i);var d=0;32&i.behaviorFlags&&(d=1);var p=0;2&i.behaviorFlags&&(p=1);var h=r.calculateApiFlags(i.apiFlags,i.undoableApiSetInfoOrdinal);return z.invokeMethod(this,i.originalName,p,e,h,d)}},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 r=this;e.prototype[i.name]=function(){var e=[];if(64&i.behaviorFlags&&i.parameterCount>0){for(var o=0;o<i.parameterCount-1;o++)e.push(arguments[o]);var a=[];for(o=i.parameterCount-1;o<arguments.length;o++)a.push(arguments[o]);e.push(a)}else for(o=0;o<arguments.length;o++)e.push(arguments[o]);if(1&i.behaviorFlags){var s=r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+i.originalName),c=[this];for(o=0;o<e.length;o++)c.push(e[o]);var l=s.apply(this,c),u=l.handled,f=l.result;if(u)return f}if(r.throwIfApiNotSupported(n,i),0!=(16&i.behaviorFlags))return z.createIndexerObject(r.getFunction(i.returnTypeFullName),this,e);var d=0;2&i.behaviorFlags&&(d=1);var p=r.calculateApiFlags(i.apiFlags,i.undoableApiSetInfoOrdinal);return z.createMethodObject(r.getFunction(i.returnTypeFullName),this,i.originalName,d,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(P.prototype._handleResult.call(this,e),!G.isNullOrUndefined(e)){if(G.fixObjectPathIfNecessary(this,e),8&n.behaviorFlags)i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_HandleResult").call(this,this,e);if(n.scalarProperties)for(var r=0;r<n.scalarProperties.length;r++)G.isUndefined(e[n.scalarProperties[r].originalName])||(0!=(8&n.scalarProperties[r].behaviorFlags)?this[i.getFieldName(n.scalarProperties[r])]=G.adjustToDateTime(e[n.scalarProperties[r].originalName]):this[i.getFieldName(n.scalarProperties[r])]=e[n.scalarProperties[r].originalName]);if(n.navigationProperties){for(var o=[],a=0;a<n.navigationProperties.length;a++)o.push(n.navigationProperties[a].name),o.push(n.navigationProperties[a].originalName);G._handleNavigationPropertyResults(this,e,o)}if(0!=(1&n.behaviorFlags)){var s=i.hasIndexMethod(n);if(!G.isNullOrUndefined(e[k.items])){this.m__items=[];for(var c=e[k.items],l=i.getFunction(n.childItemTypeFullName),u=0;u<c.length;u++){var f=z.createChildItemObject(l,s,this,c[u],u);f._handleResult(c[u]),this.m__items.push(f)}}}}}},t.prototype.buildHandleRetrieveResult=function(e,t){var n=this;e.prototype._handleRetrieveResult=function(e,i){if(P.prototype._handleRetrieveResult.call(this,e,i),!G.isNullOrUndefined(e)){if(t.scalarProperties)for(var r=0;r<t.scalarProperties.length;r++)8&t.scalarProperties[r].behaviorFlags&&(G.isNullOrUndefined(e[t.scalarProperties[r].name])||(e[t.scalarProperties[r].name]=G.adjustToDateTime(e[t.scalarProperties[r].name])));if(1&t.behaviorFlags){var o=n.hasIndexMethod(t),a=n.getFunction(t.childItemTypeFullName),s=this;G.processRetrieveResult(s,e,i,(function(e,t){return z.createChildItemObject(a,o,s,e,t)}))}else G.processRetrieveResult(this,e,i)}}},t.prototype.buildHandleIdResult=function(e,n){var i=this;e.prototype._handleIdResult=function(e){if(P.prototype._handleIdResult.call(this,e),!G.isNullOrUndefined(e)){if(16&n.behaviorFlags)i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_HandleIdResult").call(this,this,e);if(n.scalarProperties)for(var r=0;r<n.scalarProperties.length;r++){var o=n.scalarProperties[r].originalName;"Id"!==o&&"_Id"!==o&&"_ReferenceId"!==o||G.isNullOrUndefined(e[n.scalarProperties[r].originalName])||(this[i.getFieldName(n.scalarProperties[r])]=e[n.scalarProperties[r].originalName])}}}},t.prototype.buildLoad=function(e,t){e.prototype.load=function(e){return G.load(this,e)}},t.prototype.buildRetrieve=function(e,t){e.prototype.retrieve=function(e){return G.retrieve(this,e)}},t.prototype.buildNewObject=function(e,t){G.isNullOrEmptyString(t.newObjectServerTypeFullName)||(e.newObject=function(n){return z.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 r=this;G.setMockData(r,e,(function(e,o){return z.createChildItemObject(n.getFunction(t.childItemTypeFullName),i,r,e,o)}),(function(e){r.m__items=e}))}}else e.prototype.setMockData=function(e){G.setMockData(this,e)}},t.prototype.buildEnsureUnchanged=function(e,t){e.prototype.ensureUnchanged=function(e){z.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 r=0;r<t.scalarProperties.length;r++)0==(2&t.scalarProperties[r].behaviorFlags)&&0!=(1&t.scalarProperties[r].behaviorFlags)?i.push(t.scalarProperties[r].name):n.push(t.scalarProperties[r].name);var o=[];if(t.navigationProperties)for(r=0;r<t.navigationProperties.length;r++)0!=(16&t.navigationProperties[r].behaviorFlags)||0==(1&t.navigationProperties[r].behaviorFlags)||0==(32&t.navigationProperties[r].behaviorFlags)?n.push(t.navigationProperties[r].name):o.push(t.navigationProperties[r].name);0===o.length&&0===i.length||(e.prototype.set=function(e,t){this._recursivelySet(e,t,i,o,n)})}},t.prototype.buildItems=function(e,t){0!=(1&t.behaviorFlags)&&Object.defineProperty(e.prototype,"items",{get:function(){return G.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 r={};if(t.navigationProperties)for(i=0;i<t.navigationProperties.length;i++)0!=(1&t.navigationProperties[i].behaviorFlags)&&(r[t.navigationProperties[i].name]=this[n.getFieldName(t.navigationProperties[i])]);return G.toJson(this,e,r)}:e.prototype.toJSON=function(){return G.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}),G.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");G.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 r=this,o=this.getOnEventName(i.name),a=this.getFieldName(i);Object.defineProperty(e.prototype,o,{get:function(){if(!this[a]){r.throwIfApiNotSupported(n,i);var e=this,o=null;"null"!==i.register&&(o=this[i.register].bind(this));var s=null;"null"!==i.unregister&&(s=this[i.unregister].bind(this));var c=null;2&i.behaviorFlags&&(c=r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+i.name+"_EventArgsTransform"));var l=r.evaluateEventType(i.typeExpression);this[a]=new H(this.context,this,i.name,{eventType:l,getTargetIdFunc:function(){return r.evaluateEventTargetId(i.targetIdExpression,e)},registerFunc:o,unregisterFunc:s,eventArgsTransformFunc:function(t){return c&&(t=c.call(e,e,t)),G._createPromiseFromResult(t)}})}return this[a]},enumerable:!0,configurable:!0})},t.prototype.buildV0Event=function(e,n,i){var r=this,o=this.getOnEventName(i.name),a=this.getFieldName(i);Object.defineProperty(e.prototype,o,{get:function(){if(!this[a]){r.throwIfApiNotSupported(n,i);var e=this,o=null;if(G.isNullOrEmptyString(i.register)){var s=r.evaluateEventType(i.typeExpression);o=function(t){var n=r.evaluateEventTargetId(i.targetIdExpression,e);return e.context.eventRegistration.register(s,n,t)}}else if("null"!==i.register){var c=r.getFunction(i.register);o=function(t){return c.call(e,e,t)}}var l=null;if(G.isNullOrEmptyString(i.unregister)){var u=r.evaluateEventType(i.typeExpression);l=function(t){var n=r.evaluateEventTargetId(i.targetIdExpression,e);return e.context.eventRegistration.unregister(u,n,t)}}else if("null"!==i.unregister){var f=r.getFunction(i.unregister);l=function(t){return f.call(e,e,t)}}var d=null;2&i.behaviorFlags&&(d=r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+i.name+"_EventArgsTransform"));this[a]=new M(this.context,this,i.name,{registerFunc:o,unregisterFunc:l,eventArgsTransformFunc:function(t){return d&&(t=d.call(e,e,t)),G._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=Q}(OfficeExtension||(OfficeExtension={})),function(e){var t;!function(t){t.getPromiseType=function(){if("undefined"!=typeof Promise)return Promise;if(void 0!==Office&&Office.Promise)return Office.Promise;throw new e.Error("No Promise implementation found")}}(t||(t={})),Object.defineProperty(e,"Promise",{get:function(){return t.getPromiseType()},enumerable:!0,configurable:!0})}(OfficeExtension||(OfficeExtension={}));try{if("undefined"!=typeof OfficePlatformGlobal&&void 0!==OfficePlatformGlobal.ReactNativeReka){var RichApiBridgeImpl=function(){function e(){}return e.prototype.sendMessageToHost=function(e){OfficePlatformGlobal.ReactNativeReka.RekaInstance.InvokeNative("RichApiDataService","ProcessMessageToHost",e)},e}(),RichApiBridge_1=new RichApiBridgeImpl,RichApiDataService_1=function(){function e(){}return e.prototype.Invoke=function(e,t){"ProcessMessageFromHost"===e&&RichApiBridge_1.onMessageFromHost&&RichApiBridge_1.onMessageFromHost(t)},e}();OfficePlatformGlobal.ReactNativeReka.initReka(),OfficePlatformGlobal.ReactNativeReka.RekaInstance.RegisterService("RichApiDataService",(function(){return new RichApiDataService_1})),OfficeExtension.HostBridge.init(RichApiBridge_1),OfficeExtension.HostBridgeSession.getInstanceIfHostBridgeInited()}}catch(e){}!function(){try{const e=OfficePlatformGlobal.ReactNative.TurboModuleRegistry.get("OsfPlatformApi");if(!e||!e.getConstants().enableRuntimePolyfills)return;const t=self;t.__osfEnableWindowMapToGlobal=!0;const n=()=>{if(!t.crypto||!t.crypto.getRandomValues){const n=t=>{if(!(t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof BigInt64Array||t instanceof BigUint64Array))throw TypeError("input is not of type 'ArrayBufferView'.");if(t.byteLength>65536)throw RangeError("Byte length exceeds maximum number of bytes supported by this API (65536).");const n=e.getRandomBytes(t.byteLength);if(n.length!=t.byteLength)throw Error("Unexpected error.");var i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);return n.forEach((e,t)=>{i[t]=e}),t};t.crypto={getRandomValues:n}}if(!t.atob){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=function(t){if(arguments.length<1)throw new TypeError("Failed to execute 'atob' on 'Window': 1 argument required, but only 0 present.");(t=String(t).replace(/[\t\n\f\r ]+/g,"")).length%4==0&&(t=t.replace(/[=]{1,2}$/,""));const n=t.length;if(n%4==1)throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded..");const i=/^[A-Za-z0-9+\/]*$/;if(!i.test(t))throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");let r=0,o="";for(;r<n;){const n=e.indexOf(t[r]),i=e.indexOf(t[r+1]),a=e.indexOf(t[r+2]),s=e.indexOf(t[r+3]),c=(63&n)<<2|i>>4&3,l=(15&i)<<4|a>>2&15,u=(3&a)<<6|63&s;o+=-1===a?String.fromCharCode(c):-1===s?String.fromCharCode(c,l):String.fromCharCode(c,l,u),r+=4}return o};t.atob=n}class n{constructor(e="utf-8",t){if(this.encoding="utf-8",this.ignoreBOM=!1,e&&"utf-8"!=e.toLowerCase())throw new RangeError("Unsupported encoding.");this.encoding=e,t&&"boolean"==typeof t.ignoreBOM&&(this.ignoreBOM=t.ignoreBOM)}decode(e){let t="",n=0;const i=e.length;for(!this.ignoreBOM&&i>2&&239==e[0]&&187==e[1]&&191==e[2]&&(n=3);n<i;){const r=e[n];if(r<128)t+=String.fromCharCode(r),n++;else if(192==(192&r)){let o=0;if(192==(224&r))o=31&r;else if(224==(240&r))o=15&r;else{if(240!=(248&r))throw new Error("Invalid utf8 input.");o=7&r}n++;let a=e[n];for(;128==(192&a);){if(o=o<<6|63&a,n++,n>i)throw new Error("Invalid utf8 input.");a=e[n]}t+=String.fromCodePoint(o)}else t+=String.fromCharCode(r),n++}return t}}t.TextDecoder||(t.TextDecoder=n)};if(e.getConstants().injectPolyfillOnInit)n();else{let e=!1;t.__initializeNestedAppAuth=()=>{try{e||n(),e=!0}catch(e){}return Promise.resolve()}}}catch(e){}}();var oteljs;__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};!function(e){function t(e,t,n,i){return{name:e,dataType:t,value:n,classification:i||4}}e.makeBooleanDataField=function(e,n,i){return t(e,1,n,i)},e.makeInt64DataField=function(e,n,i){return t(e,2,n,i)},e.makeDoubleDataField=function(e,n,i){return t(e,3,n,i)},e.makeStringDataField=function(e,n,i){return t(e,0,n,i)},e.makeGuidDataField=function(e,n,i){return t(e,4,n,i)}}(oteljs||(oteljs={})),function(e){!function(e){e[e.EssentialServiceMetadata=1]="EssentialServiceMetadata",e[e.AccountData=2]="AccountData",e[e.SystemMetadata=4]="SystemMetadata",e[e.OrganizationIdentifiableInformation=8]="OrganizationIdentifiableInformation",e[e.EndUserIdentifiableInformation=16]="EndUserIdentifiableInformation",e[e.CustomerContent=32]="CustomerContent",e[e.AccessControl=64]="AccessControl",e[e.PublicNonPersonalData=128]="PublicNonPersonalData",e[e.EndUserPseudonymousInformation=256]="EndUserPseudonymousInformation",e[e.PublicPersonalData=512]="PublicPersonalData",e[e.SupportData=1024]="SupportData",e[e.DirectMeasurementData=2048]="DirectMeasurementData",e[e.Everything=65535]="Everything"}(e.DataClassification||(e.DataClassification={})),function(e){e[e.String=0]="String",e[e.Boolean=1]="Boolean",e[e.Int64=2]="Int64",e[e.Double=3]="Double",e[e.Guid=4]="Guid"}(e.DataFieldType||(e.DataFieldType={})),function(e){e[e.NotSet=0]="NotSet",e[e.Measure=1]="Measure",e[e.Diagnostics=2]="Diagnostics",e[e.CriticalBusinessImpact=191]="CriticalBusinessImpact",e[e.CriticalCensus=192]="CriticalCensus",e[e.CriticalExperimentation=193]="CriticalExperimentation",e[e.CriticalUsage=194]="CriticalUsage"}(e.SamplingPolicy||(e.SamplingPolicy={})),function(e){e[e.NotSet=0]="NotSet",e[e.Normal=1]="Normal",e[e.High=2]="High"}(e.PersistencePriority||(e.PersistencePriority={})),function(e){e[e.NotSet=0]="NotSet",e[e.Normal=1]="Normal",e[e.High=2]="High"}(e.CostPriority||(e.CostPriority={})),function(e){e[e.NotSet=0]="NotSet",e[e.SoftwareSetup=1]="SoftwareSetup",e[e.ProductServiceUsage=2]="ProductServiceUsage",e[e.ProductServicePerformance=4]="ProductServicePerformance",e[e.DeviceConfiguration=8]="DeviceConfiguration",e[e.InkingTypingSpeech=16]="InkingTypingSpeech"}(e.DataCategories||(e.DataCategories={})),function(e){e[e.ReservedDoNotUse=0]="ReservedDoNotUse",e[e.Required=10]="Required",e[e.BasicEvent=10]="BasicEvent",e[e.Optional=100]="Optional",e[e.FullEvent=100]="FullEvent",e[e.RequiredServiceData=110]="RequiredServiceData",e[e.NecessaryServiceDataEvent=110]="NecessaryServiceDataEvent",e[e.RequiredServiceDataForEssentialServices=120]="RequiredServiceDataForEssentialServices",e[e.AlwaysOnNecessaryServiceDataEvent=120]="AlwaysOnNecessaryServiceDataEvent"}(e.DiagnosticLevel||(e.DiagnosticLevel={})),function(e){e[e.None=0]="None",e[e.MocaAddIn=1]="MocaAddIn"}(e.CustomerContentType||(e.CustomerContentType={})),function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Verbose=3]="Verbose"}(e.LogLevel||(e.LogLevel={})),function(e){e[e.Core=0]="Core",e[e.Sink=1]="Sink",e[e.Transport=2]="Transport"}(e.Category||(e.Category={})),function(e){e[e.Hourly=1]="Hourly",e[e.Daily=2]="Daily"}(e.DnmInterval||(e.DnmInterval={})),function(e){e[e.ReleaseAudienceGroup=1]="ReleaseAudienceGroup",e[e.WacRing=2]="WacRing",e[e.AppName=3]="AppName",e[e.AppPlatform=4]="AppPlatform",e[e.AppVersion=5]="AppVersion"}(e.AllowedPartA||(e.AllowedPartA={})),function(e){e[e.SendTelemetryEvent=1]="SendTelemetryEvent",e[e.CustomerContent=2]="CustomerContent",e[e.DirectNumericEvent=3]="DirectNumericEvent"}(e.EventType||(e.EventType={}))}(oteljs||(oteljs={})),function(e){e.getEffectiveEventFlags=function(t){var n={costPriority:1,samplingPolicy:1,persistencePriority:1,dataCategories:0,diagnosticLevel:100};return t.eventFlags&&t.eventFlags.dataCategories||e.logNotification(0,0,(function(){return"DataCategories"})),t.eventFlags?(t.eventFlags.costPriority&&(n.costPriority=t.eventFlags.costPriority),t.eventFlags.samplingPolicy&&(n.samplingPolicy=t.eventFlags.samplingPolicy),t.eventFlags.persistencePriority&&(n.persistencePriority=t.eventFlags.persistencePriority),t.eventFlags.dataCategories&&(n.dataCategories=t.eventFlags.dataCategories),t.eventFlags.diagnosticLevel&&(n.diagnosticLevel=t.eventFlags.diagnosticLevel),n):n}}(oteljs||(oteljs={})),function(e){var t,n=(t=[],{fireEvent:function(e){t.forEach((function(t){return t(e)}))},addListener:function(e){e&&t.push(e)}});function i(e,t,i){n.fireEvent({level:e,category:t,message:i})}e.onNotification=function(){return n},e.logNotification=i,e.logError=function(e,t,n){i(0,e,(function(){var e=n instanceof Error?n.message:"";return"".concat(t,": ").concat(e)}))}}(oteljs||(oteljs={})),function(e){var t;function n(e){var t={eventName:e.eventName,eventFlags:e.eventFlags||{},telemetryProperties:e.telemetryProperties?__assign({},e.telemetryProperties):{},dataFields:e.dataFields?e.dataFields.slice():[],timestamp:e.timestamp||(new Date).getTime()};return e.eventContract&&(t.eventContract={name:e.eventContract.name,dataFields:e.eventContract.dataFields.slice()}),t}!function(e){e[e.TelemetryData=0]="TelemetryData",e[e.AnonymousData=1]="AnonymousData",e[e.CustomerContent=2]="CustomerContent"}(t||(t={})),e.SuppressNexus=-1,e.cloneEvent=n;var i=function(){function t(e,t,n){var i,r,o;this.telemetrySinks=[],this.persistentDataFields=[],this.partAFields=[],this.eventQueue=[],this.config=n||{},e&&(this.telemetrySinks=e.telemetrySinks,(i=this.persistentDataFields).push.apply(i,e.persistentDataFields),this.config=__assign(__assign({},e.getConfig()),this.config),(r=this.partAFields).push.apply(r,e.partAFields)),t&&(o=this.persistentDataFields).push.apply(o,t)}return t.prototype.addEventContentType=function(t,n){t.push(e.makeInt64DataField("EventContent.Type",n))},t.prototype.sendTelemetryEvent=function(t){var i=n(t),r=i.telemetryProperties;r.nexusTenantToken=e.SuppressNexus;var o=r.ariaTenantToken;if(!o&&(!e.fillTenantTokens(i.eventName,r)&&!o))return void e.logNotification(0,0,(function(){return"No tenant token: "+t.eventName}));this.sendTelemetryEventInternal(i,1)},t.prototype.sendNonStandardEvent=function(e,t){var i=n(e);this.sendTelemetryEventInternal(i,t)},t.prototype.sendCustomerContent=function(e){var t=n(e),i=t.telemetryProperties,r=i.customerContentVersion;return(!r||r>2)&&(i.customerContentVersion=2),i.ariaTenantToken=void 0,i.nexusTenantToken=void 0,i.dnmToken=void 0,this.addEventContentType(t.dataFields,2),this.sendTelemetryEventInternal(t,2)},t.prototype.sendDirectNumericEvent=function(t){var i=n(t),r=i.telemetryProperties;if(!r.dnmToken&&(!e.fillTenantTokens(i.eventName,r)&&!r.dnmToken))return void e.logNotification(0,0,(function(){return"No dnm token: "+i.eventName}));this.addEventContentType(i.dataFields,1),this.sendTelemetryEventInternal(i,3)},t.prototype.sendTelemetryEventInternal=function(t,n){if(2===n||!t.telemetryProperties.customerContentVersion&&!t.telemetryProperties.customerContentType){try{if(0===this.telemetrySinks.length)return void(this.config.enableQueue&&this.eventQueue.length<1e3?this.eventQueue.push([t,n]):e.logNotification(1,0,(function(){return"No telemetry sinks are attached."})));this.processTelemetryEvent(t,n)}catch(t){return void e.logError(0,"SendTelemetryEvent",t)}this.telemetrySinks.forEach((function(e){try{3===n||2===n?e.sendNonStandardEvent&&e.sendNonStandardEvent(t,n):e.sendTelemetryEvent(t)}catch(e){}}))}else e.logNotification(0,0,(function(){return"Customer content"}))},t.prototype.processTelemetryEvent=function(t,n){var i,r,o;if(t.dataFields&&(null===(o=t.dataFields)||void 0===o||o.unshift(e.makeStringDataField("OTelJS.Version",e.oteljsVersion)),3!==n&&this.persistentDataFields&&(i=t.dataFields).unshift.apply(i,this.persistentDataFields)),this.partAFields.length>0){var a=t.eventContract||{name:"",dataFields:[]};(r=a.dataFields).push.apply(r,this.partAFields),t.eventContract=a}this.config.disableValidation||e.validateTelemetryEvent(t)},t.prototype.addSink=function(e){this.telemetrySinks.push(e),this.flushQueue()},t.prototype.flushQueue=function(){var e=this.eventQueue;if(this.eventQueue=[],this.telemetrySinks.length>0)for(var t=0,n=e;t<n.length;t++){var i=n[t],r=i[0],o=i[1];this.sendTelemetryEventInternal(r,o)}},t.prototype.setTenantToken=function(t,n,i){e.setTenantTokens(t,{ariaTenantToken:n,nexusTenantToken:i})},t.prototype.setDNMToken=function(t,n){e.setTenantTokens(t,{dnmToken:n})},t.prototype.cloneEvent=function(e){return n(e)},t.prototype.getConfig=function(){return this.config},t}();e.SimpleTelemetryLogger=i}(oteljs||(oteljs={})),function(e){var t=9007199254740991,n=/^Office(\.[A-Z][a-zA-Z0-9]*){2,}$/,i=/^[a-zA-Z0-9_\.]{1,95}$/;function r(e){return i.test(e)}function o(e){e&&e.forEach((function(e){if("string"!=typeof e.name||!r(e.name))throw new Error("Invalid dataField name");2===e.dataType&&a(e.value)}))}function a(e){if("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e<-9007199254740991||e>t)throw new Error("Invalid integer ".concat(JSON.stringify(e)))}e.validateTelemetryEvent=function(e){if(!function(e){if(!e||e.length>98)return!1;return n.test(e)}(e.eventName))throw new Error("Invalid eventName");var t=e.eventContract;if(t){if(t.name&&!r(t.name))throw new Error("Invalid eventContract");o(t.dataFields)}o(e.dataFields)},e.validateInt=a}(oteljs||(oteljs={})),function(e){var t={};e.setTenantTokens=function(n,i){"Office."===n.substring(0,7)&&"."!==n[n.length-1]?t[n]?(i.ariaTenantToken&&(t[n].ariaTenantToken=i.ariaTenantToken),i.dnmToken&&(t[n].dnmToken=i.dnmToken)):t[n]=i:e.logNotification(0,0,(function(){return"Namespace: ".concat(n)}))},e.fillTenantTokens=function(e,n){for(var i=e.length;i>0;){var r=e.substr(0,i);if(t[r]){var o=t[r];return n.ariaTenantToken=o.ariaTenantToken,n.dnmToken=o.dnmToken,!0}i=e.lastIndexOf(".",i-1)}return!1},e.clear=function(){t={}}}(oteljs||(oteljs={})),function(e){e.oteljsVersion="4.18.0"}(oteljs||(oteljs={})),function(e){var t=function(){function t(){var e=this;this._requestIsPending=!0,this._telemetryQueue=[],this._customerContentQueue=[],this.pause(1e3).then((function(){return e._requestIsPending=!1,e.processTelemetryEvents()})).catch()}return t.isSupportedByDeclaration=function(){return t.isSupportedVersion("1.2")},t.isSupportedVersion=function(e){return Office.context.requirements.isSetSupported("Telemetry",e)},t.prototype.sendCustomerContent=function(e){t.isSupportedVersion("1.3")&&(this._customerContentQueue.push(e),this.processWorkBacklog())},t.prototype.sendTelemetryEvent=function(e){this._telemetryQueue.push(e),this.processWorkBacklog()},t.prototype.processWorkBacklog=function(){var t=this;this._requestIsPending||(this._requestIsPending=!0,this.processTelemetryEvents().then((function(){t.waitAndProcessMore()})).catch((function(n){e.logError(1,"RichApiSink Error",n),t.waitAndProcessMore()})))},t.prototype.waitAndProcessMore=function(){var e=this;this.pause(1e3).then((function(){e._requestIsPending=!1,e._telemetryQueue.length>0&&setTimeout((function(){return e.processWorkBacklog()}),0)})).catch((function(){e._requestIsPending=!1}))},t.prototype.processTelemetryEvents=function(){var t=this,n=this._telemetryQueue;this._telemetryQueue=[];var i=this._customerContentQueue;this._customerContentQueue=[];var r=new OfficeCore.RequestContext,o=function(n,i){if(n.telemetryProperties){var r=[];t.addDataFields(r,n.dataFields);var o=n.eventContract?n.eventContract.name:"";n.eventContract&&t.addDataFields(r,n.eventContract.dataFields),i(n.telemetryProperties,n.eventName,o,e.getEffectiveEventFlags(n),r)}};return n.forEach((function(e){o(e,(function(e,t,n,i,o){r.telemetry.sendTelemetryEvent(e,t,n,i,o)}))})),i.forEach((function(e){o(e,(function(e,t,n,i,o){r.telemetry.sendCustomerContent(e,t,n,i,o)}))})),r.sync().catch((function(t){e.logError(1,"RichApi telemetry failed.",t)}))},t.prototype.addDataFields=function(e,t){t&&t.forEach((function(t){e.push({name:t.name,value:t.value,classification:t.classification?t.classification:4,type:4===t.dataType?0:t.dataType})}))},t.prototype.pause=function(e){return new Office.Promise((function(t){return setTimeout(t,e)}))},t}();e.RichApiSink=t}(oteljs||(oteljs={})),function(e){!function(t){!function(t){!function(t){!function(t){t.getFields=function(t,n){var i=[];return void 0!==n.id&&i.push(e.makeStringDataField("".concat(t,".Id"),n.id)),void 0!==n.version&&i.push(e.makeStringDataField("".concat(t,".Version"),n.version)),void 0!==n.instanceId&&i.push(e.makeStringDataField("".concat(t,".InstanceId"),n.instanceId)),void 0!==n.name&&i.push(e.makeStringDataField("".concat(t,".Name"),n.name)),void 0!==n.marketplaceType&&i.push(e.makeStringDataField("".concat(t,".MarketplaceType"),n.marketplaceType)),void 0!==n.sessionId&&i.push(e.makeStringDataField("".concat(t,".SessionId"),n.sessionId)),void 0!==n.browserToken&&i.push(e.makeStringDataField("".concat(t,".BrowserToken"),n.browserToken)),void 0!==n.osfRuntimeVersion&&i.push(e.makeStringDataField("".concat(t,".OsfRuntimeVersion"),n.osfRuntimeVersion)),void 0!==n.officeJsVersion&&i.push(e.makeStringDataField("".concat(t,".OfficeJsVersion"),n.officeJsVersion)),void 0!==n.hostJsVersion&&i.push(e.makeStringDataField("".concat(t,".HostJsVersion"),n.hostJsVersion)),void 0!==n.assetId&&i.push(e.makeStringDataField("".concat(t,".AssetId"),n.assetId)),void 0!==n.providerName&&i.push(e.makeStringDataField("".concat(t,".ProviderName"),n.providerName)),void 0!==n.type&&i.push(e.makeStringDataField("".concat(t,".Type"),n.type)),i}}(t.SDX||(t.SDX={}))}(t.System||(t.System={}))}(t.Office||(t.Office={}))}(e.Contracts||(e.Contracts={}))}(oteljs||(oteljs={})),function(e){var t=function(){function t(){}return t.isSupported=function(){return Office.context&&Office.context.platform?Office.context.platform===Office.PlatformType.OfficeOnline:OfficeExt&&OfficeExt.HostName&&OfficeExt.HostName.Host&&OfficeExt.HostName.Host.getInstance().getPlatform()===Office.PlatformType.OfficeOnline},t.prototype.sendTelemetryEvent=function(t,n){try{if(t.dataFields&&t.dataFields.filter((function(e){var t=e.classification;return t&&4!==t&&1!==t})).length>0)return;var i=OSF._OfficeAppFactory.getId(),r=OSF.AgaveHostAction.SendTelemetryEvent;OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[i,r,t])}catch(t){e.logError(1,"AgaveWacSink",t)}},t.prototype.sendCustomerContent=function(t,n){try{if(t.dataFields&&t.dataFields.filter((function(e){var t=e.classification;return t&&4!==t&&1!==t&&32!==t})).length>0)return;var i=OSF._OfficeAppFactory.getId(),r=OSF.AgaveHostAction.SendCustomerContent;OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[i,r,t])}catch(t){e.logError(1,"AgaveWacSink",t)}},t}();e.SdxWacSink=t}(oteljs||(oteljs={}));var OfficeFirstPartyDialog,OfficeFirstPartyAuth,OfficeCore,Office,OfficeFirstParty;__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)}}(),__awaiter=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){e.done?r(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,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};!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),r=(OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson),o=OfficeExtension.Utility.fixObjectPathIfNecessary,a=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),s=(OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags),c=function(c){function l(){return null!==c&&c.apply(this,arguments)||this}return __extends(l,c),Object.defineProperty(l.prototype,"_className",{get:function(){return"BiShim"},enumerable:!0,configurable:!0}),l.prototype.initialize=function(e){n(this,"Initialize",0,[e],s(2,"SharedApiUndo","1.5"),0)},l.prototype.getData=function(){return n(this,"getData",1,[],4,0)},l.prototype.setVisualObjects=function(e){n(this,"setVisualObjects",0,[e],2,0)},l.prototype.setVisualObjectsToPersist=function(e){n(this,"setVisualObjectsToPersist",0,[e],2,0)},l.prototype._handleResult=function(e){(c.prototype._handleResult.call(this,e),i(e))||o(this,e)},l.prototype._handleRetrieveResult=function(e,t){c.prototype._handleRetrieveResult.call(this,e,t),a(this,e,t)},l.newObject=function(n){return t(e.BiShim,n,"Microsoft.AgaveVisual.BiShim",!1,4)},l.prototype.toJSON=function(){return r(this,{},{})},l}(OfficeExtension.ClientObject);e.BiShim=c,function(e){e.generalException="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),r=OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,o=(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,f=OfficeExtension.Utility.fixObjectPathIfNecessary,d=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),p=function(r){function a(){return null!==r&&r.apply(this,arguments)||this}return __extends(a,r),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,r,o){return t(e.ABType,this,"GetFeature",1,[n,i,r,o],!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){(r.prototype._handleResult.call(this,e),o(e))||f(this,e)},a.prototype._handleRetrieveResult=function(e,t){r.prototype._handleRetrieveResult.call(this,e,t),d(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),!o(t)){var n=t;f(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),d(this,t,n)},t.prototype.toJSON=function(){return u(this,{value:this._V},{})},t.prototype.ensureUnchanged=function(e){r(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){var t,n=function(){function e(e){this._dialogService=e}return e.prototype.close=function(){return this._dialogService.close(),this._dialogService.context.sync()},e.prototype.messageChild=function(e,t){DialogApiManager&&DialogApiManager.messageChildRichApiBridge&&DialogApiManager.messageChildRichApiBridge(e,t)},e}();e.Dialog=n,e.displayWebDialog=function(t,n){return void 0===n&&(n={}),new OfficeExtension.CoreUtility.Promise((function(r,o){if(n.width&&n.height&&(!i(n.width)||!i(n.height)))throw new OfficeExtension.Error({code:"InvalidArgument",message:'Dimensions must be "number%" or number.'});var a=new OfficeExtension.ClientRequestContext,s=OfficeCore.FirstPartyDialogService.newObject(a),c=new e.Dialog(s),l=s.onDialogMessage.add((function(e){OfficeExtension.Utility.log("dialogMessageHandler:"+JSON.stringify(e));var t,i,s,u=JSON.parse(e.message),f=u.errorCode?new OfficeExtension.Error((t=u.errorCode,(i={})[12002]={code:"InvalidUrl",message:"Cannot load URL, no such page or bad URL syntax."},i[12003]={code:"InvalidUrl",message:"HTTPS is required."},i[12004]={code:"Untrusted",message:"Domain is not trusted."},i[12005]={code:"InvalidUrl",message:"HTTPS is required."},i[12007]={code:"FailedToOpen",message:"Another dialog is already opened."},(s=i)[t]?s[t]:{code:"Unknown",message:"An unknown error has occured with code: "+t})):null,d=u.type,p=u.origin,h=u.message;switch(d){case 17:f?o(f):r(c);break;case 12:n.onMessage&&n.onMessage(h,c,p);break;case 10:default:12006===u.errorCode?(l&&(l.remove(),a.sync()),n.onClose&&n.onClose()):n.onRuntimeError&&(n.onRuntimeError(f,c),o(f))}return OfficeExtension.CoreUtility.Promise.resolve()}));return a.sync().then((function(){var e={width:n.width?parseInt(n.width):50,height:n.height?parseInt(n.height):50,displayInIFrame:n.displayInIFrame,dialogTitle:n.dialogTitle,escKeyCloseDialog:void 0===n.escKeyCloseDialog||n.escKeyCloseDialog};return s.displayDialog(t,e),a.sync()})).catch((function(e){o(e)}))}));function i(e){return/^(\-|\+)?([0-9]+)%?$/.test(e)}},function(e){e[e.dialogMessageReceived=0]="dialogMessageReceived",e[e.dialogEventReceived=1]="dialogEventReceived"}(t||(t={}))}(OfficeFirstPartyDialog||(OfficeFirstPartyDialog={})),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(void 0===window.external||void 0===window.external.GetContext){var t=OSF.getClientEndPoint()._targetUrl,n=t.split("/")[2].split(":")[0].split("?")[0];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,r,o;return __generator(this,(function(a){switch(a.label){case 0:return i=t(),r=OfficeCore.License.newObject(i),o=r.isFeatureEnabled(e,n),[4,i.sync()];case 1:return a.sent(),[2,o.value]}}))}))},e.getFeatureTier=function(e,n){return __awaiter(this,void 0,void 0,(function(){var i,r,o;return __generator(this,(function(a){switch(a.label){case 0:return i=t(),r=OfficeCore.License.newObject(i),o=r.getFeatureTier(e,n),[4,i.sync()];case 1:return a.sent(),[2,o.value]}}))}))},e.isFreemiumUpsellEnabled=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i;return __generator(this,(function(r){switch(r.label){case 0:return e=t(),n=OfficeCore.License.newObject(e),i=n.isFreemiumUpsellEnabled(),[4,e.sync()];case 1:return r.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,r,o,a;return __generator(this,(function(s){switch(s.label){case 0:return i=t(),r=OfficeCore.License.newObject(i),(o=r.getLicenseFeature(e)).onStateChanged.add(n),a=function(){return o.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 r,o,a;return __generator(this,(function(s){switch(s.label){case 0:return r=t(),o=OfficeCore.License.newObject(r),a=o.getMsaDeviceTicket(e,n,i),[4,r.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,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.Skill_HostSkillEvent_EventArgsTransform=function(e,t){return{type:t.type,data:t.data}}}(e._CC||(e._CC={})),function(e){e.generalException="GeneralException"}(e.SkillErrorCodes||(e.SkillErrorCodes={}));new OfficeExtension.LibraryBuilder({metadata:{version:"1.0.0",name:"OfficeCore",defaultApiSetName:"OfficeSharedApi",hostName:"Office",apiSets:[["1.1","SharedApiUndo"]],strings:["Skill","registerHostSkillEvent","unregisterHostSkillEvent"],enumTypes:[],clientObjectTypes:[[1,0,0,0,[["executeAction",3,2,0,5],["notifyPaneEvent",2,2,0,5],[2,0,0,0,3,0,1],[3,0,0,0,3,0,1],["testFireEvent",0,0,0,3,0,1]],0,0,0,[["HostSkillEvent",2,0,"65538","",2,3]],"Microsoft.SkillApi.Skill",4]]},targetNamespaceObject:e})}(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),r=(OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported),o=(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.sendNonStandardEvent=function(e,t,i,o,a,s){r("TelemetryService.sendNonStandardEvent","Telemetry","1.4","OfficeCore"),n(this,"SendNonStandardEvent",1,[e,t,i,o,a,s],4,0)},l.prototype.sendTelemetryEvent=function(e,t,i,r,o){n(this,"SendTelemetryEvent",1,[e,t,i,r,o],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 o(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.sendTelemetryEvent="SendTelemetryEvent",e.customerContent="CustomerContent",e.directNumericEvent="DirectNumericEvent"}(e.EventType||(e.EventType={})),function(e){e.generalException="GeneralException"}(e.TelemetryErrorCodes||(e.TelemetryErrorCodes={}))}(OfficeCore||(OfficeCore={})),function(e){var t="officeWebAuthReplyUrls",n=!1,i=null;function r(e){var t=null,n=null,i=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return t=e.apply(void 0,n)};return{immediateCall:i,delayCall:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n=function(){return i.apply(void 0,e)}},waitForPromise:function(){return n&&(n(),n=null),t||Promise.resolve()}}}function o(t){return __awaiter(this,void 0,void 0,(function(){var n,i;return __generator(this,(function(r){switch(r.label){case 0:return n=!1,t&&e.supportsTeamsTokenFlow?(n=!0,[3,3]):[3,1];case 1:return[4,a()];case 2:(i=r.sent()).supportsAuthToken?n=!0:t&&(n=!i.hostPageSupportsAuth),r.label=3;case 3:return[2,n]}}))}))}function a(){return Office&&Office.context&&Office.context.webAuth?i?Promise.resolve(i):new Promise((function(e,t){Office.context.webAuth.getAuthContextAsync((function(n){if("succeeded"===n.status){if(!(i=n.value)||i.isAnonymous)return void t({code:"CannotGetAuthContext",message:i?i.Error:void 0,loggableErrorMessage:"Anonymous user"});if(!i.appId)return void t({code:"CannotGetAuthContext",message:"App ID is missing from getAuthContextAsync. Please verify the WebApplicationInfo node in app manifest."});e(i)}else t({code:"CannotGetAuthContext",message:n.status,loggableErrorMessage:String(n.error.code)})}))})):Promise.reject({code:"GetAuthContextAsyncMissing",message:"Office:["+!Office+"],Office.context:["+!Office.context+"],Office.context.webAuth:["+!Office.context.webAuth+"]"})}e.authFlow="authcode",e.autoPopup=!1,e.upnCheck=!0,e.timeout=void 0,e.msal="https://alcdn.msauth.net/browser-1p/2.28.1/js/msal-browser-1p.min.js",e.debugging=!1,e.useMsal3=void 0,e.delay=0,e.delayMsal=0,e.supportsOauthManager=!1,e.supportsTeamsTokenFlow=!0,e.supportsBrowserAuth=!0;var s=r((function(i,r){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(s){switch(s.label){case 0:return e.supportsBrowserAuth?[4,a()]:[2,Promise.reject({code:"PackageNotLoaded"})];case 1:return o=s.sent(),[2,new Promise((function(a,s){try{var c="msa"===o.authorityType.toLowerCase();if(OSF.WebAuth.config={authFlow:e.authFlow,authVersion:e.authVersion?e.authVersion:null,msal:e.msal,delayWebAuth:e.delay,delayMsal:e.delayMsal,debugging:e.debugging,useMsal3:e.useMsal3,authority:e.authorityOverride?e.authorityOverride:o.authority,idp:o.authorityType.toLowerCase(),appIds:[c&&o.msaAppId?o.msaAppId:o.appId],redirectUri:i||null,upn:o.upn,puid:o.userId,prefetch:r,telemetryInstance:"otel",autoPopup:e.autoPopup,enableUpnCheck:e.upnCheck,enableConsoleLogging:e.debugging,tenantId:o.tenantId,timeout:e.timeout},OSF.WebAuth.load().then((function(e){u(e,n=!0),a()})).catch((function(e){s({code:"PackageNotLoaded",message:e instanceof Event?e.type:e,telemetryResult:e})})),"implicit"===e.authFlow){var l=i||window.location.href.split("?")[0],f=sessionStorage.getItem(t);f||""===f?f=l:f+=", "+l,f&&sessionStorage.setItem(t,f)}}catch(e){OSF.WebAuth.config=null,OSF.WebAuth.load().then((function(){a()})).catch((function(){s({code:"FailedToLoad",message:e})}))}}))]}}))}))}));var c=r((function(t,n){return __awaiter(this,void 0,void 0,(function(){var i,r;return __generator(this,(function(a){switch(a.label){case 0:if(!OSF.WebAuth||"web"!=OSF._OfficeAppFactory.getHostInfo().hostPlatform)return[3,6];a.label=1;case 1:return a.trys.push([1,5,,6]),s.delayCall(t,n),[4,o(e.supportsOauthManager)];case 2:return a.sent()?[3,4]:[4,s.waitForPromise()];case 3:a.sent(),a.label=4;case 4:return[3,6];case 5:throw i=a.sent(),u((r=i).result,!1,r),delete r.result,delete r.loggableErrorMessage,r;case 6:return[2]}}))}))}));function l(e,t){return c.immediateCall(e,t)}function u(e,t,n){void 0!==OTel&&OTel.OTelLogger.onTelemetryLoaded((function(){var i=OSF.WebAuth.config?[oteljs.makeStringDataField("IdentityProvider",OSF.WebAuth.config.idp),oteljs.makeStringDataField("AppId",OSF.WebAuth.config.appIds[0]),oteljs.makeStringDataField("Target",{authFlow:OSF.WebAuth.config.authFlow,authVersion:OSF.WebAuth.config.authVersion,msal:OSF.WebAuth.config.msal,autoPopup:OSF.WebAuth.config.autoPopup,enableUpnCheck:OSF.WebAuth.config.upnCheck}),oteljs.makeBooleanDataField("UseMsal3",!0===OSF.WebAuth.config.useMsal3)]:[],r=n&&n.loggableErrorMessage?n.loggableErrorMessage:"",o=t?[]:[oteljs.makeStringDataField("ApiErrorCode",n&&n.code?n.code:""),oteljs.makeStringDataField("Error",r||(e instanceof Event?e.type:""))],a=i.concat(o,[oteljs.makeBooleanDataField("Result",t)]);if(e&&!(e instanceof Event)&&e.Telemetry)for(var s in e.Telemetry)if(e.Telemetry[s])switch(s){case"succeeded":a.push(oteljs.makeBooleanDataField(s,e.Telemetry[s]));break;case"loadedApplicationCount":case"timeToLoad":a.push(oteljs.makeInt64DataField(s,e.Telemetry[s]));break;default:a.push(oteljs.makeStringDataField(s,e.Telemetry[s]))}OTel.OTelLogger.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.OfficeFirstPartyAuth.Load",dataFields:a,eventFlags:{dataCategories:oteljs.DataCategories.ProductServiceUsage}})}))}function f(e,t,n){void 0!==OTel&&OTel.OTelLogger.onTelemetryLoaded((function(){var i=[oteljs.makeStringDataField("IdentityProvider",OSF.WebAuth.config.idp),oteljs.makeStringDataField("AppId",OSF.WebAuth.config.appIds[0]),oteljs.makeStringDataField("Target",{authFlow:OSF.WebAuth.config.authFlow,authVersion:OSF.WebAuth.config.authVersion,msal:OSF.WebAuth.config.msal,autoPopup:OSF.WebAuth.config.autoPopup,enableUpnCheck:OSF.WebAuth.config.upnCheck}),oteljs.makeBooleanDataField("Popup","boolean"==typeof n&&n),oteljs.makeBooleanDataField("Result",t),oteljs.makeStringDataField("Error",e instanceof Event?e.type:e.ErrorCode)];if(e&&!(e instanceof Event)&&e.Telemetry)for(var r in e.Telemetry)if(e.Telemetry[r])switch(r){case"succeeded":i.push(oteljs.makeBooleanDataField(r,e.Telemetry[r]));break;case"timeToGetToken":i.push(oteljs.makeInt64DataField(r,e.Telemetry[r]));break;default:i.push(oteljs.makeStringDataField(r,e.Telemetry[r]))}OTel.OTelLogger.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.OfficeFirstPartyAuth.GetAccessToken",dataFields:i,eventFlags:{dataCategories:oteljs.DataCategories.ProductServiceUsage}})}))}e.load=l,e.getAccessToken=function(e,t){var i=this;return c.waitForPromise().then((function(){return new Promise((function(r,a){return __awaiter(i,void 0,void 0,(function(){var i,c,l,u,d,p,h,g;return __generator(this,(function(m){switch(m.label){case 0:return m.trys.push([0,10,,11]),"web"!=OSF._OfficeAppFactory.getHostInfo().hostPlatform?[3,6]:[4,o(!!e.appName)];case 1:return m.sent()?[3,3]:[4,s.waitForPromise()];case 2:return m.sent(),OSF.WebAuth&&n?OSF.WebAuth.config.appIds[0]&&OSF.WebAuth.getToken(e.resource,null,OSF.WebAuth.config.appIds[0],e.correlationId||OSF._OfficeAppFactory.getHostInfo().osfControlAppCorrelationId,t&&t.popup?t.popup:null,e&&e.authChallenge?e.authChallenge:null).then((function(e){f(e,!0,!(!t||!t.popup)&&t.popup),r({accessToken:e.Token,tokenIdenityType:"msa"==OSF.WebAuth.config.idp.toLowerCase()?OfficeCore.IdentityType.microsoftAccount:OfficeCore.IdentityType.organizationAccount})})).catch((function(e){f(e,!1,!(!t||!t.popup)&&t.popup),a({code:e.ErrorCode,message:e instanceof Event?e.type:e.ErrorMessage})})):(v=n,y=OSF.WebAuth.loadAttempts,void 0!==OTel&&OTel.OTelLogger.onTelemetryLoaded((function(){var e=[oteljs.makeBooleanDataField("Loaded",v),oteljs.makeInt64DataField("LoadAttempts","number"==typeof y?y:0)];OTel.OTelLogger.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.OfficeFirstPartyAuth.UnexpectedAcquire",dataFields:e,eventFlags:{dataCategories:oteljs.DataCategories.ProductServiceUsage}})}))),[3,5];case 3:return i=new OfficeCore.RequestContext,u=OfficeCore.AuthenticationService.newObject(i),i._customData="WacPartition",c=u.getAccessToken(e,null),[4,i.sync()];case 4:m.sent(),r(c.value),m.label=5;case 5:return[3,9];case 6:return l=new OfficeCore.RequestContext,u=OfficeCore.AuthenticationService.newObject(l),d=u.onTokenReceived.add((function(e){if(!OfficeExtension.CoreUtility.isNullOrUndefined(e))if(d.remove(),l.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})),[4,l.sync()];case 7:return m.sent(),p=u.getAccessToken(e,u._targetId),[4,l.sync()];case 8:if(m.sent(),OfficeExtension.CoreUtility.isNullOrUndefined(p.value))return[2,null];h=p.value.accessToken,OfficeExtension.CoreUtility.isNullOrUndefined(h)||r(p.value),m.label=9;case 9:return[3,11];case 10:return g=m.sent(),a(g),[3,11];case 11:return[2]}var v,y}))}))}))}))},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}))},e.onIdentityChanged=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,i=this;return __generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),"web"===OSF._OfficeAppFactory.getHostInfo().hostPlatform?[3,2]:(t=new OfficeCore.RequestContext,n=OfficeCore.AuthenticationService.newObject(t),n.onIdentityChanged.add(e),[4,t.sync()]);case 1:return r.sent(),[2,function(){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:return n.onIdentityChanged.remove(e),[4,t.sync()];case 1:return i.sent(),[2]}}))}))}];case 2:return[3,4];case 3:return r.sent(),[3,4];case 4:return[2,function(){return Promise.resolve()}]}}))}))},"undefined"!=typeof window&&window.OSF&&function(){try{if("undefined"==typeof window||!window.sessionStorage)return;var e=sessionStorage.getItem(t);null!==e&&-1!==e.indexOf(window.location.origin+window.location.pathname)&&l()}catch(e){console.error(e)}}()}(OfficeFirstPartyAuth||(OfficeFirstPartyAuth={})),function(e){!function(e){var t,n;!function(e){e[e.None=0]="None",e[e.Auto=1]="Auto",e[e.Force=2]="Force"}(t=e.PopupOptions||(e.PopupOptions={})),function(e){e[e.UnsupportedUserIdentity=13003]="UnsupportedUserIdentity",e[e.UserAborted=13004]="UserAborted",e[e.InteractionRequired=13005]="InteractionRequired",e[e.ClientError=13006]="ClientError",e[e.ServerError=13007]="ServerError",e[e.NotAvailable=13012]="NotAvailable",e[e.InternalError=5001]="InternalError",e[e.InvalidApiArguments=5013]="InvalidApiArguments"}(n=e.AuthErrorCode||(e.AuthErrorCode={}));var i={ACCOUNT_UNAVAILABLE:n.UnsupportedUserIdentity,USER_CANCEL:n.UserAborted,USER_INTERACTION_REQUIRED:n.InteractionRequired,PERSISTENT_ERROR:n.ClientError,NO_NETWORK:n.ServerError,TRANSIENT_ERROR:n.ServerError,NESTED_APP_AUTH_UNAVAILABLE:n.NotAvailable},r={POPUP_WINDOW_ERROR:n.ClientError,USER_CANCELLED:n.UserAborted},o="access_token",a="xms_cc",s=0,c=!1,l=!1,u=void 0,f=null,d=void 0;e.clientCapabilities=[],e.upnCheck=!0,e.timeout=void 0,e.msal="https://alcdn.msauth.net/browser-1p/2.28.1/js/msal-browser-1p.min.js",e.debugging=!1,e.delay=0,e.delayMsal=0,e.useMsal3=void 0;var p={},h=function(e){try{var t="string"==typeof e?e:e.data,r=JSON.parse(t);if(r.requestId){var o=r.requestId;if(p.hasOwnProperty(o)){var a=n.InternalError,s=p[o],c=s[0],l=s[1];delete p[o];var u=r.token;if(u&&!0===r.success&&u.access_token&&"number"==typeof u.expires_in)return void c({accessToken:u.access_token,idToken:u.id_token,expiresOn:new Date(Date.now()+1e3*u.expires_in)});var f=r.error;if(f){var d=f.status;i[d]&&(a=i[d])}l({code:a})}}}catch(e){}},g={code:n.NotAvailable};function m(t){if(0===e.clientCapabilities.length)return t;var n={};if(t)try{n=JSON.parse(t)}catch(e){}return n.hasOwnProperty(o)||(n[o]={}),n[o][a]={values:e.clientCapabilities},JSON.stringify(n)}function v(e,t){var i=e.clientId||d,o=e.correlationId||OSF.OUtil.Guid.generateNewGuid(),a=Date.now(),f=function(e){var n=function(e,n){var r=Date.now()-a;!function(e,t,n,i,r,o){if(s>0&&!n)return;s++,void 0!==OTel&&OTel.OTelLogger.onTelemetryLoaded((function(){var r=[oteljs.makeStringDataField("NestedClientId",e),oteljs.makeStringDataField("CorrelationId",t),oteljs.makeBooleanDataField("Popup",n),oteljs.makeInt64DataField("Duration",i),oteljs.makeInt64DataField("ErrorCode",o?o.code:0),oteljs.makeBooleanDataField("BridgeAvailable",y())];OTel.OTelLogger.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.NestedAppAuth.GetAccessToken",dataFields:r,eventFlags:{dataCategories:oteljs.DataCategories.ProductServiceUsage,diagnosticLevel:oteljs.DiagnosticLevel.NecessaryServiceDataEvent}})}))}(i,o,t,r,0,n)};return e.then((function(e){n(0,null)})).catch((function(e){n(0,e)})),e};return y()?f(new Promise((function(n,r){var a=OSF.OUtil.Guid.generateNewGuid(),s=e.scopes.join(" "),l={messageType:"NestedAppAuthRequest",method:t?"GetTokenPopup":"GetToken",requestId:a,clientLibrary:"officejs",sendTime:Date.now(),tokenParams:{clientId:i,scope:s,correlationId:o,claims:m(e.claims)}};c||(nestedAppAuthBridge.addEventListener("message",h),c=!0),p[a]=[n,r],nestedAppAuthBridge.postMessage(JSON.stringify(l))}))):f(u?u.then((function(){if(!l)return Promise.reject(g);var a=e.scopes.join(" ");return a=a.replace(/(\/.default)$/,""),OSF.WebAuth.getToken(a,e.scopes,i,o,t,e.claims).then((function(e){return{accessToken:e.Token,expiresOn:e.MsalResult?e.MsalResult.expiresOn:void 0}})).catch((function(e){var t=n.InternalError,i=void 0;if(e)if(i=e.ErrorMessage,e.MsalResult&&"InteractionRequiredAuthError"===e.MsalResult.name)t=n.InteractionRequired;else if(e.ErrorCode){var o=e.ErrorCode.toUpperCase();r[o]&&(t=r[o])}return Promise.reject({code:t,description:i})}))})):Promise.reject(g))}function y(){return"undefined"!=typeof nestedAppAuthBridge}e.isBridgeAvailable=y,e.load=function(t,n,i,r){return d=t,r&&(e.clientCapabilities=r),u||(u=new Promise((function(o,a){if(y())o();else if(Office&&Office.context&&Office.context.auth&&OSF.WebAuth)try{Office.context.auth.getAuthContextAsync((function(s){if("succeeded"===s.status){if(!(f=s.value))return void a(g);OSF.WebAuth.config={authFlow:"authcode",authVersion:e.authVersion?e.authVersion:null,msal:e.msal,delayWebAuth:e.delay,delayMsal:e.delayMsal,debugging:e.debugging,useMsal3:e.useMsal3,authority:e.authorityOverride?e.authorityOverride:f.authorityBaseUrl,idp:"msa"===f.authorityType.toLowerCase()?"msa":"aad",appIds:[t],redirectUri:n||null,upn:f.userPrincipalName,prefetch:i,telemetryInstance:"otel",enableUpnCheck:e.upnCheck,enableConsoleLogging:e.debugging,checkActiveAccount:!0,tenantId:f.tenantId,timeout:e.timeout,clientCapabilities:r},OSF.WebAuth.load().then((function(e){l=!0,o()})).catch((function(e){a(__assign({},g,{description:e instanceof Event?e.type:void 0}))}))}else a(g)}))}catch(e){a(g)}else a(g)})))},e.getAccessToken=function(e){var i=null==e.popup?t.None:e.popup;if(i===t.Auto&&!e.directUserActionCallback)throw{code:n.InvalidApiArguments};return v(e,i===t.Force).catch((function(r){if(r.code==n.InteractionRequired&&i===t.Auto&&e.directUserActionCallback)return e.directUserActionCallback().then((function(t){if(t)return v(e,!0);throw{code:n.UserAborted}})).catch((function(){throw{code:n.UserAborted}}));throw r}))}}(e.NestedAppAuth||(e.NestedAppAuth={}))}(OfficeFirstPartyAuth||(OfficeFirstPartyAuth={})),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.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?LicenseFeatureTier.unknown:1==t.tierName?LicenseFeatureTier.basic:2==t.tierName?LicenseFeatureTier.premium:t.tierName),n}}(e._CC||(e._CC={})),function(e){e.ThemeService_OfficeThemeChanged_EventArgsTransform=function(e,t){return{bodyBackgroundColor:t.bodyBackgroundColor,bodyForegroundColor:t.bodyForegroundColor,controlBackgroundColor:t.controlBackgroundColor,controlForegroundColor:t.controlForegroundColor}}}(e._CC||(e._CC={})),function(e){e[e.immediate=0]="immediate",e[e.load=3]="load"}(t=e.PersonaPromiseType||(e.PersonaPromiseType={}));var n=function(){};e.PersonaInfoAndSource=n;var i=function(){function i(){}return i.prototype.performAsyncOperation=function(e,n,i,r){var o=this;e!=t.immediate?r().then((function(e){if(e)i();else{var t=o;t.load("hostId"),t.context.sync().then((function(){var e=t.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 f=s.dataUpdated[u];if(n==f)return void r().then((function(e){e&&(i(),o.onPersonaUpdated.remove(a),t.context.sync()),c(e)}))}c(!1)}))};o.onPersonaUpdated.add(a),t.context.sync()}))}))}})):i()},i.prototype.getOrganizationAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,i){var r=t;t.performAsyncOperation(e,PersonaDataUpdated.organization,(function(){var e=r.organization;e.load("*"),r.context.sync().then((function(){n(e)}))}),(function(){return new OfficeExtension.CoreUtility.Promise((function(e,t){var n=r.organization;n.load("isWarmedUp"),r.context.sync().then((function(){e(n.isWarmedUp)}))}))}))}))},i.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)}))}))},i.prototype.getPersonaInfoAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,i){var r=t;t.performAsyncOperation(e,PersonaDataUpdated.personaInfo,(function(){var e=r.personaInfo;e.load(),r.context.sync().then((function(){n(e)}))}),(function(){return t.getIsPersonaInfoResolvedCheck()}))}))},i.prototype.getPersonaInfoWithSourceAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(i,r){var o=t;t.performAsyncOperation(e,PersonaDataUpdated.personaInfo,(function(){var e=new n;e.info=o.personaInfo,e.info.load(),e.source=o.personaInfo.sources,e.source.load(),o.context.sync().then((function(){i(e)}))}),(function(){return t.getIsPersonaInfoResolvedCheck()}))}))},i.prototype.getUnifiedCommunicationInfo=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,i){var r=t;t.performAsyncOperation(e,PersonaDataUpdated.personaInfo,(function(){var e=r.unifiedCommunicationInfo;e.load("*"),r.context.sync().then((function(){n(e)}))}),(function(){return t.getIsPersonaInfoResolvedCheck()}))}))},i.prototype.getUnifiedGroupInfoAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,i){var r=t;t.performAsyncOperation(e,PersonaDataUpdated.personaInfo,(function(){var e=r.unifiedGroupInfo;e.load("*"),r.context.sync().then((function(){n(e)}))}),(function(){return t.getIsPersonaInfoResolvedCheck()}))}))},i.prototype.getTypeAsync=function(t){var n=this;return new OfficeExtension.CoreUtility.Promise((function(i,r){var o=n;n.performAsyncOperation(t,PersonaDataUpdated.personaInfo,(function(){o.load("type"),o.context.sync().then((function(){i(e.PersonaType[o.type.valueOf()])}))}),(function(){return n.getIsPersonaInfoResolvedCheck()}))}))},i.prototype.getCustomizationsAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,i){var r=t;t.performAsyncOperation(e,PersonaDataUpdated.personaInfo,(function(){var e=r.getCustomizations();r.context.sync().then((function(){n(e.value)}))}),(function(){return t.getIsPersonaInfoResolvedCheck()}))}))},i.prototype.getMembersAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,i){var r=t;t.performAsyncOperation(e,PersonaDataUpdated.members,(function(){var e=r.getMembers();e.load("isWarmedUp"),r.context.sync().then((function(){n(e)}))}),(function(){return new OfficeExtension.CoreUtility.Promise((function(e,t){var n=r.getMembers();n.load("isWarmedUp"),r.context.sync().then((function(){e(n.isWarmedUp)}))}))}))}))},i.prototype.getMembershipAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,i){var r=t;t.performAsyncOperation(e,PersonaDataUpdated.membership,(function(){var e=r.getMembership();e.load("*"),r.context.sync().then((function(){n(e)}))}),(function(){return new OfficeExtension.CoreUtility.Promise((function(e){var t=r.getMembership();t.load("isWarmedUp"),r.context.sync().then((function(){e(t.isWarmedUp)}))}))}))}))},i.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 r(i.context,i.instanceId).getPersonaLifetime().then((function(e){t(e)}))}))}))},i}();e.PersonaCustom=i;var r=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=r,function(e){e.FirstPartyDialogService_DialogMessage_EventArgsTransform=function(e,t){return{message:t.message}}}(e._CC||(e._CC={}));var o=function(){function e(){}return Object.defineProperty(e.prototype,"_targetId",{get:function(){return null==this.m_targetId&&(void 0!==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=o,function(e){e.AuthenticationService_TokenReceived_EventArgsTransform=function(e,t){var n=t;return{tokenValue:n.tokenValue,code:n.code,errorInfo:n.errorInfo}}}(e._CC||(e._CC={})),function(e){e.ExternalCodeService_ExternalCodeExecutionCompleted_EventArgsTransform=function(e,t){return{result:t.result}},e.ExternalCodeService_ExternalCodeServiceRequestCompleted_EventArgsTransform=function(e,t){return t},e.ExternalCodeService_ExternalCodeServiceResult_EventArgsTransform=function(e,t){return t}}(e._CC||(e._CC={})),function(e){e.AddinSkillActionService_ReplyReceived_EventArgsTransform=function(e,t){return{actionCorrelationId:t.actionCorrelationId,replyMessage:t.replyMessage,resultCode:t.resultCode}}}(e._CC||(e._CC={})),function(e){e.apiNotAvailable="ApiNotAvailable",e.clientError="ClientError",e.clpSessionError="ClpSessionError",e.controlIdNotFound="ControlIdNotFound",e.docCookieError="DocCookieError",e.entryIdRequired="EntryIdRequired",e.errorPointer="ErrorPointer",e.generalException="GeneralException",e.hostIntegrationManagerError="HostIntegrationManagerError",e.hostRestartNeeded="HostRestartNeeded",e.instanceNotFound="InstanceNotFound",e.interactiveFlowAborted="InteractiveFlowAborted",e.invalidArgument="InvalidArgument",e.invalidGrant="InvalidGrant",e.invalidResourceUrl="InvalidResourceUrl",e.invalidRibbonDefinition="InvalidRibbonDefinition",e.labelingDisabledAppguard="LabelingDisabledAppguard",e.labelingDisabledNoSignedInClpCompatibleUsers="LabelingDisabledNoSignedInClpCompatibleUsers",e.labelingDisabledPrivacySettings="LabelingDisabledPrivacySettings",e.labelingDisabledProtectedView="LabelingDisabledProtectedView",e.labelingDisabledUnsupportedLabelClient="LabelingDisabledUnsupportedLabelClient",e.msoOLDocumentError="MsoOLDocumentError",e.notImplement="NotImplement",e.objectNotFound="ObjectNotFound",e.officeJSItemLabelForIdentityError="OfficeJSItemLabelForIdentityError",e.officeJSRMSLicenseError="OfficeJSRMSLicenseError",e.officeJSSessionOrDocError="OfficeJSSessionOrDocError",e.officeSolutionFrameworkHostError="OfficeSolutionFrameworkHostError",e.omworkflowUserNotFound="OMWorkflowUserNotFound",e.osfControlContainerError="OsfControlContainerError",e.outOfMemory="OutOfMemory",e.resourceNotSupported="ResourceNotSupported",e.sensitivityDocumentReadOnly="SensitivityDocumentReadOnly",e.sensitivityInsufficientPermission="SensitivityInsufficientPermission",e.sensitivityLabelDisabled="SensitivityLabelDisabled",e.sensitivityLabelingDisabled="SensitivityLabelingDisabled",e.sensitivityLabelNotFound="SensitivityLabelNotFound",e.sensitivityNewLabelSensitivityOrder="SensitivityNewLabelSensitivityOrder",e.sensitivityUnsupportedContentType="SensitivityUnsupportedContentType",e.sensitivityUnsupportedCrossTenant="SensitivityUnsupportedCrossTenant",e.sensitivityUnsupportedDke="SensitivityUnsupportedDke",e.sensitivityUnsupportedUdp="SensitivityUnsupportedUdp",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={});new OfficeExtension.LibraryBuilder({metadata:{version:"1.0.0",name:"OfficeCore",defaultApiSetName:"OfficeSharedApi",hostName:"Office",apiSets:[["1.2","SharedApiUndo"],["1.2","SharedRuntimeInternal"],["1.1","SnapshotControl"],["1.1","SharedApiUndo"],["1.4","SharedApiUndo"],["1.2","DynamicRibbon"],["1.1","DynamicRibbonUndo"],["1.2","FirstPartyAuthentication"],["1.3","FirstPartyAuthentication"],["1.5","FirstPartyAuthentication"],["1.1","SensitivityUndo"],["1.2","SensitivityService"],["1.2","SensitivityUndo"],["1.3","SensitivityService"],["1.3","SensitivityUndo"],["1.3","SharedApiUndo"],["1.2","CopilotService"],["1.1","PrivateAPI"],["1.1","ExternalCodeServiceUndo"],["1.1","TaskpaneAPI"]],strings:["DialogPage","License","LicenseFeature","MsaDeviceTicketOptions","AppRuntimePersistenceService","AppRuntimeService","ThemeService","Tap","MemberInfoList","PersonaActions","PersonaInfoSource","PersonaInfo","PersonaUnifiedCommunicationInfo","PersonaPhotoInfo","PersonaCollection","PersonaOrganizationInfo","UnifiedGroupInfo","Persona","PersonaLifetime","LokiTokenProvider","LokiTokenProviderFactory","ServiceContext","RichapiPcxFeatureChecks","Comment","CommentCollection","ExtensionLifeCycle","OfficeServicesManagerApi","LocaleApi","FirstPartyDialogService","DynamicRibbon","RibbonTab","RibbonButton","RibbonButtonCollection","ServiceUrlProvider","LinkedIn","NetworkUsage","BeforeDocumentCloseNotification","AuthenticationService","RoamingSetting","RoamingSettingCollection","SharedFilePicker","ActionService","Auth","AugLoopEventService","UndoService","UserFeedbackService","NotificationService","SensitivityService","CopilotService","PrivateApiService","ExternalCodeService","BusinessBarService","ShowSimpleDialog","DispatchApiService","DevicePermissionService","TaskpaneService","AddinSkillActionService","UnifiedStoreService","close","registerOnShow","unregisterOnShow","id","_RegisterStateChange","_UnregisterStateChange","","null","registerOfficeThemeChangedEvent","unregisterOfficeThemeChangedEvent","isWarmedUp","isWarmingUp","displayName","email","emailAddresses","sipAddresses","birthday","birthdays","title","jobInfoDepartment","companyName","office","linkedTitles","linkedDepartments","linkedCompanyNames","linkedOffices","webSites","notes","getImageUri","setPlaceholderColor","getPlaceholderUri","getImageUriWithMetadata","getCount","getItem","instanceId","dispose","_RegisterPersonaUpdatedEvent","_UnregisterPersonaUpdatedEvent","this.instanceId","_RegisterLokiTokenAvailableEvent","_UnregisterLokiTokenAvailableEvent","_RegisterIdentityUniqueIdAvailableEvent","_UnregisterIdentityUniqueIdAvailableEvent","_RegisterClientAccessTokenAvailableEvent","_UnregisterClientAccessTokenAvailableEvent","getLokiTokenProvider","registerIdentityChangedEvent","unregisterIdentityChangedEvent","_RegisterHostMessageReceivedEvent","_UnregisterHostMessageReceivedEvent","_RegisterUndoStackChangedEvent","_UnregisterUndoStackChangedEvent","_RegisterUserFeedbackUIDismissedEvent","_UnregisterUserFeedbackUIDismissedEvent","_RegisterUserFeedbackResponseEvent","_UnregisterUserFeedbackResponseEvent","_RegisterSensitivityLabelChangedEvent","_UnregisterSensitivityLabelChangedEvent","execute","_RegisterPrivateApiEvent","_UnregisterPrivateApiEvent","registerExternalCodeExecutionCompletedEvent","unregisterExternalCodeExecutionCompletedEvent","registerExternalCodeServiceRequestCompletedEvent","unregisterExternalCodeServiceRequestCompletedEvent","registerExternalCodeServiceResultEvent","unregisterExternalCodeServiceResultEvent","_RegisterReplyReceivedEvent","_UnregisterReplyReceivedEvent","_RegisterCopilotAgentEvent","_UnregisterCopilotAgentEvent"],enumTypes:[["DialogPageEventType",[],{onShow:1}],["LicenseFeatureTier",["unknown","basic","premium"]],["LicenseEventType",[],{featureStateChanged:1}],["AppRuntimeState",["inactive","background","visible"]],["Visibility",["hidden","visible"]],["VisualSurface",["default","menus","panes","statusBar","backstage","dialogs"],{qat:"QAT"}],["ObjectType",["unknown","chart","smartArt","table","image","slide","text"],{ole:"OLE"}],["PersonaCardPerfPoint",["placeHolderRendered","initialCardRendered"]],["MessageType",[],{personaLifetimePersonaUpdatedEvent:3502,lokiTokenProviderLokiTokenAvailableEvent:3503,lokiTokenProviderIdentityUniqueIdAvailableEvent:3504,lokiTokenProviderClientAccessTokenAvailableEvent:3505}],["UnifiedCommunicationAvailability",["notSet","free","idle","busy","idleBusy","doNotDisturb","unalertable","unavailable"]],["UnifiedCommunicationStatus",["online","notOnline","away","busy","beRightBack","onThePhone","outToLunch","inAMeeting","outOfOffice","doNotDisturb","inAConference","getting","notABuddy","disconnected","notInstalled","urgentInterruptionsOnly","mayBeAvailable","idle","inPresentation"]],["UnifiedCommunicationPresence",["free","busy","idle","doNotDistrub","blocked","notSet","outOfOffice"]],["FreeBusyCalendarState",["unknown","free","busy","elsewhere","tentative","outOfOffice"]],["PersonaType",["unknown","enterprise","contact","bot","phoneOnly","oneOff","distributionList","personalDistributionList","anonymous","unifiedGroup"]],["PhoneType",["workPhone","homePhone","mobilePhone","businessFax","otherPhone"]],["AddressType",["workAddress","homeAddress","otherAddress"]],["MemberType",["unknown","individual","group"]],["PersonaDataUpdated",["hostId","type","photo","personaInfo","unifiedCommunicationInfo","organization","unifiedGroupInfo","members","membership","capabilities","customizations","viewableSources","placeholder"]],["CustomizedData",["email","workPhone","workPhone2","workFax","mobilePhone","homePhone","homePhone2","otherPhone","sipAddress","profile","office","company","workAddress","homeAddress","otherAddress","birthday"]],["CommentTextFormat",["plain","markdown","delta"]],["TimeStringFormat",["shortTime","longTime","shortDate","longDate"]],["ServiceProvider",["ariaBrowserPipeUrl","ariaUploadUrl","ariaVNextUploadUrl","lokiAutoDiscoverUrl"]],["IdentityType",["organizationAccount","microsoftAccount","unsupported"]],["AugLoopEventType",[],{onHostMessageReceivedEvent:65542}],["UndoType",[],{onUndoStackChangedEvent:65543,onCopilotOperationStartedEvent:65544}],["TriStateOption",["notSet","true","false"]],["UserFeedbackType",["like","dislike","idea","unclassified"]],["UserFeedbackUIType",["modalDialog","taskpane"]],["UserFeedbackEventType",[],{onUserFeedbackUIDismissedEvent:65546,onUserFeedbackResponseEvent:65550}],["UserFeedbackScreenshotInfoSourceType",["autoCapture","autoCaptureWithHtml2Canvas","providedAtInitialization","dynamicallyProvided"]],["UserFeedbackScreenshotInfoImageFormat",[],{jpeg:"jpeg",png:"png"}],["LabelMessageContext",[],{generic:0,firstPerson:1}],["LabelResultSeverity",[],{info:0,warning:1,error:2}],["SensitivityLabelEventType",[],{onLabelChangedEvent:65549}],["EncryptionType",[],{none:0,irmtemplate:1,irmuserDefinedPermission:2,irmencryptOnly:3,irmdoNotForward:4}],["TryUpgradeLabelError",[],{s_APPLYLABEL_OK:0,e_APPLYLABEL_FAIL:2147467259,e_APPLYLABEL_UNSUPPORTED_CROSSTENANT:2147205120,e_APPLYLABEL_DOCUMENT_READONLY:2147205119,e_APPLYLABEL_INSUFFICIENTPERMISSION:2147205118,e_APPLYLABEL_LABELDISABLED:2147205117,e_APPLYLABEL_UNSUPPORTED_UDP:2147205116,e_APPLYLABEL_LABELING_DISABLED:2147205115,e_APPLYLABEL_UNSUPPORTED_CONTENTTYPE:2147205114,e_APPLYLABEL_UNSUPPORTED_DKE:2147205113,e_APPLYLABEL_LABELNOTFOUND:2147205112,e_APPLYLABEL_USERNOTFOUND:2147220727,e_APPLYLABEL_NEWLABELSENSITIVITYORDER:2147205105}],["PrivateApiEventType",[],{onPrivateEvent:65552}],["RequestMethod",["get","post","patch","delete"]],["ResultType",["executionResult","runtimeInfo","serviceResponse"]],["ErrorCategory",["other","environment","runtime","license","user","auth","billing","invalidArg","python","service","unsupported","dataUpload"]],["BusinessBarType",["info","error","blocked","severeWarning","success","warning"]],["SimpleDialogState",[],{cancel:0,confirm:1,checkedConfirm:2}],["SimpleDialogCategory",[],{information:"information",error:"error",warning:"warning",question:"question",other:"other"}],["DevicePermissionType",[],{camera:"camera",microphone:"microphone",geolocation:"geolocation"}],["CopilotAgentEventType",[],{onCopilotAgentEvent:65556}]],clientObjectTypes:[[1,0,[["_Id",2]],0,[[59,0,2,0,4],["readyToShow",0,2,0,4],[60,0,2,0,4],[61,0,2,0,4],["sendMessageToHost",1,2,0,4]],0,0,0,[["OnShowEvent",0,0,"DialogPageEventType.onShow","this._Id",60,61]],"Microsoft.Office.DialogPage.DialogPage",4],[2,0,0,0,[["isFeatureEnabled",2,2,0,4],["getFeatureTier",2,2,0,4],["isFreemiumUpsellEnabled",0,2,0,4],["launchUpsellExperience",1,2,0,4],["_TestFireStateChangedEvent",1,0,0,3,0,1],["getMsaDeviceTicket",3,2,0,5]],[["getLicenseFeature",3,1,2,0,4]],0,0,0,"Microsoft.Office.Licensing.License",4],[3,0,[[62,3]],0,[[63,0,2,0,4],[64,0,2,0,4]],0,0,0,[["StateChanged",2,0,"LicenseEventType.featureStateChanged","this.id",63,64]]],[4,0,[["scopes",1,0,0,2,1]],0,0,0,0,0,0,"Microsoft.Office.Licensing.MsaDeviceTicketOptions",4],[5,0,0,0,[["setAppRuntimeStartState",1,0,0,2,0,2],["getAppRuntimeStartState",0,2,0,4]],0,0,0,0,"Microsoft.AppRuntime.AppRuntimePersistenceService",4],[6,0,0,0,[["setAppRuntimeState",1,0,0,2,0,2],["getAppRuntimeState",0,2,0,4],["setSnapshotEnabled",1,2,3,4],["getSnapshotEnabled",0,2,3,4],["getContentSnapshotAsBase64",0,2,3,4]],0,0,0,[["SnapshotImageReady",0,3,"65547",65,66,66],["VisibilityChanged",0,0,"65539",65,66,66]],"Microsoft.AppRuntime.AppRuntimeService",4],[7,0,0,0,[[67,0,0,0,2,0,4],[68,0,0,0,2,0,4],["getOfficeThemeDataForVisualSurface",1,2,0,5]],0,0,0,[["OfficeThemeChanged",2,0,"65548",65,67,68]],"Microsoft.Theme.ThemeService",4],[8,0,0,0,[["getEnterpriseUserInfo",0,2,0,5],["getMruFriendlyPath",1,2,0,5],["launchFileUrlInOfficeApp",2,2,0,5],["performLocalSearch",4,2,0,5],["readSearchCache",3,2,0,5],["writeSearchCache",3,2,0,5]],0,0,0,0,"Microsoft.TapRichApi.Tap",4],[9,0,[[69,3],[70,3]],0,[["items",0,2,0,4]],[["getPersonaForMember",18,1,2,0,4]]],[10,0,0,0,[["addContact",0,0,0,2,0,5],["editContact",0,0,0,2,0,5],["composeEmail",1,0,0,2,0,5],["composeInstantMessage",1,0,0,2,0,5],["callPhoneNumber",1,0,0,2,0,5],["pinPersonaToQuickContacts",0,0,0,2,0,5],["toggleTagForAlerts",0,0,0,2,0,5],["scheduleMeeting",0,0,0,2,0,5],["openLinkContactUx",0,0,0,2,0,5],["editContactByIdentifier",1,0,0,2,0,5],["showHoverCardForPersona",6,0,0,2,0,5],["hideHoverCardForPersona",0,0,0,2,0,5],["showContextMenu",6,0,0,2,0,5],["showContactCard",6,0,0,2,0,5],["showExpandedCard",6,0,0,2,0,5],["openGroupCalendar",0,0,0,2,0,5],["subscribeToGroup",0,0,0,2,0,5],["unsubscribeFromGroup",0,0,0,2,0,5],["getChangePhotoUrlAndOpenInBrowser",0,0,0,2,0,5],["startAudioCall",0,0,0,2,0,5],["startVideoCall",0,0,0,2,0,5],["openOutlookProperties",0,0,0,2,0,5],["editUnifiedGroup",0,0,0,2,0,5],["joinUnifiedGroup",0,0,0,2,0,5],["leaveUnifiedGroup",0,0,0,2,0,5]]],[11,0,[[71,3],[72,3],[73,3],[74,3],[75,3],[76,3],[77,3],[78,3],[79,3],[80,3],[81,3],[82,3],[83,3],[84,3],["phones",3],["addresses",3],[85,3],[86,3]]],[12,0,[[71,3],[72,3],[73,3],[74,3],[75,11],[76,11],[77,3],[78,3],[79,3],[80,3],[81,3],[82,3],[83,3],[84,3],[85,3],[86,3],["isPersonResolved",3]],[["sources",11,3,0,0,4]],[["getPhones",0,2,0,4],["getAddresses",0,2,0,4]]],[13,0,[["availability",3],["status",3],["isSelf",3],["isTagged",3],["customStatusString",3],["isBlocked",3],["presenceTooltip",3],["isOutOfOffice",3],["outOfOfficeNote",3],["timezone",3],["meetingLocation",3],["meetingSubject",3],["timezoneBias",3],["idleStartTime",11],["overallCapability",3],["isOnBuddyList",3],["presenceNote",3],["voiceMailUri",3],["availabilityText",3],["availabilityTooltip",3],["isDurationInAvailabilityText",3],["freeBusyStatus",3],["calendarState",3],["presence",3]]],[14,0,0,0,[[87,1,2,0,4,87],[88,1,0,0,2,88,5],[89,1,2,0,4,89],[90,1,2,0,4,90]]],[15,1,0,0,[[91,0,2,0,4]],[[92,18,1,18,0,4]],0,18],[16,0,[[69,3],[70,3]],[["hierarchy",15,18,0,0,4],["manager",18,2,0,0,4],["directReports",15,18,0,0,4]]],[17,0,[["description",1,0,0,2,5],["oneDrive",1,0,0,2,5],["oneNote",1,0,0,2,5],["isPublic",1,0,0,2,5],["amIOwner",1,0,0,2,5],["amIMember",1,0,0,2,5],["amISubscribed",1,0,0,2,5],["memberCount",1,0,0,2,5],["ownerCount",1,0,0,2,5],["hasGuests",1,0,0,2,5],["site",1,0,0,2,5],["planner",1,0,0,2,5],["classification",1,0,0,2,5],["subscriptionEnabled",1,0,0,2,5]]],[18,4,[["hostId",3],["type",3],["capabilities",3],["diagnosticId",3],[93,3]],[["photo",14,3,0,0,4],["personaInfo",12,3,0,0,4],["unifiedCommunicationInfo",13,3,0,0,4],["organization",16,3,0,0,4],["unifiedGroupInfo",17,35,0,0,4],["actions",10,2,0,0,4]],[["getCustomizations",0,2,0,4],["warmup",1,0,0,2,0,5],[94,0,0,0,2,0,5],["getViewableSources",0,2,0,4],["reportTimeForRender",2,0,0,2,0,5]],[["getMembers",9,0,2,0,4],["getMembership",9,0,2,0,4]]],[19,0,[[93,3]],0,[["getPolicies",0,2,0,4],[95,0,0,0,2,0,5],[96,0,0,0,2,0,5],["getTextScaleFactor",0,2,0,4]],[["getPersona",18,1,2,0,4],["getPersonaForOrgEntry",18,4,2,0,4],["getPersonaForOrgByEntryId",18,4,2,0,4]],0,0,[["PersonaUpdated",0,0,"MessageType.personaLifetimePersonaUpdatedEvent",97,95,96]]],[20,0,[["emailOrUpn",3],[93,3]],0,[["requestToken",0,0,0,2,0,5],[98,0,0,0,2,0,5],[99,0,0,0,2,0,5],["requestIdentityUniqueId",0,0,0,2,0,5],[100,0,0,0,2,0,5],[101,0,0,0,2,0,5],["requestClientAccessToken",0,0,0,2,0,5],[102,0,0,0,2,0,5],[103,0,0,0,2,0,5]],0,0,0,[["ClientAccessTokenAvailable",0,0,"MessageType.lokiTokenProviderClientAccessTokenAvailableEvent",97,102,103],["IdentityUniqueIdAvailable",0,0,"MessageType.lokiTokenProviderIdentityUniqueIdAvailableEvent",97,100,101],["LokiTokenAvailable",0,0,"MessageType.lokiTokenProviderLokiTokenAvailableEvent",97,98,99]]],[21,0,0,0,0,[[104,20,1,2,0,4]],0,0,0,"Microsoft.People.LokiTokenProviderFactory",4],[22,0,0,0,[[94,1,0,0,2,0,5],["accountEmailOrUpn",1,2,0,4],["getPersonaPolicies",0,2,0,4]],[[104,20,1,2,0,4],["getPersonaLifetime",19,1,2,0,4],["getInitialPersona",18,1,2,0,4]],0,0,0,"Microsoft.People.ServiceContext",4],[23,0,0,0,[["isAddChangePhotoLinkOnLpcPersonaImageFlightEnabled",0,2,0,4]],0,0,0,0,"Microsoft.People.RichapiPcxFeatureChecks",4],[24,0,[[62,3],["text",1,0,0,2,5],["created",11],["level",3],["resolved",1,0,0,2,5],["author",3],["mentions",3]],[["parent",24,2,0,0,4],["parentOrNullObject",24,2,0,0,4],["replies",25,19,0,0,4]],[["getRichText",1,2,0,4],["setRichText",2,0,0,2,0,5],["delete",0,0,0,2,0,5]],[["getParentOrSelf",24,0,2,0,4],["reply",24,2,0,0,2,0,0,5]]],[25,1,0,0,[[91,0,2,0,4]],[[92,24,1,18,0,4]],0,24],[26,0,0,0,[["launchExtensionComponent",3,2,0,5]],0,0,0,0,"Microsoft.OfficeSharedApi.ExtensionLifeCycle",4],[27,0,0,0,[["bindServiceToProfile",3,0,0,2,0,5]],0,0,0,0,"Microsoft.OfficeServicesManager.OfficeServicesManagerApi",4],[28,0,0,0,[["getLocaleDateTimeFormattingInfo",1,2,0,4],["formatDateTimeString",3,2,0,4]],0,0,0,0,"Microsoft.LocaleApi.LocaleApi",4],[29,0,0,0,[["displayDialog",2,2,0,5],[59,0,2,0,5]],0,0,0,[["DialogMessage",2,0,"65536",65,66,66]],"Microsoft.FirstPartyDialog.FirstPartyDialogService",4],[30,0,0,[["buttons",33,19,0,0,4]],[["executeRequestUpdate",1,2,0,4],["executeRequestCreate",1,2,6,4]],[["getButton",32,1,2,0,4],["getTab",31,1,2,0,4]],0,0,0,"Microsoft.DynamicRibbon.DynamicRibbon",4],[31,0,[[62,3]],0,[["setVisibility",1,0,0,2,0,7]]],[32,0,[[62,3],["enabled",1,0,0,2,7],["label",3]],0,[["setEnabled",1,0,0,2,0,7]]],[33,1,0,0,[[91,0,2,0,4]],[[92,32,1,18,0,4]],0,32],[34,0,0,0,[["getServiceUrl",2,2,0,4]],0,0,0,0,"Microsoft.DesktopCompliance.ServiceUrlProvider",4],[35,0,0,0,[["isEnabledForOffice",0,2,0,4],["recordLinkedInSettingsCompliance",2,0,0,2,0,5]],0,0,0,0,"Microsoft.DesktopCompliance.LinkedIn",4],[36,0,0,0,[["isInOnlineMode",0,2,0,4],["isInDisconnectedMode",0,2,0,4]],0,0,0,0,"Microsoft.DesktopCompliance.NetworkUsage",4],[37,0,0,0,[["enable",0,2,0,4],["disable",0,2,0,4]],0,0,0,[["BeforeCloseNotificationCancelled",0,0,"65540",65,66,66]],"Microsoft.BeforeDocumentCloseNotification.BeforeDocumentCloseNotification",4],[38,4,0,[["roamingSettings",40,2,0,0,4]],[["getAccessToken",2,2,0,5],["getPrimaryIdentityInfo",0,2,8,5],["getIdentities",0,2,9,5],[105,0,0,10,3,0,4],[106,0,0,10,3,0,4]],0,0,0,[["IdentityChanged",0,10,"65545",65,105,106],["TokenReceived",2,8,"3001","this._targetId",66,66]],"Microsoft.Authentication.AuthenticationService",4],[39,0,[[62,3],["value",1,0,0,2,4]]],[40,0,0,0,0,[[92,39,1,2,0,4],["getItemOrNullObject",39,1,2,0,4]]],[41,0,0,0,[["getSharedFilePickerResponse",1,2,0,4]],0,0,0,0,"Microsoft.Office.SharedFilePicker",4],[42,0,0,0,[["getShortcuts",0,2,0,4],["replaceShortcuts",1,0,0,2,0,4],["areShortcutsInUse",1,0,0,2,0,4]],0,0,0,0,"Microsoft.Office.ActionService",4],[43,0,0,0,[["getAccessTokenFirstPartyOAuth",2,2,0,5]],0,0,0,0,"Microsoft.Office.Auth",5],[44,0,0,0,[["sendMessage",1,2,0,5],[107,0,2,0,5],[108,0,2,0,5]],0,0,0,[["HostMessageReceived",0,0,"AugLoopEventType.onHostMessageReceivedEvent",65,107,108]],"Microsoft.Office.AugLoopEventService",5],[45,0,0,0,[["undo",0,0,0,3,0,5],[109,0,2,0,5],[110,0,2,0,5],["startCopilotOperation",1,0,0,3,0,5],["endCopilotOperation",1,0,0,3,0,5]],0,0,0,[["CopilotOperationStarted",0,0,"UndoType.onCopilotOperationStartedEvent",65,66,66],["UndoStackChanged",0,0,"UndoType.onUndoStackChangedEvent",65,109,110]],"Microsoft.Office.UndoService",5],[46,0,0,0,[["collectUserFeedback",4,2,0,5],[111,0,2,0,5],[112,0,2,0,5],["canCollectUserFeedback",0,2,0,5],[113,0,2,0,5],[114,0,2,0,5],["getInitializationData",0,2,0,5],["getHostScreenshot",0,2,0,5],["invokeDiagnosticsLogsUpload",1,2,0,5],["canCollectCopilotFeedback",0,2,0,5],["collectFeedbackEligibility",0,2,0,5],["checkFeedbackEligibility",1,2,0,5]],0,0,0,[["UserFeedbackResponse",0,0,"UserFeedbackEventType.onUserFeedbackResponseEvent",65,113,114],["UserFeedbackUIDismissed",0,0,"UserFeedbackEventType.onUserFeedbackUIDismissedEvent",65,111,112]],"Microsoft.Office.UserFeedbackService",5],[47,0,0,0,[["addNotification",2,0,0,3,0,1],["updateNotification",2,0,0,3,0,1],["removeNotification",1,0,0,3,0,1]],0,0,0,0,"Microsoft.Office.NotificationService",5],[48,0,0,0,[["getLabel",0,0,0,3,0,11],["tryUpgradeLabel",2,0,0,3,0,11],["getHighestSensitivityLabel",1,0,0,3,0,11],[115,0,2,0,5],[116,0,2,0,5],["getSensitivityResultDetails",2,0,12,3,0,13],["getSensitivityResultDetailsByStringErrorCode",2,0,14,3,0,15]],0,0,0,[["LabelChanged",0,0,"SensitivityLabelEventType.onLabelChangedEvent",65,115,116]],"Microsoft.Office.SensitivityService",5],[49,0,0,0,[["launchHelpPaneByQuery",1,0,0,3,0,16],["launchHelpPaneByArticleId",1,0,0,3,0,16],["launchHelpPaneByArticleIdString",1,0,0,3,0,16],["launchTaskPaneByAgentId",1,0,17,3],["getWindowClientWidth",0,0,0,3,0,16]],0,0,0,0,"Microsoft.Office.CopilotService",5],[50,0,0,0,[[117,1,0,0,3,0,18],[118,0,2,0,5],[119,0,2,0,5]],0,0,0,[["OnPrivateEvent",0,0,"PrivateApiEventType.onPrivateEvent",65,118,119]],"Microsoft.Office.PrivateApiService",5],[51,0,0,0,[["executePythonCode",1,0,0,3,0,19],["executePythonCodeAsync",1,0,0,3,0,19],[120,0,0,0,3,0,19],[121,0,0,0,3,0,19],["executePythonCodeAsync2",2,0,0,3,0,19],["sendRequestAsync",4,2,0,5],[122,0,2,0,5],[123,0,2,0,5],["getRuntimeInfoAsync",0,2,0,5],[124,0,0,0,3,0,19],[125,0,0,0,3,0,19],["getRuntimeInfoAsync2",1,2,0,5]],0,0,0,[["ExternalCodeExecutionCompleted",2,0,"65551",65,120,121],["ExternalCodeServiceRequestCompleted",2,0,"65553",65,122,123],["ExternalCodeServiceResult",2,0,"65554",65,124,125]],"Microsoft.Office.ExternalCodeService",5],[52,0,0,0,[["show",2,0,0,3,0,4],["hide",1,0,0,3,0,4]],0,0,0,0,"Microsoft.Office.BusinessBarService",5],[53,0,0,0,[["launchSimpleDialog",8,0,0,3]],0,0,0,0,"Microsoft.Office.ShowSimpleDialog",5],[54,0,0,0,[[117,2,2,0,5]],0,0,0,0,"Microsoft.Office.DispatchApiService",5],[55,0,0,0,[["requestPermissions",1,2,0,5]],0,0,0,0,"Microsoft.Office.DevicePermissionService",5],[56,0,0,0,[["notifyHeaderLoaded",0,0,0,3,0,20],[59,0,0,0,3,0,20],["move",0,0,0,3,0,20],["setWidth",1,0,0,2,0,20]],0,0,0,0,"Microsoft.Office.TaskpaneService",4],[57,0,0,0,[["invokeAction",4,2,0,5],[126,0,2,0,5],[127,0,2,0,5]],0,0,0,[["ReplyReceived",2,0,"65555",65,126,127]],"Microsoft.Office.AddinSkillActionService",5],[58,0,0,0,[["launchStoreDialogWithCopilotAgentPageShown",0,0,0,3],[128,0,2,0,5],[129,0,2,0,5]],0,0,0,[["CopilotAgentEvent",0,0,"CopilotAgentEventType.onCopilotAgentEvent",65,128,129]],"Microsoft.Office.UnifiedStoreService",5]]},targetNamespaceObject:e})}(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 r(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 o;e.setStartupBehavior=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(o){switch(o.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,r=i(!1),OfficeCore.AppRuntimePersistenceService.newObject(r).setAppRuntimeStartState(t),[4,r.sync()];case 1:return o.sent(),[2]}}))}))},e.getStartupBehavior=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,o;return __generator(this,(function(a){switch(a.label){case 0:return e=i(!1),t=OfficeCore.AppRuntimePersistenceService.newObject(e),r=t.getAppRuntimeStartState(),[4,e.sync()];case 1:return a.sent(),o=r.value,[2,o==OfficeCore.AppRuntimeState.inactive?n.none:n.load]}}))}))},e.setSnapshotEnabled=function(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).setSnapshotEnabled(e),[4,t.sync()];case 1:return n.sent(),[2,Promise.resolve()]}}))}))},e.getSnapshotEnabled=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(r){switch(r.label){case 0:return e=i(!0),t=OfficeCore.AppRuntimeService.newObject(e),n=t.getSnapshotEnabled(),[4,e.sync()];case 1:return r.sent(),[2,n.value]}}))}))},e.getContentSnapshotAsBase64=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,new OfficeExtension.CoreUtility.Promise((function(e,t){var n=i(!0),r=OfficeCore.AppRuntimeService.newObject(n),o=setTimeout((function(){a.remove(),n.sync().catch((function(){})),t(OfficeExtension.Utility.createRuntimeError(OfficeExtension.ErrorCodes.generalException,"timeout","getContentSnapshotAsBase64"))}),7e3),a=r.onSnapshotImageReady.add((function(i){return clearTimeout(o),a.remove(),OfficeExtension.CoreUtility.isNullOrUndefined(i)?(n.sync().catch((function(){})),t(OfficeExtension.Utility.createRuntimeError(OfficeExtension.ErrorCodes.generalException,"execution failed","getContentSnapshotAsBase64"))):(n.sync().catch((function(){})),e(i.imageBase64)),null}));n.sync().then((function(){r.getContentSnapshotAsBase64();return n.sync().then((function(){return null}))})).catch((function(e){t(e)}))}))]}))}))},e._getState=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(r){switch(r.label){case 0:return e=i(!0),t=OfficeCore.AppRuntimeService.newObject(e),n=t.getAppRuntimeState(),[4,e.sync()];case 1:return r.sent(),[2,n.value]}}))}))},e.showAsTaskpane=function(){return r(OfficeCore.AppRuntimeState.visible)},e.hide=function(){return r(OfficeCore.AppRuntimeState.background)},e.onVisibilityModeChanged=function(e){return __awaiter(this,void 0,void 0,(function(){var n,r,a=this;return __generator(this,(function(s){switch(s.label){case 0:return n=function(){if(!o){var e=i(!0);o=OfficeCore.AppRuntimeService.newObject(e)}return o}(),r=n.onVisibilityChanged.add((function(n){if(e){var i={visibilityMode:(r=n.visibility,r===OfficeCore.Visibility.visible?t.taskpane:t.hidden)};e(i)}var r;return null})),[4,n.context.sync()];case 1:return s.sent(),[2,function(){return __awaiter(a,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return r.remove(),[4,n.context.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))},function(e){function t(e){var t=new OfficeCore.RequestContext;return t._requestFlagModifier|=64,e&&(t._customData="WacPartition"),t}e.enable=function(){return __awaiter(this,void 0,void 0,(function(){var e,n;return __generator(this,(function(i){switch(i.label){case 0:return e=!1,"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(e=!0),n=t(e),OfficeCore.BeforeDocumentCloseNotification.newObject(n).enable(),[4,n.sync()];case 1:return i.sent(),[2]}}))}))},e.disable=function(){return __awaiter(this,void 0,void 0,(function(){var e,n;return __generator(this,(function(i){switch(i.label){case 0:return e=!1,"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(e=!0),n=t(e),OfficeCore.BeforeDocumentCloseNotification.newObject(n).disable(),[4,n.sync()];case 1:return i.sent(),[2]}}))}))},e.onCloseActionCancelled=function(e){return __awaiter(this,void 0,void 0,(function(){var n,i,r,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return n=!1,"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(n=!0),i=t(n),r=OfficeCore.BeforeDocumentCloseNotification.newObject(i),o=r.onBeforeCloseNotificationCancelled.add((function(t){return e&&e(),null})),[4,i.sync()];case 1:return s.sent(),[2,function(){return __awaiter(a,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return o.remove(),[4,i.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))}}(e.beforeDocumentCloseNotification||(e.beforeDocumentCloseNotification={}))}(e.addin||(e.addin={}))}(Office||(Office={})),function(e){var t,n;!function(e){e.taskpane="Taskpane",e.dialog="Dialog"}(t||(t={})),function(n){function i(e){return new OfficeCore.RequestContext}!function(e){function t(){var e=new OfficeCore.RequestContext;return e._customData="WacPartition",e}e.close=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return e=t(),OfficeCore.TaskpaneService.newObject(e).close(),[4,e.sync()];case 1:return n.sent(),[2]}}))}))},e.move=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return e=t(),OfficeCore.TaskpaneService.newObject(e).move(),[4,e.sync()];case 1:return n.sent(),[2]}}))}))},e.notifyHeaderLoaded=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return e=t(),OfficeCore.TaskpaneService.newObject(e).notifyHeaderLoaded(),[4,e.sync()];case 1:return n.sent(),[2]}}))}))},e.setWidth=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.TaskpaneService.newObject(n).setWidth(e),[4,n.sync()];case 1:return i.sent(),[2]}}))}))}}(n.taskpane||(n.taskpane={})),n.launchTaskpane=function(n){return __awaiter(this,void 0,void 0,(function(){var r,o,a,s,c;return __generator(this,(function(l){switch(l.label){case 0:return e.context.platform&&"OfficeOnline"===e.context.platform?(r={SharedRuntimeId:n.sharedRuntimeId,SourceLocationOverrideResourceId:n.sourceLocationOverride,TaskPaneTitle:n.taskpaneTitle,TaskPaneWidth:n.taskpaneWidth},o={OptionalProperties:r,DevProperties:n.settings},e.context.extensionLifeCycle.launchExtensionComponent(null,"Taskpane",null,null,o),[3,3]):[3,1];case 1:return a=i(),s=OfficeCore.ExtensionLifeCycle.newObject(a),c=n.settings,n.settings=c&&OSF.OUtil.serializeSettings(c),s.launchExtensionComponent("",t.taskpane,n),[4,a.sync()];case 2:l.sent(),l.label=3;case 3:return[2]}}))}))},n.launchDialog=function(n){return __awaiter(this,void 0,void 0,(function(){var r,o,a,s,c;return __generator(this,(function(l){switch(l.label){case 0:return e.context.platform&&"OfficeOnline"===e.context.platform?(r={SharedRuntimeId:n.sharedRuntimeId,SourceLocationOverrideResourceId:n.sourceLocationOverride},o={OptionalProperties:r,DevProperties:n.settings},e.context.extensionLifeCycle.launchExtensionComponent(null,"SDXDialog",null,null,o),[3,3]):[3,1];case 1:return a=i(),s=OfficeCore.ExtensionLifeCycle.newObject(a),c=n.settings,n.settings=c&&OSF.OUtil.serializeSettings(c),s.launchExtensionComponent("",t.dialog,n),[4,a.sync()];case 2:l.sent(),l.label=3;case 3:return[2]}}))}))}}(n=e.ExtensionLifeCycle||(e.ExtensionLifeCycle={})),e.extensionLifeCycle=n}(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 r(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){r(e)})):r(e)})),n.sync()},e.requestCreateControls=function(e){var n,i=t();return i.ribbon.executeRequestCreate(JSON.stringify(e)),(n=250,new Promise((function(e,t){return setTimeout((function(){return e()}),n)}))).then((function(){return i.sync()}))}}(e.ribbon||(e.ribbon={}))}(Office||(Office={})),function(e){!function(e){e.requestUpdate=function(e){if(OfficeExtension&&OfficeExtension.Utility&&!OfficeExtension.Utility.isSetSupported("ContextMenuApi","1.1"))throw OfficeExtension.Utility.createRuntimeError(OfficeCore.ErrorCodes.apiNotAvailable,null,null);var t,n=(t=new OfficeCore.RequestContext,"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(t._customData="WacPartition"),t),i=n.ribbon;return 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)})),n.sync()}}(e.contextMenu||(e.contextMenu={}))}(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,r=OfficeExtension.Utility.isNullOrUndefined;function o(e,t){Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:e,dataFields:t,eventFlags:{dataCategories:oteljs.DataCategories.ProductServiceUsage,diagnosticLevel:oteljs.DiagnosticLevel.Optional,samplingPolicy:oteljs.SamplingPolicy.CriticalBusinessImpact}})}function a(e){if(e){var t=e.toUpperCase(),i=n.mappings[t];if(!r(i)&&"function"==typeof i)return i}throw OfficeExtension.Utility.createRuntimeError("invalidOperation","sourceData","ActionProxy._getFunction")}function s(e,t,n,i){var a=OSF._OfficeAppFactory.getHostInfo();if(a&&"web"===a.hostPlatform.toLowerCase())OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getId(),OSF.AgaveHostAction.ReportAddinSkillResult,{actionCorrelationId:e,resultCode:t,replyMessage:i}]);else{if(r(window.external))throw new OfficeExtension.Error({code:"GenericException",message:"API currently unsupported."});var s=r(OSF.MethodDispId)?OSF.DDA.MethodDispId.dispidAddinSkillActionReply:OSF.MethodDispId.dispidAddinSkillActionReply;window.external.Execute(s,[e,i,t],null)}o("Office.Extensibility.AddinSkill.ExecuteAction",[oteljs.makeStringDataField("CorrelationId",e),oteljs.makeStringDataField("Message",n),oteljs.makeInt64DataField("ResultCode",t)])}function c(e){try{OfficeExtension.Utility.log("ActionProxy._handleMessage"),OfficeExtension.Utility.checkArgumentNull(e,"args");for(var t=e.entries,n=function(e){if(2!==t[e].messageCategory)return"continue";if("string"==typeof t[e].message&&(t[e].message=JSON.parse(t[e].message)),1e3===t[e].messageType){var n=null,i=a(u=t[e].message[0]);if(t[e].message.length>=2){var c=t[e].message[1];c&&(n=function(e){if("string"==typeof e&&"{"===e[0])return!0;return!1}(c)?JSON.parse(c):c)}void 0!==OSF&&OSF.AppTelemetry&&OSF.AppTelemetry.CallOnAppActivatedIfPending&&OSF.AppTelemetry.CallOnAppActivatedIfPending(),i.apply(null,[n])}else if(1001===t[e].messageType){n=null;var u=t[e].message[0],f=t[e].message[1],d=JSON.parse(f);n=d.message;var p=d.correlationId,h=[oteljs.makeStringDataField("CorrelationId",p),oteljs.makeStringDataField("Message","ActionProxy._handleMessage is called")];o("Office.Extensibility.AddinSkill.ExecuteAction",h);var g=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultSuccess;i=null;try{i=a(u)}catch(e){g=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultNoActionFunctionMapping,h.push(oteljs.makeStringDataField("Message","ActionProxy._handleMessage failed to get function")),h.push(oteljs.makeInt64DataField("ResultCode",g)),o("Office.Extensibility.AddinSkill.ExecuteAction",h),l(e)}var m=null,v="";if(g==OfficeFirstParty.AddinInvokeResult.AddinInvokeResultSuccess)try{m=i.apply(null,[n])}catch(e){g=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultInvocationFailed,h.push(oteljs.makeStringDataField("Message","ActionProxy._handleMessage failed to execute function")),h.push(oteljs.makeInt64DataField("ResultCode",g)),o("Office.Extensibility.AddinSkill.ExecuteAction",h),l(e)}if(g==OfficeFirstParty.AddinInvokeResult.AddinInvokeResultSuccess&&r(m)?(g=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultNoResultGenerated,v="No result generated"):g!=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultSuccess||"object"==typeof m&&"function"==typeof m.then||(g=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultInvalidResultGenerated,v="Invalid result generated"),g==OfficeFirstParty.AddinInvokeResult.AddinInvokeResultSuccess)try{m.then((function(e){v="Successfully executed function",r(e)?(e="",g=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultNoResultGenerated,v="No result generated"):"string"!=typeof e&&(e="",g=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultInvalidResultGenerated,v="Invalid result generated"),s(p,g,v,e)}),(function(e){var t="";g=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultInvocationFailed,v="Failed to execute function","string"==typeof e?t=e:l(e),s(p,g,v,t)}))}catch(e){g=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultInvalidResultGenerated,v="Invalid result generated",l(e),s(p,g,v,"")}else try{s(p,g,v,"")}catch(e){l(e)}}else OfficeExtension.Utility.log("ActionProxy._handleMessage unknown message type "+t[e].messageType)},i=0;i<t.length;i++)n(i)}catch(e){throw l(e),e}return OfficeExtension.Utility._createPromiseFromResult(null)}function l(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)}function u(){try{Microsoft.Office.WebExtension.onReadyInternal().then((function(){return function(){if(void 0!==OSF&&OSF.DDA&&OSF.DDA.RichApi&&OSF.DDA.RichApi.richApiMessageManager)return(new OfficeExtension.ClientRequestContext).eventRegistration.register(5,"",c)}()})).then((function(){var e,t,n=OSF._OfficeAppFactory.getHostInfo();return!0===n.isDialog||"web"===n.hostPlatform&&"word"!==n.hostType&&"excel"!==n.hostType&&"powerpoint"!==n.hostType?void 0:(e=new OfficeExtension.ClientRequestContext,t=OfficeCore.AddinInternalService.newObject(e),e._customData="WacPartition",t.notifyActionHandlerReady(),e.sync())}))}catch(e){}}OfficeExtension.Utility.log("ActionProxy.initOnce"),void 0!==e.actions&&(i=e.actions._association,n=i),"undefined"!=typeof document&&(document.readyState&&"loading"!==document.readyState?(OfficeExtension.Utility.log("ActionProxy.initOnce: document.readyState is not loading state"),u()):document.addEventListener&&document.addEventListener("DOMContentLoaded",(function(){OfficeExtension.Utility.log("ActionProxy.initOnce: DOMContentLoaded event triggered"),u()}))),OfficeExtension.HostBridge.onInited((function(e){!function(e){e.addHostMessageHandler((function(e){3===e.type&&c(e.message)}))}(e)}))}(t||(t={}))}(Office||(Office={})),function(e){!function(e){function t(e){var t=new OfficeCore.RequestContext;return e&&e.controlId&&(t.requestHeaders[OfficeExtension.Constants.officeControlId]=e.controlId),t._customData="WacPartition",t}e.SendMessage=function(e,n){return __awaiter(this,void 0,void 0,(function(){var i,r;return __generator(this,(function(o){switch(o.label){case 0:return i=void 0!==n?n:e,r=t(void 0!==n?e:void 0),OfficeCore.AugLoopEventService.newObject(r).sendMessage(i),[4,r.sync()];case 1:return o.sent(),[2]}}))}))},e.onHostMessageReceived=function(e,n){return __awaiter(this,void 0,void 0,(function(){var i,r,o,a,s=this;return __generator(this,(function(c){switch(c.label){case 0:return i=void 0!==n?n:e,r=t(void 0!==n?e:void 0),o=OfficeCore.AugLoopEventService.newObject(r),a=function(e){if(i){var t=e.data;i(t)}return null},o.onHostMessageReceived.add(a),[4,o.context.sync()];case 1:return c.sent(),[2,function(){return __awaiter(s,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return o.onHostMessageReceived.remove(a),[4,r.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))}}(e.AugLoop||(e.AugLoop={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){function t(e){return"object"==typeof e&&"string"==typeof e.controlId?e.controlId:void 0}function n(e){var t=new OfficeCore.RequestContext;return e&&(t.requestHeaders[OfficeExtension.Constants.officeControlId]=e),t._customData="SkipUndoRecording",t}var i,r={};e.undo=function(e){return __awaiter(this,void 0,void 0,(function(){var i,r,o;return __generator(this,(function(a){switch(a.label){case 0:return i=n(t(e)),r=OfficeCore.UndoService.newObject(i),o=r.undo(),[4,i.sync()];case 1:return a.sent(),[2,o.value]}}))}))},e.onUndoStackChanged=function(e,i){return __awaiter(this,void 0,void 0,(function(){var r,o,a,s=this;return __generator(this,(function(c){switch(c.label){case 0:return r=i||e,o=n(t(i?e:void 0)),(a=OfficeCore.UndoService.newObject(o)).onUndoStackChanged.add(r),[4,o.sync()];case 1:return c.sent(),[2,function(){return __awaiter(s,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return a.onUndoStackChanged.remove(r),[4,o.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))},e.startCopilotOperation=function(e){return __awaiter(this,void 0,void 0,(function(){var o,a,s,c,l,u,f,d;return __generator(this,(function(p){switch(p.label){case 0:if(void 0===(o=t(e))){if(void 0!==i)throw new Error("startCopilotOperation is already inprogress")}else if(r[o])throw new Error("startCopilotOperation is already in progress");a=function(){},s=new Promise((function(e){void 0===o?i=e:r[o]=e})),p.label=1;case 1:return p.trys.push([1,4,,5]),c=n(o),l=OfficeCore.UndoService.newObject(c),u=function(){return function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return void 0===e?void 0!==i&&(i(),i=void 0):r[e]&&(r[e](),delete r[e]),[2]}))}))}(o)},a=function(){try{l.onCopilotOperationStarted.remove(u),c.sync()}catch(e){}},l.onCopilotOperationStarted.add(u),[4,c.sync()];case 2:return p.sent(),f=l.startCopilotOperation(""),[4,c.sync()];case 3:return p.sent(),f.value?(void 0!==o&&s.then((function(){a()})),[2,s]):(void 0===o?i=void 0:(a(),delete r[o]),[3,5]);case 4:throw d=p.sent(),void 0===o?i=void 0:(a(),delete r[o]),d;case 5:return[2]}}))}))},e.endCopilotOperation=function(e){return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(r){switch(r.label){case 0:return i=n(t(e)),OfficeCore.UndoService.newObject(i).endCopilotOperation(""),[4,i.sync()];case 1:return r.sent(),[2]}}))}))}}(e.Undo||(e.Undo={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){var t;(t=e.dialogPage||(e.dialogPage={})).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]}}))}))},t.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]}}))}))},t.onShow=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,i;return __generator(this,(function(r){switch(r.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 r.sent(),[2,i]}}))}))},t.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]}}))}))}}(Office||(Office={})),function(e){!function(e){function t(e){var t=new OfficeCore.RequestContext;return t._customData="WacPartition",t}e.CollectUserFeedback=function(e,n,i,r){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(a){switch(a.label){case 0:return o=t(),OfficeCore.UserFeedbackService.newObject(o).collectUserFeedback(e,n,i,r),[4,o.sync()];case 1:return a.sent(),[2]}}))}))},e.onUserFeedbackUIDismissed=function(e){return __awaiter(this,void 0,void 0,(function(){var n,i,r,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=function(t){if(e){var n=t.isFeedbackSent;e(n)}return null},i=t(),(r=OfficeCore.UserFeedbackService.newObject(i)).onUserFeedbackUIDismissed.add(n),[4,r.context.sync()];case 1:return a.sent(),[2,function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return r.onUserFeedbackUIDismissed.remove(n),[4,i.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))},e.CanCollectUserFeedback=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i;return __generator(this,(function(r){switch(r.label){case 0:return e=t(),n=OfficeCore.UserFeedbackService.newObject(e),i=n.canCollectUserFeedback(),[4,e.sync()];case 1:return r.sent(),[2,i.value]}}))}))},e.onUserFeedbackResponse=function(e){return __awaiter(this,void 0,void 0,(function(){var n,i,r,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=function(t){if(e){var n=t.responseData;e(n)}return null},i=t(),(r=OfficeCore.UserFeedbackService.newObject(i)).onUserFeedbackResponse.add(n),[4,r.context.sync()];case 1:return a.sent(),[2,function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return r.onUserFeedbackResponse.remove(n),[4,i.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))},e.InvokeDiagnosticsLogsUpload=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.UserFeedbackService.newObject(n).invokeDiagnosticsLogsUpload(e),[4,n.sync()];case 1:return i.sent(),[2]}}))}))},e.GetInitializationData=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i;return __generator(this,(function(r){switch(r.label){case 0:return e=t(),n=OfficeCore.UserFeedbackService.newObject(e),i=n.getInitializationData(),[4,e.sync()];case 1:return r.sent(),[2,i.value]}}))}))},e.GetHostScreenshot=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i;return __generator(this,(function(r){switch(r.label){case 0:return e=t(),n=OfficeCore.UserFeedbackService.newObject(e),i=n.getHostScreenshot(),[4,e.sync()];case 1:return r.sent(),[2,i.value]}}))}))},e.CanCollectCopilotFeedback=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i;return __generator(this,(function(r){switch(r.label){case 0:return e=t(),n=OfficeCore.UserFeedbackService.newObject(e),i=n.canCollectCopilotFeedback(),[4,e.sync()];case 1:return r.sent(),[2,i.value]}}))}))},e.CollectFeedbackEligibility=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i;return __generator(this,(function(r){switch(r.label){case 0:return e=t(),n=OfficeCore.UserFeedbackService.newObject(e),i=n.collectFeedbackEligibility(),[4,e.sync()];case 1:return r.sent(),[2,i.value]}}))}))},e.CheckFeedbackEligibility=function(e){return __awaiter(this,void 0,void 0,(function(){var n,i,r;return __generator(this,(function(o){switch(o.label){case 0:return n=t(),i=OfficeCore.UserFeedbackService.newObject(n),r=i.checkFeedbackEligibility(e),[4,n.sync()];case 1:return o.sent(),[2,r.value]}}))}))}}(e.UserFeedback||(e.UserFeedback={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){var t=function(){};function n(){var e=new OfficeCore.RequestContext;return e._customData="WacPartition",e}function i(e){return JSON.stringify(e instanceof t?{type:"callout",params:e.params}:{type:"custom",props:e})}e.callout=function(e){var n=new t;return n.params=e,n},e.addNotification=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,o,a;return __generator(this,(function(s){switch(s.label){case 0:return r=n(),o=OfficeCore.NotificationService.newObject(r),a=o.addNotification(i(e),function(e){return JSON.stringify(e)}(t)),[4,r.sync()];case 1:return s.sent(),[2,a.value]}}))}))},e.updateNotification=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(o){switch(o.label){case 0:return r=n(),OfficeCore.NotificationService.newObject(r).updateNotification(e,i(t)),[4,r.sync()];case 1:return o.sent(),[2]}}))}))},e.removeNotification=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){switch(i.label){case 0:return t=n(),OfficeCore.NotificationService.newObject(t).removeNotification(e),[4,t.sync()];case 1:return i.sent(),[2]}}))}))}}(e.Notification||(e.Notification={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){function t(e){var t=new OfficeCore.RequestContext;return e&&e.controlId&&(t.requestHeaders[OfficeExtension.Constants.officeControlId]=e.controlId),t._customData="WacPartition",t}e.getLabel=function(e){return __awaiter(this,void 0,void 0,(function(){var n,i,r;return __generator(this,(function(o){switch(o.label){case 0:return n=t(e),i=OfficeCore.SensitivityService.newObject(n),r=i.getLabel(),[4,n.sync()];case 1:return o.sent(),[2,r.value]}}))}))},e.tryUpgradeLabel=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return __awaiter(this,void 0,void 0,(function(){var n,i,r,o,a;return __generator(this,(function(s){switch(s.label){case 0:if(n=3===e.length,2!==e.length&&3!==e.length)throw new Error("tryUpgradeLabel: Invalid number of parameters ("+e.length+")");return i=n?e[0]:void 0,r=n?e[1]:e[0],o=n?e[2]:e[1],a=t(i),OfficeCore.SensitivityService.newObject(a).tryUpgradeLabel(r,o),[4,a.sync()];case 1:return s.sent(),[2]}}))}))},e.getHighestSensitivityLabel=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return __awaiter(this,void 0,void 0,(function(){var n,i,r,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:if(n=2===e.length,1!==e.length&&2!==e.length)throw new Error("getHighestSensitivityLabel: Invalid number of parameters ("+e.length+")");return i=n?e[0]:void 0,r=n?e[1]:e[0],o=t(i),a=OfficeCore.SensitivityService.newObject(o),s=a.getHighestSensitivityLabel(r),[4,o.sync()];case 1:return c.sent(),[2,s.value]}}))}))},e.getSensitivityResultDetails=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return __awaiter(this,void 0,void 0,(function(){var n,i,r,o,a,s,c;return __generator(this,(function(l){switch(l.label){case 0:if(n=3===e.length,2!==e.length&&3!==e.length)throw new Error("getSensitivityResultDetails: Invalid number of parameters ("+e.length+")");return i=n?e[0]:void 0,r=n?e[1]:e[0],o=n?e[2]:e[1],a=t(i),s=OfficeCore.SensitivityService.newObject(a),c=s.getSensitivityResultDetails(r,o),[4,a.sync()];case 1:return l.sent(),[2,c.value]}}))}))},e.getSensitivityResultDetailsByStringErrorCode=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return __awaiter(this,void 0,void 0,(function(){var n,i,r,o,a,s,c;return __generator(this,(function(l){switch(l.label){case 0:if(n=3===e.length,2!==e.length&&3!==e.length)throw new Error("getSensitivityResultDetails: Invalid number of parameters ("+e.length+")");return i=n?e[0]:void 0,r=n?e[1]:e[0],o=n?e[2]:e[1],a=t(i),s=OfficeCore.SensitivityService.newObject(a),c=s.getSensitivityResultDetailsByStringErrorCode(r,o),[4,a.sync()];case 1:return l.sent(),[2,c.value]}}))}))},e.onLabelChangedEvent=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return __awaiter(this,void 0,void 0,(function(){var n,i,r,o,a,s,c=this;return __generator(this,(function(l){switch(l.label){case 0:if(n=2===e.length,1!==e.length&&2!==e.length)throw new Error("onLabelChangedEvent: Invalid number of parameters ("+e.length+")");return i=n?e[0]:void 0,r=n?e[1]:e[0],o=function(e){if(r){var t=e.previousLabel,n=e.newLabel,i=e.context,o=e.error;r(t,n,i,o)}return null},a=t(i),(s=OfficeCore.SensitivityService.newObject(a)).onLabelChanged.add(o),[4,s.context.sync()];case 1:return l.sent(),[2,function(){return __awaiter(c,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return s.onLabelChanged.remove(o),[4,a.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))}}(e.Sensitivity||(e.Sensitivity={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){function t(e){var t=new OfficeCore.RequestContext;return t._customData="WacPartition",t}e.launchHelpPaneByQuery=function(e){return __awaiter(this,void 0,void 0,(function(){var n,i;return __generator(this,(function(r){switch(r.label){case 0:return n=t(),i=OfficeCore.CopilotService.newObject(n),i.launchHelpPaneByQuery(e),[4,n.sync()];case 1:return r.sent(),[2]}}))}))},e.launchHelpPaneByArticleId=function(e){return __awaiter(this,void 0,void 0,(function(){var n,i;return __generator(this,(function(r){switch(r.label){case 0:return n=t(),i=OfficeCore.CopilotService.newObject(n),i.launchHelpPaneByArticleId(e),[4,n.sync()];case 1:return r.sent(),[2]}}))}))},e.launchHelpPaneByArticleIdString=function(e){return __awaiter(this,void 0,void 0,(function(){var n,i;return __generator(this,(function(r){switch(r.label){case 0:return n=t(),i=OfficeCore.CopilotService.newObject(n),i.launchHelpPaneByArticleIdString(e),[4,n.sync()];case 1:return r.sent(),[2]}}))}))},e.launchTaskPaneByAgentId=function(e){return __awaiter(this,void 0,void 0,(function(){var n,i;return __generator(this,(function(r){switch(r.label){case 0:return n=t(),i=OfficeCore.CopilotService.newObject(n),i.launchTaskPaneByAgentId(e),[4,n.sync()];case 1:return r.sent(),[2]}}))}))},e.getWindowClientWidth=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i;return __generator(this,(function(r){switch(r.label){case 0:return e=t(),n=OfficeCore.CopilotService.newObject(e),i=n.getWindowClientWidth(),[4,e.sync()];case 1:return r.sent(),[2,i.value]}}))}))}}(e.Copilot||(e.Copilot={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){function t(e){var t=new OfficeCore.RequestContext;return e&&e.controlId&&(t.requestHeaders[OfficeExtension.Constants.officeControlId]=e.controlId),t._customData="WacPartition",t}e.execute=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return __awaiter(this,void 0,void 0,(function(){var n,i,r,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:return n=e.length>=2,i=n?e[0]:void 0,r=n?e[1]:e[0],o=t(i),a=OfficeCore.PrivateApiService.newObject(o),s=a.execute(r),[4,o.sync()];case 1:return c.sent(),[2,s.value]}}))}))},e.onPrivateEvent=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return __awaiter(this,void 0,void 0,(function(){var n,i,r,o,a,s,c=this;return __generator(this,(function(l){switch(l.label){case 0:return n=e.length>=2,i=n?e[0]:void 0,r=n?e[1]:e[0],o=function(e){if(r){var t=e.messageData;r(t)}return null},a=t(i),(s=OfficeCore.PrivateApiService.newObject(a)).onOnPrivateEvent.add(o),[4,s.context.sync()];case 1:return l.sent(),[2,function(){return __awaiter(c,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return s.onOnPrivateEvent.remove(o),[4,a.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))}}(e.PrivateApi||(e.PrivateApi={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){var t;function n(e){var t=new OfficeCore.RequestContext;return t._customData="WacPartition",t}!function(e){e.copilotAgentsPage="CopilotAgentsPage"}(t=e.DefaultPageType||(e.DefaultPageType={})),function(e){e.activated="Activated",e.removed="Removed"}(e.CopilotAgentActionType||(e.CopilotAgentActionType={})),e.launchStore=function(e){return __awaiter(this,void 0,void 0,(function(){var i,r,o;return __generator(this,(function(a){switch(a.label){case 0:if(e!==t.copilotAgentsPage)throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument,null,null);return i=n(),r=OfficeCore.UnifiedStoreService.newObject(i),e!=t.copilotAgentsPage?[3,2]:(o=r.launchStoreDialogWithCopilotAgentPageShown(),[4,i.sync()]);case 1:return a.sent(),[2,o];case 2:return[2]}}))}))},e.onCopilotAgentEvent=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,r,o=this;return __generator(this,(function(a){switch(a.label){case 0:return t=function(t){if(e){var n=JSON.parse(t.messageData),i=n.actionType,r=n.titleId;e({actionType:i,titleId:r})}return null},i=n(),(r=OfficeCore.UnifiedStoreService.newObject(i)).onCopilotAgentEvent.add(t),[4,r.context.sync()];case 1:return a.sent(),[2,function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return r.onCopilotAgentEvent.remove(t),[4,i.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))}}(e.UnifiedStore||(e.UnifiedStore={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){function t(){var e=new OfficeCore.RequestContext;return e._customData="WacPartition",e}e.hide=function(e){return __awaiter(this,void 0,void 0,(function(){var n,i;return __generator(this,(function(r){switch(r.label){case 0:return n=t(),i=OfficeCore.BusinessBarService.newObject(n),i.hide(e),[4,n.sync()];case 1:return r.sent(),[2]}}))}))},e.show=function(e,n){return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(r){switch(r.label){case 0:return i=t(),OfficeCore.BusinessBarService.newObject(i).show(e,n),[4,i.sync()];case 1:return r.sent(),[2]}}))}))}}(e.BusinessBar||(e.BusinessBar={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){e.launchSimpleDialog=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,i;return __generator(this,(function(r){switch(r.label){case 0:return t=function(){var e=new OfficeCore.RequestContext;return e._customData="WacPartition",e}(),n=OfficeCore.ShowSimpleDialog.newObject(t),i=n.launchSimpleDialog(e.title,e.description,e.telemetryid,e.category,e.hasButton,e.buttonLabel,e.hasCheckbox,e.checkboxLabel),[4,t.sync()];case 1:return r.sent(),[2,i.value]}}))}))}}(e.SimpleDialog||(e.SimpleDialog={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){e.execute=function(e,t){return __awaiter(this,void 0,void 0,(function(){var n,i,r;return __generator(this,(function(o){switch(o.label){case 0:return n=function(e){var t=new OfficeCore.RequestContext;return t._customData="WacPartition",t}(),i=OfficeCore.DispatchApiService.newObject(n),r=i.execute(e,t),[4,n.sync()];case 1:return o.sent(),[2,r.value]}}))}))}}(e.DispatchApi||(e.DispatchApi={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){e.camera="camera",e.microphone="microphone",e.geolocation="geolocation"}(e.DevicePermissionType||(e.DevicePermissionType={})),function(e){e.requestPermissions=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,i;return __generator(this,(function(r){switch(r.label){case 0:return t=function(){var e=new OfficeCore.RequestContext;return e._customData="WacPartition",e}(),n=OfficeCore.DevicePermissionService.newObject(t),i=n.requestPermissions(e),[4,t.sync()];case 1:return r.sent(),[2,i.value]}}))}))}}(e.devicePermission||(e.devicePermission={}))}(Office||(Office={})),function(e){var t;!function(e){e[e.AddinInvokeResultNotInstalled=-1]="AddinInvokeResultNotInstalled",e[e.AddinInvokeResultSkillNotFound=-2]="AddinInvokeResultSkillNotFound",e[e.AddinInvokeResultLaunchFailed=-3]="AddinInvokeResultLaunchFailed",e[e.AddinInvokeResultSuccess=0]="AddinInvokeResultSuccess",e[e.AddinInvokeResultInvocationFailed=1]="AddinInvokeResultInvocationFailed",e[e.AddinInvokeResultNoResultGenerated=2]="AddinInvokeResultNoResultGenerated",e[e.AddinInvokeResultInvalidResultGenerated=3]="AddinInvokeResultInvalidResultGenerated",e[e.AddinInvokeResultNoActionFunctionMapping=4]="AddinInvokeResultNoActionFunctionMapping"}(t=e.AddinInvokeResult||(e.AddinInvokeResult={})),function(e){var n={},i=null;function r(){var e=new OfficeCore.RequestContext;return e._customData="WacPartition",e}function o(e){!function(){if(null==i){i=function(e){var t=e.actionCorrelationId,i=(e.replyMessage,e.resultCode,n[t]);return null!=i&&(i.replyMessage=e.replyMessage,i.resultCode=e.resultCode,i.replyPromiseResolver()),null};var e=r();OfficeCore.AddinSkillActionService.newObject(e).onReplyReceived.add(i),e.sync().then(null,(function(e){console.log("There was an error registering the reply event listener!")}))}}();var t={correlationId:e,replyPromise:null,replyPromiseResolver:null,replyMessage:null,resultCode:0};return t.replyPromise=new Promise((function(e){t.replyPromiseResolver=e})),n[e]=t,t}e.InvokeAction=function(e,i,a){return __awaiter(this,void 0,void 0,(function(){var s,c,l,u;return __generator(this,(function(f){switch(f.label){case 0:s=r(),c=OfficeCore.AddinSkillActionService.newObject(s),l=OSF.OUtil.Guid.generateNewGuid(),u=o(l),f.label=1;case 1:return f.trys.push([1,,4,5]),c.invokeAction(e,i,a,l),[4,s.sync()];case 2:return f.sent(),[4,u.replyPromise];case 3:return f.sent(),[3,5];case 4:return function(e){delete n[e]}(l),[7];case 5:if(u.resultCode==t.AddinInvokeResultSuccess){if("string"==typeof u.replyMessage)return[2,u.replyMessage];u.resultCode=t.AddinInvokeResultInvalidResultGenerated}switch(u.resultCode){case t.AddinInvokeResultNotInstalled:throw new OfficeExtension.Error({code:"AddinNotInstalled",message:"Add-in not installed."});case t.AddinInvokeResultSkillNotFound:throw new OfficeExtension.Error({code:"SkillNotFound",message:"Skill not found in the add-in manifest."});case t.AddinInvokeResultLaunchFailed:throw new OfficeExtension.Error({code:"LaunchFailed",message:"Add-in launch failed."});case t.AddinInvokeResultInvocationFailed:throw new OfficeExtension.Error({code:"InvocationFailed",message:"Skill invocation failed."});case t.AddinInvokeResultNoResultGenerated:throw new OfficeExtension.Error({code:"NoResultGenerated",message:"No result generated."});case t.AddinInvokeResultInvalidResultGenerated:throw new OfficeExtension.Error({code:"InvalidResultGenerated",message:"Invalid result generated."});case t.AddinInvokeResultNoActionFunctionMapping:throw new OfficeExtension.Error({code:"NoActionFunctionMapping",message:"No action function mapping."});default:throw new OfficeExtension.Error({code:"UnknownError",message:"Unknown error (code = "+u.resultCode+")."})}return[2]}}))}))}}(e.AddinSkillAction||(e.AddinSkillAction={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){e.getofficethemedataforvisualsurface=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,i;return __generator(this,(function(r){switch(r.label){case 0:return t=function(e){var t=new OfficeCore.RequestContext;return t._customData="WacPartition",t}(),n=OfficeCore.ThemeService.newObject(t),i=n.getOfficeThemeDataForVisualSurface(e),[4,t.sync()];case 1:return r.sent(),[2,JSON.parse(i.value)]}}))}))}}(e.ThemeService||(e.ThemeService={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){function t(){try{if(void 0!==OSF&&void 0!==OSF.isOfficeReactNative&&OSF.isOfficeReactNative())return!0}catch(e){}return!1}function n(){var e="web";try{void 0!==OSF&&void 0!==OSF._OfficeAppFactory&&void 0!==OSF._OfficeAppFactory.getHostInfo&&(e=OSF._OfficeAppFactory.getHostInfo().hostPlatform)}catch(e){}return e}e.isNativeStorage=function(){var e=n();return!(function(){try{if(void 0!==OSF&&void 0!==OSF._OfficeAppFactory&&void 0!==OSF._OfficeAppFactory.getHostInfo&&OSF._OfficeAppFactory.getHostInfo().flags&OSF.HostInfoFlags.SharedApp)return!0}catch(e){}return!1}()||!(t()||"win32"===e||"mac"===e&&window._useSDXSandbox))},e.isNativeApiInfomation=function(){var e=n();return!!(t()||"win32"===e||"mac"===e&&window._useSDXSandbox)},e.isNativeDialog=function(){var e=n();return!(!t()&&"win32"!==e)}}(e.ApiHelper||(e.ApiHelper={}))}(OfficeRuntime||(OfficeRuntime={})),function(e){e.ApiHelper.isNativeApiInfomation()?e.apiInformation=t:e.apiInformation=n;var t={isSetSupported:function(e,t){if("string"!=typeof e)return!1;if(null==t&&(t="0.0.0"),void 0===global.__apiSets)return!1;var n=global.__apiSets,r=Object.keys(n).map((function(e){return e.toLowerCase()})).indexOf(e.toLowerCase());if(r>-1){var o=n[Object.keys(n)[r]];try{var a=i(t),s=void 0;if((s=Array.isArray(o)?function(e,t){for(var n=0;n<e.length;n++){var r=i(e[n]);if(r.major==t)return r}return{major:0,minor:0,patch:0}}(o,a.major):i(o)).major>0){if(s.major>a.major)return!0;if(s.major==a.major&&s.minor>a.minor)return!0;if(s.major==a.major&&s.minor==a.minor&&s.patch>=a.patch)return!0}}catch(e){return!1}}return!1}},n={isSetSupported:function(e,t){try{return!!(Office&&Office.context&&Office.context.requirements)&&Office.context.requirements.isSetSupported(e,Number(t))}catch(e){return!1}}};function i(e){var t=e.split("."),n=0,i=0,r=0;if(t.length<2&&isNaN(Number(e)))throw"version format incorrect";if(n=Number(t[0]),t.length>=2&&(i=Number(t[1])),t.length>=3&&(r=Number(t[2])),isNaN(n)||isNaN(i)||isNaN(r))throw"version format incorrect";return{major:n,minor:i,patch:r}}}(OfficeRuntime||(OfficeRuntime={}));var OfficeRuntime;__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){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),r=(OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson),o=OfficeExtension.Utility.fixObjectPathIfNecessary,a=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),s=(OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags,function(e){this._dialogService=e});e.Dialog=s;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.close=function(){return this._dialogService.close(),OfficeExtension.CoreUtility.Promise.resolve()},t}(s),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.close=function(){return this._dialogService.close(),this._dialogService.context.sync()},t}(s);function u(e){return/^(\-|\+)?([0-9]+)%?$/.test(e)}function f(e){var t,n=((t={})[12002]={code:"InvalidUrl",message:"Cannot load URL, no such page or bad URL syntax."},t[12003]={code:"InvalidUrl",message:"HTTPS is required."},t[12004]={code:"Untrusted",message:"Domain is not trusted."},t[12005]={code:"InvalidUrl",message:"HTTPS is required."},t[12007]={code:"FailedToOpen",message:"Another dialog is already opened."},t);return n[e]?n[e]:{code:"Unknown",message:"An unknown error has occured with code: "+e}}e.displayWebDialog=function(t,n){return void 0===n&&(n={}),new OfficeExtension.CoreUtility.Promise((function(i,r){if(n.width&&n.height&&(!u(n.width)||!u(n.height)))throw new OfficeExtension.Error({code:"InvalidArgument",message:'Dimensions must be "number%" or number.'});var o={width:n.width?parseInt(n.width):50,height:n.height?parseInt(n.height):50,displayInIFrame:n.displayInIFrame};e.ApiHelper.isNativeDialog()?function(e,t,n,i,r){void 0===r&&(r={});var o=new OfficeExtension.ClientRequestContext,a=p.newObject(o),s=new l(a),c=a.onDialogMessage.add((function(e){switch(OfficeExtension.Utility.log("dialogMessageHandler:"+JSON.stringify(e)),e.type){case 17:e.error?n(e.error):t(s);break;case 12:r.onMessage&&r.onMessage(e.message,s);break;case 10:default:12006===e.originalErrorCode?(c&&(c.remove(),o.sync()),r.onClose&&r.onClose()):r.onRuntimeError&&(r.onRuntimeError(e.error,s),n(e.error))}return OfficeExtension.CoreUtility.Promise.resolve()}));o.sync().then((function(){return a.displayDialog(i,e),o.sync()})).catch((function(e){n(e)}))}(o,i,r,t,n):function(e,t,n,i,r){void 0===r&&(r={});var o;function a(e){"failed"===e.status?n(new OfficeExtension.Error(f(e.error.code))):((o=e.value).addEventHandler(Office.EventType.DialogMessageReceived,s),o.addEventHandler(Office.EventType.DialogEventReceived,l),t(new c(o)))}function s(e){r.onMessage&&r.onMessage(e.message,o,e.origin)}function l(e){12006===e.error?r.onClose&&r.onClose():r.onRuntimeError&&r.onRuntimeError(new OfficeExtension.Error(f(e.error)),o)}Office.context.ui.displayDialogAsync(i,e,a)}(o,i,r,t,n)}))};var d,p=function(s){function c(){return null!==s&&s.apply(this,arguments)||this}return __extends(c,s),Object.defineProperty(c.prototype,"_className",{get:function(){return"DialogService"},enumerable:!0,configurable:!0}),c.prototype.close=function(){n(this,"Close",1,[],4,0)},c.prototype.displayDialog=function(e,t){n(this,"DisplayDialog",1,[e,t],4,0)},c.prototype._handleResult=function(e){(s.prototype._handleResult.call(this,e),i(e))||o(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.DialogService,n,"Microsoft.Dialog.DialogService",!1,4)},Object.defineProperty(c.prototype,"onDialogMessage",{get:function(){return this.m_dialogMessage||(this.m_dialogMessage=new OfficeExtension.GenericEventHandlers(this.context,this,"DialogMessage",{eventType:65536,registerFunc:function(){},unregisterFunc:function(){},getTargetIdFunc:function(){return null},eventArgsTransformFunc:function(e){var t;try{var n=JSON.parse(e.message),i=n.errorCode?new OfficeExtension.Error(f(n.errorCode)):null;t={originalErrorCode:n.errorCode,type:n.type,error:i,message:n.message,origin:n.origin}}catch(e){t={originalErrorCode:null,type:17,error:new OfficeExtension.Error({code:"GenericException",message:"Unknown error"}),message:e.message}}return OfficeExtension.Utility._createPromiseFromResult(t)}})),this.m_dialogMessage},enumerable:!0,configurable:!0}),c.prototype.toJSON=function(){return r(this,{},{})},c}(OfficeExtension.ClientObject);e.DialogService=p,function(e){e[e.dialogMessageReceived=0]="dialogMessageReceived",e[e.dialogEventReceived=1]="dialogEventReceived"}(d||(d={})),function(e){e.generalException="GeneralException"}(e.DialogErrorCodes||(e.DialogErrorCodes={}))}(OfficeRuntime||(OfficeRuntime={})),function(e){!function(e){function t(e,t){try{var n=Microsoft.Office.WebExtension.FeatureGates[e];return null==n?t:"true"===n.toString().toLowerCase()}catch(e){return t}}function n(e,t){try{var n=Microsoft.Office.WebExtension.FeatureGates,i=parseInt(n[e]);return isNaN(i)?t:i}catch(e){return t}}function i(e,t){try{var n=Microsoft.Office.WebExtension.FeatureGates[e];return null==n?t:n}catch(e){return t}}e.getBooleanFeatureGate=t,e.getIntFeatureGate=n,e.getStringFeatureGate=i,e.getBooleanFeatureGateAsync=function(e,n){return Promise.resolve(t(e,n))},e.getIntFeatureGateAsync=function(e,t){return Promise.resolve(n(e,t))},e.getStringFeatureGateAsync=function(e,t){return Promise.resolve(i(e,t))}}(e.experimentation||(e.experimentation={}))}(OfficeRuntime||(OfficeRuntime={})),function(e){!function(e){var n={};function i(e){var t=e.eventName,i=e.message;n.hasOwnProperty(t)&&n[t].call(i)}e.on=function(e,r){return function(e,r){n.hasOwnProperty(e)||(n[e]=new t,function(){Office&&Office.context&&Office.context.messaging&&!Office.context.messaging.onMessage&&(Office.context.messaging.onMessage=i.bind(this))}());n[e].add(r)}(e,r),new Promise((function(e){e()}))},e.off=function(e,t){return function(e,t){n.hasOwnProperty(e)&&(t?n[e].remove(t):delete n[e])}(e,t),new Promise((function(e){e()}))},e.emit=function(e,t){return function(e,t){var n={eventName:e,message:t};Office&&Office.context&&Office.context.messaging&&Office.context.messaging.sendMessage&&Office.context.messaging.sendMessage(n)}(e,t),new Promise((function(e){e()}))}}(e.message||(e.message={}));var t=function(){function e(){this.listeners=[]}return e.prototype.add=function(e){this.listeners.push(e)},e.prototype.remove=function(e){var t=this.listeners.lastIndexOf(e);-1!==t&&this.listeners.splice(t,1)},e.prototype.call=function(e){this.listeners.forEach((function(t){return t(e)}))},e}();e.ListenerManager=t}(OfficeRuntime||(OfficeRuntime={})),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),r=(OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson),o=OfficeExtension.Utility.fixObjectPathIfNecessary,a=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),s=(OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags,"_Office_AsyncStorage_"),c=s+"|_unusedKey_",l={getItem:function(e){return p((function(t,n){return t.multiGet(n,JSON.stringify([e]))}),(function(e){var t=JSON.parse(e);return t&&t[0]&&t[0][1]?t[0][1]:null}))},setItem:function(e,t){return p((function(n,i){return n.multiSet(i,JSON.stringify([[e,t]]))}),(function(){return null}))},removeItem:function(e){return p((function(t,n){return t.multiRemove(n,JSON.stringify([e]))}),(function(){return null}))},getItems:function(e){return p((function(t,n){return t.multiGet(n,JSON.stringify(e))}),(function(t){var n=JSON.parse(t),i={};return n&&n.forEach((function(e){var t=e[0],n=e[1];return i[t]=n,n})),e&&e.forEach((function(e){i[e]&&i[e]})),i}))},setItems:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push([n,e[n]]);return p((function(e,n){return e.multiSet(n,JSON.stringify(t))}),(function(){return null}))},removeItems:function(e){return p((function(t,n){return t.multiRemove(n,JSON.stringify(e))}),(function(){return null}))},getKeys:function(){return p((function(e,t){return e.getAllKeys(t)}),(function(e){return JSON.parse(e)}))}},u={getItem:function(e){return m((function(){return f(e)}))},setItem:function(e,t){return g((function(){return d(e,t)}))},removeItem:function(e){return g((function(){return window.localStorage.removeItem(s+e)}))},getItems:function(e){return new Promise((function(t,n){var i={},r=[];try{h()}catch(e){n(e)}e.forEach((function(e){try{var t=f(e);i[e]=t||null}catch(e){r.push(e)}})),r.length>0?n(new Error("Unknown error.")):t(i)}))},setItems:function(e){return v(e,(function(t){return d(t,e[t])}))},removeItems:function(e){return v(e,(function(e){return window.localStorage.removeItem(s+e)}))},getKeys:function(){return m((function(){return Object.keys(window.localStorage).filter((function(e){return 0===e.indexOf(s)})).map((function(e){return e.substr(s.length)}))}))}};function f(e){return window.localStorage.getItem(s+e)}function d(e,t){window.localStorage.setItem(s+e,t)}function p(e,t){return new OfficeExtension.CoreUtility.Promise((function(n,i){var r=y.getInstance(),o=r.setCallBack((function(e,r){if(r)i(r);else{var o=t(e);n(o)}}));r.ctx.sync().then((function(){var t=r.getPersistentKvStorageService();return e(t,o),r.ctx.sync()})).catch((function(e){i(e)}))}))}function h(){d(c,null),window.localStorage.removeItem(c)}function g(e,t){return void 0===t&&(t=function(){}),new Promise((function(n,i){try{h(),e(),t(null),n()}catch(e){t(e),i(e)}}))}function m(e,t){return void 0===t&&(t=function(){}),new Promise((function(n,i){try{h();var r=e();t(null,r),n(r)}catch(e){t(e,null),i(e)}}))}function v(e,t,n){return void 0===n&&(n=function(){}),new Promise((function(i,r){var o=[];try{h()}catch(e){o.push(e)}for(var a in e)if(e.hasOwnProperty(a)||Array.isArray(e))try{Array.isArray(e)?t(e[a]):t(a)}catch(e){o.push(e)}n(o),o.length>0?r(o):i()}))}e.ApiHelper.isNativeStorage()?e.storage=l:e.storage=u;var y=function(){function e(){var e=this;this._invokeId=0,this._callDict={},this.ctx=new OfficeExtension.ClientRequestContext,this._perkvstorService=O.newObject(this.ctx),this._eventResult=this._perkvstorService.onPersistentStorageMessage.add((function(t){OfficeExtension.Utility.log("persistentKvStoragegMessageHandler:"+JSON.stringify(t));var n=e._callDict[t.invokeId];n&&(n(t.message,t.error),delete e._callDict[t.invokeId])}))}return e.getInstance=function(){return void 0===e.instance?e.instance=new e:e.instance._perkvstorService=O.newObject(e.instance.ctx),e.instance},e.prototype.getPersistentKvStorageService=function(){return this._perkvstorService},e.prototype.getCallBack=function(e){return this._callDict[e]},e.prototype.setCallBack=function(e){var t=this._invokeId;return this._callDict[this._invokeId++]=e,t},e}(),O=function(s){function c(){return null!==s&&s.apply(this,arguments)||this}return __extends(c,s),Object.defineProperty(c.prototype,"_className",{get:function(){return"PersistentKvStorageService"},enumerable:!0,configurable:!0}),c.prototype.clear=function(e){n(this,"Clear",1,[e],4,0)},c.prototype.getAllKeys=function(e){n(this,"GetAllKeys",1,[e],4,0)},c.prototype.multiGet=function(e,t){n(this,"MultiGet",1,[e,t],4,0)},c.prototype.multiRemove=function(e,t){n(this,"MultiRemove",1,[e,t],4,0)},c.prototype.multiSet=function(e,t){n(this,"MultiSet",1,[e,t],4,0)},c.prototype._handleResult=function(e){(s.prototype._handleResult.call(this,e),i(e))||o(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.PersistentKvStorageService,n,"Microsoft.PersistentKvStorage.PersistentKvStorageService",!1,4)},Object.defineProperty(c.prototype,"onPersistentStorageMessage",{get:function(){return this.m_persistentStorageMessage||(this.m_persistentStorageMessage=new OfficeExtension.GenericEventHandlers(this.context,this,"PersistentStorageMessage",{eventType:65537,registerFunc:function(){},unregisterFunc:function(){},getTargetIdFunc:function(){return null},eventArgsTransformFunc:function(e){var t,n,i,r;try{var o=JSON.parse(e.message),a=parseInt(o.errorCode),s=0!=a?new OfficeExtension.Error((n=a,(i={})[16389]={code:"GenericException",message:"Unknown error."},i[65535]={code:"Unexcepted",message:"Catastrophic failure."},i[14]={code:"OutOfMemory",message:"Ran out of memory."},i[87]={code:"InvalidArg",message:"One or more arguments are invalid."},i[16385]={code:"NotImplemented",message:"Not implemented."},i[6]={code:"BadHandle",message:"File Handle is not Set."},i[5]={code:"AccessDenied",message:"Can't read the Storage File."},(r=i)[n]?r[n]:{code:"Unknown",message:"An unknown error has occured"})):null;t={invokeId:o.invokeId,message:o.message,error:s}}catch(e){t={invokeId:-1,message:e.message,error:new OfficeExtension.Error({code:"GenericException",message:"Unknown error"})}}return OfficeExtension.Utility._createPromiseFromResult(t)}})),this.m_persistentStorageMessage},enumerable:!0,configurable:!0}),c.prototype.toJSON=function(){return r(this,{},{})},c}(OfficeExtension.ClientObject);e.PersistentKvStorageService=O,function(e){e.generalException="GeneralException"}(e.ErrorCodes||(e.ErrorCodes={}))}(OfficeRuntime||(OfficeRuntime={}));var MailboxFunctionMappings={};!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):new n((function(t){t(e.value)})).then(a,s)}c((i=i.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),a=0;function s(){return i(this,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:return(e=new o.RequestContext).mailbox.onSdxControlReadyResponse(),[4,e.sync()];case 1:return t.sent(),console.log("SDX Control is ready!"),[2]}}))}))}t.SendOmReadyMessageToHost=s;let c=new function(){let e={};this.addApiContext=function(t,n,i,r,o,a,s){e[n]={dispid:t,invocationId:n,asyncContext:i||null,callback:r||null,format:o||null,customResponse:a||null,isLoadedItem:s||null}},this.getApiContext=function(t){return e[t]},this.removeApiContext=function(t){delete e[t]}};function l(e,t,n,s,l,u,f){return i(this,void 0,void 0,(function(){var i,d;return r(this,(function(r){return i=++a,c.addApiContext(e,i,t,n,s,l,f),(d=new o.RequestContext).mailbox.executeApi(e,i,u),d.sync(),console.log("MailboxHostExecuteApi invoked!"),[2]}))}))}t.MailboxHostExecuteApi=l;const u=1,f=2,d=3,p=4,h=5,g=6,m=7,v=8,y=9,O=10,b=11,S=12,_=13,A=17;let C=function(){function e(e,t,n){if(this.launchEventType=e,e!==m&&e!==v||null==t)if(e===b&&null!=t)this.type=Microsoft.Office.WebExtension.EventType.InfobarClicked,this.infobarDetails=JSON.parse(t);else if(e===d||e===p){this.type=Microsoft.Office.WebExtension.EventType.AttachmentsChanged;let e=JSON.parse(t);this.attachmentStatus=e.attachmentStatus,this.attachmentDetails=Microsoft.Office.WebExtension.OutlookBase.CreateAttachmentDetails(e.attachmentDetails)}else if(e===y){this.type=Microsoft.Office.WebExtension.EventType.AppointmentTimeChanged;try{let e=JSON.parse(t);this.start=new Date(e.start).toISOString(),this.end=new Date(e.end).toISOString()}catch(e){console.log("Exception creating AppointmentTimeChanged data : "+e.message),this.start=null,this.end=null}}else if(e==O){this.type=Microsoft.Office.WebExtension.EventType.RecurrenceChanged,this.recurrence=null;try{let e=JSON.parse(t);if(null!=e.recurrence){let t=JSON.parse(e.recurrence);this.recurrence=Microsoft.Office.WebExtension.OutlookBase.SeriesTimeJsonConverter(t)}}catch(e){console.log("Exception creating RecurrenceChanged data : "+e.message)}}else if(e==A)this.type=Microsoft.Office.WebExtension.EventType.SensitivityLabelChanged;else if(e==u)this.type=Microsoft.Office.WebExtension.EventType.OnNewMessageCompose;else if(e==S)this.type=Microsoft.Office.WebExtension.EventType.OnMessageCompose;else if(e==f)this.type=Microsoft.Office.WebExtension.EventType.OnNewAppointmentOrganizer;else if(e==_)this.type=Microsoft.Office.WebExtension.EventType.OnAppointmentOrganizer;else if(n.isSpamReporting)try{let e=JSON.parse(t);this.type="SpamReporting",null!=e.options&&(this.options=e.options),null!=e.freeText&&(this.freeText=e.freeText)}catch(e){console.log("Exception creating SpamReporting data : "+e.message)}else this.type="Unknown";else this.type=Microsoft.Office.WebExtension.EventType.RecipientsChanged,this.changedRecipientFields=JSON.parse(t)}return e.prototype.getEventType=function(){return this.launchEventType},e.prototype.completed=function(e){if(console.log("LaunchEventObj.completed was invoked: "+this.launchEventType),(this.launchEventType==h||this.launchEventType==g||"SpamReporting"==this.type)&&null!=e)try{e.contextData=JSON.stringify(e.contextData)}catch(t){console.log("Exception stringifying contextData: "+t.message),e.contextData=void 0}MailboxFunctionMappings.SendEventCompletedMessageToHost(e,this.launchEventType,this.type)},e}();function E(e){return i(this,void 0,void 0,(function(){return r(this,(function(t){var n=JSON.parse(e),i=n[0],r=n[1],o=(parseInt(n[2]),parseInt(n[3])),a="";if(n.length>4)try{a=JSON.parse(n[4])}catch(e){console.log("Exception parsing additionalData.")}return Office.actions._association.mappings[i.toUpperCase()](function(e,t,n){return new C(e,t,n)}(o,r,a)),console.log("RunLaunchEventHandlerFunctionWithData was invoked with funcName = "+i),[2]}))}))}function I(e,t,n){return i(this,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:i=new o.RequestContext;var s={data:e,args:{launchEventType:t,invocationId:a},type:n};return i.mailbox.OnLaunchEventCompletedWithData(JSON.stringify(s)),[4,i.sync()];case 1:return r.sent(),console.log("Event completed message sent to host!"),[2]}}))}))}function w(e,t){return i(this,void 0,void 0,(function(){return r(this,(function(t){let n=JSON.parse(e);if(n.length>=2){let e=JSON.parse(n[0]),t=parseInt(n[1]);null!=c.getApiContext(t)?(MailboxFunctionMappings.OnLaunchEventCallComplete(e,c.getApiContext(t)),c.removeApiContext(t)):console.log("Unexpected failure in MailboxApiCallComplete : Missing response callback object. Did we remove it prematurely, or was it never inserted in the maanger?")}else console.log("Unexpected failure in MailboxApiCallComplete : Array returned after parsing hostData has an unexpected length/size. Did the client omit some data? hostData = "+data);return[2]}))}))}t.RunLaunchEventHandlerFunctionWithData=E,t.SendEventCompletedMessageToHost=I,t.MailboxApiCallComplete=w,Office&&(console.log("Platform Bundle - Office exists!"),Office.actions&&(console.log("Platform Bundle - Office.actions exists!"),Office.actions.associate&&(console.log("Platform Bundle - Office.actions.associate exists!"),Office.actions.associate("INVOKE_MAILBOX_CREATE_OM",(function(e){console.log("InvokeMailboxCreateOM was invoked!"+e),MailboxCreateOM(e)})),Office.actions.associate("MAILBOX_API_CALL_COMPLETE",w),Office.actions.associate("RUN_LAUNCH_EVENT_HANDLER_FUNCTION_WITH_DATA",E)))),MailboxFunctionMappings.SendOmReadyMessageToHost=s,MailboxFunctionMappings.MailboxHostExecuteApi=l,MailboxFunctionMappings.SendEventCompletedMessageToHost=I},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=function(e,t){return(i=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])})(e,t)},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});OfficeExtension.BatchApiHelper.createPropertyObject,OfficeExtension.BatchApiHelper.createMethodObject,OfficeExtension.BatchApiHelper.createIndexerObject;var o=OfficeExtension.BatchApiHelper.createRootServiceObject,a=(OfficeExtension.BatchApiHelper.createTopLevelServiceObject,OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod),s=(OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined),c=(OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson),l=OfficeExtension.Utility.fixObjectPathIfNecessary,u=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),f=(OfficeExtension.Utility.setMockData,function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"_className",{get:function(){return"MailBox"},enumerable:!0,configurable:!0}),t.prototype.executeApi=function(e,t,n){a(this,"ExecuteApi",0,[e,t,n],0,0)},t.prototype.OnLaunchEventCompletedWithData=function(e){a(this,"OnLaunchEventCompletedWithData",0,[e],0,0)},t.prototype.onSdxControlReadyResponse=function(){a(this,"OnSdxControlReadyResponse",0,[],0,0)},t.prototype._handleResult=function(t){(e.prototype._handleResult.call(this,t),s(t))||l(this,t)},t.prototype._handleRetrieveResult=function(t,n){e.prototype._handleRetrieveResult.call(this,t,n),u(this,t,n)},t.prototype.toJSON=function(){return c(this,{},{})},t}(OfficeExtension.ClientObject));t.MailBox=f;var d=function(e){function t(){var t=e.call(this)||this;return t.m_mailbox=o(f,t),t}return r(t,e),Object.defineProperty(t.prototype,"mailbox",{get:function(){return this.m_mailbox},enumerable:!0,configurable:!0}),t}(OfficeExtension.ClientRequestContext);t.RequestContext=d,function(e){e.generalException="GeneralException"}(t.ErrorCodes||(t.ErrorCodes={}))}]),console.log("Outlook Batch JS loaded!"),(
/*
    Your use of this file is governed by the license terms for the Microsoft Office JavaScript (Office.js) API library: https://github.com/OfficeDev/office-js/blob/release/LICENSE.md

    This file also contains the following Promise implementation (with a few small modifications):
        * @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
*/
OSF="object"==typeof OSF?OSF:{}).DDA=OSF.DDA||{},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,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeActivityLimitReached:5102,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,ooeAccessDenied:13990,ooeGeneralException:13991}}}(),(Microsoft="object"==typeof Microsoft?Microsoft:{}).Office=Microsoft.Office||{},Microsoft.Office.WebExtension=Microsoft.Office.WebExtension||{},Microsoft.Office.WebExtension.MailboxEnums=Microsoft.Office.WebExtension.MailboxEnums||{},Microsoft.Office.WebExtension.AsyncResultStatus=Microsoft.Office.WebExtension.AsyncResultStatus||{Succeeded:"succeeded",Failed:"failed"},Microsoft.Office.WebExtension.EventType=Microsoft.Office.WebExtension.EventType||{},Microsoft.Office.WebExtension.EventType.AttachmentsChanged="olkAttachmentsChanged",Microsoft.Office.WebExtension.EventType.RecipientsChanged="olkRecipientsChanged",Microsoft.Office.WebExtension.EventType.AppointmentTimeChanged="olkAppointmentTimeChanged",Microsoft.Office.WebExtension.EventType.RecurrenceChanged="olkRecurrenceChanged",Microsoft.Office.WebExtension.EventType.InfobarClicked="olkInfobarClicked",Microsoft.Office.WebExtension.EventType.SensitivityLabelChanged="olkSensitivityLabelChanged",(OSF="object"==typeof OSF?OSF:{}).InitializationHelper=OSF.InitializationHelper||{},OSF.DDA=OSF.DDA||{},OSF.DDA.AsyncResultEnum=OSF.DDA.AsyncResultEnum||{},OSF.DDA.AsyncResultEnum.ErrorCode=OSF.DDA.AsyncResultEnum.ErrorCode||{Success:0,Failed:1},OSF.DDA.AsyncResultEnum.Properties=OSF.DDA.AsyncResultEnum.Properties||{Context:"Context",Value:"Value",Status:"Status",Error:"Error"},OSF.DDA.AsyncResultEnum.ErrorProperties=OSF.DDA.AsyncResultEnum.ErrorProperties||{Name:"Name",Message:"Message",Code:"Code"},OSF.OUtil=OSF.OUtil||{},OSF.OUtil.defineNondefaultProperty=OSF.OUtil.defineNondefaultProperty||function(e,t,n,i){for(var r in n=n||{},i){var o=i[r];null==n[o]&&(n[o]=!0)}return Object.defineProperty(e,t,n),e},OSF.OUtil.defineNondefaultProperties=OSF.OUtil.defineNondefaultProperties||function(e,t,n){for(var i in t=t||{})OSF.OUtil.defineNondefaultProperty(e,i,t[i],n);return e},OSF.OUtil.defineEnumerableProperties=OSF.OUtil.defineEnumerableProperties||function(e,t){return OSF.OUtil.defineNondefaultProperties(e,t,["enumerable"])},OSF.OUtil.defineEnumerableProperty=OSF.OUtil.defineEnumerableProperty||function(e,t,n){return OSF.OUtil.defineNondefaultProperty(e,t,n,["enumerable"])},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.Error=function(e,t,n){OSF.OUtil.defineEnumerableProperties(this,{name:{value:e},message:{value:t},code:{value:n}})},(Office="object"==typeof Office?Office:{}).context=Office.context||{},Office.context.roamingSettings=Office.context.roamingSettings||{};var MailboxCreateOMHelper=function(e,t,n){var i="object"==typeof i?i:{};i.OutlookAppOm=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=1)}([function(e,t){e.exports=OSF},function(e,t,n){"use strict";function i(e){return null==e}n.r(t);var r,o=function(){function e(){}return e.success=0,e.noResponseDictionary=-900,e.noErrorCodeForStandardInvokeMethod=-901,e.genericProxyError=-902,e.genericLegacyApiError=-903,e.genericUnknownError=-904,e}(),a=function(e){switch(e){case 402:case 401:case 400:case 403:return!0;default:return!1}};!function(e){e[e.noError=0]="noError",e[e.errorInRequest=-1]="errorInRequest",e[e.errorHandlingRequest=-2]="errorHandlingRequest",e[e.errorInResponse=-3]="errorInResponse",e[e.errorHandlingResponse=-4]="errorHandlingResponse",e[e.errorHandlingRequestAccessDenied=-5]="errorHandlingRequestAccessDenied",e[e.errorHandlingMethodCallTimedout=-6]="errorHandlingMethodCallTimedout"}(r||(r={}));var s,c=!1,l=new Map;function u(e){return d(),l.get(e)}function f(e){return d(),Boolean(l.get(e))}function d(){if(!c){l.clear();var e=ea("nativeFlights");null!=e&&(Object.keys(e).forEach((function(t){l.set(t,e[t])})),c=!0)}}var p=function(){return s},h=function(e){return(s=new g).parameterBlobSupported=!0,s},g=function(){function e(){this._parameterBlobSupported=!0,this._itemNumber=0,this._itemNumberForLoadedItem=0,s=this}return Object.defineProperty(e.prototype,"parameterBlobSupported",{set:function(e){this._parameterBlobSupported=e},enumerable:!0,configurable:!0}),e.prototype.setActionsDefinition=function(e){this._actionsDefinition=e},e.prototype.setCurrentItemNumber=function(e){e>0&&(this._itemNumber=e)},Object.defineProperty(e.prototype,"itemNumber",{get:function(){return this._itemNumber},enumerable:!0,configurable:!0}),e.prototype.setItemNumberForLoadedItem=function(e){e>0&&(this._itemNumberForLoadedItem=e)},Object.defineProperty(e.prototype,"itemNumberForLoadedItem",{get:function(){return this._itemNumberForLoadedItem},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"actionsDefinition",{get:function(){return this._actionsDefinition},enumerable:!0,configurable:!0}),e.prototype.updateOutlookExecuteParameters=function(e,t,n){var i=e;if(this._parameterBlobSupported){if(this._itemNumber>0&&(f("MultiSelectV2")&&n&&this._itemNumber!=this._itemNumberForLoadedItem?(t.itemNumber=this._itemNumberForLoadedItem.toString(),t.isNoUI=!0):t.itemNumber=this._itemNumber.toString()),null!=this._actionsDefinition&&(t.actions=this.actionsDefinition),0===Object.keys(t).length)return i;null==i&&(i=[]),i.push(JSON.stringify(t))}return i},e}(),m=n(0),v=function(e,t){if(0==e.length)return null;var n=S(e);_(e);var i=n>0,r=0;return p()&&(r=p().itemNumber),A(e,i&&r>0&&n>r&&!t)};void 0!==MailboxFunctionMappings&&(MailboxFunctionMappings.OnLaunchEventCallComplete=function(e,t){var n=null;if(e.length>0){var i=S(e);_(e);var o=i>0,a=0;p()&&(a=p().itemNumber);var s=o&&a>0&&i>a&&!t.isLoadedItem;n=195===t.dispid||209===t.dispid||205===t.dispid?I(e):A(e,s)}null!=t.callback&&function(e,t,n){if("object"==typeof t&&null!==t){var i=void 0,o=!0;if(void 0!==t.wasSuccessful&&(o=t.wasSuccessful),void 0!==t.error||void 0!==t.errorCode||void 0!==t.data)if(t.error){var a=t.errorCode;i=x(void 0,w.DDA.AsyncResultEnum.ErrorCode.Failed,a,n.asyncContext,t.errorMessage,t.errorName)}else i=x(n.format?n.format(t.data):t.data,w.DDA.AsyncResultEnum.ErrorCode.Success,0,n.asyncContext);n.customResponse&&(i=n.customResponse(t,n.asyncContext,e)),i||e===r.noError||(i=x(void 0,w.DDA.AsyncResultEnum.ErrorCode.Failed,9002,n.asyncContext)),i||e!==r.noError||!1!==o||(i=x(void 0,w.DDA.AsyncResultEnum.ErrorCode.Failed,w.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported,n.asyncContext)),n.callback(i)}}(0,n,t)});var y=function(e,t,n){var i=null,r={};switch(e){case 12:r.isRest=t.isRest;break;case 4:i=[JSON.stringify(t.customProperties)];break;case 5:i=new Array(t.body);break;case 8:case 9:case 179:case 180:i=new Array(t.itemId);break;case 7:case 177:i=new Array(O(t.requiredAttendees),O(t.optionalAttendees),t.start,t.end,t.location,O(t.resources),t.subject,t.body);break;case 44:case 178:i=[O(t.toRecipients),O(t.ccRecipients),O(t.bccRecipients),t.subject,t.htmlBody,t.attachments];break;case 43:i=[t.ewsIdOrEmail];break;case 45:i=[t.module,t.queryString];break;case 40:i=[t.extensionId,t.consentState];break;case 11:case 10:case 184:case 183:i=[t.htmlBody];break;case 31:case 30:case 182:case 181:i=[t.htmlBody,t.attachments];break;case 23:case 13:case 38:case 29:i=[t.data,t.coercionType];break;case 37:case 28:i=[t.coercionType];break;case 17:i=[t.subject];break;case 15:i=[t.recipientField];break;case 22:case 21:i=[t.recipientField,b(t.recipientArray)];break;case 19:i=[t.itemId,t.name];break;case 16:i=[t.uri,t.name,t.isInline];break;case 148:i=[t.base64String,t.name,t.isInline];break;case 20:i=[t.attachmentIndex];break;case 25:i=[t.TimeProperty,t.time];break;case 24:i=[t.TimeProperty];break;case 27:i=[t.location];break;case 33:case 35:i=[t.key,t.type,t.persistent,t.message,t.icon],p().setActionsDefinition(t.actions);break;case 36:i=[t.key];break;default:r=t||{}}return 1!==e&&(i=p().updateOutlookExecuteParameters(i,r,n)),i},O=function(e){return null!=e?e.join(";"):""},b=function(e){var t=[];if(null==e)return t;for(var n=0;n<e.length;n++){var i=[e[n].address,e[n].name];t.push(i)}return t},S=function(e){var t=0;if(e.length>2){var n=JSON.parse(e[2]);n&&"object"==typeof n&&(t=n.itemNumber)}return t},_=function(e){if(e.length>2){var t=JSON.parse(e[2]);t&&"object"==typeof t&&t.itemNumberForLoadedItem&&p().setItemNumberForLoadedItem(t.itemNumberForLoadedItem)}},A=function(e,t){var n=null,i=JSON.parse(e[0]);if("number"==typeof i)n=E(e,t);else{if(!i||"object"!=typeof i)throw new Error("Return data type from host must be Object or Number");n=C(e,t)}return n},C=function(e,t){var n=JSON.parse(e[0]);if(t)n.error=!0,n.errorCode=9030;else if(e.length>1&&0!==e[1]){if(n.error=!0,n.errorCode=e[1],e.length>2){var i=JSON.parse(e[2]);n.diagnostics=i.Diagnostics}e.length>=5&&(n.errorMessage=e[3],n.errorName=e[4])}else n.error=!1;return n},E=function(e,t){var n={error:!0};return n.errorCode=e[0],n},I=function(e){var t={};return 0!==parseInt(e[0])?E(e,!1):(t.error=!1,t.wasSuccessful=!0,t.data=e[1],t)};var w=n(0);function P(e,t,n,i,r,o,a){var s=y(e,i,a);MailboxFunctionMappings.MailboxHostExecuteApi(e,t,n,r,o,s,a)}function x(e,t,n,i,r,o){var a,s={};if(s[w.DDA.AsyncResultEnum.Properties.Value]=e,s[w.DDA.AsyncResultEnum.Properties.Context]=i,w.DDA.AsyncResultEnum.ErrorCode.Success!==t){a={};var c;c=w.DDA.ErrorCodeManager.getErrorArgs(n),a[w.DDA.AsyncResultEnum.ErrorProperties.Name]=o||c.name,a[w.DDA.AsyncResultEnum.ErrorProperties.Message]=r||c.message,a[w.DDA.AsyncResultEnum.ErrorProperties.Code]=n}return new w.DDA.AsyncResult(s,a)}var T=function(e,t,n,i){if(w.AppName.OutlookWebApp!==na()&&a(e))n(r.errorHandlingRequest,null);else{var o=performance&&performance.now(),s=function(t,i){R(t,i,e,o),n&&n(t,i)};if(w.AppName.OutlookWebApp===na()){var c={ApiParams:t,MethodData:f("MultiSelectV2")?{ControlId:w._OfficeAppFactory.getId(),DispatchId:e,isLoadedItem:i}:{ControlId:w._OfficeAppFactory.getId(),DispatchId:e}};1===e?w._OfficeAppFactory.getClientEndPoint().invoke("GetInitialData",s,c):w._OfficeAppFactory.getClientEndPoint().invoke("ExecuteMethod",s,c)}else!function(e,t,n,i){var r=y(e,t,i);m.ClientHostController.execute(e,r,(function(e,t){var r=e.toArray(),o=v(r,i);null!=n&&n(t,o)}))}(e,t,s,i)}},R=function(e,t,n,r){if(w.AppTelemetry){var a=function(e,t){if(t){if("error"in t)return t.error?"errorCode"in t?t.errorCode:o.noErrorCodeForStandardInvokeMethod:o.success;if("wasProxySuccessful"in t)return t.wasProxySuccessful?o.success:o.genericProxyError;if("wasSuccessful"in t)return t.wasSuccessful?o.success:o.genericLegacyApiError}return i(e)?o.genericUnknownError:e}(e,t),s=performance&&performance.now();w.AppTelemetry.onMethodDone(n,null,Math.round(s-r),a)}},F=function(){var e=ea("permissionLevel");return i(e)?-1:e};function k(e,t){var n=new Error(e);if(n.message=e||"",t)for(var i in t)n[i]=t[i];return n}function N(e,t){var n="Sys.ArgumentException: "+(t||"Value does not fall within the expected range.");return e&&(n+="\n"+"Parameter name: {0}".replace("{0}",e)),k(n,{name:"Sys.ArgumentException",paramName:e})}function M(e,t){var n="Sys.ArgumentNullException: "+(t||"Value cannot be null.");return e&&(n+="\n"+"Parameter name: {0}".replace("{0}",e)),k(n,{name:"Sys.ArgumentNullException",paramName:e})}function D(e,t,n){var i="Sys.ArgumentOutOfRangeException: "+(n||"Specified argument was out of the range of valid values.");return e&&(i+="\n"+"Parameter name: {0}".replace("{0}",e)),null!=t&&(i+="\n"+"Actual value was {0}.".replace("{0}",t)),k(i,{name:"Sys.ArgumentOutOfRangeException",paramName:e,actualValue:t})}function j(e,t,n,i){var r="Sys.ArgumentTypeException: ";return r+=i||(t&&n?"Object of type '{0}' cannot be converted to type '{1}'.".replace("{0}",t.getName?t.getName():t).replace("{1}",n.getName?n.getName():n):"Object cannot be converted to the required type."),e&&(r+="\n"+"Parameter name: {0}".replace("{0}",e)),k(r,{name:"Sys.ArgumentTypeException",paramName:e,actualType:t,expectedType:n})}var U;window;function H(e){return U[e]}var L;function B(e,t){if(-1==F())throw function(e){return k("Invalid operation ({0}) when Office.context.mailbox.item is null.".replace("{0}",e))}(t);if(F()<e)throw k(H("l_ElevatedPermissionNeededForMethod_Text").replace("{0}",t))}function W(e,t,n){var i={};if(n&&(i=function(e){var t={};if(1===e.length||2===e.length)return"function"!=typeof e[0]||(t.callback=e[0],2===e.length&&(t.asyncContext=e[1])),t;return t}(e)).callback)return i;if(1===e.length)if("function"==typeof e[0])i.callback=e[0];else{if("object"!=typeof e[0])throw j();i.options=e[0]}else if(2===e.length){if("object"!=typeof e[0])throw N("options");if("function"!=typeof e[1])throw N("callback");i.callback=e[1],i.options=e[0]}else if(0!==e.length)throw k("Sys.ParameterCountException: "+(H("l_ParametersNotAsExpected_Text")||"Parameter count mismatch."),{name:"Sys.ParameterCountException"});if(t&&!i.callback)throw M("callback");return i.options&&i.options.asyncContext&&(i.asyncContext=i.options.asyncContext),i}!function(e){e[e.to=0]="to",e[e.cc=1]="cc",e[e.bcc=2]="bcc",e[e.requiredAttendees=0]="requiredAttendees",e[e.optionalAttendees=1]="optionalAttendees"}(L||(L={}));var q=571,J=32768,V=2048;function G(e,t,n,i){if(e<t||e>n)throw D(String(i))}var z,Q,K={EntityType:{MeetingSuggestion:"meetingSuggestion",TaskSuggestion:"taskSuggestion",Address:"address",EmailAddress:"emailAddress",Url:"url",PhoneNumber:"phoneNumber",Contact:"contact",FlightReservations:"flightReservations",ParcelDeliveries:"parcelDeliveries"},ItemType:{Message:"message",Appointment:"appointment"},ResponseType:{None:"none",Organizer:"organizer",Tentative:"tentative",Accepted:"accepted",Declined:"declined"},RecipientType:{Other:"other",DistributionList:"distributionList",User:"user",ExternalUser:"externalUser"},AttachmentType:{File:"file",Item:"item",Cloud:"cloud",Base64:"base64"},AttachmentStatus:{Added:"added",Removed:"removed"},AttachmentContentFormat:{Base64:"base64",Url:"url",Eml:"eml",ICalendar:"iCalendar"},BodyType:{Text:"text",Html:"html"},ItemNotificationMessageType:{ProgressIndicator:"progressIndicator",InformationalMessage:"informationalMessage",ErrorMessage:"errorMessage",InsightMessage:"insightMessage"},Folder:{Inbox:"inbox",Junk:"junk",DeletedItems:"deletedItems"},ComposeType:{Forward:"forward",NewMail:"newMail",Reply:"reply"}},X={Text:"text",Html:"html"};function Y(e){if(null==e)throw M(e);if(e!==K.RestVersion.v1_0&&e!==K.RestVersion.v2_0&&e!==K.RestVersion.Beta)throw N(e)}function $(e,t){if(null==e)throw M(e);return Y(t),e.replace(new RegExp("[/]","g"),"-").replace(new RegExp("[+]","g"),"_")}function Z(e,t){if(null==e)throw M(e);return Y(t),e.replace(new RegExp("[-]","g"),"/").replace(new RegExp("[_]","g"),"+")}function ee(e,t){if(!Array.isArray(e))throw j("name");G(e.length,0,100,"{0}.length".replace("{0}",t))}function te(e,t){for(var n=e,i=[],r=0;r<n.length;r++)if("object"==typeof n[r]){if(ne(n[r]),i[r]=n[r].emailAddress,"string"!=typeof i[r])throw N("{0}[{1}]".replace(t,String(r)))}else{if("string"!=typeof n[r])throw N("{0}[{1}]".replace(t,String(r)));i[r]=n[r]}return i}function ne(e){if(!i(e.displayName)&&"string"==typeof e.displayName&&e.displayName.length>255)throw D("displayName");if(!i(e.emailAddress)&&"string"==typeof e.emailAddress&&e.emailAddress.length>571)throw D("emailAddress");if(!i(e.appointmentResponse)&&"string"!=typeof e.appointmentResponse)throw D("appointmentResponse");if(!i(e.recipientType)&&"string"!=typeof e.recipientType)throw D("recipientType")}function ie(e){if("string"!=typeof e)throw j("itemId");!function(e){if(i(e)||""===e)throw M("itemId")}(e)}function re(e){return ea("isRestIdSupported")?$(e,K.RestVersion.v1_0):Z(e,K.RestVersion.v1_0)}K.UserProfileType={Office365:"office365",OutlookCom:"outlookCom",Enterprise:"enterprise"},K.RestVersion={v1_0:"v1.0",v2_0:"v2.0",Beta:"beta"},K.ModuleType={Addins:"addins"},K.ActionType={ShowTaskPane:"showTaskPane",ExecuteFunction:"executeFunction"},K.SendModeOverride={PromptUser:"promptUser"},K.Days={Mon:"mon",Tue:"tue",Wed:"wed",Thu:"thu",Fri:"fri",Sat:"sat",Sun:"sun",Weekday:"weekday",WeekendDay:"weekendDay",Day:"day"},K.WeekNumber={First:"first",Second:"second",Third:"third",Fourth:"fourth",Last:"last"},K.RecurrenceType={Daily:"daily",Weekday:"weekday",Weekly:"weekly",Monthly:"monthly",Yearly:"yearly"},K.Month={Jan:"jan",Feb:"feb",Mar:"mar",Apr:"apr",May:"may",Jun:"jun",Jul:"jul",Aug:"aug",Sep:"sep",Oct:"oct",Nov:"nov",Dec:"dec"},K.DelegatePermissions={Read:1,Write:2,DeleteOwn:4,DeleteAll:8,EditOwn:16,EditAll:32},K.TimeZone={AfghanistanStandardTime:"Afghanistan Standard Time",AlaskanStandardTime:"Alaskan Standard Time",AleutianStandardTime:"Aleutian Standard Time",AltaiStandardTime:"Altai Standard Time",ArabStandardTime:"Arab Standard Time",ArabianStandardTime:"Arabian Standard Time",ArabicStandardTime:"Arabic Standard Time",ArgentinaStandardTime:"Argentina Standard Time",AstrakhanStandardTime:"Astrakhan Standard Time",AtlanticStandardTime:"Atlantic Standard Time",AUSCentralStandardTime:"AUS Central Standard Time",AusCentralWStandardTime:"Aus Central W. Standard Time",AUSEasternStandardTime:"AUS Eastern Standard Time",AzerbaijanStandardTime:"Azerbaijan Standard Time",AzoresStandardTime:"Azores Standard Time",BahiaStandardTime:"Bahia Standard Time",BangladeshStandardTime:"Bangladesh Standard Time",BelarusStandardTime:"Belarus Standard Time",BougainvilleStandardTime:"Bougainville Standard Time",CanadaCentralStandardTime:"Canada Central Standard Time",CapeVerdeStandardTime:"Cape Verde Standard Time",CaucasusStandardTime:"Caucasus Standard Time",CenAustraliaStandardTime:"Cen. Australia Standard Time",CentralAmericaStandardTime:"Central America Standard Time",CentralAsiaStandardTime:"Central Asia Standard Time",CentralBrazilianStandardTime:"Central Brazilian Standard Time",CentralEuropeStandardTime:"Central Europe Standard Time",CentralEuropeanStandardTime:"Central European Standard Time",CentralPacificStandardTime:"Central Pacific Standard Time",CentralStandardTime:"Central Standard Time",CentralStandardTime_Mexico:"Central Standard Time (Mexico)",ChathamIslandsStandardTime:"Chatham Islands Standard Time",ChinaStandardTime:"China Standard Time",CubaStandardTime:"Cuba Standard Time",DatelineStandardTime:"Dateline Standard Time",EAfricaStandardTime:"E. Africa Standard Time",EAustraliaStandardTime:"E. Australia Standard Time",EEuropeStandardTime:"E. Europe Standard Time",ESouthAmericaStandardTime:"E. South America Standard Time",EasterIslandStandardTime:"Easter Island Standard Time",EasternStandardTime:"Eastern Standard Time",EasternStandardTime_Mexico:"Eastern Standard Time (Mexico)",EgyptStandardTime:"Egypt Standard Time",EkaterinburgStandardTime:"Ekaterinburg Standard Time",FijiStandardTime:"Fiji Standard Time",FLEStandardTime:"FLE Standard Time",GeorgianStandardTime:"Georgian Standard Time",GMTStandardTime:"GMT Standard Time",GreenlandStandardTime:"Greenland Standard Time",GreenwichStandardTime:"Greenwich Standard Time",GTBStandardTime:"GTB Standard Time",HaitiStandardTime:"Haiti Standard Time",HawaiianStandardTime:"Hawaiian Standard Time",IndiaStandardTime:"India Standard Time",IranStandardTime:"Iran Standard Time",IsraelStandardTime:"Israel Standard Time",JordanStandardTime:"Jordan Standard Time",KaliningradStandardTime:"Kaliningrad Standard Time",KamchatkaStandardTime:"Kamchatka Standard Time",KoreaStandardTime:"Korea Standard Time",LibyaStandardTime:"Libya Standard Time",LineIslandsStandardTime:"Line Islands Standard Time",LordHoweStandardTime:"Lord Howe Standard Time",MagadanStandardTime:"Magadan Standard Time",MagallanesStandardTime:"Magallanes Standard Time",MarquesasStandardTime:"Marquesas Standard Time",MauritiusStandardTime:"Mauritius Standard Time",MidAtlanticStandardTime:"Mid-Atlantic Standard Time",MiddleEastStandardTime:"Middle East Standard Time",MontevideoStandardTime:"Montevideo Standard Time",MoroccoStandardTime:"Morocco Standard Time",MountainStandardTime:"Mountain Standard Time",MountainStandardTime_Mexico:"Mountain Standard Time (Mexico)",MyanmarStandardTime:"Myanmar Standard Time",NCentralAsiaStandardTime:"N. Central Asia Standard Time",NamibiaStandardTime:"Namibia Standard Time",NepalStandardTime:"Nepal Standard Time",NewZealandStandardTime:"New Zealand Standard Time",NewfoundlandStandardTime:"Newfoundland Standard Time",NorfolkStandardTime:"Norfolk Standard Time",NorthAsiaEastStandardTime:"North Asia East Standard Time",NorthAsiaStandardTime:"North Asia Standard Time",NorthKoreaStandardTime:"North Korea Standard Time",OmskStandardTime:"Omsk Standard Time",PacificSAStandardTime:"Pacific SA Standard Time",PacificStandardTime:"Pacific Standard Time",PacificStandardTime_Mexico:"Pacific Standard Time (Mexico)",PakistanStandardTime:"Pakistan Standard Time",ParaguayStandardTime:"Paraguay Standard Time",RomanceStandardTime:"Romance Standard Time",RussiaTimeZone10:"Russia Time Zone 10",RussiaTimeZone11:"Russia Time Zone 11",RussiaTimeZone3:"Russia Time Zone 3",RussianStandardTime:"Russian Standard Time",SAEasternStandardTime:"SA Eastern Standard Time",SAPacificStandardTime:"SA Pacific Standard Time",SAWesternStandardTime:"SA Western Standard Time",SaintPierreStandardTime:"Saint Pierre Standard Time",SakhalinStandardTime:"Sakhalin Standard Time",SamoaStandardTime:"Samoa Standard Time",SaratovStandardTime:"Saratov Standard Time",SEAsiaStandardTime:"SE Asia Standard Time",SingaporeStandardTime:"Singapore Standard Time",SouthAfricaStandardTime:"South Africa Standard Time",SriLankaStandardTime:"Sri Lanka Standard Time",SudanStandardTime:"Sudan Standard Time",SyriaStandardTime:"Syria Standard Time",TaipeiStandardTime:"Taipei Standard Time",TasmaniaStandardTime:"Tasmania Standard Time",TocantinsStandardTime:"Tocantins Standard Time",TokyoStandardTime:"Tokyo Standard Time",TomskStandardTime:"Tomsk Standard Time",TongaStandardTime:"Tonga Standard Time",TransbaikalStandardTime:"Transbaikal Standard Time",TurkeyStandardTime:"Turkey Standard Time",TurksAndCaicosStandardTime:"Turks And Caicos Standard Time",UlaanbaatarStandardTime:"Ulaanbaatar Standard Time",USEasternStandardTime:"US Eastern Standard Time",USMountainStandardTime:"US Mountain Standard Time",UTC:"UTC",UTCPLUS12:"UTC+12",UTCPLUS13:"UTC+13",UTCMINUS02:"UTC-02",UTCMINUS08:"UTC-08",UTCMINUS09:"UTC-09",UTCMINUS11:"UTC-11",VenezuelaStandardTime:"Venezuela Standard Time",VladivostokStandardTime:"Vladivostok Standard Time",WAustraliaStandardTime:"W. Australia Standard Time",WCentralAfricaStandardTime:"W. Central Africa Standard Time",WEuropeStandardTime:"W. Europe Standard Time",WMongoliaStandardTime:"W. Mongolia Standard Time",WestAsiaStandardTime:"West Asia Standard Time",WestBankStandardTime:"West Bank Standard Time",WestPacificStandardTime:"West Pacific Standard Time",YakutskStandardTime:"Yakutsk Standard Time"},K.LocationType={Custom:"custom",Room:"room"},K.AppointmentSensitivityType={Normal:"normal",Personal:"personal",Private:"private",Confidential:"confidential"},K.CategoryColor={None:"None",Preset0:"Preset0",Preset1:"Preset1",Preset2:"Preset2",Preset3:"Preset3",Preset4:"Preset4",Preset5:"Preset5",Preset6:"Preset6",Preset7:"Preset7",Preset8:"Preset8",Preset9:"Preset9",Preset10:"Preset10",Preset11:"Preset11",Preset12:"Preset12",Preset13:"Preset13",Preset14:"Preset14",Preset15:"Preset15",Preset16:"Preset16",Preset17:"Preset17",Preset18:"Preset18",Preset19:"Preset19",Preset20:"Preset20",Preset21:"Preset21",Preset22:"Preset22",Preset23:"Preset23",Preset24:"Preset24"},K.MoveSpamItemTo={DeletedItemsFolder:"deletedItemsFolder",CustomFolder:"customFolder",JunkFolder:"junkFolder",NoMove:"noMove"},K.SaveLocation={OnedriveForBusiness:1,SharePoint:2,Box:4,Dropbox:8,GoogleDrive:16,Local:32,AccountDocument:64,PhotoLibrary:128,Other:1<<31},K.OpenLocation={OnedriveForBusiness:1,SharePoint:2,Camera:4,Local:8,AccountDocument:16,PhotoLibrary:32,Other:1<<31},(Q=z||(z={}))[Q.camera=0]="camera",Q[Q.microphone=1]="microphone",Q[Q.geolocation=2]="geolocation";var oe=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i};function ae(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce.apply(void 0,oe([9,e],t))}function se(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce.apply(void 0,oe([180,e],t))}function ce(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];B(1,"mailbox.displayAppointmentForm");var r=W(n,!1,!1),o={itemId:t};le(o),P(e,r.asyncContext,r.callback,{itemId:re(o.itemId)},void 0,void 0,void 0)}function le(e){ie(e.itemId)}var ue=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i};function fe(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];pe.apply(void 0,ue([8,e],t))}function de(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];pe.apply(void 0,ue([179,e],t))}function pe(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];B(1,"mailbox.displayMessageForm");var r=W(n,!1,!1),o={itemId:t};he(o),P(e,r.asyncContext,r.callback,{itemId:re(o.itemId)},void 0,void 0,void 0)}function he(e){ie(e.itemId)}function ge(e,t,n,i){if("string"!=typeof e)throw N(String(i));G(e.length,t,n,i)}var me=function(e){return e instanceof Date||"[object Date]"==Object.prototype.toString.call(e)},ve=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i};function ye(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return be.apply(void 0,ve([7,e],t))}function Oe(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return be.apply(void 0,ve([177,e],t))}function be(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];B(1,"mailbox.displayNewAppointmentForm");var r=W(n,!1,!1);Se(t);var o=_e(t);P(e,r.asyncContext,r.callback,o,void 0,void 0,void 0)}function Se(e){if(i(e.requiredAttendees)||ee(e.requiredAttendees,"requiredAttendees"),i(e.optionalAttendees)||ee(e.optionalAttendees,"optionalAttendees"),i(e.location)||ge(e.location,0,255,"location"),i(e.body)||ge(e.body,0,J,"body"),i(e.subject)||ge(e.subject,0,255,"subject"),!i(e.start)){if(!me(e.start))throw N("start");if(!i(e.end)){if(!me(e.end))throw N("end");if(e.end&&e.start&&e.end<e.start)throw N("end",H("l_InvalidEventDates_Text"))}}}function _e(e){var t=null,n=null;if(i(e.requiredAttendees)||(t=te(e.requiredAttendees,"requiredAttendees")),i(e.optionalAttendees)||(n=te(e.optionalAttendees,"optionalAttendees")),!i(e.start)){var r=e.start;e.start=r.getTime()}if(!i(e.end)){var o=e.end;e.end=o.getTime()}var a=JSON.parse(JSON.stringify(e));return(t||n)&&(i(e.requiredAttendees)||(a.requiredAttendees=t),i(e.optionalAttendees)||(a.optionalAttendees=n)),a}var Ae=6e5,Ce=27892122,Ee=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i};function Ie(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Pe.apply(void 0,Ee([44,e],t))}function we(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Pe.apply(void 0,Ee([178,e],t))}function Pe(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];B(1,"mailbox.displayNewMessageForm");var r=W(n,!1,!1);xe(t);var o=Te(t);P(e,r.asyncContext,r.callback,null==o?t:o,void 0,void 0,void 0)}function xe(e){null!==e&&null!==e&&(i(e.toRecipients)||ee(e.toRecipients,"toRecipients"),i(e.ccRecipients)||ee(e.ccRecipients,"ccRecipients"),i(e.bccRecipients)||ee(e.bccRecipients,"bccRecipients"),i(e.htmlBody)||ge(e.htmlBody,0,J,"htmlBody"),i(e.subject)||ge(e.subject,0,255,"subject"))}function Te(e){var t=JSON.parse(JSON.stringify(e));if(!i(e)){e.toRecipients&&(t.toRecipients=te(e.toRecipients,"toRecipients")),e.ccRecipients&&(t.ccRecipients=te(e.ccRecipients,"ccRecipients")),e.bccRecipients&&(t.bccRecipients=te(e.bccRecipients,"bccRecipients"));var n=function(e){var t=[];e.attachments&&Re(t=e.attachments);return t}(e);e.attachments&&(t.attachments=Fe(n))}return t}function Re(e){if(!i(e)&&!Array.isArray(e))throw N("attachments")}function Fe(e){for(var t=[],n=0;n<e.length;n++){if("object"!=typeof e[n])throw N("attachments");var i=e[n];ke(i),t.push(Ne(i))}return t}function ke(e){if("object"!=typeof e)throw N("attachments");if(!e.type||!e.name)throw N("attachments");if(!e.url&&!e.itemId&&!e.base64file)throw N("attachments")}function Ne(e){var t=null;if(!0,e.type===K.AttachmentType.File){var n=e.url,i=e.name,r=!!e.isInline;!function(e,t){if("string"!=typeof e&&"string"!=typeof t)throw N("attachments");if(e.length>V)throw D("attachments",e.length,H("l_AttachmentUrlTooLong_Text"));Me(t)}(n,i),t=[K.AttachmentType.File,i,n,r]}else if(e.type===K.AttachmentType.Item){var o=re(e.itemId),a=e.name;!function(e,t){if("string"!=typeof e||"string"!=typeof t)throw N("attachments");if(e.length>200)throw D("attachments",e.length,H("l_AttachmentItemIdTooLong_Text"));Me(t)}(o,a),t=[K.AttachmentType.Item,a,o]}else{if(!f("ReplyFormBase64Support")||e.type!==K.AttachmentType.Base64)throw N("attachments");var s=e.base64file,c=e.name;r=!!e.isInline;!function(e,t){if("string"!=typeof e||"string"!=typeof t)throw N("attachments");if(e.length>Ce)throw D("attachments",e.length,H("l_AttachmentExceededSize_Text"));Me(t)}(s,c),t=[K.AttachmentType.Base64,c,s,r]}return t}function Me(e){if(e.length>255)throw D("attachments",e.length,H("l_AttachmentNameTooLong_Text"))}var De=n(0);function je(e,t,n){var i=void 0;return na()===De.AppName.Outlook&&void 0!==e.error&&void 0!==e.errorCode&&e.error&&9030===e.errorCode?i=x(void 0,De.DDA.AsyncResultEnum.ErrorCode.Failed,e.errorCode,t,e.errorMessage,e.errorName):n&&n!==r.noError?(i=x(void 0,De.DDA.AsyncResultEnum.ErrorCode.Failed,9017,t,H("l_InternalProtocolError_Text").replace("{0}",n)))&&(i.diagnostics={InvokeCodeResult:n}):(i=e.wasSuccessful?x(e.token,De.DDA.AsyncResultEnum.ErrorCode.Success,0,t):x(void 0,De.DDA.AsyncResultEnum.ErrorCode.Failed,e.errorCode,t,e.errorMessage,e.errorName),e.diagnostics&&(i.diagnostics=e.diagnostics)),i}function Ue(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B(1,"mailbox.getCallbackTokenAsync");var n=W(e,!0,!0),i=!1;if(n.options&&n.options.isRest&&(i=!0),ta()&&(!i||F()<3))throw k(H("l_TokenAccessDeniedWithoutItemContext_Text"));P(12,n.asyncContext,n.callback,{isRest:i},void 0,je,void 0)}function He(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B(1,"mailbox.getUserIdentityToken");var n=W(e,!0,!0);P(2,n.asyncContext,n.callback,void 0,void 0,je,void 0)}var Le=function(e){if(!i(e)){var t=ea("hostVersion").split("."),n=e.split("."),r=0;if(t.length>=4&&n.length>=4){for(var o=0;o<4;o++){var a=parseInt(t[o]),s=parseInt(n[o]);if(isNaN(a)||isNaN(s)||a<s)return!1;if(a>s)return!0;r++}return 4==r}}return!1},Be=n(0),We=1e6,qe=5242880,Je="16.0.16224.10000";function Ve(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(3,"mailbox.makeEwsRequest");var i=W(t,!0,!0);if(null==e)throw M("data");if("string"!=typeof e)throw j("data",typeof e,"string");if(na()==Be.AppName.Outlook&&Le(Je)){if(e.length>qe)throw N("data",H("l_NewEwsRequestOversized_Text"))}else if(e.length>We)throw N("data",H("l_EwsRequestOversized_Text"));P(5,i.asyncContext,i.callback,{body:e},void 0,Ge,void 0)}function Ge(e,t,n){return n&&n!==r.noError?x(void 0,Be.DDA.AsyncResultEnum.ErrorCode.Failed,9017,t,H("l_InternalProtocolError_Text").replace("{0}",n)):!1===e.wasProxySuccessful?x(void 0,Be.DDA.AsyncResultEnum.ErrorCode.Failed,9020,t,e.errorMessage):x(e.body,Be.DDA.AsyncResultEnum.ErrorCode.Success,0,t)}var ze=function(e,t){var n=Object.keys(t),i=n.map((function(e){return{value:t[e],writable:!1}})),r={};return n.forEach((function(e,t){r[e]=i[t]})),Object.defineProperties(e,r)};n(0);var Qe=K.CategoryColor,Ke=[Qe.None,Qe.Preset0,Qe.Preset1,Qe.Preset2,Qe.Preset3,Qe.Preset4,Qe.Preset5,Qe.Preset6,Qe.Preset7,Qe.Preset8,Qe.Preset9,Qe.Preset10,Qe.Preset11,Qe.Preset12,Qe.Preset13,Qe.Preset14,Qe.Preset15,Qe.Preset16,Qe.Preset17,Qe.Preset18,Qe.Preset19,Qe.Preset20,Qe.Preset21,Qe.Preset22,Qe.Preset23,Qe.Preset24];function Xe(e){if(!e)throw N("categoryDetails");if(!Array.isArray(e))throw j("categoryDetails",typeof e,typeof[]);if(0===e.length)throw N("categoryDetails");e.forEach(Ye)}function Ye(e){if(!e)throw N("categoryDetails");if(!e.color||!e.displayName)throw N("categoryDetails");if("string"!=typeof e.color)throw j("categoryDetails.color",typeof e.color,"string");if("string"!=typeof e.displayName)throw j("categoryDetails.displayName",typeof e.displayName,"string");if(e.displayName.length>255)throw D("categoryDetails.displayName",e.displayName.length);if(-1===Ke.indexOf(e.color))throw N("categoryDetails.color")}function $e(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(3,"masterCategories.addAsync");var i=W(t,!1,!1),r={categoryDetails:e};Xe(e),P(161,i.asyncContext,i.callback,r,void 0,void 0,void 0)}function Ze(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B(3,"masterCategories.getAsync");var n=W(e,!0,!1);P(160,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function et(e){if(!e)throw N("categories");if(!Array.isArray(e))throw j("categories",typeof e,typeof Array);if(0===e.length)throw N("categories");e.forEach(tt)}function tt(e){if(!e)throw N("categories");if("string"!=typeof e)throw j("categories",typeof e,"string");if(e.length>255)throw D("categories",e.length)}function nt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(3,"masterCategories.removeAsync");var i=W(t,!1,!1),r={categories:e};et(e),P(162,i.asyncContext,i.callback,r,void 0,void 0,void 0)}function it(){P(42,void 0,void 0,void 0,void 0,void 0,void 0)}var rt,ot=function(){return ea("itemType")};!function(e){e[e.Message=1]="Message",e[e.Appointment=2]="Appointment",e[e.MeetingRequest=3]="MeetingRequest",e[e.MessageCompose=4]="MessageCompose",e[e.AppointmentCompose=5]="AppointmentCompose",e[e.ItemLess=6]="ItemLess"}(rt||(rt={}));var at=n(0);function st(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,"item.getInitializationContext");var i=W(t,!0,!1);Le("16.0.17215.10000")?P(99,i.asyncContext,i.callback,void 0,void 0,ct,e):P(99,i.asyncContext,i.callback,void 0,void 0,void 0,void 0)}}function ct(e,t,n){return n&&n!==r.noError?x(void 0,at.DDA.AsyncResultEnum.ErrorCode.Failed,9017,t,H("l_InternalProtocolError_Text").replace("{0}",n)):e.wasSuccessful?""===e.data?x(void 0,at.DDA.AsyncResultEnum.ErrorCode.Success,0,t):x(JSON.parse(e.data),at.DDA.AsyncResultEnum.ErrorCode.Success,0,t):x(void 0,at.DDA.AsyncResultEnum.ErrorCode.Failed,e.errorCode,t,e.errorMessage,e.errorName)}var lt,ut="Date(";function ft(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(1,"item.saveCustomProperties");var i=this&&this.isLoadedItem,r=W(t,!1,!0);dt(e),P(4,r.asyncContext,r.callback,{customProperties:e},void 0,void 0,i)}function dt(e){if(JSON.stringify(e).length>2500)throw D("customProperties")}!function(e){e[e.NonTransmittable=0]="NonTransmittable"}(lt||(lt={}));var pt=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i},ht=function(){function e(e,t){if(this.isLoadedItem=!1,i(e)&&M("data"),Array.isArray(e)){var n=e;if(!(n.length>lt.NonTransmittable))throw N("data");e=n[lt.NonTransmittable]}else this.rawData=e;this.isLoadedItem=1==t}return e.prototype.get=function(e){var t=this.rawData[e];if("string"==typeof t){var n=t;if(n.length>ut.length+")".length&&n.startsWith(ut)&&n.endsWith(")")){var r=n.substring(ut.length,n.length-1),o=parseInt(r);if(!isNaN(o)){var a=new Date(o);i(a)||(t=a)}}}return t},e.prototype.set=function(e,t){me(t)&&(t=ut+t.getTime()+")"),this.rawData[e]=t},e.prototype.remove=function(e){delete this.rawData[e]},e.prototype.saveAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ft.apply(void 0,pt([this.rawData],e))},e.prototype.getAll=function(){var e=this,t={};return Object.keys(this.rawData).forEach((function(n){t[n]=e.get(n)})),t},e}(),gt=n(0);function mt(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=W(t,!0,!0);P(3,i.asyncContext,i.callback,void 0,void 0,vt,e)}}function vt(e,t,n){if(void 0!==n&&n!==r.noError)return x(void 0,gt.DDA.AsyncResultEnum.ErrorCode.Failed,9017,t,H("l_InternalProtocolError_Text").replace("{0}",n));if(e.wasSuccessful){var i=JSON.parse(e.customProperties),o=this&&this.isLoadedItem;return x(new ht(i,o),gt.DDA.AsyncResultEnum.ErrorCode.Success,0,t)}return x(void 0,gt.DDA.AsyncResultEnum.ErrorCode.Failed,9020,t,e.errorMessage)}var yt,Ot,bt=n(0);function St(e,t){t.options&&"string"==typeof t.options.coercionType?e.coercionType=_t(t.options.coercionType):e.coercionType=Ot.Text}function _t(e){return e===X.Html?Ot.Html:e===X.Text?Ot.Text:void 0}function At(e){e.callback&&e.callback(x(void 0,bt.DDA.AsyncResultEnum.ErrorCode.Failed,1e3,e.asyncContext))}function Ct(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];B(1,"body.getAsync");var r=W(n,!0,!1),o={coercionType:_t(t)};if(void 0===o.coercionType)throw N("coercionType");P(37,r.asyncContext,r.callback,o,void 0,void 0,e)}}function Et(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,"body.getTypeAsync");var i=W(t,!0,!1);P(14,i.asyncContext,i.callback,void 0,void 0,void 0,e)}}!function(e){e[e.Compose=0]="Compose",e[e.Read=1]="Read",e[e.ReadUI=2]="ReadUI"}(yt||(yt={})),function(e){e[e.Text=0]="Text",e[e.Html=3]="Html"}(Ot||(Ot={}));function It(e){if("string"!=typeof e.data)throw j("data",typeof e.data,"string");if(e.data.length>1e6)throw D("data",e.data.length)}function wt(e){if("string"!=typeof e.data)throw j("data",typeof e.data,"string");if(e.data.length>12e4)throw D("data",e.data.length)}var Pt="setUIAsync";function xt(e){if(!ea("enableBetaAPIs"))throw k("The feature {0}, is only enabled on the beta api endpoint".replace("{0}",e),{name:"Sys.FeatureNotEnabled"})}var Tt,Rt=n(0);function Ft(e,t){var n=x(void 0,Rt.DDA.AsyncResultEnum.ErrorCode.Failed,5e3,e,"");t&&setTimeout((function(){t&&t(n)}),0)}function kt(e,t){return function(n){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];if(38==e)B(2,"body.setAsync");else{if(206!=e)throw"Unexpected dispid";xt(Pt),B(2,"display.body.setAsync")}var o=W(i,!1,!1);if(t)Ft(o.asyncContext,o.callback);else{var a={data:n};It(a),St(a,o),void 0!==a.coercionType?P(e,o.asyncContext,o.callback,a,void 0,void 0,t):At(o)}}}function Nt(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];B(2,"body.prependAsync");var r=W(n,!1,!1);if(e)Ft(r.asyncContext,r.callback);else{var o={data:t};It(o),St(o,r),void 0!==o.coercionType?P(23,r.asyncContext,r.callback,o,void 0,void 0,e):At(r)}}}function Mt(e,t,n,r,o){B(2,t);var a=W(r,!1,!1);if(o)Ft(a.asyncContext,a.callback);else{var s={appendTxt:n};i(s.appendTxt)?s.appendTxt="":function(e){if("string"!=typeof e.appendTxt)throw j("data",typeof e.appendTxt,"string");if(e.appendTxt.length>5e3)throw D("data",e.appendTxt.length)}(s),St(s,a),void 0!==s.coercionType?P(e,a.asyncContext,a.callback,s,void 0,void 0,o):At(a)}}function Dt(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];Mt(100,"body.appendOnSendAsync",t,n,e)}}function jt(e,t){return function(n){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];var o=W(i,!1,!1);if(f("MultiSelectV2")&&t)Ft(o.asyncContext,o.callback);else{B(2,"body.setSelectedDataAsync");var a={data:n};It(a),St(a,o),void 0!==a.coercionType?P(e,o.asyncContext,o.callback,a,void 0,void 0,void 0):At(o)}}}function Ut(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];B(2,"item.body.setSignatureAsync");var o=W(n,!1,!1);if(e)Ft(o.asyncContext,o.callback);else{var a={data:t};i(a.data)?a.data="":wt(a),St(a,o),void 0!==a.coercionType?P(173,o.asyncContext,o.callback,a,void 0,void 0,e):At(o)}}}function Ht(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];Mt(197,"body.prependOnSendAsync",t,n,e)}}function Lt(e,t){return!f("MultiSelectV2")||i(t)?ea(e):t&&t[e]}function Bt(e,t,n){var i=ze({},{});if(e==yt.Compose)ze(i,{appendOnSendAsync:Dt(t),getTypeAsync:Et(t),prependAsync:Nt(t),setAsync:kt(38,t),setSelectedDataAsync:jt(13,t),setSignatureAsync:Ut(t),prependOnSendAsync:Ht(t),getAsync:Ct(t)});else if(e==yt.Read)ze(i,{getAsync:Ct(t),type:Lt("bodyType",n)});else{if(e!=yt.ReadUI)throw"Unexpected ItemSurfaceType";ze(i,{setAsync:kt(206,t)})}return i}function Wt(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,"item.getAllInternetHeadersAsync");var i=W(t,!0,!1);P(168,i.asyncContext,i.callback,void 0,void 0,void 0,e)}}function qt(e,t){if(i(t)||""===t)throw M(e);if("string"!=typeof t)throw j(e,typeof t,"string")}!function(e){e[e.informationalMessage=0]="informationalMessage",e[e.progressIndicator=1]="progressIndicator",e[e.errorMessage=2]="errorMessage",e[e.insightMessage=3]="insightMessage"}(Tt||(Tt={}));var Jt="icon",Vt="message",Gt="persistent",zt="actions",Qt="actionType",Kt="actionText",Xt="commandId",Yt="showTaskPane",$t="executeFunction",Zt=n(0);function en(e){if(qt("key",e),e.length>32)throw D("key",e.length)}function tn(e){if(qt("type",e.type),e.type===K.ItemNotificationMessageType.InformationalMessage){if(qt(Jt,e.icon),e.icon.length>32)throw D(Jt,e.icon.length);if(i(e.persistent))throw M(Gt);if("boolean"!=typeof e.persistent)throw j(Gt,typeof e.persistent,"boolean");if(!i(e.actions))throw N(zt,H("l_ActionsDefinitionWrongNotificationMessageError_Text"))}else if(e.type===K.ItemNotificationMessageType.InsightMessage)!function(e){if(qt(Jt,e.icon),e.icon.length>32)throw D(Jt,e.icon.length);if(i(e.actions))throw M(zt);!function(e){var t=function(e){var t=null;if(!Array.isArray(e))throw N(zt);if(1===e.length)t=e[0];else if(e.length>1)throw N(zt,H("l_ActionsDefinitionMultipleActionsError_Text"));return t}(e);if(i(t))return;(function(e){if(i(e.actionType))throw M(Qt);var t=e.actionType,n=[Yt];Zt.AppName.OutlookWebApp===na()&&n.push($t);if(-1===n.indexOf(t))throw N(Qt,H("l_InvalidActionType_Text"));if(i(e.commandId)||"string"!=typeof e.commandId||""===e.commandId)throw N(Xt,H("l_InvalidCommandIdError_Text"))})(t),function(e){if(i(e.actionText)||""===e.actionText||"string"!=typeof e.actionText)throw M(Kt);if(e.actionText.length>30)throw D(Kt,e.actionText.length)}(t)}(e.actions)}(e);else{if(!i(e.icon))throw N(Jt);if(!i(e.persistent))throw N(Gt);if(!i(e.actions))throw N(zt,H("l_ActionsDefinitionWrongNotificationMessageError_Text"))}if(qt(Vt,e.message),e.message.length>150)throw D(Vt,e.message.length)}function nn(e){return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];B(1,"notificationMessages.addAsync");var a=W(r,!1,!1);if(e)Ft(a.asyncContext,a.callback);else{en(t),tn(n);var s,c,l=Tt[n.type];if(i(l))throw N("type");s=Le("16.0.17215.10000"),c=Le("16.0.17803.10000");var f,d=u("notificationActionsPassByValue"),p=c&&(!0===d||void 0===d),h=n.message,g=n.icon,m=n.persistent;null==(f=n.actions&&p?JSON.parse(JSON.stringify(n.actions)):n.actions)||f.forEach((function(e){if(s)try{e.contextData=JSON.stringify(e.contextData)}catch(t){e.contextData=void 0}else void 0===e.contextData||null!==e.contextData&&""!==e.contextData||(e.contextData="{}")}));var v={key:t,message:h,type:l,icon:g,persistent:m,actions:f};P(33,a.asyncContext,a.callback,v,void 0,void 0,e)}}}var rn=n(0);function on(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,"notificationMessages.getAllAsync");var i,r=W(t,!0,!1);i=Le("16.0.17215.10000"),P(34,r.asyncContext,r.callback,void 0,void 0,i?an:void 0,e)}}function an(e,t,n){if(n&&n!==r.noError)return x(void 0,rn.DDA.AsyncResultEnum.ErrorCode.Failed,9017,t,H("l_InternalProtocolError_Text").replace("{0}",n));if(e.wasSuccessful){for(var i=[],o=0;o<e.data.length;o++){var a=e.data[o];a.action&&void 0!==a.action.contextData&&(a.action.contextData=JSON.parse(a.action.contextData)),i.push(a)}return x(i,rn.DDA.AsyncResultEnum.ErrorCode.Success,0,t)}return x(void 0,rn.DDA.AsyncResultEnum.ErrorCode.Failed,e.errorCode,t,e.errorMessage,e.errorName)}function sn(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];B(1,"notificationMessages.removeAsync");var r=W(n,!1,!1);if(e)Ft(r.asyncContext,r.callback);else{en(t);var o={key:t};P(36,r.asyncContext,r.callback,o,void 0,void 0,e)}}}function cn(e){return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];B(1,"notificationMessages.replaceAsync");var a=W(r,!1,!1);if(e)Ft(a.asyncContext,a.callback);else{en(t),tn(n);var s,c,l=Tt[n.type];if(i(l))throw N("type");s=Le("16.0.17215.10000"),c=Le("16.0.17803.10000");var f,d=u("notificationActionsPassByValue"),p=c&&(!0===d||void 0===d),h=n.message,g=n.icon,m=n.persistent;null==(f=n.actions&&p?JSON.parse(JSON.stringify(n.actions)):n.actions)||f.forEach((function(e){if(s)try{e.contextData=JSON.stringify(e.contextData)}catch(t){e.contextData=void 0}else void 0===e.contextData||null!==e.contextData&&""!==e.contextData||(e.contextData="{}")}));var v={key:t,message:h,type:l,icon:g,persistent:m,actions:f};P(35,a.asyncContext,a.callback,v,void 0,void 0,e)}}}function ln(e){return ze({},{addAsync:nn(e),getAllAsync:on(e),removeAsync:sn(e),replaceAsync:cn(e)})}function un(e){i(e)||G(e.length,0,J,"htmlBody")}function fn(e){var t="";return e.htmlBody&&(!function(e){if("string"!=typeof e)throw j("htmlBody",typeof e,"string");if(i(e))throw M("htmlBody");G(e.length,0,J,"htmlBody")}(e.htmlBody),t=e.htmlBody),t}function dn(e){var t=[];return e.attachments&&Re(t=e.attachments),t}function pn(e){var t=[];return i(e.options)||(t[0]=e.options),i(e.callback)||(t[t.length]=e.callback),t}var hn=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i};function gn(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];On.apply(void 0,hn([!1,!1,t,e],n))}}function mn(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];On.apply(void 0,hn([!0,!1,t,e],n))}}function vn(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];On.apply(void 0,hn([!1,!0,t,e],n))}}function yn(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];On.apply(void 0,hn([!0,!0,t,e],n))}}function On(e,t,n,r){for(var o=[],a=4;a<arguments.length;a++)o[a-4]=arguments[a];var s=W(pn(n),!1,!1);if(f("MultiSelectV2")&&r&&!t)Ft(s.asyncContext,s.callback);else{var c;B(1,"mailbox.displayReplyForm"),(i(s)||void 0===s.options&&void 0===s.callback)&&(s=W(o,!1,!1));var l={formData:n},u=null,d=null;if("string"==typeof l.formData)c=e?t?184:11:t?183:10,un(l.formData),P(c,s.asyncContext,s.callback,{htmlBody:l.formData},void 0,void 0,r);else{if("object"!=typeof l.formData)throw N();u=fn(l.formData),d=Fe(dn(l.formData)),P(c=e?t?182:31:t?181:30,s.asyncContext,s.callback,{htmlBody:u,attachments:d},void 0,void 0,r)}}}function bn(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];B(2,"categories.addAsync");var r=W(n,!1,!1),o={categories:t};et(t),P(158,r.asyncContext,r.callback,o,void 0,void 0,e)}}function Sn(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,"categories.getAsync");var i=W(t,!0,!1);P(157,i.asyncContext,i.callback,void 0,void 0,void 0,e)}}function _n(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];B(2,"categories.removeAsync");var r=W(n,!1,!1),o={categories:t};et(t),P(159,r.asyncContext,r.callback,o,void 0,void 0,e)}}function An(e){return ze({},{addAsync:bn(e),removeAsync:_n(e),getAsync:Sn(e)})}function Cn(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];B(1,"item.getAttachmentContentAsync");var r=W(n,!0,!1),o={id:t};En(o),P(150,r.asyncContext,r.callback,o,void 0,void 0,e)}}function En(e){qt("attachmentId",e.id)}var In=K.Folder;function wn(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];B(3,"item.move");var r=W(n,!1,!1),o={destinationFolder:t};Pn(t),P(101,r.asyncContext,r.callback,o,void 0,void 0,e)}}function Pn(e){if(e!==In.Inbox&&e!==In.Junk&&e!==In.DeletedItems)throw N("destinationFolder")}var xn=K.ResponseType,Tn=K.RecipientType,Rn=[xn.None,xn.Organizer,xn.Tentative,xn.Accepted,xn.Declined],Fn=[Tn.Other,Tn.DistributionList,Tn.User,Tn.ExternalUser],kn=function(e){var t=e.appointmentResponse,n=e.recipientType,i={emailAddress:e.address,displayName:e.name};return"number"==typeof e.appointmentResponse&&(i.appointmentResponse=t<Rn.length?Rn[t]:xn.None),"number"==typeof e.recipientType&&(i.recipientType=n<Fn.length?Fn[n]:Tn.Other),i};function Nn(e){return kn({name:e.Name||"",address:e.UserId||""})}function Mn(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,"delayDeliveryTime.getAsync");var i=W(t,!0,!1);P(166,i.asyncContext,i.callback,void 0,void 0,void 0,e)}}function Dn(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];B(2,"delayDeliveryTime.setAsync");var r=W(n,!1,!1);e?Ft(r.asyncContext,r.callback):(jn(t),P(167,r.asyncContext,r.callback,{time:t.getTime()},void 0,void 0,e))}}function jn(e){if(i(e))throw M("dateTime","You cannot conduct to a null dateTime");if(!me(e))throw j("dateTime",typeof e,typeof Date);if(isNaN(e.getTime()))throw N("dateTime");G(e.getTime(),-864e13,864e13,"dateTime")}function Un(e,t){var n=ze({},{getAsync:Mn(t)});return e&&ze(n,{setAsync:Dn(t)}),n}function Hn(e,t){for(var n=e.length-1;n>=0;n--){for(var i=!1,r=n-1;r>=0;r--)if(t(e[n],e[r])){i=!0;break}i&&e.splice(n,1)}return e}var Ln=function(e,t){return e===t},Bn=function(e,t){return e===t||!(!e||!t)&&e.meetingString===t.meetingString},Wn=function(e,t){return e===t||!(!e||!t)&&e.taskString===t.taskString},qn=function(e,t){return e===t||!(!e||!t)&&e.contactString===t.contactString};function Jn(){return!!ea("entities")&&void 0!==ea("entities").IsLegacyExtraction&&ea("entities").IsLegacyExtraction}var Vn,Gn=864e5,zn=new Date("0001-01-01T00:00:00Z");function Qn(e,t){if(!t)return e;var n=null;try{var r=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0),o=function(e){var t=32767,n=0;if(null==e)return;n=Jn()?Xn(e):Kn(e);var i=(e.getTime()-n-zn.getTime())/Gn;if(i<0)return;if(i>=262144)return;var r=i>>15;switch(i&=t,r){case 0:return function(e){var t=15,n=31,i=127,r=0,o=0,a=0,s=e>>12&7;if(4==(4&s)){if(r=e>>5&i,2==(2&s)){if(1==(1&s))return;o=e>>1&t}}else 2==(2&s)&&(o=e>>8&t),1==(1&s)&&(a=e>>3&n);return function(e,t,n){return{day:e,month:t,year:n%100}}(a,o,r)}(i);case 1:return function(e){var t=7,n=3,i=15&e,r=function(e,t){var n=1<<t-1,i=(1<<t)-1;return(e&n)==n?-(1+(e^i)):e}(63&(e>>=4),6),o=(e>>=6)&t,a=(e>>=3)&n;try{return function(e,t,n,i){return{modifier:e,offset:t,unit:n,tag:i}}(a,r,o,i)}catch(e){return}}(i);default:return}}(e);if(!o)return e;var a=o;if(a.day&&a.month&&void 0!==a.year)n=function(e,t){var n,r=t.year,o=0==t.month?e.getMonth():t.month-1,a=t.day;if(0==a)return e;i(r)?(n=new Date(e.getFullYear(),o,a)).getTime()<e.getTime()&&(n=new Date(e.getFullYear()+1,o,a)):n=new Date(r<50?2e3+r:1900+r,o,a);if(n.getMonth()!=o)return e;return n}(r,o);else{var s=o;n=void 0!==s.modifier&&void 0!==s.offset&&void 0!==s.tag&&void 0!==s.unit?function(e,t){var n;switch(t.unit){case 0:return(n=new Date(e.getFullYear(),e.getMonth(),e.getDate())).setDate(n.getDate()+t.offset),n;case 5:return function(e,t,n){if(t>-5&&t<5){var i=7*t+((n+6)%7+1-e.getDay());return e.setDate(e.getDate()+i),e}return(i=(n-e.getDay())%7)<0&&(i+=7),e.setDate(e.getDate()+i),e}(e,t.offset,t.tag);case 2:var i=1;switch(t.modifier){case 1:break;case 2:i=16;break;default:0==t.offset&&(i=e.getDate())}return(n=new Date(e.getFullYear(),e.getMonth(),i)).setMonth(n.getMonth()+t.offset),n.getTime()<e.getTime()&&n.setDate(n.getDate()+e.getDate()-1),n;case 1:if((n=new Date(e.getFullYear(),e.getMonth(),e.getDate())).setDate(e.getDate()+7*t.offset),1==t.modifier||0==t.modifier)return n.setDate(n.getDate()+1-n.getDay()),n.getTime()<e.getTime()?e:n;if(2==t.modifier)return n.setDate(n.getDate()+5-n.getDay()),n;break;case 4:return function(e,t){var n,i,r;if(n=e,t.tag<=0||t.tag>12||t.offset<=0||t.offset>5)return e;var o=(12+t.tag-n.getMonth()-1)%12;if(i=new Date(n.getFullYear(),n.getMonth()+o,1),1==t.modifier)return 1==t.offset&&6!=i.getDay()&&0!=i.getDay()?i:((r=new Date(i.getFullYear(),i.getMonth(),i.getDate())).setDate(r.getDate()+(1-i.getDay()+7)%7),6!=i.getDay()&&0!=i.getDay()&&1!=i.getDay()&&r.setDate(r.getDate()-7),r.setDate(r.getDate()+7*(t.offset-1)),r.getMonth()+1!=t.tag?e:r);var a=1-(r=new Date(i.getFullYear(),i.getMonth(),(s=i.getMonth(),c=i.getFullYear(),32-new Date(c,s,32).getDate()))).getDay();return a>0&&(a-=7),r.setDate(r.getDate()+a),r.setDate(r.getDate()+7*(1-t.offset)),r.getMonth()+1!=t.tag?6!=i.getDay()&&0!=i.getDay()?i:e:r;var s,c}(e,t);case 3:if(t.offset>0)return new Date(e.getFullYear()+t.offset,0,1)}return e}(r,o):r}return isNaN(n.getTime())?t:(n.setMilliseconds(n.getMilliseconds()+(Jn()?Xn(e):Kn(e))),n)}catch(e){return t}}function Kn(e){var t=0;return t+=3600*e.getHours(),t+=60*e.getMinutes(),t+=e.getSeconds(),t*=1e3,t+=e.getMilliseconds()}function Xn(e){var t=0;return t+=3600*e.getUTCHours(),t+=60*e.getUTCMinutes(),t+=e.getUTCSeconds(),t*=1e3,t+=e.getUTCMilliseconds()}function Yn(e){for(var t=ea("timeZoneOffsets"),n=0;n<t.length;n++){var i=t[n],r=parseInt(i.start),o=parseInt(i.end);if(e.getTime()-r>=0&&e.getTime()-o<0)return parseInt(i.offset)}throw N("input",H("l_InvalidDate_Text"))}function $n(e){var t=function(e){var t=new Date(e.year,e.month,e.date,e.hours,e.minutes,e.seconds,null===e.milliseconds?0:e.milliseconds);if(isNaN(t.getTime()))throw N("input",H("l_InvalidDate_Text"));return t}(e);if(!i(ea("timeZoneOffsets"))){var n=Yn(t);t.setUTCMinutes(t.getUTCMinutes()-n),n=e.timezoneOffset?e.timezoneOffset:-1*t.getTimezoneOffset(),t.setUTCMinutes(t.getUTCMinutes()+n)}return t}function Zn(e){return{month:e.getMonth(),date:e.getDate(),year:e.getFullYear(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds(),milliseconds:e.getMilliseconds()}}function ei(e){return i(e)?{addresses:[],emailAddresses:[],urls:[],taskSuggestions:[],meetingSuggestions:[],phoneNumbers:[],contacts:[],flightReservations:[],parcelDelivery:[]}:{addresses:ti(e[Vn.address]),emailAddresses:ni(e[Vn.emailAddress]),urls:ii(e[Vn.url]),taskSuggestions:ri(e[Vn.taskSuggestion]),meetingSuggestions:oi(e[Vn.meetingSuggestion]),phoneNumbers:si(e[Vn.phoneNumber]),contacts:ci(e[Vn.contact]),flightReservations:li(e[Vn.flightReservations]),parcelDelivery:li(e[Vn.parcelDeliveries])}}!function(e){e.meetingSuggestion="MeetingSuggestions",e.taskSuggestion="TaskSuggestions",e.address="Addresses",e.emailAddress="EmailAddresses",e.url="Urls",e.phoneNumber="PhoneNumbers",e.contact="Contacts",e.flightReservations="FlightReservations",e.parcelDeliveries="ParcelDeliveries"}(Vn||(Vn={}));var ti=function(e){return Hn(e||[],Ln)},ni=function(e){return 0===F()?[]:e||[]},ii=function(e){return e||[]},ri=function(e){if(0===F())return[];var t=e||[];return Hn(t=t.map((function(e){return{assignees:(e.Assignees||[]).map(Nn),taskString:e.TaskString}})),Wn)},oi=function(e){if(0===F())return[];var t=e||[];return Hn(t=t.map((function(e){var t=""!==e.StartTime?ai(e.StartTime):void 0,n=""!==e.EndTime?ai(e.EndTime):void 0;return{meetingString:e.MeetingString,attendees:(e.Attendees||[]).map(Nn),location:e.Location,subject:e.Subject,start:void 0!==e.StartTime?t:void 0,end:void 0!==e.EndTime?n:void 0}})),Bn)};function ai(e){var t=Qn(new Date(e),new Date(ea("dateTimeSent")));return t.getTime()!==new Date(e).getTime()?$n(Zn(t)):new Date(e)}var si=function(e){return(e||[]).map((function(e){return{phoneString:e.PhoneString,originalPhoneString:e.OriginalPhoneString,type:e.Type}}))},ci=function(e){if(0===F())return[];var t=e||[];return Hn(t=t.map((function(e){return{personName:e.PersonName,businessName:e.BusinessName,phoneNumbers:si(e.PhoneNumbers||[]),emailAddresses:e.EmailAddresses||[],urls:e.Urls||[],addresses:e.Addresses||[],contactString:e.ContactString}})),qn)},li=function(e){return 0===F()?[]:e||[]},ui={meetingSuggestion:1,taskSuggestion:1,address:0,emailAddress:1,url:0,phoneNumber:0,contact:1,flightReservations:1,parcelDeliveries:1},fi={meetingSuggestion:"meetingSuggestions",taskSuggestion:"taskSuggestions",address:"addresses",emailAddress:"emailAddresses",url:"urls",phoneNumber:"phoneNumbers",contact:"contacts",flightReservations:"flightReservations",parcelDeliveries:"parcelDeliveries"},di=function(e){return function(){return ei(Lt("entities",e))}},pi=function(e){return function(t){var n=ei(Lt("entities",e));B(void 0!==ui[t]?ui[t]:1,t);var i=fi[t];return void 0===i?null:n[i]}},hi=function(e){return function(t){return function(e,t){B(1,"item.getFilteredEntitiesByName");var n=Object.keys(e).map((function(n){return e[n][t]?{entityType:n,name:t,entities:e[n][t]}:void 0})).filter((function(e){return void 0!==e}));if(0===n.length)return null;var i=n[0];switch(i.entityType){case Vn.meetingSuggestion:return oi(i.entities);case Vn.address:return ti(i.entities);case Vn.contact:return ci(i.entities);case Vn.emailAddress:return ni(i.entities);case Vn.phoneNumber:return si(i.entities);case Vn.taskSuggestion:return ri(i.entities);case Vn.url:return ii(i.entities);default:return li(i.entities)}}(Lt("filteredEntities",e),t)}},gi=function(e){return function(){return Lt("regExMatches",e)}},mi=function(e){return function(t){return(Lt("regExMatches",e)||{})[t]}},vi=function(e){return function(){return ei(Lt("selectedEntities",e))}},yi=function(e){return function(){return Lt("selectedRegExMatches",e)}};function Oi(e){var t=[];if(0===F())return[];if(e)for(var n=0;n<e.length;n++)if(e[n]){var i=bi(e[n]);t.push(i)}return t}function bi(e){if(null!==e.attachmentType||void 0!==e.attachmentType)switch(e.attachmentType){case 0:e.attachmentType=K.AttachmentType.File;break;case 1:e.attachmentType=K.AttachmentType.Item;break;case 2:e.attachmentType=K.AttachmentType.Cloud}return e}function Si(e){return JSON.parse(JSON.stringify(e))}var _i="recurrenceType",Ai="seriesTime",Ci="name",Ei="interval",Ii="days",wi="dayOfMonth",Pi="dayOfWeek",xi="weekNumber",Ti="month",Ri="firstDayOfWeek";function Fi(e){return e<0&&(e=1),e<10?"0"+e.toString():e.toString()}function ki(e,t,n){if(!Ni(e,t,n))throw N(Ai,H("l_InvalidDate_Text"))}function Ni(e,t,n){return!(e<1601||t<1||t>12||n<1||n>31)}var Mi=function(){function e(){this.startYear=0,this.startMonth=0,this.startDay=0,this.endYear=0,this.endMonth=0,this.endDay=0,this.startTimeMinutes=0,this.durationMinutes=0}return e.prototype.getDuration=function(){return this.durationMinutes},e.prototype.getEndTime=function(){var e=this.startTimeMinutes+this.durationMinutes,t=e%60;return"T"+Fi(Math.floor(e/60)%24)+":"+Fi(t)+":00.000"},e.prototype.getEndDate=function(){return 0===this.endYear&&0===this.endMonth&&0===this.endDay?null:this.endYear.toString()+"-"+Fi(this.endMonth)+"-"+Fi(this.endDay)},e.prototype.getStartDate=function(){return this.startYear.toString()+"-"+Fi(this.startMonth)+"-"+Fi(this.startDay)},e.prototype.getStartTime=function(){var e=this.startTimeMinutes%60;return"T"+Fi(Math.floor(this.startTimeMinutes/60))+":"+Fi(e)+":00.000"},e.prototype.setDuration=function(e){if(!(e>=0))throw N(void 0,H("l_InvalidTime_Text"));this.durationMinutes=e},e.prototype.setEndDate=function(e,t,n){null===e||i(t)||null===n?null!==e?this.setDateHelper(!1,e):null==e&&(this.endYear=0,this.endMonth=0,this.endDay=0):this.setDateHelper(!1,e,t,n)},e.prototype.setStartDate=function(e,t,n){null===e||i(t)||null===n?null!==e&&this.setDateHelper(!0,e):this.setDateHelper(!0,e,t,n)},e.prototype.setStartTime=function(e,t){if(i(e)||i(t)){if(!i(e)){var n=e,r="2017-01-15"+n+"Z";if(!new RegExp("^T[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d{3}$").test(n))throw N(void 0,H("l_InvalidTime_Text"));var o=new Date(r);if(i(o)||isNaN(o.getUTCHours())||isNaN(o.getUTCMinutes()))throw N(void 0,H("l_InvalidTime_Text"));this.startTimeMinutes=60*o.getUTCHours()+o.getUTCMinutes()}}else{var a=60*e+t;if(!(a>=0))throw N(void 0,H("l_InvalidTime_Text"));this.startTimeMinutes=a}},e.prototype.isValid=function(){return!!Ni(this.startYear,this.startMonth,this.startDay)&&(!(0!==this.endDay&&0!==this.endMonth&&0!==this.endYear&&!Ni(this.endYear,this.endMonth,this.endDay))&&!(this.startTimeMinutes<0||this.durationMinutes<=0))},e.prototype.exportToSeriesTimeJson=function(){var e={};return e.startYear=this.startYear,e.startMonth=this.startMonth,e.startDay=this.startDay,0===this.endYear&&0===this.endMonth&&0===this.endDay?e.noEndDate=!0:(e.endYear=this.endYear,e.endMonth=this.endMonth,e.endDay=this.endDay),e.startTimeMin=this.startTimeMinutes,this.durationMinutes>0&&(e.durationMin=this.durationMinutes),e},e.prototype.importFromSeriesTimeJsonObject=function(e){this.startYear=e.startYear,this.startMonth=e.startMonth,this.startDay=e.startDay,null!=e.noEndDate&&"boolean"==typeof e.noEndDate?(this.endYear=0,this.endMonth=0,this.endDay=0):(this.endYear=e.endYear,this.endMonth=e.endMonth,this.endDay=e.endDay),this.startTimeMinutes=e.startTimeMin,this.durationMinutes=e.durationMin},e.prototype.setDateHelper=function(e,t,n,r){var o=0,a=0,s=0;if(null===t||i(n)||null===r){if(null!==t){var c=t;!function(e){if(!new RegExp("^\\d{4}-(?:[0]\\d|1[0-2])-(?:[0-2]\\d|3[01])$").test(e))throw N(Ai,H("l_InvalidDate_Text"))}(c);var l=new Date(c);null===l||isNaN(l.getUTCFullYear())||isNaN(l.getUTCMonth())||isNaN(l.getUTCDate())||(ki(l.getUTCFullYear(),l.getUTCMonth()+1,l.getUTCDate()),o=l.getUTCFullYear(),a=l.getUTCMonth()+1,s=l.getUTCDate())}}else ki(t,n+1,r),o=t,a=n+1,s=r;0!==o&&0!==a&&0!==s&&(e?(this.startYear=o,this.startMonth=a,this.startDay=s):(this.endYear=o,this.endMonth=a,this.endDay=s))},e.prototype.isEndAfterStart=function(){if(0===this.endYear&&0===this.endMonth&&0===this.endDay)return!0;var e=new Date;e.setFullYear(this.startYear),e.setMonth(this.startMonth-1),e.setDate(this.startDay);var t=new Date;return t.setFullYear(this.endYear),t.setMonth(this.endMonth-1),t.setDate(this.endDay),t>=e},e}();function Di(e){if(i(e)||i(e.seriesTimeJson))return e;var t={recurrenceType:"",recurrenceProperties:null,recurrenceTimeZone:null},n=new Mi;return i(e.recurrenceProperties)||(t.recurrenceProperties=Si(e.recurrenceProperties)),t.recurrenceType=e.recurrenceType,i(e.recurrenceTimeZone)||(t.recurrenceTimeZone=Si(e.recurrenceTimeZone)),n.importFromSeriesTimeJsonObject(e.seriesTimeJson),t.seriesTime=n,t}function ji(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,"getAsFileAsync");var i=W(t,!0,!1);P(204,i.asyncContext,i.callback,void 0,void 0,void 0,e)}}function Ui(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,"subject.getAsync");var i=W(t,!0,!1);P(18,i.asyncContext,i.callback,void 0,void 0,void 0,e)}}function Hi(e){if("string"!=typeof e.subject)throw j("subject",typeof e.subject,"string");G(e.subject.length,0,255,"subject")}function Li(e,t){return function(n){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];if(17==e)B(2,"subject.setAsync");else{if(207!=e)throw"Unexpected dispid";xt(Pt),B(2,"display.subject.setAsync")}var o=W(i,!1,!1);if(t)Ft(o.asyncContext,o.callback);else{var a={subject:n};Hi(a),P(e,o.asyncContext,o.callback,a,void 0,void 0,t)}}}function Bi(e,t){var n=ze({},{getAsync:Ui(t)});return ze(n,e?{setAsync:Li(207,t)}:{setAsync:Li(17,t)}),n}function Wi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B(2,"item.unloadAsync");var n=W(e,!1,!1);P(212,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function qi(e,t){var n=Lt("sender",t),i=Lt("from",t),r=Lt("dateTimeCreated",t),o=Lt("dateTimeModified",t),a=Lt("end",t),s=Lt("start",t),c=ze({},{attachments:Oi(Lt("attachments",t)),bcc:(Lt("bcc",t)||[]).map(kn),body:Bt(yt.Read,e,t),categories:An(e),cc:(Lt("cc",t)||[]).map(kn),conversationId:Lt("conversationId",t),dateTimeCreated:r?new Date(r):void 0,dateTimeModified:o?new Date(o):void 0,display:ze({},{body:Bt(yt.ReadUI),subject:Bi(!0)}),end:a?new Date(a):void 0,from:i?kn(i):void 0,getAllInternetHeadersAsync:Wt(e),internetMessageId:Lt("internetMessageId",t),itemClass:Lt("itemClass",t),itemId:Lt("id",t),itemType:"message",location:Lt("location",t),move:wn(e),normalizedSubject:Lt("normalizedSubject",t),notificationMessages:ln(e),recurrence:Di(Lt("recurrence",t)),seriesId:Lt("seriesId",t),sender:n?kn(n):void 0,start:s?new Date(s):void 0,subject:Lt("subject",t),to:(Lt("to",t)||[]).map(kn),displayReplyForm:gn(e),displayReplyFormAsync:vn(e),displayReplyAllForm:mn(e),displayReplyAllFormAsync:yn(e),getAttachmentContentAsync:Cn(e),getEntities:di(t),getEntitiesByType:pi(t),getFilteredEntitiesByName:hi(t),getInitializationContextAsync:st(e),getRegExMatches:gi(t),getRegExMatchesByName:mi(t),getSelectedEntities:vi(t),getSelectedRegExMatches:yi(t),loadCustomPropertiesAsync:mt(e),delayDeliveryTime:Un(!1,e),isAllDayEvent:Lt("isAllDayEvent",t),sensitivity:Lt("sensitivity",t),getAsFileAsync:ji(e)});return f("MultiSelectV2")&&e&&ze(c,{isLoadedItem:e,unloadAsync:Wi}),c}function Ji(e){if(i(e)||""===e||"string"!=typeof e)throw N("attachmentName");G(e.length,0,255,"attachmentName")}function Vi(e){return function(t,n){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];B(2,"item.addFileAttachmentAsync");var o=W(i,!1,!1);if(e)Ft(o.asyncContext,o.callback);else{var a=!1;o.options&&(a=!!o.options.isInline);var s=n,c={uri:t,name:s,isInline:a,__timeout__:Ae};Gi(c),P(16,o.asyncContext,o.callback,c,void 0,void 0,e)}}}function Gi(e){qt("uri",e.uri),G(e.uri.length,0,V,"uri"),Ji(e.name)}function zi(e){return function(t,n){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];B(2,"item.addBase64FileAttachmentAsync");var o=W(i,!1,!1);if(e)Ft(o.asyncContext,o.callback);else{var a=!1;o.options&&(a=!!o.options.isInline);var s={base64String:t,name:n,isInline:a,__timeout__:Ae};Qi(s),P(148,o.asyncContext,o.callback,s,void 0,void 0,e)}}}function Qi(e){qt("base64Encoded",e.base64String),G(e.base64String.length,0,Ce,"base64File"),Ji(e.name)}function Ki(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];B(2,"item.addItemAttachmentAsync");var r=this&&this.isLoadedItem,o=W(n,!1,!1);if(r)Ft(o.asyncContext,o.callback);else{var a={itemId:e,name:t};Xi(a),P(19,o.asyncContext,o.callback,{itemId:re(a.itemId),name:a.name,__timeout__:Ae},void 0,void 0,void 0)}}function Xi(e){qt("itemId",e.itemId),qt("attachmentName",e.name),G(e.itemId.length,0,200,"itemId"),G(e.name.length,0,255,"attachmentName")}function Yi(){P(41,void 0,void 0,void 0,void 0,void 0,void 0)}function $i(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,"item.getAttachmentsAsync");var i=W(t,!0,!1);P(149,i.asyncContext,i.callback,void 0,Oi,void 0,e)}}function Zi(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(2,"item.getSelectedDataAsync");var i=W(t,!0,!1),r={coercionType:_t(e)};if(void 0===r.coercionType)throw N("coercionType");P(28,i.asyncContext,i.callback,r,void 0,void 0,void 0)}function er(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var r=W(n,!0,!1);if(e)Ft(r.asyncContext,r.callback);else{B(2,"item.getSelectedDataAsync");var o={coercionType:_t(t)};if(void 0===o.coercionType)throw N("coercionType");P(28,r.asyncContext,r.callback,o,void 0,void 0,e)}}}function tr(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];B(2,"item.removeAttachmentAsync");var r=W(n,!1,!1);if(e)Ft(r.asyncContext,r.callback);else{var o={attachmentIndex:t};nr(o),P(20,r.asyncContext,r.callback,o,void 0,void 0,e)}}}function nr(e){qt("attachmentId",e.attachmentIndex),G(e.attachmentIndex.length,0,200,"attachmentId")}function ir(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(2,"item.saveAsync");var i=W(t,!1,!1);P(32,i.asyncContext,i.callback,void 0,void 0,void 0,e)}}function rr(e){if(!Array.isArray(e.recipientArray))throw N("recipients");if(e.recipientArray.length>100)throw D("recipients",e.recipientArray.length);var t=e.recipientArray.map((function(e){if(i(e))throw N("recipients");if("string"==typeof e)return or(e,e),ar(e,e);if("object"==typeof e)return or(e.displayName,e.emailAddress),ar(e.displayName,e.emailAddress);throw N("recipients")}));e.recipientArray=t}function or(e,t){if(!e&&!t)throw N("recipients");if("string"==typeof e&&e.length>255)throw D("recipients",e.length,H("l_DisplayNameTooLong_Text"));if("string"==typeof t&&t.length>571)throw D("recipients",t.length,H("l_EmailAddressTooLong_Text"));if("string"!=typeof e&&"string"!=typeof t)throw N("recipients")}function ar(e,t){return{address:t,name:e}}function sr(e,t){return function(n){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];B(2,e+".addAsync");var o=W(i,!1,!1);if(t)Ft(o.asyncContext,o.callback);else{var a={recipientField:L[e],recipientArray:n};rr(a),P(22,o.asyncContext,o.callback,a,void 0,void 0,t)}}}function cr(e,t){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];B(1,e+".getAsync");var r=W(n,!0,!1);P(15,r.asyncContext,r.callback,{recipientField:L[e]},lr,void 0,t)}}function lr(e){return null==e?[]:e.map((function(e){return kn(e)}))}function ur(e,t){return function(n){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];B(2,e+".setAsync");var o=W(i,!1,!1);if(t)Ft(o.asyncContext,o.callback);else{var a={recipientField:L[e],recipientArray:n};rr(a),P(21,o.asyncContext,o.callback,a,void 0,void 0,t)}}}function fr(e,t){return ze({},{addAsync:sr(e,t),getAsync:cr(e,t),setAsync:ur(e,t)})}function dr(e,t){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];B(1,e+".getAsync");var r=W(n,!0,!1);P(107,r.asyncContext,r.callback,void 0,pr,void 0,t)}}function pr(e){return i(e)?null:kn(e)}function hr(e,t){return ze({},{getAsync:dr(e,t)})}function gr(e){if(i(e))throw N("internetHeaders");if(!Array.isArray(e))throw j("internetHeaders",typeof e,"Array");if(0===e.length)throw N("internetHeaders");for(var t=0,n=e;t<n.length;t++){qt("internetHeaders",n[t])}}function mr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(2,"internetHeaders.removeAsync");var i=this&&this.isLoadedItem,r=W(t,!1,!1);if(i)Ft(r.asyncContext,r.callback);else{var o={internetHeaderKeys:e};vr(o),P(153,r.asyncContext,r.callback,o,void 0,void 0,i)}}function vr(e){gr(e.internetHeaderKeys)}function yr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(1,"internetHeaders.getAsync");var i=this&&this.isLoadedItem,r=W(t,!0,!1),o={internetHeaderKeys:e};Or(o),P(151,r.asyncContext,r.callback,o,void 0,void 0,i)}function Or(e){gr(e.internetHeaderKeys)}var br;function Sr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(2,"internetHeaders.setAsync");var i=this&&this.isLoadedItem,r=W(t,!1,!1);if(i)Ft(r.asyncContext,r.callback);else{var o={internetHeaderNameValuePairs:e};_r(o),P(152,r.asyncContext,r.callback,o,void 0,void 0,i)}}function _r(e){if(i(e.internetHeaderNameValuePairs))throw M("internetHeaders");var t=Object.keys(e.internetHeaderNameValuePairs);if(0===t.length)throw N("internetHeaders");for(var n=0,r=t;n<r.length;n++){var o=r[n],a=e.internetHeaderNameValuePairs[o];if(qt("internetHeaders",o),"string"!=typeof a)throw j("internetHeaders",typeof a,"string");G(o.length+a.length,0,998,o)}}function Ar(e,t){var n=ze({},{isLoadedItem:t,getAsync:yr});return e&&ze(n,{removeAsync:mr,setAsync:Sr}),n}function Cr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,"item.getItemIdAsync");var i=W(t,!0,!1);P(164,i.asyncContext,i.callback,void 0,void 0,void 0,e)}}function Er(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,"item.getComposeTypeAsync");var i=W(t,!0,!1);P(174,i.asyncContext,i.callback,void 0,void 0,void 0,e)}}function Ir(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,"isClientSignatureEnabledAsync");var i=W(t,!0,!1);P(175,i.asyncContext,i.callback,void 0,void 0,void 0,e)}}function wr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(2,"disableClientSignatureAsync");var i=W(t,!0,!1);e?Ft(i.asyncContext,i.callback):P(176,i.asyncContext,i.callback,void 0,void 0,void 0,e)}}function Pr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(2,"sessionData.getAsync");var i=W(t,!0,!1),r={name:e};Tr(r),P(186,i.asyncContext,i.callback,r,void 0,void 0,void 0)}function xr(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var r=W(n,!0,!1);if(e)Ft(r.asyncContext,r.callback);else{B(2,"sessionData.getAsync");var o={name:t};Tr(o),P(186,r.asyncContext,r.callback,o,void 0,void 0,e)}}}function Tr(e){qt("name",e.name)}function Rr(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];B(2,"sessionData.setAsync");var r=W(n,!1,!1),o={name:e,value:t};kr(o),P(185,r.asyncContext,r.callback,o,void 0,void 0,void 0)}function Fr(e){return function(t,n){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];var o=W(i,!1,!1);if(e)Ft(o.asyncContext,o.callback);else{B(2,"sessionData.setAsync");var a={name:t,value:n};kr(a),P(185,o.asyncContext,o.callback,a,void 0,void 0,e)}}}function kr(e){qt("name",e.name),function(e,t){if(i(t))throw M(e);if("string"!=typeof t)throw j(e,typeof t,"string")}("value",e.value)}function Nr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B(2,"sessionData.getAllAsync");var n=W(e,!0,!1);P(187,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function Mr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=W(t,!0,!1);e?Ft(i.asyncContext,i.callback):(B(2,"sessionData.getAllAsync"),P(187,i.asyncContext,i.callback,void 0,void 0,void 0,e))}}function Dr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B(2,"sessionData.clearAsync");var n=W(e,!1,!1);P(188,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function jr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=W(t,!1,!1);e?Ft(i.asyncContext,i.callback):(B(2,"sessionData.clearAsync"),P(188,i.asyncContext,i.callback,void 0,void 0,void 0,e))}}function Ur(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(2,"sessionData.removeAsync");var i=W(t,!1,!1),r={name:e};Lr(r),P(189,i.asyncContext,i.callback,r,void 0,void 0,void 0)}function Hr(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var r=W(n,!1,!1);if(e)Ft(r.asyncContext,r.callback);else{B(2,"sessionData.removeAsync");var o={name:t};Lr(o),P(189,r.asyncContext,r.callback,o,void 0,void 0,e)}}}function Lr(e){qt("name",e.name)}function Br(e){return f("MultiSelectV2")?ze({},{getAsync:xr(e),setAsync:Fr(e),getAllAsync:Mr(e),clearAsync:jr(e),removeAsync:Hr(e)}):ze({},{getAsync:Pr,setAsync:Rr,getAllAsync:Nr,clearAsync:Dr,removeAsync:Ur})}function Wr(e){if(!e)throw N("sensitivityLabel");if("string"!=typeof e&&!e.id)throw N("sensitivityLabel.id",void 0);if("string"!=typeof e&&e.id&&null!=(e=e).children)throw N(void 0,H("l_SensitivityUnableToSetParent_Text"))}function qr(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];B(2,"sensitivityLabel.setAsync");var r=W(n,!1,!1);if(e)Ft(r.asyncContext,r.callback);else{Wr(t);var o=Jr(t),a={sensitivityLabelID:o};P(200,r.asyncContext,r.callback,a,void 0,void 0,e)}}}function Jr(e){return"string"!=typeof e&&void 0!==e.id?e.id:e}function Vr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(2,"sensitivityLabel.getAsync");var i=W(t,!0,!1);P(201,i.asyncContext,i.callback,void 0,void 0,void 0,e)}}function Gr(e){return ze({},{getAsync:Vr(e),setAsync:qr(e)})}function zr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B(2,"item.closeAsync");var n=W(e,!1,!1),i=!1;n.options&&(i=!!n.options.discardItem);var r={discardItem:i};P(203,n.asyncContext,n.callback,r,void 0,void 0,void 0)}function Qr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,"item.getItemClassAsync");var i=W(t,!0,!1);P(210,i.asyncContext,i.callback,void 0,void 0,void 0,e)}}function Kr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,"item.getConversationIndexAsync");var i=W(t,!0,!1);P(213,i.asyncContext,i.callback,void 0,void 0,void 0,e)}}function Xr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=W(t,!1,!1);!e&&f("UILessCommandsV2")?(B(2,"item.sendAsync"),P(215,i.asyncContext,i.callback,void 0,void 0,void 0,e)):Ft(i.asyncContext,i.callback)}}function Yr(e){if(i(e))throw M("locationIdentifier");if(!Array.isArray(e))throw j("locationIdentifier",typeof e,"Array");if(0===e.length)throw N("locationIdentifier");for(var t=0,n=e;t<n.length;t++){$r(n[t])}}function $r(e){if(i(e)||i(e.id)||i(e.type))throw M("locationIdentifier");if(e.type!==K.LocationType.Room&&e.type!==K.LocationType.Custom)throw N("type");!function(e,t){if(""===e)throw N("id");if(t===K.LocationType.Room&&e.length>q)throw N("id")}(e.id,e.type)}function Zr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(2,"enhancedLocations.addAsync");var i=W(t,!1,!1),r={enhancedLocations:e};eo(r),P(155,i.asyncContext,i.callback,r,void 0,void 0,void 0)}function eo(e){Yr(e.enhancedLocations)}function to(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B(1,"enhancedLocations.getAsync");var n=W(e,!0,!1);P(154,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function no(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(2,"enhancedLocations.removeAsync");var i=W(t,!1,!1),r={enhancedLocations:e};io(r),P(156,i.asyncContext,i.callback,r,void 0,void 0,void 0)}function io(e){Yr(e.enhancedLocations)}function ro(e){var t=ze({},{getAsync:to});return e&&ze(t,{addAsync:Zr,removeAsync:no}),t}function oo(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,e+".getAsync");var i=W(t,!0,!1);P(24,i.asyncContext,i.callback,{TimeProperty:br[e]},ao,void 0,void 0)}}function ao(e){return new Date(e)}!function(e){e[e.start=1]="start",e[e.end=2]="end"}(br||(br={}));function so(e){return function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];B(2,e+".setAsync");var r=W(n,!1,!1),o={date:t};co(o),P(25,r.asyncContext,r.callback,{TimeProperty:br[e],time:o.date.getTime()},void 0,void 0,void 0)}}function co(e){if(!me(e.date))throw j("dateTime",typeof e.date,typeof Date);if(isNaN(e.date.getTime()))throw N("dateTime");if(e.date.getTime()<-864e13||e.date.getTime()>864e13)throw D("dateTime")}function lo(e){return ze({},{getAsync:oo(e),setAsync:so(e)})}function uo(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B(1,"location.getAsync");var n=W(e,!0,!1);P(26,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}var fo;function po(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(2,"location.setAsync");var i=W(t,!1,!1),r={location:e};ho(r),P(27,i.asyncContext,i.callback,r,void 0,void 0,void 0)}function ho(e){if(i(e.location))throw M("location");if("string"!=typeof e.location)throw j("location",typeof e.location,"string");G(e.location.length,0,255,"location")}function go(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B(1,"recurrenceProperties.getAsync");var n=W(e,!0,!1);P(103,n.asyncContext,n.callback,void 0,mo,void 0,void 0)}function mo(e){if(null!==e&&null!==e.seriesTimeJson){var t=new Mi;t.importFromSeriesTimeJsonObject(e.seriesTimeJson),delete e.seriesTimeJson,e.seriesTime=t}return e}function vo(e){if(!i(e)){if(i((e=e).recurrenceType))throw M(_i);if(i(e.seriesTime))throw M(Ai);if(!(e.seriesTime instanceof Mi&&e.seriesTime.isValid()))throw N(Ai);if(!e.seriesTime.isEndAfterStart())throw N(Ai,H("l_InvalidEventDates_Text"));if(function(e){if(e!==K.RecurrenceType.Daily&&e!==K.RecurrenceType.Weekly&&e!==K.RecurrenceType.Weekday&&e!==K.RecurrenceType.Yearly&&e!==K.RecurrenceType.Monthly)throw N(_i)}(e.recurrenceType),e.recurrenceType!==K.RecurrenceType.Weekday&&i(e.recurrenceProperties))throw M(_i);if(!i(e.recurrenceTimeZone)){if(i(e.recurrenceTimeZone.name))throw M(Ci);if("string"!=typeof e.recurrenceTimeZone.name)throw j(Ci,typeof e.recurrenceTimeZone.name,"string")}e.recurrenceType===K.RecurrenceType.Daily?yo(e.recurrenceProperties):e.recurrenceType===K.RecurrenceType.Weekly?function(e){if(yo(e),i(e.days))throw j(Ii);if(!Array.isArray(e.days))throw j(Ii);if(function(e){for(var t=0;t<e.length;t++)if(!Oo(e[t],!1))throw N(Ii)}(e.days),!i(e.firstDayOfWeek)){if("string"!=typeof e.firstDayOfWeek)throw j(Ri);if(!Oo(e.firstDayOfWeek,!1))throw N(Ri)}}(e.recurrenceProperties):e.recurrenceType===K.RecurrenceType.Monthly?function(e){if(i(e.interval))throw M(Ei);if("number"!=typeof e.interval)throw j(Ei,typeof e.interval,"number");if(i(e.dayOfMonth)){if(i(e.dayOfWeek)||i(e.weekNumber))throw N(void 0,H("l_Recurrence_Error_Properties_Invalid_Text"));if("string"!=typeof e.dayOfWeek)throw j(Pi,typeof e.dayOfWeek,"string");if(!Oo(e.dayOfWeek,!0))throw N(Pi);if("string"!=typeof e.weekNumber)throw j(xi,typeof e.weekNumber,"string");bo(e.weekNumber)}else{if("number"!=typeof e.dayOfMonth)throw j(wi,typeof e.dayOfMonth,"number");So(e.dayOfMonth)}}(e.recurrenceProperties):e.recurrenceType===K.RecurrenceType.Yearly&&function(e){if(i(e.interval))throw M(Ei);if("number"!=typeof e.interval)throw j(Ei,typeof e.interval,"number");if(i(e.month))throw M(Ti);if("string"!=typeof e.month)throw j(Ti,typeof e.month,"string");if(function(e){if(e!==K.Month.Jan&&e!==K.Month.Feb&&e!==K.Month.Mar&&e!==K.Month.Apr&&e!==K.Month.May&&e!==K.Month.Jun&&e!==K.Month.Jul&&e!==K.Month.Aug&&e!==K.Month.Sep&&e!==K.Month.Oct&&e!==K.Month.Nov&&e!==K.Month.Dec)throw N(Ti)}(e.month),i(e.dayOfMonth)){if(i(e.weekNumber)||i(e.dayOfWeek))throw N(void 0,H("l_Recurrence_Error_Properties_Invalid_Text"));if("string"!=typeof e.dayOfWeek)throw j(Pi,typeof e.dayOfWeek,"string");if(!Oo(e.dayOfWeek,!0))throw N(Pi);if("string"!=typeof e.weekNumber)throw j(xi,typeof e.weekNumber,"string");bo(e.weekNumber)}else{if("number"!=typeof e.dayOfMonth)throw j(wi,typeof e.dayOfMonth,"number");So(e.dayOfMonth)}}(e.recurrenceProperties)}}function yo(e){if(i(e.interval))throw M(Ei);if("number"!=typeof e.interval)throw j(Ei,typeof e.interval,"number");if(e.interval<=0)throw N(Ei)}function Oo(e,t){var n=e===K.Days.Mon||e===K.Days.Tue||e===K.Days.Wed||e===K.Days.Thu||e===K.Days.Fri||e===K.Days.Sat||e===K.Days.Sun;return t&&(e===K.Days.WeekendDay||e===K.Days.Weekday||e===K.Days.Day)||n}function bo(e){if(e!==K.WeekNumber.First&&e!==K.WeekNumber.Second&&e!==K.WeekNumber.Third&&e!==K.WeekNumber.Fourth&&e!==K.WeekNumber.Last)throw N(xi)}function So(e){if(e<1||e>31)throw N(wi)}function _o(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(2,"recurrenceProperties.setAsync");var r=To().seriesId;if(!i(r)&&r.length>0)throw N(void 0,H("l_Recurrence_Error_Instance_SetAsync_Text"));vo(e);var o=W(t,!1,!1),a=Ao(e),s={recurrenceData:a};P(104,o.asyncContext,o.callback,s,void 0,void 0,void 0)}function Ao(e){if(null!==e&&null!==e.seriesTime&&e.seriesTime instanceof Mi)return{recurrenceProperties:e.recurrenceProperties,recurrenceTimeZone:e.recurrenceTimeZone,recurrenceType:e.recurrenceType,seriesTimeJson:e.seriesTime.exportToSeriesTimeJson()};return e}function Co(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B(1,"isAllDayEvent.getAsync");var n=W(e,!0,!1);P(169,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function Eo(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(2,"isAllDayEvent.setAsync");var i=W(t,!0,!1),r={isAllDayEvent:e};Io(r),P(170,i.asyncContext,i.callback,r,void 0,void 0,void 0)}function Io(e){if(i(e.isAllDayEvent))throw M("isAllDayEvent");if("boolean"!=typeof e.isAllDayEvent)throw j("isAllDayEvent",typeof e.isAllDayEvent,"boolean")}function wo(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(2,"sensitivity.setAsync");var i=W(t,!0,!1),r={sensitivity:e};Po(r),P(172,i.asyncContext,i.callback,r,void 0,void 0,void 0)}function Po(e){qt("sensitivity",e.sensitivity),function(e){if(e!==K.AppointmentSensitivityType.Normal&&e!==K.AppointmentSensitivityType.Personal&&e!==K.AppointmentSensitivityType.Private&&e!==K.AppointmentSensitivityType.Confidential)throw N("sensitivity")}(e.sensitivity)}function xo(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B(1,"sensitivity.getAsync");var n=W(e,!0,!1);P(171,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function To(){var e,t;return ze({},{body:Bt(yt.Compose),categories:An(),end:lo("end"),enhancedLocation:ro(!0),itemType:"appointment",location:ze({},{getAsync:uo,setAsync:po}),notificationMessages:ln(),optionalAttendees:fr("optionalAttendees"),organizer:hr("organizer"),recurrence:(e=!0,t=ze({},{getAsync:go}),e&&ze(t,{setAsync:_o}),t),requiredAttendees:fr("requiredAttendees"),seriesId:ea("seriesId"),start:lo("start"),subject:Bi(!1),addFileAttachmentAsync:Vi(),addFileAttachmentFromBase64Async:zi(),addItemAttachmentAsync:Ki,close:Yi,getAttachmentsAsync:$i(),getAttachmentContentAsync:Cn(),getInitializationContextAsync:st(),getItemIdAsync:Cr(),getSelectedDataAsync:f("MultiSelectV2")?er():Zi,loadCustomPropertiesAsync:mt(),removeAttachmentAsync:tr(),saveAsync:ir(),setSelectedDataAsync:jt(29),isAllDayEvent:ze({},{getAsync:Co,setAsync:Eo}),sensitivity:ze({},{getAsync:xo,setAsync:wo}),isClientSignatureEnabledAsync:Ir(),disableClientSignatureAsync:wr(),sensitivityLabel:Gr(),sessionData:Br(),sendAsync:Xr()})}function Ro(e){var t={consentState:e,extensionId:ea("extensionId")};!function(e){if(e!==fo.Consented&&e!==fo.NotConsented&&e!==fo.NotResponded)throw D("consentState")}(e),P(40,void 0,void 0,t,void 0,void 0,void 0)}function Fo(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=W(t,!1,!1),r={module:e};ko(e),e===K.ModuleType.Addins&&(i.options&&i.options.queryString?r.queryString=i.options.queryString:r.queryString=""),P(45,i.asyncContext,i.callback,r,void 0,void 0,void 0)}function ko(e){if(i(e))throw M("module");if(""===e)throw N("module");if(e!==K.ModuleType.Addins)throw N("module")}function No(e){if(i(e))throw M("data");P(402,void 0,void 0,e,void 0,void 0,void 0)}function Mo(e){if(i(e))throw M("data");P(401,void 0,void 0,e,void 0,void 0,void 0)}function Do(e){if(i(e))throw M("data");P(400,void 0,void 0,e,void 0,void 0,void 0)}function jo(e){if(i(e))throw M("data");P(163,void 0,void 0,{telemetryData:e},void 0,void 0,void 0)}function Uo(e){if(i(e))throw M("data");P(193,void 0,void 0,{telemetryData:e},void 0,void 0,void 0)}!function(e){e[e.NotResponded=0]="NotResponded",e[e.NotConsented=1]="NotConsented",e[e.Consented=2]="Consented"}(fo||(fo={}));var Ho=function(){return(Ho=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function Lo(e){if(!me(e))throw N("timeValue");var t=new Date(e.getTime()),n=-1*t.getTimezoneOffset();return i(ea("timeZoneOffsets"))||(t.setUTCMinutes(t.getUTCMinutes()-n),n=Yn(t),t.setUTCMinutes(t.getUTCMinutes()+n)),Ho({timezoneOffset:n},Zn(t))}function Bo(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=W(t,!1,!1),r={ewsIdOrEmail:e};Wo(r),P(43,i.asyncContext,i.callback,{ewsIdOrEmail:e.trim()},void 0,void 0,void 0)}function Wo(e){if(i(e.ewsIdOrEmail))throw M("ewsIdOrEmail");if(function(e){if("string"!=typeof e)throw N("ewsIdOrEmail")}(e.ewsIdOrEmail),""===e.ewsIdOrEmail)throw N("ewsIdOrEmail","ewsIdOrEmail cannot be empty.")}function qo(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];B(1,"item.getSharedPropertiesAsync");var i=W(t,!0,!1);P(108,i.asyncContext,i.callback,void 0,void 0,void 0,e)}}function Jo(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B(3,"getSelectedItemsAsync");var n=W(e,!0,!1);P(196,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}n(0);var Vo=function(){var e,t,n,i,r,o,a,s,c=void 0;switch(ot()){case rt.Message:c=qi();break;case rt.MessageCompose:s=ze({},{bcc:fr("bcc",o),body:Bt(yt.Compose,o,a),categories:An(o),cc:fr("cc",o),conversationId:Lt("conversationId",a),from:hr("from",o),internetHeaders:Ar(!0,o),itemType:"message",notificationMessages:ln(o),seriesId:Lt("seriesId",a),subject:Bi(!1,o),to:fr("to",o),addFileAttachmentAsync:Vi(o),addFileAttachmentFromBase64Async:zi(o),addItemAttachmentAsync:Ki,close:Yi,closeAsync:zr,getAttachmentsAsync:$i(o),getAttachmentContentAsync:Cn(o),getInitializationContextAsync:st(o),getItemIdAsync:Cr(o),getSelectedDataAsync:f("MultiSelectV2")?er(o):Zi,loadCustomPropertiesAsync:mt(o),removeAttachmentAsync:tr(o),saveAsync:ir(o),setSelectedDataAsync:jt(29,o),delayDeliveryTime:Un(!0,o),getComposeTypeAsync:Er(o),isClientSignatureEnabledAsync:Ir(o),disableClientSignatureAsync:wr(o),sessionData:Br(o),sensitivityLabel:Gr(o),getItemClassAsync:Qr(o),inReplyTo:Lt("inReplyTo",a),getConversationIndexAsync:Kr(o),sendAsync:Xr(o)}),f("MultiSelectV2")&&o&&ze(s,{isLoadedItem:o,unloadAsync:Wi}),c=s;break;case rt.Appointment:e=ea("organizer"),t=ea("dateTimeCreated"),n=ea("dateTimeModified"),i=ea("end"),r=ea("start"),c=ze({},{attachments:Oi(ea("attachments")),body:Bt(yt.Read),categories:An(),dateTimeCreated:t?new Date(t):void 0,dateTimeModified:n?new Date(n):void 0,end:i?new Date(i):void 0,enhancedLocation:ro(!1),itemClass:ea("itemClass"),itemId:ea("id"),itemType:"appointment",location:ea("location"),normalizedSubject:ea("normalizedSubject"),notificationMessages:ln(),optionalAttendees:(ea("cc")||[]).map(kn),organizer:e?kn(e):void 0,recurrence:Di(ea("recurrence")),requiredAttendees:(ea("to")||[]).map(kn),start:r?new Date(r):void 0,seriesId:ea("seriesId"),subject:ea("subject"),displayReplyForm:gn(void 0),displayReplyFormAsync:vn(void 0),displayReplyAllForm:mn(void 0),displayReplyAllFormAsync:yn(void 0),getAttachmentContentAsync:Cn(),getEntities:di(),getEntitiesByType:pi(),getFilteredEntitiesByName:hi(),getInitializationContextAsync:st(),getRegExMatches:gi(),getRegExMatchesByName:mi(),getSelectedEntities:vi(),getSelectedRegExMatches:yi(),loadCustomPropertiesAsync:mt(),isAllDayEvent:ea("isAllDayEvent"),sensitivity:ea("sensitivity")});break;case rt.AppointmentCompose:c=To();break;case rt.MeetingRequest:c=qi();break;default:return}return function(e,t){e&&ea("isFromSharedFolder")&&ot()!==rt.ItemLess&&ze(e,{getSharedPropertiesAsync:qo(t)})}(c,!1),c};function Go(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B(2,"sensitivityLabelsCatalog.getAsync");var n=W(e,!0,!1);P(199,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function zo(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B(2,"sensitivityLabelsCatalog.getIsEnabledAsync");var n=W(e,!0,!1);P(202,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function Qo(){return ze({},{getAsync:Go,getIsEnabledAsync:zo})}function Ko(e){if(!e)throw M("permissions");if(!Array.isArray(e))throw j("permissions",typeof e,typeof Array);if(0===e.length)throw M("permissions");e.forEach((function(e){if(!(e in z))throw D("permissions",e)}))}function Xo(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];B(2,"devicePermission.requestPermissionsAsync");var i=W(t,!0,!1);Ko(e);var r={permissions:e};P(214,i.asyncContext,i.callback,r,void 0,void 0,void 0)}function Yo(){return ze({},{requestPermissionsAsync:Xo})}var $o,Zo=n(0),ea=function(e){return $o&&$o.getInitialDataProp(e)},ta=function(){return!$o||!$o.item},na=function(){return $o&&$o.getAppName()},ia=function(){function e(t,n,i){var o=this;this.displayName="mailbox",this.stringLoadedCallback=function(){o.appReadyCallback&&(o.officeAppContext.get_isDialog()?setTimeout((function(){return o.appReadyCallback()}),0):function(e,t,n,i){T(e,t,n,i)}(1,void 0,o.onInitialDataResponse))},this.initialize=function(e){if(null==e)h(),o.initialData=null,o.item=null;else{o.initialData=e,o.initialData.permissionLevel=ra(),o.item=Vo();!0,void 0!==MailboxFunctionMappings&&void 0!==Office&&void 0!==Office.context&&(Object.defineProperty(Office.context,"displayLanguage",{value:ea("displayLanguage")}),Object.defineProperty(Office.context,"contentLanguage",{value:ea("contentLanguage")}),Object.defineProperty(Office.context,"diagnostics",{value:{host:Office.HostType.Outlook,platform:Office.PlatformType.PC,version:ea("officeVersion")}}),Object.defineProperty(Office.context,"platform",{value:Office.PlatformType.PC}),Object.defineProperty(Office.context,"requirements",{value:{isSetSupported:oa}})),h(),void 0!==e.itemNumber&&p().setCurrentItemNumber(e.itemNumber)}},this.exposeDevicePermissionApi=function(){if(na()==Zo.AppName.OutlookWebApp){window.OfficeCore||(window.OfficeCore={}),window.OfficeCore.DevicePermissionType={camera:0,microphone:1,geolocation:2},o.officeAppContext.devicePermission=Yo}},this.onInitialDataResponse=function(e,t){if(!e||e===r.noError){var n;o.initialize(t),ze(n=o,{ewsUrl:ea("ewsUrl"),restUrl:ea("restUrl"),displayAppointmentForm:ae,displayAppointmentFormAsync:se,displayMessageForm:fe,displayMessageFormAsync:de,displayPersonaCardAsync:Bo,getCallbackTokenAsync:Ue,getUserIdentityTokenAsync:He,logTelemetry:jo,logCustomerContentTelemetry:Uo,makeEwsRequestAsync:Ve,masterCategories:ze({},{addAsync:$e,getAsync:Ze,removeAsync:nt}),navigateToModuleAsync:Fo,diagnostics:ze({},{hostName:"Outlook",hostVersion:ea("hostVersion"),OWAView:ea("owaView")}),userProfile:ze({},{accountType:ea("userProfileType"),displayName:ea("userDisplayName"),emailAddress:ea("userEmailAddress"),timeZone:ea("userTimeZone")}),convertToEwsId:Z,convertToLocalClientTime:Lo,convertToRestId:$,convertToUtcClientTime:$n,getSelectedItemsAsync:Jo,RegisterConsentAsync:Ro,GetIsRead:function(){return ea("isRead")},GetEndPointUrl:function(){return ea("endNodeUrl")},GetConsentMetaData:function(){return ea("consentMetadata")},GetMarketplaceContentMarket:function(){return ea("marketplaceContentMarket")},GetMarketplaceAssetId:function(){return ea("marketplaceAssetId")},GetExtensionId:function(){return ea("extensionId")},CloseApp:it,recordDataPoint:No,recordTrace:Mo,trackCtq:Do}),ot()!==rt.MessageCompose&&ot()!==rt.AppointmentCompose&&ze(n,{displayNewAppointmentForm:ye,displayNewMessageForm:Ie,displayNewAppointmentFormAsync:Oe,displayNewMessageFormAsync:we});var i=o.officeAppContext;i.sensitivityLabelsCatalog=Qo,o.exposeDevicePermissionApi(),i.urls=ea("urls"),setTimeout((function(){return o.appReadyCallback()}),0)}},this.officeAppContext=t,this.targetWindow=window,this.appReadyCallback=i,$o=this,e.shouldRunInitialDataResponse()&&this.onInitialDataResponse(r.noError,GlobalMailboxInitialData)}return e.prototype.getAppName=function(){return 8,8},e.prototype.getInitialDataProp=function(e){return this.initialData&&this.initialData[e]},e.prototype.setCurrentItemNumber=function(e){p().setCurrentItemNumber(e)},e.addAdditionalArgs=function(e,t){return t},e.shouldRunInitialDataResponse=function(){return!0},e}(),ra=function(){var e=ea("permissionLevel");if(void 0===e)return 0;switch(e){case 1:return 1;case 3:return 2;case 2:return 3;default:return 0}};function oa(e,t){if(null==e)return!1;null==t&&(t=0);var n=JSON.parse(ea("requirementSets").toLowerCase());if(n.hasOwnProperty(e.toLowerCase())){var i=n[e.toLowerCase()];try{var r=aa(i),o=aa(t+="");if(r.major>0&&r.major>o.major)return!0;if(r.major>0&&r.minor>=0&&r.major==o.major&&r.minor>=o.minor)return!0}catch(e){return!1}}return!1}function aa(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}}var sa=n(0);function ca(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=W(t,!1,!1);if(void 0!==SerializeRoamingSettings){var r=SerializeRoamingSettings(e);JSON.stringify(r).length>32768&&i.callback&&setTimeout((function(){i.callback&&i.callback(x(void 0,sa.DDA.AsyncResultEnum.ErrorCode.Failed,9057,i.asyncContext,""))}),0),la(i,r)}}function la(e,t){var n=-1,i=null;try{void 0!==MailboxFunctionMappings&&MailboxFunctionMappings.MailboxHostExecuteApi(194,e.asyncContext,e.callback,null,null,[JSON.stringify(t)])}catch(e){i=e}var r=void 0;null!=i?(n=9019,r=x(void 0,sa.DDA.AsyncResultEnum.ErrorCode.Failed,n,e.asyncContext,i)):(n=0,r=x(void 0,sa.DDA.AsyncResultEnum.ErrorCode.Success,n,e.asyncContext)),e.callback&&e.callback(r)}var ua=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i},fa=(n(0),function(){function e(e){this.rawData=e,this.settingsData=null}return e.prototype.getSettingsData=function(){return null==this.settingsData&&(this.settingsData=this.convertFromRawSettings(this.rawData),this.rawData=null),this.settingsData},e.prototype.get=function(e){return this.getSettingsData()[e]},e.prototype.set=function(e,t){this.getSettingsData()[e]=t},e.prototype.remove=function(e){delete this.getSettingsData()[e]},e.prototype.saveAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ca.apply(void 0,ua([this.getSettingsData()],e))},e.prototype.convertFromRawSettings=function(e){if(null==e)return{};var t=e.SettingsKey;return t?DeserializeRoamingSettings(t):e},e}()),da={toItemRead:function(e){var t=ot();if(t===rt.Message||t===rt.Appointment||t===rt.MeetingRequest)return e;throw j()},toItemCompose:function(e){var t=ot();if(t===rt.MessageCompose||t===rt.AppointmentCompose)return e;throw j()},toMessage:function(e){return da.toMessageRead(e)},toMessageRead:function(e){if(ot()===rt.Message||ot()===rt.MeetingRequest)return e;throw j()},toMessageCompose:function(e){if(ot()===rt.MessageCompose)return e;throw j()},toMeetingRequest:function(e){if(ot()===rt.MeetingRequest)return e;throw j()},toAppointment:function(e){if(ot()===rt.Appointment)return e;throw j()},toAppointmentRead:function(e){if(ot()===rt.Appointment)return e;throw j()},toAppointmentCompose:function(e){if(ot()===rt.AppointmentCompose)return e;throw j()}},pa={SeriesTimeJsonConverter:function(e){if(null!==e&&"object"==typeof e&&null!==e.seriesTimeJson){var t=new Mi;t.importFromSeriesTimeJsonObject(e.seriesTimeJson),delete e.seriesTimeJson,e.seriesTime=t}return e},CreateAttachmentDetails:function(e){return bi(e),e}};(OSF="object"==typeof OSF?OSF:{}).DDA=OSF.DDA||{},OSF.DDA.Settings=fa,(OSF="object"==typeof OSF?OSF:{}).DDA=OSF.DDA||{},OSF.DDA.OutlookAppOm=ia,(Office="object"==typeof Office?Office:{}).cast=Office.cast||{},Office.cast.item=da,Microsoft.Office.WebExtension.MailboxEnums=K,Microsoft.Office.WebExtension.CoercionType=X,Microsoft.Office.WebExtension.SeriesTime=Mi,Microsoft.Office.WebExtension.OutlookBase=pa,Microsoft.Office.WebExtension.DevicePermissionType=z;t.default=ia;Microsoft.Office.WebExtension.GetLaunchEventType=function(){return ea("launchEventType")}}]).default,Office.MailboxEnums=Office.MailboxEnums||Microsoft.Office.WebExtension.MailboxEnums,Office.CoercionType=Office.CoercionType||Microsoft.Office.WebExtension.CoercionType,Office.SeriesTime=Office.SeriesTime||Microsoft.Office.WebExtension.SeriesTime,Microsoft.Office.WebExtension.EventType.OnNewMessageCompose="olkNewMessageCompose",Microsoft.Office.WebExtension.EventType.OnMessageCompose="olkMessageCompose",Microsoft.Office.WebExtension.EventType.OnNewAppointmentOrganizer="olkNewAppointmentOrganizer",Microsoft.Office.WebExtension.EventType.OnAppointmentOrganizer="olkAppointmentOrganizer",Microsoft.Office.WebExtension.EventType.OnMessageFromChanged="olkMessageFromChanged",Microsoft.Office.WebExtension.EventType.OnAppointmentFromChanged="olkAppointmentFromChanged",Microsoft.Office.WebExtension.EventType.OnMessageReadWithCustomHeader="olkMessageReadWithCustomHeader",Microsoft.Office.WebExtension.EventType.OnMessageReadWithCustomAttachment="olkMessageReadWithCustomAttachment",Object.defineProperty(Office.AsyncResultStatus,"Succeeded",{value:"succeeded"}),Object.defineProperty(Office.AsyncResultStatus,"Failed",{value:"failed"}),Office.context.mailbox=new OSF.DDA.OutlookAppOm(e,{},t),InitRoamingSettings(),InitSensitivityLabelsCatalog(e),InitUrlValues(),InitOfficeContextAuth(),exposeOfficeRuntimeThroughOfficeNamespace(void 0!==OfficeRuntime&&OfficeRuntime||void 0,void 0!==Office&&Office||void 0),InitNestedAppAuthBridge(),MailboxFunctionMappings.SendOmReadyMessageToHost()};let GlobalMailboxInitialData;function OnMailboxOMReady(){}function MailboxCreateOM(e){let t=JSON.parse(e);GlobalMailboxInitialData=JSON.parse(t[0]),MailboxCreateOMHelper(OSF.OfficeAppContext,OnMailboxOMReady,window)}function InitSensitivityLabelsCatalog(e){e.sensitivityLabelsCatalog&&(Office.context.sensitivityLabelsCatalog=e.sensitivityLabelsCatalog())}function InitUrlValues(){let e,t=GlobalMailboxInitialData.urls;t&&(e=JSON.parse(t)),e&&Object.defineProperty(Office.context,"urls",{value:e})}function InitRoamingSettings(){let e,t=GlobalMailboxInitialData.roamingSettings;t&&(e=DeserializeRoamingSettings({SettingsKey:t})),e?Office.context.roamingSettings=new OSF.DDA.Settings(e):console.log("Failed to initialize Roaming Settings. 'roamingSettings' NOT found in initial data blob.")}function getDateJSONPrefix(){return"Date("}function getDateJSONSuffix(){return")"}function isDateObj(e){return"[object Date]"===Object.prototype.toString.apply(e)}function SerializeRoamingSettings(e){let t={};const n=getDateJSONPrefix(),i=getDateJSONSuffix();for(let r in e){let o=e[r];try{o=JSON.stringify(o,(function(e,t){return isDateObj(this[e])?n+this[e].getTime()+i:t})),t[r]=o}catch(e){}}return t}function DeserializeRoamingSettings(e){let t={};e=e||{};const n=getDateJSONPrefix(),i=getDateJSONSuffix();for(let r in e){let o=e[r];try{o=JSON.parse(o,(function(e,t){let r;return"string"==typeof t&&t&&t.length>6&&t.slice(0,5)===n&&t.slice(-1)===i&&(r=new Date(parseInt(t.slice(5,-1))),r)?r:t})),t[r]=o}catch(e){}}return t}self.__osfEnableWindowMapToGlobal||(window={});var OfficeContextAuth=function(){function e(){null==Microsoft.Office.WebExtension.AccountTypeFilter&&(Microsoft.Office.WebExtension.AccountTypeFilter={NoFilter:"noFilter",AAD:"aad",MSA:"msa"}),null==Microsoft.Office.WebExtension.Parameters&&(Microsoft.Office.WebExtension.Parameters={AuthChallenge:"authChallenge",AllowConsentPrompt:"allowConsentPrompt",ForMSGraphAccess:"forMSGraphAccess",AllowSignInPrompt:"allowSignInPrompt",JsonPayload:"jsonPayload",EnableNewHosts:"enableNewHosts",AccountTypeFilter:"accountTypeFilter",Callback:"callback"}),_supportedOptions[Microsoft.Office.WebExtension.Parameters.AuthChallenge]={types:["string"],defaultValue:""},_supportedOptions[Microsoft.Office.WebExtension.Parameters.AllowConsentPrompt]={types:["boolean"],defaultValue:!1},_supportedOptions[Microsoft.Office.WebExtension.Parameters.ForMSGraphAccess]={types:["boolean"],defaultValue:!1},_supportedOptions[Microsoft.Office.WebExtension.Parameters.AllowSignInPrompt]={types:["boolean"],defaultValue:!1},_supportedOptions[Microsoft.Office.WebExtension.Parameters.EnableNewHosts]={types:["number"],defaultValue:0},_supportedOptions[Microsoft.Office.WebExtension.Parameters.AccountTypeFilter]={enum:Microsoft.Office.WebExtension.AccountTypeFilter,defaultValue:Microsoft.Office.WebExtension.AccountTypeFilter.NoFilter}}function t(e){if(e.length>2)throw"Too many arguments";let t,r;for(let n=e.length-1;n>=0;n--){let i=e[n];switch(typeof i){case"object":if(t)throw"Multiple optional objects in parameter list.";t=i;break;case"function":if(r)throw"Multiple optional functions in parameter list.";r=i;break;default:throw"Invalid optional argument."}}if(t=function(e){e=e||{};for(let t in _supportedOptions)if(!n(e,t)){let n=void 0,i=_supportedOptions[t];n||void 0===i.defaultValue||(n=i.defaultValue),e[t]=n}return e}(t),r){if(t[Microsoft.Office.WebExtension.Parameters.Callback])throw"Callback cannot be specified both in argument list and in optional object.";t[Microsoft.Office.WebExtension.Parameters.Callback]=r}return function(e){for(let t in _supportedOptions){let n=_supportedOptions[t],r=e[t];if(n.enum)switch(typeof r){case"string":if(i(n.enum,r))break;case"undefined":throw 5007;default:throw"Function getAccessToken has invalid parameters."}if(n.types&&!i(n.types,typeof r))throw"Function getAccessToken has invalid parameters."}}(t),t}function n(e,t){for(let n in e)if(t==n)return!0;return!1}function i(e,t){for(let n in e)if(t==e[n])return!0;return!1}function r(e){let t={};for(var n in e)t[n]=e[n];return o&&(t=o(t)),t}function o(e){let t={[Microsoft.Office.WebExtension.Parameters.AuthChallenge]:!0,[Microsoft.Office.WebExtension.Parameters.AllowConsentPrompt]:!0,[Microsoft.Office.WebExtension.Parameters.ForMSGraphAccess]:!0,[Microsoft.Office.WebExtension.Parameters.AllowSignInPrompt]:!0,[Microsoft.Office.WebExtension.Parameters.EnableNewHosts]:!0,[Microsoft.Office.WebExtension.Parameters.AccountTypeFilter]:!0},n={};for(let i of Object.keys(t))t[i]&&(n[i]=e[i]),delete e[i];return e[Microsoft.Office.WebExtension.Parameters.JsonPayload]=JSON.stringify(n),e}return _supportedOptions={},e.prototype.getAccessToken=function(e){return new Promise((n,i)=>{try{!function(){let e=r(t(arguments));MailboxFunctionMappings.MailboxHostExecuteApi(195,{},e.callback,null,null,[e.jsonPayload])}(e||{},(function(e){"succeeded"===e.status?n(e.value):i(e.error)}))}catch(e){i(e)}})},e.prototype.getAuthContext=function(){return new Promise((e,t)=>{MailboxFunctionMappings.MailboxHostExecuteApi(205,{},n=>{if("succeeded"===n.status)try{e(function(e){const t=e.userObjectId||"",n=e.tenantId||"",i=e.userPrincipalName||"";return{userObjectId:t,tenantId:n,userPrincipalName:i,authorityType:e.authorityType||"",authorityBaseUrl:e.authorityBaseUrl||"",puid:e.puid||"",loginHint:e.loginHint||i}}(JSON.parse(n.value)))}catch(e){t(e)}else t(n.error)},null,null,[])})},e}();function InitOfficeContextAuth(){void 0!==OfficeRuntime&&(OfficeRuntime=OfficeRuntime||{},Object.defineProperty(OfficeRuntime,"auth",{value:new OfficeContextAuth}))}class NestedAppAuthBridge{constructor(){this.events=[]}postMessage(e){MailboxFunctionMappings.MailboxHostExecuteApi(209,{},e=>{for(var t=0;t<this.events.length;t++){var n=this.events[t];try{n(e.value)}catch(e){}}},null,null,[e])}addEventListener(e,t){"message"===e&&this.events.push(t)}removeEventListener(e,t){"message"===e&&(this.events=this.events.filter(e=>e!==t))}}function InitNestedAppAuthBridge(){if(GlobalMailboxInitialData&&GlobalMailboxInitialData.nativeFlights&&GlobalMailboxInitialData.nativeFlights.NestedAppAuthEnabled){const e=new NestedAppAuthBridge;Object.defineProperty(self,"nestedAppAuthBridge",{enumerable:!1,get:function(){return"function"==typeof self.__initializeNestedAppAuth&&self.__initializeNestedAppAuth(),e}})}}function exposeOfficeRuntimeThroughOfficeNamespace(e,t){var n,i;void 0===e&&"undefined"!=typeof window&&(e=null===window||void 0===window?void 0:window.OfficeRuntime),void 0===e&&(e={}),void 0!==t&&(t.storage=t.storage||(null==e?void 0:e.storage),t.auth=t.auth||(null==e?void 0:e.auth),t.getAccessToken=t.getAccessToken||(null===(n=null==e?void 0:e.auth)||void 0===n?void 0:n.getAccessToken),t.addin=t.addin||(null==e?void 0:e.addin),t.isSetSupported=t.isSetSupported||(null===(i=null==e?void 0:e.apiInformation)||void 0===i?void 0:i.isSetSupported),t.license=t.license||(null==e?void 0:e.license),t.message=t.message||(null==e?void 0:e.message))}exposeOfficeRuntimeThroughOfficeNamespace(void 0!==OfficeRuntime&&OfficeRuntime||void 0,void 0!==Office&&Office||void 0),console.log("Outlook LaunchEvent JS loaded!"),function(e){if(!function(){try{return"object"==typeof process&&"[object process]"===String(process)}catch(e){return!1}}()&&!e.isOfficeReactNative()){try{e.Flights=e.OUtil.parseFlights(!0),e.DisabledChangeGates=e.OUtil.parseDisabledChangeGates(!0)}catch(e){}function t(){OSFPerformance.hostSpecificFileName=e.LoadScriptHelper.getHostBundleJsName(),Office.onReadyInternal((function(){OSFPerfUtil.sendPerformanceTelemetry()})),e._OfficeAppFactory.getHostInfo().hostLocale&&setTimeout((function(){e.OUtil.ensureOfficeStringsJs().catch((function(e){console.error(e)}))}),0)}e._OfficeAppFactory.bootstrap((function(){}),(function(e){e instanceof Error?console.warn(e.message):console.warn(JSON.stringify(e))})),"complete"===document.readyState||"interactive"===document.readyState?t():window.addEventListener("DOMContentLoaded",(function(e){t()}))}}(OSF||(OSF={})),OSFPerformance.hostInitializationEnd=OSFPerformance.now(),OSFPerformance.totalJSHeapSize=OSFPerformance.getTotalJSHeapSize(),OSFPerformance.usedJSHeapSize=OSFPerformance.getUsedJSHeapSize(),OSFPerformance.jsHeapSizeLimit=OSFPerformance.getJSHeapSizeLimit();