/* Visio Web-specific API library */
/* Version: 16.0.9103.3000 */

/*
	Copyright (c) Microsoft Corporation.  All rights reserved.
*/

/*
	Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419.
*/

/*
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license   Licensed under MIT license
*            See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
* @version   2.3.0
*/

var __extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},OfficeExtension,OfficeCore,Visio;(function(n){var t=function(){function n(n,t,i){this.m_actionInfo=n;this.m_isWriteOperation=t;this.m_isRestrictedResourceAccess=i}return Object.defineProperty(n.prototype,"actionInfo",{get:function(){return this.m_actionInfo},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isWriteOperation",{get:function(){return this.m_isWriteOperation},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isRestrictedResourceAccess",{get:function(){return this.m_isRestrictedResourceAccess},enumerable:!0,configurable:!0}),n}();n.Action=t})(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function n(n){this.m_callback=n}return n.prototype._handleResult=function(n){this.m_callback&&this.m_callback()},n}(),i=function(){function i(){}return i.createSetPropertyAction=function(t,i,r,u){var f;n.Utility.validateObjectPath(i);var o={Id:t._nextId(),ActionType:4,Name:r,ObjectPathId:i._objectPath.objectPathInfo.Id,ArgumentInfo:{}},s=[u],e=n.Utility.setMethodArguments(t,o.ArgumentInfo,s);return n.Utility.validateReferencedObjectPaths(e),t._pendingRequest.ensureInstantiateObjectPath(i._objectPath),t._pendingRequest.ensureInstantiateObjectPaths(e),f=new n.Action(o,!0,!1),t._pendingRequest.addAction(f),t._pendingRequest.addReferencedObjectPath(i._objectPath),t._pendingRequest.addReferencedObjectPaths(e),f.referencedObjectPath=i._objectPath,f.referencedArgumentObjectPaths=e,f},i.createMethodAction=function(t,i,r,u,f,e){var h,o,c,s;return n.Utility.validateObjectPath(i),h={Id:t._nextId(),ActionType:3,Name:r,ObjectPathId:i._objectPath.objectPathInfo.Id,ArgumentInfo:{}},o=n.Utility.setMethodArguments(t,h.ArgumentInfo,f),n.Utility.validateReferencedObjectPaths(o),t._pendingRequest.ensureInstantiateObjectPath(i._objectPath),t._pendingRequest.ensureInstantiateObjectPaths(o),c=u!=1,s=new n.Action(h,c,e),t._pendingRequest.addAction(s),t._pendingRequest.addReferencedObjectPath(i._objectPath),t._pendingRequest.addReferencedObjectPaths(o),s.referencedObjectPath=i._objectPath,s.referencedArgumentObjectPaths=o,s},i.createQueryAction=function(t,i,r){var f,u;return n.Utility.validateObjectPath(i),t._pendingRequest.ensureInstantiateObjectPath(i._objectPath),f={Id:t._nextId(),ActionType:2,Name:"",ObjectPathId:i._objectPath.objectPathInfo.Id},f.QueryInfo=r,u=new n.Action(f,!1,!1),t._pendingRequest.addAction(u),t._pendingRequest.addReferencedObjectPath(i._objectPath),u.referencedObjectPath=i._objectPath,u},i.createRecursiveQueryAction=function(t,i,r){n.Utility.validateObjectPath(i);t._pendingRequest.ensureInstantiateObjectPath(i._objectPath);var f={Id:t._nextId(),ActionType:6,Name:"",ObjectPathId:i._objectPath.objectPathInfo.Id,RecursiveQueryInfo:r},u=new n.Action(f,!1,!1);return t._pendingRequest.addAction(u),t._pendingRequest.addReferencedObjectPath(i._objectPath),u.referencedObjectPath=i._objectPath,u},i.createQueryAsJsonAction=function(t,i,r){var f,u;return n.Utility.validateObjectPath(i),t._pendingRequest.ensureInstantiateObjectPath(i._objectPath),f={Id:t._nextId(),ActionType:7,Name:"",ObjectPathId:i._objectPath.objectPathInfo.Id},f.QueryInfo=r,u=new n.Action(f,!1,!1),t._pendingRequest.addAction(u),t._pendingRequest.addReferencedObjectPath(i._objectPath),u.referencedObjectPath=i._objectPath,u},i.createEnsureUnchangedAction=function(t,i,r){n.Utility.validateObjectPath(i);t._pendingRequest.ensureInstantiateObjectPath(i._objectPath);var f={Id:t._nextId(),ActionType:8,Name:"",ObjectPathId:i._objectPath.objectPathInfo.Id,ObjectState:r},u=new n.Action(f,!1,!1);return t._pendingRequest.addAction(u),t._pendingRequest.addReferencedObjectPath(i._objectPath),u.referencedObjectPath=i._objectPath,u},i.createUpdateAction=function(t,i,r){n.Utility.validateObjectPath(i);t._pendingRequest.ensureInstantiateObjectPath(i._objectPath);var f={Id:t._nextId(),ActionType:9,Name:"",ObjectPathId:i._objectPath.objectPathInfo.Id,ObjectState:r},u=new n.Action(f,!0,!1);return t._pendingRequest.addAction(u),t._pendingRequest.addReferencedObjectPath(i._objectPath),u.referencedObjectPath=i._objectPath,u},i.createInstantiateAction=function(t,i){n.Utility.validateObjectPath(i);t._pendingRequest.ensureInstantiateObjectPath(i._objectPath.parentObjectPath);t._pendingRequest.ensureInstantiateObjectPaths(i._objectPath.argumentObjectPaths);var u={Id:t._nextId(),ActionType:1,Name:"",ObjectPathId:i._objectPath.objectPathInfo.Id},r=new n.Action(u,!1,!1);return r.referencedObjectPath=i._objectPath,t._pendingRequest.addAction(r),t._pendingRequest.addReferencedObjectPath(i._objectPath),t._pendingRequest.addActionResultHandler(r,new n.InstantiateActionResultHandler(i)),r},i.createTraceAction=function(t,i,r){var u={Id:t._nextId(),ActionType:5,Name:"Trace",ObjectPathId:0},f=new n.Action(u,!1,!1);return t._pendingRequest.addAction(f),r&&t._pendingRequest.addTrace(u.Id,i),f},i.createTraceMarkerForCallback=function(n,r){var u=i.createTraceAction(n,null,!1);n._pendingRequest.addActionResultHandler(u,new t(r))},i}();n.ActionFactory=i}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function t(t,i){n.Utility.checkArgumentNull(t,"context");this.m_context=t;this.m_objectPath=i;this.m_objectPath&&(t._processingResult||(n.ActionFactory.createInstantiateAction(t,this),t._autoCleanup&&this._KeepReference&&t.trackedObjects._autoAdd(this)))}return Object.defineProperty(t.prototype,"context",{get:function(){return this.m_context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_objectPath",{get:function(){return this.m_objectPath},set:function(n){this.m_objectPath=n},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isNull",{get:function(){return n.Utility.throwIfNotLoaded("isNull",this._isNull,null,this._isNull),this._isNull},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isNullObject",{get:function(){return n.Utility.throwIfNotLoaded("isNullObject",this._isNull,null,this._isNull),this._isNull},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_isNull",{get:function(){return this.m_isNull},set:function(n){this.m_isNull=n;n&&this.m_objectPath&&this.m_objectPath._updateAsNullObject()},enumerable:!0,configurable:!0}),t.prototype._handleResult=function(t){this._isNull=n.Utility.isNullOrUndefined(t);this.context.trackedObjects._autoTrackIfNecessaryWhenHandleObjectResultValue(this,t)},t.prototype._handleIdResult=function(t){this._isNull=n.Utility.isNullOrUndefined(t);n.Utility.fixObjectPathIfNecessary(this,t);this.context.trackedObjects._autoTrackIfNecessaryWhenHandleObjectResultValue(this,t)},t.prototype._handleRetrieveResult=function(n,t){this._handleIdResult(n)},t.prototype._recursivelySet=function(i,r,u,f,e){var c=i instanceof t,v=i,o,a,h,s,l;if(c)if(Object.getPrototypeOf(this)===Object.getPrototypeOf(i))i=JSON.parse(JSON.stringify(i));else throw n._Internal.RuntimeError._createInvalidArgError({argumentName:"properties",errorLocation:this._className+".set"});try{for(s=0;s<u.length;s++)o=u[s],i.hasOwnProperty(o)&&typeof i[o]!="undefined"&&(this[o]=i[o]);for(s=0;s<f.length;s++)o=f[s],i.hasOwnProperty(o)&&typeof i[o]!="undefined"&&(a=c?v[o]:i[o],this[o].set(a,r));for(h=!c,r&&!n.Utility.isNullOrUndefined(h)&&(h=r.throwOnReadOnly),s=0;s<e.length;s++)if(o=e[s],i.hasOwnProperty(o)&&typeof i[o]!="undefined"&&h)throw new n._Internal.RuntimeError({code:n.ErrorCodes.invalidArgument,message:n.Utility._getResourceString(n.ResourceStrings.cannotApplyPropertyThroughSetMethod,o),debugInfo:{errorLocation:o}});for(o in i)if(u.indexOf(o)<0&&f.indexOf(o)<0){if(l=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o),!l)throw new n._Internal.RuntimeError({code:n.ErrorCodes.invalidArgument,message:n.Utility._getResourceString(n.ResourceStrings.propertyDoesNotExist,o),debugInfo:{errorLocation:o}});if(h&&!l.set)throw new n._Internal.RuntimeError({code:n.ErrorCodes.invalidArgument,message:n.Utility._getResourceString(n.ResourceStrings.attemptingToSetReadOnlyProperty,o),debugInfo:{errorLocation:o}});}}catch(y){throw new n._Internal.RuntimeError({code:n.ErrorCodes.invalidArgument,message:n.Utility._getResourceString(n.ResourceStrings.invalidArgument,"properties"),debugInfo:{errorLocation:this._className+".set"},innerError:y});}},t.prototype._recursivelyUpdate=function(t){var o=n._internalConfig.alwaysPolyfillClientObjectUpdateMethod,r,f,e,c,u,l,i,v,y;o||(o=!n.Utility.isSetSupported("RichApiRuntime","1.2"));try{if(r=this[n.Constants.scalarPropertyNames],r||(r=[]),f=this[n.Constants.scalarPropertyUpdateable],!f)for(f=[],u=0;u<r.length;u++)f.push(!1);e=this[n.Constants.navigationPropertyNames];e||(e=[]);var s={},h={},a=0;for(i in t)if(c=r.indexOf(i),c>=0){if(!f[c])throw new n._Internal.RuntimeError({code:n.ErrorCodes.invalidArgument,message:n.Utility._getResourceString(n.ResourceStrings.attemptingToSetReadOnlyProperty,i),debugInfo:{errorLocation:i}});s[i]=t[i];++a}else if(e.indexOf(i)>=0)h[i]=t[i];else throw new n._Internal.RuntimeError({code:n.ErrorCodes.invalidArgument,message:n.Utility._getResourceString(n.ResourceStrings.propertyDoesNotExist,i),debugInfo:{errorLocation:i}});if(a>0)if(o)for(u=0;u<r.length;u++)i=r[u],l=s[i],n.Utility.isUndefined(l)||n.ActionFactory.createSetPropertyAction(this.context,this,i,l);else n.ActionFactory.createUpdateAction(this.context,this,s);for(i in h)v=this[i],y=h[i],v._recursivelyUpdate(y)}catch(p){throw new n._Internal.RuntimeError({code:n.ErrorCodes.invalidArgument,message:n.Utility._getResourceString(n.ResourceStrings.invalidArgument,"properties"),debugInfo:{errorLocation:this._className+".update"},innerError:p});}},t}();n.ClientObject=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function t(n){this.m_context=n;this.m_actions=[];this.m_actionResultHandler={};this.m_referencedObjectPaths={};this.m_instantiatedObjectPaths={};this.m_flags=0;this.m_traceInfos={};this.m_pendingProcessEventHandlers=[];this.m_pendingEventHandlerActions={};this.m_responseTraceIds={};this.m_responseTraceMessages=[];this.m_preSyncPromises=[]}return Object.defineProperty(t.prototype,"flags",{get:function(){return this.m_flags},enumerable:!0,configurable:!0}),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(t){var i,r,u;if(t)for(i=0;i<t.length;i++)r=t[i],this.m_responseTraceIds[r]=r,u=this.m_traceInfos[r],n.Utility.isNullOrUndefined(u)||this.m_responseTraceMessages.push(u)},t.prototype.addAction=function(n){if(this.m_context.batchMode===1){var t=!1;n.actionInfo.ActionType===1&&n.referencedObjectPath.objectPathInfo.ObjectPathType===4&&(t=!0);t||this.m_context.ensureInProgressBatchIfBatchMode()}n.isWriteOperation&&(this.m_flags=this.m_flags|1);n.isRestrictedResourceAccess&&(this.m_flags=this.m_flags|2);this.m_actions.push(n);n.actionInfo.ActionType==1&&(this.m_instantiatedObjectPaths[n.actionInfo.ObjectPathId]=n)},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.addTrace=function(n,t){this.m_traceInfos[n]=t},t.prototype.ensureInstantiateObjectPath=function(t){if(t){if(this.m_instantiatedObjectPaths[t.objectPathInfo.Id])return;if(this.ensureInstantiateObjectPath(t.parentObjectPath),this.ensureInstantiateObjectPaths(t.argumentObjectPaths),!this.m_instantiatedObjectPaths[t.objectPathInfo.Id]){var r={Id:this.m_context._nextId(),ActionType:1,Name:"",ObjectPathId:t.objectPathInfo.Id},i=new n.Action(r,!1,!1);i.referencedObjectPath=t;this.addReferencedObjectPath(t);this.addAction(i)}}},t.prototype.ensureInstantiateObjectPaths=function(n){if(n)for(var t=0;t<n.length;t++)this.ensureInstantiateObjectPath(n[t])},t.prototype.addReferencedObjectPath=function(t){if(!this.m_referencedObjectPaths[t.objectPathInfo.Id]){if(!t.isValid)throw new n._Internal.RuntimeError({code:n.ErrorCodes.invalidObjectPath,message:n.Utility._getResourceString(n.ResourceStrings.invalidObjectPath,n.Utility.getObjectPathExpression(t)),debugInfo:{errorLocation:n.Utility.getObjectPathExpression(t)}});while(t)t.isWriteOperation&&(this.m_flags=this.m_flags|1),t.isRestrictedResourceAccess&&(this.m_flags=this.m_flags|2),this.m_referencedObjectPaths[t.objectPathInfo.Id]=t,t.objectPathInfo.ObjectPathType==3&&this.addReferencedObjectPaths(t.argumentObjectPaths),t=t.parentObjectPath}},t.prototype.addReferencedObjectPaths=function(n){if(n)for(var t=0;t<n.length;t++)this.addReferencedObjectPath(n[t])},t.prototype.addActionResultHandler=function(n,t){this.m_actionResultHandler[n.actionInfo.Id]=t},t.prototype.buildRequestMessageBody=function(){var r,u,f,i;n._internalConfig.enableEarlyDispose&&t._calculateLastUsedObjectPathIds(this.m_actions);r={};for(u in this.m_referencedObjectPaths)r[u]=this.m_referencedObjectPaths[u].objectPathInfo;for(f=[],i=0;i<this.m_actions.length;i++)f.push(this.m_actions[i].actionInfo);return{AutoKeepReference:this.m_context._autoCleanup,Actions:f,ObjectPaths:r}},t.prototype.processResponse=function(n){var t,i,r;if(n)for(t=0;t<n.length;t++)i=n[t],r=this.m_actionResultHandler[i.ActionId],r&&r._handleResult(i.Value)},t.prototype.invalidatePendingInvalidObjectPaths=function(){for(var n in this.m_referencedObjectPaths)this.m_referencedObjectPaths[n].isInvalidAfterRequest&&(this.m_referencedObjectPaths[n].isValid=!1)},t.prototype._addPendingEventHandlerAction=function(n,t){this.m_pendingEventHandlerActions[n._id]||(this.m_pendingEventHandlerActions[n._id]=[],this.m_pendingProcessEventHandlers.push(n));this.m_pendingEventHandlerActions[n._id].push(t)},Object.defineProperty(t.prototype,"_pendingProcessEventHandlers",{get:function(){return this.m_pendingProcessEventHandlers},enumerable:!0,configurable:!0}),t.prototype._getPendingEventHandlerActions=function(n){return this.m_pendingEventHandlerActions[n._id]},t.prototype._addPreSyncPromise=function(n){this.m_preSyncPromises.push(n)},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._updateLastUsedActionIdOfObjectPathId=function(n,i,r){for(var u,e,f;i;){if(n[i.objectPathInfo.Id])return;if(n[i.objectPathInfo.Id]=r,u=i.argumentObjectPaths,u)for(e=u.length,f=0;f<e;f++)t._updateLastUsedActionIdOfObjectPathId(n,u[f],r);i=i.parentObjectPath}},t._calculateLastUsedObjectPathIds=function(n){for(var o,v,s,h,l,u,f,i,c,e={},a=n.length,r=a-1;r>=0;--r)if(i=n[r],u=i.actionInfo.Id,i.referencedObjectPath&&t._updateLastUsedActionIdOfObjectPathId(e,i.referencedObjectPath,u),o=i.referencedArgumentObjectPaths,o)for(v=o.length,s=0;s<v;s++)t._updateLastUsedActionIdOfObjectPathId(e,o[s],u);h={};for(l in e)u=e[l],f=h[u],f||(f=[],h[u]=f),f.push(parseInt(l));for(r=0;r<a;r++)i=n[r],c=h[i.actionInfo.Id],c&&c.length>0?i.actionInfo.L=c:i.actionInfo.L&&delete i.actionInfo.L},t}();n.ClientRequest=t}(OfficeExtension||(OfficeExtension={})),function(n){var t,i;n._internalConfig={showDisposeInfoInDebugInfo:!1,enableEarlyDispose:!0,alwaysPolyfillClientObjectUpdateMethod:!1,alwaysPolyfillClientObjectRetrieveMethod:!1};t=function(){function t(){}return t.prototype._resolveRequestUrlAndHeaderInfo=function(){return n.Utility._createPromiseFromResult(null)},t.prototype._createRequestExecutorOrNull=function(){return null},Object.defineProperty(t.prototype,"eventRegistration",{get:function(){return n._Internal.officeJsEventRegistration},enumerable:!0,configurable:!0}),t}();n.SessionBase=t;i=function(){function i(r){if(this.m_customRequestHeaders={},this.m_batchMode=0,this._onRunFinishedNotifiers=[],this.m_nextId=0,i._overrideSession)this.m_requestUrlAndHeaderInfoResolver=i._overrideSession;else if((n.Utility.isNullOrUndefined(r)||typeof r=="string"&&r.length===0)&&(r=i.defaultRequestUrlAndHeaders,r||(r={url:n.Constants.localDocument,headers:{}})),typeof r=="string")this.m_requestUrlAndHeaderInfo={url:r,headers:{}};else if(i.isRequestUrlAndHeaderInfoResolver(r))this.m_requestUrlAndHeaderInfoResolver=r;else if(i.isRequestUrlAndHeaderInfo(r)){var u=r;this.m_requestUrlAndHeaderInfo={url:u.url,headers:{}};n.Utility._copyHeaders(u.headers,this.m_requestUrlAndHeaderInfo.headers)}else throw n._Internal.RuntimeError._createInvalidArgError("url");this.m_requestUrlAndHeaderInfoResolver instanceof t&&(this.m_session=this.m_requestUrlAndHeaderInfoResolver);this._processingResult=!1;this._customData=n.Constants.iterativeExecutor;this.sync=this.sync.bind(this)}return 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.eventRegistration:n._Internal.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 this.m_pendingRequest==null&&(this.m_pendingRequest=new n.ClientRequest(this)),this.m_pendingRequest},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"debugInfo",{get:function(){var t=new n.RequestPrettyPrinter(this._rootObjectPropertyName,this._pendingRequest._objectPaths,this._pendingRequest._actions,n._internalConfig.showDisposeInfoInDebugInfo),i=t.process();return{pendingStatements:i}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"trackedObjects",{get:function(){return this.m_trackedObjects||(this.m_trackedObjects=new n.TrackedObjects(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}),i.prototype.ensureInProgressBatchIfBatchMode=function(){if(this.m_batchMode===1&&!this.m_explicitBatchInProgress)throw n.Utility.createRuntimeError(n.ErrorCodes.generalException,n.Utility._getResourceString(n.ResourceStrings.notInsideBatch),null);},i.prototype.load=function(t,r){n.Utility.validateContext(this,t);var u=i._parseQueryOption(r),f=n.ActionFactory.createQueryAction(this,t,u);this._pendingRequest.addActionResultHandler(f,t)},i.isLoadOption=function(t){if(!n.Utility.isUndefined(t.select)&&(typeof t.select=="string"||Array.isArray(t.select))||!n.Utility.isUndefined(t.expand)&&(typeof t.expand=="string"||Array.isArray(t.expand))||!n.Utility.isUndefined(t.top)&&typeof t.top=="number"||!n.Utility.isUndefined(t.skip)&&typeof t.skip=="number")return!0;for(var i in t)return!1;return!0},i.parseStrictLoadOption=function(n){var t={Select:[]};return i.parseStrictLoadOptionHelper(t,"","option",n),t},i.combineQueryPath=function(n,t,i){return n.length===0?t:n+i+t},i.parseStrictLoadOptionHelper=function(t,r,u,f){var e,o;for(e in f)if(o=f[e],e==="$all"){if(typeof o!="boolean")throw n._Internal.RuntimeError._createInvalidArgError(i.combineQueryPath(u,e,"."));o&&t.Select.push(i.combineQueryPath(r,"*","/"))}else if(e==="$top"){if(typeof o!="number"||r.length>0)throw n._Internal.RuntimeError._createInvalidArgError(i.combineQueryPath(u,e,"."));t.Top=o}else if(e==="$skip"){if(typeof o!="number"||r.length>0)throw n._Internal.RuntimeError._createInvalidArgError(i.combineQueryPath(u,e,"."));t.Skip=o}else if(typeof o=="boolean")o&&t.Select.push(i.combineQueryPath(r,e,"/"));else if(typeof o=="object")i.parseStrictLoadOptionHelper(t,i.combineQueryPath(r,e,"/"),i.combineQueryPath(u,e,"."),o);else throw n._Internal.RuntimeError._createInvalidArgError(i.combineQueryPath(u,e,"."));},i._parseQueryOption=function(t){var u={},f,r;if(typeof t=="string")f=t,u.Select=n.Utility._parseSelectExpand(f);else if(Array.isArray(t))u.Select=t;else if(typeof t=="object")if(r=t,i.isLoadOption(r)){if(typeof r.select=="string")u.Select=n.Utility._parseSelectExpand(r.select);else if(Array.isArray(r.select))u.Select=r.select;else if(!n.Utility.isNullOrUndefined(r.select))throw n._Internal.RuntimeError._createInvalidArgError("option.select");if(typeof r.expand=="string")u.Expand=n.Utility._parseSelectExpand(r.expand);else if(Array.isArray(r.expand))u.Expand=r.expand;else if(!n.Utility.isNullOrUndefined(r.expand))throw n._Internal.RuntimeError._createInvalidArgError("option.expand");if(typeof r.top=="number")u.Top=r.top;else if(!n.Utility.isNullOrUndefined(r.top))throw n._Internal.RuntimeError._createInvalidArgError("option.top");if(typeof r.skip=="number")u.Skip=r.skip;else if(!n.Utility.isNullOrUndefined(r.skip))throw n._Internal.RuntimeError._createInvalidArgError("option.skip");}else u=i.parseStrictLoadOption(t);else if(!n.Utility.isNullOrUndefined(t))throw n._Internal.RuntimeError._createInvalidArgError("option");return u},i.prototype.loadRecursive=function(t,r,u){var f,e,o;if(!n.Utility.isPlainJsonObject(r))throw n._Internal.RuntimeError._createInvalidArgError("options");f={};for(e in r)f[e]=i._parseQueryOption(r[e]);o=n.ActionFactory.createRecursiveQueryAction(this,t,{Queries:f,MaxDepth:u});this._pendingRequest.addActionResultHandler(o,t)},i.prototype.trace=function(t){n.ActionFactory.createTraceAction(this,t,!0)},i.prototype._processOfficeJsErrorResponse=function(n,t){},i.prototype.ensureRequestUrlAndHeaderInfo=function(){var t=this;return n.Utility._createPromiseFromResult(null).then(function(){if(!t.m_requestUrlAndHeaderInfo)return t.m_requestUrlAndHeaderInfoResolver._resolveRequestUrlAndHeaderInfo().then(function(i){if(t.m_requestUrlAndHeaderInfo=i,t.m_requestUrlAndHeaderInfo||(t.m_requestUrlAndHeaderInfo={url:n.Constants.localDocument,headers:{}}),n.Utility.isNullOrEmptyString(t.m_requestUrlAndHeaderInfo.url)&&(t.m_requestUrlAndHeaderInfo.url=n.Constants.localDocument),t.m_requestUrlAndHeaderInfo.headers||(t.m_requestUrlAndHeaderInfo.headers={}),typeof t.m_requestUrlAndHeaderInfoResolver._createRequestExecutorOrNull=="function"){var r=t.m_requestUrlAndHeaderInfoResolver._createRequestExecutorOrNull();r&&(t._requestExecutor=r)}})})},i.prototype.syncPrivateMain=function(){var n=this;return this.ensureRequestUrlAndHeaderInfo().then(function(){var t=n._pendingRequest;return n.m_pendingRequest=null,n.processPreSyncPromises(t).then(function(){return n.syncPrivate(t)})})},i.prototype.syncPrivate=function(t){var f=this,e,o,s,u,h,r,i;return t.hasActions?(e=t.buildRequestMessageBody(),o=t.flags,this._requestExecutor||(this._requestExecutor=n.Utility._isLocalDocumentUrl(this.m_requestUrlAndHeaderInfo.url)?new n.OfficeJsRequestExecutor(this):new n.HttpRequestExecutor),s=this._requestExecutor,u={},n.Utility._copyHeaders(this.m_requestUrlAndHeaderInfo.headers,u),n.Utility._copyHeaders(this.m_customRequestHeaders,u),h={Url:this.m_requestUrlAndHeaderInfo.url,Headers:u,Body:e},t.invalidatePendingInvalidObjectPaths(),r=null,i=null,this._lastSyncStart=performance.now(),s.executeAsync(this._customData,o,h).then(function(u){return f._lastSyncEnd=performance.now(),r=f.processRequestExecutorResponseMessage(t,u),f.processPendingEventHandlers(t).catch(function(t){n.Utility.log("Error in processPendingEventHandlers");n.Utility.log(JSON.stringify(t));i=t})}).then(function(){var u,f;if(r){n.Utility.log("Throw error from response: "+JSON.stringify(r));throw r;}if(i){n.Utility.log("Throw error from ProcessEventHandler: "+JSON.stringify(i));u=null;i instanceof n._Internal.RuntimeError?(u=i,u.traceMessages=t._responseTraceMessages):(f=null,f=typeof i=="string"?i:i.message,n.Utility.isNullOrEmptyString(f)&&(f=n.Utility._getResourceString(n.ResourceStrings.cannotRegisterEvent)),u=new n._Internal.RuntimeError({code:n.ErrorCodes.cannotRegisterEvent,message:f,traceMessages:t._responseTraceMessages}));throw u;}})):this.processPendingEventHandlers(t)},i.prototype.processRequestExecutorResponseMessage=function(t,i){var e,r,o,u,f;if(i.Body&&i.Body.TraceIds&&t._setResponseTraceIds(i.Body.TraceIds),e=t._responseTraceMessages,r=null,i.Body&&(i.Body.Error&&i.Body.Error.ActionIndex>=0&&(o=new n.RequestPrettyPrinter(this._rootObjectPropertyName,t._objectPaths,t._actions),r=o.processForDebugStatementInfo(i.Body.Error.ActionIndex)),u=null,i.Body.Results?u=i.Body.Results:i.Body.ProcessedResults&&i.Body.ProcessedResults.Results&&(u=i.Body.ProcessedResults.Results),u)){this._processingResult=!0;try{t.processResponse(u)}finally{this._processingResult=!1}}if(n.Utility.isNullOrEmptyString(i.ErrorCode)){if(i.Body&&i.Body.Error)return f={errorLocation:i.Body.Error.Location},r&&(f.statement=r.statement,f.surroundingStatements=r.surroundingStatements),new n._Internal.RuntimeError({code:i.Body.Error.Code,message:i.Body.Error.Message,traceMessages:e,debugInfo:f})}else return new n._Internal.RuntimeError({code:i.ErrorCode,message:i.ErrorMessage,traceMessages:e});return null},i.prototype.processPendingEventHandlers=function(t){for(var u,i=n.Utility._createPromiseFromResult(null),r=0;r<t._pendingProcessEventHandlers.length;r++)u=t._pendingProcessEventHandlers[r],i=i.then(this.createProcessOneEventHandlersFunc(u,t));return i},i.prototype.createProcessOneEventHandlersFunc=function(n,t){return function(){return n._processRegistration(t)}},i.prototype.processPreSyncPromises=function(t){for(var u,i=n.Utility._createPromiseFromResult(null),r=0;r<t._preSyncPromises.length;r++)u=t._preSyncPromises[r],i=i.then(this.createProcessOneProSyncFunc(u));return i},i.prototype.createProcessOneProSyncFunc=function(n){return function(){return n}},i.prototype.sync=function(n){return this.syncPrivateMain().then(function(){return n})},i.prototype.batch=function(t){var i=this,u,r,f,e;if(this.m_batchMode!==1)return n._Internal.OfficePromise.reject(n.Utility.createRuntimeError(n.ErrorCodes.generalException,null,null));if(this.m_explicitBatchInProgress)return n._Internal.OfficePromise.reject(n.Utility.createRuntimeError(n.ErrorCodes.generalException,n.Utility._getResourceString(n.ResourceStrings.pendingBatchInProgress),null));if(n.Utility.isNullOrUndefined(t))return n.Utility._createPromiseFromResult(null);this.m_explicitBatchInProgress=!0;u=this.m_pendingRequest;this.m_pendingRequest=new n.ClientRequest(this);try{r=t(this._rootObject,this)}catch(o){return this.m_explicitBatchInProgress=!1,this.m_pendingRequest=u,n._Internal.OfficePromise.reject(o)}return typeof r=="object"&&r&&typeof r.then=="function"?e=n.Utility._createPromiseFromResult(null).then(function(){return r}).then(function(n){return i.m_explicitBatchInProgress=!1,f=i.m_pendingRequest,i.m_pendingRequest=u,n}).catch(function(t){return i.m_explicitBatchInProgress=!1,f=i.m_pendingRequest,i.m_pendingRequest=u,n._Internal.OfficePromise.reject(t)}):(this.m_explicitBatchInProgress=!1,f=this.m_pendingRequest,this.m_pendingRequest=u,e=n.Utility._createPromiseFromResult(r)),e.then(function(n){return i.ensureRequestUrlAndHeaderInfo().then(function(){return i.syncPrivate(f)}).then(function(){return n})})},i._run=function(n,t,r,u,f,e){return r===void 0&&(r=3),u===void 0&&(u=5e3),i._runCommon("run",null,n,0,t,r,u,f,e)},i.isRequestUrlAndHeaderInfo=function(t){return typeof t=="object"&&t!==null&&Object.getPrototypeOf(t)===Object.getPrototypeOf({})&&!n.Utility.isNullOrUndefined(t.url)},i.isRequestUrlAndHeaderInfoResolver=function(n){return typeof n=="object"&&n!==null&&typeof n._resolveRequestUrlAndHeaderInfo=="function"},i._runBatch=function(n,t,r,u,f,e,o){return u===void 0&&(u=3),f===void 0&&(f=5e3),i._runBatchCommon(0,n,t,r,u,f,e,o)},i._runExplicitBatch=function(n,t,r,u,f,e,o){return u===void 0&&(u=3),f===void 0&&(f=5e3),i._runBatchCommon(1,n,t,r,u,f,e,o)},i._runBatchCommon=function(t,r,u,f,e,o,s,h){var a,y,p,c,l,v;if(e===void 0&&(e=3),o===void 0&&(o=5e3),p=null,c=0,u.length>0&&(typeof u[0]=="string"||i.isRequestUrlAndHeaderInfo(u[0])||i.isRequestUrlAndHeaderInfoResolver(u[0]))&&(p=u[0],c=1),u.length==c+1)a=f,y=u[c+0];else if(u.length==c+2){if(n.Utility.isNullOrUndefined(u[c+0]))a=f;else if(u[c+0]instanceof n.ClientObject)a=function(){return u[c+0].context};else if(u[c+0]instanceof i)a=function(){return u[c+0]};else if(Array.isArray(u[c+0])){if(l=u[c+0],l.length==0)return i.createErrorPromise(r);for(v=0;v<l.length;v++){if(!(l[v]instanceof n.ClientObject))return i.createErrorPromise(r);if(l[v].context!=l[0].context)return i.createErrorPromise(r,n.ResourceStrings.invalidRequestContext)}a=function(){return l[0].context}}else return i.createErrorPromise(r);y=u[c+1]}else return i.createErrorPromise(r);return i._runCommon(r,p,a,t,y,e,o,s,h)},i.createErrorPromise=function(t,i){return i===void 0&&(i=n.ResourceStrings.invalidArgument),n._Internal.OfficePromise.reject(n.Utility.createRuntimeError(i,n.Utility._getResourceString(i),t))},i._runCommon=function(t,r,u,f,e,o,s,h,c){i._overrideSession&&(r=i._overrideSession);var p=new n._Internal.OfficePromise(function(n,t){n()}),l,v=!1,a,y;return p.then(function(){if(l=u(r),l._autoCleanup)return new n._Internal.OfficePromise(function(n,t){l._onRunFinishedNotifiers.push(function(){l._autoCleanup=!0;n()})});else l._autoCleanup=!0}).then(function(){if(typeof e!="function")return i.createErrorPromise(t);y=l.m_batchMode;l.m_batchMode=f;var r;return r=f==1?e(l.batch.bind(l)):e(l),(n.Utility.isNullOrUndefined(r)||typeof r.then!="function")&&n.Utility.throwError(n.ResourceStrings.runMustReturnPromise),r}).then(function(n){return f===1?n:l.sync(n)}).then(function(n){v=!0;a=n}).catch(function(n){a=n}).then(function(){function f(){var r;t++;var e=l.m_pendingRequest,a=l.m_batchMode,i=new n.ClientRequest(l);l.m_pendingRequest=i;l.m_batchMode=0;try{for(r in u)l.trackedObjects.remove(u[r])}finally{l.m_batchMode=a;l.m_pendingRequest=e}return l.syncPrivate(i).then(function(){h&&h(t)}).catch(function(){c&&c(t);t<o&&setTimeout(function(){f()},s)})}var u=l.trackedObjects._retrieveAndClearAutoCleanupList(),e,t;l._autoCleanup=!1;l.m_batchMode=y;for(e in u)u[e]._objectPath.isValid=!1;if(t=0,n.Utility._synchronousCleanup||i.isRequestUrlAndHeaderInfoResolver(r))return f();else f()}).then(function(){if(l._onRunFinishedNotifiers&&l._onRunFinishedNotifiers.length>0){var n=l._onRunFinishedNotifiers.shift();n()}if(v)return a;else throw a;})},i.prototype._nextId=function(){return++this.m_nextId},i}();n.ClientRequestContext=i}(OfficeExtension||(OfficeExtension={})),function(n){var i=function(){function t(n){this.m_type=n}return Object.defineProperty(t.prototype,"value",{get:function(){if(!this.m_isLoaded)throw new n._Internal.RuntimeError({code:n.ErrorCodes.valueNotLoaded,message:n.Utility._getResourceString(n.ResourceStrings.valueNotLoaded),debugInfo:{errorLocation:"clientResult.value"}});return this.m_value},enumerable:!0,configurable:!0}),t.prototype._handleResult=function(t){(this.m_isLoaded=!0,typeof t=="object"&&t&&t._IsNull)||(this.m_value=this.m_type===1?n.Utility.adjustToDateTime(t):t)},t}(),t;n.ClientResult=i;t=function(){function t(t,i){var r;this.m_proxy=t;this.m_shouldPolyfill=i;var u=t[n.Constants.scalarPropertyNames],f=t[n.Constants.navigationPropertyNames],e=t[n.Constants.className],o=t[n.Constants.isCollection];if(u)for(r=0;r<u.length;r++)n.Utility.definePropertyThrowUnloadedException(this,e,u[r]);if(f)for(r=0;r<f.length;r++)n.Utility.definePropertyThrowUnloadedException(this,e,f[r]);o&&n.Utility.definePropertyThrowUnloadedException(this,e,n.Constants.itemsLowerCase)}return Object.defineProperty(t.prototype,"$proxy",{get:function(){return this.m_proxy},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"$isNullObject",{get:function(){if(!this.m_isLoaded)throw new n._Internal.RuntimeError({code:n.ErrorCodes.valueNotLoaded,message:n.Utility._getResourceString(n.ResourceStrings.valueNotLoaded),debugInfo:{errorLocation:"retrieveResult.$isNullObject"}});return this.m_isNullObject},enumerable:!0,configurable:!0}),t.prototype.toJSON=function(){return this.m_isLoaded?this.m_isNullObject?null:(n.Utility.isUndefined(this.m_json)&&(this.m_json=this.purifyJson(this.m_value)),this.m_json):undefined},t.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.prototype._handleResult=function(n){this.m_isLoaded=!0;n===null||typeof n=="object"&&n&&n._IsNull?(this.m_isNullObject=!0,n=null):this.m_isNullObject=!1;this.m_shouldPolyfill&&(n=this.changePropertyNameToCamelLowerCase(n));this.m_value=n;this.m_proxy._handleRetrieveResult(n,this)},t.prototype.changePropertyNameToCamelLowerCase=function(t){var o=95,r,i,u,f,e;if(Array.isArray(t)){for(i=[],r=0;r<t.length;r++)i.push(this.changePropertyNameToCamelLowerCase(t[r]));return i}else if(typeof t=="object"&&t!==null){i={};for(u in t)if(f=t[u],u===n.Constants.items){i={};i[n.Constants.itemsLowerCase]=this.changePropertyNameToCamelLowerCase(f);break}else e=n.Utility._toCamelLowerCase(u),i[e]=this.changePropertyNameToCamelLowerCase(f);return i}else return t},t.prototype.purifyJson=function(n){var f=95,r,i,u,t;if(Array.isArray(n)){for(i=[],r=0;r<n.length;r++)i.push(this.purifyJson(n[r]));return i}else if(typeof n=="object"&&n!==null){i={};for(u in n)u.charCodeAt(0)!==f&&(t=n[u],typeof t=="object"&&t!==null&&Array.isArray(t.items)&&(t=t.items),i[u]=this.purifyJson(t));return i}else return n},t}();n.RetrieveResultImpl=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function n(){}return n.flags="flags",n.getItemAt="GetItemAt",n.id="Id",n.idLowerCase="id",n.idPrivate="_Id",n.index="_Index",n.items="_Items",n.iterativeExecutor="IterativeExecutor",n.localDocument="http://document.localhost/",n.localDocumentApiPrefix="http://document.localhost/_api/",n.processQuery="ProcessQuery",n.referenceId="_ReferenceId",n.isTracked="_IsTracked",n.sourceLibHeader="SdkVersion",n.embeddingPageOrigin="EmbeddingPageOrigin",n.embeddingPageSessionInfo="EmbeddingPageSessionInfo",n.eventMessageCategory=65536,n.eventWorkbookId="Workbook",n.eventSourceRemote="Remote",n.itemsLowerCase="items",n.proxy="$proxy",n.scalarPropertyNames="_scalarPropertyNames",n.navigationPropertyNames="_navigationPropertyNames",n.className="_className",n.isCollection="_isCollection",n.scalarPropertyUpdateable="_scalarPropertyUpdateable",n.collectionPropertyPath="_collectionPropertyPath",n}();n.Constants=t}(OfficeExtension||(OfficeExtension={})),function(n){var u=1,r={invokeRequestModifier:function(n){return n.DdaMethod.Version=u,n},invokeResponseModifier:function(n){return u=n.Version,n.Error&&(n.error={},n.error.Code=n.Error),n}},i,t,f,e;(function(n){n[n.Success=0]="Success";n[n.Timeout=1]="Timeout";n[n.InternalError=5001]="InternalError"})(i||(i={})),function(n){n.SendingId="sId";n.RespondingId="rId";n.CommandKey="command";n.SessionInfoKey="sessionInfo";n.ParamsKey="params";n.ApiReadyCommand="apiready";n.ExecuteMethodCommand="executeMethod";n.GetAppContextCommand="getAppContext";n.RegisterEventCommand="registerEvent";n.UnregisterEventCommand="unregisterEvent";n.FireEventCommand="fireEvent"}(t||(t={}));f=function(u){function f(n,t){u.call(this);this.m_chosenWindow=null;this.m_chosenOrigin=null;this.m_enabled=!0;this.m_onMessageHandler=this._onMessage.bind(this);this.m_callbackList={};this.m_id=0;this.m_timeoutId=-1;this.m_appContext=null;this.m_url=n;this.m_options=t;this.m_options||(this.m_options={sessionKey:Math.random().toString()});this.m_options.sessionKey||(this.m_options.sessionKey=Math.random().toString());this.m_options.container||(this.m_options.container=document.body);this.m_options.timeoutInMilliseconds||(this.m_options.timeoutInMilliseconds=6e4);this.m_options.height||(this.m_options.height="400px");this.m_options.width||(this.m_options.width="100%")}return __extends(f,u),f.prototype._getIFrameSrc=function(){var u=window.location.protocol+"//"+window.location.host,i=n.Constants.embeddingPageOrigin+"="+encodeURIComponent(u)+"&"+n.Constants.embeddingPageSessionInfo+"="+encodeURIComponent(this.m_options.sessionKey),r=!1,t;return(this.m_url.toLowerCase().indexOf("/_layouts/preauth.aspx")>0||this.m_url.toLowerCase().indexOf("/_layouts/15/preauth.aspx")>0)&&(r=!0),t=document.createElement("a"),t.href=this.m_url,r?t.hash=t.hash.length===0||t.hash==="#"?"#"+i:t.hash+"&"+i:t.search=t.search.length===0||t.search==="?"?"?"+i:t.search+"&"+i,t.href},f.prototype.init=function(){var t=this,i;return window.addEventListener("message",this.m_onMessageHandler),i=this._getIFrameSrc(),new n._Internal.OfficePromise(function(r,u){var f=document.createElement("iframe");t.m_options.id&&(f.id=t.m_options.id);f.style.height=t.m_options.height;f.style.width=t.m_options.width;f.src=i;t.m_options.container.appendChild(f);t.m_timeoutId=setTimeout(function(){t.close();var i=n.Utility.createRuntimeError(n.ErrorCodes.timeout,n.Utility._getResourceString(n.ResourceStrings.timeout),"EmbeddedSession.init");u(i)},t.m_options.timeoutInMilliseconds);t.m_promiseResolver=r})},f.prototype._invoke=function(n,t,u){if(!this.m_enabled){t(i.InternalError,null);return}r.invokeRequestModifier&&(u=r.invokeRequestModifier(u));this._sendMessageWithCallback(this.m_id++,n,u,function(n){r.invokeResponseModifier&&(n=r.invokeResponseModifier(n));var u=n.Error;delete n.Error;t(u||i.Success,n)})},f.prototype.close=function(){window.removeEventListener("message",this.m_onMessageHandler);window.clearTimeout(this.m_timeoutId);this.m_enabled=!1},Object.defineProperty(f.prototype,"eventRegistration",{get:function(){return this.m_sessionEventManager||(this.m_sessionEventManager=new n.EventRegistration(this._registerEventImpl.bind(this),this._unregisterEventImpl.bind(this))),this.m_sessionEventManager},enumerable:!0,configurable:!0}),f.prototype._createRequestExecutorOrNull=function(){return new e(this)},f.prototype._resolveRequestUrlAndHeaderInfo=function(){return n.Utility._createPromiseFromResult(null)},f.prototype._registerEventImpl=function(i,r){var u=this;return new n._Internal.OfficePromise(function(n,f){u._sendMessageWithCallback(u.m_id++,t.RegisterEventCommand,{EventId:i,TargetId:r},function(){n(null)})})},f.prototype._unregisterEventImpl=function(i,r){var u=this;return new n._Internal.OfficePromise(function(n,f){u._sendMessageWithCallback(u.m_id++,t.UnregisterEventCommand,{EventId:i,TargetId:r},function(){n()})})},f.prototype._onMessage=function(n){var u=this,i,e,r,o,s;if(this.m_enabled&&(!this.m_chosenWindow||this.m_chosenWindow===n.source&&this.m_chosenOrigin===n.origin)){if(i=n.data,i&&i[t.CommandKey]===t.ApiReadyCommand){!this.m_chosenWindow&&this._isValidDescendant(n.source)&&i[t.SessionInfoKey]===this.m_options.sessionKey&&(this.m_chosenWindow=n.source,this.m_chosenOrigin=n.origin,this._sendMessageWithCallback(this.m_id++,t.GetAppContextCommand,null,function(n){u._setupContext(n);window.clearTimeout(u.m_timeoutId);u.m_promiseResolver()}));return}if(i&&i[t.CommandKey]===t.FireEventCommand){var f=i[t.ParamsKey],h=f.EventId,c=f.TargetId,l=f.Data;if(this.m_sessionEventManager)for(e=this.m_sessionEventManager.getHandlers(h,c),r=0;r<e.length;r++)e[r](l);return}i&&i.hasOwnProperty(t.RespondingId)&&(o=i[t.RespondingId],s=this.m_callbackList[o],typeof s=="function"&&s(i[t.ParamsKey]),delete this.m_callbackList[o])}},f.prototype._sendMessageWithCallback=function(n,i,r,u){this.m_callbackList[n]=u;var f={};f[t.SendingId]=n;f[t.CommandKey]=i;f[t.ParamsKey]=r;this.m_chosenWindow.postMessage(JSON.stringify(f),this.m_chosenOrigin)},f.prototype._isValidDescendant=function(n){function i(t){if(t===n)return!0;for(var r=0,u=t.frames.length;r<u;r++)if(i(t.frames[r]))return!0;return!1}for(var u=this.m_options.container||document.body,r=u.getElementsByTagName("iframe"),t=0,f=r.length;t<f;t++)if(i(r[t].contentWindow))return!0;return!1},f.prototype._setupContext=function(n){!(this.m_appContext=n)},f}(n.SessionBase);n.EmbeddedSession=f;e=function(){function r(n){this.m_session=n}return r.prototype.executeAsync=function(u,f,e){var o=this,s=n.RichApiMessageUtility.buildMessageArrayForIRequestExecutor(u,f,e,r.SourceLibHeaderValue);return new n._Internal.OfficePromise(function(u,f){o.m_session._invoke(t.ExecuteMethodCommand,function(t,r){n.Utility.log("Response:");n.Utility.log(JSON.stringify(r));var f;f=t==i.Success?n.RichApiMessageUtility.buildResponseOnSuccess(n.RichApiMessageUtility.getResponseBodyFromSafeArray(r.Data),n.RichApiMessageUtility.getResponseHeadersFromSafeArray(r.Data)):n.RichApiMessageUtility.buildResponseOnError(r.error.Code,r.error.Message);u(f)},r._transformMessageArrayIntoParams(s))})},r._transformMessageArrayIntoParams=function(n){return{ArrayData:n,DdaMethod:{DispatchId:r.DispidExecuteRichApiRequestMethod}}},r.DispidExecuteRichApiRequestMethod=93,r.SourceLibHeaderValue="Embedded",r}()}(OfficeExtension||(OfficeExtension={})),function(n){var t;(function(t){var i=function(i){function r(n){i.call(this,typeof n=="string"?n:n.message);this.name="OfficeExtension.Error";typeof n=="string"?this.message=n:(this.code=n.code,this.message=n.message,this.traceMessages=n.traceMessages||[],this.innerError=n.innerError||null,this.debugInfo=this._createDebugInfo(n.debugInfo||{}))}return __extends(r,i),r.prototype.toString=function(){return this.code+": "+this.message},r.prototype._createDebugInfo=function(t){var i={code:this.code,message:this.message,toString:function(){return JSON.stringify(this)}};for(var r in t)i[r]=t[r];return this.innerError&&(i.innerError=this.innerError instanceof n._Internal.RuntimeError?this.innerError.debugInfo:this.innerError),i},r._createInvalidArgError=function(i){return new t.RuntimeError({code:n.ErrorCodes.invalidArgument,message:n.Utility.isNullOrEmptyString(i.argumentName)?n.Utility._getResourceString(n.ResourceStrings.invalidArgumentGeneric):n.Utility._getResourceString(n.ResourceStrings.invalidArgument,i.argumentName),debugInfo:i.errorLocation?{errorLocation:i.errorLocation}:{},innerError:i.innerError})},r}(Error);t.RuntimeError=i})(t=n._Internal||(n._Internal={}));n.Error=t.RuntimeError}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function n(){}return n.accessDenied="AccessDenied",n.generalException="GeneralException",n.activityLimitReached="ActivityLimitReached",n.invalidObjectPath="InvalidObjectPath",n.propertyNotLoaded="PropertyNotLoaded",n.valueNotLoaded="ValueNotLoaded",n.invalidRequestContext="InvalidRequestContext",n.invalidArgument="InvalidArgument",n.runMustReturnPromise="RunMustReturnPromise",n.cannotRegisterEvent="CannotRegisterEvent",n.apiNotFound="ApiNotFound",n.connectionFailure="ConnectionFailure",n.timeout="Timeout",n.invalidOrTimedOutSession="InvalidOrTimedOutSession",n.cannotUpdateReadOnlyProperty="CannotUpdateReadOnlyProperty",n}();n.ErrorCodes=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function t(n,t,i,r){var u=this;this.m_id=n._nextId();this.m_context=n;this.m_name=i;this.m_handlers=[];this.m_registered=!1;this.m_eventInfo=r;this.m_callback=function(n){u.m_eventInfo.eventArgsTransformFunc(n).then(function(n){return u.fireEvent(n)})}}return Object.defineProperty(t.prototype,"_registered",{get:function(){return this.m_registered},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_id",{get:function(){return this.m_id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_handlers",{get:function(){return this.m_handlers},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_context",{get:function(){return this.m_context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_callback",{get:function(){return this.m_callback},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var i=n.ActionFactory.createTraceAction(this.m_context,null,!1);return this.m_context._pendingRequest._addPendingEventHandlerAction(this,{id:i.actionInfo.Id,handler:t,operation:0}),new n.EventHandlerResult(this.m_context,this,t)},t.prototype.remove=function(t){var i=n.ActionFactory.createTraceAction(this.m_context,null,!1);this.m_context._pendingRequest._addPendingEventHandlerAction(this,{id:i.actionInfo.Id,handler:t,operation:1})},t.prototype.removeAll=function(){var t=n.ActionFactory.createTraceAction(this.m_context,null,!1);this.m_context._pendingRequest._addPendingEventHandlerAction(this,{id:t.actionInfo.Id,handler:null,operation:2})},t.prototype._processRegistration=function(t){var f=this,u=n.Utility._createPromiseFromResult(null),e=t._getPendingEventHandlerActions(this),r,s,i,o;if(!e)return u;for(r=[],i=0;i<this.m_handlers.length;i++)r.push(this.m_handlers[i]);for(s=!1,i=0;i<e.length;i++)if(t._responseTraceIds[e[i].id]){s=!0;switch(e[i].operation){case 0:r.push(e[i].handler);break;case 1:for(o=r.length-1;o>=0;o--)if(r[o]===e[i].handler){r.splice(o,1);break}break;case 2:r=[];break}}return s&&(!this.m_registered&&r.length>0?u=u.then(function(){return f.m_eventInfo.registerFunc(f.m_callback)}).then(function(){return f.m_registered=!0}):this.m_registered&&r.length==0&&(u=u.then(function(){return f.m_eventInfo.unregisterFunc(f.m_callback)}).catch(function(t){n.Utility.log("Error when unregister event: "+JSON.stringify(t))}).then(function(){return f.m_registered=!1})),u=u.then(function(){return f.m_handlers=r})),u},t.prototype.fireEvent=function(t){for(var u,f,r=[],i=0;i<this.m_handlers.length;i++)u=this.m_handlers[i],f=n.Utility._createPromiseFromResult(null).then(this.createFireOneEventHandlerFunc(u,t)).catch(function(t){n.Utility.log("Error when invoke handler: "+JSON.stringify(t))}),r.push(f);n._Internal.OfficePromise.all(r)},t.prototype.createFireOneEventHandlerFunc=function(n,t){return function(){return n(t)}},t}();n.EventHandlers=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function n(n,t,i){this.m_context=n;this.m_allHandlers=t;this.m_handler=i}return Object.defineProperty(n.prototype,"context",{get:function(){return this.m_context},enumerable:!0,configurable:!0}),n.prototype.remove=function(){this.m_allHandlers&&this.m_handler&&(this.m_allHandlers.remove(this.m_handler),this.m_allHandlers=null,this.m_handler=null)},n}();n.EventHandlerResult=t}(OfficeExtension||(OfficeExtension={})),function(n){var t,i;(function(t){var i=function(){function i(){}return i.prototype.register=function(i,r,u){switch(i){case 4:return n.Utility.promisify(function(n){return Office.context.document.bindings.getByIdAsync(r,n)}).then(function(t){return n.Utility.promisify(function(n){return t.addHandlerAsync(Office.EventType.BindingDataChanged,u,n)})});case 3:return n.Utility.promisify(function(n){return Office.context.document.bindings.getByIdAsync(r,n)}).then(function(t){return n.Utility.promisify(function(n){return t.addHandlerAsync(Office.EventType.BindingSelectionChanged,u,n)})});case 2:return n.Utility.promisify(function(n){return Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged,u,n)});case 1:return n.Utility.promisify(function(n){return Office.context.document.settings.addHandlerAsync(Office.EventType.SettingsChanged,u,n)});case 5:return n.Utility.promisify(function(n){return OSF.DDA.RichApi.richApiMessageManager.addHandlerAsync("richApiMessage",u,n)});case 13:return n.Utility.promisify(function(n){return Office.context.document.addHandlerAsync(Office.EventType.ObjectDeleted,u,{id:r},n)});case 14:return n.Utility.promisify(function(n){return Office.context.document.addHandlerAsync(Office.EventType.ObjectSelectionChanged,u,{id:r},n)});case 15:return n.Utility.promisify(function(n){return Office.context.document.addHandlerAsync(Office.EventType.ObjectDataChanged,u,{id:r},n)});case 16:return n.Utility.promisify(function(n){return Office.context.document.addHandlerAsync(Office.EventType.ContentControlAdded,u,{id:r},n)});default:throw t.RuntimeError._createInvalidArgError("eventId");}},i.prototype.unregister=function(i,r,u){switch(i){case 4:return n.Utility.promisify(function(n){return Office.context.document.bindings.getByIdAsync(r,n)}).then(function(t){return n.Utility.promisify(function(n){return t.removeHandlerAsync(Office.EventType.BindingDataChanged,{handler:u},n)})});case 3:return n.Utility.promisify(function(n){return Office.context.document.bindings.getByIdAsync(r,n)}).then(function(t){return n.Utility.promisify(function(n){return t.removeHandlerAsync(Office.EventType.BindingSelectionChanged,{handler:u},n)})});case 2:return n.Utility.promisify(function(n){return Office.context.document.removeHandlerAsync(Office.EventType.DocumentSelectionChanged,{handler:u},n)});case 1:return n.Utility.promisify(function(n){return Office.context.document.settings.removeHandlerAsync(Office.EventType.SettingsChanged,{handler:u},n)});case 5:return n.Utility.promisify(function(n){return OSF.DDA.RichApi.richApiMessageManager.removeHandlerAsync("richApiMessage",{handler:u},n)});case 13:return n.Utility.promisify(function(n){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectDeleted,{id:r,handler:u},n)});case 14:return n.Utility.promisify(function(n){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectSelectionChanged,{id:r,handler:u},n)});case 15:return n.Utility.promisify(function(n){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectDataChanged,{id:r,handler:u},n)});case 16:return n.Utility.promisify(function(n){return Office.context.document.removeHandlerAsync(Office.EventType.ContentControlAdded,{id:r,handler:u},n)});default:throw t.RuntimeError._createInvalidArgError("eventId");}},i}();t.officeJsEventRegistration=new i})(t=n._Internal||(n._Internal={}));i=function(){function i(n,t){this.m_handlersByEventByTarget={};this.m_registerEventImpl=n;this.m_unregisterEventImpl=t}return i.prototype.getHandlers=function(t,i){var r,u;return n.Utility.isNullOrUndefined(i)&&(i=""),r=this.m_handlersByEventByTarget[t],r||(r={},this.m_handlersByEventByTarget[t]=r),u=r[i],u||(u=[],r[i]=u),u},i.prototype.register=function(i,r,u){if(!u)throw t.RuntimeError._createInvalidArgError("handler");var f=this.getHandlers(i,r);return(f.push(u),f.length===1)?this.m_registerEventImpl(i,r):n.Utility._createPromiseFromResult(null)},i.prototype.unregister=function(i,r,u){var f,e;if(!u)throw t.RuntimeError._createInvalidArgError("handler");for(f=this.getHandlers(i,r),e=f.length-1;e>=0;e--)if(f[e]===u){f.splice(e,1);break}return f.length===0?this.m_unregisterEventImpl(i,r):n.Utility._createPromiseFromResult(null)},i}();n.EventRegistration=i}(OfficeExtension||(OfficeExtension={})),function(n){function r(n){t._testReadyImpl=n}function u(n){t.getGenericEventRegistration()._handleRichApiMessage(n)}var t=function(){function t(){this.m_eventRegistration=new n.EventRegistration(this._registerEventImpl.bind(this),this._unregisterEventImpl.bind(this));this.m_richApiMessageHandler=this._handleRichApiMessage.bind(this)}return t.prototype.ready=function(){var i=this;return this.m_ready||(this.m_ready=t._testReadyImpl?t._testReadyImpl().then(function(){i.m_isReady=!0}):n._Internal.officeJsEventRegistration.register(5,"",this.m_richApiMessageHandler).then(function(){i.m_isReady=!0})),this.m_ready},Object.defineProperty(t.prototype,"isReady",{get:function(){return this.m_isReady},enumerable:!0,configurable:!0}),t.prototype.register=function(n,t,i){var r=this;return this.ready().then(function(){return r.m_eventRegistration.register(n,t,i)})},t.prototype.unregister=function(n,t,i){var r=this;return this.ready().then(function(){return r.m_eventRegistration.unregister(n,t,i)})},t.prototype._registerEventImpl=function(t,i){return n.Utility._createPromiseFromResult(null)},t.prototype._unregisterEventImpl=function(t,i){return n.Utility._createPromiseFromResult(null)},t.prototype._handleRichApiMessage=function(t){var r,i,u,e,f;if(t&&t.entries)for(r=0;r<t.entries.length;r++)if(i=t.entries[r],i.messageCategory==n.Constants.eventMessageCategory&&(n.Utility._logEnabled&&n.Utility.log(JSON.stringify(i)),u=this.m_eventRegistration.getHandlers(i.messageType,i.targetId),u.length>0))for(e=JSON.parse(i.message),i.isRemoteOverride&&(e.source=n.Constants.eventSourceRemote),f=0;f<u.length;f++)u[f](e)},t.getGenericEventRegistration=function(){return t.s_genericEventRegistration||(t.s_genericEventRegistration=new t),t.s_genericEventRegistration},t.richApiMessageEventCategory=65536,t}(),i;n._testSetRichApiMessageReadyImpl=r;n._testTriggerRichApiMessageEvent=u;i=function(i){function r(n,t,r,u){i.call(this,n,t,r,u);this.m_genericEventInfo=u}return __extends(r,i),r.prototype.add=function(i){var r=this;return this._handlers.length==0&&this.m_genericEventInfo.registerFunc&&this.m_genericEventInfo.registerFunc(),t.getGenericEventRegistration().isReady||this._context._pendingRequest._addPreSyncPromise(t.getGenericEventRegistration().ready()),n.ActionFactory.createTraceMarkerForCallback(this._context,function(){r._handlers.push(i);r._handlers.length==1&&t.getGenericEventRegistration().register(r.m_genericEventInfo.eventType,r.m_genericEventInfo.getTargetIdFunc(),r._callback)}),new n.EventHandlerResult(this._context,this,i)},r.prototype.remove=function(i){var r=this;this._handlers.length==1&&this.m_genericEventInfo.unregisterFunc&&this.m_genericEventInfo.unregisterFunc();n.ActionFactory.createTraceMarkerForCallback(this._context,function(){for(var n=r._handlers,u=n.length-1;u>=0;u--)if(n[u]===i){n.splice(u,1);break}n.length==0&&t.getGenericEventRegistration().unregister(r.m_genericEventInfo.eventType,r.m_genericEventInfo.getTargetIdFunc(),r._callback)})},r.prototype.removeAll=function(){},r}(n.EventHandlers);n.GenericEventHandlers=i}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function t(){}return t.prototype.executeAsync=function(i,r,u){var s=JSON.stringify(u.Body),f=u.Url,e,o;if(f.charAt(f.length-1)!="/"&&(f=f+"/"),f=f+n.Constants.processQuery,f=f+"?"+n.Constants.flags+"="+r.toString(),e={method:"POST",url:f,headers:{},body:s},e.headers[n.Constants.sourceLibHeader]=t.SourceLibHeaderValue,e.headers["CONTENT-TYPE"]="application/json",u.Headers)for(o in u.Headers)e.headers[o]=u.Headers[o];return n.HttpUtility.sendRequest(e).then(function(t){var i,r;return t.statusCode===200?i={ErrorCode:null,ErrorMessage:null,Headers:t.headers,Body:JSON.parse(t.body)}:(n.Utility.log("Error Response:"+t.body),r=n.Utility._parseErrorResponse(t),i={ErrorCode:r.errorCode,ErrorMessage:r.errorMessage,Headers:t.headers,Body:null}),i})},t.SourceLibHeaderValue="officejs-rest",t}();n.HttpRequestExecutor=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function t(){}return t.setCustomSendRequestFunc=function(n){t.s_customSendRequestFunc=n},t.xhrSendRequestFunc=function(t){return new n._Internal.OfficePromise(function(i,r){var u=new XMLHttpRequest,f;if(u.open(t.method,t.url),u.onload=function(){var t={statusCode:u.status,headers:n.Utility._parseHttpResponseHeaders(u.getAllResponseHeaders()),body:u.responseText};i(t)},u.onerror=function(){r(new n._Internal.RuntimeError({code:n.ErrorCodes.connectionFailure,message:n.Utility._getResourceString(n.ResourceStrings.connectionFailureWithStatus,u.statusText)}))},t.headers)for(f in t.headers)u.setRequestHeader(f,t.headers[f]);u.send(t.body)})},t.sendRequest=function(n){t.validateAndNormalizeRequest(n);var i=t.s_customSendRequestFunc;return i||(i=t.xhrSendRequestFunc),i(n)},t.setCustomSendLocalDocumentRequestFunc=function(n){t.s_customSendLocalDocumentRequestFunc=n},t.sendLocalDocumentRequest=function(n){t.validateAndNormalizeRequest(n);var i;return i=t.s_customSendLocalDocumentRequestFunc||t.officeJsSendLocalDocumentRequestFunc,i(n)},t.officeJsSendLocalDocumentRequestFunc=function(t){t=n.Utility._validateLocalDocumentRequest(t);var i=n.Utility._buildRequestMessageSafeArray(t);return new n._Internal.OfficePromise(function(t,r){OSF.DDA.RichApi.executeRichApiRequestAsync(i,function(i){var r;r=i.status=="succeeded"?{statusCode:n.RichApiMessageUtility.getResponseStatusCode(i),headers:n.RichApiMessageUtility.getResponseHeaders(i),body:n.RichApiMessageUtility.getResponseBody(i)}:n.RichApiMessageUtility.buildHttpResponseFromOfficeJsError(i.error.code,i.error.message);n.Utility.log(JSON.stringify(r));t(r)})})},t.validateAndNormalizeRequest=function(t){if(n.Utility.isNullOrUndefined(t))throw n._Internal.RuntimeError._createInvalidArgError({argumentName:"request"});n.Utility.isNullOrEmptyString(t.method)&&(t.method="GET");t.method=t.method.toUpperCase()},t.logRequest=function(i){if(n.Utility._logEnabled){if(n.Utility.log("---HTTP Request---"),n.Utility.log(i.method+" "+i.url),i.headers)for(var r in i.headers)n.Utility.log(r+": "+i.headers[r]);t._logBody&&n.Utility.log(i.body)}},t.logResponse=function(i){if(n.Utility._logEnabled){if(n.Utility.log("---HTTP Response---"),n.Utility.log(""+i.statusCode),i.headers)for(var r in i.headers)n.Utility.log(r+": "+i.headers[r]);t._logBody&&n.Utility.log(i.body)}},t._logBody=!1,t}();n.HttpUtility=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function n(n){this.m_clientObject=n}return n.prototype._handleResult=function(n){this.m_clientObject._handleIdResult(n)},n}();n.InstantiateActionResultHandler=t}(OfficeExtension||(OfficeExtension={})),function(n){}(OfficeExtension||(OfficeExtension={})),function(n){var u=function(){function t(n){this.m_session=n}return t.prototype.executeAsync=function(t,r,u){var e={url:n.Constants.processQuery,method:"POST",headers:u.Headers,body:u.Body},f={id:i.nextId(),type:1,flags:r,message:e};return n.Utility.log(JSON.stringify(f)),this.m_session.sendMessageToHost(f).then(function(t){var i,r,u;return n.Utility.log("Received response: "+JSON.stringify(t)),i=t.message,i.statusCode===200?r={ErrorCode:null,ErrorMessage:null,Headers:i.headers,Body:i.body}:(n.Utility.log("Error Response:"+i.body),u=n.Utility._parseErrorResponse(i),r={ErrorCode:u.errorCode,ErrorMessage:u.errorMessage,Headers:i.headers,Body:null}),r})},t}(),i=function(i){function r(n){var t=this;i.call(this);this.m_promiseResolver={};this.m_bridge=n;this.m_bridge.onMessageFromHost=function(n){t.onMessageFromHost(n)}}return __extends(r,i),r.prototype._resolveRequestUrlAndHeaderInfo=function(){return n.Utility._createPromiseFromResult(null)},r.prototype._createRequestExecutorOrNull=function(){return n.Utility.log("NativeBridgeSession::CreateRequestExecutor"),new u(this)},Object.defineProperty(r.prototype,"eventRegistration",{get:function(){return n._Internal.officeJsEventRegistration},enumerable:!0,configurable:!0}),r.init=function(t){if(t&&typeof t=="object"){var i=new r(t);n.ClientRequestContext._overrideSession=i;n.HttpUtility.setCustomSendLocalDocumentRequestFunc(function(n){var t={id:r.nextId(),type:1,flags:0,message:n};return i.sendMessageToHost(t).then(function(n){return n.message})})}},r.prototype.sendMessageToHost=function(t){var i=this;return this.m_bridge.sendMessageToHost(JSON.stringify(t)),new n._Internal.OfficePromise(function(n,r){i.m_promiseResolver[t.id]=n})},r.prototype.onMessageFromHost=function(n){var i,r;n==="test"?t._testFunc&&t._testFunc():(i=JSON.parse(n),typeof i.id=="number"&&(r=this.m_promiseResolver[i.id],r&&r(i),delete this.m_promiseResolver[i.id]))},r.nextId=function(){return r.s_nextId++},r.s_nextId=1,r}(n.SessionBase),r=function(){function n(){}return n.init=function(n){i.init(n)},n}(),t;n.HostBridge=r;typeof _richApiNativeBridge=="object"&&_richApiNativeBridge&&r.init(_richApiNativeBridge);t=function(){function n(){}return n.setTestFunc=function(t){n._testFunc=t},n}();n.HostBridgeTest=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function t(n,t,i,r){this.m_objectPathInfo=n;this.m_parentObjectPath=t;this.m_isWriteOperation=!1;this.m_isCollection=i;this.m_isInvalidAfterRequest=r;this.m_isValid=!0}return Object.defineProperty(t.prototype,"objectPathInfo",{get:function(){return this.m_objectPathInfo},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isWriteOperation",{get:function(){return this.m_isWriteOperation},set:function(n){this.m_isWriteOperation=n},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRestrictedResourceAccess",{get:function(){return this.m_isRestrictedResourceAccess},set:function(n){this.m_isRestrictedResourceAccess=n},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(n){this.m_argumentObjectPaths=n},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isValid",{get:function(){return this.m_isValid},set:function(n){this.m_isValid=n;!n&&this.m_objectPathInfo.ObjectPathType===6&&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,"getByIdMethodName",{get:function(){return this.m_getByIdMethodName},set:function(n){this.m_getByIdMethodName=n},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.updateUsingObjectData=function(i,r){var l=i[n.Constants.referenceId],h,a,f,c,u,e,o,s;if(!n.Utility.isNullOrEmptyString(l)){this.m_savedObjectPathInfo||this.isInvalidAfterRequest||!t.isRestorableObjectPath(this.m_objectPathInfo.ObjectPathType)||(h={},t.copyObjectPathInfo(this.m_objectPathInfo,h),this.m_savedObjectPathInfo={pathInfo:h,parent:this.m_parentObjectPath});this.resetForUpdateUsingObjectData();this.m_objectPathInfo.ObjectPathType=6;this.m_objectPathInfo.Name=l;delete this.m_objectPathInfo.ParentObjectPathId;this.m_parentObjectPath=null;return}if(a=this.parentObjectPath&&this.parentObjectPath.isCollection,f=this.getByIdMethodName,(a||!n.Utility.isNullOrEmptyString(f))&&(u=n.Utility.tryGetObjectIdFromLoadOrRetrieveResult(i),!n.Utility.isNullOrUndefined(u))){this.resetForUpdateUsingObjectData();n.Utility.isNullOrEmptyString(f)?(this.m_objectPathInfo.ObjectPathType=5,this.m_objectPathInfo.Name=""):(this.m_objectPathInfo.ObjectPathType=3,this.m_objectPathInfo.Name=f,this.m_getByIdMethodName=null);this.m_objectPathInfo.ArgumentInfo.Arguments=[u];return}if(c=r[n.Constants.collectionPropertyPath],this.m_objectPathInfo.ObjectPathType!==5&&!n.Utility.isNullOrEmptyString(c)&&(u=n.Utility.tryGetObjectIdFromLoadOrRetrieveResult(i),!n.Utility.isNullOrUndefined(u))){for(e=c.split("."),o=r.context[e[0]],s=1;s<e.length;s++)o=o[e[s]];this.resetForUpdateUsingObjectData();this.m_parentObjectPath=o._objectPath;this.m_objectPathInfo.ParentObjectPathId=this.m_parentObjectPath.objectPathInfo.Id;this.m_objectPathInfo.ObjectPathType=5;this.m_objectPathInfo.Name="";this.m_objectPathInfo.ArgumentInfo.Arguments=[u];return}},t.prototype.resetForUpdateUsingObjectData=function(){this.m_isInvalidAfterRequest=!1;this.m_isValid=!0;this.m_isWriteOperation=!1;this.m_objectPathInfo.ArgumentInfo={};this.m_argumentObjectPaths=null},t.isRestorableObjectPath=function(n){return n===1||n===5||n===3||n===4},t.copyObjectPathInfo=function(n,t){t.Id=n.Id;t.ArgumentInfo=n.ArgumentInfo;t.Name=n.Name;t.ObjectPathType=n.ObjectPathType;t.ParentObjectPathId=n.ParentObjectPathId},t}();n.ObjectPath=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function t(){}return t.createGlobalObjectObjectPath=function(t){var i={Id:t._nextId(),ObjectPathType:1,Name:""};return new n.ObjectPath(i,null,!1,!1)},t.createNewObjectObjectPath=function(t,i,r,u){var e={Id:t._nextId(),ObjectPathType:2,Name:i},f=new n.ObjectPath(e,null,r,!1);return f.isRestrictedResourceAccess=u,f},t.createPropertyObjectPath=function(t,i,r,u,f,e){var s={Id:t._nextId(),ObjectPathType:4,Name:r,ParentObjectPathId:i._objectPath.objectPathInfo.Id},o=new n.ObjectPath(s,i._objectPath,u,f);return o.isRestrictedResourceAccess=e,o},t.createIndexerObjectPath=function(t,i,r){var u={Id:t._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:i._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return u.ArgumentInfo.Arguments=r,new n.ObjectPath(u,i._objectPath,!1,!1)},t.createIndexerObjectPathUsingParentPath=function(t,i,r){var u={Id:t._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:i.objectPathInfo.Id,ArgumentInfo:{}};return u.ArgumentInfo.Arguments=r,new n.ObjectPath(u,i,!1,!1)},t.createMethodObjectPath=function(t,i,r,u,f,e,o,s,h){var l={Id:t._nextId(),ObjectPathType:3,Name:r,ParentObjectPathId:i._objectPath.objectPathInfo.Id,ArgumentInfo:{}},a=n.Utility.setMethodArguments(t,l.ArgumentInfo,f),c=new n.ObjectPath(l,i._objectPath,e,o);return c.argumentObjectPaths=a,c.isWriteOperation=u!=1,c.getByIdMethodName=s,c.isRestrictedResourceAccess=h,c},t.createReferenceIdObjectPath=function(t,i){var r={Id:t._nextId(),ObjectPathType:6,Name:i,ArgumentInfo:{}};return new n.ObjectPath(r,null,!1,!1)},t.createChildItemObjectPathUsingIndexerOrGetItemAt=function(i,r,u,f,e){var o=n.Utility.tryGetObjectIdFromLoadOrRetrieveResult(f);return i&&!n.Utility.isNullOrUndefined(o)?t.createChildItemObjectPathUsingIndexer(r,u,f):t.createChildItemObjectPathUsingGetItemAt(r,u,f,e)},t.createChildItemObjectPathUsingIndexer=function(t,i,r){var f=n.Utility.tryGetObjectIdFromLoadOrRetrieveResult(r),u=u={Id:t._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:i._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return u.ArgumentInfo.Arguments=[f],new n.ObjectPath(u,i._objectPath,!1,!1)},t.createChildItemObjectPathUsingGetItemAt=function(t,i,r,u){var e=r[n.Constants.index],f;return e&&(u=e),f={Id:t._nextId(),ObjectPathType:3,Name:n.Constants.getItemAt,ParentObjectPathId:i._objectPath.objectPathInfo.Id,ArgumentInfo:{}},f.ArgumentInfo.Arguments=[u],new n.ObjectPath(f,i._objectPath,!1,!1)},t}();n.ObjectPathFactory=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function t(n){this.m_context=n}return t.prototype.executeAsync=function(i,r,u){var f=this,e=n.RichApiMessageUtility.buildMessageArrayForIRequestExecutor(i,r,u,t.SourceLibHeaderValue);return new n._Internal.OfficePromise(function(t,i){OSF.DDA.RichApi.executeRichApiRequestAsync(e,function(i){n.Utility.log("Response:");n.Utility.log(JSON.stringify(i));var r;i.status=="succeeded"?r=n.RichApiMessageUtility.buildResponseOnSuccess(n.RichApiMessageUtility.getResponseBody(i),n.RichApiMessageUtility.getResponseHeaders(i)):(r=n.RichApiMessageUtility.buildResponseOnError(i.error.code,i.error.message),f.m_context._processOfficeJsErrorResponse(i.error.code,r));t(r)})})},t.SourceLibHeaderValue="officejs",t}();n.OfficeJsRequestExecutor=t}(OfficeExtension||(OfficeExtension={})),function(n){var t,i;(function(n){n.OfficeRequire=function(){return null}()})(t=n._Internal||(n._Internal={})),function(n){var t;(function(t){function i(){return function(){"use strict";function vt(n){return typeof n=="function"||typeof n=="object"&&n!==null}function b(n){return typeof n=="function"}function yt(n){return typeof n=="object"&&n!==null}function wt(n){k=n}function bt(n){f=n}function ni(){var t=process.nextTick,n=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);return Array.isArray(n)&&n[1]==="0"&&n[2]==="10"&&(t=setImmediate),function(){t(c)}}function tr(){return function(){pt(c)}}function ti(){var n=0,i=new it(c),t=document.createTextNode("");return i.observe(t,{characterData:!0}),function(){t.data=n=++n%2}}function ii(){var n=new MessageChannel;return n.port1.onmessage=c,function(){n.port2.postMessage(0)}}function ri(){return function(){setTimeout(c,1)}}function c(){for(var t,i,n=0;n<h;n+=2)t=e[n],i=e[n+1],t(i),e[n]=undefined,e[n+1]=undefined;h=0}function l(){}function ui(){return new TypeError("You cannot resolve a promise with itself")}function fi(){return new TypeError("A promises callback cannot return that same promise.")}function ei(n){try{return n.then}catch(t){return y.error=t,y}}function oi(n,t,i,r){try{n.call(t,i,r)}catch(u){return u}}function si(n,i,u){f(function(n){var f=!1,e=oi(u,i,function(t){f||(f=!0,i!==t?v(n,t):r(n,t))},function(i){f||(f=!0,t(n,i))},"Settle: "+(n._label||" unknown promise"));!f&&e&&(f=!0,t(n,e))},n)}function hi(n,i){i._state===a?r(n,i._result):i._state===s?t(n,i._result):p(i,undefined,function(t){v(n,t)},function(i){t(n,i)})}function ci(n,i){if(i.constructor===n.constructor)hi(n,i);else{var u=ei(i);u===y?t(n,y.error):u===undefined?r(n,i):b(u)?si(n,i,u):r(n,i)}}function v(n,i){n===i?t(n,ui()):vt(i)?ci(n,i):r(n,i)}function li(n){n._onerror&&n._onerror(n._result);d(n)}function r(n,t){n._state===o&&(n._result=t,n._state=a,n._subscribers.length!==0&&f(d,n))}function t(n,t){n._state===o&&(n._state=s,n._result=t,f(li,n))}function p(n,t,i,r){var u=n._subscribers,e=u.length;n._onerror=null;u[e]=t;u[e+a]=i;u[e+s]=r;e===0&&n._state&&f(d,n)}function d(n){var i=n._subscribers,e=n._state,r,u,f,t;if(i.length!==0){for(f=n._result,t=0;t<i.length;t+=3)r=i[t],u=i[t+e],r?ft(e,r,u,f):u(f);n._subscribers.length=0}}function ut(){this.error=null}function ai(n,t){try{return n(t)}catch(i){return w.error=i,w}}function ft(n,i,u,f){var c=b(u),e,l,h,y;if(c){if(e=ai(u,f),e===w?(y=!0,l=e.error,e=null):h=!0,i===e){t(i,fi());return}}else e=f,h=!0;i._state!==o||(c&&h?v(i,e):y?t(i,l):n===a?r(i,e):n===s&&t(i,e))}function vi(n,i){try{i(function(t){v(n,t)},function(i){t(n,i)})}catch(r){t(n,r)}}function u(n,i){var u=this;u._instanceConstructor=n;u.promise=new n(l);u._validateInput(i)?(u._input=i,u.length=i.length,u._remaining=i.length,u._init(),u.length===0?r(u.promise,u._result):(u.length=u.length||0,u._enumerate(),u._remaining===0&&r(u.promise,u._result))):t(u.promise,u._validationError())}function yi(n){return new et(this,n).promise}function pi(n){function e(n){v(i,n)}function s(n){t(i,n)}var u=this,i=new u(l),f,r;if(!nt(n))return t(i,new TypeError("You must pass an array to race.")),i;for(f=n.length,r=0;i._state===o&&r<f;r++)p(u.resolve(n[r]),undefined,e,s);return i}function wi(n){var i=this,t;return n&&typeof n=="object"&&n.constructor===i?n:(t=new i(l),v(t,n),t)}function bi(n){var r=this,i=new r(l);return t(i,n),i}function ki(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");}function di(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");}function i(n){this._id=lt++;this._state=undefined;this._result=undefined;this._subscribers=[];l!==n&&(b(n)||ki(),this instanceof i||di(),vi(this,n))}var g,e,rt,w,et,ot,st,ht,ct,lt,at;g=Array.isArray?Array.isArray:function(n){return Object.prototype.toString.call(n)==="[object Array]"};var nt=g,h=0,gi={}.toString,pt,k,f=function(n,t){e[h]=n;e[h+1]=t;h+=2;h===2&&(k?k(c):rt())};var kt=typeof window!="undefined"?window:undefined,tt=kt||{},it=tt.MutationObserver||tt.WebKitMutationObserver,dt=typeof process!="undefined"&&{}.toString.call(process)==="[object process]",gt=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";e=new Array(1e3);rt=dt?ni():it?ti():gt?ii():ri();var o=void 0,a=1,s=2,y=new ut;return w=new ut,u.prototype._validateInput=function(n){return nt(n)},u.prototype._validationError=function(){return new n.Error("Array Methods must be provided an Array")},u.prototype._init=function(){this._result=new Array(this.length)},et=u,u.prototype._enumerate=function(){for(var n=this,i=n.length,r=n.promise,u=n._input,t=0;r._state===o&&t<i;t++)n._eachEntry(u[t],t)},u.prototype._eachEntry=function(n,t){var i=this,r=i._instanceConstructor;yt(n)?n.constructor===r&&n._state!==o?(n._onerror=null,i._settledAt(n._state,t,n._result)):i._willSettleAt(r.resolve(n),t):(i._remaining--,i._result[t]=n)},u.prototype._settledAt=function(n,i,u){var f=this,e=f.promise;e._state===o&&(f._remaining--,n===s?t(e,u):f._result[i]=u);f._remaining===0&&r(e,f._result)},u.prototype._willSettleAt=function(n,t){var i=this;p(n,undefined,function(n){i._settledAt(a,t,n)},function(n){i._settledAt(s,t,n)})},ot=yi,st=pi,ht=wi,ct=bi,lt=0,at=i,i.all=ot,i.race=st,i.resolve=ht,i.reject=ct,i._setScheduler=wt,i._setAsap=bt,i._asap=f,i.prototype={constructor:i,then:function(n,t){var u=this,i=u._state,r,e,o;return i===a&&!n||i===s&&!t?this:(r=new this.constructor(l),e=u._result,i?(o=arguments[i-1],f(function(){ft(i,r,o,e)})):p(u,r,n,t),r)},"catch":function(n){return this.then(null,n)}},at}.call(this)}t.Init=i})(t=n.PromiseImpl||(n.PromiseImpl={}))}(t=n._Internal||(n._Internal={})),function(n){function t(){var n=window.navigator.userAgent,t=n.indexOf("Edge/");return t>=0?(n=n.substring(t+5,n.length),n<"14.14393"?!0:!1):!1}function i(){return typeof window=="undefined"&&typeof Promise=="function"?Promise:typeof window!="undefined"&&window.Promise?t()?n.PromiseImpl.Init():window.Promise:n.PromiseImpl.Init()}n.OfficePromise=i()}(t=n._Internal||(n._Internal={}));i=t.OfficePromise;n.Promise=i}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function t(n){this._autoCleanupList={};this.m_context=n}return t.prototype.add=function(n){var t=this;Array.isArray(n)?n.forEach(function(n){return t._addCommon(n,!0)}):this._addCommon(n,!0)},t.prototype._autoAdd=function(n){this._addCommon(n,!1);this._autoCleanupList[n._objectPath.objectPathInfo.Id]=n},t.prototype._autoTrackIfNecessaryWhenHandleObjectResultValue=function(t,i){var r=this.m_context._autoCleanup&&!t[n.Constants.isTracked]&&t!==this.m_context._rootObject&&i&&!n.Utility.isNullOrEmptyString(i[n.Constants.referenceId]);r&&(this._autoCleanupList[t._objectPath.objectPathInfo.Id]=t,t[n.Constants.isTracked]=!0)},t.prototype._addCommon=function(t,i){if(t[n.Constants.isTracked]){i&&this.m_context._autoCleanup&&delete this._autoCleanupList[t._objectPath.objectPathInfo.Id];return}var r=t[n.Constants.referenceId];n.Utility.isNullOrEmptyString(r)&&t._KeepReference&&(t._KeepReference(),n.ActionFactory.createInstantiateAction(this.m_context,t),i&&this.m_context._autoCleanup&&delete this._autoCleanupList[t._objectPath.objectPathInfo.Id],t[n.Constants.isTracked]=!0)},t.prototype.remove=function(n){var t=this;Array.isArray(n)?n.forEach(function(n){return t._removeCommon(n)}):this._removeCommon(n)},t.prototype._removeCommon=function(t){var r=t[n.Constants.referenceId],i;n.Utility.isNullOrEmptyString(r)||(i=this.m_context._rootObject,i._RemoveReference&&i._RemoveReference(r),delete t[n.Constants.isTracked])},t.prototype._retrieveAndClearAutoCleanupList=function(){var n=this._autoCleanupList;return this._autoCleanupList={},n},t}();n.TrackedObjects=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function t(n,t,i,r){n||(n="root");this.m_globalObjName=n;this.m_referencedObjectPaths=t;this.m_actions=i;this.m_statements=[];this.m_variableNameForObjectPathMap={};this.m_variableNameToObjectPathMap={};this.m_declaredObjectPathMap={};this.m_showDispose=r}return t.prototype.process=function(){this.m_showDispose&&n.ClientRequest._calculateLastUsedObjectPathIds(this.m_actions);for(var t=0;t<this.m_actions.length;t++)this.processOneAction(this.m_actions[t]);return this.m_statements},t.prototype.processForDebugStatementInfo=function(t){var o,c,i,u,f,e,r,s,h;for(this.m_showDispose&&n.ClientRequest._calculateLastUsedObjectPathIds(this.m_actions),o=5,this.m_statements=[],c="",i=-1,u=0;u<this.m_actions.length;u++)if(this.processOneAction(this.m_actions[u]),t==u&&(i=this.m_statements.length-1),i>=0&&this.m_statements.length>i+o+1)break;if(i<0)return null;for(f=i-o,f<0&&(f=0),e=i+1+o,e>this.m_statements.length&&(e=this.m_statements.length),r=[],f!=0&&r.push("..."),s=f;s<i;s++)r.push(this.m_statements[s]);for(r.push("// >>>>>"),r.push(this.m_statements[i]),r.push("// <<<<<"),h=i+1;h<e;h++)r.push(this.m_statements[h]);return e<this.m_statements.length&&r.push("..."),{statement:this.m_statements[i],surroundingStatements:r}},t.prototype.processOneAction=function(n){var t=n.actionInfo;switch(t.ActionType){case 1:this.processInstantiateAction(n);break;case 3:this.processMethodAction(n);break;case 2:this.processQueryAction(n);break;case 7:this.processQueryAsJsonAction(n);break;case 6:this.processRecursiveQueryAction(n);break;case 4:this.processSetPropertyAction(n);break;case 5:this.processTraceAction(n);break;case 8:this.processEnsureUnchangedAction(n);break;case 9:this.processUpdateAction(n);break}},t.prototype.processInstantiateAction=function(n){var i=n.actionInfo.ObjectPathId,u=this.m_referencedObjectPaths[i],r=this.getObjVarName(i),t;this.m_declaredObjectPathMap[i]?(t="// Instantiate {"+r+"}",t=this.appendDisposeCommentIfRelevant(t,n),this.m_statements.push(t)):(t="var "+r+"="+this.buildObjectPathExpressionWithParent(u)+";",t=this.appendDisposeCommentIfRelevant(t,n),this.m_statements.push(t),this.m_declaredObjectPathMap[i]=r)},t.prototype.processMethodAction=function(t){var r=t.actionInfo.Name,i;r==="_KeepReference"&&(r="track");i=this.getObjVarName(t.actionInfo.ObjectPathId)+"."+n.Utility._toCamelLowerCase(r)+"("+this.buildArgumentsExpression(t.actionInfo.ArgumentInfo)+");";i=this.appendDisposeCommentIfRelevant(i,t);this.m_statements.push(i)},t.prototype.processQueryAction=function(n){var i=this.buildQueryExpression(n),t=this.getObjVarName(n.actionInfo.ObjectPathId)+".load("+i+");";t=this.appendDisposeCommentIfRelevant(t,n);this.m_statements.push(t)},t.prototype.processQueryAsJsonAction=function(n){var i=this.buildQueryExpression(n),t=this.getObjVarName(n.actionInfo.ObjectPathId)+".retrieve("+i+");";t=this.appendDisposeCommentIfRelevant(t,n);this.m_statements.push(t)},t.prototype.processRecursiveQueryAction=function(n){var i="",t;n.actionInfo.RecursiveQueryInfo&&(i=JSON.stringify(n.actionInfo.RecursiveQueryInfo));t=this.getObjVarName(n.actionInfo.ObjectPathId)+".loadRecursive("+i+");";t=this.appendDisposeCommentIfRelevant(t,n);this.m_statements.push(t)},t.prototype.processSetPropertyAction=function(t){var i=this.getObjVarName(t.actionInfo.ObjectPathId)+"."+n.Utility._toCamelLowerCase(t.actionInfo.Name)+"="+this.buildArgumentsExpression(t.actionInfo.ArgumentInfo)+";";i=this.appendDisposeCommentIfRelevant(i,t);this.m_statements.push(i)},t.prototype.processTraceAction=function(n){var t="context.trace();";t=this.appendDisposeCommentIfRelevant(t,n);this.m_statements.push(t)},t.prototype.processEnsureUnchangedAction=function(n){var t=this.getObjVarName(n.actionInfo.ObjectPathId)+".ensureUnchanged("+JSON.stringify(n.actionInfo.ObjectState)+");";t=this.appendDisposeCommentIfRelevant(t,n);this.m_statements.push(t)},t.prototype.processUpdateAction=function(n){var t=this.getObjVarName(n.actionInfo.ObjectPathId)+".update("+JSON.stringify(n.actionInfo.ObjectState)+");";t=this.appendDisposeCommentIfRelevant(t,n);this.m_statements.push(t)},t.prototype.appendDisposeCommentIfRelevant=function(n,t){var u=this,i,r;return this.m_showDispose&&(i=t.actionInfo.L,i&&i.length>0)?(r=i.map(function(n){return u.getObjVarName(n)}).join(", "),n+" // And then dispose {"+r+"}"):n},t.prototype.buildQueryExpression=function(n){if(n.actionInfo.QueryInfo){var t={};return t.select=n.actionInfo.QueryInfo.Select,t.expand=n.actionInfo.QueryInfo.Expand,t.skip=n.actionInfo.QueryInfo.Skip,t.top=n.actionInfo.QueryInfo.Top,typeof t.top=="undefined"&&typeof t.skip=="undefined"&&typeof t.expand=="undefined"?typeof t.select=="undefined"?"":JSON.stringify(t.select):JSON.stringify(t)}return""},t.prototype.buildObjectPathExpressionWithParent=function(n){var t=n.objectPathInfo.ObjectPathType==5||n.objectPathInfo.ObjectPathType==3||n.objectPathInfo.ObjectPathType==4;return t&&n.objectPathInfo.ParentObjectPathId?this.getObjVarName(n.objectPathInfo.ParentObjectPathId)+"."+this.buildObjectPathExpression(n):this.buildObjectPathExpression(n)},t.prototype.buildObjectPathExpression=function(t){switch(t.objectPathInfo.ObjectPathType){case 1:return"context."+this.m_globalObjName;case 5:return"getItem("+this.buildArgumentsExpression(t.objectPathInfo.ArgumentInfo)+")";case 3:return n.Utility._toCamelLowerCase(t.objectPathInfo.Name)+"("+this.buildArgumentsExpression(t.objectPathInfo.ArgumentInfo)+")";case 2:return t.objectPathInfo.Name+".newObject()";case 7:return"null";case 4:return n.Utility._toCamelLowerCase(t.objectPathInfo.Name);case 6:return"context."+this.m_globalObjName+"._getObjectByReferenceId("+JSON.stringify(t.objectPathInfo.Name)+")"}},t.prototype.buildArgumentsExpression=function(n){var t="",i;if(!n.Arguments)return t;for(i=0;i<n.Arguments.length;i++)i>0&&(t=t+", "),t=t+this.buildArgumentLiteral(n.Arguments[i],n.ReferencedObjectPathIds?n.ReferencedObjectPathIds[i]:null);return t==="undefined"&&(t=""),t},t.prototype.buildArgumentLiteral=function(n,t){return typeof n=="number"&&n===t?this.getObjVarName(t):JSON.stringify(n)},t.prototype.getObjVarNameBase=function(t){var u="v",f=this.m_referencedObjectPaths[t],i,r;if(f)switch(f.objectPathInfo.ObjectPathType){case 1:u=this.m_globalObjName;break;case 4:u=n.Utility._toCamelLowerCase(f.objectPathInfo.Name);break;case 3:i=f.objectPathInfo.Name;i.length>3&&i.substr(0,3)==="Get"&&(i=i.substr(3));u=n.Utility._toCamelLowerCase(i);break;case 5:r=this.getObjVarNameBase(f.objectPathInfo.ParentObjectPathId);u=r.charAt(r.length-1)==="s"?r.substr(0,r.length-1):r+"Item";break}return u},t.prototype.getObjVarName=function(n){var t,i;if(this.m_variableNameForObjectPathMap[n])return this.m_variableNameForObjectPathMap[n];if(t=this.getObjVarNameBase(n),!this.m_variableNameToObjectPathMap[t])return this.m_variableNameForObjectPathMap[n]=t,this.m_variableNameToObjectPathMap[t]=n,t;for(i=1;this.m_variableNameToObjectPathMap[t+i.toString()];)i++;return t=t+i.toString(),this.m_variableNameForObjectPathMap[n]=t,this.m_variableNameToObjectPathMap[t]=n,t},t}();n.RequestPrettyPrinter=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function n(){}return n.cannotRegisterEvent="CannotRegisterEvent",n.connectionFailureWithStatus="ConnectionFailureWithStatus",n.connectionFailureWithDetails="ConnectionFailureWithDetails",n.invalidObjectPath="InvalidObjectPath",n.invalidRequestContext="InvalidRequestContext",n.invalidArgument="InvalidArgument",n.invalidArgumentGeneric="InvalidArgumentGeneric",n.propertyNotLoaded="PropertyNotLoaded",n.runMustReturnPromise="RunMustReturnPromise",n.timeout="Timeout",n.propertyDoesNotExist="PropertyDoesNotExist",n.attemptingToSetReadOnlyProperty="AttemptingToSetReadOnlyProperty",n.moreInfoInnerError="MoreInfoInnerError",n.cannotApplyPropertyThroughSetMethod="CannotApplyPropertyThroughSetMethod",n.valueNotLoaded="ValueNotLoaded",n.invalidOrTimedOutSessionMessage="InvalidOrTimedOutSessionMessage",n.invalidOperationInCellEditMode="InvalidOperationInCellEditMode",n.customFunctionDefintionMissing="CustomFunctionDefintionMissing",n.customFunctionImplementationMissing="CustomFunctionImplementationMissing",n.customFunctionNameContainsBadChars="CustomFunctionNameContainsBadChars",n.customFunctionNameCannotSplit="CustomFunctionNameCannotSplit",n.customFunctionUnexpectedNumberOfEntriesInResultBatch="CustomFunctionUnexpectedNumberOfEntriesInResultBatch",n.customFunctionCancellationHandlerMissing="CustomFunctionCancellationHandlerMissing",n.apiNotFoundDetails="ApiNotFoundDetails",n.pendingBatchInProgress="PendingBatchInProgress",n.notInsideBatch="NotInsideBatch",n.cannotUpdateReadOnlyProperty="CannotUpdateReadOnlyProperty",n}();n.ResourceStrings=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function n(){}return n.CannotRegisterEvent="The event handler cannot be registered.",n.ConnectionFailureWithStatus="The request failed with status code of {0}.",n.ConnectionFailureWithDetails="The request failed with status code of {0}, error code {1} and the following error message: {2}",n.InvalidArgument="The argument '{0}' doesn't work for this situation, is missing, or isn't in the right format.",n.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.',n.InvalidRequestContext="Cannot use the object across different request contexts.",n.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.",n.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()".',n.Timeout="The operation has timed out.",n.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.',n.InvalidOrTimedOutSessionMessage="Your Office Online session has expired or is invalid. To continue, refresh the page.",n.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.",n.CustomFunctionDefintionMissing="A property with this name that represents the function's definition must exist on Excel.CustomFunctions.",n.CustomFunctionImplementationMissing="The property with this name on Excel.CustomFunctions that represents the function's definition must contain a 'call' property that implements the function.",n.CustomFunctionNameContainsBadChars="The function name may only contain letters, digits, underscores, and periods.",n.CustomFunctionNameCannotSplit="The function name must contain a non-empty namespace and a non-empty short name.",n.CustomFunctionUnexpectedNumberOfEntriesInResultBatch="The batching function returned a number of results that doesn't match the number of parameter value sets that were passed into it.",n.CustomFunctionCancellationHandlerMissing="The cancellation handler onCanceled is missing in the function. The handler must be present as the function is defined as cancelable.",n.ApiNotFoundDetails="The method or property {0} is part of the {1} requirement set, which is not available in your version of {2}.",n.PendingBatchInProgress="There is a pending batch in progress. The batch method may not be called inside another batch, or simultaneously with another batch.",n.NotInsideBatch="Operations may not be invoked outside of a batch method.",n.CannotUpdateReadOnlyProperty="The property '{0}' is read-only and it cannot be updated.",n}();n.ResourceStringValues=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function t(){}return t.buildMessageArrayForIRequestExecutor=function(i,r,u,f){var o=JSON.stringify(u.Body),e;return n.Utility.log("Request:"),n.Utility.log(o),e={},e[n.Constants.sourceLibHeader]=f,t.buildRequestMessageSafeArray(i,r,"POST","ProcessQuery",e,o)},t.buildResponseOnSuccess=function(n,t){var i={ErrorCode:"",ErrorMessage:"",Headers:null,Body:null};return i.Body=JSON.parse(n),i.Headers=t,i},t.buildResponseOnError=function(i,r){var u={ErrorCode:"",ErrorMessage:"",Headers:null,Body:null};return u.ErrorCode=n.ErrorCodes.generalException,u.ErrorMessage=r,i==t.OfficeJsErrorCode_ooeNoCapability?u.ErrorCode=n.ErrorCodes.accessDenied:i==t.OfficeJsErrorCode_ooeActivityLimitReached?u.ErrorCode=n.ErrorCodes.activityLimitReached:i==t.OfficeJsErrorCode_ooeInvalidOrTimedOutSession&&(u.ErrorCode=n.ErrorCodes.invalidOrTimedOutSession,u.ErrorMessage=n.Utility._getResourceString(n.ResourceStrings.invalidOrTimedOutSessionMessage)),u},t.buildHttpResponseFromOfficeJsError=function(i,r){var f=500,u={};return u.error={},u.error.code=n.ErrorCodes.generalException,u.error.message=r,i===t.OfficeJsErrorCode_ooeNoCapability?(f=403,u.error.code=n.ErrorCodes.accessDenied):i===t.OfficeJsErrorCode_ooeActivityLimitReached&&(f=429,u.error.code=n.ErrorCodes.activityLimitReached),{statusCode:f,headers:{},body:JSON.stringify(u)}},t.buildRequestMessageSafeArray=function(n,t,i,r,u,f){var e=[],o;if(u)for(o in u)e.push(o),e.push(u[o]);var s=0,h="",c="",l="";return[n,i,r,e,f,s,t,h,c,l]},t.getResponseBody=function(n){return t.getResponseBodyFromSafeArray(n.value.data)},t.getResponseHeaders=function(n){return t.getResponseHeadersFromSafeArray(n.value.data)},t.getResponseBodyFromSafeArray=function(n){var t=n[2],i;return typeof t=="string"?t:(i=t,i.join(""))},t.getResponseHeadersFromSafeArray=function(n){var i=n[1],r,t;if(!i)return null;for(r={},t=0;t<i.length-1;t+=2)r[i[t]]=i[t+1];return r},t.getResponseStatusCode=function(n){return t.getResponseStatusCodeFromSafeArray(n.value.data)},t.getResponseStatusCodeFromSafeArray=function(n){return n[0]},t.OfficeJsErrorCode_ooeInvalidOrTimedOutSession=5012,t.OfficeJsErrorCode_ooeActivityLimitReached=5102,t.OfficeJsErrorCode_ooeNoCapability=7e3,t}();n.RichApiMessageUtility=t}(OfficeExtension||(OfficeExtension={})),function(n){var t=function(){function t(){}return t.checkArgumentNull=function(i,r){if(t.isNullOrUndefined(i))throw n._Internal.RuntimeError._createInvalidArgError(r);},t.isNullOrUndefined=function(n){return n===null?!0:typeof n=="undefined"?!0:!1},t.isUndefined=function(n){return typeof n=="undefined"?!0:!1},t.isNullOrEmptyString=function(n){return n===null?!0:typeof n=="undefined"?!0:n.length==0?!0:!1},t.isPlainJsonObject=function(n){return t.isNullOrUndefined(n)?!1:typeof n!="object"?!1:Object.getPrototypeOf(n)===Object.getPrototypeOf({})},t.trim=function(n){return n.replace(new RegExp("^\\s+|\\s+$","g"),"")},t.caseInsensitiveCompareString=function(n,i){return t.isNullOrUndefined(n)?t.isNullOrUndefined(i):t.isNullOrUndefined(i)?!1:n.toUpperCase()==i.toUpperCase()},t.adjustToDateTime=function(i){var r,u;if(t.isNullOrUndefined(i))return null;if(typeof i=="string")return new Date(i);if(Array.isArray(i)){for(r=i,u=0;u<r.length;u++)r[u]=t.adjustToDateTime(r[u]);return r}throw n._Internal.RuntimeError._createInvalidArgError("date");},t.isReadonlyRestRequest=function(n){return t.caseInsensitiveCompareString(n,"GET")},t.setMethodArguments=function(n,i,r){if(t.isNullOrUndefined(r))return null;var u=[],f=[],e=t.collectObjectPathInfos(n,r,u,f);return(i.Arguments=r,e)?(i.ReferencedObjectPathIds=f,u):null},t.collectObjectPathInfos=function(i,r,u,f){for(var o,h,c,s=!1,e=0;e<r.length;e++)r[e]instanceof n.ClientObject?(o=r[e],t.validateContext(i,o),r[e]=o._objectPath.objectPathInfo.Id,f.push(o._objectPath.objectPathInfo.Id),u.push(o._objectPath),s=!0):Array.isArray(r[e])?(h=[],c=t.collectObjectPathInfos(i,r[e],u,h),c?(f.push(h),s=!0):f.push(0)):f.push(0);return s},t.fixObjectPathIfNecessary=function(n,t){n&&n._objectPath&&t&&n._objectPath.updateUsingObjectData(t,n)},t.tryGetObjectIdFromLoadOrRetrieveResult=function(i){var r=i[n.Constants.id];return t.isNullOrUndefined(r)&&(r=i[n.Constants.idLowerCase]),t.isNullOrUndefined(r)&&(r=i[n.Constants.idPrivate]),r},t.validateObjectPath=function(i){for(var r=i._objectPath;r;){if(!r.isValid)throw new n._Internal.RuntimeError({code:n.ErrorCodes.invalidObjectPath,message:t._getResourceString(n.ResourceStrings.invalidObjectPath,t.getObjectPathExpression(r)),debugInfo:{errorLocation:t.getObjectPathExpression(r)}});r=r.parentObjectPath}},t.validateReferencedObjectPaths=function(i){var u,r;if(i)for(u=0;u<i.length;u++)for(r=i[u];r;){if(!r.isValid)throw new n._Internal.RuntimeError({code:n.ErrorCodes.invalidObjectPath,message:t._getResourceString(n.ResourceStrings.invalidObjectPath,t.getObjectPathExpression(r))});r=r.parentObjectPath}},t.validateContext=function(i,r){if(r&&r.context!==i)throw new n._Internal.RuntimeError({code:n.ErrorCodes.invalidRequestContext,message:t._getResourceString(n.ResourceStrings.invalidRequestContext)});},t.log=function(n){t._logEnabled&&typeof console!="undefined"&&console.log&&console.log(n)},t.load=function(n,t){return n.context.load(n,t),n},t.loadAndSync=function(n,t){return n.context.load(n,t),n.context.sync().then(function(){return n})},t.retrieve=function(i,r){var u=n._internalConfig.alwaysPolyfillClientObjectRetrieveMethod,f,e,o;return u||(u=!t.isSetSupported("RichApiRuntime","1.1")),f=new n.RetrieveResultImpl(i,u),e=n.ClientRequestContext._parseQueryOption(r),o=u?n.ActionFactory.createQueryAction(i.context,i,e):n.ActionFactory.createQueryAsJsonAction(i.context,i,e),i.context._pendingRequest.addActionResultHandler(o,f),f},t.retrieveAndSync=function(n,i){var r=t.retrieve(n,i);return n.context.sync().then(function(){return r})},t.isSetSupported=function(n,t){return typeof window!="undefined"&&window.Office&&window.Office.context&&window.Office.context.requirements?window.Office.context.requirements.isSetSupported(n,t):!0},t._parseSelectExpand=function(n){function e(n){var t=n.toLowerCase(),i,r;return t==="items"||t==="items/"?"*":(i=6,r=t.substr(0,i)==="items/"||t.substr(0,i)==="items.",r&&(n=n.substr(i)),n.replace(new RegExp("[/.]items[/.]","gi"),"/"))}var f=[],u,r,i;if(!t.isNullOrEmptyString(n))for(u=n.split(","),r=0;r<u.length;r++)i=u[r],i=e(i.trim()),i.length>0&&f.push(i);return f},t.toJson=function(n,i,r,u){var o={},e,f;for(e in i)f=i[e],typeof f!="undefined"&&(o[e]=f);for(e in r)f=r[e],typeof f!="undefined"&&(o[e]=f[t.fieldName_isCollection]&&typeof f[t.fieldName_m__items]!="undefined"?f.toJSON().items:f.toJSON());return u&&(o.items=u.map(function(n){return n.toJSON()})),o},t.throwError=function(i,r,u){throw new n._Internal.RuntimeError({code:i,message:t._getResourceString(i,r),debugInfo:u?{errorLocation:u}:undefined});},t.createRuntimeError=function(t,i,r){return new n._Internal.RuntimeError({code:t,message:i,debugInfo:{errorLocation:r}})},t._getResourceString=function(i,r){var u,e,f,o;return typeof window!="undefined"&&window.Strings&&window.Strings.OfficeOM&&(e="L_"+i,f=window.Strings.OfficeOM[e],f&&(u=f)),u||(u=n.ResourceStringValues[i]),u||(u=i),t.isNullOrUndefined(r)||(Array.isArray(r)?(o=r,u=t._formatString(u,o)):u=u.replace("{0}",r)),u},t._formatString=function(t,i){return t.replace(/\{\d\}/g,function(t){var r=parseInt(t.substr(1,t.length-2));if(r<i.length)return i[r];else throw n._Internal.RuntimeError._createInvalidArgError("format");})},t.throwIfNotLoaded=function(n,i,r,u){if(!u&&t.isUndefined(i)&&n.charCodeAt(0)!=t.s_underscoreCharCode)throw t.createPropertyNotLoadedException(r,n);},t.createPropertyNotLoadedException=function(i,r){return new n._Internal.RuntimeError({code:n.ErrorCodes.propertyNotLoaded,message:t._getResourceString(n.ResourceStrings.propertyNotLoaded,r),debugInfo:i?{errorLocation:i+"."+r}:undefined})},t.createCannotUpdateReadOnlyPropertyException=function(i,r){return new n._Internal.RuntimeError({code:n.ErrorCodes.cannotUpdateReadOnlyProperty,message:t._getResourceString(n.ResourceStrings.cannotUpdateReadOnlyProperty,r),debugInfo:i?{errorLocation:i+"."+r}:undefined})},t.throwIfApiNotSupported=function(i,r,u,f){if(t._doApiNotSupportedCheck&&!t.isSetSupported(r,u)){var e=t._getResourceString(n.ResourceStrings.apiNotFoundDetails,[i,r+" "+u,f]);throw new n._Internal.RuntimeError({code:n.ErrorCodes.apiNotFound,message:e,debugInfo:{errorLocation:i}});}},t.getObjectPathExpression=function(n){for(var i="";n;){switch(n.objectPathInfo.ObjectPathType){case 1:i=i;break;case 2:i="new()"+(i.length>0?".":"")+i;break;case 3:i=t.normalizeName(n.objectPathInfo.Name)+"()"+(i.length>0?".":"")+i;break;case 4:i=t.normalizeName(n.objectPathInfo.Name)+(i.length>0?".":"")+i;break;case 5:i="getItem()"+(i.length>0?".":"")+i;break;case 6:i="_reference()"+(i.length>0?".":"")+i;break}n=n.parentObjectPath}return i},t._createPromiseFromResult=function(t){return new n._Internal.OfficePromise(function(n,i){n(t)})},t._createTimeoutPromise=function(t){return new n._Internal.OfficePromise(function(n,i){setTimeout(function(){n(null)},t)})},t.promisify=function(t){return new n._Internal.OfficePromise(function(n,i){var r=function(t){t.status=="failed"?i(t.error):n(t.value)};t(r)})},t._addActionResultHandler=function(n,t,i){n.context._pendingRequest.addActionResultHandler(t,i)},t._handleNavigationPropertyResults=function(n,i,r){for(var u=0;u<r.length-1;u+=2)t.isUndefined(i[r[u+1]])||n[r[u]]._handleResult(i[r[u+1]])},t.normalizeName=function(n){return n.substr(0,1).toLowerCase()+n.substr(1)},t._isLocalDocumentUrl=function(n){return t._getLocalDocumentUrlPrefixLength(n)>0},t._getLocalDocumentUrlPrefixLength=function(n){for(var i=["http://document.localhost","https://document.localhost","//document.localhost"],r=n.toLowerCase().trim(),t=0;t<i.length;t++)if(r===i[t])return i[t].length;else if(r.substr(0,i[t].length+1)===i[t]+"/")return i[t].length+1;return 0},t._validateLocalDocumentRequest=function(i){var f=t._getLocalDocumentUrlPrefixLength(i.url),r,u;if(f<=0)throw n._Internal.RuntimeError._createInvalidArgError({argumentName:"request"});return r=i.url.substr(f),u=r.toLowerCase(),u==="_api"?r="":u.substr(0,5)==="_api/"&&(r=r.substr(5)),{method:i.method,url:r,headers:i.headers,body:i.body}},t._buildRequestMessageSafeArray=function(i){var r=0,f,s,e,u,o,h;if(t.isReadonlyRestRequest(i.method)||(r=1),i.url.substr(0,n.Constants.processQuery.length).toLowerCase()===n.Constants.processQuery.toLowerCase()&&(f=i.url.indexOf("?"),f>0))for(s=i.url.substr(f+1),e=s.split("&"),u=0;u<e.length;u++)if(o=e[u].split("="),o[0].toLowerCase()===n.Constants.flags){h=parseInt(o[1]);r=h;r=r&1;break}return n.RichApiMessageUtility.buildRequestMessageSafeArray("",r,i.method,i.url,i.headers,i.body)},t._parseHttpResponseHeaders=function(n){var s={},h,o,r,i,u,f,e;if(!t.isNullOrEmptyString(n))for(h=new RegExp("\r?\n"),o=n.split(h),r=0;r<o.length;r++)i=o[r],i!=null&&(u=i.indexOf(":"),u>0&&(f=i.substr(0,u),e=i.substr(u+1),f=t.trim(f),e=t.trim(e),s[f.toUpperCase()]=e));return s},t._parseErrorResponse=function(i){var r=null,f,e,u;if(t.isPlainJsonObject(i.body))r=i.body;else if(!t.isNullOrEmptyString(i.body)){f=t.trim(i.body);try{r=JSON.parse(f)}catch(o){t.log("Error when parse "+f)}}return!t.isNullOrUndefined(r)&&typeof r=="object"&&r.error?(u=r.error.code,e=t._getResourceString(n.ResourceStrings.connectionFailureWithDetails,[i.statusCode.toString(),r.error.code,r.error.message])):e=t._getResourceString(n.ResourceStrings.connectionFailureWithStatus,i.statusCode.toString()),t.isNullOrEmptyString(u)&&(u=n.ErrorCodes.connectionFailure),{errorCode:u,errorMessage:e}},t._copyHeaders=function(n,t){if(n&&t)for(var i in n)t[i]=n[i]},t._toCamelLowerCase=function(n){if(t.isNullOrEmptyString(n))return n;for(var i=0;i<n.length&&n.charCodeAt(i)>=65&&n.charCodeAt(i)<=90;)i++;return i<n.length?n.substr(0,i).toLowerCase()+n.substr(i):n.toLowerCase()},t.definePropertyThrowUnloadedException=function(n,i,r){Object.defineProperty(n,r,{configurable:!0,enumerable:!0,get:function(){throw t.createPropertyNotLoadedException(i,r);},set:function(){throw t.createCannotUpdateReadOnlyPropertyException(i,r);}})},t.defineReadOnlyPropertyWithValue=function(n,i,r){Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get:function(){return r},set:function(){throw t.createCannotUpdateReadOnlyPropertyException(null,i);}})},t.processRetrieveResult=function(i,r,u,f){var c,a,v,l,e,o,h,w,s;if(!t.isNullOrUndefined(r))if(f){if(c=r[n.Constants.itemsLowerCase],Array.isArray(c)){for(a=[],e=0;e<c.length;e++)v=f(c[e],e),l={},l[n.Constants.proxy]=v,v._handleRetrieveResult(c[e],l),a.push(l);t.defineReadOnlyPropertyWithValue(u,n.Constants.itemsLowerCase,a)}}else{var y=i[n.Constants.scalarPropertyNames],p=i[n.Constants.navigationPropertyNames],b=i[n.Constants.className];if(y)for(e=0;e<y.length;e++)o=y[e],h=r[o],t.isUndefined(h)?t.definePropertyThrowUnloadedException(u,b,o):t.defineReadOnlyPropertyWithValue(u,o,h);if(p)for(e=0;e<p.length;e++)o=p[e],h=r[o],t.isUndefined(h)?t.definePropertyThrowUnloadedException(u,b,o):(w=i[o],s={},w._handleRetrieveResult(h,s),s[n.Constants.proxy]=w,Array.isArray(s[n.Constants.itemsLowerCase])&&(s=s[n.Constants.itemsLowerCase]),t.defineReadOnlyPropertyWithValue(u,o,s))}},t.fieldName_m__items="m__items",t.fieldName_isCollection="_isCollection",t._logEnabled=!1,t._synchronousCleanup=!1,t._doApiNotSupportedCheck=!1,t.s_underscoreCharCode="_".charCodeAt(0),t}();n.Utility=t}(OfficeExtension||(OfficeExtension={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var h="OfficeCore",c="AgaveVisualApi",l=OfficeExtension.ObjectPathFactory.createPropertyObjectPath,a=OfficeExtension.ObjectPathFactory.createMethodObjectPath,v=OfficeExtension.ObjectPathFactory.createIndexerObjectPath,i=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath,y=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer,p=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt,w=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt,t=OfficeExtension.ActionFactory.createMethodAction,b=OfficeExtension.ActionFactory.createEnsureUnchangedAction,k=OfficeExtension.ActionFactory.createSetPropertyAction,r=OfficeExtension.Utility.isNullOrUndefined,d=OfficeExtension.Utility.isUndefined,g=OfficeExtension.Utility.throwIfNotLoaded,nt=OfficeExtension.Utility.throwIfApiNotSupported,tt=OfficeExtension.Utility.load,it=OfficeExtension.Utility.loadAndSync,rt=OfficeExtension.Utility.retrieve,ut=OfficeExtension.Utility.retrieveAndSync,u=OfficeExtension.Utility.toJson,f=OfficeExtension.Utility.fixObjectPathIfNecessary,e=OfficeExtension.Utility._addActionResultHandler,ft=OfficeExtension.Utility._handleNavigationPropertyResults,et=OfficeExtension.Utility.adjustToDateTime,ot="BiShim",o=function(o){function s(){return o!==null&&o.apply(this,arguments)||this}return __extends(s,o),Object.defineProperty(s.prototype,"_className",{get:function(){return"BiShim"},enumerable:!0,configurable:!0}),s.prototype.initialize=function(n){t(this.context,this,"Initialize",0,[n],!1)},s.prototype.uninitialize=function(){t(this.context,this,"Uninitialize",0,[],!1)},s.prototype.getData=function(){var i=t(this.context,this,"getData",1,[],!1),n=new OfficeExtension.ClientResult;return e(this,i,n),n},s.prototype._handleResult=function(n){if(o.prototype._handleResult.call(this,n),!r(n)){var t=n;f(this,t)}},s.newObject=function(t){return new n.BiShim(t,i(t,"Microsoft.AgaveVisual.BiShim",!1,!1))},s.prototype.toJSON=function(){return u(this,{},{})},s}(OfficeExtension.ClientObject),s;n.BiShim=o,function(n){n.generalException="GeneralException"}(s=n.ErrorCodes||(n.ErrorCodes={}))}(OfficeCore||(OfficeCore={})),function(n){var y="OfficeCore",p="ExperimentApi",w=OfficeExtension.ObjectPathFactory.createPropertyObjectPath,i=OfficeExtension.ObjectPathFactory.createMethodObjectPath,b=OfficeExtension.ObjectPathFactory.createIndexerObjectPath,o=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath,k=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer,d=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt,g=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt,t=OfficeExtension.ActionFactory.createMethodAction,nt=OfficeExtension.ActionFactory.createSetPropertyAction,r=OfficeExtension.Utility.isNullOrUndefined,s=OfficeExtension.Utility.isUndefined,h=OfficeExtension.Utility.throwIfNotLoaded,tt=OfficeExtension.Utility.throwIfApiNotSupported,c=OfficeExtension.Utility.load,u=OfficeExtension.Utility.fixObjectPathIfNecessary,f=OfficeExtension.Utility._addActionResultHandler,it=OfficeExtension.Utility._handleNavigationPropertyResults,rt=OfficeExtension.Utility.adjustToDateTime,l=function(e){function s(){return e!==null&&e.apply(this,arguments)||this}return __extends(s,e),Object.defineProperty(s.prototype,"_className",{get:function(){return"FlightingService"},enumerable:!0,configurable:!0}),s.prototype.getClientSessionId=function(){var i=t(this.context,this,"GetClientSessionId",1,[]),n=new OfficeExtension.ClientResult;return f(this,i,n),n},s.prototype.getDeferredFlights=function(){var i=t(this.context,this,"GetDeferredFlights",1,[]),n=new OfficeExtension.ClientResult;return f(this,i,n),n},s.prototype.getFeature=function(t,r,u,f){return new n.ABType(this.context,i(this.context,this,"GetFeature",1,[t,r,u,f],!1,!1,null))},s.prototype.getFeatureGate=function(t,r){return new n.ABType(this.context,i(this.context,this,"GetFeatureGate",1,[t,r],!1,!1,null))},s.prototype.resetOverride=function(n){t(this.context,this,"ResetOverride",0,[n])},s.prototype.setOverride=function(n,i,r){t(this.context,this,"SetOverride",0,[n,i,r])},s.prototype._handleResult=function(n){if(e.prototype._handleResult.call(this,n),!r(n)){var t=n;u(this,t)}},s.newObject=function(t){return new n.FlightingService(t,o(t,"Microsoft.Experiment.FlightingService",!1))},s.prototype.toJSON=function(){return{}},s}(OfficeExtension.ClientObject),e,a,v;n.FlightingService=l;e=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),Object.defineProperty(t.prototype,"_className",{get:function(){return"ABType"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return h("value",this.m_value,"ABType",this._isNull),this.m_value},enumerable:!0,configurable:!0}),t.prototype._handleResult=function(t){if(n.prototype._handleResult.call(this,t),!r(t)){var i=t;u(this,i);s(i.Value)||(this.m_value=i.Value)}},t.prototype.load=function(n){return c(this,n),this},t.prototype.toJSON=function(){return{value:this.m_value}},t}(OfficeExtension.ClientObject);n.ABType=e,function(n){n.boolean="Boolean";n.integer="Integer";n.string="String"}(a=n.FeatureType||(n.FeatureType={})),function(n){n.generalException="GeneralException"}(v=n.ExperimentErrorCodes||(n.ExperimentErrorCodes={}))}(OfficeCore||(OfficeCore={})),function(n){var t=function(){function t(n){this.context=n}return Object.defineProperty(t.prototype,"authentication",{get:function(){return this.m_authentication||(this.m_authentication=n.AuthenticationService.newObject(this.context)),this.m_authentication},enumerable:!0,configurable:!0}),t}(),i;n.FirstPartyApis=t;i=function(i){function r(n){return i.call(this,n)||this}return __extends(r,i),Object.defineProperty(r.prototype,"firstParty",{get:function(){return this.m_firstPartyApis||(this.m_firstPartyApis=new t(this)),this.m_firstPartyApis},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"flighting",{get:function(){return this.flightingService},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"telemetry",{get:function(){return this.m_telemetry||(this.m_telemetry=n.TelemetryService.newObject(this)),this.m_telemetry},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"bi",{get:function(){return this.m_biShim||(this.m_biShim=n.BiShim.newObject(this)),this.m_biShim},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"flightingService",{get:function(){return this.m_flightingService||(this.m_flightingService=n.FlightingService.newObject(this)),this.m_flightingService},enumerable:!0,configurable:!0}),r}(OfficeExtension.ClientRequestContext);n.RequestContext=i}(OfficeCore||(OfficeCore={})),function(n){var o="OfficeCore",s="TelemetryApi",h=OfficeExtension.ObjectPathFactory.createPropertyObjectPath,c=OfficeExtension.ObjectPathFactory.createMethodObjectPath,l=OfficeExtension.ObjectPathFactory.createIndexerObjectPath,t=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath,a=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer,v=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt,y=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt,i=OfficeExtension.ActionFactory.createMethodAction,p=OfficeExtension.ActionFactory.createSetPropertyAction,r=OfficeExtension.Utility.isNullOrUndefined,w=OfficeExtension.Utility.isUndefined,b=OfficeExtension.Utility.throwIfNotLoaded,k=OfficeExtension.Utility.throwIfApiNotSupported,d=OfficeExtension.Utility.load,u=OfficeExtension.Utility.fixObjectPathIfNecessary,g=OfficeExtension.Utility._addActionResultHandler,nt=OfficeExtension.Utility._handleNavigationPropertyResults,tt=OfficeExtension.Utility.adjustToDateTime,it="TelemetryService",f=function(f){function e(){return f!==null&&f.apply(this,arguments)||this}return __extends(e,f),Object.defineProperty(e.prototype,"_className",{get:function(){return"TelemetryService"},enumerable:!0,configurable:!0}),e.prototype.sendTelemetryEvent=function(n,t,r,u,f){i(this.context,this,"SendTelemetryEvent",1,[n,t,r,u,f],!1)},e.prototype._handleResult=function(n){if(f.prototype._handleResult.call(this,n),!r(n)){var t=n;u(this,t)}},e.newObject=function(i){return new n.TelemetryService(i,t(i,"Microsoft.Telemetry.TelemetryService",!1,!1))},e.prototype.toJSON=function(){return{}},e}(OfficeExtension.ClientObject),e;n.TelemetryService=f,function(n){n.generalException="GeneralException"}(e=n.TelemetryErrorCodes||(n.TelemetryErrorCodes={}))}(OfficeCore||(OfficeCore={})),function(n){var st="Office",ht="OfficeSharedApi",o=OfficeExtension.ObjectPathFactory.createPropertyObjectPath,l=OfficeExtension.ObjectPathFactory.createMethodObjectPath,nt=OfficeExtension.ObjectPathFactory.createIndexerObjectPath,tt=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath,ct=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer,lt=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt,a=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt,u=OfficeExtension.ActionFactory.createMethodAction,it=OfficeExtension.ActionFactory.createEnsureUnchangedAction,v=OfficeExtension.ActionFactory.createSetPropertyAction,f=OfficeExtension.Utility.isNullOrUndefined,t=OfficeExtension.Utility.isUndefined,i=OfficeExtension.Utility.throwIfNotLoaded,at=OfficeExtension.Utility.throwIfApiNotSupported,y=OfficeExtension.Utility.load,p=OfficeExtension.Utility.retrieve,s=OfficeExtension.Utility.toJson,h=OfficeExtension.Utility.fixObjectPathIfNecessary,e=OfficeExtension.Utility._addActionResultHandler,rt=OfficeExtension.Utility._handleNavigationPropertyResults,w=OfficeExtension.Utility.adjustToDateTime,c=OfficeExtension.Utility.processRetrieveResult,ut,ft,b,r,k,d,g,et,ot;(function(n){n.organizationAccount="OrganizationAccount";n.microsoftAccount="MicrosoftAccount"})(ut=n.IdentityType||(n.IdentityType={}));ft="AuthenticationService";b=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),Object.defineProperty(i.prototype,"_className",{get:function(){return"AuthenticationService"},enumerable:!0,configurable:!0}),i.prototype.getAccessToken=function(n){var i=u(this.context,this,"GetAccessToken",1,[n],!0),t=new OfficeExtension.ClientResult;return e(this,i,t),t},i.prototype.getPrimaryIdentityType=function(){var t=u(this.context,this,"GetPrimaryIdentityType",1,[],!0),n=new OfficeExtension.ClientResult;return e(this,t,n),n},i.prototype.hasUserSignin=function(){var t=u(this.context,this,"HasUserSignin",1,[],!0),n=new OfficeExtension.ClientResult;return e(this,t,n),n},i.prototype._handleResult=function(n){if(t.prototype._handleResult.call(this,n),!f(n)){var i=n;h(this,i)}},i.prototype._handleRetrieveResult=function(n,i){t.prototype._handleRetrieveResult.call(this,n,i);c(this,n,i)},i.newObject=function(t){return new n.AuthenticationService(t,tt(t,"Microsoft.Authentication.AuthenticationService",!1,!1))},i.prototype.toJSON=function(){return s(this,{},{})},i}(OfficeExtension.ClientObject);n.AuthenticationService=b;r="Comment";k=function(a){function b(){return a!==null&&a.apply(this,arguments)||this}return __extends(b,a),Object.defineProperty(b.prototype,"_className",{get:function(){return"Comment"},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"_scalarPropertyNames",{get:function(){return["id","text","created","level","resolved","author","mentions"]},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"_scalarPropertyUpdateable",{get:function(){return[!1,!0,!1,!1,!0,!1,!1]},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"_navigationPropertyNames",{get:function(){return["parent","parentOrNullObject","replies"]},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"parent",{get:function(){return this._P||(this._P=new n.Comment(this.context,o(this.context,this,"Parent",!1,!1,!1))),this._P},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"parentOrNullObject",{get:function(){return this._Pa||(this._Pa=new n.Comment(this.context,o(this.context,this,"ParentOrNullObject",!1,!1,!1))),this._Pa},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"replies",{get:function(){return this._R||(this._R=new n.CommentCollection(this.context,o(this.context,this,"Replies",!0,!1,!1))),this._R},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"author",{get:function(){return i("author",this._A,r,this._isNull),this._A},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"created",{get:function(){return i("created",this._C,r,this._isNull),this._C},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"id",{get:function(){return i("id",this._I,r,this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"level",{get:function(){return i("level",this._L,r,this._isNull),this._L},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"mentions",{get:function(){return i("mentions",this._M,r,this._isNull),this._M},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"resolved",{get:function(){return i("resolved",this._Re,r,this._isNull),this._Re},set:function(n){this._Re=n;v(this.context,this,"Resolved",n)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"text",{get:function(){return i("text",this._T,r,this._isNull),this._T},set:function(n){this._T=n;v(this.context,this,"Text",n)},enumerable:!0,configurable:!0}),b.prototype.set=function(n,t){this._recursivelySet(n,t,["text","resolved"],[],["parent","parentOrNullObject","replies"])},b.prototype.update=function(n){this._recursivelyUpdate(n)},b.prototype.delete=function(){u(this.context,this,"Delete",0,[],!1)},b.prototype.getParentOrSelf=function(){return new n.Comment(this.context,l(this.context,this,"GetParentOrSelf",1,[],!1,!1,null,!1))},b.prototype.getRichText=function(n){var i=u(this.context,this,"GetRichText",1,[n],!1),t=new OfficeExtension.ClientResult;return e(this,i,t),t},b.prototype.reply=function(t,i){return new n.Comment(this.context,l(this.context,this,"Reply",0,[t,i],!1,!1,null,!1))},b.prototype.setRichText=function(n,t){var r=u(this.context,this,"SetRichText",0,[n,t],!1),i=new OfficeExtension.ClientResult;return e(this,r,i),i},b.prototype._handleResult=function(n){if(a.prototype._handleResult.call(this,n),!f(n)){var i=n;h(this,i);t(i.Author)||(this._A=i.Author);t(i.Created)||(this._C=w(i.Created));t(i.Id)||(this._I=i.Id);t(i.Level)||(this._L=i.Level);t(i.Mentions)||(this._M=i.Mentions);t(i.Resolved)||(this._Re=i.Resolved);t(i.Text)||(this._T=i.Text);rt(this,i,["parent","Parent","parentOrNullObject","ParentOrNullObject","replies","Replies"])}},b.prototype.load=function(n){return y(this,n)},b.prototype.retrieve=function(n){return p(this,n)},b.prototype._handleIdResult=function(n){(a.prototype._handleIdResult.call(this,n),f(n))||t(n.Id)||(this._I=n.Id)},b.prototype._handleRetrieveResult=function(n,i){if(a.prototype._handleRetrieveResult.call(this,n,i),!f(n)){var r=n;t(r.Created)||(r.created=w(r.created));c(this,n,i)}},b.prototype.toJSON=function(){return s(this,{author:this._A,created:this._C,id:this._I,level:this._L,mentions:this._M,resolved:this._Re,text:this._T},{replies:this._R})},b.prototype.ensureUnchanged=function(n){it(this.context,this,n);return},b}(OfficeExtension.ClientObject);n.Comment=k;d="CommentCollection";g=function(t){function r(){return t!==null&&t.apply(this,arguments)||this}return __extends(r,t),Object.defineProperty(r.prototype,"_className",{get:function(){return"CommentCollection"},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"_isCollection",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"items",{get:function(){return i("items",this.m__items,d,this._isNull),this.m__items},enumerable:!0,configurable:!0}),r.prototype.getCount=function(){var t=u(this.context,this,"GetCount",1,[],!1),n=new OfficeExtension.ClientResult;return e(this,t,n),n},r.prototype.getItem=function(t){return new n.Comment(this.context,nt(this.context,this,[t]))},r.prototype._handleResult=function(i){var u,e,r,o;if((t.prototype._handleResult.call(this,i),!f(i))&&(u=i,h(this,u),!f(u[OfficeExtension.Constants.items])))for(this.m__items=[],e=u[OfficeExtension.Constants.items],r=0;r<e.length;r++)o=new n.Comment(this.context,a(!0,this.context,this,e[r],r)),o._handleResult(e[r]),this.m__items.push(o)},r.prototype.load=function(n){return y(this,n)},r.prototype.retrieve=function(n){return p(this,n)},r.prototype._handleRetrieveResult=function(i,r){var u=this;t.prototype._handleRetrieveResult.call(this,i,r);c(this,i,r,function(t,i){return new n.Comment(u.context,a(!0,u.context,u,t,i))})},r.prototype.toJSON=function(){return s(this,{},{},this.m__items)},r}(OfficeExtension.ClientObject);n.CommentCollection=g,function(n){n.plain="Plain";n.markdown="Markdown";n.delta="Delta"}(et=n.CommentTextFormat||(n.CommentTextFormat={})),function(n){n.apiNotAvailable="ApiNotAvailable";n.clientError="ClientError";n.generalException="GeneralException";n.invalidArgument="InvalidArgument";n.invalidGrant="InvalidGrant";n.invalidResourceUrl="InvalidResourceUrl";n.serverError="ServerError";n.unsupportedUserIdentity="UnsupportedUserIdentity";n.userNotSignIn="UserNotSignIn"}(ot=n.ErrorCodes||(n.ErrorCodes={}))}(OfficeCore||(OfficeCore={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var vi="Visio",yi="",c=OfficeExtension.ObjectPathFactory.createPropertyObjectPath,it=OfficeExtension.ObjectPathFactory.createMethodObjectPath,w=OfficeExtension.ObjectPathFactory.createIndexerObjectPath,pi=OfficeExtension.ObjectPathFactory.createNewObjectObjectPath,wi=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexer,bi=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingGetItemAt,a=OfficeExtension.ObjectPathFactory.createChildItemObjectPathUsingIndexerOrGetItemAt,u=OfficeExtension.ActionFactory.createMethodAction,v=OfficeExtension.ActionFactory.createEnsureUnchangedAction,l=OfficeExtension.ActionFactory.createSetPropertyAction,r=OfficeExtension.Utility.isNullOrUndefined,i=OfficeExtension.Utility.isUndefined,t=OfficeExtension.Utility.throwIfNotLoaded,ki=OfficeExtension.Utility.throwIfApiNotSupported,f=OfficeExtension.Utility.load,e=OfficeExtension.Utility.retrieve,o=OfficeExtension.Utility.toJson,s=OfficeExtension.Utility.fixObjectPathIfNecessary,y=OfficeExtension.Utility._addActionResultHandler,nt=OfficeExtension.Utility._handleNavigationPropertyResults,di=OfficeExtension.Utility.adjustToDateTime,h=OfficeExtension.Utility.processRetrieveResult,rt="Application",fi=function(n){function c(){return n!==null&&n.apply(this,arguments)||this}return __extends(c,n),Object.defineProperty(c.prototype,"_className",{get:function(){return"Application"},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"_scalarPropertyNames",{get:function(){return["showBorders","showToolbars"]},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"_scalarPropertyUpdateable",{get:function(){return[!0,!0]},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"showBorders",{get:function(){return t("showBorders",this._S,rt,this._isNull),this._S},set:function(n){this._S=n;l(this.context,this,"ShowBorders",n)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"showToolbars",{get:function(){return t("showToolbars",this._Sh,rt,this._isNull),this._Sh},set:function(n){this._Sh=n;l(this.context,this,"ShowToolbars",n)},enumerable:!0,configurable:!0}),c.prototype.set=function(n,t){this._recursivelySet(n,t,["showBorders","showToolbars"],[],[])},c.prototype.update=function(n){this._recursivelyUpdate(n)},c.prototype.showToolbar=function(n,t){u(this.context,this,"ShowToolbar",0,[n,t],!1)},c.prototype._handleResult=function(t){if(n.prototype._handleResult.call(this,t),!r(t)){var u=t;s(this,u);i(u.ShowBorders)||(this._S=u.ShowBorders);i(u.ShowToolbars)||(this._Sh=u.ShowToolbars)}},c.prototype.load=function(n){return f(this,n)},c.prototype.retrieve=function(n){return e(this,n)},c.prototype._handleRetrieveResult=function(t,i){n.prototype._handleRetrieveResult.call(this,t,i);h(this,t,i)},c.prototype.toJSON=function(){return o(this,{showBorders:this._S,showToolbars:this._Sh},{})},c.prototype.ensureUnchanged=function(n){v(this.context,this,n);return},c}(OfficeExtension.ClientObject),ei,ut,b,ft,p,et,ot,st,ht,ct,lt,at,k,vt,yt,pt,wt,bt,d,kt,dt,gt,g,ni,ti,ii,tt,ri,oi,ui,si,hi,ci,li,ai;n.Application=fi;ei="Document";ut=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),Object.defineProperty(i.prototype,"_className",{get:function(){return"Document"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_navigationPropertyNames",{get:function(){return["view","application","pages"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"application",{get:function(){return this._A||(this._A=new n.Application(this.context,c(this.context,this,"Application",!1,!1,!1))),this._A},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pages",{get:function(){return this._P||(this._P=new n.PageCollection(this.context,c(this.context,this,"Pages",!0,!1,!1))),this._P},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"view",{get:function(){return this._V||(this._V=new n.DocumentView(this.context,c(this.context,this,"View",!1,!1,!1))),this._V},enumerable:!0,configurable:!0}),i.prototype.set=function(n,t){this._recursivelySet(n,t,[],["view","application"],["pages"])},i.prototype.update=function(n){this._recursivelyUpdate(n)},i.prototype.getActivePage=function(){return new n.Page(this.context,it(this.context,this,"GetActivePage",1,[],!1,!1,null,!1))},i.prototype.setActivePage=function(n){u(this.context,this,"SetActivePage",1,[n],!1)},i.prototype.startDataRefresh=function(){u(this.context,this,"StartDataRefresh",1,[],!1)},i.prototype._handleResult=function(n){if(t.prototype._handleResult.call(this,n),!r(n)){var i=n;s(this,i);nt(this,i,["application","Application","pages","Pages","view","View"])}},i.prototype.load=function(n){return f(this,n)},i.prototype.retrieve=function(n){return e(this,n)},i.prototype._handleRetrieveResult=function(n,i){t.prototype._handleRetrieveResult.call(this,n,i);h(this,n,i)},Object.defineProperty(i.prototype,"onDataRefreshComplete",{get:function(){var n=this;return this.m_dataRefreshComplete||(this.m_dataRefreshComplete=new OfficeExtension.EventHandlers(this.context,this,"DataRefreshComplete",{registerFunc:function(t){return n.context.eventRegistration.register(3,"",t)},unregisterFunc:function(t){return n.context.eventRegistration.unregister(3,"",t)},eventArgsTransformFunc:function(n){var t={document:this,success:n.ddaBinding.Object.success};return OfficeExtension.Utility._createPromiseFromResult(t)}})),this.m_dataRefreshComplete},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"onDocumentLoadComplete",{get:function(){var n=this;return this.m_documentLoadComplete||(this.m_documentLoadComplete=new OfficeExtension.EventHandlers(this.context,this,"DocumentLoadComplete",{registerFunc:function(t){return n.context.eventRegistration.register(7,"",t)},unregisterFunc:function(t){return n.context.eventRegistration.unregister(7,"",t)},eventArgsTransformFunc:function(n){var t={success:n.ddaBinding.Object.success};return OfficeExtension.Utility._createPromiseFromResult(t)}})),this.m_documentLoadComplete},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"onPageLoadComplete",{get:function(){var n=this;return this.m_pageLoadComplete||(this.m_pageLoadComplete=new OfficeExtension.EventHandlers(this.context,this,"PageLoadComplete",{registerFunc:function(t){return n.context.eventRegistration.register(1,"",t)},unregisterFunc:function(t){return n.context.eventRegistration.unregister(1,"",t)},eventArgsTransformFunc:function(n){return OfficeExtension.Utility._createPromiseFromResult(n.ddaBinding.Object)}})),this.m_pageLoadComplete},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"onSelectionChanged",{get:function(){var n=this;return this.m_selectionChanged||(this.m_selectionChanged=new OfficeExtension.EventHandlers(this.context,this,"SelectionChanged",{registerFunc:function(t){return n.context.eventRegistration.register(2,"",t)},unregisterFunc:function(t){return n.context.eventRegistration.unregister(2,"",t)},eventArgsTransformFunc:function(n){return OfficeExtension.Utility._createPromiseFromResult(n.ddaBinding.Object)}})),this.m_selectionChanged},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"onShapeMouseEnter",{get:function(){var n=this;return this.m_shapeMouseEnter||(this.m_shapeMouseEnter=new OfficeExtension.EventHandlers(this.context,this,"ShapeMouseEnter",{registerFunc:function(t){return n.context.eventRegistration.register(4,"",t)},unregisterFunc:function(t){return n.context.eventRegistration.unregister(4,"",t)},eventArgsTransformFunc:function(n){return OfficeExtension.Utility._createPromiseFromResult(n.ddaBinding.Object)}})),this.m_shapeMouseEnter},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"onShapeMouseLeave",{get:function(){var n=this;return this.m_shapeMouseLeave||(this.m_shapeMouseLeave=new OfficeExtension.EventHandlers(this.context,this,"ShapeMouseLeave",{registerFunc:function(t){return n.context.eventRegistration.register(5,"",t)},unregisterFunc:function(t){return n.context.eventRegistration.unregister(5,"",t)},eventArgsTransformFunc:function(n){return OfficeExtension.Utility._createPromiseFromResult(n.ddaBinding.Object)}})),this.m_shapeMouseLeave},enumerable:!0,configurable:!0}),i.prototype.toJSON=function(){return o(this,{},{application:this._A,pages:this._P,view:this._V})},i.prototype.ensureUnchanged=function(n){v(this.context,this,n);return},i}(OfficeExtension.ClientObject);n.Document=ut;b="DocumentView";ft=function(n){function u(){return n!==null&&n.apply(this,arguments)||this}return __extends(u,n),Object.defineProperty(u.prototype,"_className",{get:function(){return"DocumentView"},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"_scalarPropertyNames",{get:function(){return["disableHyperlinks","disableZoom","disablePan","hideDiagramBoundary"]},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"_scalarPropertyUpdateable",{get:function(){return[!0,!0,!0,!0]},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"disableHyperlinks",{get:function(){return t("disableHyperlinks",this._D,b,this._isNull),this._D},set:function(n){this._D=n;l(this.context,this,"DisableHyperlinks",n)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"disablePan",{get:function(){return t("disablePan",this._Di,b,this._isNull),this._Di},set:function(n){this._Di=n;l(this.context,this,"DisablePan",n)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"disableZoom",{get:function(){return t("disableZoom",this._Dis,b,this._isNull),this._Dis},set:function(n){this._Dis=n;l(this.context,this,"DisableZoom",n)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"hideDiagramBoundary",{get:function(){return t("hideDiagramBoundary",this._H,b,this._isNull),this._H},set:function(n){this._H=n;l(this.context,this,"HideDiagramBoundary",n)},enumerable:!0,configurable:!0}),u.prototype.set=function(n,t){this._recursivelySet(n,t,["disableHyperlinks","disableZoom","disablePan","hideDiagramBoundary"],[],[])},u.prototype.update=function(n){this._recursivelyUpdate(n)},u.prototype._handleResult=function(t){if(n.prototype._handleResult.call(this,t),!r(t)){var u=t;s(this,u);i(u.DisableHyperlinks)||(this._D=u.DisableHyperlinks);i(u.DisablePan)||(this._Di=u.DisablePan);i(u.DisableZoom)||(this._Dis=u.DisableZoom);i(u.HideDiagramBoundary)||(this._H=u.HideDiagramBoundary)}},u.prototype.load=function(n){return f(this,n)},u.prototype.retrieve=function(n){return e(this,n)},u.prototype._handleRetrieveResult=function(t,i){n.prototype._handleRetrieveResult.call(this,t,i);h(this,t,i)},u.prototype.toJSON=function(){return o(this,{disableHyperlinks:this._D,disablePan:this._Di,disableZoom:this._Dis,hideDiagramBoundary:this._H},{})},u.prototype.ensureUnchanged=function(n){v(this.context,this,n);return},u}(OfficeExtension.ClientObject);n.DocumentView=ft;p="Page";et=function(l){function a(){return l!==null&&l.apply(this,arguments)||this}return __extends(a,l),Object.defineProperty(a.prototype,"_className",{get:function(){return"Page"},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"_scalarPropertyNames",{get:function(){return["index","name","isBackground","width","height"]},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"_navigationPropertyNames",{get:function(){return["shapes","view","comments","allShapes"]},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"allShapes",{get:function(){return this._A||(this._A=new n.ShapeCollection(this.context,c(this.context,this,"AllShapes",!0,!1,!1))),this._A},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"comments",{get:function(){return this._C||(this._C=new n.CommentCollection(this.context,c(this.context,this,"Comments",!0,!1,!1))),this._C},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"shapes",{get:function(){return this._S||(this._S=new n.ShapeCollection(this.context,c(this.context,this,"Shapes",!0,!1,!1))),this._S},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"view",{get:function(){return this._V||(this._V=new n.PageView(this.context,c(this.context,this,"View",!1,!1,!1))),this._V},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"height",{get:function(){return t("height",this._H,p,this._isNull),this._H},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"index",{get:function(){return t("index",this._I,p,this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"isBackground",{get:function(){return t("isBackground",this._Is,p,this._isNull),this._Is},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"name",{get:function(){return t("name",this._N,p,this._isNull),this._N},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"width",{get:function(){return t("width",this._W,p,this._isNull),this._W},enumerable:!0,configurable:!0}),a.prototype.set=function(n,t){this._recursivelySet(n,t,[],["view"],["allShapes","comments","shapes"])},a.prototype.update=function(n){this._recursivelyUpdate(n)},a.prototype.activate=function(){u(this.context,this,"Activate",1,[],!1)},a.prototype._handleResult=function(n){if(l.prototype._handleResult.call(this,n),!r(n)){var t=n;s(this,t);i(t.Height)||(this._H=t.Height);i(t.Index)||(this._I=t.Index);i(t.IsBackground)||(this._Is=t.IsBackground);i(t.Name)||(this._N=t.Name);i(t.Width)||(this._W=t.Width);nt(this,t,["allShapes","AllShapes","comments","Comments","shapes","Shapes","view","View"])}},a.prototype.load=function(n){return f(this,n)},a.prototype.retrieve=function(n){return e(this,n)},a.prototype._handleRetrieveResult=function(n,t){l.prototype._handleRetrieveResult.call(this,n,t);h(this,n,t)},a.prototype.toJSON=function(){return o(this,{height:this._H,index:this._I,isBackground:this._Is,name:this._N,width:this._W},{allShapes:this._A,comments:this._C,shapes:this._S,view:this._V})},a.prototype.ensureUnchanged=function(n){v(this.context,this,n);return},a}(OfficeExtension.ClientObject);n.Page=et;ot="PageView";st=function(c){function a(){return c!==null&&c.apply(this,arguments)||this}return __extends(a,c),Object.defineProperty(a.prototype,"_className",{get:function(){return"PageView"},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"_scalarPropertyNames",{get:function(){return["zoom"]},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"_scalarPropertyUpdateable",{get:function(){return[!0]},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"zoom",{get:function(){return t("zoom",this._Z,ot,this._isNull),this._Z},set:function(n){this._Z=n;l(this.context,this,"Zoom",n)},enumerable:!0,configurable:!0}),a.prototype.set=function(n,t){this._recursivelySet(n,t,["zoom"],[],[])},a.prototype.update=function(n){this._recursivelyUpdate(n)},a.prototype.centerViewportOnShape=function(n){u(this.context,this,"CenterViewportOnShape",1,[n],!1)},a.prototype.fitToWindow=function(){u(this.context,this,"FitToWindow",1,[],!1)},a.prototype.getPosition=function(){var t=u(this.context,this,"GetPosition",1,[],!1),n=new OfficeExtension.ClientResult;return y(this,t,n),n},a.prototype.getSelection=function(){return new n.Selection(this.context,it(this.context,this,"GetSelection",1,[],!1,!1,null,!1))},a.prototype.isShapeInViewport=function(n){var i=u(this.context,this,"IsShapeInViewport",1,[n],!1),t=new OfficeExtension.ClientResult;return y(this,i,t),t},a.prototype.setPosition=function(n){u(this.context,this,"SetPosition",1,[n],!1)},a.prototype._handleResult=function(n){if(c.prototype._handleResult.call(this,n),!r(n)){var t=n;s(this,t);i(t.Zoom)||(this._Z=t.Zoom)}},a.prototype.load=function(n){return f(this,n)},a.prototype.retrieve=function(n){return e(this,n)},a.prototype._handleRetrieveResult=function(n,t){c.prototype._handleRetrieveResult.call(this,n,t);h(this,n,t)},a.prototype.toJSON=function(){return o(this,{zoom:this._Z},{})},a.prototype.ensureUnchanged=function(n){v(this.context,this,n);return},a}(OfficeExtension.ClientObject);n.PageView=st;ht="PageCollection";ct=function(i){function c(){return i!==null&&i.apply(this,arguments)||this}return __extends(c,i),Object.defineProperty(c.prototype,"_className",{get:function(){return"PageCollection"},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"_isCollection",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"items",{get:function(){return t("items",this.m__items,ht,this._isNull),this.m__items},enumerable:!0,configurable:!0}),c.prototype.getCount=function(){var t=u(this.context,this,"GetCount",1,[],!1),n=new OfficeExtension.ClientResult;return y(this,t,n),n},c.prototype.getItem=function(t){return new n.Page(this.context,w(this.context,this,[t]))},c.prototype._handleResult=function(t){var f,e,u,o;if((i.prototype._handleResult.call(this,t),!r(t))&&(f=t,s(this,f),!r(f[OfficeExtension.Constants.items])))for(this.m__items=[],e=f[OfficeExtension.Constants.items],u=0;u<e.length;u++)o=new n.Page(this.context,a(!0,this.context,this,e[u],u)),o._handleResult(e[u]),this.m__items.push(o)},c.prototype.load=function(n){return f(this,n)},c.prototype.retrieve=function(n){return e(this,n)},c.prototype._handleRetrieveResult=function(t,r){var u=this;i.prototype._handleRetrieveResult.call(this,t,r);h(this,t,r,function(t,i){return new n.Page(u.context,a(!0,u.context,u,t,i))})},c.prototype.toJSON=function(){return o(this,{},{},this.m__items)},c}(OfficeExtension.ClientObject);n.PageCollection=ct;lt="ShapeCollection";at=function(i){function c(){return i!==null&&i.apply(this,arguments)||this}return __extends(c,i),Object.defineProperty(c.prototype,"_className",{get:function(){return"ShapeCollection"},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"_isCollection",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"items",{get:function(){return t("items",this.m__items,lt,this._isNull),this.m__items},enumerable:!0,configurable:!0}),c.prototype.getCount=function(){var t=u(this.context,this,"GetCount",1,[],!1),n=new OfficeExtension.ClientResult;return y(this,t,n),n},c.prototype.getItem=function(t){return new n.Shape(this.context,w(this.context,this,[t]))},c.prototype._handleResult=function(t){var f,e,u,o;if((i.prototype._handleResult.call(this,t),!r(t))&&(f=t,s(this,f),!r(f[OfficeExtension.Constants.items])))for(this.m__items=[],e=f[OfficeExtension.Constants.items],u=0;u<e.length;u++)o=new n.Shape(this.context,a(!0,this.context,this,e[u],u)),o._handleResult(e[u]),this.m__items.push(o)},c.prototype.load=function(n){return f(this,n)},c.prototype.retrieve=function(n){return e(this,n)},c.prototype._handleRetrieveResult=function(t,r){var u=this;i.prototype._handleRetrieveResult.call(this,t,r);h(this,t,r,function(t,i){return new n.Shape(u.context,a(!0,u.context,u,t,i))})},c.prototype.toJSON=function(){return o(this,{},{},this.m__items)},c}(OfficeExtension.ClientObject);n.ShapeCollection=at;k="Shape";vt=function(a){function p(){return a!==null&&a.apply(this,arguments)||this}return __extends(p,a),Object.defineProperty(p.prototype,"_className",{get:function(){return"Shape"},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"_scalarPropertyNames",{get:function(){return["name","id","text","select"]},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"_scalarPropertyUpdateable",{get:function(){return[!1,!1,!1,!0]},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"_navigationPropertyNames",{get:function(){return["hyperlinks","shapeDataItems","view","subShapes","comments"]},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"comments",{get:function(){return this._C||(this._C=new n.CommentCollection(this.context,c(this.context,this,"Comments",!0,!1,!1))),this._C},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"hyperlinks",{get:function(){return this._H||(this._H=new n.HyperlinkCollection(this.context,c(this.context,this,"Hyperlinks",!0,!1,!1))),this._H},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"shapeDataItems",{get:function(){return this._Sh||(this._Sh=new n.ShapeDataItemCollection(this.context,c(this.context,this,"ShapeDataItems",!0,!1,!1))),this._Sh},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"subShapes",{get:function(){return this._Su||(this._Su=new n.ShapeCollection(this.context,c(this.context,this,"SubShapes",!0,!1,!1))),this._Su},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"view",{get:function(){return this._V||(this._V=new n.ShapeView(this.context,c(this.context,this,"View",!1,!1,!1))),this._V},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"id",{get:function(){return t("id",this._I,k,this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"name",{get:function(){return t("name",this._N,k,this._isNull),this._N},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"select",{get:function(){return t("select",this._S,k,this._isNull),this._S},set:function(n){this._S=n;l(this.context,this,"Select",n)},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"text",{get:function(){return t("text",this._T,k,this._isNull),this._T},enumerable:!0,configurable:!0}),p.prototype.set=function(n,t){this._recursivelySet(n,t,["select"],["view"],["comments","hyperlinks","shapeDataItems","subShapes"])},p.prototype.update=function(n){this._recursivelyUpdate(n)},p.prototype.getBounds=function(){var t=u(this.context,this,"GetBounds",1,[],!1),n=new OfficeExtension.ClientResult;return y(this,t,n),n},p.prototype._handleResult=function(n){if(a.prototype._handleResult.call(this,n),!r(n)){var t=n;s(this,t);i(t.Id)||(this._I=t.Id);i(t.Name)||(this._N=t.Name);i(t.Select)||(this._S=t.Select);i(t.Text)||(this._T=t.Text);nt(this,t,["comments","Comments","hyperlinks","Hyperlinks","shapeDataItems","ShapeDataItems","subShapes","SubShapes","view","View"])}},p.prototype.load=function(n){return f(this,n)},p.prototype.retrieve=function(n){return e(this,n)},p.prototype._handleIdResult=function(n){(a.prototype._handleIdResult.call(this,n),r(n))||i(n.Id)||(this._I=n.Id)},p.prototype._handleRetrieveResult=function(n,t){a.prototype._handleRetrieveResult.call(this,n,t);h(this,n,t)},p.prototype.toJSON=function(){return o(this,{id:this._I,name:this._N,select:this._S,text:this._T},{comments:this._C,hyperlinks:this._H,shapeDataItems:this._Sh,subShapes:this._Su,view:this._V})},p.prototype.ensureUnchanged=function(n){v(this.context,this,n);return},p}(OfficeExtension.ClientObject);n.Shape=vt;yt="ShapeView";pt=function(n){function c(){return n!==null&&n.apply(this,arguments)||this}return __extends(c,n),Object.defineProperty(c.prototype,"_className",{get:function(){return"ShapeView"},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"_scalarPropertyNames",{get:function(){return["highlight"]},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"_scalarPropertyUpdateable",{get:function(){return[!0]},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"highlight",{get:function(){return t("highlight",this._H,yt,this._isNull),this._H},set:function(n){this._H=n;l(this.context,this,"Highlight",n)},enumerable:!0,configurable:!0}),c.prototype.set=function(n,t){this._recursivelySet(n,t,["highlight"],[],[])},c.prototype.update=function(n){this._recursivelyUpdate(n)},c.prototype.addOverlay=function(n,t,i,r,f,e){var s=u(this.context,this,"AddOverlay",1,[n,t,i,r,f,e],!1),o=new OfficeExtension.ClientResult;return y(this,s,o),o},c.prototype.removeOverlay=function(n){u(this.context,this,"RemoveOverlay",1,[n],!1)},c.prototype._handleResult=function(t){if(n.prototype._handleResult.call(this,t),!r(t)){var u=t;s(this,u);i(u.Highlight)||(this._H=u.Highlight)}},c.prototype.load=function(n){return f(this,n)},c.prototype.retrieve=function(n){return e(this,n)},c.prototype._handleRetrieveResult=function(t,i){n.prototype._handleRetrieveResult.call(this,t,i);h(this,t,i)},c.prototype.toJSON=function(){return o(this,{highlight:this._H},{})},c.prototype.ensureUnchanged=function(n){v(this.context,this,n);return},c}(OfficeExtension.ClientObject);n.ShapeView=pt;wt="ShapeDataItemCollection";bt=function(i){function c(){return i!==null&&i.apply(this,arguments)||this}return __extends(c,i),Object.defineProperty(c.prototype,"_className",{get:function(){return"ShapeDataItemCollection"},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"_isCollection",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"items",{get:function(){return t("items",this.m__items,wt,this._isNull),this.m__items},enumerable:!0,configurable:!0}),c.prototype.getCount=function(){var t=u(this.context,this,"GetCount",1,[],!1),n=new OfficeExtension.ClientResult;return y(this,t,n),n},c.prototype.getItem=function(t){return new n.ShapeDataItem(this.context,w(this.context,this,[t]))},c.prototype._handleResult=function(t){var f,e,u,o;if((i.prototype._handleResult.call(this,t),!r(t))&&(f=t,s(this,f),!r(f[OfficeExtension.Constants.items])))for(this.m__items=[],e=f[OfficeExtension.Constants.items],u=0;u<e.length;u++)o=new n.ShapeDataItem(this.context,a(!0,this.context,this,e[u],u)),o._handleResult(e[u]),this.m__items.push(o)},c.prototype.load=function(n){return f(this,n)},c.prototype.retrieve=function(n){return e(this,n)},c.prototype._handleRetrieveResult=function(t,r){var u=this;i.prototype._handleRetrieveResult.call(this,t,r);h(this,t,r,function(t,i){return new n.ShapeDataItem(u.context,a(!0,u.context,u,t,i))})},c.prototype.toJSON=function(){return o(this,{},{},this.m__items)},c}(OfficeExtension.ClientObject);n.ShapeDataItemCollection=bt;d="ShapeDataItem";kt=function(n){function u(){return n!==null&&n.apply(this,arguments)||this}return __extends(u,n),Object.defineProperty(u.prototype,"_className",{get:function(){return"ShapeDataItem"},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"_scalarPropertyNames",{get:function(){return["label","value","format","formattedValue"]},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"format",{get:function(){return t("format",this._F,d,this._isNull),this._F},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"formattedValue",{get:function(){return t("formattedValue",this._Fo,d,this._isNull),this._Fo},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"label",{get:function(){return t("label",this._L,d,this._isNull),this._L},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"value",{get:function(){return t("value",this._V,d,this._isNull),this._V},enumerable:!0,configurable:!0}),u.prototype._handleResult=function(t){if(n.prototype._handleResult.call(this,t),!r(t)){var u=t;s(this,u);i(u.Format)||(this._F=u.Format);i(u.FormattedValue)||(this._Fo=u.FormattedValue);i(u.Label)||(this._L=u.Label);i(u.Value)||(this._V=u.Value)}},u.prototype.load=function(n){return f(this,n)},u.prototype.retrieve=function(n){return e(this,n)},u.prototype._handleRetrieveResult=function(t,i){n.prototype._handleRetrieveResult.call(this,t,i);h(this,t,i)},u.prototype.toJSON=function(){return o(this,{format:this._F,formattedValue:this._Fo,label:this._L,value:this._V},{})},u.prototype.ensureUnchanged=function(n){v(this.context,this,n);return},u}(OfficeExtension.ClientObject);n.ShapeDataItem=kt;dt="HyperlinkCollection";gt=function(i){function c(){return i!==null&&i.apply(this,arguments)||this}return __extends(c,i),Object.defineProperty(c.prototype,"_className",{get:function(){return"HyperlinkCollection"},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"_isCollection",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"items",{get:function(){return t("items",this.m__items,dt,this._isNull),this.m__items},enumerable:!0,configurable:!0}),c.prototype.getCount=function(){var t=u(this.context,this,"GetCount",1,[],!1),n=new OfficeExtension.ClientResult;return y(this,t,n),n},c.prototype.getItem=function(t){return new n.Hyperlink(this.context,w(this.context,this,[t]))},c.prototype._handleResult=function(t){var f,e,u,o;if((i.prototype._handleResult.call(this,t),!r(t))&&(f=t,s(this,f),!r(f[OfficeExtension.Constants.items])))for(this.m__items=[],e=f[OfficeExtension.Constants.items],u=0;u<e.length;u++)o=new n.Hyperlink(this.context,a(!0,this.context,this,e[u],u)),o._handleResult(e[u]),this.m__items.push(o)},c.prototype.load=function(n){return f(this,n)},c.prototype.retrieve=function(n){return e(this,n)},c.prototype._handleRetrieveResult=function(t,r){var u=this;i.prototype._handleRetrieveResult.call(this,t,r);h(this,t,r,function(t,i){return new n.Hyperlink(u.context,a(!0,u.context,u,t,i))})},c.prototype.toJSON=function(){return o(this,{},{},this.m__items)},c}(OfficeExtension.ClientObject);n.HyperlinkCollection=gt;g="Hyperlink";ni=function(n){function u(){return n!==null&&n.apply(this,arguments)||this}return __extends(u,n),Object.defineProperty(u.prototype,"_className",{get:function(){return"Hyperlink"},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"_scalarPropertyNames",{get:function(){return["address","subAddress","description","extraInfo"]},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"address",{get:function(){return t("address",this._A,g,this._isNull),this._A},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"description",{get:function(){return t("description",this._D,g,this._isNull),this._D},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"extraInfo",{get:function(){return t("extraInfo",this._E,g,this._isNull),this._E},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"subAddress",{get:function(){return t("subAddress",this._S,g,this._isNull),this._S},enumerable:!0,configurable:!0}),u.prototype._handleResult=function(t){if(n.prototype._handleResult.call(this,t),!r(t)){var u=t;s(this,u);i(u.Address)||(this._A=u.Address);i(u.Description)||(this._D=u.Description);i(u.ExtraInfo)||(this._E=u.ExtraInfo);i(u.SubAddress)||(this._S=u.SubAddress)}},u.prototype.load=function(n){return f(this,n)},u.prototype.retrieve=function(n){return e(this,n)},u.prototype._handleRetrieveResult=function(t,i){n.prototype._handleRetrieveResult.call(this,t,i);h(this,t,i)},u.prototype.toJSON=function(){return o(this,{address:this._A,description:this._D,extraInfo:this._E,subAddress:this._S},{})},u.prototype.ensureUnchanged=function(n){v(this.context,this,n);return},u}(OfficeExtension.ClientObject);n.Hyperlink=ni;ti="CommentCollection";ii=function(i){function c(){return i!==null&&i.apply(this,arguments)||this}return __extends(c,i),Object.defineProperty(c.prototype,"_className",{get:function(){return"CommentCollection"},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"_isCollection",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"items",{get:function(){return t("items",this.m__items,ti,this._isNull),this.m__items},enumerable:!0,configurable:!0}),c.prototype.getCount=function(){var t=u(this.context,this,"GetCount",1,[],!1),n=new OfficeExtension.ClientResult;return y(this,t,n),n},c.prototype.getItem=function(t){return new n.Comment(this.context,w(this.context,this,[t]))},c.prototype._handleResult=function(t){var f,e,u,o;if((i.prototype._handleResult.call(this,t),!r(t))&&(f=t,s(this,f),!r(f[OfficeExtension.Constants.items])))for(this.m__items=[],e=f[OfficeExtension.Constants.items],u=0;u<e.length;u++)o=new n.Comment(this.context,a(!0,this.context,this,e[u],u)),o._handleResult(e[u]),this.m__items.push(o)},c.prototype.load=function(n){return f(this,n)},c.prototype.retrieve=function(n){return e(this,n)},c.prototype._handleRetrieveResult=function(t,r){var u=this;i.prototype._handleRetrieveResult.call(this,t,r);h(this,t,r,function(t,i){return new n.Comment(u.context,a(!0,u.context,u,t,i))})},c.prototype.toJSON=function(){return o(this,{},{},this.m__items)},c}(OfficeExtension.ClientObject);n.CommentCollection=ii;tt="Comment";ri=function(n){function u(){return n!==null&&n.apply(this,arguments)||this}return __extends(u,n),Object.defineProperty(u.prototype,"_className",{get:function(){return"Comment"},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"_scalarPropertyNames",{get:function(){return["author","text","date"]},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"_scalarPropertyUpdateable",{get:function(){return[!0,!0,!0]},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"author",{get:function(){return t("author",this._A,tt,this._isNull),this._A},set:function(n){this._A=n;l(this.context,this,"Author",n)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"date",{get:function(){return t("date",this._D,tt,this._isNull),this._D},set:function(n){this._D=n;l(this.context,this,"Date",n)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"text",{get:function(){return t("text",this._T,tt,this._isNull),this._T},set:function(n){this._T=n;l(this.context,this,"Text",n)},enumerable:!0,configurable:!0}),u.prototype.set=function(n,t){this._recursivelySet(n,t,["author","text","date"],[],[])},u.prototype.update=function(n){this._recursivelyUpdate(n)},u.prototype._handleResult=function(t){if(n.prototype._handleResult.call(this,t),!r(t)){var u=t;s(this,u);i(u.Author)||(this._A=u.Author);i(u.Date)||(this._D=u.Date);i(u.Text)||(this._T=u.Text)}},u.prototype.load=function(n){return f(this,n)},u.prototype.retrieve=function(n){return e(this,n)},u.prototype._handleRetrieveResult=function(t,i){n.prototype._handleRetrieveResult.call(this,t,i);h(this,t,i)},u.prototype.toJSON=function(){return o(this,{author:this._A,date:this._D,text:this._T},{})},u.prototype.ensureUnchanged=function(n){v(this.context,this,n);return},u}(OfficeExtension.ClientObject);n.Comment=ri;oi="Selection";ui=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),Object.defineProperty(i.prototype,"_className",{get:function(){return"Selection"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_navigationPropertyNames",{get:function(){return["shapes"]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"shapes",{get:function(){return this._S||(this._S=new n.ShapeCollection(this.context,c(this.context,this,"Shapes",!0,!1,!1))),this._S},enumerable:!0,configurable:!0}),i.prototype._handleResult=function(n){if(t.prototype._handleResult.call(this,n),!r(n)){var i=n;s(this,i);nt(this,i,["shapes","Shapes"])}},i.prototype.load=function(n){return f(this,n)},i.prototype.retrieve=function(n){return e(this,n)},i.prototype._handleRetrieveResult=function(n,i){t.prototype._handleRetrieveResult.call(this,n,i);h(this,n,i)},i.prototype.toJSON=function(){return o(this,{},{shapes:this._S})},i}(OfficeExtension.ClientObject);n.Selection=ui,function(n){n.left="Left";n.center="Center";n.right="Right"}(si=n.OverlayHorizontalAlignment||(n.OverlayHorizontalAlignment={})),function(n){n.top="Top";n.middle="Middle";n.bottom="Bottom"}(hi=n.OverlayVerticalAlignment||(n.OverlayVerticalAlignment={})),function(n){n.text="Text";n.image="Image"}(ci=n.OverlayType||(n.OverlayType={})),function(n){n.commandBar="CommandBar";n.pageNavigationBar="PageNavigationBar";n.statusBar="StatusBar"}(li=n.ToolBarType||(n.ToolBarType={})),function(n){n.accessDenied="AccessDenied";n.generalException="GeneralException";n.invalidArgument="InvalidArgument";n.itemNotFound="ItemNotFound";n.notImplemented="NotImplemented";n.unsupportedOperation="UnsupportedOperation"}(ai=n.ErrorCodes||(n.ErrorCodes={}))}(Visio||(Visio={})),function(n){function i(t,i,r){return OfficeExtension.ClientRequestContext._runBatch("Visio.run",arguments,function(t){return new n.RequestContext(t)})}var t=function(t){function i(i){var r=t.call(this,i)||this;return r.m_document=new n.Document(r,OfficeExtension.ObjectPathFactory.createGlobalObjectObjectPath(r)),r._rootObject=r.m_document,r}return __extends(i,t),Object.defineProperty(i.prototype,"document",{get:function(){return this.m_document},enumerable:!0,configurable:!0}),i}(OfficeExtension.ClientRequestContext);n.RequestContext=t;n.run=i}(Visio||(Visio={}));OfficeExtension.Utility._doApiNotSupportedCheck=!0