Office 365: Bind and manipulate data in a SharePoint Access app

This project shows how to create an app for Office that binds to an Access table in a SharePoint Access app.

C# (3.9 MB)
 
 
 
 
 
5 Star
(1)
1,024 times
Add to favorites
7/18/2014
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

C#
/* Outlook web application specific API library */
/* Version: 16.0.2420.1000 */
/*
	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.
*/

Type.registerNamespace("Microsoft.Office.WebExtension.MailboxEnums"),Microsoft.Office.WebExtension.MailboxEnums.EntityType={MeetingSuggestion:"meetingSuggestion",TaskSuggestion:"taskSuggestion",Address:"address",EmailAddress:"emailAddress",Url:"url",PhoneNumber:"phoneNumber",Contact:"contact"},Microsoft.Office.WebExtension.MailboxEnums.ItemType={Message:"message",Appointment:"appointment"},Microsoft.Office.WebExtension.MailboxEnums.ResponseType={None:"none",Organizer:"organizer",Tentative:"tentative",Accepted:"accepted",Declined:"declined"},Microsoft.Office.WebExtension.MailboxEnums.RecipientType={Other:"other",DistributionList:"distributionList",User:"user",ExternalUser:"externalUser"},Type.registerNamespace("OSF.DDA"),OSF.DDA.OutlookAppOm=function(n,t,i){this.$$d__callAppReadyCallback$p$0=Function.createDelegate(this,this._callAppReadyCallback$p$0),this.$$d__getDiagnostics$p$0=Function.createDelegate(this,this._getDiagnostics$p$0),this.$$d__getUserProfile$p$0=Function.createDelegate(this,this._getUserProfile$p$0),this.$$d__getItem$p$0=Function.createDelegate(this,this._getItem$p$0),this.$$d__getInitialDataResponseHandler$p$0=Function.createDelegate(this,this._getInitialDataResponseHandler$p$0),OSF.DDA.OutlookAppOm._instance$p=this,this._officeAppContext$p$0=n,this._appReadyCallback$p$0=i;var r=this,u=function(){i&&r._invokeHostMethod$i$0(1,"GetInitialData",null,r.$$d__getInitialDataResponseHandler$p$0)};this._areStringsLoaded$p$0()?u():this._loadLocalizedScript$p$0(u)},OSF.DDA.OutlookAppOm._createAsyncResult$i=function(n,t,i,r){var f={},u;return f[OSF.DDA.AsyncResultEnum.Properties.Value]=n,f[OSF.DDA.AsyncResultEnum.Properties.Context]=r,u=null,0!==t&&(u={},u[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=t,u[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=i),new OSF.DDA.AsyncResult(f,u)},OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i=function(n){if(!n)throw Error.create(_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text);},OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i=function(n,t,i){if(n<t)throw Error.create(String.format(_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text,i));},OSF.DDA.OutlookAppOm._throwOnArgumentType$p=function(n,t,i){if(Object.getType(n)!==t)throw Error.argumentType(i);},OSF.DDA.OutlookAppOm._throwOnOutOfRange$p=function(n,t,i,r){if(n<t||n>i)throw Error.argumentOutOfRange(r);},OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p=function(n,t,i,r){if(!$h.ScriptHelpers.isNullOrUndefined(n)){OSF.DDA.OutlookAppOm._throwOnArgumentType$p(n,String,r);var u=n;OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(u.length,t,i,r)}},OSF.DDA.OutlookAppOm._convertToOutlookParameters$p=function(n,t){var i=null,r;switch(n){case 1:case 2:case 3:break;case 4:r=JSON.stringify(t.customProperties),i=[r];break;case 5:i=[t.body];break;case 8:case 9:i=[t.itemId];break;case 7:i=[OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p(t.requiredAttendees),OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p(t.optionalAttendees),t.start,t.end,t.location,OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p(t.resources),t.subject,t.body];break;case 11:case 10:i=[t.htmlBody];break;default:Sys.Debug.fail("Unexpected method dispid")}return i},OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p=function(n){return n?n.join(";"):null},OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p=function(n,t){var i;if($h.ScriptHelpers.isNullOrUndefined(n))return null;OSF.DDA.OutlookAppOm._throwOnArgumentType$p(n,Array,t);var r=n,u=null,f=!1;for(OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(r.length,0,OSF.DDA.OutlookAppOm._maxRecipients$p,String.format("{0}.length",t)),i=0;i<r.length;i++)if($h.EmailAddressDetails.isInstanceOfType(r[i])){f=!0;break}for(f&&(u=[]),i=0;i<r.length;i++)f?(u[i]=$h.EmailAddressDetails.isInstanceOfType(r[i])?r[i].emailAddress:r[i],OSF.DDA.OutlookAppOm._throwOnArgumentType$p(u[i],String,String.format("{0}[{1}]",t,i))):OSF.DDA.OutlookAppOm._throwOnArgumentType$p(r[i],String,String.format("{0}[{1}]",t,i));return u},OSF.DDA.OutlookAppOm.prototype={_initialData$p$0:null,_item$p$0:null,_userProfile$p$0:null,_diagnostics$p$0:null,_officeAppContext$p$0:null,_appReadyCallback$p$0:null,initialize:function(n){var t="itemType";this._initialData$p$0=new $h.InitialData(n),1===n[t]?this._item$p$0=new $h.Message(this._initialData$p$0):3===n[t]?this._item$p$0=new $h.MeetingRequest(this._initialData$p$0):2===n[t]?this._item$p$0=new $h.Appointment(this._initialData$p$0):Sys.Debug.trace("Unexpected item type was received from the host."),this._userProfile$p$0=new $h.UserProfile(this._initialData$p$0),this._diagnostics$p$0=new $h.Diagnostics(this._initialData$p$0,this._officeAppContext$p$0.get_appName()),$h.InitialData._defineReadOnlyProperty$i(this,"item",this.$$d__getItem$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"userProfile",this.$$d__getUserProfile$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"diagnostics",this.$$d__getDiagnostics$p$0)},makeEwsRequestAsync:function(n,t,i){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");if(n.length>OSF.DDA.OutlookAppOm._maxEwsRequestSize$p)throw Error.argument("data",_u.ExtensibilityStrings.l_EwsRequestOversized_Text);OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._initialData$p$0.get__permissionLevel$i$0(),2,"makeEwsRequestAsync");var r=new $h.EwsRequest(i),u=this;r.onreadystatechange=function(){4===r.get__requestState$i$1()&&t(r._asyncResult$p$0)},r.send(n)},recordDataPoint:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this._invokeHostMethod$i$0(0,"RecordDataPoint",n,null)},recordTrace:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this._invokeHostMethod$i$0(0,"RecordTrace",n,null)},trackCtq:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this._invokeHostMethod$i$0(0,"TrackCtq",n,null)},convertToLocalClientTime:function(n){var t=new Date(n.getTime()),i=t.getTimezoneOffset()*-1,r;return this._initialData$p$0&&this._initialData$p$0.get__timeZoneOffsets$i$0()&&(t.setUTCMinutes(t.getUTCMinutes()-i),i=this._findOffset$p$0(t),t.setUTCMinutes(t.getUTCMinutes()+i)),r=this._dateToDictionary$i$0(t),r.timezoneOffset=i,r},convertToUtcClientTime:function(n){var t=this._dictionaryToDate$i$0(n),i;return this._initialData$p$0&&this._initialData$p$0.get__timeZoneOffsets$i$0()&&(i=this._findOffset$p$0(t),t.setUTCMinutes(t.getUTCMinutes()-i),i=n.timezoneOffset?n.timezoneOffset:t.getTimezoneOffset()*-1,t.setUTCMinutes(t.getUTCMinutes()+i)),t},getUserIdentityTokenAsync:function(n,t){if(OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._initialData$p$0.get__permissionLevel$i$0(),1,"getUserIdentityTokenAsync"),$h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("callback");var i=this;this._invokeHostMethod$i$0(2,"GetUserIdentityToken",null,function(i,r){if(i)OSF.DDA.OutlookAppOm._createAsyncResult$i(null,1,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,i),t);else{var u=r,f;f=u.wasSuccessful?OSF.DDA.OutlookAppOm._createAsyncResult$i(u.token,0,null,t):OSF.DDA.OutlookAppOm._createAsyncResult$i(null,1,u.errorMessage,t),n(f)}})},displayMessageForm:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("itemId");this._invokeHostMethod$i$0(8,"DisplayExistingMessageForm",{itemId:n},null)},displayAppointmentForm:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("itemId");this._invokeHostMethod$i$0(9,"DisplayExistingAppointmentForm",{itemId:n},null)},displayNewAppointmentForm:function(n){var r=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(n.requiredAttendees,"requiredAttendees"),u=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(n.optionalAttendees,"optionalAttendees"),f,i,t,e,o,s;if(OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(n.location,0,OSF.DDA.OutlookAppOm._maxLocationLength$p,"location"),OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(n.body,0,OSF.DDA.OutlookAppOm._maxBodyLength$p,"body"),OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(n.subject,0,OSF.DDA.OutlookAppOm._maxSubjectLength$p,"subject"),!$h.ScriptHelpers.isNullOrUndefined(n.start)&&(OSF.DDA.OutlookAppOm._throwOnArgumentType$p(n.start,Date,"start"),f=n.start,n.start=f.getTime(),!$h.ScriptHelpers.isNullOrUndefined(n.end))){if(OSF.DDA.OutlookAppOm._throwOnArgumentType$p(n.end,Date,"end"),i=n.end,i<f)throw Error.argumentOutOfRange("end",i,_u.ExtensibilityStrings.l_InvalidEventDates_Text);n.end=i.getTime()}if(t=null,r||u){t={},e=n;for(o in e)s={key:o,value:e[o]},t[s.key]=s.value;r&&(t.requiredAttendees=r),u&&(t.optionalAttendees=u)}this._invokeHostMethod$i$0(7,"DisplayNewAppointmentForm",t||n,null)},_displayReplyForm$i$0:function(n){$h.ScriptHelpers.isNullOrUndefined(n)||OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(n.length,0,OSF.DDA.OutlookAppOm._maxBodyLength$p,"htmlBody"),this._invokeHostMethod$i$0(10,"DisplayReplyForm",{htmlBody:n},null)},_displayReplyAllForm$i$0:function(n){$h.ScriptHelpers.isNullOrUndefined(n)||OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(n.length,0,OSF.DDA.OutlookAppOm._maxBodyLength$p,"htmlBody"),this._invokeHostMethod$i$0(11,"DisplayReplyAllForm",{htmlBody:n},null)},_invokeHostMethod$i$0:function(n,t,i,r){if(64===this._officeAppContext$p$0.get_appName())OSF._OfficeAppFactory.getClientEndPoint().invoke(t,r,i);else if(n){var u=OSF.DDA.OutlookAppOm._convertToOutlookParameters$p(n,i),f=this;window.external.Execute(n,u,function(n,t){if(r){var i=n.getItem(0),u=JSON.parse(i);r(t,u)}})}else r&&r(-2,null)},_dictionaryToDate$i$0:function(n){var t=new Date(n.year,n.month,n.date,n.hours,n.minutes,n.seconds,n.milliseconds?n.milliseconds:0);if(isNaN(t.getTime()))throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);return t},_dateToDictionary$i$0:function(n){var t={};return t.month=n.getMonth(),t.date=n.getDate(),t.year=n.getFullYear(),t.hours=n.getHours(),t.minutes=n.getMinutes(),t.seconds=n.getSeconds(),t.milliseconds=n.getMilliseconds(),t},_getInitialDataResponseHandler$p$0:function(n,t){n||(this.initialize(t),this.displayName="mailbox",window.setTimeout(this.$$d__callAppReadyCallback$p$0,0))},_callAppReadyCallback$p$0:function(){this._appReadyCallback$p$0()},_getItem$p$0:function(){return this._item$p$0},_getUserProfile$p$0:function(){return OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0.get__permissionLevel$i$0()),this._userProfile$p$0},_getDiagnostics$p$0:function(){return this._diagnostics$p$0},_findOffset$p$0:function(n){for(var r=this._initialData$p$0.get__timeZoneOffsets$i$0(),t=0;t<r.length;t++){var i=r[t],u=parseInt(i.start),f=parseInt(i.end);if(n.getTime()-u>=0&&n.getTime()-f<0)return parseInt(i.offset)}throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);},_areStringsLoaded$p$0:function(){var n=!1;try{n=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text)}catch(t){}return n},_loadLocalizedScript$p$0:function(n){for(var l=null,y="",a=document.getElementsByTagName("script"),i,c,h,s,f,r,u,o=a.length-1;o>=0;o--)if(i=null,c=a[o].attributes,c&&(h=c.getNamedItem("src"),h&&(i=h.value),i&&(s=!1,i=i.toLowerCase(),f=i.indexOf("office_strings.js"),f<0&&(f=i.indexOf("office_strings.debug.js"),s=!0),f>0&&f<i.length))){l=i.replace(s?"office_strings.debug.js":"office_strings.js","outlook_strings.js"),r=i.substring(0,f),u=r.lastIndexOf("/",r.length-2),u===-1&&(u=r.lastIndexOf("\\",r.length-2)),u!==-1&&r.length>u+1&&(y=r.substring(0,u+1));break}if(l){var v=document.getElementsByTagName("head")[0],t=null,b=this,e=function(){n&&(!t.readyState||t.readyState&&(t.readyState==="loaded"||t.readyState==="complete"))&&(t.onload=null,t.onreadystatechange=null,n())},p=this,w=function(){if(!p._areStringsLoaded$p$0()){var n=y+"en-us/outlook_strings.js";t.onload=null,t.onreadystatechange=null,t=p._createScriptElement$p$0(n),t.onload=e,t.onreadystatechange=e,v.appendChild(t)}};t=this._createScriptElement$p$0(l),t.onload=e,t.onreadystatechange=e,window.setTimeout(w,2e3),v.appendChild(t)}},_createScriptElement$p$0:function(n){var t=document.createElement("script");return t.type="text/javascript",t.src=n,t}},Type.registerNamespace("$h"),$h.Appointment=function(n){this.$$d__getOrganizer$p$1=Function.createDelegate(this,this._getOrganizer$p$1),this.$$d__getNormalizedSubject$p$1=Function.createDelegate(this,this._getNormalizedSubject$p$1),this.$$d__getSubject$p$1=Function.createDelegate(this,this._getSubject$p$1),this.$$d__getResources$p$1=Function.createDelegate(this,this._getResources$p$1),this.$$d__getRequiredAttendees$p$1=Function.createDelegate(this,this._getRequiredAttendees$p$1),this.$$d__getOptionalAttendees$p$1=Function.createDelegate(this,this._getOptionalAttendees$p$1),this.$$d__getLocation$p$1=Function.createDelegate(this,this._getLocation$p$1),this.$$d__getEnd$p$1=Function.createDelegate(this,this._getEnd$p$1),this.$$d__getStart$p$1=Function.createDelegate(this,this._getStart$p$1),$h.Appointment.initializeBase(this,[n]),$h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$1),$h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$1),$h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$1),$h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$1),$h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$1),$h.InitialData._defineReadOnlyProperty$i(this,"resources",this.$$d__getResources$p$1),$h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$1),$h.InitialData._defineReadOnlyProperty$i(this,"normalizedSubject",this.$$d__getNormalizedSubject$p$1),$h.InitialData._defineReadOnlyProperty$i(this,"organizer",this.$$d__getOrganizer$p$1)},$h.Appointment.prototype={getEntities:function(){return this._data$p$0._getEntities$i$0()},getEntitiesByType:function(n){return this._data$p$0._getEntitiesByType$i$0(n)},getRegExMatches:function(){return OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(),1,"getRegExMatches"),this._data$p$0._getRegExMatches$i$0()},getFilteredEntitiesByName:function(n){return this._data$p$0._getFilteredEntitiesByName$i$0(n)},getRegExMatchesByName:function(n){return OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(),1,"getRegExMatchesByName"),this._data$p$0._getRegExMatchesByName$i$0(n)},displayReplyForm:function(n){OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(n)},displayReplyAllForm:function(n){OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(n)},getItemType:function(){return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment},_getStart$p$1:function(){return this._data$p$0.get__start$i$0()},_getEnd$p$1:function(){return this._data$p$0.get__end$i$0()},_getLocation$p$1:function(){return this._data$p$0.get__location$i$0()},_getOptionalAttendees$p$1:function(){return this._data$p$0.get__cc$i$0()},_getRequiredAttendees$p$1:function(){return this._data$p$0.get__to$i$0()},_getResources$p$1:function(){return this._data$p$0.get__resources$i$0()},_getSubject$p$1:function(){return this._data$p$0.get__subject$i$0()},_getNormalizedSubject$p$1:function(){return this._data$p$0.get__normalizedSubject$i$0()},_getOrganizer$p$1:function(){return this._data$p$0.get__organizer$i$0()}},$h.Contact=function(n){this.$$d__getContactString$p$0=Function.createDelegate(this,this._getContactString$p$0),this.$$d__getAddresses$p$0=Function.createDelegate(this,this._getAddresses$p$0),this.$$d__getUrls$p$0=Function.createDelegate(this,this._getUrls$p$0),this.$$d__getEmailAddresses$p$0=Function.createDelegate(this,this._getEmailAddresses$p$0),this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this,this._getPhoneNumbers$p$0),this.$$d__getBusinessName$p$0=Function.createDelegate(this,this._getBusinessName$p$0),this.$$d__getPersonName$p$0=Function.createDelegate(this,this._getPersonName$p$0),this._data$p$0=n,$h.InitialData._defineReadOnlyProperty$i(this,"personName",this.$$d__getPersonName$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"businessName",this.$$d__getBusinessName$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"phoneNumbers",this.$$d__getPhoneNumbers$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"emailAddresses",this.$$d__getEmailAddresses$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"urls",this.$$d__getUrls$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"addresses",this.$$d__getAddresses$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"contactString",this.$$d__getContactString$p$0)},$h.Contact.prototype={_data$p$0:null,_phoneNumbers$p$0:null,_getPersonName$p$0:function(){return this._data$p$0.PersonName},_getBusinessName$p$0:function(){return this._data$p$0.BusinessName},_getAddresses$p$0:function(){return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"Addresses")},_getEmailAddresses$p$0:function(){return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"EmailAddresses")},_getUrls$p$0:function(){return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"Urls")},_getPhoneNumbers$p$0:function(){if(!this._phoneNumbers$p$0){var n=this;this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber,this._data$p$0,"PhoneNumbers",function(n){return new $h.PhoneNumber(n)})}return this._phoneNumbers$p$0},_getContactString$p$0:function(){return this._data$p$0.ContactString}},$h.CustomProperties=function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this._data$p$0=n},$h.CustomProperties.prototype={_data$p$0:null,get:function(n){var i=this._data$p$0[n],t,f,r,u;return typeof i=="string"&&(t=i,t.length>6&&t.startsWith("Date(")&&t.endsWith(")")&&(f=t.substring(5,t.length-1),r=parseInt(f),isNaN(r)||(u=new Date(r),u&&(i=u)))),i},set:function(n,t){OSF.OUtil.isDate(t)&&(t="Date("+t.getTime()+")"),this._data$p$0[n]=t},remove:function(n){delete this._data$p$0[n]},saveAsync:function(n,t){var r=2500,i;if(JSON.stringify(this._data$p$0).length>r)throw Error.argument();i=new $h._saveDictionaryRequest(n,t),i._sendRequest$i$0(4,"SaveCustomProperties",{customProperties:this._data$p$0})}},$h.Diagnostics=function(n,t){this.$$d__getOwaView$p$0=Function.createDelegate(this,this._getOwaView$p$0),this.$$d__getHostVersion$p$0=Function.createDelegate(this,this._getHostVersion$p$0),this.$$d__getHostName$p$0=Function.createDelegate(this,this._getHostName$p$0),this._data$p$0=n,this._appName$p$0=t,$h.InitialData._defineReadOnlyProperty$i(this,"hostName",this.$$d__getHostName$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"hostVersion",this.$$d__getHostVersion$p$0),64===this._appName$p$0&&$h.InitialData._defineReadOnlyProperty$i(this,"OWAView",this.$$d__getOwaView$p$0)},$h.Diagnostics.prototype={_data$p$0:null,_appName$p$0:0,_getHostName$p$0:function(){return 8===this._appName$p$0?"Outlook":64===this._appName$p$0?"OutlookWebApp":null},_getHostVersion$p$0:function(){return this._data$p$0.get__hostVersion$i$0()},_getOwaView$p$0:function(){return this._data$p$0.get__owaView$i$0()}},$h.EmailAddressDetails=function(n){this.$$d__getRecipientType$p$0=Function.createDelegate(this,this._getRecipientType$p$0),this.$$d__getAppointmentResponse$p$0=Function.createDelegate(this,this._getAppointmentResponse$p$0),this.$$d__getDisplayName$p$0=Function.createDelegate(this,this._getDisplayName$p$0),this.$$d__getEmailAddress$p$0=Function.createDelegate(this,this._getEmailAddress$p$0),this._data$p$0=n,$h.InitialData._defineReadOnlyProperty$i(this,"emailAddress",this.$$d__getEmailAddress$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"displayName",this.$$d__getDisplayName$p$0),$h.ScriptHelpers.dictionaryContainsKey(n,"appointmentResponse")&&$h.InitialData._defineReadOnlyProperty$i(this,"appointmentResponse",this.$$d__getAppointmentResponse$p$0),$h.ScriptHelpers.dictionaryContainsKey(n,"recipientType")&&$h.InitialData._defineReadOnlyProperty$i(this,"recipientType",this.$$d__getRecipientType$p$0)},$h.EmailAddressDetails._createFromEmailUserDictionary$i=function(n){var t={},i=n.Name,r=n.UserId;return t.name=i||$h.EmailAddressDetails._emptyString$p,t.address=r||$h.EmailAddressDetails._emptyString$p,new $h.EmailAddressDetails(t)},$h.EmailAddressDetails.prototype={_data$p$0:null,_getEmailAddress$p$0:function(){return this._data$p$0.address},_getDisplayName$p$0:function(){return this._data$p$0.name},_getAppointmentResponse$p$0:function(){var n=this._data$p$0.appointmentResponse;return n<$h.EmailAddressDetails._responseTypeMap$p.length?$h.EmailAddressDetails._responseTypeMap$p[n]:Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None},_getRecipientType$p$0:function(){var n=this._data$p$0.recipientType;return n<$h.EmailAddressDetails._recipientTypeMap$p.length?$h.EmailAddressDetails._recipientTypeMap$p[n]:Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other}},$h.Entities=function(n,t,i,r){this.$$d__createMeetingSuggestion$p$0=Function.createDelegate(this,this._createMeetingSuggestion$p$0),this.$$d__getContacts$p$0=Function.createDelegate(this,this._getContacts$p$0),this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this,this._getPhoneNumbers$p$0),this.$$d__getUrls$p$0=Function.createDelegate(this,this._getUrls$p$0),this.$$d__getEmailAddresses$p$0=Function.createDelegate(this,this._getEmailAddresses$p$0),this.$$d__getMeetingSuggestions$p$0=Function.createDelegate(this,this._getMeetingSuggestions$p$0),this.$$d__getTaskSuggestions$p$0=Function.createDelegate(this,this._getTaskSuggestions$p$0),this.$$d__getAddresses$p$0=Function.createDelegate(this,this._getAddresses$p$0),this._data$p$0=n||{},this._filteredData$p$0=t||{},this._dateTimeSent$p$0=i,$h.InitialData._defineReadOnlyProperty$i(this,"addresses",this.$$d__getAddresses$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"taskSuggestions",this.$$d__getTaskSuggestions$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"meetingSuggestions",this.$$d__getMeetingSuggestions$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"emailAddresses",this.$$d__getEmailAddresses$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"urls",this.$$d__getUrls$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"phoneNumbers",this.$$d__getPhoneNumbers$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"contacts",this.$$d__getContacts$p$0),this._permissionLevel$p$0=r},$h.Entities._getExtractedObjects$i=function(n,t,i,r,u,f){var o=null,e=t[i],h,l;if(!e)return new Array(0);u&&(e=$h.Entities._removeDuplicate$p(Object,e,$h.Entities._entityDictionaryEquals$p,f)),o=new Array(e.length),h=0;for(var c=e,a=c.length,s=0;s<a;++s)l=c[s],o[h++]=r(l);return o},$h.Entities._getExtractedStringProperty$i=function(n,t,i){var r=n[t];return r?(i&&(r=$h.Entities._removeDuplicate$p(String,r,$h.Entities._stringEquals$p,null)),r):new Array(0)},$h.Entities._createContact$p=function(n){return new $h.Contact(n)},$h.Entities._createTaskSuggestion$p=function(n){return new $h.TaskSuggestion(n)},$h.Entities._createPhoneNumber$p=function(n){return new $h.PhoneNumber(n)},$h.Entities._entityDictionaryEquals$p=function(n,t,i){return n===t?!0:!n||!t?!1:n[i]===t[i]?!0:!1},$h.Entities._stringEquals$p=function(n,t){return n===t},$h.Entities._removeDuplicate$p=function(n,t,i,r){for(var e,f,u=t.length-1;u>=0;u--){for(e=!1,f=u-1;f>=0;f--)if(i(t[u],t[f],r)){e=!0;break}e&&Array.removeAt(t,u)}return t},$h.Entities.prototype={_dateTimeSent$p$0:null,_data$p$0:null,_filteredData$p$0:null,_filteredEntitiesCache$p$0:null,_permissionLevel$p$0:0,_taskSuggestions$p$0:null,_meetingSuggestions$p$0:null,_phoneNumbers$p$0:null,_contacts$p$0:null,_addresses$p$0:null,_emailAddresses$p$0:null,_urls$p$0:null,_getByType$i$0:function(n){return n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion?this._getMeetingSuggestions$p$0():n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion?this._getTaskSuggestions$p$0():n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address?this._getAddresses$p$0():n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber?this._getPhoneNumbers$p$0():n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress?this._getEmailAddresses$p$0():n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url?this._getUrls$p$0():n===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact?this._getContacts$p$0():null},_getFilteredEntitiesByName$i$0:function(n){var r,i,u,t;if(this._filteredEntitiesCache$p$0||(this._filteredEntitiesCache$p$0={}),!$h.ScriptHelpers.dictionaryContainsKey(this._filteredEntitiesCache$p$0,n)){for(r=!1,i=0;i<$h.Entities._allEntityKeys$p.length;i++)if((u=$h.Entities._allEntityKeys$p[i],t=this._filteredData$p$0[u],t)&&$h.ScriptHelpers.dictionaryContainsKey(t,n)){switch(u){case"EmailAddresses":case"Urls":this._filteredEntitiesCache$p$0[n]=$h.Entities._getExtractedStringProperty$i(t,n);break;case"Addresses":this._filteredEntitiesCache$p$0[n]=$h.Entities._getExtractedStringProperty$i(t,n,!0);break;case"PhoneNumbers":this._filteredEntitiesCache$p$0[n]=$h.Entities._getExtractedObjects$i($h.PhoneNumber,t,n,$h.Entities._createPhoneNumber$p,!1,null);break;case"TaskSuggestions":this._filteredEntitiesCache$p$0[n]=$h.Entities._getExtractedObjects$i($h.TaskSuggestion,t,n,$h.Entities._createTaskSuggestion$p,!0,"TaskString");break;case"MeetingSuggestions":this._filteredEntitiesCache$p$0[n]=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion,t,n,this.$$d__createMeetingSuggestion$p$0,!0,"MeetingString");break;case"Contacts":this._filteredEntitiesCache$p$0[n]=$h.Entities._getExtractedObjects$i($h.Contact,t,n,$h.Entities._createContact$p,!0,"ContactString")}r=!0;break}r||(this._filteredEntitiesCache$p$0[n]=null)}return this._filteredEntitiesCache$p$0[n]},_createMeetingSuggestion$p$0:function(n){return new $h.MeetingSuggestion(n,this._dateTimeSent$p$0)},_getAddresses$p$0:function(){return this._addresses$p$0||(this._addresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"Addresses",!0)),this._addresses$p$0},_getEmailAddresses$p$0:function(){return OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0),this._emailAddresses$p$0||(this._emailAddresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"EmailAddresses",!1)),this._emailAddresses$p$0},_getUrls$p$0:function(){return this._urls$p$0||(this._urls$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"Urls",!1)),this._urls$p$0},_getPhoneNumbers$p$0:function(){return this._phoneNumbers$p$0||(this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber,this._data$p$0,"PhoneNumbers",$h.Entities._createPhoneNumber$p)),this._phoneNumbers$p$0},_getTaskSuggestions$p$0:function(){return OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0),this._taskSuggestions$p$0||(this._taskSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.TaskSuggestion,this._data$p$0,"TaskSuggestions",$h.Entities._createTaskSuggestion$p,!0,"TaskString")),this._taskSuggestions$p$0},_getMeetingSuggestions$p$0:function(){return OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0),this._meetingSuggestions$p$0||(this._meetingSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion,this._data$p$0,"MeetingSuggestions",this.$$d__createMeetingSuggestion$p$0,!0,"MeetingString")),this._meetingSuggestions$p$0},_getContacts$p$0:function(){return OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0),this._contacts$p$0||(this._contacts$p$0=$h.Entities._getExtractedObjects$i($h.Contact,this._data$p$0,"Contacts",$h.Entities._createContact$p,!0,"ContactString")),this._contacts$p$0}},$h.Item=function(n){this.$$d__createCustomProperties$i$0=Function.createDelegate(this,this._createCustomProperties$i$0),this.$$d__getItemClass$p$0=Function.createDelegate(this,this._getItemClass$p$0),this.$$d__getItemId$p$0=Function.createDelegate(this,this._getItemId$p$0),this.$$d__getDateTimeModified$p$0=Function.createDelegate(this,this._getDateTimeModified$p$0),this.$$d__getDateTimeCreated$p$0=Function.createDelegate(this,this._getDateTimeCreated$p$0),this._data$p$0=n,$h.InitialData._defineReadOnlyProperty$i(this,"dateTimeCreated",this.$$d__getDateTimeCreated$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"dateTimeModified",this.$$d__getDateTimeModified$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"itemId",this.$$d__getItemId$p$0);var t=this;$h.InitialData._defineReadOnlyProperty$i(this,"itemType",function(){return t.getItemType()}),$h.InitialData._defineReadOnlyProperty$i(this,"itemClass",this.$$d__getItemClass$p$0)},$h.Item.prototype={_data$p$0:null,loadCustomPropertiesAsync:function(n,t){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("callback");var i=new $h._loadDictionaryRequest(this.$$d__createCustomProperties$i$0,"customProperties",n,t);i._sendRequest$i$0(3,"LoadCustomProperties",{})},_createCustomProperties$i$0:function(n){return new $h.CustomProperties(n)},_getItemId$p$0:function(){return this._data$p$0.get__itemId$i$0()},_getItemClass$p$0:function(){return this._data$p$0.get__itemClass$i$0()},_getDateTimeCreated$p$0:function(){return this._data$p$0.get__dateTimeCreated$i$0()},_getDateTimeModified$p$0:function(){return this._data$p$0.get__dateTimeModified$i$0()}},$h.MeetingRequest=function(n){this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this,this._getRequiredAttendees$p$2),this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this,this._getOptionalAttendees$p$2),this.$$d__getLocation$p$2=Function.createDelegate(this,this._getLocation$p$2),this.$$d__getEnd$p$2=Function.createDelegate(this,this._getEnd$p$2),this.$$d__getStart$p$2=Function.createDelegate(this,this._getStart$p$2),$h.MeetingRequest.initializeBase(this,[n]),$h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$2),$h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$2),$h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$2),$h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$2),$h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$2)},$h.MeetingRequest.prototype={_getStart$p$2:function(){return this._data$p$0.get__start$i$0()},_getEnd$p$2:function(){return this._data$p$0.get__end$i$0()},_getLocation$p$2:function(){return this._data$p$0.get__location$i$0()},_getOptionalAttendees$p$2:function(){return this._data$p$0.get__cc$i$0()},_getRequiredAttendees$p$2:function(){return this._data$p$0.get__to$i$0()}},$h.MeetingSuggestion=function(n,t){this.$$d__getEndTime$p$0=Function.createDelegate(this,this._getEndTime$p$0),this.$$d__getStartTime$p$0=Function.createDelegate(this,this._getStartTime$p$0),this.$$d__getSubject$p$0=Function.createDelegate(this,this._getSubject$p$0),this.$$d__getLocation$p$0=Function.createDelegate(this,this._getLocation$p$0),this.$$d__getAttendees$p$0=Function.createDelegate(this,this._getAttendees$p$0),this.$$d__getMeetingString$p$0=Function.createDelegate(this,this._getMeetingString$p$0),this._data$p$0=n,this._dateTimeSent$p$0=t,$h.InitialData._defineReadOnlyProperty$i(this,"meetingString",this.$$d__getMeetingString$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"attendees",this.$$d__getAttendees$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStartTime$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEndTime$p$0)},$h.MeetingSuggestion.prototype={_dateTimeSent$p$0:null,_data$p$0:null,_attendees$p$0:null,_getMeetingString$p$0:function(){return this._data$p$0.MeetingString},_getLocation$p$0:function(){return this._data$p$0.Location},_getSubject$p$0:function(){return this._data$p$0.Subject},_getStartTime$p$0:function(){var n=this._createDateTimeFromParameter$p$0("StartTime"),t=$h.MeetingSuggestionTimeDecoder.resolve(n,this._dateTimeSent$p$0);return t.getTime()!==n.getTime()?OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(t)):n},_getEndTime$p$0:function(){var n=this._createDateTimeFromParameter$p$0("EndTime"),t=$h.MeetingSuggestionTimeDecoder.resolve(n,this._dateTimeSent$p$0);return t.getTime()!==n.getTime()?OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(t)):n},_createDateTimeFromParameter$p$0:function(n){var t=this._data$p$0[n];return t?new Date(t):null},_getAttendees$p$0:function(){if(!this._attendees$p$0){var n=this;this._attendees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails,this._data$p$0,"Attendees",function(n){return $h.EmailAddressDetails._createFromEmailUserDictionary$i(n)})}return this._attendees$p$0}},$h.MeetingSuggestionTimeDecoder=function(){},$h.MeetingSuggestionTimeDecoder.resolve=function(n,t){if(!t)return n;try{var u,i,r,f=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0),e,o,s;return(s=$h.MeetingSuggestionTimeDecoder._decode$p(n,e={val:r},o={val:u}),r=e.val,u=o.val,s)?(i=$h._preciseDate.isInstanceOfType(r)?$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p(f,r):$h._relativeDate.isInstanceOfType(r)?$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p(f,r):f,isNaN(i.getTime()))?t:(i.setMilliseconds(i.getMilliseconds()+u),i):n}catch(h){return t}},$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i=function(n){return null===n||n===undefined},$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p=function(n,t){var r=t._year$i$1,u=t._month$i$1?t._month$i$1-1:n.getMonth(),f=t._day$i$1,i;return f?($h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(r)?(i=new Date(n.getFullYear(),u,f),i.getTime()<n.getTime()&&(i=new Date(n.getFullYear()+1,u,f))):i=new Date(r<50?2e3+r:1900+r,u,f),i.getMonth()!==u)?n:i:n},$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p=function(n,t){var i,r;switch(t._unit$i$1){case 0:return i=new Date(n.getFullYear(),n.getMonth(),n.getDate()),i.setDate(i.getDate()+t._offset$i$1),i;case 5:return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p(n,t._offset$i$1,t._tag$i$1);case 2:r=1;switch(t._modifier$i$1){case 1:break;case 2:r=16;break;default:t._offset$i$1||(r=n.getDate())}return i=new Date(n.getFullYear(),n.getMonth(),r),i.setMonth(i.getMonth()+t._offset$i$1),i.getTime()<n.getTime()&&i.setDate(i.getDate()+n.getDate()-1),i;case 1:if(i=new Date(n.getFullYear(),n.getMonth(),n.getDate()),i.setDate(n.getDate()+7*t._offset$i$1),t._modifier$i$1!==1&&t._modifier$i$1){if(t._modifier$i$1===2)return i.setDate(i.getDate()+5-i.getDay()),i}else return(i.setDate(i.getDate()+1-i.getDay()),i.getTime()<n.getTime())?n:i;break;case 4:return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p(n,t);case 3:if(t._offset$i$1>0)return new Date(n.getFullYear()+t._offset$i$1,0,1)}return n},$h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p=function(n,t,i){var u,r;return t>-5&&t<5?(u=(i+6)%7+1,r=7*t+(u-n.getDay()),n.setDate(n.getDate()+r),n):(r=(i-n.getDay())%7,r<0&&(r+=7),n.setDate(n.getDate()+r),n)},$h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p=function(n,t){var f,i,r,e,u;return(f=n,t._tag$i$1<=0||t._tag$i$1>12||t._offset$i$1<=0||t._offset$i$1>5)?n:(e=(12+t._tag$i$1-f.getMonth()-1)%12,i=new Date(f.getFullYear(),f.getMonth()+e,1),t._modifier$i$1===1?t._offset$i$1===1&&i.getDay()!==6&&i.getDay()!==0?i:(r=new Date(i.getFullYear(),i.getMonth(),i.getDate()),r.setDate(r.getDate()+(8-i.getDay())%7),i.getDay()!==6&&i.getDay()!==0&&i.getDay()!==1&&r.setDate(r.getDate()-7),r.setDate(r.getDate()+7*(t._offset$i$1-1)),r.getMonth()+1!==t._tag$i$1)?n:r:(r=new Date(i.getFullYear(),i.getMonth(),$h.MeetingSuggestionTimeDecoder._daysInMonth$p(i.getMonth(),i.getFullYear())),u=1-r.getDay(),u>0&&(u=u-7),r.setDate(r.getDate()+u),r.setDate(r.getDate()+7*(1-t._offset$i$1)),r.getMonth()+1!==t._tag$i$1?i.getDay()!==6&&i.getDay()!==0?i:n:r))},$h.MeetingSuggestionTimeDecoder._decode$p=function(n,t,i){var e=32767,u,r,f;if((t.val=null,i.val=0,!n)||(i.val=$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p(n),u=n.getTime()-i.val,r=(u-$h.MeetingSuggestionTimeDecoder._baseDate$p.getTime())/864e5,r<0)||r>=262144)return!1;f=r>>15,r=r&e;switch(f){case 0:return $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p(r,t);case 1:return $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p(r,t);default:return!1}},$h.MeetingSuggestionTimeDecoder._decodePreciseDate$p=function(n,t){var o=7,u=15,s=31,h=127,f=null,r=0,e=0,i;if(t.val=null,i=n>>12&o,(i&4)==4){if(f=n>>5&h,(i&2)==2){if((i&1)==1)return!1;r=n>>1&u}}else(i&2)==2&&(r=n>>8&u),(i&1)==1&&(e=n>>3&s);return t.val=new $h._preciseDate(e,r,f),!0},$h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p=function(n,t){var f=15,e=63,o=7,s=3,h=n&f,i,r,u;n>>=4,i=$h.MeetingSuggestionTimeDecoder._fromComplement$p(n&e,6),n>>=6,r=n&o,n>>=3,u=n&s;try{return t.val=new $h._relativeDate(u,i,r,h),!0}catch(c){return t.val=null,!1}},$h.MeetingSuggestionTimeDecoder._fromComplement$p=function(n,t){var i=1<<t-1,r=(1<<t)-1;return(n&i)===i?-((n^r)+1):n},$h.MeetingSuggestionTimeDecoder._daysInMonth$p=function(n,t){return 32-new Date(t,n,32).getDate()},$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p=function(n){var t=0;return t+=n.getUTCHours()*3600,t+=n.getUTCMinutes()*60,t+=n.getUTCSeconds(),t*=1e3,t+=n.getUTCMilliseconds()},$h._extractedDate=function(){},$h._preciseDate=function(n,t,i){if($h._preciseDate.initializeBase(this),n<0||n>31)throw Error.argumentOutOfRange("day");if(t<0||t>12)throw Error.argumentOutOfRange("month");if(this._day$i$1=n,this._month$i$1=t,$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(i)){if(!this._month$i$1&&!this._day$i$1)throw Error.argument("Invalid datetime");}else{if(!t&&n)throw Error.argument("Invalid arguments");if(i<0||i>2099)throw Error.argumentOutOfRange("year");this._year$i$1=i%100}},$h._preciseDate.prototype={_day$i$1:0,_month$i$1:0,_year$i$1:null},$h._relativeDate=function(n,t,i,r){if($h._relativeDate.initializeBase(this),t<-32||t>31)throw Error.argumentOutOfRange("offset");if(r<0||r>15)throw Error.argumentOutOfRange("tag");if(!i&&t<0)throw Error.argument("unit & offset do not form a valid date");this._modifier$i$1=n,this._offset$i$1=t,this._unit$i$1=i,this._tag$i$1=r},$h._relativeDate.prototype={_modifier$i$1:0,_offset$i$1:0,_unit$i$1:0,_tag$i$1:0},$h.Message=function(n){this.$$d__getConversationId$p$1=Function.createDelegate(this,this._getConversationId$p$1),this.$$d__getInternetMessageId$p$1=Function.createDelegate(this,this._getInternetMessageId$p$1),this.$$d__getCc$p$1=Function.createDelegate(this,this._getCc$p$1),this.$$d__getTo$p$1=Function.createDelegate(this,this._getTo$p$1),this.$$d__getFrom$p$1=Function.createDelegate(this,this._getFrom$p$1),this.$$d__getSender$p$1=Function.createDelegate(this,this._getSender$p$1),this.$$d__getNormalizedSubject$p$1=Function.createDelegate(this,this._getNormalizedSubject$p$1),this.$$d__getSubject$p$1=Function.createDelegate(this,this._getSubject$p$1),$h.Message.initializeBase(this,[n]),$h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$1),$h.InitialData._defineReadOnlyProperty$i(this,"normalizedSubject",this.$$d__getNormalizedSubject$p$1),$h.InitialData._defineReadOnlyProperty$i(this,"sender",this.$$d__getSender$p$1),$h.InitialData._defineReadOnlyProperty$i(this,"from",this.$$d__getFrom$p$1),$h.InitialData._defineReadOnlyProperty$i(this,"to",this.$$d__getTo$p$1),$h.InitialData._defineReadOnlyProperty$i(this,"cc",this.$$d__getCc$p$1),$h.InitialData._defineReadOnlyProperty$i(this,"internetMessageId",this.$$d__getInternetMessageId$p$1),$h.InitialData._defineReadOnlyProperty$i(this,"conversationId",this.$$d__getConversationId$p$1)},$h.Message.prototype={getEntities:function(){return this._data$p$0._getEntities$i$0()},getEntitiesByType:function(n){return this._data$p$0._getEntitiesByType$i$0(n)},getFilteredEntitiesByName:function(n){return this._data$p$0._getFilteredEntitiesByName$i$0(n)},getRegExMatches:function(){return OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(),1,"getRegExMatches"),this._data$p$0._getRegExMatches$i$0()},getRegExMatchesByName:function(n){return OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(),1,"getRegExMatchesByName"),this._data$p$0._getRegExMatchesByName$i$0(n)},displayReplyForm:function(n){OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(n)},displayReplyAllForm:function(n){OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(n)},getItemType:function(){return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message},_getSubject$p$1:function(){return this._data$p$0.get__subject$i$0()},_getNormalizedSubject$p$1:function(){return this._data$p$0.get__normalizedSubject$i$0()},_getSender$p$1:function(){return this._data$p$0.get__sender$i$0()},_getFrom$p$1:function(){return this._data$p$0.get__from$i$0()},_getTo$p$1:function(){return this._data$p$0.get__to$i$0()},_getCc$p$1:function(){return this._data$p$0.get__cc$i$0()},_getInternetMessageId$p$1:function(){return this._data$p$0.get__internetMessageId$i$0()},_getConversationId$p$1:function(){return this._data$p$0.get__conversationId$i$0()}},$h.PhoneNumber=function(n){this.$$d__getPhoneType$p$0=Function.createDelegate(this,this._getPhoneType$p$0),this.$$d__getOriginalPhoneString$p$0=Function.createDelegate(this,this._getOriginalPhoneString$p$0),this.$$d__getPhoneString$p$0=Function.createDelegate(this,this._getPhoneString$p$0),this._data$p$0=n,$h.InitialData._defineReadOnlyProperty$i(this,"phoneString",this.$$d__getPhoneString$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"originalPhoneString",this.$$d__getOriginalPhoneString$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"type",this.$$d__getPhoneType$p$0)},$h.PhoneNumber.prototype={_data$p$0:null,_getPhoneString$p$0:function(){return this._data$p$0.PhoneString},_getOriginalPhoneString$p$0:function(){return this._data$p$0.OriginalPhoneString},_getPhoneType$p$0:function(){return this._data$p$0.Type}},$h.TaskSuggestion=function(n){this.$$d__getAssignees$p$0=Function.createDelegate(this,this._getAssignees$p$0),this.$$d__getTaskString$p$0=Function.createDelegate(this,this._getTaskString$p$0),this._data$p$0=n,$h.InitialData._defineReadOnlyProperty$i(this,"taskString",this.$$d__getTaskString$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"assignees",this.$$d__getAssignees$p$0)},$h.TaskSuggestion.prototype={_data$p$0:null,_assignees$p$0:null,_getTaskString$p$0:function(){return this._data$p$0.TaskString},_getAssignees$p$0:function(){if(!this._assignees$p$0){var n=this;this._assignees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails,this._data$p$0,"Assignees",function(n){return $h.EmailAddressDetails._createFromEmailUserDictionary$i(n)})}return this._assignees$p$0}},$h.UserProfile=function(n){this.$$d__getTimeZone$p$0=Function.createDelegate(this,this._getTimeZone$p$0),this.$$d__getEmailAddress$p$0=Function.createDelegate(this,this._getEmailAddress$p$0),this.$$d__getDisplayName$p$0=Function.createDelegate(this,this._getDisplayName$p$0),this._data$p$0=n,$h.InitialData._defineReadOnlyProperty$i(this,"displayName",this.$$d__getDisplayName$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"emailAddress",this.$$d__getEmailAddress$p$0),$h.InitialData._defineReadOnlyProperty$i(this,"timeZone",this.$$d__getTimeZone$p$0)},$h.UserProfile.prototype={_data$p$0:null,_getDisplayName$p$0:function(){return this._data$p$0.get__userDisplayName$i$0()},_getEmailAddress$p$0:function(){return this._data$p$0.get__userEmailAddress$i$0()},_getTimeZone$p$0:function(){return this._data$p$0.get__userTimeZone$i$0()}},$h.RequestState=function(){},$h.RequestState.prototype={unsent:0,opened:1,headersReceived:2,loading:3,done:4},$h.RequestState.registerEnum("$h.RequestState",!1),$h.EwsRequest=function(n){this.readyState=1,$h.EwsRequest.initializeBase(this,[n])},$h.EwsRequest.prototype={status:0,statusText:null,onreadystatechange:null,responseText:null,get__statusCode$i$1:function(){return this.status},set__statusCode$i$1:function(n){return this.status=n,n},get__statusDescription$i$1:function(){return this.statusText},set__statusDescription$i$1:function(n){return this.statusText=n,n},get__requestState$i$1:function(){return this.readyState},set__requestState$i$1:function(n){return this.readyState=n,n},get__response$i$1:function(){return this.responseText},set__response$i$1:function(n){return this.responseText=n,n},send:function(n){this._checkSendConditions$i$1(),$h.ScriptHelpers.isNullOrUndefined(n)&&this._throwInvalidStateException$i$1(),this._sendRequest$i$0(5,"EwsRequest",{body:n})},_callOnReadyStateChangeCallback$i$1:function(){$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)||this.onreadystatechange()},_parseExtraResponseData$i$1:function(){}},$h.InitialData=function(n){this._data$p$0=n},$h.InitialData._defineReadOnlyProperty$i=function(n,t,i){var r={get:i,configurable:!1};Object.defineProperty(n,t,r)},$h.InitialData.prototype={_toRecipients$p$0:null,_ccRecipients$p$0:null,_resources$p$0:null,_entities$p$0:null,_data$p$0:null,get__permissionLevel$i$0:function(){var n=this._data$p$0.permissionLevel;return $h.ScriptHelpers.isUndefined(n)?0:n},get__itemId$i$0:function(){return this._data$p$0.id},get__itemClass$i$0:function(){return this._data$p$0.itemClass},get__dateTimeCreated$i$0:function(){return new Date(this._data$p$0.dateTimeCreated)},get__dateTimeModified$i$0:function(){return new Date(this._data$p$0.dateTimeModified)},get__dateTimeSent$i$0:function(){return new Date(this._data$p$0.dateTimeSent)},get__subject$i$0:function(){return this._data$p$0.subject},get__normalizedSubject$i$0:function(){return this._data$p$0.normalizedSubject},get__internetMessageId$i$0:function(){return this._data$p$0.internetMessageId},get__conversationId$i$0:function(){return this._data$p$0.conversationId},get__sender$i$0:function(){this._throwOnRestrictedPermissionLevel$p$0();var n=this._data$p$0.sender;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get__from$i$0:function(){this._throwOnRestrictedPermissionLevel$p$0();var n=this._data$p$0.from;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get__to$i$0:function(){return this._throwOnRestrictedPermissionLevel$p$0(),null===this._toRecipients$p$0&&(this._toRecipients$p$0=this._createEmailAddressDetails$p$0("to")),this._toRecipients$p$0},get__cc$i$0:function(){return this._throwOnRestrictedPermissionLevel$p$0(),null===this._ccRecipients$p$0&&(this._ccRecipients$p$0=this._createEmailAddressDetails$p$0("cc")),this._ccRecipients$p$0},get__start$i$0:function(){return new Date(this._data$p$0.start)},get__end$i$0:function(){return new Date(this._data$p$0.end)},get__location$i$0:function(){return this._data$p$0.location},get__resources$i$0:function(){return this._throwOnRestrictedPermissionLevel$p$0(),null===this._resources$p$0&&(this._resources$p$0=this._createEmailAddressDetails$p$0("resources")),this._resources$p$0},get__organizer$i$0:function(){this._throwOnRestrictedPermissionLevel$p$0();var n=this._data$p$0.organizer;return $h.ScriptHelpers.isNullOrUndefined(n)?null:new $h.EmailAddressDetails(n)},get__userDisplayName$i$0:function(){return this._data$p$0.userDisplayName},get__userEmailAddress$i$0:function(){return this._data$p$0.userEmailAddress},get__userTimeZone$i$0:function(){return this._data$p$0.userTimeZone},get__timeZoneOffsets$i$0:function(){return this._data$p$0.timeZoneOffsets},get__hostVersion$i$0:function(){return this._data$p$0.hostVersion},get__owaView$i$0:function(){return this._data$p$0.owaView},_getEntities$i$0:function(){return this._entities$p$0||(this._entities$p$0=new $h.Entities(this._data$p$0.entities,this._data$p$0.filteredEntities,this.get__dateTimeSent$i$0(),this.get__permissionLevel$i$0())),this._entities$p$0},_getEntitiesByType$i$0:function(n){var t=this._getEntities$i$0();return t._getByType$i$0(n)},_getFilteredEntitiesByName$i$0:function(n){var t=this._getEntities$i$0();return t._getFilteredEntitiesByName$i$0(n)},_getRegExMatches$i$0:function(){return this._data$p$0.regExMatches?this._data$p$0.regExMatches:null},_getRegExMatchesByName$i$0:function(n){var t=this._getRegExMatches$i$0();return!t||!t[n]?null:t[n]},_createEmailAddressDetails$p$0:function(n){var i=this._data$p$0[n],r,t;if($h.ScriptHelpers.isNullOrUndefined(i))return[];for(r=[],t=0;t<i.length;t++)$h.ScriptHelpers.isNullOrUndefined(i[t])||(r[t]=new $h.EmailAddressDetails(i[t]));return r},_throwOnRestrictedPermissionLevel$p$0:function(){OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this.get__permissionLevel$i$0())}},$h._loadDictionaryRequest=function(n,t,i,r){$h._loadDictionaryRequest.initializeBase(this,[r]),this._createResultObject$p$1=n,this._dictionaryName$p$1=t,this._callback$p$1=i},$h._loadDictionaryRequest.prototype={_dictionaryName$p$1:null,_createResultObject$p$1:null,_callback$p$1:null,handleResponse:function(n){if(n.wasSuccessful){var t=n[this._dictionaryName$p$1],i=JSON.parse(t);this.createAsyncResult(this._createResultObject$p$1(i),0,null)}else this.createAsyncResult(null,1,n.errorMessage);this._callback$p$1(this._asyncResult$p$0)}},$h.ProxyRequestBase=function(n){$h.ProxyRequestBase.initializeBase(this,[n])},$h.ProxyRequestBase.prototype={handleResponse:function(n){if(n.wasProxySuccessful)this.set__statusCode$i$1(n.statusCode),this.set__statusDescription$i$1(n.statusDescription),this.set__response$i$1(n.body),this.createAsyncResult(this.get__response$i$1(),0,null);else{this.set__statusCode$i$1(500),this.set__statusDescription$i$1("Error");var t=n.errorMessage;this.set__response$i$1(t),this.createAsyncResult(null,1,t)}this._parseExtraResponseData$i$1(n),this._cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1()},_throwInvalidStateException$i$1:function(){throw Error.create("DOMException",{code:11,message:"INVALID_STATE_ERR"});},_cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1:function(){var n=this;this._changeReadyState$i$1(2,function(){n._changeReadyState$i$1(3,function(){n._changeReadyState$i$1(4,null)})})},_changeReadyState$i$1:function(n,t){this.set__requestState$i$1(n);var i=this;window.setTimeout(function(){try{i._callOnReadyStateChangeCallback$i$1()}finally{$h.ScriptHelpers.isNullOrUndefined(t)||t()}},0)},_checkSendConditions$i$1:function(){this.get__requestState$i$1()!==1&&this._throwInvalidStateException$i$1(),this._isSent$p$0&&this._throwInvalidStateException$i$1()}},$h.RequestBase=function(n){this._userContext$p$0=n},$h.RequestBase.prototype={_isSent$p$0:!1,_asyncResult$p$0:null,_userContext$p$0:null,_sendRequest$i$0:function(n,t,i){this._isSent$p$0=!0;var r=this;OSF.DDA.OutlookAppOm._instance$p._invokeHostMethod$i$0(n,t,i,function(n,t){n?r.createAsyncResult(null,1,String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text,n)):r.handleResponse(t)})},createAsyncResult:function(n,t,i){this._asyncResult$p$0=OSF.DDA.OutlookAppOm._createAsyncResult$i(n,t,i,this._userContext$p$0)}},$h._saveDictionaryRequest=function(n,t){$h._saveDictionaryRequest.initializeBase(this,[t]),$h.ScriptHelpers.isNullOrUndefined(n)||(this._callback$p$1=n)},$h._saveDictionaryRequest.prototype={_callback$p$1:null,handleResponse:function(n){n.wasSuccessful?this.createAsyncResult(null,0,null):this.createAsyncResult(null,1,n.errorMessage),$h.ScriptHelpers.isNullOrUndefined(this._callback$p$1)||this._callback$p$1(this._asyncResult$p$0)}},$h.ScriptHelpers=function(){},$h.ScriptHelpers.isNull=function(n){return null===n},$h.ScriptHelpers.isNullOrUndefined=function(n){return $h.ScriptHelpers.isNull(n)||$h.ScriptHelpers.isUndefined(n)},$h.ScriptHelpers.isUndefined=function(n){return n===undefined},$h.ScriptHelpers.dictionaryContainsKey=function(n,t){return Object.isInstanceOfType(n)?t in n:!1},OSF.DDA.OutlookAppOm.registerClass("OSF.DDA.OutlookAppOm"),$h.Item.registerClass("$h.Item"),$h.Appointment.registerClass("$h.Appointment",$h.Item),$h.Contact.registerClass("$h.Contact"),$h.CustomProperties.registerClass("$h.CustomProperties"),$h.Diagnostics.registerClass("$h.Diagnostics"),$h.EmailAddressDetails.registerClass("$h.EmailAddressDetails"),$h.Entities.registerClass("$h.Entities"),$h.Message.registerClass("$h.Message",$h.Item),$h.MeetingRequest.registerClass("$h.MeetingRequest",$h.Message),$h.MeetingSuggestion.registerClass("$h.MeetingSuggestion"),$h.MeetingSuggestionTimeDecoder.registerClass("$h.MeetingSuggestionTimeDecoder"),$h._extractedDate.registerClass("$h._extractedDate"),$h._preciseDate.registerClass("$h._preciseDate",$h._extractedDate),$h._relativeDate.registerClass("$h._relativeDate",$h._extractedDate),$h.PhoneNumber.registerClass("$h.PhoneNumber"),$h.TaskSuggestion.registerClass("$h.TaskSuggestion"),$h.UserProfile.registerClass("$h.UserProfile"),$h.RequestBase.registerClass("$h.RequestBase"),$h.ProxyRequestBase.registerClass("$h.ProxyRequestBase",$h.RequestBase),$h.EwsRequest.registerClass("$h.EwsRequest",$h.ProxyRequestBase),$h.InitialData.registerClass("$h.InitialData"),$h._loadDictionaryRequest.registerClass("$h._loadDictionaryRequest",$h.RequestBase),$h._saveDictionaryRequest.registerClass("$h._saveDictionaryRequest",$h.RequestBase),$h.ScriptHelpers.registerClass("$h.ScriptHelpers"),OSF.DDA.OutlookAppOm._maxRecipients$p=100,OSF.DDA.OutlookAppOm._maxSubjectLength$p=255,OSF.DDA.OutlookAppOm._maxBodyLength$p=32768,OSF.DDA.OutlookAppOm._maxLocationLength$p=255,OSF.DDA.OutlookAppOm._maxEwsRequestSize$p=1e6,OSF.DDA.OutlookAppOm._instance$p=null,$h.Diagnostics.outlookAppName="Outlook",$h.Diagnostics.outlookWebAppName="OutlookWebApp",$h.EmailAddressDetails._emptyString$p="",$h.EmailAddressDetails._responseTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Organizer,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Tentative,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Accepted,Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Declined],$h.EmailAddressDetails._recipientTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other,Microsoft.Office.WebExtension.MailboxEnums.RecipientType.DistributionList,Microsoft.Office.WebExtension.MailboxEnums.RecipientType.User,Microsoft.Office.WebExtension.MailboxEnums.RecipientType.ExternalUser],$h.Entities._allEntityKeys$p=["Addresses","EmailAddresses","Urls","PhoneNumbers","TaskSuggestions","MeetingSuggestions","Contacts"],$h.MeetingSuggestionTimeDecoder._baseDate$p=new Date("0001-01-01T00:00:00Z"),$h.ScriptHelpers.emptyString="",OSF.OUtil.getTrailingItem=function(n,t){if(n.length>0){var i=n[n.length-1];if(typeof i==t)return i}return null},OSF.OUtil.checkParamsAndGetCallback=function(n,t){var i=OSF.OUtil.getTrailingItem(n,"function"),r=OSF.OUtil.getTrailingItem(n,"object"),u,f;if(r&&r[Microsoft.Office.WebExtension.Parameters.Callback])if(i)throw OSF.OUtil.formatString(Strings.OfficeOM.L_RedundantCallbackSpecification);else if(i=r[Microsoft.Office.WebExtension.Parameters.Callback],u=typeof i,u!="function")throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,u);if(t.push({name:"options",type:Object,optional:!0}),f=Function._validateParams(n,t,!1),f)throw f;return i},OSF.DDA.Settings=function(n){n=n||{},Object.defineProperties(this,{get:{value:function(t){var i=Function._validateParams(arguments,[{name:"name",type:String,mayBeNull:!1}]),r;if(i)throw i;return r=n[t],r||null}},set:{value:function(t,i){var r=Function._validateParams(arguments,[{name:"name",type:String,mayBeNull:!1},{name:"value",mayBeNull:!0}]);if(r)throw r;n[t]=i}},remove:{value:function(t){var i=Function._validateParams(arguments,[{name:"name",type:String,mayBeNull:!1}]);if(i)throw i;delete n[t]}},saveAsync:{value:function(t){var i=OSF.OUtil.checkParamsAndGetCallback(arguments,[]),r,u;t=t||{},r=OSF.DDA.SettingsManager.serializeSettings(n),u=function(n,r){var f,u,e;i&&(f={},f[OSF.DDA.AsyncResultEnum.Properties.Context]=t[Microsoft.Office.WebExtension.Parameters.AsyncContext],r.error!==0&&(u={},u[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=OSF.DDA.AsyncResultEnum.ErrorCode.Failed,u[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=r.errorMessage),e=new OSF.DDA.AsyncResult(f,u),i(e))},OSF._OfficeAppFactory.getClientEndPoint().invoke("saveSettingsAsync",u,[r])}}})}