설명 없음
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

outlookwebapp-15.01.debug.js 126KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377
  1. /* Outlook web application specific API library */
  2. /* Version: 15.0.4615.1000 */
  3. /*
  4. Copyright (c) Microsoft Corporation. All rights reserved.
  5. */
  6. /*
  7. Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419.
  8. */
  9. ;
  10. Type.registerNamespace('Microsoft.Office.WebExtension.MailboxEnums');
  11. Microsoft.Office.WebExtension.MailboxEnums.EntityType={
  12. MeetingSuggestion: "meetingSuggestion", TaskSuggestion: "taskSuggestion", Address: "address", EmailAddress: "emailAddress", Url: "url", PhoneNumber: "phoneNumber", Contact: "contact"
  13. };
  14. Microsoft.Office.WebExtension.MailboxEnums.ItemType={
  15. Message: 'message', Appointment: 'appointment'
  16. };
  17. Microsoft.Office.WebExtension.MailboxEnums.ResponseType={
  18. None: "none", Organizer: "organizer", Tentative: "tentative", Accepted: "accepted", Declined: "declined"
  19. };
  20. Microsoft.Office.WebExtension.MailboxEnums.RecipientType={
  21. Other: "other", DistributionList: "distributionList", User: "user", ExternalUser: "externalUser"
  22. };
  23. Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={
  24. File: "file", Item: "item"
  25. };
  26. Microsoft.Office.WebExtension.MailboxEnums.BodyType={
  27. Text: "text", Html: "html"
  28. };
  29. Microsoft.Office.WebExtension.CoercionType={
  30. Text: "text", Html: "html"
  31. };
  32. ;
  33. Type.registerNamespace('OSF.DDA');
  34. OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(officeAppContext, targetWindow, appReadyCallback)
  35. {
  36. this.$$d__callAppReadyCallback$p$0=Function.createDelegate(this, this._callAppReadyCallback$p$0);
  37. this.$$d__displayNewAppointmentFormApi$p$0=Function.createDelegate(this, this._displayNewAppointmentFormApi$p$0);
  38. this.$$d_windowOpenOverrideHandler=Function.createDelegate(this, this.windowOpenOverrideHandler);
  39. this.$$d__getEwsUrl$p$0=Function.createDelegate(this, this._getEwsUrl$p$0);
  40. this.$$d__getDiagnostics$p$0=Function.createDelegate(this, this._getDiagnostics$p$0);
  41. this.$$d__getUserProfile$p$0=Function.createDelegate(this, this._getUserProfile$p$0);
  42. this.$$d__getItem$p$0=Function.createDelegate(this, this._getItem$p$0);
  43. this.$$d__getInitialDataResponseHandler$p$0=Function.createDelegate(this, this._getInitialDataResponseHandler$p$0);
  44. OSF.DDA.OutlookAppOm._instance$p=this;
  45. this._officeAppContext$p$0=officeAppContext;
  46. this._appReadyCallback$p$0=appReadyCallback;
  47. var $$t_4=this;
  48. var stringLoadedCallback=function()
  49. {
  50. if (appReadyCallback)
  51. {
  52. $$t_4._invokeHostMethod$i$0(1, 'GetInitialData', null, $$t_4.$$d__getInitialDataResponseHandler$p$0)
  53. }
  54. };
  55. if (this._areStringsLoaded$p$0())
  56. {
  57. stringLoadedCallback()
  58. }
  59. else
  60. {
  61. this._loadLocalizedScript$p$0(stringLoadedCallback)
  62. }
  63. };
  64. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i=function OSF_DDA_OutlookAppOm$_throwOnPropertyAccessForRestrictedPermission$i(currentPermissionLevel)
  65. {
  66. if (!currentPermissionLevel)
  67. {
  68. throw Error.create(_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text);
  69. }
  70. };
  71. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i=function OSF_DDA_OutlookAppOm$_throwOnOutOfRange$i(value, minValue, maxValue, argumentName)
  72. {
  73. if (value < minValue || value > maxValue)
  74. {
  75. throw Error.argumentOutOfRange(argumentName);
  76. }
  77. };
  78. OSF.DDA.OutlookAppOm._throwOnArgumentType$p=function OSF_DDA_OutlookAppOm$_throwOnArgumentType$p(value, expectedType, argumentName)
  79. {
  80. if (Object.getType(value) !==expectedType)
  81. {
  82. throw Error.argumentType(argumentName);
  83. }
  84. };
  85. OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p=function OSF_DDA_OutlookAppOm$_validateOptionalStringParameter$p(value, minLength, maxLength, name)
  86. {
  87. if ($h.ScriptHelpers.isNullOrUndefined(value))
  88. {
  89. return
  90. }
  91. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(value, String, name);
  92. var stringValue=value;
  93. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(stringValue.length, minLength, maxLength, name)
  94. };
  95. OSF.DDA.OutlookAppOm._convertToOutlookParameters$p=function OSF_DDA_OutlookAppOm$_convertToOutlookParameters$p(dispid, data)
  96. {
  97. var executeParameters=null;
  98. switch (dispid)
  99. {
  100. case 1:
  101. case 2:
  102. case 12:
  103. case 3:
  104. case 14:
  105. case 18:
  106. case 26:
  107. break;
  108. case 4:
  109. var jsonProperty=JSON.stringify(data['customProperties']);
  110. executeParameters=[jsonProperty];
  111. break;
  112. case 5:
  113. executeParameters=[data['body']];
  114. break;
  115. case 8:
  116. case 9:
  117. executeParameters=[data['itemId']];
  118. break;
  119. case 7:
  120. executeParameters=[OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data['requiredAttendees']), OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data['optionalAttendees']), data['start'], data['end'], data['location'], OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(data['resources']), data['subject'], data['body']];
  121. break;
  122. case 11:
  123. case 10:
  124. executeParameters=[data['htmlBody']];
  125. break;
  126. case 23:
  127. case 13:
  128. executeParameters=[data['data'], data['coercionType'] || null];
  129. break;
  130. case 17:
  131. executeParameters=[data['subject']];
  132. break;
  133. case 15:
  134. executeParameters=[data['recipientField']];
  135. break;
  136. case 22:
  137. case 21:
  138. executeParameters=[data['recipientField'], OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p(data['recipientArray'])];
  139. break;
  140. case 19:
  141. executeParameters=[data['itemId'], data['name']];
  142. break;
  143. case 16:
  144. executeParameters=[data['uri'], data['name']];
  145. break;
  146. case 20:
  147. executeParameters=[data['attachmentIndex']];
  148. break;
  149. case 25:
  150. executeParameters=[data['TimeProperty'], data['time']];
  151. break;
  152. case 24:
  153. executeParameters=[data['TimeProperty']];
  154. break;
  155. case 27:
  156. executeParameters=[data['location']];
  157. break;
  158. default:
  159. Sys.Debug.fail('Unexpected method dispid');
  160. break
  161. }
  162. return executeParameters
  163. };
  164. OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p=function OSF_DDA_OutlookAppOm$_convertRecipientArrayParameterForOutlookForDisplayApi$p(array)
  165. {
  166. return (array) ? array.join(';') : null
  167. };
  168. OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p=function OSF_DDA_OutlookAppOm$_convertComposeEmailDictionaryParameterForSetApi$p(recipients)
  169. {
  170. if (!recipients)
  171. {
  172. return null
  173. }
  174. var results=new Array(recipients.length);
  175. for (var i=0; i < recipients.length; i++)
  176. {
  177. results[i]=[recipients[i]['address'], recipients[i]['name']]
  178. }
  179. return results
  180. };
  181. OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p=function OSF_DDA_OutlookAppOm$_validateAndNormalizeRecipientEmails$p(emailset, name)
  182. {
  183. if ($h.ScriptHelpers.isNullOrUndefined(emailset))
  184. {
  185. return null
  186. }
  187. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(emailset, Array, name);
  188. var originalAttendees=emailset;
  189. var updatedAttendees=null;
  190. var normalizationNeeded=false;
  191. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(originalAttendees.length, 0, OSF.DDA.OutlookAppOm._maxRecipients$p, String.format('{0}.length', name));
  192. for (var i=0; i < originalAttendees.length; i++)
  193. {
  194. if ($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i]))
  195. {
  196. normalizationNeeded=true;
  197. break
  198. }
  199. }
  200. if (normalizationNeeded)
  201. {
  202. updatedAttendees=[]
  203. }
  204. for (var i=0; i < originalAttendees.length; i++)
  205. {
  206. if (normalizationNeeded)
  207. {
  208. updatedAttendees[i]=($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i])) ? (originalAttendees[i]).emailAddress : originalAttendees[i];
  209. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(updatedAttendees[i], String, String.format('{0}[{1}]', name, i))
  210. }
  211. else
  212. {
  213. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(originalAttendees[i], String, String.format('{0}[{1}]', name, i))
  214. }
  215. }
  216. return updatedAttendees
  217. };
  218. OSF.DDA.OutlookAppOm.prototype={
  219. _initialData$p$0: null, _item$p$0: null, _userProfile$p$0: null, _diagnostics$p$0: null, _officeAppContext$p$0: null, _appReadyCallback$p$0: null, _clientEndPoint$p$0: null, get_clientEndPoint: function OSF_DDA_OutlookAppOm$get_clientEndPoint()
  220. {
  221. if (!this._clientEndPoint$p$0)
  222. {
  223. this._clientEndPoint$p$0=OSF._OfficeAppFactory.getClientEndPoint()
  224. }
  225. return this._clientEndPoint$p$0
  226. }, set_clientEndPoint: function OSF_DDA_OutlookAppOm$set_clientEndPoint(value)
  227. {
  228. this._clientEndPoint$p$0=value;
  229. return value
  230. }, get_initialData: function OSF_DDA_OutlookAppOm$get_initialData()
  231. {
  232. return this._initialData$p$0
  233. }, get__appName$i$0: function OSF_DDA_OutlookAppOm$get__appName$i$0()
  234. {
  235. return this._officeAppContext$p$0.get_appName()
  236. }, initialize: function OSF_DDA_OutlookAppOm$initialize(initialData)
  237. {
  238. var ItemTypeKey='itemType';
  239. this._initialData$p$0=new $h.InitialData(initialData);
  240. if (1===initialData[ItemTypeKey])
  241. {
  242. this._item$p$0=new $h.Message(this._initialData$p$0)
  243. }
  244. else if (3===initialData[ItemTypeKey])
  245. {
  246. this._item$p$0=new $h.MeetingRequest(this._initialData$p$0)
  247. }
  248. else if (2===initialData[ItemTypeKey])
  249. {
  250. this._item$p$0=new $h.Appointment(this._initialData$p$0)
  251. }
  252. else if (4===initialData[ItemTypeKey])
  253. {
  254. this._item$p$0=new $h.MessageCompose(this._initialData$p$0)
  255. }
  256. else if (5===initialData[ItemTypeKey])
  257. {
  258. this._item$p$0=new $h.AppointmentCompose(this._initialData$p$0)
  259. }
  260. else
  261. {
  262. Sys.Debug.trace('Unexpected item type was received from the host.')
  263. }
  264. this._userProfile$p$0=new $h.UserProfile(this._initialData$p$0);
  265. this._diagnostics$p$0=new $h.Diagnostics(this._initialData$p$0, this._officeAppContext$p$0.get_appName());
  266. this._initializeMethods$p$0();
  267. $h.InitialData._defineReadOnlyProperty$i(this, 'item', this.$$d__getItem$p$0);
  268. $h.InitialData._defineReadOnlyProperty$i(this, 'userProfile', this.$$d__getUserProfile$p$0);
  269. $h.InitialData._defineReadOnlyProperty$i(this, 'diagnostics', this.$$d__getDiagnostics$p$0);
  270. $h.InitialData._defineReadOnlyProperty$i(this, 'ewsUrl', this.$$d__getEwsUrl$p$0);
  271. if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64)
  272. {
  273. if (this._initialData$p$0.get__overrideWindowOpen$i$0())
  274. {
  275. window.open=this.$$d_windowOpenOverrideHandler
  276. }
  277. }
  278. }, windowOpenOverrideHandler: function OSF_DDA_OutlookAppOm$windowOpenOverrideHandler(url, targetName, features, replace)
  279. {
  280. this._invokeHostMethod$i$0(0, 'LaunchPalUrl', {launchUrl: url}, null)
  281. }, makeEwsRequestAsync: function OSF_DDA_OutlookAppOm$makeEwsRequestAsync(data)
  282. {
  283. var args=[];
  284. for (var $$pai_5=1; $$pai_5 < arguments.length;++$$pai_5)
  285. {
  286. args[$$pai_5 - 1]=arguments[$$pai_5]
  287. }
  288. if ($h.ScriptHelpers.isNullOrUndefined(data))
  289. {
  290. throw Error.argumentNull('data');
  291. }
  292. if (data.length > OSF.DDA.OutlookAppOm._maxEwsRequestSize$p)
  293. {
  294. throw Error.argument('data', _u.ExtensibilityStrings.l_EwsRequestOversized_Text);
  295. }
  296. this._throwOnMethodCallForInsufficientPermission$i$0(3, 'makeEwsRequestAsync');
  297. var parameters=$h.CommonParameters.parse(args, true, true);
  298. var ewsRequest=new $h.EwsRequest(parameters._asyncContext$p$0);
  299. var $$t_4=this;
  300. ewsRequest.onreadystatechange=function()
  301. {
  302. if (4===ewsRequest.get__requestState$i$1())
  303. {
  304. parameters.get_callback()(ewsRequest._asyncResult$p$0)
  305. }
  306. };
  307. ewsRequest.send(data)
  308. }, recordDataPoint: function OSF_DDA_OutlookAppOm$recordDataPoint(data)
  309. {
  310. if ($h.ScriptHelpers.isNullOrUndefined(data))
  311. {
  312. throw Error.argumentNull('data');
  313. }
  314. this._invokeHostMethod$i$0(0, 'RecordDataPoint', data, null)
  315. }, recordTrace: function OSF_DDA_OutlookAppOm$recordTrace(data)
  316. {
  317. if ($h.ScriptHelpers.isNullOrUndefined(data))
  318. {
  319. throw Error.argumentNull('data');
  320. }
  321. this._invokeHostMethod$i$0(0, 'RecordTrace', data, null)
  322. }, trackCtq: function OSF_DDA_OutlookAppOm$trackCtq(data)
  323. {
  324. if ($h.ScriptHelpers.isNullOrUndefined(data))
  325. {
  326. throw Error.argumentNull('data');
  327. }
  328. this._invokeHostMethod$i$0(0, 'TrackCtq', data, null)
  329. }, convertToLocalClientTime: function OSF_DDA_OutlookAppOm$convertToLocalClientTime(timeValue)
  330. {
  331. var date=new Date(timeValue.getTime());
  332. var offset=date.getTimezoneOffset() * -1;
  333. if (this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0())
  334. {
  335. date.setUTCMinutes(date.getUTCMinutes() - offset);
  336. offset=this._findOffset$p$0(date);
  337. date.setUTCMinutes(date.getUTCMinutes()+offset)
  338. }
  339. var retValue=this._dateToDictionary$i$0(date);
  340. retValue['timezoneOffset']=offset;
  341. return retValue
  342. }, convertToUtcClientTime: function OSF_DDA_OutlookAppOm$convertToUtcClientTime(input)
  343. {
  344. var retValue=this._dictionaryToDate$i$0(input);
  345. if (this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0())
  346. {
  347. var offset=this._findOffset$p$0(retValue);
  348. retValue.setUTCMinutes(retValue.getUTCMinutes() - offset);
  349. offset=(!input['timezoneOffset']) ? retValue.getTimezoneOffset() * -1 : input['timezoneOffset'];
  350. retValue.setUTCMinutes(retValue.getUTCMinutes()+offset)
  351. }
  352. return retValue
  353. }, getUserIdentityTokenAsync: function OSF_DDA_OutlookAppOm$getUserIdentityTokenAsync()
  354. {
  355. var args=[];
  356. for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  357. {
  358. args[$$pai_2]=arguments[$$pai_2]
  359. }
  360. this._throwOnMethodCallForInsufficientPermission$i$0(1, 'getUserIdentityTokenAsync');
  361. var parameters=$h.CommonParameters.parse(args, true, true);
  362. this._invokeGetTokenMethodAsync$p$0(2, 'GetUserIdentityToken', parameters.get_callback(), parameters._asyncContext$p$0)
  363. }, getCallbackTokenAsync: function OSF_DDA_OutlookAppOm$getCallbackTokenAsync()
  364. {
  365. var args=[];
  366. for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  367. {
  368. args[$$pai_2]=arguments[$$pai_2]
  369. }
  370. this._throwOnMethodCallForInsufficientPermission$i$0(1, 'getCallbackTokenAsync');
  371. var parameters=$h.CommonParameters.parse(args, true, true);
  372. this._invokeGetTokenMethodAsync$p$0(12, 'GetCallbackToken', parameters.get_callback(), parameters._asyncContext$p$0)
  373. }, displayMessageForm: function OSF_DDA_OutlookAppOm$displayMessageForm(itemId)
  374. {
  375. if ($h.ScriptHelpers.isNullOrUndefined(itemId))
  376. {
  377. throw Error.argumentNull('itemId');
  378. }
  379. this._invokeHostMethod$i$0(8, 'DisplayExistingMessageForm', {itemId: itemId}, null)
  380. }, displayAppointmentForm: function OSF_DDA_OutlookAppOm$displayAppointmentForm(itemId)
  381. {
  382. if ($h.ScriptHelpers.isNullOrUndefined(itemId))
  383. {
  384. throw Error.argumentNull('itemId');
  385. }
  386. this._invokeHostMethod$i$0(9, 'DisplayExistingAppointmentForm', {itemId: itemId}, null)
  387. }, createAsyncResult: function OSF_DDA_OutlookAppOm$createAsyncResult(value, errorCode, errorDescription, userContext)
  388. {
  389. var initArgs={};
  390. var errorArgs=null;
  391. initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=value;
  392. initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=userContext;
  393. if (0 !==errorCode)
  394. {
  395. errorArgs={};
  396. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=errorCode;
  397. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=errorDescription
  398. }
  399. return new OSF.DDA.AsyncResult(initArgs, errorArgs)
  400. }, standardCreateAsyncResult: function OSF_DDA_OutlookAppOm$standardCreateAsyncResult(value, errorCode, detailedErrorCode, userContext)
  401. {
  402. var initArgs={};
  403. var errorArgs=null;
  404. initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=value;
  405. initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=userContext;
  406. if (0 !==errorCode)
  407. {
  408. errorArgs={};
  409. var errorProperties=$h.OutlookErrorManager.getErrorArgs(detailedErrorCode);
  410. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=errorProperties['name'];
  411. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=errorProperties['message'];
  412. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=detailedErrorCode
  413. }
  414. return new OSF.DDA.AsyncResult(initArgs, errorArgs)
  415. }, _throwOnMethodCallForInsufficientPermission$i$0: function OSF_DDA_OutlookAppOm$_throwOnMethodCallForInsufficientPermission$i$0(requiredPermissionLevel, methodName)
  416. {
  417. if (this._initialData$p$0._permissionLevel$p$0 < requiredPermissionLevel)
  418. {
  419. throw Error.create(String.format(_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text, methodName));
  420. }
  421. }, _displayReplyForm$i$0: function OSF_DDA_OutlookAppOm$_displayReplyForm$i$0(htmlBody)
  422. {
  423. if (!$h.ScriptHelpers.isNullOrUndefined(htmlBody))
  424. {
  425. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(htmlBody.length, 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'htmlBody')
  426. }
  427. this._invokeHostMethod$i$0(10, 'DisplayReplyForm', {htmlBody: htmlBody}, null)
  428. }, _displayReplyAllForm$i$0: function OSF_DDA_OutlookAppOm$_displayReplyAllForm$i$0(htmlBody)
  429. {
  430. if (!$h.ScriptHelpers.isNullOrUndefined(htmlBody))
  431. {
  432. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(htmlBody.length, 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'htmlBody')
  433. }
  434. this._invokeHostMethod$i$0(11, 'DisplayReplyAllForm', {htmlBody: htmlBody}, null)
  435. }, _standardInvokeHostMethod$i$0: function OSF_DDA_OutlookAppOm$_standardInvokeHostMethod$i$0(dispid, name, data, format, userContext, callback)
  436. {
  437. var $$t_C=this;
  438. this._invokeHostMethod$i$0(dispid, name, data, function(resultCode, response)
  439. {
  440. if (callback)
  441. {
  442. var asyncResult=null;
  443. if (Object.isInstanceOfType(response))
  444. {
  445. var responseDictionary=response;
  446. if (('error' in responseDictionary) || ('data' in responseDictionary) || ('errorCode' in responseDictionary))
  447. {
  448. if (!responseDictionary['error'])
  449. {
  450. var formattedData=(format) ? format(responseDictionary['data']) : responseDictionary['data'];
  451. asyncResult=$$t_C.standardCreateAsyncResult(formattedData, 0, 0, userContext)
  452. }
  453. else
  454. {
  455. var errorCode=responseDictionary['errorCode'];
  456. asyncResult=$$t_C.standardCreateAsyncResult(null, 1, errorCode, userContext)
  457. }
  458. }
  459. }
  460. if (!asyncResult && resultCode)
  461. {
  462. asyncResult=$$t_C.standardCreateAsyncResult(null, 1, 9002, userContext)
  463. }
  464. callback(asyncResult)
  465. }
  466. })
  467. }, _invokeHostMethod$i$0: function OSF_DDA_OutlookAppOm$_invokeHostMethod$i$0(dispid, name, data, responseCallback)
  468. {
  469. if (64===this._officeAppContext$p$0.get_appName())
  470. {
  471. this.get_clientEndPoint().invoke(name, responseCallback, data)
  472. }
  473. else if (dispid)
  474. {
  475. var executeParameters=OSF.DDA.OutlookAppOm._convertToOutlookParameters$p(dispid, data);
  476. var $$t_B=this;
  477. window.external.Execute(dispid, executeParameters, function(nativeData, resultCode)
  478. {
  479. if (responseCallback)
  480. {
  481. var responseData=nativeData.toArray();
  482. var rawData=JSON.parse(responseData[0]);
  483. if (Object.isInstanceOfType(rawData))
  484. {
  485. var deserializedData=rawData;
  486. if (responseData.length > 1 && responseData[1])
  487. {
  488. deserializedData['error']=true;
  489. deserializedData['errorCode']=responseData[1]
  490. }
  491. else
  492. {
  493. deserializedData['error']=false
  494. }
  495. responseCallback(resultCode, deserializedData)
  496. }
  497. else if (Number.isInstanceOfType(rawData))
  498. {
  499. var returnDict={};
  500. returnDict['error']=true;
  501. returnDict['errorCode']=rawData;
  502. responseCallback(resultCode, returnDict)
  503. }
  504. else
  505. {
  506. throw Error.notImplemented('Return data type from host must be Dictionary or int');
  507. }
  508. }
  509. })
  510. }
  511. else if (responseCallback)
  512. {
  513. responseCallback(-2, null)
  514. }
  515. }, _dictionaryToDate$i$0: function OSF_DDA_OutlookAppOm$_dictionaryToDate$i$0(input)
  516. {
  517. var retValue=new Date(input['year'], input['month'], input['date'], input['hours'], input['minutes'], input['seconds'], (!input['milliseconds']) ? 0 : input['milliseconds']);
  518. if (isNaN(retValue.getTime()))
  519. {
  520. throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);
  521. }
  522. return retValue
  523. }, _dateToDictionary$i$0: function OSF_DDA_OutlookAppOm$_dateToDictionary$i$0(input)
  524. {
  525. var retValue={};
  526. retValue['month']=input.getMonth();
  527. retValue['date']=input.getDate();
  528. retValue['year']=input.getFullYear();
  529. retValue['hours']=input.getHours();
  530. retValue['minutes']=input.getMinutes();
  531. retValue['seconds']=input.getSeconds();
  532. retValue['milliseconds']=input.getMilliseconds();
  533. return retValue
  534. }, _displayNewAppointmentFormApi$p$0: function OSF_DDA_OutlookAppOm$_displayNewAppointmentFormApi$p$0(parameters)
  535. {
  536. var normalizedRequiredAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters['requiredAttendees'], 'requiredAttendees');
  537. var normalizedOptionalAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters['optionalAttendees'], 'optionalAttendees');
  538. OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['location'], 0, OSF.DDA.OutlookAppOm._maxLocationLength$p, 'location');
  539. OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['body'], 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'body');
  540. OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['subject'], 0, OSF.DDA.OutlookAppOm._maxSubjectLength$p, 'subject');
  541. if (!$h.ScriptHelpers.isNullOrUndefined(parameters['start']))
  542. {
  543. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters['start'], Date, 'start');
  544. var startDateTime=parameters['start'];
  545. parameters['start']=startDateTime.getTime();
  546. if (!$h.ScriptHelpers.isNullOrUndefined(parameters['end']))
  547. {
  548. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters['end'], Date, 'end');
  549. var endDateTime=parameters['end'];
  550. if (endDateTime < startDateTime)
  551. {
  552. throw Error.argumentOutOfRange('end', endDateTime, _u.ExtensibilityStrings.l_InvalidEventDates_Text);
  553. }
  554. parameters['end']=endDateTime.getTime()
  555. }
  556. }
  557. var updatedParameters=null;
  558. if (normalizedRequiredAttendees || normalizedOptionalAttendees)
  559. {
  560. updatedParameters={};
  561. var $$dict_6=parameters;
  562. for (var $$key_7 in $$dict_6)
  563. {
  564. var entry={
  565. key: $$key_7, value: $$dict_6[$$key_7]
  566. };
  567. updatedParameters[entry.key]=entry.value
  568. }
  569. if (normalizedRequiredAttendees)
  570. {
  571. updatedParameters['requiredAttendees']=normalizedRequiredAttendees
  572. }
  573. if (normalizedOptionalAttendees)
  574. {
  575. updatedParameters['optionalAttendees']=normalizedOptionalAttendees
  576. }
  577. }
  578. this._invokeHostMethod$i$0(7, 'DisplayNewAppointmentForm', updatedParameters || parameters, null)
  579. }, _initializeMethods$p$0: function OSF_DDA_OutlookAppOm$_initializeMethods$p$0()
  580. {
  581. var currentInstance=this;
  582. if ($h.Item.isInstanceOfType(this._item$p$0))
  583. {
  584. currentInstance.displayNewAppointmentForm=this.$$d__displayNewAppointmentFormApi$p$0
  585. }
  586. }, _getInitialDataResponseHandler$p$0: function OSF_DDA_OutlookAppOm$_getInitialDataResponseHandler$p$0(resultCode, data)
  587. {
  588. if (resultCode)
  589. {
  590. return
  591. }
  592. this.initialize(data);
  593. (this).displayName='mailbox';
  594. window.setTimeout(this.$$d__callAppReadyCallback$p$0, 0)
  595. }, _callAppReadyCallback$p$0: function OSF_DDA_OutlookAppOm$_callAppReadyCallback$p$0()
  596. {
  597. this._appReadyCallback$p$0()
  598. }, _invokeGetTokenMethodAsync$p$0: function OSF_DDA_OutlookAppOm$_invokeGetTokenMethodAsync$p$0(outlookDispid, methodName, callback, userContext)
  599. {
  600. if ($h.ScriptHelpers.isNullOrUndefined(callback))
  601. {
  602. throw Error.argumentNull('callback');
  603. }
  604. var $$t_8=this;
  605. this._invokeHostMethod$i$0(outlookDispid, methodName, null, function(resultCode, response)
  606. {
  607. var asyncResult;
  608. if (resultCode)
  609. {
  610. asyncResult=$$t_8.createAsyncResult(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode), userContext)
  611. }
  612. else
  613. {
  614. var responseDictionary=response;
  615. if (responseDictionary['wasSuccessful'])
  616. {
  617. asyncResult=$$t_8.createAsyncResult(responseDictionary['token'], 0, null, userContext)
  618. }
  619. else
  620. {
  621. asyncResult=$$t_8.createAsyncResult(null, 1, responseDictionary['errorMessage'], userContext)
  622. }
  623. }
  624. callback(asyncResult)
  625. })
  626. }, _getItem$p$0: function OSF_DDA_OutlookAppOm$_getItem$p$0()
  627. {
  628. return this._item$p$0
  629. }, _getUserProfile$p$0: function OSF_DDA_OutlookAppOm$_getUserProfile$p$0()
  630. {
  631. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0);
  632. return this._userProfile$p$0
  633. }, _getDiagnostics$p$0: function OSF_DDA_OutlookAppOm$_getDiagnostics$p$0()
  634. {
  635. return this._diagnostics$p$0
  636. }, _getEwsUrl$p$0: function OSF_DDA_OutlookAppOm$_getEwsUrl$p$0()
  637. {
  638. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0);
  639. return this._initialData$p$0.get__ewsUrl$i$0()
  640. }, _findOffset$p$0: function OSF_DDA_OutlookAppOm$_findOffset$p$0(value)
  641. {
  642. var ranges=this._initialData$p$0.get__timeZoneOffsets$i$0();
  643. for (var r=0; r < ranges.length; r++)
  644. {
  645. var range=ranges[r];
  646. var start=parseInt(range['start']);
  647. var end=parseInt(range['end']);
  648. if (value.getTime() - start >=0 && value.getTime() - end < 0)
  649. {
  650. return parseInt(range['offset'])
  651. }
  652. }
  653. throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);
  654. }, _areStringsLoaded$p$0: function OSF_DDA_OutlookAppOm$_areStringsLoaded$p$0()
  655. {
  656. var stringsLoaded=false;
  657. try
  658. {
  659. stringsLoaded=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text)
  660. }
  661. catch($$e_1) {}
  662. return stringsLoaded
  663. }, _loadLocalizedScript$p$0: function OSF_DDA_OutlookAppOm$_loadLocalizedScript$p$0(stringLoadedCallback)
  664. {
  665. var url=null;
  666. var baseUrl='';
  667. var scripts=document.getElementsByTagName('script');
  668. for (var i=scripts.length - 1; i >=0; i--)
  669. {
  670. var filename=null;
  671. var attributes=scripts[i].attributes;
  672. if (attributes)
  673. {
  674. var attribute=attributes.getNamedItem('src');
  675. if (attribute)
  676. {
  677. filename=attribute.value
  678. }
  679. if (filename)
  680. {
  681. var debug=false;
  682. filename=filename.toLowerCase();
  683. var officeIndex=filename.indexOf('office_strings.js');
  684. if (officeIndex < 0)
  685. {
  686. officeIndex=filename.indexOf('office_strings.debug.js');
  687. debug=true
  688. }
  689. if ((officeIndex > 0) && (officeIndex < filename.length))
  690. {
  691. url=filename.replace((debug) ? 'office_strings.debug.js' : 'office_strings.js', 'outlook_strings.js');
  692. var languageUrl=filename.substring(0, officeIndex);
  693. var lastIndexOfSlash=languageUrl.lastIndexOf('/', languageUrl.length - 2);
  694. if (lastIndexOfSlash===-1)
  695. {
  696. lastIndexOfSlash=languageUrl.lastIndexOf('\\', languageUrl.length - 2)
  697. }
  698. if (lastIndexOfSlash !==-1 && languageUrl.length > lastIndexOfSlash+1)
  699. {
  700. baseUrl=languageUrl.substring(0, lastIndexOfSlash+1)
  701. }
  702. break
  703. }
  704. }
  705. }
  706. }
  707. if (url)
  708. {
  709. var head=document.getElementsByTagName('head')[0];
  710. var scriptElement=null;
  711. var $$t_H=this;
  712. var scriptElementCallback=function()
  713. {
  714. if (stringLoadedCallback && (!scriptElement.readyState || (scriptElement.readyState && (scriptElement.readyState==='loaded' || scriptElement.readyState==='complete'))))
  715. {
  716. scriptElement.onload=null;
  717. scriptElement.onreadystatechange=null;
  718. stringLoadedCallback()
  719. }
  720. };
  721. var $$t_I=this;
  722. var failureCallback=function()
  723. {
  724. if (!$$t_I._areStringsLoaded$p$0())
  725. {
  726. var fallbackUrl=baseUrl+'en-us/'+'outlook_strings.js';
  727. scriptElement.onload=null;
  728. scriptElement.onreadystatechange=null;
  729. scriptElement=$$t_I._createScriptElement$p$0(fallbackUrl);
  730. scriptElement.onload=scriptElementCallback;
  731. scriptElement.onreadystatechange=scriptElementCallback;
  732. head.appendChild(scriptElement)
  733. }
  734. };
  735. scriptElement=this._createScriptElement$p$0(url);
  736. scriptElement.onload=scriptElementCallback;
  737. scriptElement.onreadystatechange=scriptElementCallback;
  738. window.setTimeout(failureCallback, 2000);
  739. head.appendChild(scriptElement)
  740. }
  741. }, _createScriptElement$p$0: function OSF_DDA_OutlookAppOm$_createScriptElement$p$0(url)
  742. {
  743. var scriptElement=document.createElement('script');
  744. scriptElement.type='text/javascript';
  745. scriptElement.src=url;
  746. return scriptElement
  747. }
  748. };
  749. OSF.DDA.Settings=function OSF_DDA_Settings(data)
  750. {
  751. this._rawData$p$0=data
  752. };
  753. OSF.DDA.Settings._convertFromRawSettings$p=function OSF_DDA_Settings$_convertFromRawSettings$p(rawSettings)
  754. {
  755. if (!rawSettings)
  756. {
  757. return {}
  758. }
  759. if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===8)
  760. {
  761. var outlookSettings=rawSettings['SettingsKey'];
  762. if (outlookSettings)
  763. {
  764. return OSF.DDA.SettingsManager.deserializeSettings(outlookSettings)
  765. }
  766. }
  767. return rawSettings
  768. };
  769. OSF.DDA.Settings.prototype={
  770. _rawData$p$0: null, _settingsData$p$0: null, get__data$p$0: function OSF_DDA_Settings$get__data$p$0()
  771. {
  772. if (!this._settingsData$p$0)
  773. {
  774. this._settingsData$p$0=OSF.DDA.Settings._convertFromRawSettings$p(this._rawData$p$0);
  775. this._rawData$p$0=null
  776. }
  777. return this._settingsData$p$0
  778. }, get: function OSF_DDA_Settings$get(name)
  779. {
  780. return this.get__data$p$0()[name]
  781. }, set: function OSF_DDA_Settings$set(name, value)
  782. {
  783. this.get__data$p$0()[name]=value
  784. }, remove: function OSF_DDA_Settings$remove(name)
  785. {
  786. delete this.get__data$p$0()[name]
  787. }, saveAsync: function OSF_DDA_Settings$saveAsync()
  788. {
  789. var args=[];
  790. for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  791. {
  792. args[$$pai_2]=arguments[$$pai_2]
  793. }
  794. var commonParameters=$h.CommonParameters.parse(args, false);
  795. if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64)
  796. {
  797. this._saveSettingsForOwa$p$0(commonParameters.get_callback(), commonParameters._asyncContext$p$0)
  798. }
  799. else
  800. {
  801. this._saveSettingsForOutlook$p$0(commonParameters.get_callback(), commonParameters._asyncContext$p$0)
  802. }
  803. }, _saveSettingsForOutlook$p$0: function OSF_DDA_Settings$_saveSettingsForOutlook$p$0(callback, userContext)
  804. {
  805. var storedException=null;
  806. try
  807. {
  808. var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0());
  809. var jsonSettings=JSON.stringify(serializedSettings);
  810. var settingsObjectToSave={SettingsKey: jsonSettings};
  811. OSF.DDA.RichClientSettingsManager.write(settingsObjectToSave)
  812. }
  813. catch(ex)
  814. {
  815. storedException=ex
  816. }
  817. if (callback)
  818. {
  819. var asyncResult;
  820. if (storedException)
  821. {
  822. asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null, 1, storedException.message, userContext)
  823. }
  824. else
  825. {
  826. asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null, 0, null, userContext)
  827. }
  828. callback(asyncResult)
  829. }
  830. }, _saveSettingsForOwa$p$0: function OSF_DDA_Settings$_saveSettingsForOwa$p$0(callback, userContext)
  831. {
  832. var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0());
  833. var $$t_7=this;
  834. OSF._OfficeAppFactory.getClientEndPoint().invoke('saveSettingsAsync', function(resultCode, response)
  835. {
  836. if (callback)
  837. {
  838. var asyncResult;
  839. if (resultCode)
  840. {
  841. asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode), userContext)
  842. }
  843. else
  844. {
  845. var responseDictionary=response;
  846. if (!(responseDictionary['error']))
  847. {
  848. asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null, 0, null, userContext)
  849. }
  850. else
  851. {
  852. asyncResult=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null, 1, responseDictionary['errorMessage'], userContext)
  853. }
  854. }
  855. callback(asyncResult)
  856. }
  857. }, [serializedSettings])
  858. }
  859. };
  860. Type.registerNamespace('$h');
  861. Type.registerNamespace('Office.cast');
  862. $h.Appointment=function $h_Appointment(dataDictionary)
  863. {
  864. this.$$d__getOrganizer$p$2=Function.createDelegate(this, this._getOrganizer$p$2);
  865. this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this, this._getNormalizedSubject$p$2);
  866. this.$$d__getSubject$p$2=Function.createDelegate(this, this._getSubject$p$2);
  867. this.$$d__getResources$p$2=Function.createDelegate(this, this._getResources$p$2);
  868. this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this, this._getRequiredAttendees$p$2);
  869. this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this, this._getOptionalAttendees$p$2);
  870. this.$$d__getLocation$p$2=Function.createDelegate(this, this._getLocation$p$2);
  871. this.$$d__getEnd$p$2=Function.createDelegate(this, this._getEnd$p$2);
  872. this.$$d__getStart$p$2=Function.createDelegate(this, this._getStart$p$2);
  873. $h.Appointment.initializeBase(this, [dataDictionary]);
  874. $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStart$p$2);
  875. $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEnd$p$2);
  876. $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$2);
  877. $h.InitialData._defineReadOnlyProperty$i(this, 'optionalAttendees', this.$$d__getOptionalAttendees$p$2);
  878. $h.InitialData._defineReadOnlyProperty$i(this, 'requiredAttendees', this.$$d__getRequiredAttendees$p$2);
  879. $h.InitialData._defineReadOnlyProperty$i(this, 'resources', this.$$d__getResources$p$2);
  880. $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$2);
  881. $h.InitialData._defineReadOnlyProperty$i(this, 'normalizedSubject', this.$$d__getNormalizedSubject$p$2);
  882. $h.InitialData._defineReadOnlyProperty$i(this, 'organizer', this.$$d__getOrganizer$p$2)
  883. };
  884. $h.Appointment.prototype={
  885. getEntities: function $h_Appointment$getEntities()
  886. {
  887. return this._data$p$0._getEntities$i$0()
  888. }, getEntitiesByType: function $h_Appointment$getEntitiesByType(entityType)
  889. {
  890. return this._data$p$0._getEntitiesByType$i$0(entityType)
  891. }, getRegExMatches: function $h_Appointment$getRegExMatches()
  892. {
  893. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'getRegExMatches');
  894. return this._data$p$0._getRegExMatches$i$0()
  895. }, getFilteredEntitiesByName: function $h_Appointment$getFilteredEntitiesByName(name)
  896. {
  897. return this._data$p$0._getFilteredEntitiesByName$i$0(name)
  898. }, getRegExMatchesByName: function $h_Appointment$getRegExMatchesByName(name)
  899. {
  900. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'getRegExMatchesByName');
  901. return this._data$p$0._getRegExMatchesByName$i$0(name)
  902. }, displayReplyForm: function $h_Appointment$displayReplyForm(htmlBody)
  903. {
  904. OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(htmlBody)
  905. }, displayReplyAllForm: function $h_Appointment$displayReplyAllForm(htmlBody)
  906. {
  907. OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(htmlBody)
  908. }, getItemType: function $h_Appointment$getItemType()
  909. {
  910. return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment
  911. }, _getStart$p$2: function $h_Appointment$_getStart$p$2()
  912. {
  913. return this._data$p$0.get__start$i$0()
  914. }, _getEnd$p$2: function $h_Appointment$_getEnd$p$2()
  915. {
  916. return this._data$p$0.get__end$i$0()
  917. }, _getLocation$p$2: function $h_Appointment$_getLocation$p$2()
  918. {
  919. return this._data$p$0.get__location$i$0()
  920. }, _getOptionalAttendees$p$2: function $h_Appointment$_getOptionalAttendees$p$2()
  921. {
  922. return this._data$p$0.get__cc$i$0()
  923. }, _getRequiredAttendees$p$2: function $h_Appointment$_getRequiredAttendees$p$2()
  924. {
  925. return this._data$p$0.get__to$i$0()
  926. }, _getResources$p$2: function $h_Appointment$_getResources$p$2()
  927. {
  928. return this._data$p$0.get__resources$i$0()
  929. }, _getSubject$p$2: function $h_Appointment$_getSubject$p$2()
  930. {
  931. return this._data$p$0.get__subject$i$0()
  932. }, _getNormalizedSubject$p$2: function $h_Appointment$_getNormalizedSubject$p$2()
  933. {
  934. return this._data$p$0.get__normalizedSubject$i$0()
  935. }, _getOrganizer$p$2: function $h_Appointment$_getOrganizer$p$2()
  936. {
  937. return this._data$p$0.get__organizer$i$0()
  938. }
  939. };
  940. $h.AppointmentCompose=function $h_AppointmentCompose(data)
  941. {
  942. this.$$d__getLocation$p$2=Function.createDelegate(this, this._getLocation$p$2);
  943. this.$$d__getEnd$p$2=Function.createDelegate(this, this._getEnd$p$2);
  944. this.$$d__getStart$p$2=Function.createDelegate(this, this._getStart$p$2);
  945. this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this, this._getOptionalAttendees$p$2);
  946. this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this, this._getRequiredAttendees$p$2);
  947. $h.AppointmentCompose.initializeBase(this, [data]);
  948. $h.InitialData._defineReadOnlyProperty$i(this, 'requiredAttendees', this.$$d__getRequiredAttendees$p$2);
  949. $h.InitialData._defineReadOnlyProperty$i(this, 'optionalAttendees', this.$$d__getOptionalAttendees$p$2);
  950. $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStart$p$2);
  951. $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEnd$p$2);
  952. $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$2)
  953. };
  954. $h.AppointmentCompose.prototype={
  955. _requiredAttendees$p$2: null, _optionalAttendees$p$2: null, _start$p$2: null, _end$p$2: null, _location$p$2: null, getItemType: function $h_AppointmentCompose$getItemType()
  956. {
  957. return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment
  958. }, _getRequiredAttendees$p$2: function $h_AppointmentCompose$_getRequiredAttendees$p$2()
  959. {
  960. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  961. if (!this._requiredAttendees$p$2)
  962. {
  963. this._requiredAttendees$p$2=new $h.ComposeRecipient(0, 'requiredAttendees')
  964. }
  965. return this._requiredAttendees$p$2
  966. }, _getOptionalAttendees$p$2: function $h_AppointmentCompose$_getOptionalAttendees$p$2()
  967. {
  968. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  969. if (!this._optionalAttendees$p$2)
  970. {
  971. this._optionalAttendees$p$2=new $h.ComposeRecipient(1, 'optionalAttendees')
  972. }
  973. return this._optionalAttendees$p$2
  974. }, _getStart$p$2: function $h_AppointmentCompose$_getStart$p$2()
  975. {
  976. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  977. if (!this._start$p$2)
  978. {
  979. this._start$p$2=new $h.ComposeTime(1)
  980. }
  981. return this._start$p$2
  982. }, _getEnd$p$2: function $h_AppointmentCompose$_getEnd$p$2()
  983. {
  984. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  985. if (!this._end$p$2)
  986. {
  987. this._end$p$2=new $h.ComposeTime(2)
  988. }
  989. return this._end$p$2
  990. }, _getLocation$p$2: function $h_AppointmentCompose$_getLocation$p$2()
  991. {
  992. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  993. if (!this._location$p$2)
  994. {
  995. this._location$p$2=new $h.ComposeLocation
  996. }
  997. return this._location$p$2
  998. }
  999. };
  1000. $h.AttachmentDetails=function $h_AttachmentDetails(data)
  1001. {
  1002. this.$$d__getIsInline$p$0=Function.createDelegate(this, this._getIsInline$p$0);
  1003. this.$$d__getAttachmentType$p$0=Function.createDelegate(this, this._getAttachmentType$p$0);
  1004. this.$$d__getSize$p$0=Function.createDelegate(this, this._getSize$p$0);
  1005. this.$$d__getContentType$p$0=Function.createDelegate(this, this._getContentType$p$0);
  1006. this.$$d__getName$p$0=Function.createDelegate(this, this._getName$p$0);
  1007. this.$$d__getId$p$0=Function.createDelegate(this, this._getId$p$0);
  1008. this._data$p$0=data;
  1009. $h.InitialData._defineReadOnlyProperty$i(this, 'id', this.$$d__getId$p$0);
  1010. $h.InitialData._defineReadOnlyProperty$i(this, 'name', this.$$d__getName$p$0);
  1011. $h.InitialData._defineReadOnlyProperty$i(this, 'contentType', this.$$d__getContentType$p$0);
  1012. $h.InitialData._defineReadOnlyProperty$i(this, 'size', this.$$d__getSize$p$0);
  1013. $h.InitialData._defineReadOnlyProperty$i(this, 'attachmentType', this.$$d__getAttachmentType$p$0);
  1014. $h.InitialData._defineReadOnlyProperty$i(this, 'isInline', this.$$d__getIsInline$p$0)
  1015. };
  1016. $h.AttachmentDetails.prototype={
  1017. _data$p$0: null, _getId$p$0: function $h_AttachmentDetails$_getId$p$0()
  1018. {
  1019. return this._data$p$0['id']
  1020. }, _getName$p$0: function $h_AttachmentDetails$_getName$p$0()
  1021. {
  1022. return this._data$p$0['name']
  1023. }, _getContentType$p$0: function $h_AttachmentDetails$_getContentType$p$0()
  1024. {
  1025. return this._data$p$0['contentType']
  1026. }, _getSize$p$0: function $h_AttachmentDetails$_getSize$p$0()
  1027. {
  1028. return this._data$p$0['size']
  1029. }, _getAttachmentType$p$0: function $h_AttachmentDetails$_getAttachmentType$p$0()
  1030. {
  1031. var response=this._data$p$0['attachmentType'];
  1032. return (response < $h.AttachmentDetails._attachmentTypeMap$p.length) ? $h.AttachmentDetails._attachmentTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File
  1033. }, _getIsInline$p$0: function $h_AttachmentDetails$_getIsInline$p$0()
  1034. {
  1035. return this._data$p$0['isInline']
  1036. }
  1037. };
  1038. $h.ComposeBody=function $h_ComposeBody(){};
  1039. $h.ComposeBody._createParameterDictionaryToHost$p=function $h_ComposeBody$_createParameterDictionaryToHost$p(data, parameters)
  1040. {
  1041. var dataToHost={data: data};
  1042. if (parameters._options$p$0 && parameters._options$p$0['coercionType'])
  1043. {
  1044. var hostCoercionType;
  1045. var $$t_4,
  1046. $$t_5;
  1047. if (!(($$t_5=$h.ComposeBody._tryMapToHostCoercionType$p(parameters._options$p$0['coercionType'], ($$t_4={val: hostCoercionType}))), hostCoercionType=$$t_4.val, $$t_5))
  1048. {
  1049. if (parameters.get_callback())
  1050. {
  1051. parameters.get_callback()(OSF.DDA.OutlookAppOm._instance$p.standardCreateAsyncResult(null, 1, 1000, parameters._asyncContext$p$0))
  1052. }
  1053. return null
  1054. }
  1055. dataToHost['coercionType']=hostCoercionType
  1056. }
  1057. else
  1058. {
  1059. dataToHost['coercionType']=0
  1060. }
  1061. return dataToHost
  1062. };
  1063. $h.ComposeBody._tryMapToHostCoercionType$p=function $h_ComposeBody$_tryMapToHostCoercionType$p(coercionType, hostCoercionType)
  1064. {
  1065. hostCoercionType.val=undefined;
  1066. if (coercionType===Microsoft.Office.WebExtension.CoercionType.Html)
  1067. {
  1068. hostCoercionType.val=3
  1069. }
  1070. else if (coercionType===Microsoft.Office.WebExtension.CoercionType.Text)
  1071. {
  1072. hostCoercionType.val=0
  1073. }
  1074. else
  1075. {
  1076. return false
  1077. }
  1078. return true
  1079. };
  1080. $h.ComposeBody.prototype={
  1081. getTypeAsync: function $h_ComposeBody$getTypeAsync()
  1082. {
  1083. var args=[];
  1084. for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  1085. {
  1086. args[$$pai_2]=arguments[$$pai_2]
  1087. }
  1088. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'body.getTypeAsync');
  1089. var parameters=$h.CommonParameters.parse(args, true);
  1090. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(14, 'GetBodyTypeAsync', null, null, parameters._asyncContext$p$0, parameters.get_callback())
  1091. }, setSelectedDataAsync: function $h_ComposeBody$setSelectedDataAsync(data)
  1092. {
  1093. var args=[];
  1094. for (var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4)
  1095. {
  1096. args[$$pai_4 - 1]=arguments[$$pai_4]
  1097. }
  1098. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'body.setSelectedDataAsync');
  1099. var parameters=$h.CommonParameters.parse(args, false);
  1100. if (!(String.isInstanceOfType(data)))
  1101. {
  1102. throw Error.argumentType('data', Object.getType(data), String);
  1103. }
  1104. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length, 0, 1000000, 'data');
  1105. var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$p(data, parameters);
  1106. if (!dataToHost)
  1107. {
  1108. return
  1109. }
  1110. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(13, 'BodySetSelectedDataAsync', dataToHost, null, parameters._asyncContext$p$0, parameters.get_callback())
  1111. }, prependAsync: function $h_ComposeBody$prependAsync(data)
  1112. {
  1113. var args=[];
  1114. for (var $$pai_4=1; $$pai_4 < arguments.length;++$$pai_4)
  1115. {
  1116. args[$$pai_4 - 1]=arguments[$$pai_4]
  1117. }
  1118. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'body.prependAsync');
  1119. var parameters=$h.CommonParameters.parse(args, false);
  1120. if (!(String.isInstanceOfType(data)))
  1121. {
  1122. throw Error.argumentType('data', Object.getType(data), String);
  1123. }
  1124. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length, 0, 1000000, 'data');
  1125. var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$p(data, parameters);
  1126. if (!dataToHost)
  1127. {
  1128. return
  1129. }
  1130. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(23, 'BodyPrependAsync', dataToHost, null, parameters._asyncContext$p$0, parameters.get_callback())
  1131. }
  1132. };
  1133. $h.ComposeItem=function $h_ComposeItem(data)
  1134. {
  1135. this.$$d__getBody$p$1=Function.createDelegate(this, this._getBody$p$1);
  1136. this.$$d__getSubject$p$1=Function.createDelegate(this, this._getSubject$p$1);
  1137. $h.ComposeItem.initializeBase(this, [data]);
  1138. $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$1);
  1139. $h.InitialData._defineReadOnlyProperty$i(this, 'body', this.$$d__getBody$p$1)
  1140. };
  1141. $h.ComposeItem.prototype={
  1142. _subject$p$1: null, _body$p$1: null, addFileAttachmentAsync: function $h_ComposeItem$addFileAttachmentAsync(uri, attachmentName)
  1143. {
  1144. var args=[];
  1145. for (var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5)
  1146. {
  1147. args[$$pai_5 - 2]=arguments[$$pai_5]
  1148. }
  1149. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'addFileAttachmentAsync');
  1150. if (!$h.ScriptHelpers.isNonEmptyString(uri))
  1151. {
  1152. throw Error.argument('uri');
  1153. }
  1154. if (!$h.ScriptHelpers.isNonEmptyString(attachmentName))
  1155. {
  1156. throw Error.argument('attachmentName');
  1157. }
  1158. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(uri.length, 0, 2048, 'uri');
  1159. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentName.length, 0, 255, 'attachmentName');
  1160. var commonParameters=$h.CommonParameters.parse(args, false);
  1161. var parameters={
  1162. uri: uri, name: attachmentName, __timeout__: 600000
  1163. };
  1164. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(16, 'AddFileAttachmentAsync', parameters, null, commonParameters._asyncContext$p$0, commonParameters.get_callback())
  1165. }, addItemAttachmentAsync: function $h_ComposeItem$addItemAttachmentAsync(itemId, attachmentName)
  1166. {
  1167. var args=[];
  1168. for (var $$pai_5=2; $$pai_5 < arguments.length;++$$pai_5)
  1169. {
  1170. args[$$pai_5 - 2]=arguments[$$pai_5]
  1171. }
  1172. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'addItemAttachmentAsync');
  1173. if (!$h.ScriptHelpers.isNonEmptyString(itemId))
  1174. {
  1175. throw Error.argument('itemId');
  1176. }
  1177. if (!$h.ScriptHelpers.isNonEmptyString(attachmentName))
  1178. {
  1179. throw Error.argument('attachmentName');
  1180. }
  1181. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(itemId.length, 0, 200, 'itemId');
  1182. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentName.length, 0, 255, 'attachmentName');
  1183. var commonParameters=$h.CommonParameters.parse(args, false);
  1184. var parameters={
  1185. itemId: itemId, name: attachmentName, __timeout__: 600000
  1186. };
  1187. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(19, 'AddItemAttachmentAsync', parameters, null, commonParameters._asyncContext$p$0, commonParameters.get_callback())
  1188. }, removeAttachmentAsync: function $h_ComposeItem$removeAttachmentAsync(attachmentId)
  1189. {
  1190. var args=[];
  1191. for (var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3)
  1192. {
  1193. args[$$pai_3 - 1]=arguments[$$pai_3]
  1194. }
  1195. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'removeAttachmentAsync');
  1196. if (!$h.ScriptHelpers.isNonEmptyString(attachmentId))
  1197. {
  1198. throw Error.argument('attachmentId');
  1199. }
  1200. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(attachmentId.length, 0, 200, 'attachmentId');
  1201. var commonParameters=$h.CommonParameters.parse(args, false);
  1202. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(20, 'RemoveAttachmentAsync', {attachmentIndex: attachmentId}, null, commonParameters._asyncContext$p$0, commonParameters.get_callback())
  1203. }, _getBody$p$1: function $h_ComposeItem$_getBody$p$1()
  1204. {
  1205. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  1206. if (!this._body$p$1)
  1207. {
  1208. this._body$p$1=new $h.ComposeBody
  1209. }
  1210. return this._body$p$1
  1211. }, _getSubject$p$1: function $h_ComposeItem$_getSubject$p$1()
  1212. {
  1213. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  1214. if (!this._subject$p$1)
  1215. {
  1216. this._subject$p$1=new $h.ComposeSubject
  1217. }
  1218. return this._subject$p$1
  1219. }
  1220. };
  1221. $h.ComposeRecipient=function $h_ComposeRecipient(type, propertyName)
  1222. {
  1223. this._type$p$0=type;
  1224. this._propertyName$p$0=propertyName
  1225. };
  1226. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p=function $h_ComposeRecipient$_throwOnInvalidDisplayNameOrEmail$p(displayName, emailAddress)
  1227. {
  1228. if (!displayName && !emailAddress)
  1229. {
  1230. throw Error.argument('recipients');
  1231. }
  1232. if (displayName && displayName.length > 255)
  1233. {
  1234. throw Error.argumentOutOfRange('recipients', displayName.length, _u.ExtensibilityStrings.l_DisplayNameTooLong_Text);
  1235. }
  1236. if (emailAddress && emailAddress.length > 571)
  1237. {
  1238. throw Error.argumentOutOfRange('recipients', emailAddress.length, _u.ExtensibilityStrings.l_EmailAddressTooLong_Text);
  1239. }
  1240. };
  1241. $h.ComposeRecipient._getAsyncFormatter$p=function $h_ComposeRecipient$_getAsyncFormatter$p(rawInput)
  1242. {
  1243. var input=rawInput;
  1244. var output=[];
  1245. for (var i=0; i < input.length; i++)
  1246. {
  1247. var email=new $h.EmailAddressDetails(input[i]);
  1248. output[i]=email
  1249. }
  1250. return output
  1251. };
  1252. $h.ComposeRecipient._createEmailDictionaryForHost$p=function $h_ComposeRecipient$_createEmailDictionaryForHost$p(address, name)
  1253. {
  1254. return {
  1255. address: address, name: name
  1256. }
  1257. };
  1258. $h.ComposeRecipient.prototype={
  1259. _propertyName$p$0: null, _type$p$0: 0, getAsync: function $h_ComposeRecipient$getAsync()
  1260. {
  1261. var args=[];
  1262. for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  1263. {
  1264. args[$$pai_2]=arguments[$$pai_2]
  1265. }
  1266. var parameters=$h.CommonParameters.parse(args, true);
  1267. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, this._propertyName$p$0+'.getAsync');
  1268. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(15, 'GetRecipientsAsync', {recipientField: this._type$p$0}, $h.ComposeRecipient._getAsyncFormatter$p, parameters._asyncContext$p$0, parameters.get_callback())
  1269. }, setAsync: function $h_ComposeRecipient$setAsync(recipients)
  1270. {
  1271. var args=[];
  1272. for (var $$pai_2=1; $$pai_2 < arguments.length;++$$pai_2)
  1273. {
  1274. args[$$pai_2 - 1]=arguments[$$pai_2]
  1275. }
  1276. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, this._propertyName$p$0+'.setAsync');
  1277. this.setAddHelper(recipients, args, true)
  1278. }, addAsync: function $h_ComposeRecipient$addAsync(recipients)
  1279. {
  1280. var args=[];
  1281. for (var $$pai_2=1; $$pai_2 < arguments.length;++$$pai_2)
  1282. {
  1283. args[$$pai_2 - 1]=arguments[$$pai_2]
  1284. }
  1285. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, this._propertyName$p$0+'.addAsync');
  1286. this.setAddHelper(recipients, args, false)
  1287. }, setAddHelper: function $h_ComposeRecipient$setAddHelper(recipients, args, isSet)
  1288. {
  1289. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(recipients.length, 0, 100, 'recipients');
  1290. var parameters=$h.CommonParameters.parse(args, false);
  1291. var recipientData=[];
  1292. if (Array.isInstanceOfType(recipients))
  1293. {
  1294. for (var i=0; i < recipients.length; i++)
  1295. {
  1296. if (String.isInstanceOfType(recipients[i]))
  1297. {
  1298. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(recipients[i], recipients[i]);
  1299. recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(recipients[i], recipients[i])
  1300. }
  1301. else if ($h.EmailAddressDetails.isInstanceOfType(recipients[i]))
  1302. {
  1303. var address=recipients[i];
  1304. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(address.displayName, address.emailAddress);
  1305. recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(address.emailAddress, address.displayName)
  1306. }
  1307. else if (Object.isInstanceOfType(recipients[i]))
  1308. {
  1309. var input=recipients[i];
  1310. var emailAddress=input['emailAddress'];
  1311. var displayName=input['displayName'];
  1312. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(displayName, emailAddress);
  1313. recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(emailAddress, displayName)
  1314. }
  1315. else
  1316. {
  1317. throw Error.argument('recipients');
  1318. }
  1319. }
  1320. }
  1321. else
  1322. {
  1323. throw Error.argument('recipients');
  1324. }
  1325. var $$t_B=this;
  1326. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0((isSet) ? 21 : 22, (isSet) ? 'SetRecipientsAsync' : 'AddRecipientsAsync', {
  1327. recipientField: this._type$p$0, recipientArray: recipientData
  1328. }, function(rawInput)
  1329. {
  1330. return rawInput
  1331. }, parameters._asyncContext$p$0, parameters.get_callback())
  1332. }
  1333. };
  1334. $h.ComposeRecipient.RecipientField=function(){};
  1335. $h.ComposeRecipient.RecipientField.prototype={
  1336. to: 0, cc: 1, bcc: 2, requiredAttendees: 0, optionalAttendees: 1
  1337. };
  1338. $h.ComposeRecipient.RecipientField.registerEnum('$h.ComposeRecipient.RecipientField', false);
  1339. $h.ComposeLocation=function $h_ComposeLocation(){};
  1340. $h.ComposeLocation.prototype={
  1341. getAsync: function $h_ComposeLocation$getAsync()
  1342. {
  1343. var args=[];
  1344. for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  1345. {
  1346. args[$$pai_2]=arguments[$$pai_2]
  1347. }
  1348. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'location.getAsync');
  1349. var parameters=$h.CommonParameters.parse(args, true);
  1350. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(26, 'GetLocationAsync', null, null, parameters._asyncContext$p$0, parameters.get_callback())
  1351. }, setAsync: function $h_ComposeLocation$setAsync(location)
  1352. {
  1353. var args=[];
  1354. for (var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3)
  1355. {
  1356. args[$$pai_3 - 1]=arguments[$$pai_3]
  1357. }
  1358. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'location.setAsync');
  1359. var parameters=$h.CommonParameters.parse(args, false);
  1360. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(location.length, 0, 255, 'location');
  1361. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(27, 'SetLocationAsync', {location: location}, null, parameters._asyncContext$p$0, parameters.get_callback())
  1362. }
  1363. };
  1364. $h.ComposeSubject=function $h_ComposeSubject(){};
  1365. $h.ComposeSubject.prototype={
  1366. getAsync: function $h_ComposeSubject$getAsync()
  1367. {
  1368. var args=[];
  1369. for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  1370. {
  1371. args[$$pai_2]=arguments[$$pai_2]
  1372. }
  1373. var parameters=$h.CommonParameters.parse(args, true);
  1374. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'subject.getAsync');
  1375. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(18, 'GetSubjectAsync', null, null, parameters._asyncContext$p$0, parameters.get_callback())
  1376. }, setAsync: function $h_ComposeSubject$setAsync(data)
  1377. {
  1378. var args=[];
  1379. for (var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3)
  1380. {
  1381. args[$$pai_3 - 1]=arguments[$$pai_3]
  1382. }
  1383. var parameters=$h.CommonParameters.parse(args, false);
  1384. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, 'subject.setAsync');
  1385. if (!(String.isInstanceOfType(data)))
  1386. {
  1387. throw Error.argument('data');
  1388. }
  1389. OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(data.length, 0, 255, 'data');
  1390. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(17, 'SetSubjectAsync', {subject: data}, null, parameters._asyncContext$p$0, parameters.get_callback())
  1391. }
  1392. };
  1393. $h.ComposeTime=function $h_ComposeTime(type)
  1394. {
  1395. this.$$d__ticksToDateFormatter$p$0=Function.createDelegate(this, this._ticksToDateFormatter$p$0);
  1396. this._timeType$p$0=type
  1397. };
  1398. $h.ComposeTime.prototype={
  1399. _timeType$p$0: 0, getAsync: function $h_ComposeTime$getAsync()
  1400. {
  1401. var args=[];
  1402. for (var $$pai_2=0; $$pai_2 < arguments.length;++$$pai_2)
  1403. {
  1404. args[$$pai_2]=arguments[$$pai_2]
  1405. }
  1406. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, this._getPropertyName$p$0()+'.getAsync');
  1407. var parameters=$h.CommonParameters.parse(args, true);
  1408. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(24, 'GetTimeAsync', {TimeProperty: this._timeType$p$0}, this.$$d__ticksToDateFormatter$p$0, parameters._asyncContext$p$0, parameters.get_callback())
  1409. }, setAsync: function $h_ComposeTime$setAsync(dateTime)
  1410. {
  1411. var args=[];
  1412. for (var $$pai_3=1; $$pai_3 < arguments.length;++$$pai_3)
  1413. {
  1414. args[$$pai_3 - 1]=arguments[$$pai_3]
  1415. }
  1416. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2, this._getPropertyName$p$0()+'.setAsync');
  1417. if (!(Date.isInstanceOfType(dateTime)))
  1418. {
  1419. throw Error.argumentType('dateTime', Object.getType(dateTime), Date);
  1420. }
  1421. var parameters=$h.CommonParameters.parse(args, false);
  1422. OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(25, 'SetTimeAsync', {
  1423. TimeProperty: this._timeType$p$0, time: dateTime.getTime()
  1424. }, null, parameters._asyncContext$p$0, parameters.get_callback())
  1425. }, _ticksToDateFormatter$p$0: function $h_ComposeTime$_ticksToDateFormatter$p$0(rawInput)
  1426. {
  1427. var ticks=rawInput;
  1428. return new Date(ticks)
  1429. }, _getPropertyName$p$0: function $h_ComposeTime$_getPropertyName$p$0()
  1430. {
  1431. return (this._timeType$p$0===1) ? 'start' : 'end'
  1432. }
  1433. };
  1434. $h.ComposeTime.TimeType=function(){};
  1435. $h.ComposeTime.TimeType.prototype={
  1436. start: 1, end: 2
  1437. };
  1438. $h.ComposeTime.TimeType.registerEnum('$h.ComposeTime.TimeType', false);
  1439. $h.Contact=function $h_Contact(data)
  1440. {
  1441. this.$$d__getContactString$p$0=Function.createDelegate(this, this._getContactString$p$0);
  1442. this.$$d__getAddresses$p$0=Function.createDelegate(this, this._getAddresses$p$0);
  1443. this.$$d__getUrls$p$0=Function.createDelegate(this, this._getUrls$p$0);
  1444. this.$$d__getEmailAddresses$p$0=Function.createDelegate(this, this._getEmailAddresses$p$0);
  1445. this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this, this._getPhoneNumbers$p$0);
  1446. this.$$d__getBusinessName$p$0=Function.createDelegate(this, this._getBusinessName$p$0);
  1447. this.$$d__getPersonName$p$0=Function.createDelegate(this, this._getPersonName$p$0);
  1448. this._data$p$0=data;
  1449. $h.InitialData._defineReadOnlyProperty$i(this, 'personName', this.$$d__getPersonName$p$0);
  1450. $h.InitialData._defineReadOnlyProperty$i(this, 'businessName', this.$$d__getBusinessName$p$0);
  1451. $h.InitialData._defineReadOnlyProperty$i(this, 'phoneNumbers', this.$$d__getPhoneNumbers$p$0);
  1452. $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddresses', this.$$d__getEmailAddresses$p$0);
  1453. $h.InitialData._defineReadOnlyProperty$i(this, 'urls', this.$$d__getUrls$p$0);
  1454. $h.InitialData._defineReadOnlyProperty$i(this, 'addresses', this.$$d__getAddresses$p$0);
  1455. $h.InitialData._defineReadOnlyProperty$i(this, 'contactString', this.$$d__getContactString$p$0)
  1456. };
  1457. $h.Contact.prototype={
  1458. _data$p$0: null, _phoneNumbers$p$0: null, _getPersonName$p$0: function $h_Contact$_getPersonName$p$0()
  1459. {
  1460. return this._data$p$0['PersonName']
  1461. }, _getBusinessName$p$0: function $h_Contact$_getBusinessName$p$0()
  1462. {
  1463. return this._data$p$0['BusinessName']
  1464. }, _getAddresses$p$0: function $h_Contact$_getAddresses$p$0()
  1465. {
  1466. return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Addresses')
  1467. }, _getEmailAddresses$p$0: function $h_Contact$_getEmailAddresses$p$0()
  1468. {
  1469. return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'EmailAddresses')
  1470. }, _getUrls$p$0: function $h_Contact$_getUrls$p$0()
  1471. {
  1472. return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Urls')
  1473. }, _getPhoneNumbers$p$0: function $h_Contact$_getPhoneNumbers$p$0()
  1474. {
  1475. if (!this._phoneNumbers$p$0)
  1476. {
  1477. var $$t_1=this;
  1478. this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber, this._data$p$0, 'PhoneNumbers', function(data)
  1479. {
  1480. return new $h.PhoneNumber(data)
  1481. })
  1482. }
  1483. return this._phoneNumbers$p$0
  1484. }, _getContactString$p$0: function $h_Contact$_getContactString$p$0()
  1485. {
  1486. return this._data$p$0['ContactString']
  1487. }
  1488. };
  1489. $h.CustomProperties=function $h_CustomProperties(data)
  1490. {
  1491. if ($h.ScriptHelpers.isNullOrUndefined(data))
  1492. {
  1493. throw Error.argumentNull('data');
  1494. }
  1495. if (Array.isInstanceOfType(data))
  1496. {
  1497. var customPropertiesArray=data;
  1498. if (customPropertiesArray.length > 0)
  1499. {
  1500. this._data$p$0=customPropertiesArray[0]
  1501. }
  1502. else
  1503. {
  1504. throw Error.argument('data');
  1505. }
  1506. }
  1507. else
  1508. {
  1509. this._data$p$0=data
  1510. }
  1511. };
  1512. $h.CustomProperties.prototype={
  1513. _data$p$0: null, get: function $h_CustomProperties$get(name)
  1514. {
  1515. var value=this._data$p$0[name];
  1516. if (typeof(value)==='string')
  1517. {
  1518. var valueString=value;
  1519. if (valueString.length > 6 && valueString.startsWith('Date(') && valueString.endsWith(')'))
  1520. {
  1521. var ticksString=valueString.substring(5, valueString.length - 1);
  1522. var ticks=parseInt(ticksString);
  1523. if (!isNaN(ticks))
  1524. {
  1525. var dateTimeValue=new Date(ticks);
  1526. if (dateTimeValue)
  1527. {
  1528. value=dateTimeValue
  1529. }
  1530. }
  1531. }
  1532. }
  1533. return value
  1534. }, set: function $h_CustomProperties$set(name, value)
  1535. {
  1536. if (OSF.OUtil.isDate(value))
  1537. {
  1538. value='Date('+(value).getTime()+')'
  1539. }
  1540. this._data$p$0[name]=value
  1541. }, remove: function $h_CustomProperties$remove(name)
  1542. {
  1543. delete this._data$p$0[name]
  1544. }, saveAsync: function $h_CustomProperties$saveAsync()
  1545. {
  1546. var args=[];
  1547. for (var $$pai_4=0; $$pai_4 < arguments.length;++$$pai_4)
  1548. {
  1549. args[$$pai_4]=arguments[$$pai_4]
  1550. }
  1551. var MaxCustomPropertiesLength=2500;
  1552. if (JSON.stringify(this._data$p$0).length > MaxCustomPropertiesLength)
  1553. {
  1554. throw Error.argument();
  1555. }
  1556. var parameters=$h.CommonParameters.parse(args, false, true);
  1557. var saveCustomProperties=new $h._saveDictionaryRequest(parameters.get_callback(), parameters._asyncContext$p$0);
  1558. saveCustomProperties._sendRequest$i$0(4, 'SaveCustomProperties', {customProperties: this._data$p$0})
  1559. }
  1560. };
  1561. $h.Diagnostics=function $h_Diagnostics(data, appName)
  1562. {
  1563. this.$$d__getOwaView$p$0=Function.createDelegate(this, this._getOwaView$p$0);
  1564. this.$$d__getHostVersion$p$0=Function.createDelegate(this, this._getHostVersion$p$0);
  1565. this.$$d__getHostName$p$0=Function.createDelegate(this, this._getHostName$p$0);
  1566. this._data$p$0=data;
  1567. this._appName$p$0=appName;
  1568. $h.InitialData._defineReadOnlyProperty$i(this, 'hostName', this.$$d__getHostName$p$0);
  1569. $h.InitialData._defineReadOnlyProperty$i(this, 'hostVersion', this.$$d__getHostVersion$p$0);
  1570. if (64===this._appName$p$0)
  1571. {
  1572. $h.InitialData._defineReadOnlyProperty$i(this, 'OWAView', this.$$d__getOwaView$p$0)
  1573. }
  1574. };
  1575. $h.Diagnostics.prototype={
  1576. _data$p$0: null, _appName$p$0: 0, _getHostName$p$0: function $h_Diagnostics$_getHostName$p$0()
  1577. {
  1578. if (8===this._appName$p$0)
  1579. {
  1580. return 'Outlook'
  1581. }
  1582. else if (64===this._appName$p$0)
  1583. {
  1584. return 'OutlookWebApp'
  1585. }
  1586. return null
  1587. }, _getHostVersion$p$0: function $h_Diagnostics$_getHostVersion$p$0()
  1588. {
  1589. return this._data$p$0.get__hostVersion$i$0()
  1590. }, _getOwaView$p$0: function $h_Diagnostics$_getOwaView$p$0()
  1591. {
  1592. return this._data$p$0.get__owaView$i$0()
  1593. }
  1594. };
  1595. $h.EmailAddressDetails=function $h_EmailAddressDetails(data)
  1596. {
  1597. this.$$d__getRecipientType$p$0=Function.createDelegate(this, this._getRecipientType$p$0);
  1598. this.$$d__getAppointmentResponse$p$0=Function.createDelegate(this, this._getAppointmentResponse$p$0);
  1599. this.$$d__getDisplayName$p$0=Function.createDelegate(this, this._getDisplayName$p$0);
  1600. this.$$d__getEmailAddress$p$0=Function.createDelegate(this, this._getEmailAddress$p$0);
  1601. this._data$p$0=data;
  1602. $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddress', this.$$d__getEmailAddress$p$0);
  1603. $h.InitialData._defineReadOnlyProperty$i(this, 'displayName', this.$$d__getDisplayName$p$0);
  1604. if ($h.ScriptHelpers.dictionaryContainsKey(data, 'appointmentResponse'))
  1605. {
  1606. $h.InitialData._defineReadOnlyProperty$i(this, 'appointmentResponse', this.$$d__getAppointmentResponse$p$0)
  1607. }
  1608. if ($h.ScriptHelpers.dictionaryContainsKey(data, 'recipientType'))
  1609. {
  1610. $h.InitialData._defineReadOnlyProperty$i(this, 'recipientType', this.$$d__getRecipientType$p$0)
  1611. }
  1612. };
  1613. $h.EmailAddressDetails._createFromEmailUserDictionary$i=function $h_EmailAddressDetails$_createFromEmailUserDictionary$i(data)
  1614. {
  1615. var emailAddressDetailsDictionary={};
  1616. var displayName=data['Name'];
  1617. var emailAddress=data['UserId'];
  1618. emailAddressDetailsDictionary['name']=displayName || $h.EmailAddressDetails._emptyString$p;
  1619. emailAddressDetailsDictionary['address']=emailAddress || $h.EmailAddressDetails._emptyString$p;
  1620. return new $h.EmailAddressDetails(emailAddressDetailsDictionary)
  1621. };
  1622. $h.EmailAddressDetails.prototype={
  1623. _data$p$0: null, toJSON: function $h_EmailAddressDetails$toJSON()
  1624. {
  1625. var result={};
  1626. result['emailAddress']=this._getEmailAddress$p$0();
  1627. result['displayName']=this._getDisplayName$p$0();
  1628. if ($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0, 'appointmentResponse'))
  1629. {
  1630. result['appointmentResponse']=this._getAppointmentResponse$p$0()
  1631. }
  1632. if ($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0, 'recipientType'))
  1633. {
  1634. result['recipientType']=this._getRecipientType$p$0()
  1635. }
  1636. return result
  1637. }, _getEmailAddress$p$0: function $h_EmailAddressDetails$_getEmailAddress$p$0()
  1638. {
  1639. return this._data$p$0['address']
  1640. }, _getDisplayName$p$0: function $h_EmailAddressDetails$_getDisplayName$p$0()
  1641. {
  1642. return this._data$p$0['name']
  1643. }, _getAppointmentResponse$p$0: function $h_EmailAddressDetails$_getAppointmentResponse$p$0()
  1644. {
  1645. var response=this._data$p$0['appointmentResponse'];
  1646. return (response < $h.EmailAddressDetails._responseTypeMap$p.length) ? $h.EmailAddressDetails._responseTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None
  1647. }, _getRecipientType$p$0: function $h_EmailAddressDetails$_getRecipientType$p$0()
  1648. {
  1649. var response=this._data$p$0['recipientType'];
  1650. return (response < $h.EmailAddressDetails._recipientTypeMap$p.length) ? $h.EmailAddressDetails._recipientTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other
  1651. }
  1652. };
  1653. $h.Entities=function $h_Entities(data, filteredEntitiesData, timeSent, permissionLevel)
  1654. {
  1655. this.$$d__createMeetingSuggestion$p$0=Function.createDelegate(this, this._createMeetingSuggestion$p$0);
  1656. this.$$d__getContacts$p$0=Function.createDelegate(this, this._getContacts$p$0);
  1657. this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this, this._getPhoneNumbers$p$0);
  1658. this.$$d__getUrls$p$0=Function.createDelegate(this, this._getUrls$p$0);
  1659. this.$$d__getEmailAddresses$p$0=Function.createDelegate(this, this._getEmailAddresses$p$0);
  1660. this.$$d__getMeetingSuggestions$p$0=Function.createDelegate(this, this._getMeetingSuggestions$p$0);
  1661. this.$$d__getTaskSuggestions$p$0=Function.createDelegate(this, this._getTaskSuggestions$p$0);
  1662. this.$$d__getAddresses$p$0=Function.createDelegate(this, this._getAddresses$p$0);
  1663. this._data$p$0=data || {};
  1664. this._filteredData$p$0=filteredEntitiesData || {};
  1665. this._dateTimeSent$p$0=timeSent;
  1666. $h.InitialData._defineReadOnlyProperty$i(this, 'addresses', this.$$d__getAddresses$p$0);
  1667. $h.InitialData._defineReadOnlyProperty$i(this, 'taskSuggestions', this.$$d__getTaskSuggestions$p$0);
  1668. $h.InitialData._defineReadOnlyProperty$i(this, 'meetingSuggestions', this.$$d__getMeetingSuggestions$p$0);
  1669. $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddresses', this.$$d__getEmailAddresses$p$0);
  1670. $h.InitialData._defineReadOnlyProperty$i(this, 'urls', this.$$d__getUrls$p$0);
  1671. $h.InitialData._defineReadOnlyProperty$i(this, 'phoneNumbers', this.$$d__getPhoneNumbers$p$0);
  1672. $h.InitialData._defineReadOnlyProperty$i(this, 'contacts', this.$$d__getContacts$p$0);
  1673. this._permissionLevel$p$0=permissionLevel
  1674. };
  1675. $h.Entities._getExtractedObjects$i=function $h_Entities$_getExtractedObjects$i(T, data, name, creator, removeDuplicates, stringPropertyName)
  1676. {
  1677. var results=null;
  1678. var extractedObjects=data[name];
  1679. if (!extractedObjects)
  1680. {
  1681. return new Array(0)
  1682. }
  1683. if (removeDuplicates)
  1684. {
  1685. extractedObjects=$h.Entities._removeDuplicate$p(Object, extractedObjects, $h.Entities._entityDictionaryEquals$p, stringPropertyName)
  1686. }
  1687. results=new Array(extractedObjects.length);
  1688. var count=0;
  1689. for (var $$arr_9=extractedObjects, $$len_A=$$arr_9.length, $$idx_B=0; $$idx_B < $$len_A;++$$idx_B)
  1690. {
  1691. var extractedObject=$$arr_9[$$idx_B];
  1692. results[count++]=creator(extractedObject)
  1693. }
  1694. return results
  1695. };
  1696. $h.Entities._getExtractedStringProperty$i=function $h_Entities$_getExtractedStringProperty$i(data, name, removeDuplicate)
  1697. {
  1698. var extractedProperties=data[name];
  1699. if (!extractedProperties)
  1700. {
  1701. return new Array(0)
  1702. }
  1703. if (removeDuplicate)
  1704. {
  1705. extractedProperties=$h.Entities._removeDuplicate$p(String, extractedProperties, $h.Entities._stringEquals$p, null)
  1706. }
  1707. return extractedProperties
  1708. };
  1709. $h.Entities._createContact$p=function $h_Entities$_createContact$p(data)
  1710. {
  1711. return new $h.Contact(data)
  1712. };
  1713. $h.Entities._createTaskSuggestion$p=function $h_Entities$_createTaskSuggestion$p(data)
  1714. {
  1715. return new $h.TaskSuggestion(data)
  1716. };
  1717. $h.Entities._createPhoneNumber$p=function $h_Entities$_createPhoneNumber$p(data)
  1718. {
  1719. return new $h.PhoneNumber(data)
  1720. };
  1721. $h.Entities._entityDictionaryEquals$p=function $h_Entities$_entityDictionaryEquals$p(dictionary1, dictionary2, entityPropertyIdentifier)
  1722. {
  1723. if (dictionary1===dictionary2)
  1724. {
  1725. return true
  1726. }
  1727. if (!dictionary1 || !dictionary2)
  1728. {
  1729. return false
  1730. }
  1731. if (dictionary1[entityPropertyIdentifier]===dictionary2[entityPropertyIdentifier])
  1732. {
  1733. return true
  1734. }
  1735. return false
  1736. };
  1737. $h.Entities._stringEquals$p=function $h_Entities$_stringEquals$p(string1, string2, entityProperty)
  1738. {
  1739. return string1===string2
  1740. };
  1741. $h.Entities._removeDuplicate$p=function $h_Entities$_removeDuplicate$p(T, array, entityEquals, entityPropertyIdentifier)
  1742. {
  1743. for (var matchIndex1=array.length - 1; matchIndex1 >=0; matchIndex1--)
  1744. {
  1745. var removeMatch=false;
  1746. for (var matchIndex2=matchIndex1 - 1; matchIndex2 >=0; matchIndex2--)
  1747. {
  1748. if (entityEquals(array[matchIndex1], array[matchIndex2], entityPropertyIdentifier))
  1749. {
  1750. removeMatch=true;
  1751. break
  1752. }
  1753. }
  1754. if (removeMatch)
  1755. {
  1756. Array.removeAt(array, matchIndex1)
  1757. }
  1758. }
  1759. return array
  1760. };
  1761. $h.Entities.prototype={
  1762. _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 $h_Entities$_getByType$i$0(entityType)
  1763. {
  1764. if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion)
  1765. {
  1766. return this._getMeetingSuggestions$p$0()
  1767. }
  1768. else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion)
  1769. {
  1770. return this._getTaskSuggestions$p$0()
  1771. }
  1772. else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address)
  1773. {
  1774. return this._getAddresses$p$0()
  1775. }
  1776. else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber)
  1777. {
  1778. return this._getPhoneNumbers$p$0()
  1779. }
  1780. else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress)
  1781. {
  1782. return this._getEmailAddresses$p$0()
  1783. }
  1784. else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url)
  1785. {
  1786. return this._getUrls$p$0()
  1787. }
  1788. else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact)
  1789. {
  1790. return this._getContacts$p$0()
  1791. }
  1792. return null
  1793. }, _getFilteredEntitiesByName$i$0: function $h_Entities$_getFilteredEntitiesByName$i$0(name)
  1794. {
  1795. if (!this._filteredEntitiesCache$p$0)
  1796. {
  1797. this._filteredEntitiesCache$p$0={}
  1798. }
  1799. if (!$h.ScriptHelpers.dictionaryContainsKey(this._filteredEntitiesCache$p$0, name))
  1800. {
  1801. var found=false;
  1802. for (var i=0; i < $h.Entities._allEntityKeys$p.length; i++)
  1803. {
  1804. var entityTypeKey=$h.Entities._allEntityKeys$p[i];
  1805. var perEntityTypeDictionary=this._filteredData$p$0[entityTypeKey];
  1806. if (!perEntityTypeDictionary)
  1807. {
  1808. continue
  1809. }
  1810. if ($h.ScriptHelpers.dictionaryContainsKey(perEntityTypeDictionary, name))
  1811. {
  1812. switch (entityTypeKey)
  1813. {
  1814. case'EmailAddresses':
  1815. case'Urls':
  1816. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary, name);
  1817. break;
  1818. case'Addresses':
  1819. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary, name, true);
  1820. break;
  1821. case'PhoneNumbers':
  1822. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.PhoneNumber, perEntityTypeDictionary, name, $h.Entities._createPhoneNumber$p, false, null);
  1823. break;
  1824. case'TaskSuggestions':
  1825. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.TaskSuggestion, perEntityTypeDictionary, name, $h.Entities._createTaskSuggestion$p, true, 'TaskString');
  1826. break;
  1827. case'MeetingSuggestions':
  1828. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion, perEntityTypeDictionary, name, this.$$d__createMeetingSuggestion$p$0, true, 'MeetingString');
  1829. break;
  1830. case'Contacts':
  1831. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.Contact, perEntityTypeDictionary, name, $h.Entities._createContact$p, true, 'ContactString');
  1832. break
  1833. }
  1834. found=true;
  1835. break
  1836. }
  1837. }
  1838. if (!found)
  1839. {
  1840. this._filteredEntitiesCache$p$0[name]=null
  1841. }
  1842. }
  1843. return this._filteredEntitiesCache$p$0[name]
  1844. }, _createMeetingSuggestion$p$0: function $h_Entities$_createMeetingSuggestion$p$0(data)
  1845. {
  1846. return new $h.MeetingSuggestion(data, this._dateTimeSent$p$0)
  1847. }, _getAddresses$p$0: function $h_Entities$_getAddresses$p$0()
  1848. {
  1849. if (!this._addresses$p$0)
  1850. {
  1851. this._addresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Addresses', true)
  1852. }
  1853. return this._addresses$p$0
  1854. }, _getEmailAddresses$p$0: function $h_Entities$_getEmailAddresses$p$0()
  1855. {
  1856. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  1857. if (!this._emailAddresses$p$0)
  1858. {
  1859. this._emailAddresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'EmailAddresses', false)
  1860. }
  1861. return this._emailAddresses$p$0
  1862. }, _getUrls$p$0: function $h_Entities$_getUrls$p$0()
  1863. {
  1864. if (!this._urls$p$0)
  1865. {
  1866. this._urls$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Urls', false)
  1867. }
  1868. return this._urls$p$0
  1869. }, _getPhoneNumbers$p$0: function $h_Entities$_getPhoneNumbers$p$0()
  1870. {
  1871. if (!this._phoneNumbers$p$0)
  1872. {
  1873. this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber, this._data$p$0, 'PhoneNumbers', $h.Entities._createPhoneNumber$p)
  1874. }
  1875. return this._phoneNumbers$p$0
  1876. }, _getTaskSuggestions$p$0: function $h_Entities$_getTaskSuggestions$p$0()
  1877. {
  1878. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  1879. if (!this._taskSuggestions$p$0)
  1880. {
  1881. this._taskSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.TaskSuggestion, this._data$p$0, 'TaskSuggestions', $h.Entities._createTaskSuggestion$p, true, 'TaskString')
  1882. }
  1883. return this._taskSuggestions$p$0
  1884. }, _getMeetingSuggestions$p$0: function $h_Entities$_getMeetingSuggestions$p$0()
  1885. {
  1886. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  1887. if (!this._meetingSuggestions$p$0)
  1888. {
  1889. this._meetingSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion, this._data$p$0, 'MeetingSuggestions', this.$$d__createMeetingSuggestion$p$0, true, 'MeetingString')
  1890. }
  1891. return this._meetingSuggestions$p$0
  1892. }, _getContacts$p$0: function $h_Entities$_getContacts$p$0()
  1893. {
  1894. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  1895. if (!this._contacts$p$0)
  1896. {
  1897. this._contacts$p$0=$h.Entities._getExtractedObjects$i($h.Contact, this._data$p$0, 'Contacts', $h.Entities._createContact$p, true, 'ContactString')
  1898. }
  1899. return this._contacts$p$0
  1900. }
  1901. };
  1902. Office.cast.item=function Office_cast_item(){};
  1903. Office.cast.item.toItemRead=function Office_cast_item$toItemRead(item)
  1904. {
  1905. if ($h.Item.isInstanceOfType(item))
  1906. {
  1907. return item
  1908. }
  1909. throw Error.argumentType();
  1910. };
  1911. Office.cast.item.toItemCompose=function Office_cast_item$toItemCompose(item)
  1912. {
  1913. if ($h.ComposeItem.isInstanceOfType(item))
  1914. {
  1915. return item
  1916. }
  1917. throw Error.argumentType();
  1918. };
  1919. Office.cast.item.toMessage=function Office_cast_item$toMessage(item)
  1920. {
  1921. return Office.cast.item.toMessageRead(item)
  1922. };
  1923. Office.cast.item.toMessageRead=function Office_cast_item$toMessageRead(item)
  1924. {
  1925. if ($h.Message.isInstanceOfType(item))
  1926. {
  1927. return item
  1928. }
  1929. throw Error.argumentType();
  1930. };
  1931. Office.cast.item.toMessageCompose=function Office_cast_item$toMessageCompose(item)
  1932. {
  1933. if ($h.MessageCompose.isInstanceOfType(item))
  1934. {
  1935. return item
  1936. }
  1937. throw Error.argumentType();
  1938. };
  1939. Office.cast.item.toMeetingRequest=function Office_cast_item$toMeetingRequest(item)
  1940. {
  1941. if ($h.MeetingRequest.isInstanceOfType(item))
  1942. {
  1943. return item
  1944. }
  1945. throw Error.argumentType();
  1946. };
  1947. Office.cast.item.toAppointment=function Office_cast_item$toAppointment(item)
  1948. {
  1949. return Office.cast.item.toAppointmentRead(item)
  1950. };
  1951. Office.cast.item.toAppointmentRead=function Office_cast_item$toAppointmentRead(item)
  1952. {
  1953. if ($h.Appointment.isInstanceOfType(item))
  1954. {
  1955. return item
  1956. }
  1957. throw Error.argumentType();
  1958. };
  1959. Office.cast.item.toAppointmentCompose=function Office_cast_item$toAppointmentCompose(item)
  1960. {
  1961. if ($h.AppointmentCompose.isInstanceOfType(item))
  1962. {
  1963. return item
  1964. }
  1965. throw Error.argumentType();
  1966. };
  1967. $h.Item=function $h_Item(data)
  1968. {
  1969. this.$$d__getAttachments$p$1=Function.createDelegate(this, this._getAttachments$p$1);
  1970. this.$$d__getItemClass$p$1=Function.createDelegate(this, this._getItemClass$p$1);
  1971. this.$$d__getItemId$p$1=Function.createDelegate(this, this._getItemId$p$1);
  1972. this.$$d__getDateTimeModified$p$1=Function.createDelegate(this, this._getDateTimeModified$p$1);
  1973. this.$$d__getDateTimeCreated$p$1=Function.createDelegate(this, this._getDateTimeCreated$p$1);
  1974. $h.Item.initializeBase(this, [data]);
  1975. $h.InitialData._defineReadOnlyProperty$i(this, 'dateTimeCreated', this.$$d__getDateTimeCreated$p$1);
  1976. $h.InitialData._defineReadOnlyProperty$i(this, 'dateTimeModified', this.$$d__getDateTimeModified$p$1);
  1977. $h.InitialData._defineReadOnlyProperty$i(this, 'itemId', this.$$d__getItemId$p$1);
  1978. $h.InitialData._defineReadOnlyProperty$i(this, 'itemClass', this.$$d__getItemClass$p$1);
  1979. $h.InitialData._defineReadOnlyProperty$i(this, 'attachments', this.$$d__getAttachments$p$1)
  1980. };
  1981. $h.Item.prototype={
  1982. _getItemId$p$1: function $h_Item$_getItemId$p$1()
  1983. {
  1984. return this._data$p$0.get__itemId$i$0()
  1985. }, _getItemClass$p$1: function $h_Item$_getItemClass$p$1()
  1986. {
  1987. return this._data$p$0.get__itemClass$i$0()
  1988. }, _getDateTimeCreated$p$1: function $h_Item$_getDateTimeCreated$p$1()
  1989. {
  1990. return this._data$p$0.get__dateTimeCreated$i$0()
  1991. }, _getDateTimeModified$p$1: function $h_Item$_getDateTimeModified$p$1()
  1992. {
  1993. return this._data$p$0.get__dateTimeModified$i$0()
  1994. }, _getAttachments$p$1: function $h_Item$_getAttachments$p$1()
  1995. {
  1996. return this._data$p$0.get__attachments$i$0()
  1997. }
  1998. };
  1999. $h.ItemBase=function $h_ItemBase(data)
  2000. {
  2001. this.$$d__createCustomProperties$i$0=Function.createDelegate(this, this._createCustomProperties$i$0);
  2002. this.$$d_getItemType=Function.createDelegate(this, this.getItemType);
  2003. this._data$p$0=data;
  2004. $h.InitialData._defineReadOnlyProperty$i(this, 'itemType', this.$$d_getItemType)
  2005. };
  2006. $h.ItemBase.prototype={
  2007. _data$p$0: null, get_data: function $h_ItemBase$get_data()
  2008. {
  2009. return this._data$p$0
  2010. }, loadCustomPropertiesAsync: function $h_ItemBase$loadCustomPropertiesAsync()
  2011. {
  2012. var args=[];
  2013. for (var $$pai_3=0; $$pai_3 < arguments.length;++$$pai_3)
  2014. {
  2015. args[$$pai_3]=arguments[$$pai_3]
  2016. }
  2017. var parameters=$h.CommonParameters.parse(args, true, true);
  2018. var loadCustomProperties=new $h._loadDictionaryRequest(this.$$d__createCustomProperties$i$0, 'customProperties', parameters.get_callback(), parameters._asyncContext$p$0);
  2019. loadCustomProperties._sendRequest$i$0(3, 'LoadCustomProperties', {})
  2020. }, _createCustomProperties$i$0: function $h_ItemBase$_createCustomProperties$i$0(data)
  2021. {
  2022. return new $h.CustomProperties(data)
  2023. }
  2024. };
  2025. $h.MeetingRequest=function $h_MeetingRequest(data)
  2026. {
  2027. this.$$d__getRequiredAttendees$p$3=Function.createDelegate(this, this._getRequiredAttendees$p$3);
  2028. this.$$d__getOptionalAttendees$p$3=Function.createDelegate(this, this._getOptionalAttendees$p$3);
  2029. this.$$d__getLocation$p$3=Function.createDelegate(this, this._getLocation$p$3);
  2030. this.$$d__getEnd$p$3=Function.createDelegate(this, this._getEnd$p$3);
  2031. this.$$d__getStart$p$3=Function.createDelegate(this, this._getStart$p$3);
  2032. $h.MeetingRequest.initializeBase(this, [data]);
  2033. $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStart$p$3);
  2034. $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEnd$p$3);
  2035. $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$3);
  2036. $h.InitialData._defineReadOnlyProperty$i(this, 'optionalAttendees', this.$$d__getOptionalAttendees$p$3);
  2037. $h.InitialData._defineReadOnlyProperty$i(this, 'requiredAttendees', this.$$d__getRequiredAttendees$p$3)
  2038. };
  2039. $h.MeetingRequest.prototype={
  2040. _getStart$p$3: function $h_MeetingRequest$_getStart$p$3()
  2041. {
  2042. return this._data$p$0.get__start$i$0()
  2043. }, _getEnd$p$3: function $h_MeetingRequest$_getEnd$p$3()
  2044. {
  2045. return this._data$p$0.get__end$i$0()
  2046. }, _getLocation$p$3: function $h_MeetingRequest$_getLocation$p$3()
  2047. {
  2048. return this._data$p$0.get__location$i$0()
  2049. }, _getOptionalAttendees$p$3: function $h_MeetingRequest$_getOptionalAttendees$p$3()
  2050. {
  2051. return this._data$p$0.get__cc$i$0()
  2052. }, _getRequiredAttendees$p$3: function $h_MeetingRequest$_getRequiredAttendees$p$3()
  2053. {
  2054. return this._data$p$0.get__to$i$0()
  2055. }
  2056. };
  2057. $h.MeetingSuggestion=function $h_MeetingSuggestion(data, dateTimeSent)
  2058. {
  2059. this.$$d__getEndTime$p$0=Function.createDelegate(this, this._getEndTime$p$0);
  2060. this.$$d__getStartTime$p$0=Function.createDelegate(this, this._getStartTime$p$0);
  2061. this.$$d__getSubject$p$0=Function.createDelegate(this, this._getSubject$p$0);
  2062. this.$$d__getLocation$p$0=Function.createDelegate(this, this._getLocation$p$0);
  2063. this.$$d__getAttendees$p$0=Function.createDelegate(this, this._getAttendees$p$0);
  2064. this.$$d__getMeetingString$p$0=Function.createDelegate(this, this._getMeetingString$p$0);
  2065. this._data$p$0=data;
  2066. this._dateTimeSent$p$0=dateTimeSent;
  2067. $h.InitialData._defineReadOnlyProperty$i(this, 'meetingString', this.$$d__getMeetingString$p$0);
  2068. $h.InitialData._defineReadOnlyProperty$i(this, 'attendees', this.$$d__getAttendees$p$0);
  2069. $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$0);
  2070. $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$0);
  2071. $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStartTime$p$0);
  2072. $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEndTime$p$0)
  2073. };
  2074. $h.MeetingSuggestion.prototype={
  2075. _dateTimeSent$p$0: null, _data$p$0: null, _attendees$p$0: null, _getMeetingString$p$0: function $h_MeetingSuggestion$_getMeetingString$p$0()
  2076. {
  2077. return this._data$p$0['MeetingString']
  2078. }, _getLocation$p$0: function $h_MeetingSuggestion$_getLocation$p$0()
  2079. {
  2080. return this._data$p$0['Location']
  2081. }, _getSubject$p$0: function $h_MeetingSuggestion$_getSubject$p$0()
  2082. {
  2083. return this._data$p$0['Subject']
  2084. }, _getStartTime$p$0: function $h_MeetingSuggestion$_getStartTime$p$0()
  2085. {
  2086. var time=this._createDateTimeFromParameter$p$0('StartTime');
  2087. var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time, this._dateTimeSent$p$0);
  2088. if (resolvedTime.getTime() !==time.getTime())
  2089. {
  2090. return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime))
  2091. }
  2092. return time
  2093. }, _getEndTime$p$0: function $h_MeetingSuggestion$_getEndTime$p$0()
  2094. {
  2095. var time=this._createDateTimeFromParameter$p$0('EndTime');
  2096. var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time, this._dateTimeSent$p$0);
  2097. if (resolvedTime.getTime() !==time.getTime())
  2098. {
  2099. return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime))
  2100. }
  2101. return time
  2102. }, _createDateTimeFromParameter$p$0: function $h_MeetingSuggestion$_createDateTimeFromParameter$p$0(keyName)
  2103. {
  2104. var dateTimeString=this._data$p$0[keyName];
  2105. if (!dateTimeString)
  2106. {
  2107. return null
  2108. }
  2109. return new Date(dateTimeString)
  2110. }, _getAttendees$p$0: function $h_MeetingSuggestion$_getAttendees$p$0()
  2111. {
  2112. if (!this._attendees$p$0)
  2113. {
  2114. var $$t_1=this;
  2115. this._attendees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails, this._data$p$0, 'Attendees', function(data)
  2116. {
  2117. return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data)
  2118. })
  2119. }
  2120. return this._attendees$p$0
  2121. }
  2122. };
  2123. $h.MeetingSuggestionTimeDecoder=function $h_MeetingSuggestionTimeDecoder(){};
  2124. $h.MeetingSuggestionTimeDecoder.resolve=function $h_MeetingSuggestionTimeDecoder$resolve(inTime, sentTime)
  2125. {
  2126. if (!sentTime)
  2127. {
  2128. return inTime
  2129. }
  2130. try
  2131. {
  2132. var tod;
  2133. var outDate;
  2134. var extractedDate;
  2135. var sentDate=new Date(sentTime.getFullYear(), sentTime.getMonth(), sentTime.getDate(), 0, 0, 0, 0);
  2136. var $$t_7,
  2137. $$t_8,
  2138. $$t_9;
  2139. if (!(($$t_9=$h.MeetingSuggestionTimeDecoder._decode$p(inTime, ($$t_7={val: extractedDate}), ($$t_8={val: tod}))), extractedDate=$$t_7.val, tod=$$t_8.val, $$t_9))
  2140. {
  2141. return inTime
  2142. }
  2143. else
  2144. {
  2145. if ($h._preciseDate.isInstanceOfType(extractedDate))
  2146. {
  2147. outDate=$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p(sentDate, extractedDate)
  2148. }
  2149. else
  2150. {
  2151. if ($h._relativeDate.isInstanceOfType(extractedDate))
  2152. {
  2153. outDate=$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p(sentDate, extractedDate)
  2154. }
  2155. else
  2156. {
  2157. outDate=sentDate
  2158. }
  2159. }
  2160. if (isNaN(outDate.getTime()))
  2161. {
  2162. return sentTime
  2163. }
  2164. outDate.setMilliseconds(outDate.getMilliseconds()+tod);
  2165. return outDate
  2166. }
  2167. }
  2168. catch($$e_6)
  2169. {
  2170. return sentTime
  2171. }
  2172. };
  2173. $h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i=function $h_MeetingSuggestionTimeDecoder$_isNullOrUndefined$i(value)
  2174. {
  2175. return null===value || value===undefined
  2176. };
  2177. $h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p=function $h_MeetingSuggestionTimeDecoder$_resolvePreciseDate$p(sentDate, precise)
  2178. {
  2179. var year=precise._year$i$1;
  2180. var month=(!precise._month$i$1) ? sentDate.getMonth() : precise._month$i$1 - 1;
  2181. var day=precise._day$i$1;
  2182. if (!day)
  2183. {
  2184. return sentDate
  2185. }
  2186. var candidate;
  2187. if ($h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year))
  2188. {
  2189. candidate=new Date(sentDate.getFullYear(), month, day);
  2190. if (candidate.getTime() < sentDate.getTime())
  2191. {
  2192. candidate=new Date(sentDate.getFullYear()+1, month, day)
  2193. }
  2194. }
  2195. else
  2196. {
  2197. candidate=new Date((year < 50) ? 2000+year : 1900+year, month, day)
  2198. }
  2199. if (candidate.getMonth() !==month)
  2200. {
  2201. return sentDate
  2202. }
  2203. return candidate
  2204. };
  2205. $h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p=function $h_MeetingSuggestionTimeDecoder$_resolveRelativeDate$p(sentDate, relative)
  2206. {
  2207. var date;
  2208. switch (relative._unit$i$1)
  2209. {
  2210. case 0:
  2211. date=new Date(sentDate.getFullYear(), sentDate.getMonth(), sentDate.getDate());
  2212. date.setDate(date.getDate()+relative._offset$i$1);
  2213. return date;
  2214. case 5:
  2215. return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p(sentDate, relative._offset$i$1, relative._tag$i$1);
  2216. case 2:
  2217. var days=1;
  2218. switch (relative._modifier$i$1)
  2219. {
  2220. case 1:
  2221. break;
  2222. case 2:
  2223. days=16;
  2224. break;
  2225. default:
  2226. if (!relative._offset$i$1)
  2227. {
  2228. days=sentDate.getDate()
  2229. }
  2230. break
  2231. }
  2232. date=new Date(sentDate.getFullYear(), sentDate.getMonth(), days);
  2233. date.setMonth(date.getMonth()+relative._offset$i$1);
  2234. if (date.getTime() < sentDate.getTime())
  2235. {
  2236. date.setDate(date.getDate()+sentDate.getDate() - 1)
  2237. }
  2238. return date;
  2239. case 1:
  2240. date=new Date(sentDate.getFullYear(), sentDate.getMonth(), sentDate.getDate());
  2241. date.setDate(sentDate.getDate()+(7 * relative._offset$i$1));
  2242. if (relative._modifier$i$1===1 || !relative._modifier$i$1)
  2243. {
  2244. date.setDate(date.getDate()+1 - date.getDay());
  2245. if (date.getTime() < sentDate.getTime())
  2246. {
  2247. return sentDate
  2248. }
  2249. return date
  2250. }
  2251. else if (relative._modifier$i$1===2)
  2252. {
  2253. date.setDate(date.getDate()+5 - date.getDay());
  2254. return date
  2255. }
  2256. break;
  2257. case 4:
  2258. return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p(sentDate, relative);
  2259. case 3:
  2260. if (relative._offset$i$1 > 0)
  2261. {
  2262. return new Date(sentDate.getFullYear()+relative._offset$i$1, 0, 1)
  2263. }
  2264. break;
  2265. default:
  2266. break
  2267. }
  2268. return sentDate
  2269. };
  2270. $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p=function $h_MeetingSuggestionTimeDecoder$_findBestDateForWeekDate$p(sentDate, offset, tag)
  2271. {
  2272. if (offset > -5 && offset < 5)
  2273. {
  2274. var dayOfWeek;
  2275. var days;
  2276. dayOfWeek=((tag+6) % 7)+1;
  2277. days=(7 * offset)+(dayOfWeek - sentDate.getDay());
  2278. sentDate.setDate(sentDate.getDate()+days);
  2279. return sentDate
  2280. }
  2281. else
  2282. {
  2283. var days=(tag - sentDate.getDay()) % 7;
  2284. if (days < 0)
  2285. {
  2286. days+=7
  2287. }
  2288. sentDate.setDate(sentDate.getDate()+days);
  2289. return sentDate
  2290. }
  2291. };
  2292. $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p=function $h_MeetingSuggestionTimeDecoder$_findBestDateForWeekOfMonthDate$p(sentDate, relative)
  2293. {
  2294. var date;
  2295. var firstDay;
  2296. var newDate;
  2297. date=sentDate;
  2298. if (relative._tag$i$1 <=0 || relative._tag$i$1 > 12 || relative._offset$i$1 <=0 || relative._offset$i$1 > 5)
  2299. {
  2300. return sentDate
  2301. }
  2302. var monthOffset=(12+relative._tag$i$1 - date.getMonth() - 1) % 12;
  2303. firstDay=new Date(date.getFullYear(), date.getMonth()+monthOffset, 1);
  2304. if (relative._modifier$i$1===1)
  2305. {
  2306. if (relative._offset$i$1===1 && firstDay.getDay() !==6 && firstDay.getDay() !==0)
  2307. {
  2308. return firstDay
  2309. }
  2310. else
  2311. {
  2312. newDate=new Date(firstDay.getFullYear(), firstDay.getMonth(), firstDay.getDate());
  2313. newDate.setDate(newDate.getDate()+((7+(1 - firstDay.getDay())) % 7));
  2314. if (firstDay.getDay() !==6 && firstDay.getDay() !==0 && firstDay.getDay() !==1)
  2315. {
  2316. newDate.setDate(newDate.getDate() - 7)
  2317. }
  2318. newDate.setDate(newDate.getDate()+(7 * (relative._offset$i$1 - 1)));
  2319. if (newDate.getMonth()+1 !==relative._tag$i$1)
  2320. {
  2321. return sentDate
  2322. }
  2323. return newDate
  2324. }
  2325. }
  2326. else
  2327. {
  2328. newDate=new Date(firstDay.getFullYear(), firstDay.getMonth(), $h.MeetingSuggestionTimeDecoder._daysInMonth$p(firstDay.getMonth(), firstDay.getFullYear()));
  2329. var offset=1 - newDate.getDay();
  2330. if (offset > 0)
  2331. {
  2332. offset=offset - 7
  2333. }
  2334. newDate.setDate(newDate.getDate()+offset);
  2335. newDate.setDate(newDate.getDate()+(7 * (1 - relative._offset$i$1)));
  2336. if (newDate.getMonth()+1 !==relative._tag$i$1)
  2337. {
  2338. if (firstDay.getDay() !==6 && firstDay.getDay() !==0)
  2339. {
  2340. return firstDay
  2341. }
  2342. else
  2343. {
  2344. return sentDate
  2345. }
  2346. }
  2347. else
  2348. {
  2349. return newDate
  2350. }
  2351. }
  2352. };
  2353. $h.MeetingSuggestionTimeDecoder._decode$p=function $h_MeetingSuggestionTimeDecoder$_decode$p(inDate, date, time)
  2354. {
  2355. var DateValueMask=32767;
  2356. date.val=null;
  2357. time.val=0;
  2358. if (!inDate)
  2359. {
  2360. return false
  2361. }
  2362. time.val=$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p(inDate);
  2363. var inDateAtMidnight=inDate.getTime() - time.val;
  2364. var value=(inDateAtMidnight - $h.MeetingSuggestionTimeDecoder._baseDate$p.getTime()) / 86400000;
  2365. if (value < 0)
  2366. {
  2367. return false
  2368. }
  2369. else if (value >=262144)
  2370. {
  2371. return false
  2372. }
  2373. else
  2374. {
  2375. var type=value >> 15;
  2376. value=value & DateValueMask;
  2377. switch (type)
  2378. {
  2379. case 0:
  2380. return $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p(value, date);
  2381. case 1:
  2382. return $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p(value, date);
  2383. default:
  2384. return false
  2385. }
  2386. }
  2387. };
  2388. $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p=function $h_MeetingSuggestionTimeDecoder$_decodePreciseDate$p(value, date)
  2389. {
  2390. var c_SubTypeMask=7;
  2391. var c_MonthMask=15;
  2392. var c_DayMask=31;
  2393. var c_YearMask=127;
  2394. var year=null;
  2395. var month=0;
  2396. var day=0;
  2397. date.val=null;
  2398. var subType=(value >> 12) & c_SubTypeMask;
  2399. if ((subType & 4)===4)
  2400. {
  2401. year=(value >> 5) & c_YearMask;
  2402. if ((subType & 2)===2)
  2403. {
  2404. if ((subType & 1)===1)
  2405. {
  2406. return false
  2407. }
  2408. month=(value >> 1) & c_MonthMask
  2409. }
  2410. }
  2411. else
  2412. {
  2413. if ((subType & 2)===2)
  2414. {
  2415. month=(value >> 8) & c_MonthMask
  2416. }
  2417. if ((subType & 1)===1)
  2418. {
  2419. day=(value >> 3) & c_DayMask
  2420. }
  2421. }
  2422. date.val=new $h._preciseDate(day, month, year);
  2423. return true
  2424. };
  2425. $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p=function $h_MeetingSuggestionTimeDecoder$_decodeRelativeDate$p(value, date)
  2426. {
  2427. var TagMask=15;
  2428. var OffsetMask=63;
  2429. var UnitMask=7;
  2430. var ModifierMask=3;
  2431. var tag=value & TagMask;
  2432. value >>=4;
  2433. var offset=$h.MeetingSuggestionTimeDecoder._fromComplement$p(value & OffsetMask, 6);
  2434. value >>=6;
  2435. var unit=value & UnitMask;
  2436. value >>=3;
  2437. var modifier=value & ModifierMask;
  2438. try
  2439. {
  2440. date.val=new $h._relativeDate(modifier, offset, unit, tag);
  2441. return true
  2442. }
  2443. catch($$e_A)
  2444. {
  2445. date.val=null;
  2446. return false
  2447. }
  2448. };
  2449. $h.MeetingSuggestionTimeDecoder._fromComplement$p=function $h_MeetingSuggestionTimeDecoder$_fromComplement$p(value, n)
  2450. {
  2451. var signed=1 << (n - 1);
  2452. var mask=(1 << n) - 1;
  2453. if ((value & signed)===signed)
  2454. {
  2455. return -((value ^ mask)+1)
  2456. }
  2457. else
  2458. {
  2459. return value
  2460. }
  2461. };
  2462. $h.MeetingSuggestionTimeDecoder._daysInMonth$p=function $h_MeetingSuggestionTimeDecoder$_daysInMonth$p(month, year)
  2463. {
  2464. return 32 - new Date(year, month, 32).getDate()
  2465. };
  2466. $h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p=function $h_MeetingSuggestionTimeDecoder$_getTimeOfDayInMillisecondsUTC$p(inputTime)
  2467. {
  2468. var timeOfDay=0;
  2469. timeOfDay+=inputTime.getUTCHours() * 3600;
  2470. timeOfDay+=inputTime.getUTCMinutes() * 60;
  2471. timeOfDay+=inputTime.getUTCSeconds();
  2472. timeOfDay *=1000;
  2473. timeOfDay+=inputTime.getUTCMilliseconds();
  2474. return timeOfDay
  2475. };
  2476. $h._extractedDate=function $h__extractedDate(){};
  2477. $h._preciseDate=function $h__preciseDate(day, month, year)
  2478. {
  2479. $h._preciseDate.initializeBase(this);
  2480. if (day < 0 || day > 31)
  2481. {
  2482. throw Error.argumentOutOfRange('day');
  2483. }
  2484. if (month < 0 || month > 12)
  2485. {
  2486. throw Error.argumentOutOfRange('month');
  2487. }
  2488. this._day$i$1=day;
  2489. this._month$i$1=month;
  2490. if (!$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year))
  2491. {
  2492. if (!month && day)
  2493. {
  2494. throw Error.argument('Invalid arguments');
  2495. }
  2496. if (year < 0 || year > 2099)
  2497. {
  2498. throw Error.argumentOutOfRange('year');
  2499. }
  2500. this._year$i$1=year % 100
  2501. }
  2502. else if (!this._month$i$1 && !this._day$i$1)
  2503. {
  2504. throw Error.argument('Invalid datetime');
  2505. }
  2506. };
  2507. $h._preciseDate.prototype={
  2508. _day$i$1: 0, _month$i$1: 0, _year$i$1: null
  2509. };
  2510. $h._relativeDate=function $h__relativeDate(modifier, offset, unit, tag)
  2511. {
  2512. $h._relativeDate.initializeBase(this);
  2513. if (offset < -32 || offset > 31)
  2514. {
  2515. throw Error.argumentOutOfRange('offset');
  2516. }
  2517. if (tag < 0 || tag > 15)
  2518. {
  2519. throw Error.argumentOutOfRange('tag');
  2520. }
  2521. if (!unit && offset < 0)
  2522. {
  2523. throw Error.argument('unit & offset do not form a valid date');
  2524. }
  2525. this._modifier$i$1=modifier;
  2526. this._offset$i$1=offset;
  2527. this._unit$i$1=unit;
  2528. this._tag$i$1=tag
  2529. };
  2530. $h._relativeDate.prototype={
  2531. _modifier$i$1: 0, _offset$i$1: 0, _unit$i$1: 0, _tag$i$1: 0
  2532. };
  2533. $h.Message=function $h_Message(dataDictionary)
  2534. {
  2535. this.$$d__getConversationId$p$2=Function.createDelegate(this, this._getConversationId$p$2);
  2536. this.$$d__getInternetMessageId$p$2=Function.createDelegate(this, this._getInternetMessageId$p$2);
  2537. this.$$d__getCc$p$2=Function.createDelegate(this, this._getCc$p$2);
  2538. this.$$d__getTo$p$2=Function.createDelegate(this, this._getTo$p$2);
  2539. this.$$d__getFrom$p$2=Function.createDelegate(this, this._getFrom$p$2);
  2540. this.$$d__getSender$p$2=Function.createDelegate(this, this._getSender$p$2);
  2541. this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this, this._getNormalizedSubject$p$2);
  2542. this.$$d__getSubject$p$2=Function.createDelegate(this, this._getSubject$p$2);
  2543. $h.Message.initializeBase(this, [dataDictionary]);
  2544. $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$2);
  2545. $h.InitialData._defineReadOnlyProperty$i(this, 'normalizedSubject', this.$$d__getNormalizedSubject$p$2);
  2546. $h.InitialData._defineReadOnlyProperty$i(this, 'sender', this.$$d__getSender$p$2);
  2547. $h.InitialData._defineReadOnlyProperty$i(this, 'from', this.$$d__getFrom$p$2);
  2548. $h.InitialData._defineReadOnlyProperty$i(this, 'to', this.$$d__getTo$p$2);
  2549. $h.InitialData._defineReadOnlyProperty$i(this, 'cc', this.$$d__getCc$p$2);
  2550. $h.InitialData._defineReadOnlyProperty$i(this, 'internetMessageId', this.$$d__getInternetMessageId$p$2);
  2551. $h.InitialData._defineReadOnlyProperty$i(this, 'conversationId', this.$$d__getConversationId$p$2)
  2552. };
  2553. $h.Message.prototype={
  2554. getEntities: function $h_Message$getEntities()
  2555. {
  2556. return this._data$p$0._getEntities$i$0()
  2557. }, getEntitiesByType: function $h_Message$getEntitiesByType(entityType)
  2558. {
  2559. return this._data$p$0._getEntitiesByType$i$0(entityType)
  2560. }, getFilteredEntitiesByName: function $h_Message$getFilteredEntitiesByName(name)
  2561. {
  2562. return this._data$p$0._getFilteredEntitiesByName$i$0(name)
  2563. }, getRegExMatches: function $h_Message$getRegExMatches()
  2564. {
  2565. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'getRegExMatches');
  2566. return this._data$p$0._getRegExMatches$i$0()
  2567. }, getRegExMatchesByName: function $h_Message$getRegExMatchesByName(name)
  2568. {
  2569. OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1, 'getRegExMatchesByName');
  2570. return this._data$p$0._getRegExMatchesByName$i$0(name)
  2571. }, displayReplyForm: function $h_Message$displayReplyForm(htmlBody)
  2572. {
  2573. OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(htmlBody)
  2574. }, displayReplyAllForm: function $h_Message$displayReplyAllForm(htmlBody)
  2575. {
  2576. OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(htmlBody)
  2577. }, getItemType: function $h_Message$getItemType()
  2578. {
  2579. return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message
  2580. }, _getSubject$p$2: function $h_Message$_getSubject$p$2()
  2581. {
  2582. return this._data$p$0.get__subject$i$0()
  2583. }, _getNormalizedSubject$p$2: function $h_Message$_getNormalizedSubject$p$2()
  2584. {
  2585. return this._data$p$0.get__normalizedSubject$i$0()
  2586. }, _getSender$p$2: function $h_Message$_getSender$p$2()
  2587. {
  2588. return this._data$p$0.get__sender$i$0()
  2589. }, _getFrom$p$2: function $h_Message$_getFrom$p$2()
  2590. {
  2591. return this._data$p$0.get__from$i$0()
  2592. }, _getTo$p$2: function $h_Message$_getTo$p$2()
  2593. {
  2594. return this._data$p$0.get__to$i$0()
  2595. }, _getCc$p$2: function $h_Message$_getCc$p$2()
  2596. {
  2597. return this._data$p$0.get__cc$i$0()
  2598. }, _getInternetMessageId$p$2: function $h_Message$_getInternetMessageId$p$2()
  2599. {
  2600. return this._data$p$0.get__internetMessageId$i$0()
  2601. }, _getConversationId$p$2: function $h_Message$_getConversationId$p$2()
  2602. {
  2603. return this._data$p$0.get__conversationId$i$0()
  2604. }
  2605. };
  2606. $h.MessageCompose=function $h_MessageCompose(data)
  2607. {
  2608. this.$$d__getConversationId$p$2=Function.createDelegate(this, this._getConversationId$p$2);
  2609. this.$$d__getBcc$p$2=Function.createDelegate(this, this._getBcc$p$2);
  2610. this.$$d__getCc$p$2=Function.createDelegate(this, this._getCc$p$2);
  2611. this.$$d__getTo$p$2=Function.createDelegate(this, this._getTo$p$2);
  2612. $h.MessageCompose.initializeBase(this, [data]);
  2613. $h.InitialData._defineReadOnlyProperty$i(this, 'to', this.$$d__getTo$p$2);
  2614. $h.InitialData._defineReadOnlyProperty$i(this, 'cc', this.$$d__getCc$p$2);
  2615. $h.InitialData._defineReadOnlyProperty$i(this, 'bcc', this.$$d__getBcc$p$2);
  2616. $h.InitialData._defineReadOnlyProperty$i(this, 'conversationId', this.$$d__getConversationId$p$2)
  2617. };
  2618. $h.MessageCompose.prototype={
  2619. _to$p$2: null, _cc$p$2: null, _bcc$p$2: null, getItemType: function $h_MessageCompose$getItemType()
  2620. {
  2621. return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message
  2622. }, _getTo$p$2: function $h_MessageCompose$_getTo$p$2()
  2623. {
  2624. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  2625. if (!this._to$p$2)
  2626. {
  2627. this._to$p$2=new $h.ComposeRecipient(0, 'to')
  2628. }
  2629. return this._to$p$2
  2630. }, _getCc$p$2: function $h_MessageCompose$_getCc$p$2()
  2631. {
  2632. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  2633. if (!this._cc$p$2)
  2634. {
  2635. this._cc$p$2=new $h.ComposeRecipient(1, 'cc')
  2636. }
  2637. return this._cc$p$2
  2638. }, _getBcc$p$2: function $h_MessageCompose$_getBcc$p$2()
  2639. {
  2640. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  2641. if (!this._bcc$p$2)
  2642. {
  2643. this._bcc$p$2=new $h.ComposeRecipient(2, 'bcc')
  2644. }
  2645. return this._bcc$p$2
  2646. }, _getConversationId$p$2: function $h_MessageCompose$_getConversationId$p$2()
  2647. {
  2648. return this._data$p$0.get__conversationId$i$0()
  2649. }
  2650. };
  2651. $h.OutlookErrorManager=function $h_OutlookErrorManager(){};
  2652. $h.OutlookErrorManager.getErrorArgs=function $h_OutlookErrorManager$getErrorArgs(errorCode)
  2653. {
  2654. if (!$h.OutlookErrorManager._isInitialized$p)
  2655. {
  2656. $h.OutlookErrorManager._initialize$p()
  2657. }
  2658. return OSF.DDA.ErrorCodeManager.getErrorArgs(errorCode)
  2659. };
  2660. $h.OutlookErrorManager._initialize$p=function $h_OutlookErrorManager$_initialize$p()
  2661. {
  2662. $h.OutlookErrorManager._addErrorMessage$p(9000, 'AttachmentSizeExceeded', _u.ExtensibilityStrings.l_AttachmentExceededSize_Text);
  2663. $h.OutlookErrorManager._addErrorMessage$p(9001, 'NumberOfAttachmentsExceeded', _u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text);
  2664. $h.OutlookErrorManager._addErrorMessage$p(9002, 'InternalFormatError', _u.ExtensibilityStrings.l_InternalFormatError_Text);
  2665. $h.OutlookErrorManager._addErrorMessage$p(9003, 'InvalidAttachmentId', _u.ExtensibilityStrings.l_InvalidAttachmentId_Text);
  2666. $h.OutlookErrorManager._addErrorMessage$p(9004, 'InvalidAttachmentPath', _u.ExtensibilityStrings.l_InvalidAttachmentPath_Text);
  2667. $h.OutlookErrorManager._addErrorMessage$p(9005, 'CannotAddAttachmentBeforeUpgrade', _u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text);
  2668. $h.OutlookErrorManager._addErrorMessage$p(9006, 'AttachmentDeletedBeforeUploadCompletes', _u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text);
  2669. $h.OutlookErrorManager._addErrorMessage$p(9007, 'AttachmentUploadGeneralFailure', _u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text);
  2670. $h.OutlookErrorManager._addErrorMessage$p(9008, 'AttachmentToDeleteDoesNotExist', _u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text);
  2671. $h.OutlookErrorManager._addErrorMessage$p(9009, 'AttachmentDeleteGeneralFailure', _u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text);
  2672. $h.OutlookErrorManager._addErrorMessage$p(9010, 'InvalidEndTime', _u.ExtensibilityStrings.l_InvalidEndTime_Text);
  2673. $h.OutlookErrorManager._addErrorMessage$p(9011, 'HtmlSanitizationFailure', _u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text);
  2674. $h.OutlookErrorManager._addErrorMessage$p(9012, 'NumberOfRecipientsExceeded', String.format(_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text, 100));
  2675. $h.OutlookErrorManager._addErrorMessage$p(9013, 'NoValidRecipientsProvided', _u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text);
  2676. $h.OutlookErrorManager._addErrorMessage$p(9014, 'CursorPositionChanged', _u.ExtensibilityStrings.l_CursorPositionChanged_Text);
  2677. $h.OutlookErrorManager._isInitialized$p=true
  2678. };
  2679. $h.OutlookErrorManager._addErrorMessage$p=function $h_OutlookErrorManager$_addErrorMessage$p(errorCode, errorName, errorMessage)
  2680. {
  2681. OSF.DDA.ErrorCodeManager.addErrorMessage(errorCode, {
  2682. name: errorName, message: errorMessage
  2683. })
  2684. };
  2685. $h.OutlookErrorManager.OutlookErrorCodes=function $h_OutlookErrorManager_OutlookErrorCodes(){};
  2686. $h.OutlookErrorManager.OsfDdaErrorCodes=function $h_OutlookErrorManager_OsfDdaErrorCodes(){};
  2687. $h.PhoneNumber=function $h_PhoneNumber(data)
  2688. {
  2689. this.$$d__getPhoneType$p$0=Function.createDelegate(this, this._getPhoneType$p$0);
  2690. this.$$d__getOriginalPhoneString$p$0=Function.createDelegate(this, this._getOriginalPhoneString$p$0);
  2691. this.$$d__getPhoneString$p$0=Function.createDelegate(this, this._getPhoneString$p$0);
  2692. this._data$p$0=data;
  2693. $h.InitialData._defineReadOnlyProperty$i(this, 'phoneString', this.$$d__getPhoneString$p$0);
  2694. $h.InitialData._defineReadOnlyProperty$i(this, 'originalPhoneString', this.$$d__getOriginalPhoneString$p$0);
  2695. $h.InitialData._defineReadOnlyProperty$i(this, 'type', this.$$d__getPhoneType$p$0)
  2696. };
  2697. $h.PhoneNumber.prototype={
  2698. _data$p$0: null, _getPhoneString$p$0: function $h_PhoneNumber$_getPhoneString$p$0()
  2699. {
  2700. return this._data$p$0['PhoneString']
  2701. }, _getOriginalPhoneString$p$0: function $h_PhoneNumber$_getOriginalPhoneString$p$0()
  2702. {
  2703. return this._data$p$0['OriginalPhoneString']
  2704. }, _getPhoneType$p$0: function $h_PhoneNumber$_getPhoneType$p$0()
  2705. {
  2706. return this._data$p$0['Type']
  2707. }
  2708. };
  2709. $h.TaskSuggestion=function $h_TaskSuggestion(data)
  2710. {
  2711. this.$$d__getAssignees$p$0=Function.createDelegate(this, this._getAssignees$p$0);
  2712. this.$$d__getTaskString$p$0=Function.createDelegate(this, this._getTaskString$p$0);
  2713. this._data$p$0=data;
  2714. $h.InitialData._defineReadOnlyProperty$i(this, 'taskString', this.$$d__getTaskString$p$0);
  2715. $h.InitialData._defineReadOnlyProperty$i(this, 'assignees', this.$$d__getAssignees$p$0)
  2716. };
  2717. $h.TaskSuggestion.prototype={
  2718. _data$p$0: null, _assignees$p$0: null, _getTaskString$p$0: function $h_TaskSuggestion$_getTaskString$p$0()
  2719. {
  2720. return this._data$p$0['TaskString']
  2721. }, _getAssignees$p$0: function $h_TaskSuggestion$_getAssignees$p$0()
  2722. {
  2723. if (!this._assignees$p$0)
  2724. {
  2725. var $$t_1=this;
  2726. this._assignees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails, this._data$p$0, 'Assignees', function(data)
  2727. {
  2728. return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data)
  2729. })
  2730. }
  2731. return this._assignees$p$0
  2732. }
  2733. };
  2734. $h.UserProfile=function $h_UserProfile(data)
  2735. {
  2736. this.$$d__getTimeZone$p$0=Function.createDelegate(this, this._getTimeZone$p$0);
  2737. this.$$d__getEmailAddress$p$0=Function.createDelegate(this, this._getEmailAddress$p$0);
  2738. this.$$d__getDisplayName$p$0=Function.createDelegate(this, this._getDisplayName$p$0);
  2739. this._data$p$0=data;
  2740. $h.InitialData._defineReadOnlyProperty$i(this, 'displayName', this.$$d__getDisplayName$p$0);
  2741. $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddress', this.$$d__getEmailAddress$p$0);
  2742. $h.InitialData._defineReadOnlyProperty$i(this, 'timeZone', this.$$d__getTimeZone$p$0)
  2743. };
  2744. $h.UserProfile.prototype={
  2745. _data$p$0: null, _getDisplayName$p$0: function $h_UserProfile$_getDisplayName$p$0()
  2746. {
  2747. return this._data$p$0.get__userDisplayName$i$0()
  2748. }, _getEmailAddress$p$0: function $h_UserProfile$_getEmailAddress$p$0()
  2749. {
  2750. return this._data$p$0.get__userEmailAddress$i$0()
  2751. }, _getTimeZone$p$0: function $h_UserProfile$_getTimeZone$p$0()
  2752. {
  2753. return this._data$p$0.get__userTimeZone$i$0()
  2754. }
  2755. };
  2756. $h.RequestState=function(){};
  2757. $h.RequestState.prototype={
  2758. unsent: 0, opened: 1, headersReceived: 2, loading: 3, done: 4
  2759. };
  2760. $h.RequestState.registerEnum('$h.RequestState', false);
  2761. $h.CommonParameters=function $h_CommonParameters(options, callback, asyncContext)
  2762. {
  2763. this._options$p$0=options;
  2764. this._callback$p$0=callback;
  2765. this._asyncContext$p$0=asyncContext
  2766. };
  2767. $h.CommonParameters.parse=function $h_CommonParameters$parse(args, isCallbackRequired, tryLegacy)
  2768. {
  2769. var legacyParameters;
  2770. var $$t_8,
  2771. $$t_9;
  2772. if (tryLegacy && (($$t_9=$h.CommonParameters._tryParseLegacy$p(args, ($$t_8={val: legacyParameters}))), legacyParameters=$$t_8.val, $$t_9))
  2773. {
  2774. return legacyParameters
  2775. }
  2776. var argsLength=args.length;
  2777. var options=null;
  2778. var callback=null;
  2779. var asyncContext=null;
  2780. if (argsLength===1)
  2781. {
  2782. if (Function.isInstanceOfType(args[0]))
  2783. {
  2784. callback=args[0]
  2785. }
  2786. else if (Object.isInstanceOfType(args[0]))
  2787. {
  2788. options=args[0]
  2789. }
  2790. else
  2791. {
  2792. throw Error.argumentType();
  2793. }
  2794. }
  2795. else if (argsLength===2)
  2796. {
  2797. if (!(Object.isInstanceOfType(args[0])))
  2798. {
  2799. throw Error.argument('options');
  2800. }
  2801. if (!(Function.isInstanceOfType(args[1])))
  2802. {
  2803. throw Error.argument('callback');
  2804. }
  2805. options=args[0];
  2806. callback=args[1]
  2807. }
  2808. else if (argsLength)
  2809. {
  2810. throw Error.parameterCount(_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text);
  2811. }
  2812. if (isCallbackRequired && !callback)
  2813. {
  2814. throw Error.argumentNull('callback');
  2815. }
  2816. if (options && !$h.ScriptHelpers.isNullOrUndefined(options['asyncContext']))
  2817. {
  2818. asyncContext=options['asyncContext']
  2819. }
  2820. return new $h.CommonParameters(options, callback, asyncContext)
  2821. };
  2822. $h.CommonParameters._tryParseLegacy$p=function $h_CommonParameters$_tryParseLegacy$p(args, commonParameters)
  2823. {
  2824. commonParameters.val=null;
  2825. var argsLength=args.length;
  2826. var callback=null;
  2827. var userContext=null;
  2828. if (!argsLength || argsLength > 2)
  2829. {
  2830. return false
  2831. }
  2832. if (!(Function.isInstanceOfType(args[0])))
  2833. {
  2834. return false
  2835. }
  2836. callback=args[0];
  2837. if (argsLength > 1)
  2838. {
  2839. userContext=args[1]
  2840. }
  2841. commonParameters.val=new $h.CommonParameters(null, callback, userContext);
  2842. return true
  2843. };
  2844. $h.CommonParameters.prototype={
  2845. _options$p$0: null, _callback$p$0: null, _asyncContext$p$0: null, get_options: function $h_CommonParameters$get_options()
  2846. {
  2847. return this._options$p$0
  2848. }, get_callback: function $h_CommonParameters$get_callback()
  2849. {
  2850. return this._callback$p$0
  2851. }, get_asyncContext: function $h_CommonParameters$get_asyncContext()
  2852. {
  2853. return this._asyncContext$p$0
  2854. }
  2855. };
  2856. $h.EwsRequest=function $h_EwsRequest(userContext)
  2857. {
  2858. this.readyState=1;
  2859. $h.EwsRequest.initializeBase(this, [userContext])
  2860. };
  2861. $h.EwsRequest.prototype={
  2862. status: 0, statusText: null, onreadystatechange: null, responseText: null, get__statusCode$i$1: function $h_EwsRequest$get__statusCode$i$1()
  2863. {
  2864. return this.status
  2865. }, set__statusCode$i$1: function $h_EwsRequest$set__statusCode$i$1(value)
  2866. {
  2867. this.status=value;
  2868. return value
  2869. }, get__statusDescription$i$1: function $h_EwsRequest$get__statusDescription$i$1()
  2870. {
  2871. return this.statusText
  2872. }, set__statusDescription$i$1: function $h_EwsRequest$set__statusDescription$i$1(value)
  2873. {
  2874. this.statusText=value;
  2875. return value
  2876. }, get__requestState$i$1: function $h_EwsRequest$get__requestState$i$1()
  2877. {
  2878. return this.readyState
  2879. }, set__requestState$i$1: function $h_EwsRequest$set__requestState$i$1(value)
  2880. {
  2881. this.readyState=value;
  2882. return value
  2883. }, get__response$i$1: function $h_EwsRequest$get__response$i$1()
  2884. {
  2885. return this.responseText
  2886. }, set__response$i$1: function $h_EwsRequest$set__response$i$1(value)
  2887. {
  2888. this.responseText=value;
  2889. return value
  2890. }, send: function $h_EwsRequest$send(data)
  2891. {
  2892. this._checkSendConditions$i$1();
  2893. if ($h.ScriptHelpers.isNullOrUndefined(data))
  2894. {
  2895. this._throwInvalidStateException$i$1()
  2896. }
  2897. this._sendRequest$i$0(5, 'EwsRequest', {body: data})
  2898. }, _callOnReadyStateChangeCallback$i$1: function $h_EwsRequest$_callOnReadyStateChangeCallback$i$1()
  2899. {
  2900. if (!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange))
  2901. {
  2902. this.onreadystatechange()
  2903. }
  2904. }, _parseExtraResponseData$i$1: function $h_EwsRequest$_parseExtraResponseData$i$1(response){}
  2905. };
  2906. $h.InitialData=function $h_InitialData(data)
  2907. {
  2908. this._data$p$0=data;
  2909. this._permissionLevel$p$0=this._calculatePermissionLevel$p$0()
  2910. };
  2911. $h.InitialData._defineReadOnlyProperty$i=function $h_InitialData$_defineReadOnlyProperty$i(o, methodName, getter)
  2912. {
  2913. var propertyDescriptor={
  2914. get: getter, configurable: false
  2915. };
  2916. Object.defineProperty(o, methodName, propertyDescriptor)
  2917. };
  2918. $h.InitialData.prototype={
  2919. _toRecipients$p$0: null, _ccRecipients$p$0: null, _attachments$p$0: null, _resources$p$0: null, _entities$p$0: null, _data$p$0: null, _permissionLevel$p$0: 0, get__itemId$i$0: function $h_InitialData$get__itemId$i$0()
  2920. {
  2921. return this._data$p$0['id']
  2922. }, get__itemClass$i$0: function $h_InitialData$get__itemClass$i$0()
  2923. {
  2924. return this._data$p$0['itemClass']
  2925. }, get__dateTimeCreated$i$0: function $h_InitialData$get__dateTimeCreated$i$0()
  2926. {
  2927. return new Date(this._data$p$0['dateTimeCreated'])
  2928. }, get__dateTimeModified$i$0: function $h_InitialData$get__dateTimeModified$i$0()
  2929. {
  2930. return new Date(this._data$p$0['dateTimeModified'])
  2931. }, get__dateTimeSent$i$0: function $h_InitialData$get__dateTimeSent$i$0()
  2932. {
  2933. return new Date(this._data$p$0['dateTimeSent'])
  2934. }, get__subject$i$0: function $h_InitialData$get__subject$i$0()
  2935. {
  2936. this._throwOnRestrictedPermissionLevel$i$0();
  2937. return this._data$p$0['subject']
  2938. }, get__normalizedSubject$i$0: function $h_InitialData$get__normalizedSubject$i$0()
  2939. {
  2940. this._throwOnRestrictedPermissionLevel$i$0();
  2941. return this._data$p$0['normalizedSubject']
  2942. }, get__internetMessageId$i$0: function $h_InitialData$get__internetMessageId$i$0()
  2943. {
  2944. return this._data$p$0['internetMessageId']
  2945. }, get__conversationId$i$0: function $h_InitialData$get__conversationId$i$0()
  2946. {
  2947. return this._data$p$0['conversationId']
  2948. }, get__sender$i$0: function $h_InitialData$get__sender$i$0()
  2949. {
  2950. this._throwOnRestrictedPermissionLevel$i$0();
  2951. var sender=this._data$p$0['sender'];
  2952. return ($h.ScriptHelpers.isNullOrUndefined(sender)) ? null : new $h.EmailAddressDetails(sender)
  2953. }, get__from$i$0: function $h_InitialData$get__from$i$0()
  2954. {
  2955. this._throwOnRestrictedPermissionLevel$i$0();
  2956. var from=this._data$p$0['from'];
  2957. return ($h.ScriptHelpers.isNullOrUndefined(from)) ? null : new $h.EmailAddressDetails(from)
  2958. }, get__to$i$0: function $h_InitialData$get__to$i$0()
  2959. {
  2960. this._throwOnRestrictedPermissionLevel$i$0();
  2961. if (null===this._toRecipients$p$0)
  2962. {
  2963. this._toRecipients$p$0=this._createEmailAddressDetails$p$0('to')
  2964. }
  2965. return this._toRecipients$p$0
  2966. }, get__cc$i$0: function $h_InitialData$get__cc$i$0()
  2967. {
  2968. this._throwOnRestrictedPermissionLevel$i$0();
  2969. if (null===this._ccRecipients$p$0)
  2970. {
  2971. this._ccRecipients$p$0=this._createEmailAddressDetails$p$0('cc')
  2972. }
  2973. return this._ccRecipients$p$0
  2974. }, get__attachments$i$0: function $h_InitialData$get__attachments$i$0()
  2975. {
  2976. this._throwOnRestrictedPermissionLevel$i$0();
  2977. if (null===this._attachments$p$0)
  2978. {
  2979. this._attachments$p$0=this._createAttachmentDetails$p$0()
  2980. }
  2981. return this._attachments$p$0
  2982. }, get__ewsUrl$i$0: function $h_InitialData$get__ewsUrl$i$0()
  2983. {
  2984. return this._data$p$0['ewsUrl']
  2985. }, get__start$i$0: function $h_InitialData$get__start$i$0()
  2986. {
  2987. return new Date(this._data$p$0['start'])
  2988. }, get__end$i$0: function $h_InitialData$get__end$i$0()
  2989. {
  2990. return new Date(this._data$p$0['end'])
  2991. }, get__location$i$0: function $h_InitialData$get__location$i$0()
  2992. {
  2993. return this._data$p$0['location']
  2994. }, get__resources$i$0: function $h_InitialData$get__resources$i$0()
  2995. {
  2996. this._throwOnRestrictedPermissionLevel$i$0();
  2997. if (null===this._resources$p$0)
  2998. {
  2999. this._resources$p$0=this._createEmailAddressDetails$p$0('resources')
  3000. }
  3001. return this._resources$p$0
  3002. }, get__organizer$i$0: function $h_InitialData$get__organizer$i$0()
  3003. {
  3004. this._throwOnRestrictedPermissionLevel$i$0();
  3005. var organizer=this._data$p$0['organizer'];
  3006. return ($h.ScriptHelpers.isNullOrUndefined(organizer)) ? null : new $h.EmailAddressDetails(organizer)
  3007. }, get__userDisplayName$i$0: function $h_InitialData$get__userDisplayName$i$0()
  3008. {
  3009. return this._data$p$0['userDisplayName']
  3010. }, get__userEmailAddress$i$0: function $h_InitialData$get__userEmailAddress$i$0()
  3011. {
  3012. return this._data$p$0['userEmailAddress']
  3013. }, get__userTimeZone$i$0: function $h_InitialData$get__userTimeZone$i$0()
  3014. {
  3015. return this._data$p$0['userTimeZone']
  3016. }, get__timeZoneOffsets$i$0: function $h_InitialData$get__timeZoneOffsets$i$0()
  3017. {
  3018. return this._data$p$0['timeZoneOffsets']
  3019. }, get__hostVersion$i$0: function $h_InitialData$get__hostVersion$i$0()
  3020. {
  3021. return this._data$p$0['hostVersion']
  3022. }, get__owaView$i$0: function $h_InitialData$get__owaView$i$0()
  3023. {
  3024. return this._data$p$0['owaView']
  3025. }, get__overrideWindowOpen$i$0: function $h_InitialData$get__overrideWindowOpen$i$0()
  3026. {
  3027. return this._data$p$0['overrideWindowOpen']
  3028. }, _getEntities$i$0: function $h_InitialData$_getEntities$i$0()
  3029. {
  3030. if (!this._entities$p$0)
  3031. {
  3032. this._entities$p$0=new $h.Entities(this._data$p$0['entities'], this._data$p$0['filteredEntities'], this.get__dateTimeSent$i$0(), this._permissionLevel$p$0)
  3033. }
  3034. return this._entities$p$0
  3035. }, _getEntitiesByType$i$0: function $h_InitialData$_getEntitiesByType$i$0(entityType)
  3036. {
  3037. var entites=this._getEntities$i$0();
  3038. return entites._getByType$i$0(entityType)
  3039. }, _getFilteredEntitiesByName$i$0: function $h_InitialData$_getFilteredEntitiesByName$i$0(name)
  3040. {
  3041. var entities=this._getEntities$i$0();
  3042. return entities._getFilteredEntitiesByName$i$0(name)
  3043. }, _getRegExMatches$i$0: function $h_InitialData$_getRegExMatches$i$0()
  3044. {
  3045. if (!this._data$p$0['regExMatches'])
  3046. {
  3047. return null
  3048. }
  3049. return this._data$p$0['regExMatches']
  3050. }, _getRegExMatchesByName$i$0: function $h_InitialData$_getRegExMatchesByName$i$0(regexName)
  3051. {
  3052. var regexMatches=this._getRegExMatches$i$0();
  3053. if (!regexMatches || !regexMatches[regexName])
  3054. {
  3055. return null
  3056. }
  3057. return regexMatches[regexName]
  3058. }, _throwOnRestrictedPermissionLevel$i$0: function $h_InitialData$_throwOnRestrictedPermissionLevel$i$0()
  3059. {
  3060. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0)
  3061. }, _createEmailAddressDetails$p$0: function $h_InitialData$_createEmailAddressDetails$p$0(key)
  3062. {
  3063. var to=this._data$p$0[key];
  3064. if ($h.ScriptHelpers.isNullOrUndefined(to))
  3065. {
  3066. return []
  3067. }
  3068. var recipients=[];
  3069. for (var i=0; i < to.length; i++)
  3070. {
  3071. if (!$h.ScriptHelpers.isNullOrUndefined(to[i]))
  3072. {
  3073. recipients[i]=new $h.EmailAddressDetails(to[i])
  3074. }
  3075. }
  3076. return recipients
  3077. }, _createAttachmentDetails$p$0: function $h_InitialData$_createAttachmentDetails$p$0()
  3078. {
  3079. var attachments=this._data$p$0['attachments'];
  3080. if ($h.ScriptHelpers.isNullOrUndefined(attachments))
  3081. {
  3082. return []
  3083. }
  3084. var attachmentDetails=[];
  3085. for (var i=0; i < attachments.length; i++)
  3086. {
  3087. if (!$h.ScriptHelpers.isNullOrUndefined(attachments[i]))
  3088. {
  3089. attachmentDetails[i]=new $h.AttachmentDetails(attachments[i])
  3090. }
  3091. }
  3092. return attachmentDetails
  3093. }, _calculatePermissionLevel$p$0: function $h_InitialData$_calculatePermissionLevel$p$0()
  3094. {
  3095. var HostReadItem=1;
  3096. var HostReadWriteMailbox=2;
  3097. var HostReadWriteItem=3;
  3098. var permissionLevelFromHost=this._data$p$0['permissionLevel'];
  3099. if ($h.ScriptHelpers.isUndefined(this._permissionLevel$p$0))
  3100. {
  3101. return 0
  3102. }
  3103. switch (permissionLevelFromHost)
  3104. {
  3105. case HostReadItem:
  3106. return 1;
  3107. case HostReadWriteItem:
  3108. return 2;
  3109. case HostReadWriteMailbox:
  3110. return 3;
  3111. default:
  3112. return 0
  3113. }
  3114. }
  3115. };
  3116. $h._loadDictionaryRequest=function $h__loadDictionaryRequest(createResultObject, dictionaryName, callback, userContext)
  3117. {
  3118. $h._loadDictionaryRequest.initializeBase(this, [userContext]);
  3119. this._createResultObject$p$1=createResultObject;
  3120. this._dictionaryName$p$1=dictionaryName;
  3121. this._callback$p$1=callback
  3122. };
  3123. $h._loadDictionaryRequest.prototype={
  3124. _dictionaryName$p$1: null, _createResultObject$p$1: null, _callback$p$1: null, handleResponse: function $h__loadDictionaryRequest$handleResponse(response)
  3125. {
  3126. if (response['wasSuccessful'])
  3127. {
  3128. var value=response[this._dictionaryName$p$1];
  3129. var responseData=JSON.parse(value);
  3130. this.createAsyncResult(this._createResultObject$p$1(responseData), 0, null)
  3131. }
  3132. else
  3133. {
  3134. this.createAsyncResult(null, 1, response['errorMessage'])
  3135. }
  3136. this._callback$p$1(this._asyncResult$p$0)
  3137. }
  3138. };
  3139. $h.ProxyRequestBase=function $h_ProxyRequestBase(userContext)
  3140. {
  3141. $h.ProxyRequestBase.initializeBase(this, [userContext])
  3142. };
  3143. $h.ProxyRequestBase.prototype={
  3144. handleResponse: function $h_ProxyRequestBase$handleResponse(response)
  3145. {
  3146. if (!(response['wasProxySuccessful']))
  3147. {
  3148. this.set__statusCode$i$1(500);
  3149. this.set__statusDescription$i$1('Error');
  3150. var errorMessage=response['errorMessage'];
  3151. this.set__response$i$1(errorMessage);
  3152. this.createAsyncResult(null, 1, errorMessage)
  3153. }
  3154. else
  3155. {
  3156. this.set__statusCode$i$1(response['statusCode']);
  3157. this.set__statusDescription$i$1(response['statusDescription']);
  3158. this.set__response$i$1(response['body']);
  3159. this.createAsyncResult(this.get__response$i$1(), 0, null)
  3160. }
  3161. this._parseExtraResponseData$i$1(response);
  3162. this._cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1()
  3163. }, _throwInvalidStateException$i$1: function $h_ProxyRequestBase$_throwInvalidStateException$i$1()
  3164. {
  3165. throw Error.create('DOMException', {
  3166. code: 11, message: 'INVALID_STATE_ERR'
  3167. });
  3168. }, _cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1: function $h_ProxyRequestBase$_cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1()
  3169. {
  3170. var $$t_0=this;
  3171. this._changeReadyState$i$1(2, function()
  3172. {
  3173. $$t_0._changeReadyState$i$1(3, function()
  3174. {
  3175. $$t_0._changeReadyState$i$1(4, null)
  3176. })
  3177. })
  3178. }, _changeReadyState$i$1: function $h_ProxyRequestBase$_changeReadyState$i$1(state, nextStep)
  3179. {
  3180. this.set__requestState$i$1(state);
  3181. var $$t_2=this;
  3182. window.setTimeout(function()
  3183. {
  3184. try
  3185. {
  3186. $$t_2._callOnReadyStateChangeCallback$i$1()
  3187. }
  3188. finally
  3189. {
  3190. if (!$h.ScriptHelpers.isNullOrUndefined(nextStep))
  3191. {
  3192. nextStep()
  3193. }
  3194. }
  3195. }, 0)
  3196. }, _checkSendConditions$i$1: function $h_ProxyRequestBase$_checkSendConditions$i$1()
  3197. {
  3198. if (this.get__requestState$i$1() !==1)
  3199. {
  3200. this._throwInvalidStateException$i$1()
  3201. }
  3202. if (this._isSent$p$0)
  3203. {
  3204. this._throwInvalidStateException$i$1()
  3205. }
  3206. }
  3207. };
  3208. $h.RequestBase=function $h_RequestBase(userContext)
  3209. {
  3210. this._userContext$p$0=userContext
  3211. };
  3212. $h.RequestBase.prototype={
  3213. _isSent$p$0: false, _asyncResult$p$0: null, _userContext$p$0: null, _sendRequest$i$0: function $h_RequestBase$_sendRequest$i$0(dispid, methodName, dataToSend)
  3214. {
  3215. this._isSent$p$0=true;
  3216. var $$t_5=this;
  3217. OSF.DDA.OutlookAppOm._instance$p._invokeHostMethod$i$0(dispid, methodName, dataToSend, function(resultCode, response)
  3218. {
  3219. if (resultCode)
  3220. {
  3221. $$t_5.createAsyncResult(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode))
  3222. }
  3223. else
  3224. {
  3225. $$t_5.handleResponse(response)
  3226. }
  3227. })
  3228. }, createAsyncResult: function $h_RequestBase$createAsyncResult(value, errorCode, errorDescription)
  3229. {
  3230. this._asyncResult$p$0=OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(value, errorCode, errorDescription, this._userContext$p$0)
  3231. }
  3232. };
  3233. $h._saveDictionaryRequest=function $h__saveDictionaryRequest(callback, userContext)
  3234. {
  3235. $h._saveDictionaryRequest.initializeBase(this, [userContext]);
  3236. if (!$h.ScriptHelpers.isNullOrUndefined(callback))
  3237. {
  3238. this._callback$p$1=callback
  3239. }
  3240. };
  3241. $h._saveDictionaryRequest.prototype={
  3242. _callback$p$1: null, handleResponse: function $h__saveDictionaryRequest$handleResponse(response)
  3243. {
  3244. if (response['wasSuccessful'])
  3245. {
  3246. this.createAsyncResult(null, 0, null)
  3247. }
  3248. else
  3249. {
  3250. this.createAsyncResult(null, 1, response['errorMessage'])
  3251. }
  3252. if (!$h.ScriptHelpers.isNullOrUndefined(this._callback$p$1))
  3253. {
  3254. this._callback$p$1(this._asyncResult$p$0)
  3255. }
  3256. }
  3257. };
  3258. $h.ScriptHelpers=function $h_ScriptHelpers(){};
  3259. $h.ScriptHelpers.isNull=function $h_ScriptHelpers$isNull(value)
  3260. {
  3261. return null===value
  3262. };
  3263. $h.ScriptHelpers.isNullOrUndefined=function $h_ScriptHelpers$isNullOrUndefined(value)
  3264. {
  3265. return $h.ScriptHelpers.isNull(value) || $h.ScriptHelpers.isUndefined(value)
  3266. };
  3267. $h.ScriptHelpers.isUndefined=function $h_ScriptHelpers$isUndefined(value)
  3268. {
  3269. return value===undefined
  3270. };
  3271. $h.ScriptHelpers.dictionaryContainsKey=function $h_ScriptHelpers$dictionaryContainsKey(obj, keyName)
  3272. {
  3273. return (Object.isInstanceOfType(obj)) ? keyName in obj : false
  3274. };
  3275. $h.ScriptHelpers.isNonEmptyString=function $h_ScriptHelpers$isNonEmptyString(value)
  3276. {
  3277. if (!value)
  3278. {
  3279. return false
  3280. }
  3281. return String.isInstanceOfType(value)
  3282. };
  3283. OSF.DDA.OutlookAppOm.registerClass('OSF.DDA.OutlookAppOm');
  3284. OSF.DDA.Settings.registerClass('OSF.DDA.Settings');
  3285. $h.ItemBase.registerClass('$h.ItemBase');
  3286. $h.Item.registerClass('$h.Item', $h.ItemBase);
  3287. $h.Appointment.registerClass('$h.Appointment', $h.Item);
  3288. $h.ComposeItem.registerClass('$h.ComposeItem', $h.ItemBase);
  3289. $h.AppointmentCompose.registerClass('$h.AppointmentCompose', $h.ComposeItem);
  3290. $h.AttachmentDetails.registerClass('$h.AttachmentDetails');
  3291. $h.ComposeBody.registerClass('$h.ComposeBody');
  3292. $h.ComposeRecipient.registerClass('$h.ComposeRecipient');
  3293. $h.ComposeLocation.registerClass('$h.ComposeLocation');
  3294. $h.ComposeSubject.registerClass('$h.ComposeSubject');
  3295. $h.ComposeTime.registerClass('$h.ComposeTime');
  3296. $h.Contact.registerClass('$h.Contact');
  3297. $h.CustomProperties.registerClass('$h.CustomProperties');
  3298. $h.Diagnostics.registerClass('$h.Diagnostics');
  3299. $h.EmailAddressDetails.registerClass('$h.EmailAddressDetails');
  3300. $h.Entities.registerClass('$h.Entities');
  3301. Office.cast.item.registerClass('Office.cast.item');
  3302. $h.Message.registerClass('$h.Message', $h.Item);
  3303. $h.MeetingRequest.registerClass('$h.MeetingRequest', $h.Message);
  3304. $h.MeetingSuggestion.registerClass('$h.MeetingSuggestion');
  3305. $h.MeetingSuggestionTimeDecoder.registerClass('$h.MeetingSuggestionTimeDecoder');
  3306. $h._extractedDate.registerClass('$h._extractedDate');
  3307. $h._preciseDate.registerClass('$h._preciseDate', $h._extractedDate);
  3308. $h._relativeDate.registerClass('$h._relativeDate', $h._extractedDate);
  3309. $h.MessageCompose.registerClass('$h.MessageCompose', $h.ComposeItem);
  3310. $h.OutlookErrorManager.registerClass('$h.OutlookErrorManager');
  3311. $h.OutlookErrorManager.OutlookErrorCodes.registerClass('$h.OutlookErrorManager.OutlookErrorCodes');
  3312. $h.OutlookErrorManager.OsfDdaErrorCodes.registerClass('$h.OutlookErrorManager.OsfDdaErrorCodes');
  3313. $h.PhoneNumber.registerClass('$h.PhoneNumber');
  3314. $h.TaskSuggestion.registerClass('$h.TaskSuggestion');
  3315. $h.UserProfile.registerClass('$h.UserProfile');
  3316. $h.CommonParameters.registerClass('$h.CommonParameters');
  3317. $h.RequestBase.registerClass('$h.RequestBase');
  3318. $h.ProxyRequestBase.registerClass('$h.ProxyRequestBase', $h.RequestBase);
  3319. $h.EwsRequest.registerClass('$h.EwsRequest', $h.ProxyRequestBase);
  3320. $h.InitialData.registerClass('$h.InitialData');
  3321. $h._loadDictionaryRequest.registerClass('$h._loadDictionaryRequest', $h.RequestBase);
  3322. $h._saveDictionaryRequest.registerClass('$h._saveDictionaryRequest', $h.RequestBase);
  3323. $h.ScriptHelpers.registerClass('$h.ScriptHelpers');
  3324. OSF.DDA.OutlookAppOm.asyncMethodTimeoutKeyName='__timeout__';
  3325. OSF.DDA.OutlookAppOm._maxRecipients$p=100;
  3326. OSF.DDA.OutlookAppOm._maxSubjectLength$p=255;
  3327. OSF.DDA.OutlookAppOm._maxBodyLength$p=32768;
  3328. OSF.DDA.OutlookAppOm._maxLocationLength$p=255;
  3329. OSF.DDA.OutlookAppOm._maxEwsRequestSize$p=1000000;
  3330. OSF.DDA.OutlookAppOm._instance$p=null;
  3331. $h.AttachmentDetails._attachmentTypeMap$p=[Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File, Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.Item];
  3332. $h.ComposeBody.coercionTypeParameterName='coercionType';
  3333. $h.ComposeItem.maxAttachmentNameLength=255;
  3334. $h.ComposeItem.maxUriLength=2048;
  3335. $h.ComposeItem.maxItemIdLength=200;
  3336. $h.ComposeItem.maxRemoveIdLength=200;
  3337. $h.ComposeRecipient.displayNameLengthLimit=255;
  3338. $h.ComposeRecipient.maxSmtpLength=571;
  3339. $h.ComposeRecipient.recipientsLimit=100;
  3340. $h.ComposeRecipient.addressParameterName='address';
  3341. $h.ComposeRecipient.nameParameterName='name';
  3342. $h.ComposeLocation.locationKey='location';
  3343. $h.ComposeLocation.maximumLocationLength=255;
  3344. $h.ComposeSubject.maximumSubjectLength=255;
  3345. $h.ComposeTime.timeTypeName='TimeProperty';
  3346. $h.ComposeTime.timeDataName='time';
  3347. $h.Diagnostics.outlookAppName='Outlook';
  3348. $h.Diagnostics.outlookWebAppName='OutlookWebApp';
  3349. $h.EmailAddressDetails._emptyString$p='';
  3350. $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];
  3351. $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];
  3352. $h.Entities._allEntityKeys$p=['Addresses', 'EmailAddresses', 'Urls', 'PhoneNumbers', 'TaskSuggestions', 'MeetingSuggestions', 'Contacts'];
  3353. $h.MeetingSuggestionTimeDecoder._baseDate$p=new Date('0001-01-01T00:00:00Z');
  3354. $h.OutlookErrorManager.errorNameKey='name';
  3355. $h.OutlookErrorManager.errorMessageKey='message';
  3356. $h.OutlookErrorManager._isInitialized$p=false;
  3357. $h.OutlookErrorManager.OutlookErrorCodes.attachmentSizeExceeded=9000;
  3358. $h.OutlookErrorManager.OutlookErrorCodes.numberOfAttachmentsExceeded=9001;
  3359. $h.OutlookErrorManager.OutlookErrorCodes.internalFormatError=9002;
  3360. $h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentId=9003;
  3361. $h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentPath=9004;
  3362. $h.OutlookErrorManager.OutlookErrorCodes.cannotAddAttachmentBeforeUpgrade=9005;
  3363. $h.OutlookErrorManager.OutlookErrorCodes.attachmentDeletedBeforeUploadCompletes=9006;
  3364. $h.OutlookErrorManager.OutlookErrorCodes.attachmentUploadGeneralFailure=9007;
  3365. $h.OutlookErrorManager.OutlookErrorCodes.attachmentToDeleteDoesNotExist=9008;
  3366. $h.OutlookErrorManager.OutlookErrorCodes.attachmentDeleteGeneralFailure=9009;
  3367. $h.OutlookErrorManager.OutlookErrorCodes.invalidEndTime=9010;
  3368. $h.OutlookErrorManager.OutlookErrorCodes.htmlSanitizationFailure=9011;
  3369. $h.OutlookErrorManager.OutlookErrorCodes.numberOfRecipientsExceeded=9012;
  3370. $h.OutlookErrorManager.OutlookErrorCodes.noValidRecipientsProvided=9013;
  3371. $h.OutlookErrorManager.OutlookErrorCodes.cursorPositionChanged=9014;
  3372. $h.OutlookErrorManager.OsfDdaErrorCodes.ooeCoercionTypeNotSupported=1000;
  3373. $h.CommonParameters.asyncContextKeyName='asyncContext';
  3374. $h.ScriptHelpers.emptyString=''