説明なし
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

outlook-win32-16.00.debug.js 344KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704
  1. /* Outlook specific API library */
  2. /* Version: 16.0.6807.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. var __extends=this && this.__extends || function(d, b)
  10. {
  11. for(var p in b)
  12. if(b.hasOwnProperty(p))
  13. d[p]=b[p];
  14. function __()
  15. {
  16. this.constructor=d
  17. }
  18. d.prototype=b===null ? Object.create(b) : (__.prototype=b.prototype,new __)
  19. };
  20. var OfficeExt;
  21. (function(OfficeExt)
  22. {
  23. var MicrosoftAjaxFactory=function()
  24. {
  25. function MicrosoftAjaxFactory(){}
  26. MicrosoftAjaxFactory.prototype.isMsAjaxLoaded=function()
  27. {
  28. if(typeof Sys !=="undefined" && typeof Type !=="undefined" && Sys.StringBuilder && typeof Sys.StringBuilder==="function" && Type.registerNamespace && typeof Type.registerNamespace==="function" && Type.registerClass && typeof Type.registerClass==="function" && typeof Function._validateParams==="function")
  29. return true;
  30. else
  31. return false
  32. };
  33. MicrosoftAjaxFactory.prototype.loadMsAjaxFull=function(callback)
  34. {
  35. var msAjaxCDNPath=(window.location.protocol.toLowerCase()==="https:" ? "https:" : "http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";
  36. OSF.OUtil.loadScript(msAjaxCDNPath,callback)
  37. };
  38. Object.defineProperty(MicrosoftAjaxFactory.prototype,"msAjaxError",{
  39. get: function()
  40. {
  41. if(this._msAjaxError==null && this.isMsAjaxLoaded())
  42. this._msAjaxError=Error;
  43. return this._msAjaxError
  44. },
  45. set: function(errorClass)
  46. {
  47. this._msAjaxError=errorClass
  48. },
  49. enumerable: true,
  50. configurable: true
  51. });
  52. Object.defineProperty(MicrosoftAjaxFactory.prototype,"msAjaxSerializer",{
  53. get: function()
  54. {
  55. if(this._msAjaxSerializer==null && this.isMsAjaxLoaded())
  56. this._msAjaxSerializer=Sys.Serialization.JavaScriptSerializer;
  57. return this._msAjaxSerializer
  58. },
  59. set: function(serializerClass)
  60. {
  61. this._msAjaxSerializer=serializerClass
  62. },
  63. enumerable: true,
  64. configurable: true
  65. });
  66. Object.defineProperty(MicrosoftAjaxFactory.prototype,"msAjaxString",{
  67. get: function()
  68. {
  69. if(this._msAjaxString==null && this.isMsAjaxLoaded())
  70. this._msAjaxSerializer=String;
  71. return this._msAjaxString
  72. },
  73. set: function(stringClass)
  74. {
  75. this._msAjaxString=stringClass
  76. },
  77. enumerable: true,
  78. configurable: true
  79. });
  80. Object.defineProperty(MicrosoftAjaxFactory.prototype,"msAjaxDebug",{
  81. get: function()
  82. {
  83. if(this._msAjaxDebug==null && this.isMsAjaxLoaded())
  84. this._msAjaxDebug=Sys.Debug;
  85. return this._msAjaxDebug
  86. },
  87. set: function(debugClass)
  88. {
  89. this._msAjaxDebug=debugClass
  90. },
  91. enumerable: true,
  92. configurable: true
  93. });
  94. return MicrosoftAjaxFactory
  95. }();
  96. OfficeExt.MicrosoftAjaxFactory=MicrosoftAjaxFactory
  97. })(OfficeExt || (OfficeExt={}));
  98. var OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory;
  99. var OSF=OSF || {};
  100. var OfficeExt;
  101. (function(OfficeExt)
  102. {
  103. var SafeStorage=function()
  104. {
  105. function SafeStorage(_internalStorage)
  106. {
  107. this._internalStorage=_internalStorage
  108. }
  109. SafeStorage.prototype.getItem=function(key)
  110. {
  111. try
  112. {
  113. return this._internalStorage && this._internalStorage.getItem(key)
  114. }
  115. catch(e)
  116. {
  117. return null
  118. }
  119. };
  120. SafeStorage.prototype.setItem=function(key, data)
  121. {
  122. try
  123. {
  124. this._internalStorage && this._internalStorage.setItem(key,data)
  125. }
  126. catch(e){}
  127. };
  128. SafeStorage.prototype.clear=function()
  129. {
  130. try
  131. {
  132. this._internalStorage && this._internalStorage.clear()
  133. }
  134. catch(e){}
  135. };
  136. SafeStorage.prototype.removeItem=function(key)
  137. {
  138. try
  139. {
  140. this._internalStorage && this._internalStorage.removeItem(key)
  141. }
  142. catch(e){}
  143. };
  144. SafeStorage.prototype.getKeysWithPrefix=function(keyPrefix)
  145. {
  146. var keyList=[];
  147. try
  148. {
  149. var len=this._internalStorage && this._internalStorage.length || 0;
  150. for(var i=0; i < len; i++)
  151. {
  152. var key=this._internalStorage.key(i);
  153. if(key.indexOf(keyPrefix)===0)
  154. keyList.push(key)
  155. }
  156. }
  157. catch(e){}
  158. return keyList
  159. };
  160. return SafeStorage
  161. }();
  162. OfficeExt.SafeStorage=SafeStorage
  163. })(OfficeExt || (OfficeExt={}));
  164. OSF.OUtil=function()
  165. {
  166. var _uniqueId=-1;
  167. var _xdmInfoKey="&_xdm_Info=";
  168. var _serializerVersionKey="&_serializer_version=";
  169. var _xdmSessionKeyPrefix="_xdm_";
  170. var _serializerVersionKeyPrefix="_serializer_version=";
  171. var _fragmentSeparator="#";
  172. var _loadedScripts={};
  173. var _defaultScriptLoadingTimeout=3e4;
  174. var _safeSessionStorage=null;
  175. var _safeLocalStorage=null;
  176. var _rndentropy=(new Date).getTime();
  177. function _random()
  178. {
  179. var nextrand=2147483647 * Math.random();
  180. nextrand ^=_rndentropy ^ (new Date).getMilliseconds() << Math.floor(Math.random() * (31 - 10));
  181. return nextrand.toString(16)
  182. }
  183. function _getSessionStorage()
  184. {
  185. if(!_safeSessionStorage)
  186. {
  187. try
  188. {
  189. var sessionStorage=window.sessionStorage
  190. }
  191. catch(ex)
  192. {
  193. sessionStorage=null
  194. }
  195. _safeSessionStorage=new OfficeExt.SafeStorage(sessionStorage)
  196. }
  197. return _safeSessionStorage
  198. }
  199. return{
  200. set_entropy: function OSF_OUtil$set_entropy(entropy)
  201. {
  202. if(typeof entropy=="string")
  203. for(var i=0; i < entropy.length; i+=4)
  204. {
  205. var temp=0;
  206. for(var j=0; j < 4 && i+j < entropy.length; j++)
  207. temp=(temp << 8)+entropy.charCodeAt(i+j);
  208. _rndentropy ^=temp
  209. }
  210. else if(typeof entropy=="number")
  211. _rndentropy ^=entropy;
  212. else
  213. _rndentropy ^=2147483647 * Math.random();
  214. _rndentropy &=2147483647
  215. },
  216. extend: function OSF_OUtil$extend(child, parent)
  217. {
  218. var F=function(){};
  219. F.prototype=parent.prototype;
  220. child.prototype=new F;
  221. child.prototype.constructor=child;
  222. child.uber=parent.prototype;
  223. if(parent.prototype.constructor===Object.prototype.constructor)
  224. parent.prototype.constructor=parent
  225. },
  226. setNamespace: function OSF_OUtil$setNamespace(name, parent)
  227. {
  228. if(parent && name && !parent[name])
  229. parent[name]={}
  230. },
  231. unsetNamespace: function OSF_OUtil$unsetNamespace(name, parent)
  232. {
  233. if(parent && name && parent[name])
  234. delete parent[name]
  235. },
  236. loadScript: function OSF_OUtil$loadScript(url, callback, timeoutInMs)
  237. {
  238. if(url && callback)
  239. {
  240. var doc=window.document;
  241. var _loadedScriptEntry=_loadedScripts[url];
  242. if(!_loadedScriptEntry)
  243. {
  244. var script=doc.createElement("script");
  245. script.type="text/javascript";
  246. _loadedScriptEntry={
  247. loaded: false,
  248. pendingCallbacks: [callback],
  249. timer: null
  250. };
  251. _loadedScripts[url]=_loadedScriptEntry;
  252. var onLoadCallback=function OSF_OUtil_loadScript$onLoadCallback()
  253. {
  254. if(_loadedScriptEntry.timer !=null)
  255. {
  256. clearTimeout(_loadedScriptEntry.timer);
  257. delete _loadedScriptEntry.timer
  258. }
  259. _loadedScriptEntry.loaded=true;
  260. var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length;
  261. for(var i=0; i < pendingCallbackCount; i++)
  262. {
  263. var currentCallback=_loadedScriptEntry.pendingCallbacks.shift();
  264. currentCallback()
  265. }
  266. };
  267. var onLoadError=function OSF_OUtil_loadScript$onLoadError()
  268. {
  269. delete _loadedScripts[url];
  270. if(_loadedScriptEntry.timer !=null)
  271. {
  272. clearTimeout(_loadedScriptEntry.timer);
  273. delete _loadedScriptEntry.timer
  274. }
  275. var pendingCallbackCount=_loadedScriptEntry.pendingCallbacks.length;
  276. for(var i=0; i < pendingCallbackCount; i++)
  277. {
  278. var currentCallback=_loadedScriptEntry.pendingCallbacks.shift();
  279. currentCallback()
  280. }
  281. };
  282. if(script.readyState)
  283. script.onreadystatechange=function()
  284. {
  285. if(script.readyState=="loaded" || script.readyState=="complete")
  286. {
  287. script.onreadystatechange=null;
  288. onLoadCallback()
  289. }
  290. };
  291. else
  292. script.onload=onLoadCallback;
  293. script.onerror=onLoadError;
  294. timeoutInMs=timeoutInMs || _defaultScriptLoadingTimeout;
  295. _loadedScriptEntry.timer=setTimeout(onLoadError,timeoutInMs);
  296. script.src=url;
  297. doc.getElementsByTagName("head")[0].appendChild(script)
  298. }
  299. else if(_loadedScriptEntry.loaded)
  300. callback();
  301. else
  302. _loadedScriptEntry.pendingCallbacks.push(callback)
  303. }
  304. },
  305. loadCSS: function OSF_OUtil$loadCSS(url)
  306. {
  307. if(url)
  308. {
  309. var doc=window.document;
  310. var link=doc.createElement("link");
  311. link.type="text/css";
  312. link.rel="stylesheet";
  313. link.href=url;
  314. doc.getElementsByTagName("head")[0].appendChild(link)
  315. }
  316. },
  317. parseEnum: function OSF_OUtil$parseEnum(str, enumObject)
  318. {
  319. var parsed=enumObject[str.trim()];
  320. if(typeof parsed=="undefined")
  321. {
  322. OsfMsAjaxFactory.msAjaxDebug.trace("invalid enumeration string:"+str);
  323. throw OsfMsAjaxFactory.msAjaxError.argument("str");
  324. }
  325. return parsed
  326. },
  327. delayExecutionAndCache: function OSF_OUtil$delayExecutionAndCache()
  328. {
  329. var obj={calc: arguments[0]};
  330. return function()
  331. {
  332. if(obj.calc)
  333. {
  334. obj.val=obj.calc.apply(this,arguments);
  335. delete obj.calc
  336. }
  337. return obj.val
  338. }
  339. },
  340. getUniqueId: function OSF_OUtil$getUniqueId()
  341. {
  342. _uniqueId=_uniqueId+1;
  343. return _uniqueId.toString()
  344. },
  345. formatString: function OSF_OUtil$formatString()
  346. {
  347. var args=arguments;
  348. var source=args[0];
  349. return source.replace(/{(\d+)}/gm,function(match, number)
  350. {
  351. var index=parseInt(number,10)+1;
  352. return args[index]===undefined ? "{"+number+"}" : args[index]
  353. })
  354. },
  355. generateConversationId: function OSF_OUtil$generateConversationId()
  356. {
  357. return[_random(),_random(),(new Date).getTime().toString()].join("_")
  358. },
  359. getFrameNameAndConversationId: function OSF_OUtil$getFrameNameAndConversationId(cacheKey, frame)
  360. {
  361. var frameName=_xdmSessionKeyPrefix+cacheKey+this.generateConversationId();
  362. frame.setAttribute("name",frameName);
  363. return this.generateConversationId()
  364. },
  365. addXdmInfoAsHash: function OSF_OUtil$addXdmInfoAsHash(url, xdmInfoValue)
  366. {
  367. return OSF.OUtil.addInfoAsHash(url,_xdmInfoKey,xdmInfoValue)
  368. },
  369. addSerializerVersionAsHash: function OSF_OUtil$addSerializerVersionAsHash(url, serializerVersion)
  370. {
  371. return OSF.OUtil.addInfoAsHash(url,_serializerVersionKey,serializerVersion)
  372. },
  373. addInfoAsHash: function OSF_OUtil$addInfoAsHash(url, keyName, infoValue)
  374. {
  375. url=url.trim() || "";
  376. var urlParts=url.split(_fragmentSeparator);
  377. var urlWithoutFragment=urlParts.shift();
  378. var fragment=urlParts.join(_fragmentSeparator);
  379. return[urlWithoutFragment,_fragmentSeparator,fragment,keyName,infoValue].join("")
  380. },
  381. parseXdmInfo: function OSF_OUtil$parseXdmInfo(skipSessionStorage)
  382. {
  383. return OSF.OUtil.parseXdmInfoWithGivenFragment(skipSessionStorage,window.location.hash)
  384. },
  385. parseXdmInfoWithGivenFragment: function OSF_OUtil$parseXdmInfoWithGivenFragment(skipSessionStorage, fragment)
  386. {
  387. return OSF.OUtil.parseInfoWithGivenFragment(_xdmInfoKey,_xdmSessionKeyPrefix,skipSessionStorage,fragment)
  388. },
  389. parseSerializerVersion: function OSF_OUtil$parseSerializerVersion(skipSessionStorage)
  390. {
  391. return OSF.OUtil.parseSerializerVersionWithGivenFragment(skipSessionStorage,window.location.hash)
  392. },
  393. parseSerializerVersionWithGivenFragment: function OSF_OUtil$parseSerializerVersionWithGivenFragment(skipSessionStorage, fragment)
  394. {
  395. return parseInt(OSF.OUtil.parseInfoWithGivenFragment(_serializerVersionKey,_serializerVersionKeyPrefix,skipSessionStorage,fragment))
  396. },
  397. parseInfoWithGivenFragment: function OSF_OUtil$parseInfoWithGivenFragment(infoKey, infoKeyPrefix, skipSessionStorage, fragment)
  398. {
  399. var fragmentParts=fragment.split(infoKey);
  400. var xdmInfoValue=fragmentParts.length > 1 ? fragmentParts[fragmentParts.length - 1] : null;
  401. var osfSessionStorage=_getSessionStorage();
  402. if(!skipSessionStorage && osfSessionStorage)
  403. {
  404. var sessionKeyStart=window.name.indexOf(infoKeyPrefix);
  405. if(sessionKeyStart > -1)
  406. {
  407. var sessionKeyEnd=window.name.indexOf(";",sessionKeyStart);
  408. if(sessionKeyEnd==-1)
  409. sessionKeyEnd=window.name.length;
  410. var sessionKey=window.name.substring(sessionKeyStart,sessionKeyEnd);
  411. if(xdmInfoValue)
  412. osfSessionStorage.setItem(sessionKey,xdmInfoValue);
  413. else
  414. xdmInfoValue=osfSessionStorage.getItem(sessionKey)
  415. }
  416. }
  417. return xdmInfoValue
  418. },
  419. getConversationId: function OSF_OUtil$getConversationId()
  420. {
  421. var searchString=window.location.search;
  422. var conversationId=null;
  423. if(searchString)
  424. {
  425. var index=searchString.indexOf("&");
  426. conversationId=index > 0 ? searchString.substring(1,index) : searchString.substr(1);
  427. if(conversationId && conversationId.charAt(conversationId.length - 1)==="=")
  428. {
  429. conversationId=conversationId.substring(0,conversationId.length - 1);
  430. if(conversationId)
  431. conversationId=decodeURIComponent(conversationId)
  432. }
  433. }
  434. return conversationId
  435. },
  436. getInfoItems: function OSF_OUtil$getInfoItems(strInfo)
  437. {
  438. var items=strInfo.split("$");
  439. if(typeof items[1]=="undefined")
  440. items=strInfo.split("|");
  441. return items
  442. },
  443. getConversationUrl: function OSF_OUtil$getConversationUrl()
  444. {
  445. var conversationUrl="";
  446. var xdmInfoValue=OSF.OUtil.parseXdmInfo(true);
  447. if(xdmInfoValue)
  448. {
  449. var items=OSF.OUtil.getInfoItems(xdmInfoValue);
  450. if(items !=undefined && items.length >=3)
  451. conversationUrl=items[2]
  452. }
  453. return conversationUrl
  454. },
  455. validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback)
  456. {
  457. var e=Function._validateParams(arguments,[{
  458. name: "params",
  459. type: Object,
  460. mayBeNull: false
  461. },{
  462. name: "expectedProperties",
  463. type: Object,
  464. mayBeNull: false
  465. },{
  466. name: "callback",
  467. type: Function,
  468. mayBeNull: true
  469. }]);
  470. if(e)
  471. throw e;
  472. for(var p in expectedProperties)
  473. {
  474. e=Function._validateParameter(params[p],expectedProperties[p],p);
  475. if(e)
  476. throw e;
  477. }
  478. },
  479. writeProfilerMark: function OSF_OUtil$writeProfilerMark(text)
  480. {
  481. if(window.msWriteProfilerMark)
  482. {
  483. window.msWriteProfilerMark(text);
  484. OsfMsAjaxFactory.msAjaxDebug.trace(text)
  485. }
  486. },
  487. outputDebug: function OSF_OUtil$outputDebug(text)
  488. {
  489. if(typeof Sys !=="undefined" && Sys && Sys.Debug)
  490. OsfMsAjaxFactory.msAjaxDebug.trace(text)
  491. },
  492. defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes)
  493. {
  494. descriptor=descriptor || {};
  495. for(var nd in attributes)
  496. {
  497. var attribute=attributes[nd];
  498. if(descriptor[attribute]==undefined)
  499. descriptor[attribute]=true
  500. }
  501. Object.defineProperty(obj,prop,descriptor);
  502. return obj
  503. },
  504. defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes)
  505. {
  506. descriptors=descriptors || {};
  507. for(var prop in descriptors)
  508. OSF.OUtil.defineNondefaultProperty(obj,prop,descriptors[prop],attributes);
  509. return obj
  510. },
  511. defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor)
  512. {
  513. return OSF.OUtil.defineNondefaultProperty(obj,prop,descriptor,["enumerable"])
  514. },
  515. defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors)
  516. {
  517. return OSF.OUtil.defineNondefaultProperties(obj,descriptors,["enumerable"])
  518. },
  519. defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor)
  520. {
  521. return OSF.OUtil.defineNondefaultProperty(obj,prop,descriptor,["writable","enumerable","configurable"])
  522. },
  523. defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors)
  524. {
  525. return OSF.OUtil.defineNondefaultProperties(obj,descriptors,["writable","enumerable","configurable"])
  526. },
  527. finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor)
  528. {
  529. descriptor=descriptor || {};
  530. var props=Object.getOwnPropertyNames(obj);
  531. var propsLength=props.length;
  532. for(var i=0; i < propsLength; i++)
  533. {
  534. var prop=props[i];
  535. var desc=Object.getOwnPropertyDescriptor(obj,prop);
  536. if(!desc.get && !desc.set)
  537. desc.writable=descriptor.writable || false;
  538. desc.configurable=descriptor.configurable || false;
  539. desc.enumerable=descriptor.enumerable || true;
  540. Object.defineProperty(obj,prop,desc)
  541. }
  542. return obj
  543. },
  544. mapList: function OSF_OUtil$MapList(list, mapFunction)
  545. {
  546. var ret=[];
  547. if(list)
  548. for(var item in list)
  549. ret.push(mapFunction(list[item]));
  550. return ret
  551. },
  552. listContainsKey: function OSF_OUtil$listContainsKey(list, key)
  553. {
  554. for(var item in list)
  555. if(key==item)
  556. return true;
  557. return false
  558. },
  559. listContainsValue: function OSF_OUtil$listContainsElement(list, value)
  560. {
  561. for(var item in list)
  562. if(value==list[item])
  563. return true;
  564. return false
  565. },
  566. augmentList: function OSF_OUtil$augmentList(list, addenda)
  567. {
  568. var add=list.push ? function(key, value)
  569. {
  570. list.push(value)
  571. } : function(key, value)
  572. {
  573. list[key]=value
  574. };
  575. for(var key in addenda)
  576. add(key,addenda[key])
  577. },
  578. redefineList: function OSF_Outil$redefineList(oldList, newList)
  579. {
  580. for(var key1 in oldList)
  581. delete oldList[key1];
  582. for(var key2 in newList)
  583. oldList[key2]=newList[key2]
  584. },
  585. isArray: function OSF_OUtil$isArray(obj)
  586. {
  587. return Object.prototype.toString.apply(obj)==="[object Array]"
  588. },
  589. isFunction: function OSF_OUtil$isFunction(obj)
  590. {
  591. return Object.prototype.toString.apply(obj)==="[object Function]"
  592. },
  593. isDate: function OSF_OUtil$isDate(obj)
  594. {
  595. return Object.prototype.toString.apply(obj)==="[object Date]"
  596. },
  597. addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener)
  598. {
  599. if(element.addEventListener)
  600. element.addEventListener(eventName,listener,false);
  601. else if(Sys.Browser.agent===Sys.Browser.InternetExplorer && element.attachEvent)
  602. element.attachEvent("on"+eventName,listener);
  603. else
  604. element["on"+eventName]=listener
  605. },
  606. removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener)
  607. {
  608. if(element.removeEventListener)
  609. element.removeEventListener(eventName,listener,false);
  610. else if(Sys.Browser.agent===Sys.Browser.InternetExplorer && element.detachEvent)
  611. element.detachEvent("on"+eventName,listener);
  612. else
  613. element["on"+eventName]=null
  614. },
  615. getCookieValue: function OSF_OUtil$getCookieValue(cookieName)
  616. {
  617. var tmpCookieString=RegExp(cookieName+"[^;]+").exec(document.cookie);
  618. return tmpCookieString.toString().replace(/^[^=]+./,"")
  619. },
  620. xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError)
  621. {
  622. var xmlhttp;
  623. try
  624. {
  625. xmlhttp=new XMLHttpRequest;
  626. xmlhttp.onreadystatechange=function()
  627. {
  628. if(xmlhttp.readyState==4)
  629. if(xmlhttp.status==200)
  630. onSuccess(xmlhttp.responseText);
  631. else
  632. onError(xmlhttp.status)
  633. };
  634. xmlhttp.open("GET",url,true);
  635. xmlhttp.send()
  636. }
  637. catch(ex)
  638. {
  639. onError(ex)
  640. }
  641. },
  642. xhrGetFull: function OSF_OUtil$xhrGetFull(url, oneDriveFileName, onSuccess, onError)
  643. {
  644. var xmlhttp;
  645. var requestedFileName=oneDriveFileName;
  646. try
  647. {
  648. xmlhttp=new XMLHttpRequest;
  649. xmlhttp.onreadystatechange=function()
  650. {
  651. if(xmlhttp.readyState==4)
  652. if(xmlhttp.status==200)
  653. onSuccess(xmlhttp,requestedFileName);
  654. else
  655. onError(xmlhttp.status)
  656. };
  657. xmlhttp.open("GET",url,true);
  658. xmlhttp.send()
  659. }
  660. catch(ex)
  661. {
  662. onError(ex)
  663. }
  664. },
  665. encodeBase64: function OSF_Outil$encodeBase64(input)
  666. {
  667. if(!input)
  668. return input;
  669. var codex="ABCDEFGHIJKLMNOP"+"QRSTUVWXYZabcdef"+"ghijklmnopqrstuv"+"wxyz0123456789+/=";
  670. var output=[];
  671. var temp=[];
  672. var index=0;
  673. var c1,
  674. c2,
  675. c3,
  676. a,
  677. b,
  678. c;
  679. var i;
  680. var length=input.length;
  681. do
  682. {
  683. c1=input.charCodeAt(index++);
  684. c2=input.charCodeAt(index++);
  685. c3=input.charCodeAt(index++);
  686. i=0;
  687. a=c1 & 255;
  688. b=c1 >> 8;
  689. c=c2 & 255;
  690. temp[i++]=a >> 2;
  691. temp[i++]=(a & 3) << 4 | b >> 4;
  692. temp[i++]=(b & 15) << 2 | c >> 6;
  693. temp[i++]=c & 63;
  694. if(!isNaN(c2))
  695. {
  696. a=c2 >> 8;
  697. b=c3 & 255;
  698. c=c3 >> 8;
  699. temp[i++]=a >> 2;
  700. temp[i++]=(a & 3) << 4 | b >> 4;
  701. temp[i++]=(b & 15) << 2 | c >> 6;
  702. temp[i++]=c & 63
  703. }
  704. if(isNaN(c2))
  705. temp[i - 1]=64;
  706. else if(isNaN(c3))
  707. {
  708. temp[i - 2]=64;
  709. temp[i - 1]=64
  710. }
  711. for(var t=0; t < i; t++)
  712. output.push(codex.charAt(temp[t]))
  713. } while(index < length);
  714. return output.join("")
  715. },
  716. getSessionStorage: function OSF_Outil$getSessionStorage()
  717. {
  718. return _getSessionStorage()
  719. },
  720. getLocalStorage: function OSF_Outil$getLocalStorage()
  721. {
  722. if(!_safeLocalStorage)
  723. {
  724. try
  725. {
  726. var localStorage=window.localStorage
  727. }
  728. catch(ex)
  729. {
  730. localStorage=null
  731. }
  732. _safeLocalStorage=new OfficeExt.SafeStorage(localStorage)
  733. }
  734. return _safeLocalStorage
  735. },
  736. convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val)
  737. {
  738. var hex="#"+(Number(val)+16777216).toString(16).slice(-6);
  739. return hex
  740. },
  741. attachClickHandler: function OSF_Outil$attachClickHandler(element, handler)
  742. {
  743. element.onclick=function(e)
  744. {
  745. handler()
  746. };
  747. element.ontouchend=function(e)
  748. {
  749. handler();
  750. e.preventDefault()
  751. }
  752. },
  753. getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName)
  754. {
  755. var e=Function._validateParams(arguments,[{
  756. name: "queryString",
  757. type: String,
  758. mayBeNull: false
  759. },{
  760. name: "paramName",
  761. type: String,
  762. mayBeNull: false
  763. }]);
  764. if(e)
  765. {
  766. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null.");
  767. return""
  768. }
  769. var queryExp=new RegExp("[\\?&]"+paramName+"=([^&#]*)","i");
  770. if(!queryExp.test(queryString))
  771. {
  772. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found.");
  773. return""
  774. }
  775. return queryExp.exec(queryString)[1]
  776. },
  777. isiOS: function OSF_Outil$isiOS()
  778. {
  779. return window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false
  780. },
  781. shallowCopy: function OSF_Outil$shallowCopy(sourceObj)
  782. {
  783. var copyObj=sourceObj.constructor();
  784. for(var property in sourceObj)
  785. if(sourceObj.hasOwnProperty(property))
  786. copyObj[property]=sourceObj[property];
  787. return copyObj
  788. },
  789. serializeOMEXResponseErrorMessage: function OSF_Outil$serializeObjectToString(response)
  790. {
  791. if(typeof JSON !=="undefined")
  792. try
  793. {
  794. return JSON.stringify(response)
  795. }
  796. catch(ex){}
  797. return""
  798. },
  799. createObject: function OSF_Outil$createObject(properties)
  800. {
  801. var obj=null;
  802. if(properties)
  803. {
  804. obj={};
  805. var len=properties.length;
  806. for(var i=0; i < len; i++)
  807. obj[properties[i].name]=properties[i].value
  808. }
  809. return obj
  810. }
  811. }
  812. }();
  813. OSF.OUtil.Guid=function()
  814. {
  815. var hexCode=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];
  816. return{generateNewGuid: function OSF_Outil_Guid$generateNewGuid()
  817. {
  818. var result="";
  819. var tick=(new Date).getTime();
  820. var index=0;
  821. for(; index < 32 && tick > 0; index++)
  822. {
  823. if(index==8 || index==12 || index==16 || index==20)
  824. result+="-";
  825. result+=hexCode[tick % 16];
  826. tick=Math.floor(tick / 16)
  827. }
  828. for(; index < 32; index++)
  829. {
  830. if(index==8 || index==12 || index==16 || index==20)
  831. result+="-";
  832. result+=hexCode[Math.floor(Math.random() * 16)]
  833. }
  834. return result
  835. }}
  836. }();
  837. window.OSF=OSF;
  838. OSF.OUtil.setNamespace("OSF",window);
  839. OSF.AppName={
  840. Unsupported: 0,
  841. Excel: 1,
  842. Word: 2,
  843. PowerPoint: 4,
  844. Outlook: 8,
  845. ExcelWebApp: 16,
  846. WordWebApp: 32,
  847. OutlookWebApp: 64,
  848. Project: 128,
  849. AccessWebApp: 256,
  850. PowerpointWebApp: 512,
  851. ExcelIOS: 1024,
  852. Sway: 2048,
  853. WordIOS: 4096,
  854. PowerPointIOS: 8192,
  855. Access: 16384,
  856. Lync: 32768,
  857. OutlookIOS: 65536,
  858. OneNoteWebApp: 131072
  859. };
  860. OSF.InternalPerfMarker={
  861. DataCoercionBegin: "Agave.HostCall.CoerceDataStart",
  862. DataCoercionEnd: "Agave.HostCall.CoerceDataEnd"
  863. };
  864. OSF.HostCallPerfMarker={
  865. IssueCall: "Agave.HostCall.IssueCall",
  866. ReceiveResponse: "Agave.HostCall.ReceiveResponse",
  867. RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised"
  868. };
  869. OSF.AgaveHostAction={
  870. Select: 0,
  871. UnSelect: 1,
  872. CancelDialog: 2,
  873. InsertAgave: 3,
  874. CtrlF6In: 4,
  875. CtrlF6Exit: 5,
  876. CtrlF6ExitShift: 6,
  877. SelectWithError: 7,
  878. NotifyHostError: 8,
  879. RefreshAddinCommands: 9
  880. };
  881. OSF.SharedConstants={NotificationConversationIdSuffix: "_ntf"};
  882. OSF.DialogMessageType={
  883. DialogMessageReceived: 0,
  884. DialogClosed: 1,
  885. NavigationFailed: 2,
  886. InvalidSchema: 3
  887. };
  888. OSF.OfficeAppContext=function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix)
  889. {
  890. this._id=id;
  891. this._appName=appName;
  892. this._appVersion=appVersion;
  893. this._appUILocale=appUILocale;
  894. this._dataLocale=dataLocale;
  895. this._docUrl=docUrl;
  896. this._clientMode=clientMode;
  897. this._settings=settings;
  898. this._reason=reason;
  899. this._osfControlType=osfControlType;
  900. this._eToken=eToken;
  901. this._correlationId=correlationId;
  902. this._appInstanceId=appInstanceId;
  903. this._touchEnabled=touchEnabled;
  904. this._commerceAllowed=commerceAllowed;
  905. this._appMinorVersion=appMinorVersion;
  906. this._requirementMatrix=requirementMatrix;
  907. this._isDialog=false;
  908. this.get_id=function get_id()
  909. {
  910. return this._id
  911. };
  912. this.get_appName=function get_appName()
  913. {
  914. return this._appName
  915. };
  916. this.get_appVersion=function get_appVersion()
  917. {
  918. return this._appVersion
  919. };
  920. this.get_appUILocale=function get_appUILocale()
  921. {
  922. return this._appUILocale
  923. };
  924. this.get_dataLocale=function get_dataLocale()
  925. {
  926. return this._dataLocale
  927. };
  928. this.get_docUrl=function get_docUrl()
  929. {
  930. return this._docUrl
  931. };
  932. this.get_clientMode=function get_clientMode()
  933. {
  934. return this._clientMode
  935. };
  936. this.get_bindings=function get_bindings()
  937. {
  938. return this._bindings
  939. };
  940. this.get_settings=function get_settings()
  941. {
  942. return this._settings
  943. };
  944. this.get_reason=function get_reason()
  945. {
  946. return this._reason
  947. };
  948. this.get_osfControlType=function get_osfControlType()
  949. {
  950. return this._osfControlType
  951. };
  952. this.get_eToken=function get_eToken()
  953. {
  954. return this._eToken
  955. };
  956. this.get_correlationId=function get_correlationId()
  957. {
  958. return this._correlationId
  959. };
  960. this.get_appInstanceId=function get_appInstanceId()
  961. {
  962. return this._appInstanceId
  963. };
  964. this.get_touchEnabled=function get_touchEnabled()
  965. {
  966. return this._touchEnabled
  967. };
  968. this.get_commerceAllowed=function get_commerceAllowed()
  969. {
  970. return this._commerceAllowed
  971. };
  972. this.get_appMinorVersion=function get_appMinorVersion()
  973. {
  974. return this._appMinorVersion
  975. };
  976. this.get_requirementMatrix=function get_requirementMatrix()
  977. {
  978. return this._requirementMatrix
  979. };
  980. this.get_isDialog=function get_isDialog()
  981. {
  982. return this._isDialog
  983. }
  984. };
  985. OSF.OsfControlType={
  986. DocumentLevel: 0,
  987. ContainerLevel: 1
  988. };
  989. OSF.ClientMode={
  990. ReadOnly: 0,
  991. ReadWrite: 1
  992. };
  993. OSF.OUtil.setNamespace("Microsoft",window);
  994. OSF.OUtil.setNamespace("Office",Microsoft);
  995. OSF.OUtil.setNamespace("Client",Microsoft.Office);
  996. OSF.OUtil.setNamespace("WebExtension",Microsoft.Office);
  997. Microsoft.Office.WebExtension.InitializationReason={
  998. Inserted: "inserted",
  999. DocumentOpened: "documentOpened"
  1000. };
  1001. Microsoft.Office.WebExtension.ValueFormat={
  1002. Unformatted: "unformatted",
  1003. Formatted: "formatted"
  1004. };
  1005. Microsoft.Office.WebExtension.FilterType={All: "all"};
  1006. Microsoft.Office.WebExtension.Parameters={
  1007. BindingType: "bindingType",
  1008. CoercionType: "coercionType",
  1009. ValueFormat: "valueFormat",
  1010. FilterType: "filterType",
  1011. Columns: "columns",
  1012. SampleData: "sampleData",
  1013. GoToType: "goToType",
  1014. SelectionMode: "selectionMode",
  1015. Id: "id",
  1016. PromptText: "promptText",
  1017. ItemName: "itemName",
  1018. FailOnCollision: "failOnCollision",
  1019. StartRow: "startRow",
  1020. StartColumn: "startColumn",
  1021. RowCount: "rowCount",
  1022. ColumnCount: "columnCount",
  1023. Callback: "callback",
  1024. AsyncContext: "asyncContext",
  1025. Data: "data",
  1026. Rows: "rows",
  1027. OverwriteIfStale: "overwriteIfStale",
  1028. FileType: "fileType",
  1029. EventType: "eventType",
  1030. Handler: "handler",
  1031. SliceSize: "sliceSize",
  1032. SliceIndex: "sliceIndex",
  1033. ActiveView: "activeView",
  1034. Status: "status",
  1035. Xml: "xml",
  1036. Namespace: "namespace",
  1037. Prefix: "prefix",
  1038. XPath: "xPath",
  1039. Text: "text",
  1040. ImageLeft: "imageLeft",
  1041. ImageTop: "imageTop",
  1042. ImageWidth: "imageWidth",
  1043. ImageHeight: "imageHeight",
  1044. TaskId: "taskId",
  1045. FieldId: "fieldId",
  1046. FieldValue: "fieldValue",
  1047. ServerUrl: "serverUrl",
  1048. ListName: "listName",
  1049. ResourceId: "resourceId",
  1050. ViewType: "viewType",
  1051. ViewName: "viewName",
  1052. GetRawValue: "getRawValue",
  1053. CellFormat: "cellFormat",
  1054. TableOptions: "tableOptions",
  1055. TaskIndex: "taskIndex",
  1056. ResourceIndex: "resourceIndex",
  1057. Url: "url",
  1058. MessageHandler: "messageHandler",
  1059. Width: "width",
  1060. Height: "height",
  1061. RequireHTTPs: "requireHTTPS",
  1062. MessageToParent: "messageToParent",
  1063. XFrameDenySafe: "xFrameDenySafe"
  1064. };
  1065. OSF.OUtil.setNamespace("DDA",OSF);
  1066. OSF.DDA.DocumentMode={
  1067. ReadOnly: 1,
  1068. ReadWrite: 0
  1069. };
  1070. OSF.DDA.PropertyDescriptors={AsyncResultStatus: "AsyncResultStatus"};
  1071. OSF.DDA.EventDescriptors={};
  1072. OSF.DDA.ListDescriptors={};
  1073. OSF.DDA.UI={};
  1074. OSF.DDA.getXdmEventName=function OSF_DDA$GetXdmEventName(bindingId, eventType)
  1075. {
  1076. if(eventType==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged || eventType==Microsoft.Office.WebExtension.EventType.BindingDataChanged)
  1077. return bindingId+"_"+eventType;
  1078. else
  1079. return eventType
  1080. };
  1081. OSF.DDA.MethodDispId={
  1082. dispidMethodMin: 64,
  1083. dispidGetSelectedDataMethod: 64,
  1084. dispidSetSelectedDataMethod: 65,
  1085. dispidAddBindingFromSelectionMethod: 66,
  1086. dispidAddBindingFromPromptMethod: 67,
  1087. dispidGetBindingMethod: 68,
  1088. dispidReleaseBindingMethod: 69,
  1089. dispidGetBindingDataMethod: 70,
  1090. dispidSetBindingDataMethod: 71,
  1091. dispidAddRowsMethod: 72,
  1092. dispidClearAllRowsMethod: 73,
  1093. dispidGetAllBindingsMethod: 74,
  1094. dispidLoadSettingsMethod: 75,
  1095. dispidSaveSettingsMethod: 76,
  1096. dispidGetDocumentCopyMethod: 77,
  1097. dispidAddBindingFromNamedItemMethod: 78,
  1098. dispidAddColumnsMethod: 79,
  1099. dispidGetDocumentCopyChunkMethod: 80,
  1100. dispidReleaseDocumentCopyMethod: 81,
  1101. dispidNavigateToMethod: 82,
  1102. dispidGetActiveViewMethod: 83,
  1103. dispidGetDocumentThemeMethod: 84,
  1104. dispidGetOfficeThemeMethod: 85,
  1105. dispidGetFilePropertiesMethod: 86,
  1106. dispidClearFormatsMethod: 87,
  1107. dispidSetTableOptionsMethod: 88,
  1108. dispidSetFormatsMethod: 89,
  1109. dispidExecuteRichApiRequestMethod: 93,
  1110. dispidAppCommandInvocationCompletedMethod: 94,
  1111. dispidAddDataPartMethod: 128,
  1112. dispidGetDataPartByIdMethod: 129,
  1113. dispidGetDataPartsByNamespaceMethod: 130,
  1114. dispidGetDataPartXmlMethod: 131,
  1115. dispidGetDataPartNodesMethod: 132,
  1116. dispidDeleteDataPartMethod: 133,
  1117. dispidGetDataNodeValueMethod: 134,
  1118. dispidGetDataNodeXmlMethod: 135,
  1119. dispidGetDataNodesMethod: 136,
  1120. dispidSetDataNodeValueMethod: 137,
  1121. dispidSetDataNodeXmlMethod: 138,
  1122. dispidAddDataNamespaceMethod: 139,
  1123. dispidGetDataUriByPrefixMethod: 140,
  1124. dispidGetDataPrefixByUriMethod: 141,
  1125. dispidGetDataNodeTextMethod: 142,
  1126. dispidSetDataNodeTextMethod: 143,
  1127. dispidMethodMax: 143,
  1128. dispidGetSelectedTaskMethod: 110,
  1129. dispidGetSelectedResourceMethod: 111,
  1130. dispidGetTaskMethod: 112,
  1131. dispidGetResourceFieldMethod: 113,
  1132. dispidGetWSSUrlMethod: 114,
  1133. dispidGetTaskFieldMethod: 115,
  1134. dispidGetProjectFieldMethod: 116,
  1135. dispidGetSelectedViewMethod: 117,
  1136. dispidGetTaskByIndexMethod: 118,
  1137. dispidGetResourceByIndexMethod: 119,
  1138. dispidSetTaskFieldMethod: 120,
  1139. dispidSetResourceFieldMethod: 121,
  1140. dispidGetMaxTaskIndexMethod: 122,
  1141. dispidGetMaxResourceIndexMethod: 123,
  1142. dispidMessageParentMethod: 900
  1143. };
  1144. OSF.DDA.EventDispId={
  1145. dispidEventMin: 0,
  1146. dispidInitializeEvent: 0,
  1147. dispidSettingsChangedEvent: 1,
  1148. dispidDocumentSelectionChangedEvent: 2,
  1149. dispidBindingSelectionChangedEvent: 3,
  1150. dispidBindingDataChangedEvent: 4,
  1151. dispidDocumentOpenEvent: 5,
  1152. dispidDocumentCloseEvent: 6,
  1153. dispidActiveViewChangedEvent: 7,
  1154. dispidDocumentThemeChangedEvent: 8,
  1155. dispidOfficeThemeChangedEvent: 9,
  1156. dispidDialogMessageReceivedEvent: 10,
  1157. dispidActivationStatusChangedEvent: 32,
  1158. dispidAppCommandInvokedEvent: 39,
  1159. dispidTaskSelectionChangedEvent: 56,
  1160. dispidResourceSelectionChangedEvent: 57,
  1161. dispidViewSelectionChangedEvent: 58,
  1162. dispidDataNodeAddedEvent: 60,
  1163. dispidDataNodeReplacedEvent: 61,
  1164. dispidDataNodeDeletedEvent: 62,
  1165. dispidEventMax: 63
  1166. };
  1167. OSF.DDA.ErrorCodeManager=function()
  1168. {
  1169. var _errorMappings={};
  1170. return{
  1171. getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode)
  1172. {
  1173. var errorArgs=_errorMappings[errorCode];
  1174. if(!errorArgs)
  1175. errorArgs=_errorMappings[this.errorCodes.ooeInternalError];
  1176. if(!errorArgs.name)
  1177. errorArgs.name=_errorMappings[this.errorCodes.ooeInternalError].name;
  1178. if(!errorArgs.message)
  1179. errorArgs.message=_errorMappings[this.errorCodes.ooeInternalError].message;
  1180. return errorArgs
  1181. },
  1182. addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage)
  1183. {
  1184. _errorMappings[errorCode]=errorNameMessage
  1185. },
  1186. errorCodes: {
  1187. ooeSuccess: 0,
  1188. ooeChunkResult: 1,
  1189. ooeCoercionTypeNotSupported: 1e3,
  1190. ooeGetSelectionNotMatchDataType: 1001,
  1191. ooeCoercionTypeNotMatchBinding: 1002,
  1192. ooeInvalidGetRowColumnCounts: 1003,
  1193. ooeSelectionNotSupportCoercionType: 1004,
  1194. ooeInvalidGetStartRowColumn: 1005,
  1195. ooeNonUniformPartialGetNotSupported: 1006,
  1196. ooeGetDataIsTooLarge: 1008,
  1197. ooeFileTypeNotSupported: 1009,
  1198. ooeGetDataParametersConflict: 1010,
  1199. ooeInvalidGetColumns: 1011,
  1200. ooeInvalidGetRows: 1012,
  1201. ooeInvalidReadForBlankRow: 1013,
  1202. ooeUnsupportedDataObject: 2e3,
  1203. ooeCannotWriteToSelection: 2001,
  1204. ooeDataNotMatchSelection: 2002,
  1205. ooeOverwriteWorksheetData: 2003,
  1206. ooeDataNotMatchBindingSize: 2004,
  1207. ooeInvalidSetStartRowColumn: 2005,
  1208. ooeInvalidDataFormat: 2006,
  1209. ooeDataNotMatchCoercionType: 2007,
  1210. ooeDataNotMatchBindingType: 2008,
  1211. ooeSetDataIsTooLarge: 2009,
  1212. ooeNonUniformPartialSetNotSupported: 2010,
  1213. ooeInvalidSetColumns: 2011,
  1214. ooeInvalidSetRows: 2012,
  1215. ooeSetDataParametersConflict: 2013,
  1216. ooeCellDataAmountBeyondLimits: 2014,
  1217. ooeSelectionCannotBound: 3e3,
  1218. ooeBindingNotExist: 3002,
  1219. ooeBindingToMultipleSelection: 3003,
  1220. ooeInvalidSelectionForBindingType: 3004,
  1221. ooeOperationNotSupportedOnThisBindingType: 3005,
  1222. ooeNamedItemNotFound: 3006,
  1223. ooeMultipleNamedItemFound: 3007,
  1224. ooeInvalidNamedItemForBindingType: 3008,
  1225. ooeUnknownBindingType: 3009,
  1226. ooeOperationNotSupportedOnMatrixData: 3010,
  1227. ooeInvalidColumnsForBinding: 3011,
  1228. ooeSettingNameNotExist: 4e3,
  1229. ooeSettingsCannotSave: 4001,
  1230. ooeSettingsAreStale: 4002,
  1231. ooeOperationNotSupported: 5e3,
  1232. ooeInternalError: 5001,
  1233. ooeDocumentReadOnly: 5002,
  1234. ooeEventHandlerNotExist: 5003,
  1235. ooeInvalidApiCallInContext: 5004,
  1236. ooeShuttingDown: 5005,
  1237. ooeUnsupportedEnumeration: 5007,
  1238. ooeIndexOutOfRange: 5008,
  1239. ooeBrowserAPINotSupported: 5009,
  1240. ooeInvalidParam: 5010,
  1241. ooeRequestTimeout: 5011,
  1242. ooeTooManyIncompleteRequests: 5100,
  1243. ooeRequestTokenUnavailable: 5101,
  1244. ooeActivityLimitReached: 5102,
  1245. ooeCustomXmlNodeNotFound: 6e3,
  1246. ooeCustomXmlError: 6100,
  1247. ooeCustomXmlExceedQuota: 6101,
  1248. ooeCustomXmlOutOfDate: 6102,
  1249. ooeNoCapability: 7e3,
  1250. ooeCannotNavTo: 7001,
  1251. ooeSpecifiedIdNotExist: 7002,
  1252. ooeNavOutOfBound: 7004,
  1253. ooeElementMissing: 8e3,
  1254. ooeProtectedError: 8001,
  1255. ooeInvalidCellsValue: 8010,
  1256. ooeInvalidTableOptionValue: 8011,
  1257. ooeInvalidFormatValue: 8012,
  1258. ooeRowIndexOutOfRange: 8020,
  1259. ooeColIndexOutOfRange: 8021,
  1260. ooeFormatValueOutOfRange: 8022,
  1261. ooeCellFormatAmountBeyondLimits: 8023,
  1262. ooeMemoryFileLimit: 11e3,
  1263. ooeNetworkProblemRetrieveFile: 11001,
  1264. ooeInvalidSliceSize: 11002,
  1265. ooeInvalidCallback: 11101,
  1266. ooeInvalidWidth: 12e3,
  1267. ooeInvalidHeight: 12001,
  1268. ooeNavigationError: 12002,
  1269. ooeInvalidScheme: 12003,
  1270. ooeAppDomains: 12004,
  1271. ooeRequireHTTPS: 12005,
  1272. ooeWebDialogClosed: 12006,
  1273. ooeDialogAlreadyOpened: 12007
  1274. },
  1275. initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS)
  1276. {
  1277. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={
  1278. name: stringNS.L_InvalidCoercion,
  1279. message: stringNS.L_CoercionTypeNotSupported
  1280. };
  1281. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={
  1282. name: stringNS.L_DataReadError,
  1283. message: stringNS.L_GetSelectionNotSupported
  1284. };
  1285. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={
  1286. name: stringNS.L_InvalidCoercion,
  1287. message: stringNS.L_CoercionTypeNotMatchBinding
  1288. };
  1289. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={
  1290. name: stringNS.L_DataReadError,
  1291. message: stringNS.L_InvalidGetRowColumnCounts
  1292. };
  1293. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={
  1294. name: stringNS.L_DataReadError,
  1295. message: stringNS.L_SelectionNotSupportCoercionType
  1296. };
  1297. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={
  1298. name: stringNS.L_DataReadError,
  1299. message: stringNS.L_InvalidGetStartRowColumn
  1300. };
  1301. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={
  1302. name: stringNS.L_DataReadError,
  1303. message: stringNS.L_NonUniformPartialGetNotSupported
  1304. };
  1305. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={
  1306. name: stringNS.L_DataReadError,
  1307. message: stringNS.L_GetDataIsTooLarge
  1308. };
  1309. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={
  1310. name: stringNS.L_DataReadError,
  1311. message: stringNS.L_FileTypeNotSupported
  1312. };
  1313. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={
  1314. name: stringNS.L_DataReadError,
  1315. message: stringNS.L_GetDataParametersConflict
  1316. };
  1317. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={
  1318. name: stringNS.L_DataReadError,
  1319. message: stringNS.L_InvalidGetColumns
  1320. };
  1321. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={
  1322. name: stringNS.L_DataReadError,
  1323. message: stringNS.L_InvalidGetRows
  1324. };
  1325. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={
  1326. name: stringNS.L_DataReadError,
  1327. message: stringNS.L_InvalidReadForBlankRow
  1328. };
  1329. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={
  1330. name: stringNS.L_DataWriteError,
  1331. message: stringNS.L_UnsupportedDataObject
  1332. };
  1333. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={
  1334. name: stringNS.L_DataWriteError,
  1335. message: stringNS.L_CannotWriteToSelection
  1336. };
  1337. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={
  1338. name: stringNS.L_DataWriteError,
  1339. message: stringNS.L_DataNotMatchSelection
  1340. };
  1341. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={
  1342. name: stringNS.L_DataWriteError,
  1343. message: stringNS.L_OverwriteWorksheetData
  1344. };
  1345. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={
  1346. name: stringNS.L_DataWriteError,
  1347. message: stringNS.L_DataNotMatchBindingSize
  1348. };
  1349. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={
  1350. name: stringNS.L_DataWriteError,
  1351. message: stringNS.L_InvalidSetStartRowColumn
  1352. };
  1353. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={
  1354. name: stringNS.L_InvalidFormat,
  1355. message: stringNS.L_InvalidDataFormat
  1356. };
  1357. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={
  1358. name: stringNS.L_InvalidDataObject,
  1359. message: stringNS.L_DataNotMatchCoercionType
  1360. };
  1361. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={
  1362. name: stringNS.L_InvalidDataObject,
  1363. message: stringNS.L_DataNotMatchBindingType
  1364. };
  1365. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={
  1366. name: stringNS.L_DataWriteError,
  1367. message: stringNS.L_SetDataIsTooLarge
  1368. };
  1369. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={
  1370. name: stringNS.L_DataWriteError,
  1371. message: stringNS.L_NonUniformPartialSetNotSupported
  1372. };
  1373. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={
  1374. name: stringNS.L_DataWriteError,
  1375. message: stringNS.L_InvalidSetColumns
  1376. };
  1377. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={
  1378. name: stringNS.L_DataWriteError,
  1379. message: stringNS.L_InvalidSetRows
  1380. };
  1381. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={
  1382. name: stringNS.L_DataWriteError,
  1383. message: stringNS.L_SetDataParametersConflict
  1384. };
  1385. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={
  1386. name: stringNS.L_BindingCreationError,
  1387. message: stringNS.L_SelectionCannotBound
  1388. };
  1389. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={
  1390. name: stringNS.L_InvalidBindingError,
  1391. message: stringNS.L_BindingNotExist
  1392. };
  1393. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={
  1394. name: stringNS.L_BindingCreationError,
  1395. message: stringNS.L_BindingToMultipleSelection
  1396. };
  1397. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={
  1398. name: stringNS.L_BindingCreationError,
  1399. message: stringNS.L_InvalidSelectionForBindingType
  1400. };
  1401. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={
  1402. name: stringNS.L_InvalidBindingOperation,
  1403. message: stringNS.L_OperationNotSupportedOnThisBindingType
  1404. };
  1405. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={
  1406. name: stringNS.L_BindingCreationError,
  1407. message: stringNS.L_NamedItemNotFound
  1408. };
  1409. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={
  1410. name: stringNS.L_BindingCreationError,
  1411. message: stringNS.L_MultipleNamedItemFound
  1412. };
  1413. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={
  1414. name: stringNS.L_BindingCreationError,
  1415. message: stringNS.L_InvalidNamedItemForBindingType
  1416. };
  1417. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={
  1418. name: stringNS.L_InvalidBinding,
  1419. message: stringNS.L_UnknownBindingType
  1420. };
  1421. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={
  1422. name: stringNS.L_InvalidBindingOperation,
  1423. message: stringNS.L_OperationNotSupportedOnMatrixData
  1424. };
  1425. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={
  1426. name: stringNS.L_InvalidBinding,
  1427. message: stringNS.L_InvalidColumnsForBinding
  1428. };
  1429. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={
  1430. name: stringNS.L_ReadSettingsError,
  1431. message: stringNS.L_SettingNameNotExist
  1432. };
  1433. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={
  1434. name: stringNS.L_SaveSettingsError,
  1435. message: stringNS.L_SettingsCannotSave
  1436. };
  1437. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={
  1438. name: stringNS.L_SettingsStaleError,
  1439. message: stringNS.L_SettingsAreStale
  1440. };
  1441. I_errorMappings[OSF.DDA.ErrorCodeM`nager.errorColes.ooeOperationNotSupported]={
  1442. ) name: stringNS.L_HostError,
  1443. messagez stringNS.L_OperationNotSupported
  1444. };
  1445. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]=û
  1446. name: stringNS.L_InternalError,
  1447. ) oessage: stringNS.L_InternalErrordescription
  1448. };
  1449. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={
  1450. name: stringNS.L_PermissionDenied,
  1451. message: stringNS.L_DocumentReadOnly
  1452. };
  1453. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={
  1454. name: stringNS.L_EventRegistrationError,
  1455. message: stringNS.L_EventHandlerNotExist
  1456. };
  1457. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={
  1458. name: stringNS.L_InvalidAPICall,
  1459. message: stringNS.L_InvalidApiCallInContext
  1460. };
  1461. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={
  1462. name: stringNS.L_ShuttingDown,
  1463. message: stringNS.L_ShuttingDown
  1464. };
  1465. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={
  1466. name: stringNS.L_UnsupportedEnumeration,
  1467. message: stringNS.L_UnsupportedEnumerationMessage
  1468. };
  1469. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={
  1470. name: stringNS.L_IndexOutOfRange,
  1471. message: stringNS.L_IndexOutOfRange
  1472. };
  1473. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={
  1474. îame: s|ringNS.L_APINotSupported,
  1475. messcge: suringNS.L_BrowserAPINotSupported
  1476. };
  1477. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={
  1478. name: stringNS.L_APICallFailed,
  1479. message: striogNS.L_RequestTimeout
  1480. };
  1481. _errorOappinos[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompluteRequests]={
  1482. name: stringNS.L_APICallFailed,
  1483. message: stringNS.L_TooManyIncompleteRequests
  1484. };
  1485. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={
  1486. name: stringNS.L_APICallFailed,
  1487. message: stringNS.L_RequestTokenUnavailable
  1488. };
  1489. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={
  1490. name: stringNS.L_APICallFailed,
  1491. message: stringNS.L_ActivityLimitReached
  1492. };
  1493. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={
  1494. name: stringNS.L_InvalidNode,
  1495. message: stringNS.L_CustomXmlNodeNotFound
  1496. };
  1497. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={
  1498. name: stringNS.L_CustomXmlError,
  1499. message: stringNS.L_CustomXmlError
  1500. };
  1501. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={
  1502. name: stringNS.L_CustomXmlError,
  1503. message: stringNS.L_CustomXmlError
  1504. };
  1505. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={
  1506. name: stringNS.L_CustomXmlError,
  1507. message: stringNS.L_CustomXmlError
  1508. };
  1509. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodec.ooeNoCapabiliuy]={�
  1510. name: stringNS.L_PermissionDenied,
  1511. íessage: stringNS.H_NoCapability
  1512. };
  1513. _errorMappings[OSF®DDA.ErrorSodeManager.errorCodes.ooeCannotOavTo]={
  1514. name: stringNS.L_CannotNavigateTo,
  1515. message: stringNS.L_CannotNavigateTo
  1516. };
  1517. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={
  1518. Name: stringNS.L_SpecifiedIdNotExist,
  1519. message: stringNS.L_SpecifiedIdNotExist
  1520. };
  1521. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={
  1522. name: stringNS.L_NavOutOfBound,
  1523. message: stringNS.L_NavOutOfBound
  1524. };
  1525. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={
  1526. name: stringNS.L_DataWriteReminder,
  1527. message: stringNS.L_CellDataAmountBeyondLimits
  1528. };
  1529. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={
  1530. name: stringNS.L_MissingParameter,
  1531. message: stringNS.L_ElementMissing
  1532. };
  1533. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={
  1534. name: stringNS.L_PermissionDenied,
  1535. message: stringNS.L_NoCapability
  1536. };
  1537. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={
  1538. name: stringNS.L_InvalidValue,
  1539. message: stringNS.L_InvalidCellsValue
  1540. };
  1541. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={
  1542. name: stringNS.L_InvalidValue,
  1543. message: stringNS.L_InvalidTableOptionValue
  1544. };
  1545. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={
  1546. name: stringNS.L_InvalidValue,
  1547. message: stringNS.L_InvalidFormatValue
  1548. };
  1549. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={
  1550. name: stringNS.L_OutOfRange,
  1551. message: stringNS.L_RowIndexOutOfRange
  1552. };
  1553. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={
  1554. name: stringNS.L_OutOfRange,
  1555. message: stringNS.L_ColIndexOutOfRange
  1556. };
  1557. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={
  1558. name: stringNS.L_OutOfRange,
  1559. message: stringNS.L_FormatValueOutOfRange
  1560. };
  1561. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={
  1562. name: stringNS.L_FormattingReminder,
  1563. message: stringNS.L_CellFormatAmountBeyondLimits
  1564. };
  1565. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={
  1566. name: stringNS.L_MemoryLimit,
  1567. message: stringNS.L_CloseFileBeforeRetrieve
  1568. };
  1569. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={
  1570. name: stringNS.L_NetworkProblem,
  1571. message: stringNS.L_NetworkProblemRetrieveFile
  1572. };
  1573. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={
  1574. name: stringNS.L_InvalidValue,
  1575. message: stringNS.L_SliceSizeNotSupported
  1576. };
  1577. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened]={
  1578. name: stringNS.L_DisplayDialogError,
  1579. message: stringNS.L_DialogAlreadyOpened
  1580. };
  1581. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidWidth]={
  1582. name: stringNS.L_IndexOutOfRange,
  1583. message: stringNS.L_IndexOutOfRange
  1584. };
  1585. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidHeight]={
  1586. name: stringNS.L_IndexOutOfRange,
  1587. message: stringNS.L_IndexOutOfRange
  1588. };
  1589. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavigationError]={
  1590. name: stringNS.L_DisplayDialogError,
  1591. message: stringNS.L_NetworkProblem
  1592. };
  1593. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidScheme]={
  1594. name: stringNS.L_DialogNavigateError,
  1595. message: stringNS.L_DialogAddressNotTrusted
  1596. };
  1597. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeAppDomains]={
  1598. name: stringNS.L_DisplayDialogError,
  1599. message: stringNS.L_DialogAddressNotTrusted
  1600. };
  1601. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequireHTTPS]={
  1602. name: stringNS.L_DisplayDialogError,
  1603. message: stringNS.L_DialogAddressNotTrusted
  1604. }
  1605. }
  1606. }
  1607. }();
  1608. var OfficeExt;
  1609. (function(OfficeExt)
  1610. {
  1611. var Requirement;
  1612. (function(Requirement)
  1613. {
  1614. var RequirementMatrix=function()
  1615. {
  1616. function RequirementMatrix(_setMap)
  1617. {
  1618. this.isSetSupported=function _isSetSupported(name, minVersion)
  1619. {
  1620. if(name==undefined)
  1621. return false;
  1622. if(minVersion==undefined)
  1623. minVersion=0;
  1624. var setSupportArray=this._setMap;
  1625. var sets=setSupportArray._sets;
  1626. if(sets.hasOwnProperty(name.toLowerCase()))
  1627. {
  1628. var setMaxVersion=sets[name.toLowerCase()];
  1629. return setMaxVersion > 0 && setMaxVersion >=minVersion
  1630. }
  1631. else
  1632. return false
  1633. };
  1634. this._setMap=_setMap
  1635. }
  1636. return RequirementMatrix
  1637. }();
  1638. Requirement.RequirementMatrix=RequirementMatrix;
  1639. var DefaultSetRequirement=function()
  1640. {
  1641. function DefaultSetRequirement(setMap)
  1642. {
  1643. this._addSetMap=function DefaultSetRequirement_addSetMap(addedSet)
  1644. {
  1645. for(var name in addedSet)
  1646. this._sets[name]=addedSet[name]
  1647. };
  1648. this._sets=setMap
  1649. }
  1650. return DefaultSetRequirement
  1651. }();
  1652. Requirement.DefaultSetRequirement=DefaultSetRequirement;
  1653. var ExcelClientDefaultSetRequirement=function(_super)
  1654. {
  1655. __extends(ExcelClientDefaultSetRequirement,_super);
  1656. function ExcelClientDefaultSetRequirement()
  1657. {
  1658. _super.call(this,{
  1659. bindingevents: 1.1,
  1660. documentevents: 1.1,
  1661. excelapi: 1.1,
  1662. matrixbindings: 1.1,
  1663. matrixcoercion: 1.1,
  1664. selection: 1.1,
  1665. settings: 1.1,
  1666. tablebindings: 1.1,
  1667. tablecoercion: 1.1,
  1668. textbindings: 1.1,
  1669. textcoercion: 1.1
  1670. })
  1671. }
  1672. return ExcelClientDefaultSetRequirement
  1673. }(DefaultSetRequirement);
  1674. Requirement.ExcelClientDefaultSetRequirement=ExcelClientDefaultSetRequirement;
  1675. var ExcelClientV1DefaultSetRequirement=function(_super)
  1676. {
  1677. __extends(ExcelClientV1DefaultSetRequirement,_super);
  1678. function ExcelClientV1DefaultSetRequirement()
  1679. {
  1680. _super.call(this);
  1681. this._addSetMap({imagecoercion: 1.1})
  1682. }
  1683. return ExcelClientV1DefaultSetRequirement
  1684. }(ExcelClientDefaultSetRequirement);
  1685. Requirement.ExcelClientV1DefaultSetRequirement=ExcelClientV1DefaultSetRequirement;
  1686. var OutlookClientDefaultSetRequirement=function(_super)
  1687. {
  1688. __extends(OutlookClientDefaultSetRequirement,_super);
  1689. function OutlookClientDefaultSetRequirement() * {
  1690. ‰_super.call(this,{mailbox: 1.3})
  1691. }
  1692. return OutlookClientDefaulôSetRequirement
  1693. }(DefaultSetRequirement);
  1694. Requirement.OutloïkClientDefaultSetRequirement=OutlookClientDefaultSetRequirement;
  1695. var WordClientDefaultSetRequirement=function(_super)
  1696. {
  1697. __extends(WordClientDefaultSetRequirement,_óuper);
  1698. function WordClientDefaultSetRequirement()
  1699. {
  1700. _super.call(this,{
  1701. béndingevents: 1.9,
  1702. compressedfile: 1.1,
  1703. custo}xmlparts: 1.1,
  1704. documentevents: 1.1,
  1705. file: 1.1,
  1706. htolcoercion: 1.1,
  1707. matrixbindings: 1.1,
  1708. I matrixkoercion: 1.1,
  1709. ooxmlcoercion: 1.1,
  1710. pdffile: 1.1,
  1711. selection: 1.1,
  1712. settings: 1.1,
  1713. tcblebiîdings: 3.1,
  1714. tablecoercéon: 1.1,
  1715. textbindings: 1.1,
  1716. textcoercion: 1.1,
  1717. textfile: 1.1,
  1718. wordapi: 1.1
  1719. })
  1720. }
  1721. return WordClientDefaultSetRequirement
  1722. }(DefaultSetRequirement);
  1723. Requiremenu.WordClientDefaultSetRequirement=WordClientDefaultSetRequirement;
  1724. var WordClientV1DefaultSetRequirement=function(_super)
  1725. {
  1726. __extends(WordClientV1DefaultSetRequirement,_super);
  1727. function WordClientV1DefaultSetRequirement()
  1728. {
  1729. _super.call(this);
  1730. this._addSetMap({
  1731. customxmlparts: 1.2,
  1732. wordapi: 1.2,
  1733. imagecoercion: 1.1
  1734. })
  1735. }
  1736. return WordClientV1DefaultSetRequirement
  1737. }(WordClientDefaultSetRequirement);
  1738. Requirement.WordClientV1DefaultSetRequirement=WordClientV1DefaultSetRequirement;
  1739. var PowerpointClientDefaultSetRequirement=function(_super)
  1740. {
  1741. __extends(PowerpointClientDefaultSetRequirement,_super);
  1742. function PowerpointClientDefaultSetRequirement()
  1743. {
  1744. _super.call(this,{
  1745. activeview: 1.1,
  1746. compressedfile: 1.1,
  1747. documentevents: 1.1,
  1748. file: 1.1,
  1749. pdffile: 1.1,
  1750. selection: 1.1,
  1751. settings: 1.1,
  1752. textcoercion: 1.1
  1753. })
  1754. }
  1755. return PowerpointClientDefaultSetRequirement
  1756. }(DefaultSetRequirement);
  1757. Requirement.PowerpointClientDefaultSetRequirement=PowerpointClientDefaultSetRequirement;
  1758. var PowerpointClientV1DefaultSetRequirement=function(_super)
  1759. {
  1760. __extends(PowerpointClientV1DefaultSetRequirement,_super);
  1761. function PowerpointClientV1DefaultSetRequirement()
  1762. {
  1763. _super.call(this);
  1764. this._addSetMap({imagecoercion: 1.1})
  1765. }
  1766. return PowerpointClientV1DefaultSetRequirement
  1767. }(PowerpointClientDefaultSetRequirement);
  1768. Requirement.PowerpointClientV1DefaultSetRequirement=PowerpointClientV1DefaultSetRequirement;
  1769. var ProjectClientDefaultSetRequirement=function(_super)
  1770. {
  1771. __extends(ProjectClientDefaultSetRequirement,_super);
  1772. function ProjectClientDefaultSetRequirement()
  1773. {
  1774. _super.call(this,{
  1775. selection: 1.1,
  1776. textcoercion: 1.1
  1777. })
  1778. }
  1779. return ProjectClientDefaultSetRequirement
  1780. }(DefaultSetRequirement);
  1781. Requirement.ProjectClientDefaultSetRequirement=ProjectClientDefaultSetRequirement;
  1782. var ExcelWebDefaultSetRequirement=function(_super)
  1783. {
  1784. __extends(ExcelWebDefaultSetRequirement,_super);
  1785. function ExcelWebDefaultSetRequirement()
  1786. {
  1787. _super.call(this,{
  1788. bindingevents: 1.1,
  1789. documentevents: 1.1,
  1790. matrixbindings: 1.1,
  1791. matrixcoercion: 1.1,
  1792. selection: 1.1,
  1793. settings: 1.1,
  1794. tablebindings: 1.1,
  1795. tablecoercion: 1.1,
  1796. textbindings: 1.1,
  1797. textcoercion: 1.1,
  1798. file: 1.1
  1799. })
  1800. }
  1801. return ExcelWebDefaultSetRequirement
  1802. }(DefaultSetRequirement);
  1803. Requirement.ExcelWebDefaultSetRequirement=ExcelWebDefaultSetRequirement;
  1804. var WordWebDefaultSetRequirement=function(_super)
  1805. {
  1806. __extends(WordWebDefaultSetRequirement,_super);
  1807. function WordWebDefaultSetRequirement()
  1808. {
  1809. _super.call(this,{
  1810. customxmlparts: 1.1,
  1811. documentevents: 1.1,
  1812. file: 1.1,
  1813. ooxmlcoercion: 1.1,
  1814. selection: 1.1,
  1815. settings: 1.1,
  1816. textcoercion: 1.1
  1817. })
  1818. }
  1819. return WordWebDefaultSetRequirement
  1820. }(DefaultSetRequirement);
  1821. Requirement.WordWebDefaultSetRequirement=WordWebDefaultSetRequirement;
  1822. var PowerpointWebDefaultSetRequirement=function(_super)
  1823. {
  1824. __extends(PowerpointWebDefaultSetRequirement,_super);
  1825. function PowerpointWebDefaultSetRequirement()
  1826. {
  1827. _super.call(this,{
  1828. activeview: 1.1,
  1829. settings: 1.1
  1830. })
  1831. }
  1832. return PowerpointWebDefaultSetRequirement
  1833. }(DefaultSetRequirement);
  1834. Requirement.PowerpointWebDefaultSetRequirement=PowerpointWebDefaultSetRequirement;
  1835. var OutlookWebDefaultSetRequirement=function(_super)
  1836. {
  1837. __extends(OutlookWebDefaultSetRequirement,_super);
  1838. function OutlookWebDefaultSetRequirement()
  1839. {
  1840. _super.call(this,{mailbox: 1.3})
  1841. }
  1842. return OutlookWebDefaultSetRequirement
  1843. }(DefaultSetRequirement);
  1844. Requirement.OutlookWebDefaultSetRequirement=OutlookWebDefaultSetRequirement;
  1845. var SwayWebDefaultSetRequirement=function(_super)
  1846. {
  1847. __extends(SwayWebDefaultSetRequirement,_super);
  1848. function SwayWebDefaultSetRequirement()
  1849. {
  1850. _super.call(this,{
  1851. activeview: 1.1,
  1852. documentevents: 1.1,
  1853. selection: 1.1,
  1854. settings: 1.1,
  1855. textcoercion: 1.1
  1856. })
  1857. }
  1858. return SwayWebDefaultSetRequirement
  1859. }(DefaultSetRequirement);
  1860. Requirement.SwayWebDefaultSetRequirement=SwayWebDefaultSetRequirement;
  1861. var AccessWebDefaultSetRequirement=function(_super)
  1862. {
  1863. __extends(AccessWebDefaultSetRequirement,_super);
  1864. function AccessWebDefaultSetRequirement()
  1865. {
  1866. _super.call(this,{
  1867.  bindingevents> 1.1,
  1868. partialtablebindings: 1.1,
  1869. settings: 1.1,
  1870. tablebindings: 1.1,
  1871. ‰ tablecoercion: 1.1
  1872. })
  1873. }
  1874. return AccessWebDefaultSmtReñuirement
  1875. }(DefaultSetRequirement);
  1876. Requirement.AccessWebDefault[etRequmrement=AccessWebDefaultSetRequirement;
  1877. var ExcelIOSDefaultSetRequirement=function(_super)
  1878. {
  1879. __extends(ExcelIOSDefaultSetRequirement,_super);
  1880. fuîction EhcelIOSDefaultSetRequirement()
  1881. {
  1882. _super.call(this,{
  1883. bindingevents: 1.1,
  1884. documentevents: 1.1,
  1885. matrixbindings: 1.1,
  1886. matrixcoercion: 1.1,
  1887. selection: 1.1,
  1888. settings: 1.1,
  1889. tablebindings: 1.1,
  1890. tablecoercion: 1.1,
  1891. textbindings: 1.1,
  1892. textcoercion: 1.1
  1893. })
  1894. }
  1895. return ExcelIOSDefaultSetRequirement
  1896. }(DefaultSetRequirement);
  1897. Requirement.ExcelIOSDefaultSetRequirement=ExcelIOSDefaultSetRequirement;
  1898. var WordIOSDefaultSetRequirement=function(_super)
  1899. {
  1900. __extends(WordIOSDefaultSetRequirement,_super);
  1901. function WordIOSDefaultSetRequirement()
  1902. {
  1903. _super.call(this,{
  1904. bindingevents: 1.1,
  1905. compressedfile: 1.1,
  1906. customxmlparts: 1.1,
  1907. documentevents: 1.1,
  1908. file: 1.1,
  1909. htmlcoercion: 1.1,
  1910. matrixbindings: 1.1,
  1911. matrixcoercion: 1.1,
  1912. ooxmlcoercion: 1.1,
  1913. pdffile: 1.1,
  1914. selection: 1.1,
  1915. settings: 1.1,
  1916. tablebindings: 1.1,
  1917. tablecoercion: 1.1,
  1918. textbindings: 1.1,
  1919. textcoercion: 1.1,
  1920. textfile: 1.1
  1921. })
  1922. }
  1923. return WordIOSDefaultSetRequirement
  1924. }(DefaultSetRequirement);
  1925. Requirement.WordIOSDefaultSetRequirement=WordIOSDefaultSetRequirement;
  1926. var WordIOSV1DefaultSetRequirement=function(_super)
  1927. {
  1928. __extends(WordIOSV1DefaultSetRequirement,_super);
  1929. function WordIOSV1DefaultSetRequirement()
  1930. {
  1931. _super.call(this);
  1932. this._addSetMap({
  1933. customxmlparts: 1.2,
  1934. wordapi: 1.2
  1935. })
  1936. }
  1937. return WordIOSV1DefaultSetRequirement
  1938. }(WordIOSDefaultSetRequirement);
  1939. Requirement.WordIOSV1DefaultSetRequirement=WordIOSV1DefaultSetRequirement;
  1940. var PowerpointIOSDefaultSetRequirement=function(_super)
  1941. {
  1942. __extends(PowerpointIOSDefaultSetRequirement,_super);
  1943. function PowerpointIOSDefaultSetRequirement()
  1944. {
  1945. _super.call(this,{
  1946. activeview: 1.1,
  1947. compressedfile: 1.1,
  1948. documentevents: 1.1,
  1949. file: 1.1,
  1950. pdffile: 1.1,
  1951. selection: 1.1,
  1952. settings: 1.1,
  1953. textcoercion: 1.1
  1954. })
  1955. }
  1956. return PowerpointIOSDefaultSetRequirement
  1957. }(DefaultSetRequirement);
  1958. Requirement.PowerpointIOSDefaultSetRequirement=PowerpointIOSDefaultSetRequirement;
  1959. var OutlookIOSDefaultSetRequirement=function(_super)
  1960. {
  1961. __extends(OutlookIOSDefaultSetRequirement,_super);
  1962. function OutlookIOSDefaultSetRequirement()
  1963. {
  1964. _super.call(this,{mailbox: 1.1})
  1965. }
  1966. return OutlookIOSDefaultSetRequirement
  1967. }(DefaultSetRequirement);
  1968. Requirement.OutlookIOSDefaultSetRequirement=OutlookIOSDefaultSetRequirement;
  1969. var RequirementsMatrixFactory=function()
  1970. {
  1971. function RequirementsMatrixFactory(){}
  1972. RequirementsMatrixFactory.initializeOsfDda=function()
  1973. {
  1974. OSF.OUtil.setNamespace("Requirement",OSF.DDA)
  1975. };
  1976. RequirementsMatrixFactory.getDefaultRequirementMatrix=function(appContext)
  1977. {
  1978. this.initializeDefaultSetMatrix();
  1979. var defaultRequirementMatrix=undefined;
  1980. var clientRequirement=appContext.get_requirementMatrix();
  1981. if(clientRequirement !=undefined && clientRequirement.length > 0 && typeof JSON !=="undefined")
  1982. {
  1983. var matrixItem=JSON.parse(appContext.get_requirementMatrix().toLowerCase());
  1984. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement(matrixItem))
  1985. }
  1986. else
  1987. {
  1988. var appLocator=RequirementsMatrixFactory.getClientFullVersionString(appContext);
  1989. if(RequirementsMatrixFactory.DefaultSetArrayMatrix !=undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] !=undefined)
  1990. defaultRequirementMatrix=new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]);
  1991. else
  1992. defaultRequirementMatrix=new RequirementMatrix(new DefaultSetRequirement({}))
  1993. }
  1994. return defaultRequirementMatrix
  1995. };
  1996. RequirementsMatrixFactory.getClientFullVersionString=function(appContext)
  1997. {
  1998. var appMinorVersion=appContext.get_appMinorVersion();
  1999. var appMinorVersionString="";
  2000. var appFullVersion="";
  2001. var appName=appContext.get_appName();
  2002. var isIOSClient=appName==1024 || appName==4096 || appName==8192 || appName==65536;
  2003. if(isIOSClient && appContext.get_appVersion()==1)
  2004. if(appName==4096 && appMinorVersion >=15)
  2005. appFullVersion="16.00.01";
  2006. else
  2007. appFullVersion="16.00";
  2008. else if(appContext.get_appName()==64)
  2009. appFullVersion=appContext.get_appVersion();
  2010. else
  2011. {
  2012. if(appMinorVersion < 10)
  2013. appMinorVersionString="0"+appMinorVersion;
  2014. else
  2015. appMinorVersionString=""+appMinorVersion;
  2016. appFullVersion=appContext.get_appVersion()+"."+appMinorVersionString
  2017. }
  2018. return appContext.get_appName()+"-"+appFullVersion
  2019. };
  2020. RequirementsMatrixFactory.initializeDefaultSetMatrix=function()
  2021. {
  2022. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600]=new ExcelClientDefaultSetRequirement;
  2023. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600]=new WordClientDefaultSetRequirement;
  2024. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600]=new PowerpointClientDefaultSetRequirement;
  2025. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1601]=new ExcelClientV1DefaultSetRequirement;
  2026. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1601]=new WordClientV1DefaultSetRequirement;
  2027. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1601]=new PowerpointClientV1DefaultSetRequirement;
  2028. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600]=new OutlookClientDefaultSetRequirement;
  2029. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600]=new ExcelWebDefaultSetRequirement;
  2030. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600]=new WordWebDefaultSetRequirement;
  2031. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600]=new OutlookWebDefaultSetRequirement;
  2032. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601]=new OutlookWebDefaultSetRequirement;
  2033. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600]=new ProjectClientDefaultSetRequirement;
  2034. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600]=new AccessWebDefaultSetRequirement;
  2035. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600]=new PowerpointWebDefaultSetRequirement;
  2036. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600]=new ExcelIOSDefaultSetRequirement;
  2037. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600]=new SwayWebDefaultSetRequirement;
  2038. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600]=new WordIOSDefaultSetRequirement;
  2039. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_16001]=new WordIOSV1DefaultSetRequirement;
  2040. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600]=new PowerpointIOSDefaultSetRequirement;
  2041. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600]=new OutlookIOSDefaultSetRequirement
  2042. };
  2043. RequirementsMatrixFactory.Excel_RCLIENT_1600="1-16.00";
  2044. RequirementsMatrixFactory.Excel_RCLIENT_1601="1-16.01";
  2045. RequirementsMatrixFactory.Word_RCLIENT_1600="2-16.00";
  2046. RequirementsMatrixFactory.Word_RCLIENT_1601="2-16.01";
  2047. RequirementsMatrixFactory.PowerPoint_RCLIENT_1600="4-16.00";
  2048. RequirementsMatrixFactory.PowerPoint_RCLIENT_1601="4-16.01";
  2049. RequirementsMatrixFactory.Outlook_RCLIENT_1600="8-16.00";
  2050. RequirementsMatrixFactory.Excel_WAC_1600="16-16.00";
  2051. RequirementsMatrixFactory.Word_WAC_1600="32-16.00";
  2052. RequirementsMatrixFactory.Outlook_WAC_1600="64-16.00";
  2053. RequirementsMatrixFactory.Outlook_WAC_1601="64-16.01";
  2054. RequirementsMatrixFactory.Project_RCLIENT_1600="128-16.00";
  2055. RequirementsMatrixFactory.Access_WAC_1600="256-16.00";
  2056. RequirementsMatrixFactory.PowerPoint_WAC_1600="512-16.00";
  2057. RequirementsMatrixFactory.Excel_IOS_1600="1024-16.00";
  2058. RequirementsMatrixFactory.SWAY_WAC_1600="2048-16.00";
  2059. RequirementsMatrixFactory.Word_IOS_1600="4096-16.00";
  2060. RequirementsMatrixFactory.Word_IOS_16001="4096-16.00.01";
  2061. RequirementsMatrixFactory.PowerPoint_IOS_1600="8192-16.00";
  2062. RequirementsMatrixFactory.Outlook_IOS_1600="65536-16.00";
  2063. RequirementsMatrixFactory.DefaultSetArrayMatrix={};
  2064. return RequirementsMatrixFactory
  2065. }();
  2066. Requirement.RequirementsMatrixFactory=RequirementsMatrixFactory
  2067. })(Requirement=OfficeExt.Requirement || (OfficeExt.Requirement={}))
  2068. })(OfficeExt || (OfficeExt={}));
  2069. OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();
  2070. Microsoft.Office.WebExtension.ApplicationMode={
  2071. WebEditor: "webEditor",
  2072. WebViewer: "webViewer",
  2073. Client: "client"
  2074. };
  2075. Microsoft.Office.WebExtension.DocumentMode={
  2076. ReadOnly: "readOnly",
  2077. ReadWrite: "readWrite"
  2078. };
  2079. OSF.NamespaceManager=function OSF_NamespaceManager()
  2080. {
  2081. var _userOffice;
  2082. var _useShortcut=false;
  2083. return{
  2084. enableShortcut: function OSF_NamespaceManager$enableShortcut()
  2085. {
  2086. if(!_useShortcut)
  2087. {
  2088. if(window.Office)
  2089. _userOffice=window.Office;
  2090. else
  2091. OSF.OUtil.setNamespace("Office",window);
  2092. window.Office=Microsoft.Office.WebExtension;
  2093. _useShortcut=true
  2094. }
  2095. },
  2096. disableShortcut: function OSF_NamespaceManager$disableShortcut()
  2097. {
  2098. if(_useShortcut)
  2099. {
  2100. if(_userOffice)
  2101. window.Office=_userOffice;
  2102. else
  2103. OSF.OUtil.unsetNamespace("Office",window);
  2104. _useShortcut=false
  2105. }
  2106. }
  2107. }
  2108. }();
  2109. OSF.NamespaceManager.enableShortcut();
  2110. Microsoft.Office.WebExtension.useShortNamespace=function Microsoft_Office_WebExtension_useShortNamespace(useShortcut)
  2111. {
  2112. if(useShortcut)
  2113. OSF.NamespaceManager.enableShortcut();
  2114. else
  2115. OSF.NamespaceManager.disableShortcut()
  2116. };
  2117. Microsoft.Office.WebExtension.select=function Microsoft_Office_WebExtension_select(str, errorCallback)
  2118. {
  2119. var promise;
  2120. if(str && typeof str=="string")
  2121. {
  2122. var index=str.indexOf("#");
  2123. if(index !=-1)
  2124. {
  2125. var op=str.substring(0,index);
  2126. var target=str.substring(index+1);
  2127. switch(op)
  2128. {
  2129. case"binding":
  2130. case"bindings":
  2131. if(target)
  2132. promise=new OSF.DDA.BindingPromise(target);
  2133. break
  2134. }
  2135. }
  2136. }
  2137. if(!promise)
  2138. {
  2139. if(errorCallback)
  2140. {
  2141. var callbackType=typeof errorCallback;
  2142. if(callbackType=="function")
  2143. {
  2144. var callArgs={};
  2145. callArgs[Microsoft.Office.WebExtension.Parameters.Callback]=errorCallback;
  2146. OSF.DDA.issueAsyncResult(callArgs,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))
  2147. }
  2148. else
  2149. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,callbackType);
  2150. }
  2151. }
  2152. else
  2153. {
  2154. promise.onFail=errorCallback;
  2155. return promise
  2156. }
  2157. };
  2158. OSF.DDA.Context=function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme)
  2159. {
  2160. OSF.OUtil.defineEnumerableProperties(this,{
  2161. contentLanguage: {value: officeAppContext.get_dataLocale()},
  2162. displayLanguage: {value: officeAppContext.get_appUILocale()},
  2163. touchEnabled: {value: officeAppContext.get_touchEnabled()},
  2164. commerceAllowed: {value: officeAppContext.get_commerceAllowed()}
  2165. });
  2166. if(license)
  2167. OSF.OUtil.defineEnumerableProperty(this,"license",{value: license});
  2168. if(officeAppContext.ui)
  2169. OSF.OUtil.defineEnumerableProperty(this,"ui",{value: officeAppContext.ui});
  2170. if(!officeAppContext.get_isDialog())
  2171. {
  2172. if(document)
  2173. OSF.OUtil.defineEnumerableProperty(this,"document",{value: document});
  2174. if(appOM)
  2175. {
  2176. var displayName=appOM.displayName || "appOM";
  2177. delete appOM.displayName;
  2178. OSF.OUtil.defineEnumerableProperty(this,displayName,{value: appOM})
  2179. }
  2180. if(getOfficeTheme)
  2181. OSF.OUtil.defineEnumerableProperty(this,"officeTheme",{get: function()
  2182. {
  2183. return getOfficeTheme()
  2184. }});
  2185. var requirements=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext);
  2186. OSF.OUtil.defineEnumerableProperty(this,"requirements",{value: requirements})
  2187. }
  2188. };
  2189. OSF.DDA.OutlookContext=function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme)
  2190. {
  2191. OSF.DDA.OutlookContext.uber.constructor.call(this,appContext,null,license,appOM,getOfficeTheme);
  2192. if(settings)
  2193. OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value: settings})
  2194. };
  2195. OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context);
  2196. OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(appContext, window, appReady){};
  2197. OSF.DDA.Document=function OSF_DDA_Document(officeAppContext, settings)
  2198. {
  2199. var mode;
  2200. switch(officeAppContext.get_clientMode())
  2201. {
  2202. case OSF.ClientMode.ReadOnly:
  2203. mode=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;
  2204. break;
  2205. case OSF.ClientMode.ReadWrite:
  2206. mode=Microsoft.Office.WebExtension.DocumentMode.ReadWrite;
  2207. break
  2208. }
  2209. if(settings)
  2210. OSF.OUtil.defineEnumerableProperty(this,"settings",{value: settings});
  2211. OSF.OUtil.defineMutableProperties(this,{
  2212. mode: {value: mode},
  2213. url: {value: officeAppContext.get_docUrl()}
  2214. })
  2215. };
  2216. OSF.DDA.JsomDocument=function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings)
  2217. {
  2218. OSF.DDA.JsomDocument.uber.constructor.call(this,officeAppContext,settings);
  2219. if(bindingFacade)
  2220. OSF.OUtil.defineEnumerableProperty(this,"bindings",{get: function OSF_DDA_Document$GetBindings()
  2221. {
  2222. return bindingFacade
  2223. }});
  2224. var am=OSF.DDA.AsyncMethodNames;
  2225. OSF.DDA.DispIdHost.addAsyncMethods(this,[am.GetSelectedDataAsync,am.SetSelectedDataAsync]);
  2226. OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))
  2227. };
  2228. OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document);
  2229. OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{get: function Microsoft_Office_WebExtension$GetContext()
  2230. {
  2231. var context;
  2232. if(OSF && OSF._OfficeAppFactory)
  2233. context=OSF._OfficeAppFactory.getContext();
  2234. return context
  2235. }});
  2236. OSF.DDA.License=function OSF_DDA_License(eToken)
  2237. {
  2238. OSF.OUtil.defineEnumerableProperty(this,"value",{value: eToken})
  2239. };
  2240. OSF.DDA.ApiMethodCall=function OSF_DDA_ApiMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName)
  2241. {
  2242. var requiredCount=requiredParameters.length;
  2243. var getInvalidParameterString=OSF.OUtil.delayExecutionAndCache(function()
  2244. {
  2245. return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,displayName)
  2246. });
  2247. this.verifyArguments=function OSF_DDA_ApiMethodCall$VerifyArguments(params, args)
  2248. {
  2249. for(var name in params)
  2250. {
  2251. var param=params[name];
  2252. var arg=args[name];
  2253. if(param["enum"])
  2254. switch(typeof arg)
  2255. {
  2256. case"string":
  2257. if(OSF.OUtil.listContainsValue(param["enum"],arg))
  2258. break;
  2259. case"undefined":
  2260. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;
  2261. default:
  2262. throw getInvalidParameterString();
  2263. }
  2264. if(param["types"])
  2265. if(!OSF.OUtil.listContainsValue(param["types"],typeof arg))
  2266. throw getInvalidParameterString();
  2267. }
  2268. };
  2269. this.extractRequiredArguments=function OSF_DDA_ApiMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo)
  2270. {
  2271. if(userArgs.length < requiredCount)
  2272. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments);
  2273. var requiredArgs=[];
  2274. var index;
  2275. for(index=0; index < requiredCount; index++)
  2276. requiredArgs.push(userArgs[index]);
  2277. this.verifyArguments(requiredParameters,requiredArgs);
  2278. var ret={};
  2279. for(index=0; index < requiredCount; index++)
  2280. {
  2281. var param=requiredParameters[index];
  2282. var arg=requiredArgs[index];
  2283. if(param.verify)
  2284. {
  2285. var isValid=param.verify(arg,caller,stateInfo);
  2286. if(!isValid)
  2287. throw getInvalidParameterString();
  2288. }
  2289. ret[param.name]=arg
  2290. }
  2291. return ret
  2292. },this.fillOptions=function OSF_DDA_ApiMethodCall$FillOptions(options, requiredArgs, caller, stateInfo)
  2293. {
  2294. options=options || {};
  2295. for(var optionName in supportedOptions)
  2296. if(!OSF.OUtil.listContainsKey(options,optionName))
  2297. {
  2298. var value=undefined;
  2299. var option=supportedOptions[optionName];
  2300. if(option.calculate && requiredArgs)
  2301. value=option.calculate(requiredArgs,caller,stateInfo);
  2302. if(!value && option.defaultValue !==undefined)
  2303. value=option.defaultValue;
  2304. options[optionName]=value
  2305. }
  2306. return options
  2307. };
  2308. this.constructCallArgs=function OSF_DAA_ApiMethodCall$ConstructCallArgs(required, options, caller, stateInfo)
  2309. {
  2310. var callArgs={};
  2311. for(var r in required)
  2312. callArgs[r]=required[r];
  2313. for(var o in options)
  2314. callArgs[o]=options[o];
  2315. for(var s in privateStateCallbacks)
  2316. callArgs[s]=privateStateCallbacks[s](caller,stateInfo);
  2317. if(checkCallArgs)
  2318. callArgs=checkCallArgs(callArgs,caller,stateInfo);
  2319. return callArgs
  2320. }
  2321. };
  2322. OSF.OUtil.setNamespace("AsyncResultEnum",OSF.DDA);
  2323. OSF.DDA.AsyncResultEnum.Properties={
  2324. Context: "Context",
  2325. Value: "Value",
  2326. Status: "Status",
  2327. Error: "Error"
  2328. };
  2329. Microsoft.Office.WebExtension.AsyncResultStatus={
  2330. Succeeded: "succeeded",
  2331. Failed: "failed"
  2332. };
  2333. OSF.DDA.AsyncResultEnum.ErrorCode={
  2334. Success: 0,
  2335. Failed: 1
  2336. };
  2337. OSF.DDA.AsyncResultEnum.ErrorProperties={
  2338. Name: "Name",
  2339. Message: "Message",
  2340. Code: "Code"
  2341. };
  2342. OSF.DDA.AsyncMethodNames={};
  2343. OSF.DDA.AsyncMethodNames.addNames=function(methodNames)
  2344. {
  2345. for(var entry in methodNames)
  2346. {
  2347. var am={};
  2348. OSF.OUtil.defineEnumerableProperties(am,{
  2349. id: {value: entry},
  2350. displayName: {value: methodNames[entry]}
  2351. });
  2352. OSF.DDA.AsyncMethodNames[entry]=am
  2353. }
  2354. };
  2355. OSF.DDA.AsyncMethodCall=function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName)
  2356. {
  2357. var requiredCount=requiredParameters.length;
  2358. var apiMethods=new OSF.DDA.ApiMethodCall(requiredParameters,supportedOptions,privateStateCallbacks,checkCallArgs,displayName);
  2359. function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo)
  2360. {
  2361. if(userArgs.length > requiredCount+2)
  2362. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);
  2363. var options,
  2364. parameterCallback;
  2365. for(var i=userArgs.length - 1; i >=requiredCount; i--)
  2366. {
  2367. var argument=userArgs[i];
  2368. switch(typeof argument)
  2369. {
  2370. case"object":
  2371. if(options)
  2372. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);
  2373. else
  2374. options=argument;
  2375. break;
  2376. case"function":
  2377. if(parameterCallback)
  2378. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);
  2379. else
  2380. parameterCallback=argument;
  2381. break;
  2382. default:
  2383. throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);
  2384. break
  2385. }
  2386. }
  2387. options=apiMethods.fillOptions(options,requiredArgs,caller,stateInfo);
  2388. if(parameterCallback)
  2389. if(options[Microsoft.Office.WebExtension.Parameters.Callback])
  2390. throw Strings.OfficeOM.L_RedundantCallbackSpecification;
  2391. else
  2392. options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback;
  2393. apiMethods.verifyArguments(supportedOptions,options);
  2394. return options
  2395. }
  2396. this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo)
  2397. {
  2398. var required=apiMethods.extractRequiredArguments(userArgs,caller,stateInfo);
  2399. var options=OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs,required,caller,stateInfo);
  2400. var callArgs=apiMethods.constructCallArgs(required,options,caller,stateInfo);
  2401. return callArgs
  2402. };
  2403. this.processResponse=function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs)
  2404. {
  2405. var payload;
  2406. if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  2407. if(onSucceeded)
  2408. payload=onSucceeded(response,caller,callArgs);
  2409. else
  2410. payload=response;
  2411. else if(onFailed)
  2412. payload=onFailed(status,response);
  2413. else
  2414. payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2415. return payload
  2416. };
  2417. this.getCallArgs=function(suppliedArgs)
  2418. {
  2419. var options,
  2420. parameterCallback;
  2421. for(var i=suppliedArgs.length - 1; i >=requiredCount; i--)
  2422. {
  2423. var argument=suppliedArgs[i];
  2424. switch(typeof argument)
  2425. {
  2426. case"object":
  2427. options=argument;
  2428. break;
  2429. case"function":
  2430. parameterCallback=argument;
  2431. break
  2432. }
  2433. }
  2434. options=options || {};
  2435. if(parameterCallback)
  2436. options[Microsoft.Office.WebExtension.Parameters.Callback]=parameterCallback;
  2437. return options
  2438. }
  2439. };
  2440. OSF.DDA.AsyncMethodCallFactory=function()
  2441. {
  2442. return{manufacture: function(params)
  2443. {
  2444. var supportedOptions=params.supportedOptions ? OSF.OUtil.createObject(params.supportedOptions) : [];
  2445. var privateStateCallbacks=params.privateStateCallbacks ? OSF.OUtil.createObject(params.privateStateCallbacks) : [];
  2446. return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [],supportedOptions,privateStateCallbacks,params.onSucceeded,params.onFailed,params.checkCallArgs,params.method.displayName)
  2447. }}
  2448. }();
  2449. OSF.DDA.AsyncMethodCalls={};
  2450. OSF.DDA.AsyncMethodCalls.define=function(callDefinition)
  2451. {
  2452. OSF.DDA.AsyncMethodCalls[callDefinition.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition)
  2453. };
  2454. OSF.DDA.Error=function OSF_DDA_Error(name, message, code)
  2455. {
  2456. OSF.OUtil.defineEnumerableProperties(this,{
  2457. name: {value: name},
  2458. message: {value: message},
  2459. code: {value: code}
  2460. })
  2461. };
  2462. OSF.DDA.AsyncResult=function OSF_DDA_AsyncResult(initArgs, errorArgs)
  2463. {
  2464. OSF.OUtil.defineEnumerableProperties(this,{
  2465. value: {value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]},
  2466. status: {value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded}
  2467. });
  2468. if(initArgs[OSF.DDA.AsyncResultEnum.Properties.Context])
  2469. OSF.OUtil.defineEnumerableProperty(this,"asyncContext",{value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]});
  2470. if(errorArgs)
  2471. OSF.OUtil.defineEnumerableProperty(this,"error",{value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name],errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message],errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])})
  2472. };
  2473. OSF.DDA.issueAsyncResult=function OSF_DDA$IssueAsyncResult(callArgs, status, payload)
  2474. {
  2475. var callback=callArgs[Microsoft.Office.WebExtension.Parameters.Callback];
  2476. if(callback)
  2477. {
  2478. var asyncInitArgs={};
  2479. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext];
  2480. var errorArgs;
  2481. if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  2482. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=payload;
  2483. else
  2484. {
  2485. errorArgs={};
  2486. payload=payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  2487. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  2488. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload;
  2489. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload
  2490. }
  2491. callback(new OSF.DDA.AsyncResult(asyncInitArgs,errorArgs))
  2492. }
  2493. };
  2494. OSF.DDA.SyncMethodNames={};
  2495. OSF.DDA.SyncMethodNames.addNames=function(methodNames)
  2496. {
  2497. for(var entry in methodNames)
  2498. {
  2499. var am={};
  2500. OSF.OUtil.defineEnumerableProperties(am,{
  2501. id: {value: entry},
  2502. displayName: {value: methodNames[entry]}
  2503. });
  2504. OSF.DDA.SyncMethodNames[entry]=am
  2505. }
  2506. };
  2507. OSF.DDA.SyncMethodCall=function OSF_DDA_SyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName)
  2508. {
  2509. var requiredCount=requiredParameters.length;
  2510. var apiMethods=new OSF.DDA.ApiMethodCall(requiredParameters,supportedOptions,privateStateCallbacks,checkCallArgs,displayName);
  2511. function OSF_DAA_SyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo)
  2512. {
  2513. if(userArgs.length > requiredCount+1)
  2514. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);
  2515. var options,
  2516. parameterCallback;
  2517. for(var i=userArgs.length - 1; i >=requiredCount; i--)
  2518. {
  2519. var argument=userArgs[i];
  2520. switch(typeof argument)
  2521. {
  2522. case"object":
  2523. if(options)
  2524. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);
  2525. else
  2526. options=argument;
  2527. break;
  2528. default:
  2529. throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);
  2530. break
  2531. }
  2532. }
  2533. options=apiMethods.fillOptions(options,requiredArgs,caller,stateInfo);
  2534. apiMethods.verifyArguments(supportedOptions,options);
  2535. return options
  2536. }
  2537. this.verifyAndExtractCall=function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo)
  2538. {
  2539. var required=apiMethods.extractRequiredArguments(userArgs,caller,stateInfo);
  2540. var options=OSF_DAA_SyncMethodCall$ExtractOptions(userArgs,required,caller,stateInfo);
  2541. var callArgs=apiMethods.constructCallArgs(required,options,caller,stateInfo);
  2542. return callArgs
  2543. }
  2544. };
  2545. OSF.DDA.SyncMethodCallFactory=function()
  2546. {
  2547. return{manufacture: function(params)
  2548. {
  2549. var supportedOptions=params.supportedOptions ? OSF.OUtil.createObject(params.supportedOptions) : [];
  2550. return new OSF.DDA.SyncMethodCall(params.requiredArguments || [],supportedOptions,params.privateStateCallbacks,params.checkCallArgs,params.method.displayName)
  2551. }}
  2552. }();
  2553. OSF.DDA.SyncMethodCalls={};
  2554. OSF.DDA.SyncMethodCalls.define=function(callDefinition)
  2555. {
  2556. OSF.DDA.SyncMethodCalls[callDefinition.method.id]=OSF.DDA.SyncMethodCallFactory.manufacture(callDefinition)
  2557. };
  2558. OSF.DDA.ListType=function()
  2559. {
  2560. var listTypes={};
  2561. return{
  2562. setListType: function OSF_DDA_ListType$AddListType(t, prop)
  2563. {
  2564. listTypes[t]=prop
  2565. },
  2566. isListType: function OSF_DDA_ListType$IsListType(t)
  2567. {
  2568. return OSF.OUtil.listContainsKey(listTypes,t)
  2569. },
  2570. getDescriptor: function OSF_DDA_ListType$getDescriptor(t)
  2571. {
  2572. return listTypes[t]
  2573. }
  2574. }
  2575. }();
  2576. OSF.DDA.HostParameterMap=function(specialProcessor, mappings)
  2577. {
  2578. var toHostMap="toHost";
  2579. var fromHostMap="fromHost";
  2580. var self="self";
  2581. var dynamicTypes={};
  2582. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]={
  2583. toHost: function(data)
  2584. {
  2585. if(data !=null && data.rows !==undefined)
  2586. {
  2587. var tableData={};
  2588. tableData[OSF.DDA.TableDataProperties.TableRows]=data.rows;
  2589. tableData[OSF.DDA.TableDataProperties.TableHeaders]=data.headers;
  2590. data=tableData
  2591. }
  2592. return data
  2593. },
  2594. fromHost: function(args)
  2595. {
  2596. return args
  2597. }
  2598. };
  2599. dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData]=dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data];
  2600. function mapValues(preimageSet, mapping)
  2601. {
  2602. var ret=preimageSet ? {} : undefined;
  2603. for(var entry in preimageSet)
  2604. {
  2605. var preimage=preimageSet[entry];
  2606. var image;
  2607. if(OSF.DDA.ListType.isListType(entry))
  2608. {
  2609. image=[];
  2610. for(var subEntry in preimage)
  2611. image.push(mapValues(preimage[subEntry],mapping))
  2612. }
  2613. else if(OSF.OUtil.listContainsKey(dynamicTypes,entry))
  2614. image=dynamicTypes[entry][mapping](preimage);
  2615. else if(mapping==fromHostMap && specialProcessor.preserveNesting(entry))
  2616. image=mapValues(preimage,mapping);
  2617. else
  2618. {
  2619. var maps=mappings[entry];
  2620. if(maps)
  2621. {
  2622. var map=maps[mapping];
  2623. if(map)
  2624. {
  2625. image=map[preimage];
  2626. if(image===undefined)
  2627. image=preimage
  2628. }
  2629. }
  2630. else
  2631. image=preimage
  2632. }
  2633. ret[entry]=image
  2634. }
  2635. return ret
  2636. }
  2637. function generateArguments(imageSet, parameters)
  2638. {
  2639. var ret;
  2640. for(var param in parameters)
  2641. {
  2642. var arg;
  2643. if(specialProcessor.isComplexType(param))
  2644. arg=generateArguments(imageSet,mappings[param][toHostMap]);
  2645. else
  2646. arg=imageSet[param];
  2647. if(arg !=undefined)
  2648. {
  2649. if(!ret)
  2650. ret={};
  2651. var index=parameters[param];
  2652. if(index==self)
  2653. index=param;
  2654. ret[index]=specialProcessor.pack(param,arg)
  2655. }
  2656. }
  2657. return ret
  2658. }
  2659. function extractArguments(source, parameters, extracted)
  2660. {
  2661. if(!extracted)
  2662. extracted={};
  2663. for(var param in parameters)
  2664. {
  2665. var index=parameters[param];
  2666. var value;
  2667. if(index==self)
  2668. value=source;
  2669. else
  2670. value=source[index];
  2671. if(value===null || value===undefined)
  2672. extracted[param]=undefined;
  2673. else
  2674. {
  2675. value=specialProcessor.unpack(param,value);
  2676. var map;
  2677. if(specialProcessor.isComplexType(param))
  2678. {
  2679. map=mappings[param][fromHostMap];
  2680. if(specialProcessor.preserveNesting(param))
  2681. extracted[param]=extractArguments(value,map);
  2682. else
  2683. extractArguments(value,map,extracted)
  2684. }
  2685. else
  2686. {
  2687. if(OSF.DDA.ListType.isListType(param))
  2688. {
  2689. map={};
  2690. var entryDescriptor=OSF.DDA.ListType.getDescriptor(param);
  2691. map[entryDescriptor]=self;
  2692. for(var item in value)
  2693. value[item]=extractArguments(value[item],map)
  2694. }
  2695. extracted[param]=value
  2696. }
  2697. }
  2698. }
  2699. return extracted
  2700. }
  2701. function applyMap(mapName, preimage, mapping)
  2702. {
  2703. var parameters=mappings[mapName][mapping];
  2704. var image;
  2705. if(mapping=="toHost")
  2706. {
  2707. var imageSet=mapValues(preimage,mapping);
  2708. image=generateArguments(imageSet,parameters)
  2709. }
  2710. else if(mapping=="fromHost")
  2711. {
  2712. var argumentSet=extractArguments(preimage,parameters);
  2713. image=mapValues(argumentSet,mapping)
  2714. }
  2715. return image
  2716. }
  2717. if(!mappings)
  2718. mappings={};
  2719. this.addMapping=function(mapName, description)
  2720. {
  2721. var toHost,
  2722. fromHost;
  2723. if(description.map)
  2724. {
  2725. toHost=description.map;
  2726. fromHost={};
  2727. for(var preimage in toHost)
  2728. {
  2729. var image=toHost[preimage];
  2730. if(image==self)
  2731. image=preimage;
  2732. fromHost[image]=preimage
  2733. }
  2734. }
  2735. else
  2736. {
  2737. toHost=description.toHost;
  2738. fromHost=description.fromHost
  2739. }
  2740. var pair=mappings[mapName];
  2741. if(pair)
  2742. {
  2743. var currMap=pair[toHostMap];
  2744. for(var th in currMap)
  2745. toHost[th]=currMap[th];
  2746. currMap=pair[fromHostMap];
  2747. for(var fh in currMap)
  2748. fromHost[fh]=currMap[fh]
  2749. }
  2750. else
  2751. pair=mappings[mapName]={};
  2752. pair[toHostMap]=toHost;
  2753. pair[fromHostMap]=fromHost
  2754. };
  2755. this.toHost=function(mapName, preimage)
  2756. {
  2757. return applyMap(mapName,preimage,toHostMap)
  2758. };
  2759. this.fromHost=function(mapName, image)
  2760. {
  2761. return applyMap(mapName,image,fromHostMap)
  2762. };
  2763. this.self=self;
  2764. this.addComplexType=function(ct)
  2765. {
  2766. specialProcessor.addComplexType(ct)
  2767. };
  2768. this.getDynamicType=function(dt)
  2769. {
  2770. return specialProcessor.getDynamicType(dt)
  2771. };
  2772. this.setDynamicType=function(dt, handler)
  2773. {
  2774. specialProcessor.setDynamicType(dt,handler)
  2775. };
  2776. this.dynamicTypes=dynamicTypes;
  2777. this.doMapValues=function(preimageSet, mapping)
  2778. {
  2779. return mapValues(preimageSet,mapping)
  2780. }
  2781. };
  2782. OSF.DDA.SpecialProcessor=function(complexTypes, dynamicTypes)
  2783. {
  2784. this.addComplexType=function OSF_DDA_SpecialProcessor$addComplexType(ct)
  2785. {
  2786. complexTypes.push(ct)
  2787. };
  2788. this.getDynamicType=function OSF_DDA_SpecialProcessor$getDynamicType(dt)
  2789. {
  2790. return dynamicTypes[dt]
  2791. };
  2792. this.setDynamicType=function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler)
  2793. {
  2794. dynamicTypes[dt]=handler
  2795. };
  2796. this.isComplexType=function OSF_DDA_SpecialProcessor$isComplexType(t)
  2797. {
  2798. return OSF.OUtil.listContainsValue(complexTypes,t)
  2799. };
  2800. this.isDynamicType=function OSF_DDA_SpecialProcessor$isDynamicType(p)
  2801. {
  2802. return OSF.OUtil.listContainsKey(dynamicTypes,p)
  2803. };
  2804. this.preserveNesting=function OSF_DDA_SpecialProcessor$preserveNesting(p)
  2805. {
  2806. var pn=[];
  2807. if(OSF.DDA.PropertyDescriptors)
  2808. pn.push(OSF.DDA.PropertyDescriptors.Subset);
  2809. if(OSF.DDA.DataNodeEventProperties)
  2810. pn=pn.concat([OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode]);
  2811. return OSF.OUtil.listContainsValue(pn,p)
  2812. };
  2813. this.pack=function OSF_DDA_SpecialProcessor$pack(param, arg)
  2814. {
  2815. var value;
  2816. if(this.isDynamicType(param))
  2817. value=dynamicTypes[param].toHost(arg);
  2818. else
  2819. value=arg;
  2820. return value
  2821. };
  2822. this.unpack=function OSF_DDA_SpecialProcessor$unpack(param, arg)
  2823. {
  2824. var value;
  2825. if(this.isDynamicType(param))
  2826. value=dynamicTypes[param].fromHost(arg);
  2827. else
  2828. value=arg;
  2829. return value
  2830. }
  2831. };
  2832. OSF.DDA.getDecoratedParameterMap=function(specialProcessor, initialDefs)
  2833. {
  2834. var parameterMap=new OSF.DDA.HostParameterMap(specialProcessor);
  2835. var self=parameterMap.self;
  2836. function createObject(properties)
  2837. {
  2838. var obj=null;
  2839. if(properties)
  2840. {
  2841. obj={};
  2842. var len=properties.length;
  2843. for(var i=0; i < len; i++)
  2844. obj[properties[i].name]=properties[i].value
  2845. }
  2846. return obj
  2847. }
  2848. parameterMap.define=function define(definition)
  2849. {
  2850. var args={};
  2851. var toHost=createObject(definition.toHost);
  2852. if(definition.invertible)
  2853. args.map=toHost;
  2854. else if(definition.canonical)
  2855. args.toHost=args.fromHost=toHost;
  2856. else
  2857. {
  2858. args.toHost=toHost;
  2859. args.fromHost=createObject(definition.fromHost)
  2860. }
  2861. parameterMap.addMapping(definition.type,args);
  2862. if(definition.isComplexType)
  2863. parameterMap.addComplexType(definition.type)
  2864. };
  2865. for(var id in initialDefs)
  2866. parameterMap.define(initialDefs[id]);
  2867. return parameterMap
  2868. };
  2869. OSF.OUtil.setNamespace("DispIdHost",OSF.DDA);
  2870. OSF.DDA.DispIdHost.Methods={
  2871. InvokeMethod: "invokeMethod",
  2872. AddEventHandler: "addEventHandler",
  2873. RemoveEventHandler: "removeEventHandler",
  2874. OpenDialog: "openDialog",
  2875. CloseDialog: "closeDialog",
  2876. MessageParent: "messageParent"
  2877. };
  2878. OSF.DDA.DispIdHost.Delegates={
  2879. ExecuteAsync: "executeAsync",
  2880. RegisterEventAsync: "registerEventAsync",
  2881. UnregisterEventAsync: "unregisterEventAsync",
  2882. ParameterMap: "parameterMap",
  2883. MessageParent: "messageParent"
  2884. };
  2885. OSF.DDA.DispIdHost.Facade=function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap)
  2886. {
  2887. var dispIdMap={};
  2888. var jsom=OSF.DDA.AsyncMethodNames;
  2889. var did=OSF.DDA.MethodDispId;
  2890. var methodMap={
  2891. GoToByIdAsync: did.dispidNavigateToMethod,
  2892. GetSelectedDataAsync: did.dispidGetSelectedDataMethod,
  2893. SetSelectedDataAsync: did.dispidSetSelectedDataMethod,
  2894. GetDocumentCopyChunkAsync: did.dispidGetDocumentCopyChunkMethod,
  2895. ReleaseDocumentCopyAsync: did.dispidReleaseDocumentCopyMethod,
  2896. GetDocumentCopyAsync: did.dispidGetDocumentCopyMethod,
  2897. AddFromSelectionAsync: did.dispidAddBindingFromSelectionMethod,
  2898. AddFromPromptAsync: did.dispidAddBindingFromPromptMethod,
  2899. AddFromNamedItemAsync: did.dispidAddBindingFromNamedItemMethod,
  2900. GetAllAsync: did.dispidGetAllBindingsMethod,
  2901. GetByIdAsync: did.dispidGetBindingMethod,
  2902. ReleaseByIdAsync: did.dispidReleaseBindingMethod,
  2903. GetDataAsync: did.dispidGetBindingDataMethod,
  2904. SetDataAsync: did.dispidSetBindingDataMethod,
  2905. AddRowsAsync: did.dispidAddRowsMethod,
  2906. AddColumnsAsync: did.dispidAddColumnsMethod,
  2907. DeleteAllDataValuesAsync: did.dispidClearAllRowsMethod,
  2908. RefreshAsync: did.dispidLoadSettingsMethod,
  2909. SaveAsync: did.dispidSaveSettingsMethod,
  2910. GetActiveViewAsync: did.dispidGetActiveViewMethod,
  2911. GetFilePropertiesAsync: did.dispidGetFilePropertiesMethod,
  2912. GetOfficeThemeAsync: did.dispidGetOfficeThemeMethod,
  2913. GetDocumentThemeAsync: did.dispidGetDocumentThemeMethod,
  2914. ClearFormatsAsync: did.dispidClearFormatsMethod,
  2915. SetTableOptionsAsync: did.dispidSetTableOptionsMethod,
  2916. SetFormatsAsync: did.dispidSetFormatsMethod,
  2917. ExecuteRichApiRequestAsync: did.dispidExecuteRichApiRequestMethod,
  2918. AppCommandInvocationCompletedAsync: did.dispidAppCommandInvocationCompletedMethod,
  2919. AddDataPartAsync: did.dispidAddDataPartMethod,
  2920. GetDataPartByIdAsync: did.dispidGetDataPartByIdMethod,
  2921. GetDataPartsByNameSpaceAsync: did.dispidGetDataPartsByNamespaceMethod,
  2922. GetPartXmlAsync: did.dispidGetDataPartXmlMethod,
  2923. GetPartNodesAsync: did.dispidGetDataPartNodesMethod,
  2924. DeleteDataPartAsync: did.dispidDeleteDataPartMethod,
  2925. GetNodeValueAsync: did.dispidGetDataNodeValueMethod,
  2926. GetNodeXmlAsync: did.dispidGetDataNodeXmlMethod,
  2927. GetRelativeNodesAsync: did.dispidGetDataNodesMethod,
  2928. SetNodeValueAsync: did.dispidSetDataNodeValueMethod,
  2929. SetNodeXmlAsync: did.dispidSetDataNodeXmlMethod,
  2930. AddDataPartNamespaceAsync: did.dispidAddDataNamespaceMethod,
  2931. GetDataPartNamespaceAsync: did.dispidGetDataUriByPrefixMethod,
  2932. GetDataPartPrefixAsync: did.dispidGetDataPrefixByUriMethod,
  2933. GetNodeTextAsync: did.dispidGetDataNodeTextMethod,
  2934. SetNodeTextAsync: did.dispidSetDataNodeTextMethod,
  2935. GetSelectedTask: did.dispidGetSelectedTaskMethod,
  2936. GetTask: did.dispidGetTaskMethod,
  2937. GetWSSUrl: did.dispidGetWSSUrlMethod,
  2938. GetTaskField: did.dispidGetTaskFieldMethod,
  2939. GetSelectedResource: did.dispidGetSelectedResourceMethod,
  2940. GetResourceField: did.dispidGetResourceFieldMethod,
  2941. GetProjectField: did.dispidGetProjectFieldMethod,
  2942. GetSelectedView: did.dispidGetSelectedViewMethod,
  2943. GetTaskByIndex: did.dispidGetTaskByIndexMethod,
  2944. GetResourceByIndex: did.dispidGetResourceByIndexMethod,
  2945. SetTaskField: did.dispidSetTaskFieldMethod,
  2946. SetResourceField: did.dispidSetResourceFieldMethod,
  2947. GetMaxTaskIndex: did.dispidGetMaxTaskIndexMethod,
  2948. GetMaxResourceIndex: did.dispidGetMaxResourceIndexMethod
  2949. };
  2950. for(var method in methodMap)
  2951. if(jsom[method])
  2952. dispIdMap[jsom[method].id]=methodMap[method];
  2953. jsom=OSF.DDA.SyncMethodNames;
  2954. did=OSF.DDA.MethodDispId;
  2955. var asyncMethodMap={MessageParent: did.dispidMessageParentMethod};
  2956. for(var method in asyncMethodMap)
  2957. if(jsom[method])
  2958. dispIdMap[jsom[method].id]=methodMap[method];
  2959. jsom=Microsoft.Office.WebExtension.EventType;
  2960. did=OSF.DDA.EventDispId;
  2961. var eventMap={
  2962. SettingsChanged: did.dispidSettingsChangedEvent,
  2963. DocumentSelectionChanged: did.dispidDocumentSelectionChangedEvent,
  2964. BindingSelectionChanged: did.dispidBindingSelectionChangedEvent,
  2965. BindingDataChanged: did.dispidBindingDataChangedEvent,
  2966. ActiveViewChanged: did.dispidActiveViewChangedEvent,
  2967. OfficeThemeChanged: did.dispidOfficeThemeChangedEvent,
  2968. DocumentThemeChanged: did.dispidDocumentThemeChangedEvent,
  2969. AppCommandInvoked: did.dispidAppCommandInvokedEvent,
  2970. DialogMessageReceived: did.dispidDialogMessageReceivedEvent,
  2971. TaskSelectionChanged: did.dispidTaskSelectionChangedEvent,
  2972. ResourceSelectionChanged: did.dispidResourceSelectionChangedEvent,
  2973. ViewSelectionChanged: did.dispidViewSelectionChangedEvent,
  2974. DataNodeInserted: did.dispidDataNodeAddedEvent,
  2975. DataNodeReplaced: did.dispidDataNodeReplacedEvent,
  2976. DataNodeDeleted: did.dispidDataNodeDeletedEvent
  2977. };
  2978. for(var event in eventMap)
  2979. if(jsom[event])
  2980. dispIdMap[jsom[event]]=eventMap[event];
  2981. function onException(ex, asyncMethodCall, suppliedArgs, callArgs)
  2982. {
  2983. if(typeof ex=="number")
  2984. {
  2985. if(!callArgs)
  2986. callArgs=asyncMethodCall.getCallArgs(suppliedArgs);
  2987. OSF.DDA.issueAsyncResult(callArgs,ex,OSF.DDA.ErrorCodeManager.getErrorArgs(ex))
  2988. }
  2989. else
  2990. throw ex;
  2991. }
  2992. this[OSF.DDA.DispIdHost.Methods.InvokeMethod]=function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState)
  2993. {
  2994. var callArgs;
  2995. try
  2996. {
  2997. var methodName=method.id;
  2998. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[methodName];
  2999. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,privateState);
  3000. var dispId=dispIdMap[methodName];
  3001. var delegate=getDelegateMethods(methodName);
  3002. var hostCallArgs;
  3003. if(parameterMap.toHost)
  3004. hostCallArgs=parameterMap.toHost(dispId,callArgs);
  3005. else
  3006. hostCallArgs=callArgs;
  3007. delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({
  3008. dispId: dispId,
  3009. hostCallArgs: hostCallArgs,
  3010. onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling()
  3011. {
  3012. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)
  3013. },
  3014. onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving()
  3015. {
  3016. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)
  3017. },
  3018. onComplete: function(status, hostResponseArgs)
  3019. {
  3020. var responseArgs;
  3021. if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3022. if(parameterMap.fromHost)
  3023. responseArgs=parameterMap.fromHost(dispId,hostResponseArgs);
  3024. else
  3025. responseArgs=hostResponseArgs;
  3026. else
  3027. responseArgs=hostResponseArgs;
  3028. var payload=asyncMethodCall.processResponse(status,responseArgs,caller,callArgs);
  3029. OSF.DDA.issueAsyncResult(callArgs,status,payload)
  3030. }
  3031. })
  3032. }
  3033. catch(ex)
  3034. {
  3035. onException(ex,asyncMethodCall,suppliedArguments,callArgs)
  3036. }
  3037. };
  3038. this[OSF.DDA.DispIdHost.Methods.AddEventHandler]=function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller)
  3039. {
  3040. var callArgs;
  3041. var eventType,
  3042. handler;
  3043. function onEnsureRegistration(status)
  3044. {
  3045. if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3046. {
  3047. var added=eventDispatch.addEventHandler(eventType,handler);
  3048. if(!added)
  3049. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed
  3050. }
  3051. var error;
  3052. if(status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3053. error=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  3054. OSF.DDA.issueAsyncResult(callArgs,status,error)
  3055. }
  3056. try
  3057. {
  3058. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id];
  3059. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,eventDispatch);
  3060. eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  3061. handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  3062. if(eventDispatch.getEventHandlerCount(eventType)==0)
  3063. {
  3064. var dispId=dispIdMap[eventType];
  3065. var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];
  3066. invoker({
  3067. eventType: eventType,
  3068. dispId: dispId,
  3069. targetId: caller.id || "",
  3070. onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling()
  3071. {
  3072. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)
  3073. },
  3074. onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving()
  3075. {
  3076. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)
  3077. },
  3078. onComplete: onEnsureRegistration,
  3079. onEvent: function handleEvent(hostArgs)
  3080. {
  3081. var args=parameterMap.fromHost(dispId,hostArgs);
  3082. eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType,caller,args))
  3083. }
  3084. })
  3085. }
  3086. else
  3087. onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3088. }
  3089. catch(ex)
  3090. {
  3091. onException(ex,asyncMethodCall,suppliedArguments,callArgs)
  3092. }
  3093. };
  3094. this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler]=function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller)
  3095. {
  3096. var callArgs;
  3097. var eventType,
  3098. handler;
  3099. function onEnsureRegistration(status)
  3100. {
  3101. var error;
  3102. if(status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3103. error=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  3104. OSF.DDA.issueAsyncResult(callArgs,status,error)
  3105. }
  3106. try
  3107. {
  3108. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id];
  3109. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,eventDispatch);
  3110. eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  3111. handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  3112. var status,
  3113. removeSuccess;
  3114. if(handler===null)
  3115. {
  3116. removeSuccess=eventDispatch.clearEventHandlers(eventType);
  3117. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess
  3118. }
  3119. else
  3120. {
  3121. removeSuccess=eventDispatch.removeEventHandler(eventType,handler);
  3122. status=removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist
  3123. }
  3124. if(removeSuccess && eventDispatch.getEventHandlerCount(eventType)==0)
  3125. {
  3126. var dispId=dispIdMap[eventType];
  3127. var invoker=getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync];
  3128. invoker({
  3129. eventType: eventType,
  3130. dispId: dispId,
  3131. targetId: caller.id || "",
  3132. onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling()
  3133. {
  3134. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)
  3135. },
  3136. onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving()
  3137. {
  3138. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)
  3139. },
  3140. onComplete: onEnsureRegistration
  3141. })
  3142. }
  3143. else
  3144. onEnsureRegistration(status)
  3145. }
  3146. catch(ex)
  3147. {
  3148. onException(ex,asyncMethodCall,suppliedArguments,callArgs)
  3149. }
  3150. };
  3151. this[OSF.DDA.DispIdHost.Methods.OpenDialog]=function OSF_DDA_DispIdHost_Facade$OpenDialog(suppliedArguments, eventDispatch, caller)
  3152. {
  3153. var callArgs;
  3154. var dialogMessageEvent,
  3155. dialogOtherEvent;
  3156. var targetId;
  3157. function onEnsureRegistration(status)
  3158. {
  3159. var payload;
  3160. if(status !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3161. payload=OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  3162. else
  3163. {
  3164. var onSucceedArgs={};
  3165. onSucceedArgs[Microsoft.Office.WebExtension.Parameters.Id]=targetId;
  3166. onSucceedArgs[Microsoft.Office.WebExtension.Parameters.Data]=eventDispatch;
  3167. var payload=asyncMethodCall.processResponse(status,onSucceedArgs,caller,callArgs)
  3168. }
  3169. OSF.DDA.issueAsyncResult(callArgs,status,payload)
  3170. }
  3171. try
  3172. {
  3173. dialogMessageEvent=Microsoft.Office.WebExtension.EventType.DialogMessageReceived;
  3174. dialogOtherEvent=Microsoft.Office.WebExtension.EventType.DialogEventReceived;
  3175. if(dialogMessageEvent==undefined || dialogOtherEvent==undefined)
  3176. onEnsureRegistration(OSF.DDA.ErrorCodeManager.ooeOperationNotSupported);
  3177. if(OSF.DDA.AsyncMethodNames.DisplayDialogAsync==null)
  3178. {
  3179. onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  3180. return
  3181. }
  3182. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.DisplayDialogAsync.id];
  3183. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,eventDispatch);
  3184. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3185. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3186. var dispId=dispIdMap[dialogMessageEvent];
  3187. var invoker=getDelegateMethods(dialogMessageEvent)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];
  3188. targetId=JSON.stringify(callArgs);
  3189. invoker({
  3190. eventType: dialogMessageEvent,
  3191. dispId: dispId,
  3192. targetId: targetId,
  3193. onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling()
  3194. {
  3195. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)
  3196. },
  3197. onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving()
  3198. {
  3199. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)
  3200. },
  3201. onComplete: onEnsureRegistration,
  3202. onEvent: function handleEvent(hostArgs)
  3203. {
  3204. var args=parameterMap.fromHost(dispId,hostArgs);
  3205. var event=OSF.DDA.OMFactory.manufactureEventArgs(dialogMessageEvent,caller,args);
  3206. if(event.type==dialogOtherEvent)
  3207. {
  3208. var payload=OSF.DDA.ErrorCodeManager.getErrorArgs(event.error);
  3209. var errorArgs={};
  3210. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3211. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=payload.name || payload;
  3212. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=payload.message || payload;
  3213. event.error=new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name],errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message],errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])
  3214. }
  3215. eventDispatch.fireOrQueueEvent(event);
  3216. if(args[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogClosed)
  3217. {
  3218. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3219. eventDispatch.clearEventHandlers(dialogOtherEvent)
  3220. }
  3221. }
  3222. })
  3223. }
  3224. catch(ex)
  3225. {
  3226. onException(ex,asyncMethodCall,suppliedArguments,callArgs)
  3227. }
  3228. };
  3229. this[OSF.DDA.DispIdHost.Methods.CloseDialog]=function OSF_DDA_DispIdHost_Facade$CloseDialog(suppliedArguments, targetId, eventDispatch, caller)
  3230. {
  3231. var callArgs;
  3232. var dialogMessageEvent,
  3233. dialogOtherEvent;
  3234. var closeStatus=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  3235. function closeCallback(status)
  3236. {
  3237. closeStatus=status
  3238. }
  3239. try
  3240. {
  3241. var asyncMethodCall=OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.CloseAsync.id];
  3242. callArgs=asyncMethodCall.verifyAndExtractCall(suppliedArguments,caller,eventDispatch);
  3243. dialogMessageEvent=Microsoft.Office.WebExtension.EventType.DialogMessageReceived;
  3244. dialogOtherEvent=Microsoft.Office.WebExtension.EventType.DialogEventReceived;
  3245. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3246. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3247. var dispId=dispIdMap[dialogMessageEvent];
  3248. var invoker=getDelegateMethods(dialogMessageEvent)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync];
  3249. invoker({
  3250. eventType: dialogMessageEvent,
  3251. dispId: dispId,
  3252. targetId: targetId,
  3253. onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling()
  3254. {
  3255. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)
  3256. },
  3257. onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving()
  3258. {
  3259. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)
  3260. },
  3261. onComplete: closeCallback
  3262. })
  3263. }
  3264. catch(ex)
  3265. {
  3266. onException(ex,asyncMethodCall,suppliedArguments,callArgs)
  3267. }
  3268. if(closeStatus !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3269. throw OSF.OUtil.formatString(Strings.OfficeOM.L_FunctionCallFailed,OSF.DDA.AsyncMethodNames.CloseAsync.displayName,closeStatus);
  3270. };
  3271. this[OSF.DDA.DispIdHost.Methods.MessageParent]=function OSF_DDA_DispIdHost_Facade$MessageParent(suppliedArguments, caller)
  3272. {
  3273. var stateInfo={};
  3274. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.MessageParent.id];
  3275. var callArgs=syncMethodCall.verifyAndExtractCall(suppliedArguments,caller,stateInfo);
  3276. var delegate=getDelegateMethods(OSF.DDA.SyncMethodNames.MessageParent.id);
  3277. var invoker=delegate[OSF.DDA.DispIdHost.Delegates.MessageParent];
  3278. var dispId=dispIdMap[syncMethodCall];
  3279. return invoker({
  3280. dispId: dispId,
  3281. hostCallArgs: callArgs[Microsoft.Office.WebExtension.Parameters.MessageToParent],
  3282. onCalling: function OSF_DDA_DispIdFacade$Execute_onCalling()
  3283. {
  3284. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall)
  3285. },
  3286. onReceiving: function OSF_DDA_DispIdFacade$Execute_onReceiving()
  3287. {
  3288. OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse)
  3289. }
  3290. })
  3291. }
  3292. };
  3293. OSF.DDA.DispIdHost.addAsyncMethods=function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState)
  3294. {
  3295. for(var entry in asyncMethodNames)
  3296. {
  3297. var method=asyncMethodNames[entry];
  3298. var name=method.displayName;
  3299. if(!target[name])
  3300. OSF.OUtil.defineEnumerableProperty(target,name,{value: function(asyncMethod)
  3301. {
  3302. return function()
  3303. {
  3304. var invokeMethod=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod];
  3305. invokeMethod(asyncMethod,arguments,target,privateState)
  3306. }
  3307. }(method)})
  3308. }
  3309. };
  3310. OSF.DDA.DispIdHost.addEventSupport=function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch)
  3311. {
  3312. var add=OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName;
  3313. var remove=OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName;
  3314. if(!target[add])
  3315. OSF.OUtil.defineEnumerableProperty(target,add,{value: function()
  3316. {
  3317. var addEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler];
  3318. addEventHandler(arguments,eventDispatch,target)
  3319. }});
  3320. if(!target[remove])
  3321. OSF.OUtil.defineEnumerableProperty(target,remove,{value: function()
  3322. {
  3323. var removeEventHandler=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler];
  3324. removeEventHandler(arguments,eventDispatch,target)
  3325. }})
  3326. };
  3327. if(!OsfMsAjaxFactory.isMsAjaxLoaded())
  3328. if(!(OSF._OfficeAppFactory && OSF._OfficeAppFactory && OSF._OfficeAppFactory.getLoadScriptHelper && OSF._OfficeAppFactory.getLoadScriptHelper().isScriptLoading(OSF.ConstantNames.MicrosoftAjaxId)))
  3329. {
  3330. var msAjaxCDNPath=(window.location.protocol.toLowerCase()==="https:" ? "https:" : "http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";
  3331. OsfMsAjaxFactory.loadMsAjaxFull(function OSF$loadMSAjaxCallback()
  3332. {
  3333. if(!OsfMsAjaxFactory.isMsAjaxLoaded())
  3334. throw"Not able to load MicrosoftAjax.js.";
  3335. })
  3336. }
  3337. OSF.OUtil.setNamespace("SafeArray",OSF.DDA);
  3338. OSF.DDA.SafeArray.Response={
  3339. Status: 0,
  3340. Payload: 1
  3341. };
  3342. OSF.DDA.SafeArray.UniqueArguments={
  3343. Offset: "offset",
  3344. Run: "run",
  3345. BindingSpecificData: "bindingSpecificData",
  3346. MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}"
  3347. };
  3348. OSF.OUtil.setNamespace("Delegate",OSF.DDA.SafeArray);
  3349. OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args)
  3350. {
  3351. var status;
  3352. var statusNumber=ex.number;
  3353. if(statusNumber)
  3354. switch(statusNumber)
  3355. {
  3356. case-2146828218:
  3357. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  3358. break;
  3359. case-2147467259:
  3360. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened;
  3361. break;
  3362. case-2146828283:
  3363. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidParam;
  3364. break;
  3365. case-2146827850:
  3366. default:
  3367. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3368. break
  3369. }
  3370. if(args.onComplete)
  3371. args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError)
  3372. };
  3373. OSF.DDA.SafeArray.Delegate._onExceptionSyncMethod=function OSF_DDA_SafeArray_Delegate$OnExceptionSyncMethod(ex, args)
  3374. {
  3375. var status;
  3376. var number=ex.number;
  3377. if(number)
  3378. switch(number)
  3379. {
  3380. case-2146828218:
  3381. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  3382. break;
  3383. case-2146827850:
  3384. default:
  3385. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3386. break
  3387. }
  3388. return status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError
  3389. };
  3390. OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor()
  3391. {
  3392. function _2DVBArrayToJaggedArray(vbArr)
  3393. {
  3394. var ret;
  3395. try
  3396. {
  3397. var rows=vbArr.ubound(1);
  3398. var cols=vbArr.ubound(2);
  3399. vbArr=vbArr.toArray();
  3400. if(rows==1 && cols==1)
  3401. ret=[vbArr];
  3402. else
  3403. {
  3404. ret=[];
  3405. for(var row=0; row < rows; row++)
  3406. {
  3407. var rowArr=[];
  3408. for(var col=0; col < cols; col++)
  3409. {
  3410. var datum=vbArr[row * cols+col];
  3411. if(datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid)
  3412. rowArr.push(datum)
  3413. }
  3414. if(rowArr.length > 0)
  3415. ret.push(rowArr)
  3416. }
  3417. }
  3418. }
  3419. catch(ex){}
  3420. return ret
  3421. }
  3422. var complexTypes=[];
  3423. var dynamicTypes={};
  3424. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=function()
  3425. {
  3426. var tableRows=0;
  3427. var tableHeaders=1;
  3428. return{
  3429. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data)
  3430. {
  3431. if(typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined)
  3432. {
  3433. var tableData=[];
  3434. tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows];
  3435. tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders];
  3436. data=tableData
  3437. }
  3438. return data
  3439. },
  3440. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs)
  3441. {
  3442. var ret;
  3443. if(hostArgs.toArray)
  3444. {
  3445. var dimensions=hostArgs.dimensions();
  3446. if(dimensions===2)
  3447. ret=_2DVBArrayToJaggedArray(hostArgs);
  3448. else
  3449. {
  3450. var array=hostArgs.toArray();
  3451. if(array.length===2 && (array[0] !=null && array[0].toArray || array[1] !=null && array[1].toArray))
  3452. {
  3453. ret={};
  3454. ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]);
  3455. ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders])
  3456. }
  3457. else
  3458. ret=array
  3459. }
  3460. }
  3461. else
  3462. ret=hostArgs;
  3463. return ret
  3464. }
  3465. }
  3466. }();
  3467. OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this,complexTypes,dynamicTypes);
  3468. this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg)
  3469. {
  3470. var value;
  3471. if(this.isComplexType(param) || OSF.DDA.ListType.isListType(param))
  3472. {
  3473. var toArraySupported=(arg || typeof arg==="unknown") && arg.toArray;
  3474. value=toArraySupported ? arg.toArray() : arg || {}
  3475. }
  3476. else if(this.isDynamicType(param))
  3477. value=dynamicTypes[param].fromHost(arg);
  3478. else
  3479. value=arg;
  3480. return value
  3481. }
  3482. };
  3483. OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor);
  3484. OSF.DDA.SafeArray.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor,[{
  3485. type: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  3486. toHost: [{
  3487. name: Microsoft.Office.WebExtension.ValueFormat.Unformatted,
  3488. value: 0
  3489. },{
  3490. name: Microsoft.Office.WebExtension.ValueFormat.Formatted,
  3491. value: 1
  3492. }]
  3493. },{
  3494. type: Microsoft.Office.WebExtension.Parameters.FilterType,
  3495. toHost: [{
  3496. name: Microsoft.Office.WebExtension.FilterType.All,
  3497. value: 0
  3498. }]
  3499. }]);
  3500. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  3501. type: OSF.DDA.PropertyDescriptors.AsyncResultStatus,
  3502. fromHost: [{
  3503. name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded,
  3504. value: 0
  3505. },{
  3506. name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed,
  3507. value: 1
  3508. }]
  3509. });
  3510. OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args)
  3511. {
  3512. function toArray(args)
  3513. {
  3514. var arrArgs=args;
  3515. if(OSF.OUtil.isArray(args))
  3516. {
  3517. var len=arrArgs.length;
  3518. for(var i=0; i < len; i++)
  3519. arrArgs[i]=toArray(arrArgs[i])
  3520. }
  3521. else if(OSF.OUtil.isDate(args))
  3522. arrArgs=args.getVarDate();
  3523. else if(typeof args==="object" && !OSF.OUtil.isArray(args))
  3524. {
  3525. arrArgs=[];
  3526. for(var index in args)
  3527. if(!OSF.OUtil.isFunction(args[index]))
  3528. arrArgs[index]=toArray(args[index])
  3529. }
  3530. return arrArgs
  3531. }
  3532. function fromSafeArray(value)
  3533. {
  3534. var ret=value;
  3535. if(value !=null && value.toArray)
  3536. {
  3537. var arrayResult=value.toArray();
  3538. ret=new Array(arrayResult.length);
  3539. for(var i=0; i < arrayResult.length; i++)
  3540. ret[i]=fromSafeArray(arrayResult[i])
  3541. }
  3542. return ret
  3543. }
  3544. try
  3545. {
  3546. if(args.onCalling)
  3547. args.onCalling();
  3548. var startTime=(new Date).getTime();
  3549. OSF.ClientHostController.execute(args.dispId,toArray(args.hostCallArgs),function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs)
  3550. {
  3551. var result=hostResponseArgs.toArray();
  3552. var status=result[OSF.DDA.SafeArray.Response.Status];
  3553. if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeChunkResult)
  3554. {
  3555. var payload=result[OSF.DDA.SafeArray.Response.Payload];
  3556. payload=fromSafeArray(payload);
  3557. if(payload !=null)
  3558. {
  3559. if(!args._chunkResultData)
  3560. args._chunkResultData=new Array;
  3561. args._chunkResultData[payload[0]]=payload[1]
  3562. }
  3563. return false
  3564. }
  3565. if(args.onReceiving)
  3566. args.onReceiving();
  3567. if(args.onComplete)
  3568. {
  3569. var payload;
  3570. if(status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  3571. {
  3572. if(result.length > 2)
  3573. {
  3574. payload=[];
  3575. for(var i=1; i < result.length; i++)
  3576. payload[i - 1]=result[i]
  3577. }
  3578. else
  3579. payload=result[OSF.DDA.SafeArray.Response.Payload];
  3580. if(args._chunkResultData)
  3581. {
  3582. payload=fromSafeArray(payload);
  3583. if(payload !=null)
  3584. {
  3585. var expectedChunkCount=payload[payload.length - 1];
  3586. if(args._chunkResultData.length==expectedChunkCount)
  3587. payload[payload.length - 1]=args._chunkResultData;
  3588. else
  3589. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError
  3590. }
  3591. }
  3592. }
  3593. else
  3594. payload=result[OSF.DDA.SafeArray.Response.Payload];
  3595. args.onComplete(status,payload)
  3596. }
  3597. if(OSF.AppTelemetry)
  3598. OSF.AppTelemetry.onMethodDone(args.dispId,args.hostCallArgs,Math.abs((new Date).getTime() - startTime),status);
  3599. return true
  3600. })
  3601. }
  3602. catch(ex)
  3603. {
  3604. OSF.DDA.SafeArray.Delegate._onException(ex,args)
  3605. }
  3606. };
  3607. OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args)
  3608. {
  3609. var startTime=(new Date).getTime();
  3610. return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs)
  3611. {
  3612. if(args.onReceiving)
  3613. args.onReceiving();
  3614. var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs;
  3615. if(args.onComplete)
  3616. args.onComplete(status);
  3617. if(OSF.AppTelemetry)
  3618. OSF.AppTelemetry.onRegisterDone(register,args.dispId,Math.abs((new Date).getTime() - startTime),status)
  3619. }
  3620. };
  3621. OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args)
  3622. {
  3623. if(args.onCalling)
  3624. args.onCalling();
  3625. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true,args);
  3626. try
  3627. {
  3628. OSF.ClientHostController.registerEvent(args.dispId,args.targetId,function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload)
  3629. {
  3630. if(args.onEvent)
  3631. args.onEvent(payload);
  3632. if(OSF.AppTelemetry)
  3633. OSF.AppTelemetry.onEventDone(args.dispId)
  3634. },callback)
  3635. }
  3636. catch(ex)
  3637. {
  3638. OSF.DDA.SafeArray.Delegate._onException(ex,args)
  3639. }
  3640. };
  3641. OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args)
  3642. {
  3643. if(args.onCalling)
  3644. args.onCalling();
  3645. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false,args);
  3646. try
  3647. {
  3648. OSF.ClientHostController.unregisterEvent(args.dispId,args.targetId,callback)
  3649. }
  3650. catch(ex)
  3651. {
  3652. OSF.DDA.SafeArray.Delegate._onException(ex,args)
  3653. }
  3654. };
  3655. OSF.ClientMode={
  3656. ReadWrite: 0,
  3657. ReadOnly: 1
  3658. };
  3659. OSF.DDA.RichInitializationReason={
  3660. 1: Microsoft.Office.WebExtension.InitializationReason.Inserted,
  3661. 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened
  3662. };
  3663. OSF.InitializationHelper=function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade)
  3664. {
  3665. this._hostInfo=hostInfo;
  3666. this._webAppState=webAppState;
  3667. this._context=context;
  3668. this._settings=settings;
  3669. this._hostFacade=hostFacade;
  3670. this._initializeSettings=this.initializeSettings
  3671. };
  3672. OSF.InitializationHelper.prototype.deserializeSettings=function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported)
  3673. {
  3674. var settings;
  3675. var osfSessionStorage=OSF.OUtil.getSessionStorage();
  3676. if(osfSessionStorage)
  3677. {
  3678. var storageSettings=osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());
  3679. if(storageSettings)
  3680. serializedSettings=typeof JSON !=="undefined" ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings,true);
  3681. else
  3682. {
  3683. storageSettings=typeof JSON !=="undefined" ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings);
  3684. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),storageSettings)
  3685. }
  3686. }
  3687. var deserializedSettings=OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  3688. if(refreshSupported)
  3689. settings=new OSF.DDA.RefreshableSettings(deserializedSettings);
  3690. else
  3691. settings=new OSF.DDA.Settings(deserializedSettings);
  3692. return settings
  3693. };
  3694. OSF.InitializationHelper.prototype.setAgaveHostCommunication=function OSF_InitializationHelper$setAgaveHostCommunication(){};
  3695. OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize=function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext)
  3696. {
  3697. this.prepareApiSurface(appContext);
  3698. Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext))
  3699. };
  3700. OSF.InitializationHelper.prototype.prepareApiSurface=function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext)
  3701. {
  3702. var license=new OSF.DDA.License(appContext.get_eToken());
  3703. var getOfficeThemeHandler=OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme ? OSF.DDA.OfficeTheme.getOfficeTheme : null;
  3704. if(appContext.get_isDialog())
  3705. {
  3706. if(OSF.DDA.UI.ChildUI)
  3707. appContext.ui=new OSF.DDA.UI.ChildUI
  3708. }
  3709. else if(OSF.DDA.UI.ParentUI)
  3710. appContext.ui=new OSF.DDA.UI.ParentUI;
  3711. OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext,appContext.doc,license,null,getOfficeThemeHandler));
  3712. var getDelegateMethods,
  3713. parameterMap;
  3714. getDelegateMethods=OSF.DDA.DispIdHost.getClientDelegateMethods;
  3715. parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap;
  3716. OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods,parameterMap))
  3717. };
  3718. OSF.InitializationHelper.prototype.getInitializationReason=function(appContext)
  3719. {
  3720. return OSF.DDA.RichInitializationReason[appContext.get_reason()]
  3721. };
  3722. OSF.DDA.DispIdHost.getClientDelegateMethods=function(actionId)
  3723. {
  3724. var delegateMethods={};
  3725. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync;
  3726. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync;
  3727. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync;
  3728. delegateMethods[OSF.DDA.DispIdHost.Delegates.MessageParent]=OSF.DDA.SafeArray.Delegate.messageParent;
  3729. if(OSF.DDA.AsyncMethodNames.RefreshAsync && actionId==OSF.DDA.AsyncMethodNames.RefreshAsync.id)
  3730. {
  3731. var readSerializedSettings=function(hostCallArgs, onCalling, onReceiving)
  3732. {
  3733. return OSF.DDA.ClientSettingsManager.read(onCalling,onReceiving)
  3734. };
  3735. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings)
  3736. }
  3737. if(OSF.DDA.AsyncMethodNames.SaveAsync && actionId==OSF.DDA.AsyncMethodNames.SaveAsync.id)
  3738. {
  3739. var writeSerializedSettings=function(hostCallArgs, onCalling, onReceiving)
  3740. {
  3741. return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings],hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale],onCalling,onReceiving)
  3742. };
  3743. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings)
  3744. }
  3745. return delegateMethods
  3746. };
  3747. var OSFRichclient;
  3748. (function(OSFRichclient)
  3749. {
  3750. var RichClientHostController=function()
  3751. {
  3752. function RichClientHostController(){}
  3753. RichClientHostController.prototype.execute=function(id, params, callback)
  3754. {
  3755. window.external.Execute(id,params,callback)
  3756. };
  3757. RichClientHostController.prototype.registerEvent=function(id, targetId, handler, callback)
  3758. {
  3759. window.external.RegisterEvent(id,targetId,handler,callback)
  3760. };
  3761. RichClientHostController.prototype.unregisterEvent=function(id, targetId, callback)
  3762. {
  3763. window.external.UnregisterEvent(id,targetId,callback)
  3764. };
  3765. RichClientHostController.prototype.messageParent=function(message)
  3766. {
  3767. window.external.MessageParent(message)
  3768. };
  3769. return RichClientHostController
  3770. }();
  3771. OSFRichclient.RichClientHostController=RichClientHostController
  3772. })(OSFRichclient || (OSFRichclient={}));
  3773. OSF.ClientHostController=new OSFRichclient.RichClientHostController;
  3774. var OfficeExt;
  3775. (function(OfficeExt)
  3776. {
  3777. var OfficeTheme;
  3778. (function(OfficeTheme)
  3779. {
  3780. var OfficeThemeManager=function()
  3781. {
  3782. function OfficeThemeManager()
  3783. {
  3784. this._osfOfficeTheme=null;
  3785. this._osfOfficeThemeTimeStamp=null
  3786. }
  3787. OfficeThemeManager.prototype.getOfficeTheme=function()
  3788. {
  3789. if(OSF.DDA._OsfControlContext)
  3790. {
  3791. if(this._osfOfficeTheme && this._osfOfficeThemeTimeStamp && (new Date).getTime() - this._osfOfficeThemeTimeStamp < OfficeThemeManager._osfOfficeThemeCacheValidPeriod)
  3792. {
  3793. if(OSF.AppTelemetry)
  3794. OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo",0)
  3795. }
  3796. else
  3797. {
  3798. var startTime=(new Date).getTime();
  3799. var osfOfficeTheme=OSF.DDA._OsfControlContext.GetOfficeThemeInfo();
  3800. var endTime=(new Date).getTime();
  3801. if(OSF.AppTelemetry)
  3802. OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo",Math.abs(endTime - startTime));
  3803. this._osfOfficeTheme=JSON.parse(osfOfficeTheme);
  3804. for(var color in this._osfOfficeTheme)
  3805. this._osfOfficeTheme[color]=OSF.OUtil.convertIntToCssHexColor(this._osfOfficeTheme[color]);
  3806. this._osfOfficeThemeTimeStamp=endTime
  3807. }
  3808. return this._osfOfficeTheme
  3809. }
  3810. };
  3811. OfficeThemeManager.instance=function()
  3812. {
  3813. if(OfficeThemeManager._instance==null)
  3814. OfficeThemeManager._instance=new OfficeThemeManager;
  3815. return OfficeThemeManager._instance
  3816. };
  3817. OfficeThemeManager._osfOfficeThemeCacheValidPeriod=5e3;
  3818. OfficeThemeManager._instance=null;
  3819. return OfficeThemeManager
  3820. }();
  3821. OfficeTheme.OfficeThemeManager=OfficeThemeManager;
  3822. OSF.OUtil.setNamespace("OfficeTheme",OSF.DDA);
  3823. OSF.DDA.OfficeTheme.getOfficeTheme=OfficeExt.OfficeTheme.OfficeThemeManager.instance().getOfficeTheme
  3824. })(OfficeTheme=OfficeExt.OfficeTheme || (OfficeExt.OfficeTheme={}))
  3825. })(OfficeExt || (OfficeExt={}));
  3826. OSF.DDA.ClientSettingsManager={
  3827. getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod)
  3828. {
  3829. return function(args)
  3830. {
  3831. var status,
  3832. response;
  3833. try
  3834. {
  3835. response=hostDelegateMethod(args.hostCallArgs,args.onCalling,args.onReceiving);
  3836. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess
  3837. }
  3838. catch(ex)
  3839. {
  3840. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3841. response={
  3842. name: Strings.OfficeOM.L_InternalError,
  3843. message: ex
  3844. }
  3845. }
  3846. if(args.onComplete)
  3847. args.onComplete(status,response)
  3848. }
  3849. },
  3850. read: function OSF_DDA_ClientSettingsManager$read(onCalling, onReceiving)
  3851. {
  3852. var keys=[];
  3853. var values=[];
  3854. if(onCalling)
  3855. onCalling();
  3856. OSF.DDA._OsfControlContext.GetSettings().Read(keys,values);
  3857. if(onReceiving)
  3858. onReceiving();
  3859. var serializedSettings={};
  3860. for(var index=0; index < keys.length; index++)
  3861. serializedSettings[keys[index]]=values[index];
  3862. return serializedSettings
  3863. },
  3864. write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onReceiving)
  3865. {
  3866. var keys=[];
  3867. var values=[];
  3868. for(var key in serializedSettings)
  3869. {
  3870. keys.push(key);
  3871. values.push(serializedSettings[key])
  3872. }
  3873. if(onCalling)
  3874. onCalling();
  3875. OSF.DDA._OsfControlContext.GetSettings().Write(keys,values);
  3876. if(onReceiving)
  3877. onReceiving()
  3878. }
  3879. };
  3880. OSF.InitializationHelper.prototype.initializeSettings=function OSF_InitializationHelper$initializeSettings(refreshSupported)
  3881. {
  3882. var serializedSettings=OSF.DDA.ClientSettingsManager.read();
  3883. var settings=this.deserializeSettings(serializedSettings,refreshSupported);
  3884. return settings
  3885. };
  3886. OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext)
  3887. {
  3888. var returnedContext;
  3889. var context=OSF.DDA._OsfControlContext=window.external.GetContext();
  3890. var appType=context.GetAppType();
  3891. var appTypeSupported=false;
  3892. for(var appEntry in OSF.AppName)
  3893. if(OSF.AppName[appEntry]==appType)
  3894. {
  3895. appTypeSupported=true;
  3896. break
  3897. }
  3898. if(!appTypeSupported)
  3899. throw"Unsupported client type "+appType;
  3900. var id=context.GetSolutionRef();
  3901. var version=context.GetAppVersionMajor();
  3902. var minorVersion=context.GetAppVersionMinor();
  3903. var UILocale=context.GetAppUILocale();
  3904. var dataLocale=context.GetAppDataLocale();
  3905. var docUrl=context.GetDocUrl();
  3906. var clientMode=context.GetAppCapabilities();
  3907. var reason=context.GetActivationMode();
  3908. var osfControlType=context.GetControlIntegrationLevel();
  3909. var settings=[];
  3910. var eToken;
  3911. try
  3912. {
  3913. eToken=context.GetSolutionToken()
  3914. }
  3915. catch(ex){}
  3916. var correlationId;
  3917. if(typeof context.GetCorrelationId !=="undefined")
  3918. correlationId=context.GetCorrelationId();
  3919. var appInstanceId;
  3920. if(typeof context.GetInstanceId !=="undefined")
  3921. appInstanceId=context.GetInstanceId();
  3922. var touchEnabled;
  3923. if(typeof context.GetTouchEnabled !=="undefined")
  3924. touchEnabled=context.GetTouchEnabled();
  3925. var commerceAllowed;
  3926. if(typeof context.GetCommerceAllowed !=="undefined")
  3927. commerceAllowed=context.GetCommerceAllowed();
  3928. var requirementMatrix;
  3929. if(typeof context.GetSupportedMatrix !=="undefined")
  3930. requirementMatrix=context.GetSupportedMatrix();
  3931. eToken=eToken ? eToken.toString() : "";
  3932. returnedContext=new OSF.OfficeAppContext(id,appType,version,UILocale,dataLocale,docUrl,clientMode,settings,reason,osfControlType,eToken,correlationId,appInstanceId,touchEnabled,commerceAllowed,minorVersion,requirementMatrix);
  3933. if(OSF.AppTelemetry)
  3934. OSF.AppTelemetry.initialize(returnedContext);
  3935. gotAppContext(returnedContext)
  3936. };
  3937. (function()
  3938. {
  3939. var checkScriptOverride=function OSF$checkScriptOverride()
  3940. {
  3941. var postScriptOverrideCheckAction=function OSF$postScriptOverrideCheckAction(customizedScriptPath)
  3942. {
  3943. if(customizedScriptPath)
  3944. OSF.OUtil.loadScript(customizedScriptPath,function()
  3945. {
  3946. OsfMsAjaxFactory.msAjaxDebug.trace("loaded customized script:"+customizedScriptPath)
  3947. })
  3948. };
  3949. var conversationID,
  3950. webAppUrl,
  3951. items;
  3952. var clientEndPoint=null;
  3953. var xdmInfoValue=OSF.OUtil.parseXdmInfo();
  3954. if(xdmInfoValue)
  3955. {
  3956. items=OSF.OUtil.getInfoItems(xdmInfoValue);
  3957. if(items && items.length >=3)
  3958. {
  3959. conversationID=items[0];
  3960. webAppUrl=items[2];
  3961. clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(conversationID,window.parent,webAppUrl)
  3962. }
  3963. }
  3964. var customizedScriptPath=null;
  3965. if(!clientEndPoint)
  3966. {
  3967. try
  3968. {
  3969. if(typeof window.external.getCustomizedScriptPath !=="undefined")
  3970. customizedScriptPath=window.external.getCustomizedScriptPath()
  3971. }
  3972. catch(ex)
  3973. {
  3974. OsfMsAjaxFactory.msAjaxDebug.trace("no script override through window.external.")
  3975. }
  3976. postScriptOverrideCheckAction(customizedScriptPath)
  3977. }
  3978. else
  3979. try
  3980. {
  3981. clientEndPoint.invoke("getCustomizedScriptPathAsync",function OSF$getCustomizedScriptPathAsyncCallback(errorCode, scriptPath)
  3982. {
  3983. postScriptOverrideCheckAction(errorCode===0 ? scriptPath : null)
  3984. },{__timeout__: 1e3})
  3985. }
  3986. catch(ex)
  3987. {
  3988. OsfMsAjaxFactory.msAjaxDebug.trace("no script override through cross frame communication.")
  3989. }
  3990. };
  3991. if(OSF._OfficeAppFactory.getLoadScriptHelper)
  3992. OSF._OfficeAppFactory.getLoadScriptHelper().waitForScripts([OSF.ConstantNames.MicrosoftAjaxId],checkScriptOverride)
  3993. })();
  3994. Microsoft.Office.WebExtension.EventType={};
  3995. OSF.EventDispatch=function OSF_EventDispatch(eventTypes)
  3996. {
  3997. this._eventHandlers={};
  3998. this._queuedEventsArgs={};
  3999. for(var entry in eventTypes)
  4000. {
  4001. var eventType=eventTypes[entry];
  4002. this._eventHandlers[eventType]=[];
  4003. this._queuedEventsArgs[eventType]=[]
  4004. }
  4005. };
  4006. OSF.EventDispatch.prototype={
  4007. getSupportedEvents: function OSF_EventDispatch$getSupportedEvents()
  4008. {
  4009. var events=[];
  4010. for(var eventName in this._eventHandlers)
  4011. events.push(eventName);
  4012. return events
  4013. },
  4014. supportsEvent: function OSF_EventDispatch$supportsEvent(event)
  4015. {
  4016. var isSupported=false;
  4017. for(var eventName in this._eventHandlers)
  4018. if(event==eventName)
  4019. {
  4020. isSupported=true;
  4021. break
  4022. }
  4023. return isSupported
  4024. },
  4025. hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler)
  4026. {
  4027. var handlers=this._eventHandlers[eventType];
  4028. if(handlers && handlers.length > 0)
  4029. for(var h in handlers)
  4030. if(handlers[h]===handler)
  4031. return true;
  4032. return false
  4033. },
  4034. addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler)
  4035. {
  4036. if(typeof handler !="function")
  4037. return false;
  4038. var handlers=this._eventHandlers[eventType];
  4039. if(handlers && !this.hasEventHandler(eventType,handler))
  4040. {
  4041. handlers.push(handler);
  4042. return true
  4043. }
  4044. else
  4045. return false
  4046. },
  4047. addEventHandlerAndFireQueuedEvent: function OSF_EventDispatch$addEventHandlerAndFireQueuedEvent(eventType, handler)
  4048. {
  4049. var handlers=this._eventHandlers[eventType];
  4050. var isFirstHandler=handlers.length==0;
  4051. var succeed=this.addEventHandler(eventType,handler);
  4052. if(isFirstHandler && succeed)
  4053. this.fireQueuedEvent(eventType);
  4054. return succeed
  4055. },
  4056. removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler)
  4057. {
  4058. var handlers=this._eventHandlers[eventType];
  4059. if(handlers && handlers.length > 0)
  4060. for(var index=0; index < handlers.length; index++)
  4061. if(handlers[index]===handler)
  4062. {
  4063. handlers.splice(index,1);
  4064. return true
  4065. }
  4066. return false
  4067. },
  4068. clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType)
  4069. {
  4070. if(typeof this._eventHandlers[eventType] !="undefined" && this._eventHandlers[eventType].length > 0)
  4071. {
  4072. this._eventHandlers[eventType]=[];
  4073. return true
  4074. }
  4075. return false
  4076. },
  4077. getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType)
  4078. {
  4079. return this._eventHandlers[eventType] !=undefined ? this._eventHandlers[eventType].length : -1
  4080. },
  4081. fireEvent: function OSF_EventDispatch$fireEvent(eventArgs)
  4082. {
  4083. if(eventArgs.type==undefined)
  4084. return false;
  4085. var eventType=eventArgs.type;
  4086. if(eventType && this._eventHandlers[eventType])
  4087. {
  4088. var eventHandlers=this._eventHandlers[eventType];
  4089. for(var handler in eventHandlers)
  4090. eventHandlers[handler](eventArgs);
  4091. return true
  4092. }
  4093. else
  4094. return false
  4095. },
  4096. fireOrQueueEvent: function OSF_EventDispatch$fireOrQueueEvent(eventArgs)
  4097. {
  4098. var eventType=eventArgs.type;
  4099. if(eventType && this._eventHandlers[eventType])
  4100. {
  4101. var eventHandlers=this._eventHandlers[eventType];
  4102. var queuedEvents=this._queuedEventsArgs[eventType];
  4103. if(eventHandlers.length==0)
  4104. queuedEvents.push(eventArgs);
  4105. else
  4106. this.fireEvent(eventArgs);
  4107. return true
  4108. }
  4109. else
  4110. return false
  4111. },
  4112. fireQueuedEvent: function OSF_EventDispatch$queueEvent(eventType)
  4113. {
  4114. if(eventType && this._eventHandlers[eventType])
  4115. {
  4116. var eventHandlers=this._eventHandlers[eventType];
  4117. var queuedEvents=this._queuedEventsArgs[eventType];
  4118. if(eventHandlers.length > 0)
  4119. {
  4120. var eventHandler=eventHandlers[0];
  4121. while(queuedEvents.length > 0)
  4122. {
  4123. var eventArgs=queuedEvents.shift();
  4124. eventHandler(eventArgs)
  4125. }
  4126. return true
  4127. }
  4128. }
  4129. return false
  4130. }
  4131. };
  4132. OSF.DDA.OMFactory=OSF.DDA.OMFactory || {};
  4133. OSF.DDA.OMFactory.manufactureEventArgs=function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties)
  4134. {
  4135. var args;
  4136. switch(eventType)
  4137. {
  4138. case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:
  4139. args=new OSF.DDA.DocumentSelectionChangedEventArgs(target);
  4140. break;
  4141. case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:
  4142. args=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties,target.document),eventProperties[OSF.DDA.PropertyDescriptors.Subset]);
  4143. break;
  4144. case Microsoft.Office.WebExtension.EventType.BindingDataChanged:
  4145. args=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties,target.document));
  4146. break;
  4147. case Microsoft.Office.WebExtension.EventType.SettingsChanged:
  4148. args=new OSF.DDA.SettingsChangedEventArgs(target);
  4149. break;
  4150. case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:
  4151. args=new OSF.DDA.ActiveViewChangedEventArgs(eventProperties);
  4152. break;
  4153. case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:
  4154. args=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties);
  4155. break;
  4156. case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:
  4157. args=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties);
  4158. break;
  4159. case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:
  4160. args=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties);
  4161. break;
  4162. case Microsoft.Office.WebExtension.EventType.DataNodeInserted:
  4163. args=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]),eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  4164. break;
  4165. case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:
  4166. args=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]),this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]),eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  4167. break;
  4168. case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:
  4169. args=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]),this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  4170. break;
  4171. case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:
  4172. args=new OSF.DDA.TaskSelectionChangedEventArgs(target);
  4173. break;
  4174. case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:
  4175. args=new OSF.DDA.ResourceSelectionChangedEventArgs(target);
  4176. break;
  4177. case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:
  4178. args=new OSF.DDA.ViewSelectionChangedEventArgs(target);
  4179. break;
  4180. case Microsoft.Office.WebExtension.EventType.DialogMessageReceived:
  4181. args=new OSF.DDA.DialogEventArgs(eventProperties);
  4182. break;
  4183. default:
  4184. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,eventType));
  4185. }
  4186. return args
  4187. };
  4188. OSF.DDA.AsyncMethodNames.addNames({
  4189. AddHandlerAsync: "addHandlerAsync",
  4190. RemoveHandlerAsync: "removeHandlerAsync"
  4191. });
  4192. OSF.DDA.AsyncMethodCalls.define({
  4193. method: OSF.DDA.AsyncMethodNames.AddHandlerAsync,
  4194. requiredArguments: [{
  4195. name: Microsoft.Office.WebExtension.Parameters.EventType,
  4196. "enum": Microsoft.Office.WebExtension.EventType,
  4197. verify: function(eventType, caller, eventDispatch)
  4198. {
  4199. return eventDispatch.supportsEvent(eventType)
  4200. }
  4201. },{
  4202. name: Microsoft.Office.WebExtension.Parameters.Handler,
  4203. types: ["function"]
  4204. }],
  4205. supportedOptions: [],
  4206. privateStateCallbacks: []
  4207. });
  4208. OSF.DDA.AsyncMethodCalls.define({
  4209. method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,
  4210. requiredArguments: [{
  4211. name: Microsoft.Office.WebExtension.Parameters.EventType,
  4212. "enum": Microsoft.Office.WebExtension.EventType,
  4213. verify: function(eventType, caller, eventDispatch)
  4214. {
  4215. return eventDispatch.supportsEvent(eventType)
  4216. }
  4217. }],
  4218. supportedOptions: [{
  4219. name: Microsoft.Office.WebExtension.Parameters.Handler,
  4220. value: {
  4221. types: ["function","object"],
  4222. defaultValue: null
  4223. }
  4224. }],
  4225. privateStateCallbacks: []
  4226. });
  4227. OSF.DDA.SafeArray.Delegate.ParameterMap.define({type: OSF.DDA.EventDispId.dispidDialogMessageReceivedEvent});
  4228. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{DialogMessageReceivedEvent: "DialogMessageReceivedEvent"});
  4229. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{
  4230. DialogMessageReceived: "dialogMessageReceived",
  4231. DialogEventReceived: "dialogEventReceived"
  4232. });
  4233. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{
  4234. MessageType: "messageType",
  4235. MessageContent: "messageContent"
  4236. });
  4237. OSF.DDA.DialogEventType={};
  4238. OSF.OUtil.augmentList(OSF.DDA.DialogEventType,{
  4239. DialogClosed: "dialogClosed",
  4240. NavigationFailed: "naviationFailed"
  4241. });
  4242. OSF.DDA.AsyncMethodNames.addNames({
  4243. DisplayDialogAsync: "displayDialogAsync",
  4244. CloseAsync: "close"
  4245. });
  4246. OSF.DDA.SyncMethodNames.addNames({
  4247. MessageParent: "messageParent",
  4248. AddMessageHandler: "addEventHandler"
  4249. });
  4250. OSF.DDA.UI.ParentUI=function OSF_DDA_ParentUI()
  4251. {
  4252. var eventDispatch=new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DialogMessageReceived,Microsoft.Office.WebExtension.EventType.DialogEventReceived]);
  4253. var openDialogName=OSF.DDA.AsyncMethodNames.DisplayDialogAsync.displayName;
  4254. var target=this;
  4255. if(!target[openDialogName])
  4256. OSF.OUtil.defineEnumerableProperty(target,openDialogName,{value: function()
  4257. {
  4258. var openDialog=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.OpenDialog];
  4259. openDialog(arguments,eventDispatch,target)
  4260. }});
  4261. OSF.OUtil.finalizeProperties(this)
  4262. };
  4263. OSF.DDA.UI.ChildUI=function OSF_DDA_ChildUI()
  4264. {
  4265. var messageParentName=OSF.DDA.SyncMethodNames.MessageParent.displayName;
  4266. var target=this;
  4267. if(!target[messageParentName])
  4268. OSF.OUtil.defineEnumerableProperty(target,messageParentName,{value: function()
  4269. {
  4270. var messageParent=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.MessageParent];
  4271. return messageParent(arguments,target)
  4272. }});
  4273. OSF.OUtil.finalizeProperties(this)
  4274. };
  4275. OSF.DialogHandler=function OSF_DialogHandler(){};
  4276. OSF.DDA.DialogEventArgs=function OSF_DDA_DialogEventArgs(message)
  4277. {
  4278. if(message[OSF.DDA.PropertyDescriptors.MessageType]==OSF.DialogMessageType.DialogMessageReceived)
  4279. OSF.OUtil.defineEnumerableProperties(this,{
  4280. type: {value: Microsoft.Office.WebExtension.EventType.DialogMessageReceived},
  4281. message: {value: message[OSF.DDA.PropertyDescriptors.MessageContent]}
  4282. });
  4283. else
  4284. OSF.OUtil.defineEnumerableProperties(this,{
  4285. type: {value: Microsoft.Office.WebExtension.EventType.DialogEventReceived},
  4286. error: {value: message[OSF.DDA.PropertyDescriptors.MessageType]}
  4287. })
  4288. };
  4289. OSF.DDA.AsyncMethodCalls.define({
  4290. method: OSF.DDA.AsyncMethodNames.DisplayDialogAsync,
  4291. requiredArguments: [{
  4292. name: Microsoft.Office.WebExtension.Parameters.Url,
  4293. types: ["string"]
  4294. }],
  4295. supportedOptions: [{
  4296. name: Microsoft.Office.WebExtension.Parameters.Width,
  4297. value: {
  4298. types: ["number"],
  4299. defaultValue: 99
  4300. }
  4301. },{
  4302. name: Microsoft.Office.WebExtension.Parameters.Height,
  4303. value: {
  4304. types: ["number"],
  4305. defaultValue: 99
  4306. }
  4307. },{
  4308. name: Microsoft.Office.WebExtension.Parameters.RequireHTTPs,
  4309. value: {
  4310. types: ["boolean"],
  4311. defaultValue: true
  4312. }
  4313. },{
  4314. name: Microsoft.Office.WebExtension.Parameters.XFrameDenySafe,
  4315. value: {
  4316. types: ["boolean"],
  4317. defaultValue: true
  4318. }
  4319. }],
  4320. privateStateCallbacks: [],
  4321. onSucceeded: function(args, caller, callArgs)
  4322. {
  4323. var targetId=args[Microsoft.Office.WebExtension.Parameters.Id];
  4324. var eventDispatch=args[Microsoft.Office.WebExtension.Parameters.Data];
  4325. var dialog=new OSF.DialogHandler;
  4326. var closeDialog=OSF.DDA.AsyncMethodNames.CloseAsync.displayName;
  4327. OSF.OUtil.defineEnumerableProperty(dialog,closeDialog,{value: function()
  4328. {
  4329. var closeDialogfunction=OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.CloseDialog];
  4330. closeDialogfunction(arguments,targetId,eventDispatch,dialog)
  4331. }});
  4332. var addHandler=OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;
  4333. OSF.OUtil.defineEnumerableProperty(dialog,addHandler,{value: function()
  4334. {
  4335. var syncMethodCall=OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.AddMessageHandler.id];
  4336. var callArgs=syncMethodCall.verifyAndExtractCall(arguments,dialog,eventDispatch);
  4337. var eventType=callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  4338. var handler=callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  4339. return eventDispatch.addEventHandlerAndFireQueuedEvent(eventType,handler)
  4340. }});
  4341. return dialog
  4342. },
  4343. checkCallArgs: function(callArgs, caller, stateInfo)
  4344. {
  4345. if(callArgs[Microsoft.Office.WebExtension.Parameters.Width] <=0)
  4346. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=1;
  4347. if(callArgs[Microsoft.Office.WebExtension.Parameters.Width] > 100)
  4348. callArgs[Microsoft.Office.WebExtension.Parameters.Width]=99;
  4349. if(callArgs[Microsoft.Office.WebExtension.Parameters.Height] <=0)
  4350. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=1;
  4351. if(callArgs[Microsoft.Office.WebExtension.Parameters.Height] > 100)
  4352. callArgs[Microsoft.Office.WebExtension.Parameters.Height]=99;
  4353. return callArgs
  4354. }
  4355. });
  4356. OSF.DDA.AsyncMethodCalls.define({
  4357. method: OSF.DDA.AsyncMethodNames.CloseAsync,
  4358. requiredArguments: [],
  4359. supportedOptions: [],
  4360. privateStateCallbacks: []
  4361. });
  4362. OSF.DDA.SyncMethodCalls.define({
  4363. method: OSF.DDA.SyncMethodNames.MessageParent,
  4364. requiredArguments: [{
  4365. name: Microsoft.Office.WebExtension.Parameters.MessageToParent,
  4366. types: ["string","number","boolean"]
  4367. }],
  4368. supportedOptions: []
  4369. });
  4370. OSF.DDA.SyncMethodCalls.define({
  4371. method: OSF.DDA.SyncMethodNames.AddMessageHandler,
  4372. requiredArguments: [{
  4373. name: Microsoft.Office.WebExtension.Parameters.EventType,
  4374. "enum": Microsoft.Office.WebExtension.EventType,
  4375. verify: function(eventType, caller, eventDispatch)
  4376. {
  4377. return eventDispatch.supportsEvent(eventType)
  4378. }
  4379. },{
  4380. name: Microsoft.Office.WebExtension.Parameters.Handler,
  4381. types: ["function"]
  4382. }],
  4383. supportedOptions: []
  4384. });
  4385. OSF.DDA.SafeArray.Delegate.messageParent=function OSF_DDA_SafeArray_Delegate$MessageParent(args)
  4386. {
  4387. try
  4388. {
  4389. if(args.onCalling)
  4390. args.onCalling();
  4391. var startTime=(new Date).getTime();
  4392. var result=OSF.ClientHostController.messageParent(args.hostCallArgs);
  4393. if(args.onReceiving)
  4394. args.onReceiving();
  4395. if(OSF.AppTelemetry)
  4396. OSF.AppTelemetry.onMethodDone(args.dispId,args.hostCallArgs,Math.abs((new Date).getTime() - startTime),result);
  4397. return result
  4398. }
  4399. catch(ex)
  4400. {
  4401. return OSF.DDA.SafeArray.Delegate._onExceptionSyncMethod(ex)
  4402. }
  4403. };
  4404. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4405. type: OSF.DDA.EventDispId.dispidDialogMessageReceivedEvent,
  4406. fromHost: [{
  4407. name: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,
  4408. value: OSF.DDA.SafeArray.Delegate.ParameterMap.self
  4409. }],
  4410. isComplexType: true
  4411. });
  4412. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  4413. type: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,
  4414. fromHost: [{
  4415. name: OSF.DDA.PropertyDescriptors.MessageType,
  4416. value: 0
  4417. },{
  4418. name: OSF.DDA.PropertyDescriptors.MessageContent,
  4419. value: 1
  4420. }],
  4421. isComplexType: true
  4422. });
  4423. var OSFLog;
  4424. (function(OSFLog)
  4425. {
  4426. var BaseUsageData=function()
  4427. {
  4428. function BaseUsageData(table)
  4429. {
  4430. this._table=table;
  4431. this._fields={}
  4432. }
  4433. Object.defineProperty(BaseUsageData.prototype,"Fields",{
  4434. get: function()
  4435. {
  4436. return this._fields
  4437. },
  4438. enumerable: true,
  4439. configurable: true
  4440. });
  4441. Object.defineProperty(BaseUsageData.prototype,"Table",{
  4442. get: function()
  4443. {
  4444. return this._table
  4445. },
  4446. enumerable: true,
  4447. configurable: true
  4448. });
  4449. BaseUsageData.prototype.SerializeFields=function(){};
  4450. BaseUsageData.prototype.SetSerializedField=function(key, value)
  4451. {
  4452. if(typeof value !=="undefined" && value !==null)
  4453. this._serializedFields[key]=value.toString()
  4454. };
  4455. BaseUsageData.prototype.SerializeRow=function()
  4456. {
  4457. this._serializedFields={};
  4458. this.SetSerializedField("Table",this._table);
  4459. this.SerializeFields();
  4460. return JSON.stringify(this._serializedFields)
  4461. };
  4462. return BaseUsageData
  4463. }();
  4464. OSFLog.BaseUsageData=BaseUsageData;
  4465. var AppActivatedUsageData=function(_super)
  4466. {
  4467. __extends(AppActivatedUsageData,_super);
  4468. function AppActivatedUsageData()
  4469. {
  4470. _super.call(this,"AppActivated")
  4471. }
  4472. Object.defineProperty(AppActivatedUsageData.prototype,"CorrelationId",{
  4473. get: function()
  4474. {
  4475. return this.Fields["CorrelationId"]
  4476. },
  4477. set: function(value)
  4478. {
  4479. this.Fields["CorrelationId"]=value
  4480. },
  4481. enumerable: true,
  4482. configurable: true
  4483. });
  4484. Object.defineProperty(AppActivatedUsageData.prototype,"SessionId",{
  4485. get: function()
  4486. {
  4487. return this.Fields["SessionId"]
  4488. },
  4489. set: function(value)
  4490. {
  4491. this.Fields["SessionId"]=value
  4492. },
  4493. enumerable: true,
  4494. configurable: true
  4495. });
  4496. Object.defineProperty(AppActivatedUsageData.prototype,"AppId",{
  4497. get: function()
  4498. {
  4499. return this.Fields["AppId"]
  4500. },
  4501. set: function(value)
  4502. {
  4503. this.Fields["AppId"]=value
  4504. },
  4505. enumerable: true,
  4506. configurable: true
  4507. });
  4508. Object.defineProperty(AppActivatedUsageData.prototype,"AppInstanceId",{
  4509. get: function()
  4510. {
  4511. return this.Fields["AppInstanceId"]
  4512. },
  4513. set: function(value)
  4514. {
  4515. this.Fields["AppInstanceId"]=value
  4516. },
  4517. enumerable: true,
  4518. configurable: true
  4519. });
  4520. Object.defineProperty(AppActivatedUsageData.prototype,"AppURL",{
  4521. get: function()
  4522. {
  4523. return this.Fields["AppURL"]
  4524. },
  4525. set: function(value)
  4526. {
  4527. this.Fields["AppURL"]=value
  4528. },
  4529. enumerable: true,
  4530. configurable: true
  4531. });
  4532. Object.defineProperty(AppActivatedUsageData.prototype,"AssetId",{
  4533. get: function()
  4534. {
  4535. return this.Fields["AssetId"]
  4536. },
  4537. set: function(value)
  4538. {
  4539. this.Fields["AssetId"]=value
  4540. },
  4541. enumerable: true,
  4542. configurable: true
  4543. });
  4544. Object.defineProperty(AppActivatedUsageData.prototype,"Browser",{
  4545. get: function()
  4546. {
  4547. return this.Fields["Browser"]
  4548. },
  4549. set: function(value)
  4550. {
  4551. this.Fields["Browser"]=value
  4552. },
  4553. enumerable: true,
  4554. configurable: true
  4555. });
  4556. Object.defineProperty(AppActivatedUsageData.prototype,"UserId",{
  4557. get: function()
  4558. {
  4559. return this.Fields["UserId"]
  4560. },
  4561. set: function(value)
  4562. {
  4563. this.Fields["UserId"]=value
  4564. },
  4565. enumerable: true,
  4566. configurable: true
  4567. });
  4568. Object.defineProperty(AppActivatedUsageData.prototype,"Host",{
  4569. get: function()
  4570. {
  4571. return this.Fields["Host"]
  4572. },
  4573. set: function(value)
  4574. {
  4575. this.Fields["Host"]=value
  4576. },
  4577. enumerable: true,
  4578. configurable: true
  4579. });
  4580. Object.defineProperty(AppActivatedUsageData.prototype,"HostVersion",{
  4581. get: function()
  4582. {
  4583. return this.Fields["HostVersion"]
  4584. },
  4585. set: function(value)
  4586. {
  4587. this.Fields["HostVersion"]=value
  4588. },
  4589. enumerable: true,
  4590. configurable: true
  4591. });
  4592. Object.defineProperty(AppActivatedUsageData.prototype,"ClientId",{
  4593. get: function()
  4594. {
  4595. return this.Fields["ClientId"]
  4596. },
  4597. set: function(value)
  4598. {
  4599. this.Fields["ClientId"]=value
  4600. },
  4601. enumerable: true,
  4602. configurable: true
  4603. });
  4604. Object.defineProperty(AppActivatedUsageData.prototype,"AppSizeWidth",{
  4605. get: function()
  4606. {
  4607. return this.Fields["AppSizeWidth"]
  4608. },
  4609. set: function(value)
  4610. {
  4611. this.Fields["AppSizeWidth"]=value
  4612. },
  4613. enumerable: true,
  4614. configurable: true
  4615. });
  4616. Object.defineProperty(AppActivatedUsageData.prototype,"AppSizeHeight",{
  4617. get: function()
  4618. {
  4619. return this.Fields["AppSizeHeight"]
  4620. },
  4621. set: function(value)
  4622. {
  4623. this.Fields["AppSizeHeight"]=value
  4624. },
  4625. enumerable: true,
  4626. configurable: true
  4627. });
  4628. AppActivatedUsageData.prototype.SerializeFields=function()
  4629. {
  4630. this.SetSerializedField("CorrelationId",this.CorrelationId);
  4631. this.SetSerializedField("SessionId",this.SessionId);
  4632. this.SetSerializedField("AppId",this.AppId);
  4633. this.SetSerializedField("AppInstanceId",this.AppInstanceId);
  4634. this.SetSerializedField("AppURL",this.AppURL);
  4635. this.SetSerializedField("AssetId",this.AssetId);
  4636. this.SetSerializedField("Browser",this.Browser);
  4637. this.SetSerializedField("UserId",this.UserId);
  4638. this.SetSerializedField("Host",this.Host);
  4639. this.SetSerializedField("HostVersion",this.HostVersion);
  4640. this.SetSerializedField("ClientId",this.ClientId);
  4641. this.SetSerializedField("AppSizeWidth",this.AppSizeWidth);
  4642. this.SetSerializedField("AppSizeHeight",this.AppSizeHeight)
  4643. };
  4644. return AppActivatedUsageData
  4645. }(BaseUsageData);
  4646. OSFLog.AppActivatedUsageData=AppActivatedUsageData;
  4647. var ScriptLoadUsageData=function(_super)
  4648. {
  4649. __extends(ScriptLoadUsageData,_super);
  4650. function ScriptLoadUsageData()
  4651. {
  4652. _super.call(this,"ScriptLoad")
  4653. }
  4654. Object.defineProperty(ScriptLoadUsageData.prototype,"CorrelationId",{
  4655. get: function()
  4656. {
  4657. return this.Fields["CorrelationId"]
  4658. },
  4659. set: function(value)
  4660. {
  4661. this.Fields["CorrelationId"]=value
  4662. },
  4663. enumerable: true,
  4664. configurable: true
  4665. });
  4666. Object.defineProperty(ScriptLoadUsageData.prototype,"SessionId",{
  4667. get: function()
  4668. {
  4669. return this.Fields["SessionId"]
  4670. },
  4671. set: function(value)
  4672. {
  4673. this.Fields["SessionId"]=value
  4674. },
  4675. enumerable: true,
  4676. configurable: true
  4677. });
  4678. Object.defineProperty(ScriptLoadUsageData.prototype,"ScriptId",{
  4679. get: function()
  4680. {
  4681. return this.Fields["ScriptId"]
  4682. },
  4683. set: function(value)
  4684. {
  4685. this.Fields["ScriptId"]=value
  4686. },
  4687. enumerable: true,
  4688. configurable: true
  4689. });
  4690. Object.defineProperty(ScriptLoadUsageData.prototype,"StartTime",{
  4691. get: function()
  4692. {
  4693. return this.Fields["StartTime"]
  4694. },
  4695. set: function(value)
  4696. {
  4697. this.Fields["StartTime"]=value
  4698. },
  4699. enumerable: true,
  4700. configurable: true
  4701. });
  4702. Object.defineProperty(ScriptLoadUsageData.prototype,"ResponseTime",{
  4703. get: function()
  4704. {
  4705. return this.Fields["ResponseTime"]
  4706. },
  4707. set: function(value)
  4708. {
  4709. this.Fields["ResponseTime"]=value
  4710. },
  4711. enumerable: true,
  4712. configurable: true
  4713. });
  4714. ScriptLoadUsageData.prototype.SerializeFields=function()
  4715. {
  4716. this.SetSerializedField("CorrelationId",this.CorrelationId);
  4717. this.SetSerializedField("SessionId",this.SessionId);
  4718. this.SetSerializedField("ScriptId",this.ScriptId);
  4719. this.SetSerializedField("StartTime",this.StartTime);
  4720. this.SetSerializedField("ResponseTime",this.ResponseTime)
  4721. };
  4722. return ScriptLoadUsageData
  4723. }(BaseUsageData);
  4724. OSFLog.ScriptLoadUsageData=ScriptLoadUsageData;
  4725. var AppClosedUsageData=function(_super)
  4726. {
  4727. __extends(AppClosedUsageData,_super);
  4728. function AppClosedUsageData()
  4729. {
  4730. _super.call(this,"AppClosed")
  4731. }
  4732. Object.defineProperty(AppClosedUsageData.prototype,"CorrelationId",{
  4733. get: function()
  4734. {
  4735. return this.Fields["CorrelationId"]
  4736. },
  4737. set: function(value)
  4738. {
  4739. this.Fields["CorrelationId"]=value
  4740. },
  4741. enumerable: true,
  4742. configurable: true
  4743. });
  4744. Object.defineProperty(AppClosedUsageData.prototype,"SessionId",{
  4745. get: function()
  4746. {
  4747. return this.Fields["SessionId"]
  4748. },
  4749. set: function(value)
  4750. {
  4751. this.Fields["SessionId"]=value
  4752. },
  4753. enumerable: true,
  4754. configurable: true
  4755. });
  4756. Object.defineProperty(AppClosedUsageData.prototype,"FocusTime",{
  4757. get: function()
  4758. {
  4759. return this.Fields["FocusTime"]
  4760. },
  4761. set: function(value)
  4762. {
  4763. this.Fields["FocusTime"]=value
  4764. },
  4765. enumerable: true,
  4766. configurable: true
  4767. });
  4768. Object.defineProperty(AppClosedUsageData.prototype,"AppSizeFinalWidth",{
  4769. get: function()
  4770. {
  4771. return this.Fields["AppSizeFinalWidth"]
  4772. },
  4773. set: function(value)
  4774. {
  4775. this.Fields["AppSizeFinalWidth"]=value
  4776. },
  4777. enumerable: true,
  4778. configurable: true
  4779. });
  4780. Object.defineProperty(AppClosedUsageData.prototype,"AppSizeFinalHeight",{
  4781. get: function()
  4782. {
  4783. return this.Fields["AppSizeFinalHeight"]
  4784. },
  4785. set: function(value)
  4786. {
  4787. this.Fields["AppSizeFinalHeight"]=value
  4788. },
  4789. enumerable: true,
  4790. configurable: true
  4791. });
  4792. Object.defineProperty(AppClosedUsageData.prototype,"OpenTime",{
  4793. get: function()
  4794. {
  4795. return this.Fields["OpenTime"]
  4796. },
  4797. set: function(value)
  4798. {
  4799. this.Fields["OpenTime"]=value
  4800. },
  4801. enumerable: true,
  4802. configurable: true
  4803. });
  4804. Object.defineProperty(AppClosedUsageData.prototype,"CloseMethod",{
  4805. get: function()
  4806. {
  4807. return this.Fields["CloseMethod"]
  4808. },
  4809. set: function(value)
  4810. {
  4811. this.Fields["CloseMethod"]=value
  4812. },
  4813. enumerable: true,
  4814. configurable: true
  4815. });
  4816. AppClosedUsageData.prototype.SerializeFields=function()
  4817. {
  4818. this.SetSerializedField("CorrelationId",this.CorrelationId);
  4819. this.SetSerializedField("SessionId",this.SessionId);
  4820. this.SetSerializedField("FocusTime",this.FocusTime);
  4821. this.SetSerializedField("AppSizeFinalWidth",this.AppSizeFinalWidth);
  4822. this.SetSerializedField("AppSizeFinalHeight",this.AppSizeFinalHeight);
  4823. this.SetSerializedField("OpenTime",this.OpenTime);
  4824. this.SetSerializedField("CloseMethod",this.CloseMethod)
  4825. };
  4826. return AppClosedUsageData
  4827. }(BaseUsageData);
  4828. OSFLog.AppClosedUsageData=AppClosedUsageData;
  4829. var APIUsageUsageData=function(_super)
  4830. {
  4831. __extends(APIUsageUsageData,_super);
  4832. function APIUsageUsageData()
  4833. {
  4834. _super.call(this,"APIUsage")
  4835. }
  4836. Object.defineProperty(APIUsageUsageData.prototype,"CorrelationId",{
  4837. get: function()
  4838. {
  4839. return this.Fields["CorrelationId"]
  4840. },
  4841. set: function(value)
  4842. {
  4843. this.Fields["CorrelationId"]=value
  4844. },
  4845. enumerable: true,
  4846. configurable: true
  4847. });
  4848. Object.defineProperty(APIUsageUsageData.prototype,"SessionId",{
  4849. get: function()
  4850. {
  4851. return this.Fields["SessionId"]
  4852. },
  4853. set: function(value)
  4854. {
  4855. this.Fields["SessionId"]=value
  4856. },
  4857. enumerable: true,
  4858. configurable: true
  4859. });
  4860. Object.defineProperty(APIUsageUsageData.prototype,"APIType",{
  4861. get: function()
  4862. {
  4863. return this.Fields["APIType"]
  4864. },
  4865. set: function(value)
  4866. {
  4867. this.Fields["APIType"]=value
  4868. },
  4869. enumerable: true,
  4870. configurable: true
  4871. });
  4872. Object.defineProperty(APIUsageUsageData.prototype,"APIID",{
  4873. get: function()
  4874. {
  4875. return this.Fields["APIID"]
  4876. },
  4877. set: function(value)
  4878. {
  4879. this.Fields["APIID"]=value
  4880. },
  4881. enumerable: true,
  4882. configurable: true
  4883. });
  4884. Object.defineProperty(APIUsageUsageData.prototype,"Parameters",{
  4885. get: function()
  4886. {
  4887. return this.Fields["Parameters"]
  4888. },
  4889. set: function(value)
  4890. {
  4891. this.Fields["Parameters"]=value
  4892. },
  4893. enumerable: true,
  4894. configurable: true
  4895. });
  4896. Object.defineProperty(APIUsageUsageData.prototype,"ResponseTime",{
  4897. get: function()
  4898. {
  4899. return this.Fields["ResponseTime"]
  4900. },
  4901. set: function(value)
  4902. {
  4903. this.Fields["ResponseTime"]=value
  4904. },
  4905. enumerable: true,
  4906. configurable: true
  4907. });
  4908. Object.defineProperty(APIUsageUsageData.prototype,"ErrorType",{
  4909. get: function()
  4910. {
  4911. return this.Fields["ErrorType"]
  4912. },
  4913. set: function(value)
  4914. {
  4915. this.Fields["ErrorType"]=value
  4916. },
  4917. enumerable: true,
  4918. configurable: true
  4919. });
  4920. APIUsageUsageData.prototype.SerializeFields=function()
  4921. {
  4922. this.SetSerializedField("CorrelationId",this.CorrelationId);
  4923. this.SetSerializedField("SessionId",this.SessionId);
  4924. this.SetSerializedField("APIType",this.APIType);
  4925. this.SetSerializedField("APIID",this.APIID);
  4926. this.SetSerializedField("Parameters",this.Parameters);
  4927. this.SetSerializedField("ResponseTime",this.ResponseTime);
  4928. this.SetSerializedField("ErrorType",this.ErrorType)
  4929. };
  4930. return APIUsageUsageData
  4931. }(BaseUsageData);
  4932. OSFLog.APIUsageUsageData=APIUsageUsageData;
  4933. var AppInitializationUsageData=function(_super)
  4934. {
  4935. __extends(AppInitializationUsageData,_super);
  4936. function AppInitializationUsageData()
  4937. {
  4938. _super.call(this,"AppInitialization")
  4939. }
  4940. Object.defineProperty(AppInitializationUsageData.prototype,"CorrelationId",{
  4941. get: function()
  4942. {
  4943. return this.Fields["CorrelationId"]
  4944. },
  4945. set: function(value)
  4946. {
  4947. this.Fields["CorrelationId"]=value
  4948. },
  4949. enumerable: true,
  4950. configurable: true
  4951. });
  4952. Object.defineProperty(AppInitializationUsageData.prototype,"SessionId",{
  4953. get: function()
  4954. {
  4955. return this.Fields["SessionId"]
  4956. },
  4957. set: function(value)
  4958. {
  4959. this.Fields["SessionId"]=value
  4960. },
  4961. enumerable: true,
  4962. configurable: true
  4963. });
  4964. Object.defineProperty(AppInitializationUsageData.prototype,"SuccessCode",{
  4965. get: function()
  4966. {
  4967. return this.Fields["SuccessCode"]
  4968. },
  4969. set: function(value)
  4970. {
  4971. this.Fields["SuccessCode"]=value
  4972. },
  4973. enumerable: true,
  4974. configurable: true
  4975. });
  4976. Object.defineProperty(AppInitializationUsageData.prototype,"Message",{
  4977. get: function()
  4978. {
  4979. return this.Fields["Message"]
  4980. },
  4981. set: function(value)
  4982. {
  4983. this.Fields["Message"]=value
  4984. },
  4985. enumerable: true,
  4986. configurable: true
  4987. });
  4988. AppInitializationUsageData.prototype.SerializeFields=function()
  4989. {
  4990. this.SetSerializedField("CorrelationId",this.CorrelationId);
  4991. this.SetSerializedField("SessionId",this.SessionId);
  4992. this.SetSerializedField("SuccessCode",this.SuccessCode);
  4993. this.SetSerializedField("Message",this.Message)
  4994. };
  4995. return AppInitializationUsageData
  4996. }(BaseUsageData);
  4997. OSFLog.AppInitializationUsageData=AppInitializationUsageData
  4998. })(OSFLog || (OSFLog={}));
  4999. var Logger;
  5000. (function(Logger)
  5001. {
  5002. "use strict";
  5003. (function(TraceLevel)
  5004. {
  5005. TraceLevel[TraceLevel["info"]=0]="info";
  5006. TraceLevel[TraceLevel["warning"]=1]="warning";
  5007. TraceLevel[TraceLevel["error"]=2]="error"
  5008. })(Logger.TraceLevel || (Logger.TraceLevel={}));
  5009. var TraceLevel=Logger.TraceLevel;
  5010. (function(SendFlag)
  5011. {
  5012. SendFlag[SendFlag["none"]=0]="none";
  5013. SendFlag[SendFlag["flush"]=1]="flush"
  5014. })(Logger.SendFlag || (Logger.SendFlag={}));
  5015. var SendFlag=Logger.SendFlag;
  5016. function allowUploadingData()
  5017. {
  5018. if(OSF.Logger && OSF.Logger.ulsEndpoint)
  5019. OSF.Logger.ulsEndpoint.loadProxyFrame()
  5020. }
  5021. Logger.allowUploadingData=allowUploadingData;
  5022. function sendLog(traceLevel, message, flag)
  5023. {
  5024. if(OSF.Logger && OSF.Logger.ulsEndpoint)
  5025. {
  5026. var jsonObj={
  5027. traceLevel: traceLevel,
  5028. message: message,
  5029. flag: flag,
  5030. internalLog: true
  5031. };
  5032. var logs=JSON.stringify(jsonObj);
  5033. OSF.Logger.ulsEndpoint.writeLog(logs)
  5034. }
  5035. }
  5036. Logger.sendLog=sendLog;
  5037. function creatULSEndpoint()
  5038. {
  5039. try
  5040. {
  5041. return new ULSEndpointProxy
  5042. }
  5043. catch(e)
  5044. {
  5045. return null
  5046. }
  5047. }
  5048. var ULSEndpointProxy=function()
  5049. {
  5050. function ULSEndpointProxy()
  5051. {
  5052. var _this=this;
  5053. this.proxyFrame=null;
  5054. this.telemetryEndPoint="https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html";
  5055. this.buffer=[];
  5056. this.proxyFrameReady=false;
  5057. OSF.OUtil.addEventListener(window,"message",function(e)
  5058. {
  5059. return _this.tellProxyFrameReady(e)
  5060. });
  5061. setTimeout(function()
  5062. {
  5063. _this.loadProxyFrame()
  5064. },3e3)
  5065. }
  5066. ULSEndpointProxy.prototype.writeLog=function(log)
  5067. {
  5068. if(this.proxyFrameReady===true)
  5069. this.proxyFrame.contentWindow.postMessage(log,"*");
  5070. else if(this.buffer.length < 128)
  5071. this.buffer.push(log)
  5072. };
  5073. ULSEndpointProxy.prototype.loadProxyFrame=function()
  5074. {
  5075. if(this.proxyFrame==null)
  5076. {
  5077. this.proxyFrame=document.createElement("iframe");
  5078. this.proxyFrame.setAttribute("style","display:none");
  5079. this.proxyFrame.setAttribute("src",this.telemetryEndPoint);
  5080. document.head.appendChild(this.proxyFrame)
  5081. }
  5082. };
  5083. ULSEndpointProxy.prototype.tellProxyFrameReady=function(e)
  5084. {
  5085. var _this=this;
  5086. if(e.data==="ProxyFrameReadyToLog")
  5087. {
  5088. this.proxyFrameReady=true;
  5089. for(var i=0; i < this.buffer.length; i++)
  5090. this.writeLog(this.buffer[i]);
  5091. this.buffer.length=0;
  5092. OSF.OUtil.removeEventListener(window,"message",function(e)
  5093. {
  5094. return _this.tellProxyFrameReady(e)
  5095. })
  5096. }
  5097. else if(e.data==="ProxyFrameReadyToInit")
  5098. {
  5099. var initJson={
  5100. appName: "Office APPs",
  5101. sessionId: OSF.OUtil.Guid.generateNewGuid()
  5102. };
  5103. var initStr=JSON.stringify(initJson);
  5104. this.proxyFrame.contentWindow.postMessage(initStr,"*")
  5105. }
  5106. };
  5107. return ULSEndpointProxy
  5108. }();
  5109. if(!OSF.Logger)
  5110. OSF.Logger=Logger;
  5111. Logger.ulsEndpoint=creatULSEndpoint()
  5112. })(Logger || (Logger={}));
  5113. var OSFAppTelemetry;
  5114. (function(OSFAppTelemetry)
  5115. {
  5116. "use strict";
  5117. var appInfo;
  5118. var sessionId=OSF.OUtil.Guid.generateNewGuid();
  5119. var osfControlAppCorrelationId="";
  5120. var AppInfo=function()
  5121. {
  5122. function AppInfo(){}
  5123. return AppInfo
  5124. }();
  5125. var Event=function()
  5126. {
  5127. function Event(name, handler)
  5128. {
  5129. this.name=name;
  5130. this.handler=handler
  5131. }
  5132. return Event
  5133. }();
  5134. var AppStorage=function()
  5135. {
  5136. function AppStorage()
  5137. {
  5138. this.clientIDKey="Office API client";
  5139. this.logIdSetKey="Office App Log Id Set"
  5140. }
  5141. AppStorage.prototype.getClientId=function()
  5142. {
  5143. var clientId=this.getValue(this.clientIDKey);
  5144. if(!clientId || clientId.length <=0 || clientId.length > 40)
  5145. {
  5146. clientId=OSF.OUtil.Guid.generateNewGuid();
  5147. this.setValue(this.clientIDKey,clientId)
  5148. }
  5149. return clientId
  5150. };
  5151. AppStorage.prototype.saveLog=function(logId, log)
  5152. {
  5153. var logIdSet=this.getValue(this.logIdSetKey);
  5154. logIdSet=(logIdSet && logIdSet.length > 0 ? logIdSet+";" : "")+logId;
  5155. this.setValue(this.logIdSetKey,logIdSet);
  5156. this.setValue(logId,log)
  5157. };
  5158. AppStorage.prototype.enumerateLog=function(callback, clean)
  5159. {
  5160. var logIdSet=this.getValue(this.logIdSetKey);
  5161. if(logIdSet)
  5162. {
  5163. var ids=logIdSet.split(";");
  5164. for(var id in ids)
  5165. {
  5166. var logId=ids[id];
  5167. var log=this.getValue(logId);
  5168. if(log)
  5169. {
  5170. if(callback)
  5171. callback(logId,log);
  5172. if(clean)
  5173. this.remove(logId)
  5174. }
  5175. }
  5176. if(clean)
  5177. this.remove(this.logIdSetKey)
  5178. }
  5179. };
  5180. AppStorage.prototype.getValue=function(key)
  5181. {
  5182. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  5183. var value="";
  5184. if(osfLocalStorage)
  5185. value=osfLocalStorage.getItem(key);
  5186. return value
  5187. };
  5188. AppStorage.prototype.setValue=function(key, value)
  5189. {
  5190. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  5191. if(osfLocalStorage)
  5192. osfLocalStorage.setItem(key,value)
  5193. };
  5194. AppStorage.prototype.remove=function(key)
  5195. {
  5196. var osfLocalStorage=OSF.OUtil.getLocalStorage();
  5197. if(osfLocalStorage)
  5198. try
  5199. {
  5200. osfLocalStorage.removeItem(key)
  5201. }
  5202. catch(ex){}
  5203. };
  5204. return AppStorage
  5205. }();
  5206. var AppLogger=function()
  5207. {
  5208. function AppLogger(){}
  5209. AppLogger.prototype.LogData=function(data)
  5210. {
  5211. if(!OSF.Logger)
  5212. return;
  5213. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,data.SerializeRow(),OSF.Logger.SendFlag.none)
  5214. };
  5215. AppLogger.prototype.LogRawData=function(log)
  5216. {
  5217. if(!OSF.Logger)
  5218. return;
  5219. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info,log,OSF.Logger.SendFlag.none)
  5220. };
  5221. return AppLogger
  5222. }();
  5223. function initialize(context)
  5224. {
  5225. if(!OSF.Logger)
  5226. return;
  5227. if(appInfo)
  5228. return;
  5229. appInfo=new AppInfo;
  5230. appInfo.hostVersion=context.get_appVersion();
  5231. appInfo.appId=context.get_id();
  5232. appInfo.host=context.get_appName();
  5233. appInfo.browser=window.navigator.userAgent;
  5234. appInfo.correlationId=context.get_correlationId();
  5235. appInfo.clientId=(new AppStorage).getClientId();
  5236. appInfo.appInstanceId=context.get_appInstanceId();
  5237. if(appInfo.appInstanceId)
  5238. appInfo.appInstanceId=appInfo.appInstanceId.replace(/[{}]/g,"").toLowerCase();
  5239. var index=location.href.indexOf("?");
  5240. appInfo.appURL=index==-1 ? location.href : location.href.substring(0,index);
  5241. (function getUserIdAndAssetIdFromToken(token, appInfo)
  5242. {
  5243. var xmlContent;
  5244. var parser;
  5245. var xmlDoc;
  5246. appInfo.assetId="";
  5247. appInfo.userId="";
  5248. try
  5249. {
  5250. xmlContent=decodeURIComponent(token);
  5251. parser=new DOMParser;
  5252. xmlDoc=parser.parseFromString(xmlContent,"text/xml");
  5253. appInfo.userId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue;
  5254. appInfo.assetId=xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue
  5255. }
  5256. catch(e){}
  5257. finally
  5258. {
  5259. xmlContent=null;
  5260. xmlDoc=null;
  5261. parser=null
  5262. }
  5263. })(context.get_eToken(),appInfo);
  5264. (function handleLifecycle()
  5265. {
  5266. var startTime=new Date;
  5267. var lastFocus=null;
  5268. var focusTime=0;
  5269. var finished=false;
  5270. var adjustFocusTime=function()
  5271. {
  5272. if(document.hasFocus())
  5273. {
  5274. if(lastFocus==null)
  5275. lastFocus=new Date
  5276. }
  5277. else if(lastFocus)
  5278. {
  5279. focusTime+=Math.abs((new Date).getTime() - lastFocus.getTime());
  5280. lastFocus=null
  5281. }
  5282. };
  5283. var eventList=[];
  5284. eventList.push(new Event("focus",adjustFocusTime));
  5285. eventList.push(new Event("blur",adjustFocusTime));
  5286. eventList.push(new Event("focusout",adjustFocusTime));
  5287. eventList.push(new Event("focusin",adjustFocusTime));
  5288. var exitFunction=function()
  5289. {
  5290. for(var i=0; i < eventList.length; i++)
  5291. OSF.OUtil.removeEventListener(window,eventList[i].name,eventList[i].handler);
  5292. eventList.length=0;
  5293. if(!finished)
  5294. {
  5295. if(document.hasFocus() && lastFocus)
  5296. {
  5297. focusTime+=Math.abs((new Date).getTime() - lastFocus.getTime());
  5298. lastFocus=null
  5299. }
  5300. OSFAppTelemetry.onAppClosed(Math.abs((new Date).getTime() - startTime.getTime()),focusTime);
  5301. finished=true
  5302. }
  5303. };
  5304. eventList.push(new Event("beforeunload",exitFunction));
  5305. eventList.push(new Event("unload",exitFunction));
  5306. for(var i=0; i < eventList.length; i++)
  5307. OSF.OUtil.addEventListener(window,eventList[i].name,eventList[i].handler);
  5308. adjustFocusTime()
  5309. })();
  5310. OSFAppTelemetry.onAppActivated()
  5311. }
  5312. OSFAppTelemetry.initialize=initialize;
  5313. function onAppActivated()
  5314. {
  5315. if(!appInfo)
  5316. return;
  5317. (new AppStorage).enumerateLog(function(id, log)
  5318. {
  5319. return(new AppLogger).LogRawData(log)
  5320. },true);
  5321. var data=new OSFLog.AppActivatedUsageData;
  5322. data.SessionId=sessionId;
  5323. data.AppId=appInfo.appId;
  5324. data.AssetId=appInfo.assetId;
  5325. data.AppURL=appInfo.appURL;
  5326. data.UserId=appInfo.userId;
  5327. data.ClientId=appInfo.clientId;
  5328. data.Browser=appInfo.browser;
  5329. data.Host=appInfo.host;
  5330. data.HostVersion=appInfo.hostVersion;
  5331. data.CorrelationId=appInfo.correlationId;
  5332. data.AppSizeWidth=window.innerWidth;
  5333. data.AppSizeHeight=window.innerHeight;
  5334. data.AppInstanceId=appInfo.appInstanceId;
  5335. (new AppLogger).LogData(data);
  5336. setTimeout(function()
  5337. {
  5338. if(!OSF.Logger)
  5339. return;
  5340. OSF.Logger.allowUploadingData()
  5341. },100)
  5342. }
  5343. OSFAppTelemetry.onAppActivated=onAppActivated;
  5344. function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId)
  5345. {
  5346. var data=new OSFLog.ScriptLoadUsageData;
  5347. data.CorrelationId=appCorrelationId;
  5348. data.SessionId=sessionId;
  5349. data.ScriptId=scriptId;
  5350. data.StartTime=msStartTime;
  5351. data.ResponseTime=msResponseTime;
  5352. (new AppLogger).LogData(data)
  5353. }
  5354. OSFAppTelemetry.onScriptDone=onScriptDone;
  5355. function onCallDone(apiType, id, parameters, msResponseTime, errorType)
  5356. {
  5357. if(!appInfo)
  5358. return;
  5359. var data=new OSFLog.APIUsageUsageData;
  5360. data.CorrelationId=osfControlAppCorrelationId;
  5361. data.SessionId=sessionId;
  5362. data.APIType=apiType;
  5363. data.APIID=id;
  5364. data.Parameters=parameters;
  5365. data.ResponseTime=msResponseTime;
  5366. data.ErrorType=errorType;
  5367. (new AppLogger).LogData(data)
  5368. }
  5369. OSFAppTelemetry.onCallDone=onCallDone;
  5370. function onMethodDone(id, args, msResponseTime, errorType)
  5371. {
  5372. var parameters=null;
  5373. if(args)
  5374. if(typeof args=="number")
  5375. parameters=String(args);
  5376. else if(typeof args==="object")
  5377. for(var index in args)
  5378. {
  5379. if(parameters !==null)
  5380. parameters+=",";
  5381. else
  5382. parameters="";
  5383. if(typeof args[index]=="number")
  5384. parameters+=String(args[index])
  5385. }
  5386. else
  5387. parameters="";
  5388. OSF.AppTelemetry.onCallDone("method",id,parameters,msResponseTime,errorType)
  5389. }
  5390. OSFAppTelemetry.onMethodDone=onMethodDone;
  5391. function onPropertyDone(propertyName, msResponseTime)
  5392. {
  5393. OSF.AppTelemetry.onCallDone("property",-1,propertyName,msResponseTime)
  5394. }
  5395. OSFAppTelemetry.onPropertyDone=onPropertyDone;
  5396. function onEventDone(id, errorType)
  5397. {
  5398. OSF.AppTelemetry.onCallDone("event",id,null,0,errorType)
  5399. }
  5400. OSFAppTelemetry.onEventDone=onEventDone;
  5401. function onRegisterDone(register, id, msResponseTime, errorType)
  5402. {
  5403. OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent",id,null,msResponseTime,errorType)
  5404. }
  5405. OSFAppTelemetry.onRegisterDone=onRegisterDone;
  5406. function onAppClosed(openTime, focusTime)
  5407. {
  5408. if(!appInfo)
  5409. return;
  5410. var data=new OSFLog.AppClosedUsageData;
  5411. data.CorrelationId=osfControlAppCorrelationId;
  5412. data.SessionId=sessionId;
  5413. data.FocusTime=focusTime;
  5414. data.OpenTime=openTime;
  5415. data.AppSizeFinalWidth=window.innerWidth;
  5416. data.AppSizeFinalHeight=window.innerHeight;
  5417. (new AppStorage).saveLog(sessionId,data.SerializeRow())
  5418. }
  5419. OSFAppTelemetry.onAppClosed=onAppClosed;
  5420. function setOsfControlAppCorrelationId(correlationId)
  5421. {
  5422. osfControlAppCorrelationId=correlationId
  5423. }
  5424. OSFAppTelemetry.setOsfControlAppCorrelationId=setOsfControlAppCorrelationId;
  5425. function doAppInitializationLogging(isException, message)
  5426. {
  5427. var data=new OSFLog.AppInitializationUsageData;
  5428. data.CorrelationId=osfControlAppCorrelationId;
  5429. data.SessionId=sessionId;
  5430. data.SuccessCode=isException ? 1 : 0;
  5431. data.Message=message;
  5432. (new AppLogger).LogData(data)
  5433. }
  5434. OSFAppTelemetry.doAppInitializationLogging=doAppInitializationLogging;
  5435. function logAppCommonMessage(message)
  5436. {
  5437. doAppInitializationLogging(false,message)
  5438. }
  5439. OSFAppTelemetry.logAppCommonMessage=logAppCommonMessage;
  5440. function logAppException(errorMessage)
  5441. {
  5442. doAppInitializationLogging(true,errorMessage)
  5443. }
  5444. OSFAppTelemetry.logAppException=logAppException;
  5445. OSF.AppTelemetry=OSFAppTelemetry
  5446. })(OSFAppTelemetry || (OSFAppTelemetry={}));
  5447. var OfficeExt;
  5448. (function(OfficeExt)
  5449. {
  5450. var AppCommand;
  5451. (function(AppCommand)
  5452. {
  5453. var AppCommandManager=function()
  5454. {
  5455. function AppCommandManager()
  5456. {
  5457. var _this=this;
  5458. this._pseudoDocument=null;
  5459. this._eventDispatch=null;
  5460. this._processAppCommandInvocation=function(args)
  5461. {
  5462. var verifyResult=_this._verifyManifestCallback(args.callbackName);
  5463. if(verifyResult.errorCode !=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess)
  5464. {
  5465. _this._invokeAppCommandCompletedMethod(args.appCommandId,verifyResult.errorCode,"");
  5466. return
  5467. }
  5468. var eventObj=_this._constructEventObjectForCallback(args);
  5469. if(eventObj)
  5470. window.setTimeout(function()
  5471. {
  5472. verifyResult.callback(eventObj)
  5473. },0);
  5474. else
  5475. _this._invokeAppCommandCompletedMethod(args.appCommandId,OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError,"")
  5476. }
  5477. }
  5478. AppCommandManager.initializeOsfDda=function()
  5479. {
  5480. OSF.DDA.AsyncMethodNames.addNames({AppCommandInvocationCompletedAsync: "appCommandInvocationCompletedAsync"});
  5481. OSF.DDA.AsyncMethodCalls.define({
  5482. method: OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync,
  5483. requiredArguments: [{
  5484. name: Microsoft.Office.WebExtension.Parameters.Id,
  5485. types: ["string"]
  5486. },{
  5487. name: Microsoft.Office.WebExtension.Parameters.Status,
  5488. types: ["number"]
  5489. },{
  5490. name: Microsoft.Office.WebExtension.Parameters.Data,
  5491. types: ["string"]
  5492. }]
  5493. });
  5494. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{AppCommandInvokedEvent: "AppCommandInvokedEvent"});
  5495. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{AppCommandInvoked: "appCommandInvoked"});
  5496. OSF.OUtil.setNamespace("AppCommand",OSF.DDA);
  5497. OSF.DDA.AppCommand.AppCommandInvokedEventArgs=OfficeExt.AppCommand.AppCommandInvokedEventArgs
  5498. };
  5499. AppCommandManager.prototype.initializeAndChangeOnce=function(callback)
  5500. {
  5501. AppCommand.registerDdaFacade();
  5502. this._pseudoDocument={};
  5503. OSF.DDA.DispIdHost.addAsyncMethods(this._pseudoDocument,[OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync,]);
  5504. this._eventDispatch=new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.AppCommandInvoked,]);
  5505. var onRegisterCompleted=function(result)
  5506. {
  5507. if(callback)
  5508. if(result.status=="succeeded")
  5509. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  5510. else
  5511. callback(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError)
  5512. };
  5513. OSF.DDA.DispIdHost.addEventSupport(this._pseudoDocument,this._eventDispatch);
  5514. this._pseudoDocument.addHandlerAsync(Microsoft.Office.WebExtension.EventType.AppCommandInvoked,this._processAppCommandInvocation,onRegisterCompleted)
  5515. };
  5516. AppCommandManager.prototype._verifyManifestCallback=function(callbackName)
  5517. {
  5518. var defaultResult={
  5519. callback: null,
  5520. errorCode: OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCallback
  5521. };
  5522. callbackName=callbackName.trim();
  5523. try
  5524. {
  5525. var callList=callbackName.split(".");
  5526. var parentObject=window;
  5527. for(var i=0; i < callList.length - 1; i++)
  5528. if(parentObject[callList[i]] && typeof parentObject[callList[i]]=="object")
  5529. parentObject=parentObject[callList[i]];
  5530. else
  5531. return defaultResult;
  5532. var callbackFunc=parentObject[callList[callList.length - 1]];
  5533. if(typeof callbackFunc !="function")
  5534. return defaultResult
  5535. }
  5536. catch(e)
  5537. {
  5538. return defaultResult
  5539. }
  5540. return{
  5541. callback: callbackFunc,
  5542. errorCode: OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess
  5543. }
  5544. };
  5545. AppCommandManager.prototype._invokeAppCommandCompletedMethod=function(appCommandId, resultCode, data)
  5546. {
  5547. this._pseudoDocument.appCommandInvocationCompletedAsync(appCommandId,resultCode,data)
  5548. };
  5549. AppCommandManager.prototype._constructEventObjectForCallback=function(args)
  5550. {
  5551. var _this=this;
  5552. var eventObj=new AppCommandCallbackEventArgs;
  5553. try
  5554. {
  5555. var jsonData=JSON.parse(args.eventObjStr);
  5556. this._translateEventObjectInternal(jsonData,eventObj);
  5557. Object.defineProperty(eventObj,"completed",{
  5558. value: function()
  5559. {
  5560. var jsonString=JSON.stringify(eventObj);
  5561. _this._invokeAppCommandCompletedMethod(args.appCommandId,OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess,jsonString)
  5562. },
  5563. enumerable: true
  5564. })
  5565. }
  5566. catch(e)
  5567. {
  5568. eventObj=null
  5569. }
  5570. return eventObj
  5571. };
  5572. AppCommandManager.prototype._translateEventObjectInternal=function(input, output)
  5573. {
  5574. for(var key in input)
  5575. {
  5576. if(!input.hasOwnProperty(key))
  5577. continue;
  5578. var inputChild=input[key];
  5579. if(typeof inputChild=="object" && inputChild !=null)
  5580. {
  5581. OSF.OUtil.defineEnumerableProperty(output,key,{value: {}});
  5582. this._translateEventObjectInternal(inputChild,output[key])
  5583. }
  5584. else
  5585. Object.defineProperty(output,key,{
  5586. value: inputChild,
  5587. enumerable: true,
  5588. writable: true
  5589. })
  5590. }
  5591. };
  5592. AppCommandManager.prototype._constructObjectByTemplate=function(template, input)
  5593. {
  5594. var output={};
  5595. if(!template || !input)
  5596. return output;
  5597. for(var key in template)
  5598. if(template.hasOwnProperty(key))
  5599. {
  5600. output[key]=null;
  5601. if(input[key] !=null)
  5602. {
  5603. var templateChild=template[key];
  5604. var inputChild=input[key];
  5605. var inputChildType=typeof inputChild;
  5606. if(typeof templateChild=="object" && templateChild !=null)
  5607. output[key]=this._constructObjectByTemplate(templateChild,inputChild);
  5608. else if(inputChildType=="number" || inputChildType=="string" || inputChildType=="boolean")
  5609. output[key]=inputChild
  5610. }
  5611. }
  5612. return output
  5613. };
  5614. AppCommandManager.instance=function()
  5615. {
  5616. if(AppCommandManager._instance==null)
  5617. AppCommandManager._instance=new AppCommandManager;
  5618. return AppCommandManager._instance
  5619. };
  5620. AppCommandManager._instance=null;
  5621. return AppCommandManager
  5622. }();
  5623. AppCommand.AppCommandManager=AppCommandManager;
  5624. var AppCommandInvokedEventArgs=function()
  5625. {
  5626. function AppCommandInvokedEventArgs(appCommandId, callbackName, eventObjStr)
  5627. {
  5628. this.type=Microsoft.Office.WebExtension.EventType.AppCommandInvoked;
  5629. this.appCommandId=appCommandId;
  5630. this.callbackName=callbackName;
  5631. this.eventObjStr=eventObjStr
  5632. }
  5633. AppCommandInvokedEventArgs.create=function(eventProperties)
  5634. {
  5635. return new AppCommandInvokedEventArgs(eventProperties[AppCommand.AppCommandInvokedEventEnums.AppCommandId],eventProperties[AppCommand.AppCommandInvokedEventEnums.CallbackName],eventProperties[AppCommand.AppCommandInvokedEventEnums.EventObjStr])
  5636. };
  5637. return AppCommandInvokedEventArgs
  5638. }();
  5639. AppCommand.AppCommandInvokedEventArgs=AppCommandInvokedEventArgs;
  5640. var AppCommandCallbackEventArgs=function()
  5641. {
  5642. function AppCommandCallbackEventArgs(){}
  5643. return AppCommandCallbackEventArgs
  5644. }();
  5645. AppCommand.AppCommandCallbackEventArgs=AppCommandCallbackEventArgs;
  5646. AppCommand.AppCommandInvokedEventEnums={
  5647. AppCommandId: "appCommandId",
  5648. CallbackName: "callbackName",
  5649. EventObjStr: "eventObjStr"
  5650. }
  5651. })(AppCommand=OfficeExt.AppCommand || (OfficeExt.AppCommand={}))
  5652. })(OfficeExt || (OfficeExt={}));
  5653. OfficeExt.AppCommand.AppCommandManager.initializeOsfDda();
  5654. var OfficeExt;
  5655. (function(OfficeExt)
  5656. {
  5657. var AppCommand;
  5658. (function(AppCommand)
  5659. {
  5660. function registerDdaFacade()
  5661. {
  5662. if(OSF.DDA.SafeArray)
  5663. {
  5664. var parameterMap=OSF.DDA.SafeArray.Delegate.ParameterMap;
  5665. parameterMap.define({
  5666. type: OSF.DDA.MethodDispId.dispidAppCommandInvocationCompletedMethod,
  5667. toHost: [{
  5668. name: Microsoft.Office.WebExtension.Parameters.Id,
  5669. value: 0
  5670. },{
  5671. name: Microsoft.Office.WebExtension.Parameters.Status,
  5672. value: 1
  5673. },{
  5674. name: Microsoft.Office.WebExtension.Parameters.Data,
  5675. value: 2
  5676. }]
  5677. });
  5678. parameterMap.define({
  5679. type: OSF.DDA.EventDispId.dispidAppCommandInvokedEvent,
  5680. fromHost: [{
  5681. name: OSF.DDA.EventDescriptors.AppCommandInvokedEvent,
  5682. value: parameterMap.self
  5683. }],
  5684. isComplexType: true
  5685. });
  5686. parameterMap.define({
  5687. type: OSF.DDA.EventDescriptors.AppCommandInvokedEvent,
  5688. fromHost: [{
  5689. name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.AppCommandId,
  5690. value: 0
  5691. },{
  5692. name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.CallbackName,
  5693. value: 1
  5694. },{
  5695. name: OfficeExt.AppCommand.AppCommandInvokedEventEnums.EventObjStr,
  5696. value: 2
  5697. },],
  5698. isComplexType: true
  5699. })
  5700. }
  5701. }
  5702. AppCommand.registerDdaFacade=registerDdaFacade
  5703. })(AppCommand=OfficeExt.AppCommand || (OfficeExt.AppCommand={}))
  5704. })(OfficeExt || (OfficeExt={}));
  5705. var OfficeJsClient_OutlookWin32;
  5706. (function(OfficeJsClient_OutlookWin32)
  5707. {
  5708. function prepareApiSurface(appContext)
  5709. {
  5710. if(appContext.get_isDialog())
  5711. appContext.ui=new OSF.DDA.UI.ChildUI;
  5712. else
  5713. appContext.ui=new OSF.DDA.UI.ParentUI
  5714. }
  5715. OfficeJsClient_OutlookWin32.prepareApiSurface=prepareApiSurface;
  5716. function prepareRightAfterWebExtensionInitialize()
  5717. {
  5718. var appCommandHandler=OfficeExt.AppCommand.AppCommandManager.instance();
  5719. appCommandHandler.initializeAndChangeOnce()
  5720. }
  5721. OfficeJsClient_OutlookWin32.prepareRightAfterWebExtensionInitialize=prepareRightAfterWebExtensionInitialize
  5722. })(OfficeJsClient_OutlookWin32 || (OfficeJsClient_OutlookWin32={}));
  5723. OSF.InitializationHelper.prototype.prepareRightAfterWebExtensionInitialize=function OSF_InitializationHelper$prepareRightAfterWebExtensionInitialize()
  5724. {
  5725. OfficeJsClient_OutlookWin32.prepareRightAfterWebExtensionInitialize()
  5726. };
  5727. OSF.InitializationHelper.prototype.prepareApiSurface=function OSF_InitializationHelper$prepareApiSurface(appContext)
  5728. {
  5729. var license=new OSF.DDA.License(appContext.get_eToken());
  5730. if(appContext.get_appName()==OSF.AppName.OutlookWebApp)
  5731. {
  5732. OSF.WebApp._UpdateLinksForHostAndXdmInfo();
  5733. OSF._OfficeAppFactory.setContext(new OSF.DDA.OutlookContext(appContext,this._settings,license,appContext.appOM))
  5734. }
  5735. else
  5736. {
  5737. OfficeJsClient_OutlookWin32.prepareApiSurface(appContext);
  5738. OSF._OfficeAppFactory.setContext(new OSF.DDA.OutlookContext(appContext,this._settings,license,appContext.appOM,OSF.DDA.Theming ? OSF.DDA.Theming.getOfficeTheme : null,appContext.ui));
  5739. OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(OSF.DDA.DispIdHost.getClientDelegateMethods,OSF.DDA.SafeArray.Delegate.ParameterMap))
  5740. }
  5741. };
  5742. OSF.DDA.SettingsManager={
  5743. SerializedSettings: "serializedSettings",
  5744. DateJSONPrefix: "Date(",
  5745. DataJSONSuffix: ")",
  5746. serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection)
  5747. {
  5748. var ret={};
  5749. for(var key in settingsCollection)
  5750. {
  5751. var value=settingsCollection[key];
  5752. try
  5753. {
  5754. if(JSON)
  5755. value=JSON.stringify(value,function dateReplacer(k, v)
  5756. {
  5757. return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix+this[k].getTime()+OSF.DDA.SettingsManager.DataJSONSuffix : v
  5758. });
  5759. else
  5760. value=Sys.Serialization.JavaScriptSerializer.serialize(value);
  5761. ret[key]=value
  5762. }
  5763. catch(ex){}
  5764. }
  5765. return ret
  5766. },
  5767. deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings)
  5768. {
  5769. var ret={};
  5770. serializedSettings=serializedSettings || {};
  5771. for(var key in serializedSettings)
  5772. {
  5773. var value=serializedSettings[key];
  5774. try
  5775. {
  5776. if(JSON)
  5777. value=JSON.parse(value,function dateReviver(k, v)
  5778. {
  5779. var d;
  5780. if(typeof v==="string" && v && v.length > 6 && v.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix)
  5781. {
  5782. d=new Date(parseInt(v.slice(5,-1)));
  5783. if(d)
  5784. return d
  5785. }
  5786. return v
  5787. });
  5788. else
  5789. value=Sys.Serialization.JavaScriptSerializer.deserialize(value,true);
  5790. ret[key]=value
  5791. }
  5792. catch(ex){}
  5793. }
  5794. return ret
  5795. }
  5796. };
  5797. OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM=function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath)
  5798. {
  5799. Type.registerNamespace("Microsoft.Office.WebExtension.MailboxEnums");
  5800. Microsoft.Office.WebExtension.MailboxEnums.EntityType={
  5801. MeetingSuggestion: "meetingSuggestion",
  5802. TaskSuggestion: "taskSuggestion",
  5803. Address: "address",
  5804. EmailAddress: "emailAddress",
  5805. Url: "url",
  5806. PhoneNumber: "phoneNumber",
  5807. Contact: "contact",
  5808. FlightReservations: "flightReservations",
  5809. ParcelDeliveries: "parcelDeliveries"
  5810. };
  5811. Microsoft.Office.WebExtension.MailboxEnums.ItemType={
  5812. Message: "message",
  5813. Appointment: "appointment"
  5814. };
  5815. Microsoft.Office.WebExtension.MailboxEnums.ResponseType={
  5816. None: "none",
  5817. Organizer: "organizer",
  5818. Tentative: "tentative",
  5819. Accepted: "accepted",
  5820. Declined: "declined"
  5821. };
  5822. Microsoft.Office.WebExtension.MailboxEnums.RecipientType={
  5823. Other: "other",
  5824. DistributionList: "distributionList",
  5825. User: "user",
  5826. ExternalUser: "externalUser"
  5827. };
  5828. Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={
  5829. File: "file",
  5830. Item: "item",
  5831. Cloud: "cloud"
  5832. };
  5833. Microsoft.Office.WebExtension.MailboxEnums.BodyType={
  5834. Text: "text",
  5835. Html: "html"
  5836. };
  5837. Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType={
  5838. ProgressIndicator: "progressIndicator",
  5839. InformationalMessage: "informationalMessage",
  5840. ErrorMessage: "errorMessage"
  5841. };
  5842. Microsoft.Office.WebExtension.CoercionType={
  5843. Text: "text",
  5844. Html: "html"
  5845. };
  5846. Microsoft.Office.WebExtension.MailboxEnums.UserProfileType={
  5847. Office365: "office365",
  5848. OutlookCom: "outlookCom",
  5849. Enterprise: "enterprise"
  5850. };
  5851. Microsoft.Office.WebExtension.MailboxEnums.RestVersion={
  5852. v1_0: "v1.0",
  5853. v2_0: "v2.0",
  5854. Beta: "beta"
  5855. };
  5856. Type.registerNamespace("OSF.DDA");
  5857. var OSF=window.OSF || {};
  5858. OSF.DDA=OSF.DDA || {};
  5859. window["OSF"]["DDA"]["OutlookAppOm"]=OSF.DDA.OutlookAppOm=function(officeAppContext, targetWindow, appReadyCallback)
  5860. {
  5861. this.$$d_displayContactCardAsync=Function.createDelegate(this,this.displayContactCardAsync);
  5862. this.$$d_displayNewMessageFormApi=Function.createDelegate(this,this.displayNewMessageFormApi);
  5863. this.$$d__displayNewAppointmentFormApi$p$0=Function.createDelegate(this,this._displayNewAppointmentFormApi$p$0);
  5864. this.$$d_windowOpenOverrideHandler=Function.createDelegate(this,this.windowOpenOverrideHandler);
  5865. this.$$d__getEwsUrl$p$0=Function.createDelegate(this,this._getEwsUrl$p$0);
  5866. this.$$d__getDiagnostics$p$0=Function.createDelegate(this,this._getDiagnostics$p$0);
  5867. this.$$d__getUserProfile$p$0=Function.createDelegate(this,this._getUserProfile$p$0);
  5868. this.$$d__getItem$p$0=Function.createDelegate(this,this._getItem$p$0);
  5869. this.$$d__callAppReadyCallback$p$0=Function.createDelegate(this,this._callAppReadyCallback$p$0);
  5870. this.$$d__getInitialDataResponseHandler$p$0=Function.createDelegate(this,this._getInitialDataResponseHandler$p$0);
  5871. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p=this;
  5872. this._officeAppContext$p$0=officeAppContext;
  5873. this._appReadyCallback$p$0=appReadyCallback;
  5874. var $$t_4=this;
  5875. var stringLoadedCallback=function()
  5876. {
  5877. if(appReadyCallback)
  5878. if(!officeAppContext["get_isDialog"]())
  5879. $$t_4.invokeHostMethod(1,null,$$t_4.$$d__getInitialDataResponseHandler$p$0);
  5880. else
  5881. window.setTimeout($$t_4.$$d__callAppReadyCallback$p$0,0)
  5882. };
  5883. if(this._areStringsLoaded$p$0())
  5884. stringLoadedCallback();
  5885. else
  5886. this._loadLocalizedScript$p$0(stringLoadedCallback)
  5887. };
  5888. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i=function(currentPermissionLevel)
  5889. {
  5890. if(!currentPermissionLevel)
  5891. throw Error.create(window["_u"]["ExtensibilityStrings"]["l_ElevatedPermissionNeeded_Text"]);
  5892. };
  5893. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i=function(value, minValue, maxValue, argumentName)
  5894. {
  5895. if(value < minValue || value > maxValue)
  5896. throw Error.argumentOutOfRange(argumentName);
  5897. };
  5898. window["OSF"]["DDA"]["OutlookAppOm"]._getHtmlBody$p=function(data)
  5899. {
  5900. var htmlBody="";
  5901. if("htmlBody" in data)
  5902. {
  5903. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidHtmlBody$p(data["htmlBody"]);
  5904. htmlBody=data["htmlBody"]
  5905. }
  5906. return htmlBody
  5907. };
  5908. window["OSF"]["DDA"]["OutlookAppOm"]._getAttachments$p=function(data)
  5909. {
  5910. var attachments=[];
  5911. if("attachments" in data)
  5912. {
  5913. attachments=data["attachments"];
  5914. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentsArray$p(attachments)
  5915. }
  5916. return attachments
  5917. };
  5918. window["OSF"]["DDA"]["OutlookAppOm"]._getOptionsAndCallback$p=function(data)
  5919. {
  5920. var args=[];
  5921. if("options" in data)
  5922. args[0]=data["options"];
  5923. if("callback" in data)
  5924. args[args["length"]]=data["callback"];
  5925. return args
  5926. };
  5927. window["OSF"]["DDA"]["OutlookAppOm"]._createAttachmentsDataForHost$p=function(attachments)
  5928. {
  5929. var attachmentsData=new Array(0);
  5930. if(Array.isInstanceOfType(attachments))
  5931. for(var i=0; i < attachments["length"]; i++)
  5932. if(Object.isInstanceOfType(attachments[i]))
  5933. {
  5934. var attachment=attachments[i];
  5935. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachment$p(attachment);
  5936. attachmentsData[i]=window["OSF"]["DDA"]["OutlookAppOm"]._createAttachmentData$p(attachment)
  5937. }
  5938. else
  5939. throw Error.argument("attachments");
  5940. return attachmentsData
  5941. };
  5942. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidHtmlBody$p=function(htmlBody)
  5943. {
  5944. if(!String.isInstanceOfType(htmlBody))
  5945. throw Error.argument("htmlBody");
  5946. if($h.ScriptHelpers.isNullOrUndefined(htmlBody))
  5947. throw Error.argument("htmlBody");
  5948. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(htmlBody["length"],0,window["OSF"]["DDA"]["OutlookAppOm"].maxBodyLength,"htmlBody")
  5949. };
  5950. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentsArray$p=function(attachments)
  5951. {
  5952. if(!Array.isInstanceOfType(attachments))
  5953. throw Error.argument("attachments");
  5954. };
  5955. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachment$p=function(attachment)
  5956. {
  5957. if(!Object.isInstanceOfType(attachment))
  5958. throw Error.argument("attachments");
  5959. if(!("type" in attachment) || !("name" in attachment))
  5960. throw Error.argument("attachments");
  5961. if(!("url" in attachment || "itemId" in attachment))
  5962. throw Error.argument("attachments");
  5963. };
  5964. window["OSF"]["DDA"]["OutlookAppOm"]._createAttachmentData$p=function(attachment)
  5965. {
  5966. var attachmentData=null;
  5967. if(attachment["type"]==="file")
  5968. {
  5969. var url=attachment["url"];
  5970. var name=attachment["name"];
  5971. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentUrlOrName$p(url,name);
  5972. attachmentData=window["OSF"]["DDA"]["OutlookAppOm"]._createFileAttachmentData$p(url,name)
  5973. }
  5974. else if(attachment["type"]==="item")
  5975. {
  5976. var itemId=window["OSF"]["DDA"]["OutlookAppOm"].getItemIdBasedOnHost(attachment["itemId"]);
  5977. var name=attachment["name"];
  5978. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentItemIdOrName$p(itemId,name);
  5979. attachmentData=window["OSF"]["DDA"]["OutlookAppOm"]._createItemAttachmentData$p(itemId,name)
  5980. }
  5981. else
  5982. throw Error.argument("attachments");
  5983. return attachmentData
  5984. };
  5985. window["OSF"]["DDA"]["OutlookAppOm"]._createFileAttachmentData$p=function(url, name)
  5986. {
  5987. return["file",name,url]
  5988. };
  5989. window["OSF"]["DDA"]["OutlookAppOm"]._createItemAttachmentData$p=function(itemId, name)
  5990. {
  5991. return["item",name,itemId]
  5992. };
  5993. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentUrlOrName$p=function(url, name)
  5994. {
  5995. if(!String.isInstanceOfType(url) || !String.isInstanceOfType(name))
  5996. throw Error.argument("attachments");
  5997. if(url["length"] > 2048)
  5998. throw Error.argumentOutOfRange("attachments",url["length"],window["_u"]["ExtensibilityStrings"]["l_AttachmentUrlTooLong_Text"]);
  5999. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentName$p(name)
  6000. };
  6001. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentItemIdOrName$p=function(itemId, name)
  6002. {
  6003. if(!String.isInstanceOfType(itemId) || !String.isInstanceOfType(name))
  6004. throw Error.argument("attachments");
  6005. if(itemId["length"] > 200)
  6006. throw Error.argumentOutOfRange("attachments",itemId["length"],window["_u"]["ExtensibilityStrings"]["l_AttachmentItemIdTooLong_Text"]);
  6007. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentName$p(name)
  6008. };
  6009. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidAttachmentName$p=function(name)
  6010. {
  6011. if(name["length"] > 255)
  6012. throw Error.argumentOutOfRange("attachments",name["length"],window["_u"]["ExtensibilityStrings"]["l_AttachmentNameTooLong_Text"]);
  6013. };
  6014. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidRestVersion$p=function(restVersion)
  6015. {
  6016. if(!restVersion)
  6017. throw Error.argumentNull("restVersion");
  6018. if(restVersion !==window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RestVersion"]["v1_0"] && restVersion !==window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RestVersion"]["v2_0"] && restVersion !==window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RestVersion"]["Beta"])
  6019. throw Error.argument("restVersion");
  6020. };
  6021. window["OSF"]["DDA"]["OutlookAppOm"].getItemIdBasedOnHost=function(itemId)
  6022. {
  6023. if(window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._initialData$p$0 && window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._initialData$p$0.get__isRestIdSupported$i$0())
  6024. return window["OSF"]["DDA"]["OutlookAppOm"]._instance$p["convertToRestId"](itemId,window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RestVersion"]["v1_0"]);
  6025. return window["OSF"]["DDA"]["OutlookAppOm"]._instance$p["convertToEwsId"](itemId,window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RestVersion"]["v1_0"])
  6026. };
  6027. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnArgumentType$p=function(value, expectedType, argumentName)
  6028. {
  6029. if(Object["getType"](value) !==expectedType)
  6030. throw Error.argumentType(argumentName);
  6031. };
  6032. window["OSF"]["DDA"]["OutlookAppOm"]._validateOptionalStringParameter$p=function(value, minLength, maxLength, name)
  6033. {
  6034. if($h.ScriptHelpers.isNullOrUndefined(value))
  6035. return;
  6036. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnArgumentType$p(value,String,name);
  6037. var stringValue=value;
  6038. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(stringValue["length"],minLength,maxLength,name)
  6039. };
  6040. window["OSF"]["DDA"]["OutlookAppOm"]._convertToOutlookParameters$p=function(dispid, data)
  6041. {
  6042. var executeParameters=null;
  6043. switch(dispid)
  6044. {
  6045. case 1:
  6046. case 2:
  6047. case 12:
  6048. case 3:
  6049. case 14:
  6050. case 18:
  6051. case 26:
  6052. case 32:
  6053. case 41:
  6054. case 34:
  6055. break;
  6056. case 4:
  6057. var jsonProperty=window["JSON"]["stringify"](data["customProperties"]);
  6058. executeParameters=[jsonProperty];
  6059. break;
  6060. case 5:
  6061. executeParameters=[data["body"]];
  6062. break;
  6063. case 8:
  6064. case 9:
  6065. executeParameters=[data["itemId"]];
  6066. break;
  6067. case 7:
  6068. executeParameters=[window["OSF"]["DDA"]["OutlookAppOm"]._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["requiredAttendees"]),window["OSF"]["DDA"]["OutlookAppOm"]._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["optionalAttendees"]),data["start"],data["end"],data["location"],window["OSF"]["DDA"]["OutlookAppOm"]._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["resources"]),data["subject"],data["body"]];
  6069. break;
  6070. case 44:
  6071. executeParameters=[window["OSF"]["DDA"]["OutlookAppOm"]._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["toRecipients"]),window["OSF"]["DDA"]["OutlookAppOm"]._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["ccRecipients"]),window["OSF"]["DDA"]["OutlookAppOm"]._convertRecipientArrayParameterForOutlookForDisplayApi$p(data["bccRecipients"]),data["subject"],data["htmlBody"],data["attachments"]];
  6072. break;
  6073. case 43:
  6074. executeParameters=[data["ewsIdOrEmail"]];
  6075. break;
  6076. case 40:
  6077. executeParameters=[data["extensionId"],data["consentState"]];
  6078. break;
  6079. case 11:
  6080. case 10:
  6081. executeParameters=[data["htmlBody"]];
  6082. break;
  6083. case 31:
  6084. case 30:
  6085. executeParameters=[data["htmlBody"],data["attachments"]];
  6086. break;
  6087. case 23:
  6088. case 13:
  6089. case 38:
  6090. case 29:
  6091. executeParameters=[data["data"],data["coercionType"]];
  6092. break;
  6093. case 37:
  6094. case 28:
  6095. executeParameters=[data["coercionType"]];
  6096. break;
  6097. case 17:
  6098. executeParameters=[data["subject"]];
  6099. break;
  6100. case 15:
  6101. executeParameters=[data["recipientField"]];
  6102. break;
  6103. case 22:
  6104. case 21:
  6105. executeParameters=[data["recipientField"],window["OSF"]["DDA"]["OutlookAppOm"]._convertComposeEmailDictionaryParameterForSetApi$p(data["recipientArray"])];
  6106. break;
  6107. case 19:
  6108. executeParameters=[data["itemId"],data["name"]];
  6109. break;
  6110. case 16:
  6111. executeParameters=[data["uri"],data["name"]];
  6112. break;
  6113. case 20:
  6114. executeParameters=[data["attachmentIndex"]];
  6115. break;
  6116. case 25:
  6117. executeParameters=[data["TimeProperty"],data["time"]];
  6118. break;
  6119. case 24:
  6120. executeParameters=[data["TimeProperty"]];
  6121. break;
  6122. case 27:
  6123. executeParameters=[data["location"]];
  6124. break;
  6125. case 33:
  6126. case 35:
  6127. executeParameters=[data["key"],data["type"],data["persistent"],data["message"],data["icon"]];
  6128. break;
  6129. case 36:
  6130. executeParameters=[data["key"]];
  6131. break;
  6132. default:
  6133. Sys.Debug.fail("Unexpected method dispid");
  6134. break
  6135. }
  6136. return executeParameters
  6137. };
  6138. window["OSF"]["DDA"]["OutlookAppOm"]._convertRecipientArrayParameterForOutlookForDisplayApi$p=function(array)
  6139. {
  6140. return array ? array["join"](";") : null
  6141. };
  6142. window["OSF"]["DDA"]["OutlookAppOm"]._convertComposeEmailDictionaryParameterForSetApi$p=function(recipients)
  6143. {
  6144. if(!recipients)
  6145. return null;
  6146. var results=new Array(recipients["length"]);
  6147. for(var i=0; i < recipients["length"]; i++)
  6148. results[i]=[recipients[i]["address"],recipients[i]["name"]];
  6149. return results
  6150. };
  6151. window["OSF"]["DDA"]["OutlookAppOm"]._validateAndNormalizeRecipientEmails$p=function(emailset, name)
  6152. {
  6153. if($h.ScriptHelpers.isNullOrUndefined(emailset))
  6154. return null;
  6155. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnArgumentType$p(emailset,Array,name);
  6156. var originalAttendees=emailset;
  6157. var updatedAttendees=null;
  6158. var normalizationNeeded=false;
  6159. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(originalAttendees["length"],0,window["OSF"]["DDA"]["OutlookAppOm"]._maxRecipients$p,String.format("{0}.length",name));
  6160. for(var i=0; i < originalAttendees["length"]; i++)
  6161. if($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i]))
  6162. {
  6163. normalizationNeeded=true;
  6164. break
  6165. }
  6166. if(normalizationNeeded)
  6167. updatedAttendees=[];
  6168. for(var i=0; i < originalAttendees["length"]; i++)
  6169. if(normalizationNeeded)
  6170. {
  6171. updatedAttendees[i]=$h.EmailAddressDetails.isInstanceOfType(originalAttendees[i]) ? originalAttendees[i]["emailAddress"] : originalAttendees[i];
  6172. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnArgumentType$p(updatedAttendees[i],String,String.format("{0}[{1}]",name,i))
  6173. }
  6174. else
  6175. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnArgumentType$p(originalAttendees[i],String,String.format("{0}[{1}]",name,i));
  6176. return updatedAttendees
  6177. };
  6178. OSF.DDA.OutlookAppOm.prototype={
  6179. _initialData$p$0: null,
  6180. _item$p$0: null,
  6181. _userProfile$p$0: null,
  6182. _diagnostics$p$0: null,
  6183. _officeAppContext$p$0: null,
  6184. _appReadyCallback$p$0: null,
  6185. _clientEndPoint$p$0: null,
  6186. _hostItemType$p$0: 0,
  6187. get_clientEndPoint: function()
  6188. {
  6189. if(!this._clientEndPoint$p$0)
  6190. this._clientEndPoint$p$0=OSF._OfficeAppFactory["getClientEndPoint"]();
  6191. return this._clientEndPoint$p$0
  6192. },
  6193. set_clientEndPoint: function(value)
  6194. {
  6195. this._clientEndPoint$p$0=value;
  6196. return value
  6197. },
  6198. get_initialData: function()
  6199. {
  6200. return this._initialData$p$0
  6201. },
  6202. get__appName$i$0: function()
  6203. {
  6204. return this._officeAppContext$p$0["get_appName"]()
  6205. },
  6206. initialize: function(initialData)
  6207. {
  6208. var ItemTypeKey="itemType";
  6209. this._initialData$p$0=new $h.InitialData(initialData);
  6210. this._hostItemType$p$0=initialData[ItemTypeKey];
  6211. if(1===initialData[ItemTypeKey])
  6212. this._item$p$0=new $h.Message(this._initialData$p$0);
  6213. else if(3===initialData[ItemTypeKey])
  6214. this._item$p$0=new $h.MeetingRequest(this._initialData$p$0);
  6215. else if(2===initialData[ItemTypeKey])
  6216. this._item$p$0=new $h.Appointment(this._initialData$p$0);
  6217. else if(4===initialData[ItemTypeKey])
  6218. this._item$p$0=new $h.MessageCompose(this._initialData$p$0);
  6219. else if(5===initialData[ItemTypeKey])
  6220. this._item$p$0=new $h.AppointmentCompose(this._initialData$p$0);
  6221. else if(6===initialData[ItemTypeKey]);
  6222. else
  6223. Sys.Debug.trace("Unexpected item type was received from the host.");
  6224. this._userProfile$p$0=new $h.UserProfile(this._initialData$p$0);
  6225. this._diagnostics$p$0=new $h.Diagnostics(this._initialData$p$0,this._officeAppContext$p$0["get_appName"]());
  6226. this._initializeMethods$p$0();
  6227. $h.InitialData._defineReadOnlyProperty$i(this,"item",this.$$d__getItem$p$0);
  6228. $h.InitialData._defineReadOnlyProperty$i(this,"userProfile",this.$$d__getUserProfile$p$0);
  6229. $h.InitialData._defineReadOnlyProperty$i(this,"diagnostics",this.$$d__getDiagnostics$p$0);
  6230. $h.InitialData._defineReadOnlyProperty$i(this,"ewsUrl",this.$$d__getEwsUrl$p$0);
  6231. if(window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.get__appName$i$0()===64)
  6232. if(this._initialData$p$0.get__overrideWindowOpen$i$0())
  6233. window.open=this.$$d_windowOpenOverrideHandler
  6234. },
  6235. windowOpenOverrideHandler: function(url, targetName, features, replace)
  6236. {
  6237. this.invokeHostMethod(403,{launchUrl: url},null)
  6238. },
  6239. createAsyncResult: function(value, errorCode, detailedErrorCode, userContext, errorMessage)
  6240. {
  6241. var initArgs={};
  6242. var errorArgs=null;
  6243. initArgs[OSF.DDA.AsyncResultEnum.Properties["Value"]]=value;
  6244. initArgs[OSF.DDA.AsyncResultEnum.Properties["Context"]]=userContext;
  6245. if(0 !==errorCode)
  6246. {
  6247. errorArgs={};
  6248. var errorProperties=$h.OutlookErrorManager.getErrorArgs(detailedErrorCode);
  6249. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties["Name"]]=errorProperties["name"];
  6250. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties["Message"]]=!errorMessage ? errorProperties["message"] : errorMessage;
  6251. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties["Code"]]=detailedErrorCode
  6252. }
  6253. return new OSF.DDA.AsyncResult(initArgs,errorArgs)
  6254. },
  6255. _throwOnMethodCallForInsufficientPermission$i$0: function(requiredPermissionLevel, methodName)
  6256. {
  6257. if(this._initialData$p$0._permissionLevel$p$0 < requiredPermissionLevel)
  6258. throw Error.create(String.format(window["_u"]["ExtensibilityStrings"]["l_ElevatedPermissionNeededForMethod_Text"],methodName));
  6259. },
  6260. _displayReplyForm$i$0: function(obj)
  6261. {
  6262. this._displayReplyFormHelper$p$0(obj,false)
  6263. },
  6264. _displayReplyAllForm$i$0: function(obj)
  6265. {
  6266. this._displayReplyFormHelper$p$0(obj,true)
  6267. },
  6268. _displayReplyFormHelper$p$0: function(obj, isReplyAll)
  6269. {
  6270. if(String.isInstanceOfType(obj))
  6271. this._doDisplayReplyForm$p$0(obj,isReplyAll);
  6272. else if(Object.isInstanceOfType(obj) && Object.getTypeName(obj)==="Object")
  6273. this._doDisplayReplyFormWithAttachments$p$0(obj,isReplyAll);
  6274. else
  6275. throw Error.argumentType();
  6276. },
  6277. _doDisplayReplyForm$p$0: function(htmlBody, isReplyAll)
  6278. {
  6279. if(!$h.ScriptHelpers.isNullOrUndefined(htmlBody))
  6280. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(htmlBody["length"],0,window["OSF"]["DDA"]["OutlookAppOm"].maxBodyLength,"htmlBody");
  6281. this.invokeHostMethod(isReplyAll ? 11 : 10,{htmlBody: htmlBody},null)
  6282. },
  6283. _doDisplayReplyFormWithAttachments$p$0: function(data, isReplyAll)
  6284. {
  6285. var htmlBody=window["OSF"]["DDA"]["OutlookAppOm"]._getHtmlBody$p(data);
  6286. var attachments=window["OSF"]["DDA"]["OutlookAppOm"]._getAttachments$p(data);
  6287. var parameters=$h.CommonParameters.parse(window["OSF"]["DDA"]["OutlookAppOm"]._getOptionsAndCallback$p(data),false);
  6288. var $$t_6=this;
  6289. this._standardInvokeHostMethod$i$0(isReplyAll ? 31 : 30,{
  6290. htmlBody: htmlBody,
  6291. attachments: window["OSF"]["DDA"]["OutlookAppOm"]._createAttachmentsDataForHost$p(attachments)
  6292. },function(rawInput)
  6293. {
  6294. return rawInput
  6295. },parameters._asyncContext$p$0,parameters._callback$p$0)
  6296. },
  6297. _standardInvokeHostMethod$i$0: function(dispid, data, format, userContext, callback)
  6298. {
  6299. var $$t_B=this;
  6300. this.invokeHostMethod(dispid,data,function(resultCode, response)
  6301. {
  6302. if(callback)
  6303. {
  6304. var asyncResult=null;
  6305. if(Object.isInstanceOfType(response))
  6306. {
  6307. var responseDictionary=response;
  6308. if("error" in responseDictionary || "data" in responseDictionary || "errorCode" in responseDictionary)
  6309. if(!responseDictionary["error"])
  6310. {
  6311. var formattedData=format ? format(responseDictionary["data"]) : responseDictionary["data"];
  6312. asyncResult=$$t_B.createAsyncResult(formattedData,0,0,userContext,null)
  6313. }
  6314. else
  6315. {
  6316. var errorCode=responseDictionary["errorCode"];
  6317. asyncResult=$$t_B.createAsyncResult(null,1,errorCode,userContext,null)
  6318. }
  6319. }
  6320. if(!asyncResult && resultCode)
  6321. asyncResult=$$t_B.createAsyncResult(null,1,9002,userContext,null);
  6322. callback(asyncResult)
  6323. }
  6324. })
  6325. },
  6326. invokeHostMethod: function(dispid, data, responseCallback)
  6327. {
  6328. if(64===this._officeAppContext$p$0["get_appName"]())
  6329. {
  6330. var args={ApiParams: data};
  6331. args["MethodData"]={
  6332. ControlId: OSF._OfficeAppFactory["getId"](),
  6333. DispatchId: dispid
  6334. };
  6335. if(dispid===1)
  6336. this.get_clientEndPoint()["invoke"]("GetInitialData",responseCallback,args);
  6337. else
  6338. this.get_clientEndPoint()["invoke"]("ExecuteMethod",responseCallback,args)
  6339. }
  6340. else if(!this._isOwaOnlyMethod$p$0(dispid))
  6341. {
  6342. var executeParameters=window["OSF"]["DDA"]["OutlookAppOm"]._convertToOutlookParameters$p(dispid,data);
  6343. var $$t_B=this;
  6344. OSF.ClientHostController["execute"](dispid,executeParameters,function(nativeData, resultCode)
  6345. {
  6346. if(responseCallback)
  6347. {
  6348. var responseData=nativeData.toArray();
  6349. var rawData=window["JSON"]["parse"](responseData[0]);
  6350. if(Object.isInstanceOfType(rawData))
  6351. {
  6352. var deserializedData=rawData;
  6353. if(responseData["length"] > 1 && responseData[1])
  6354. {
  6355. deserializedData["error"]=true;
  6356. deserializedData["errorCode"]=responseData[1]
  6357. }
  6358. else
  6359. deserializedData["error"]=false;
  6360. responseCallback(resultCode,deserializedData)
  6361. }
  6362. else if(Number.isInstanceOfType(rawData))
  6363. {
  6364. var returnDict={};
  6365. returnDict["error"]=true;
  6366. returnDict["errorCode"]=rawData;
  6367. responseCallback(resultCode,returnDict)
  6368. }
  6369. else
  6370. throw Error.notImplemented("Return data type from host must be Dictionary or int");
  6371. }
  6372. })
  6373. }
  6374. else if(responseCallback)
  6375. responseCallback(-2,null)
  6376. },
  6377. _dictionaryToDate$i$0: function(input)
  6378. {
  6379. var retValue=new Date(input["year"],input["month"],input["date"],input["hours"],input["minutes"],input["seconds"],!input["milliseconds"] ? 0 : input["milliseconds"]);
  6380. if(window["isNaN"](retValue["getTime"]()))
  6381. throw Error.format(window["_u"]["ExtensibilityStrings"]["l_InvalidDate_Text"]);
  6382. return retValue
  6383. },
  6384. _dateToDictionary$i$0: function(input)
  6385. {
  6386. var retValue={};
  6387. retValue["month"]=input["getMonth"]();
  6388. retValue["date"]=input["getDate"]();
  6389. retValue["year"]=input["getFullYear"]();
  6390. retValue["hours"]=input["getHours"]();
  6391. retValue["minutes"]=input["getMinutes"]();
  6392. retValue["seconds"]=input["getSeconds"]();
  6393. retValue["milliseconds"]=input["getMilliseconds"]();
  6394. return retValue
  6395. },
  6396. _isOwaOnlyMethod$p$0: function(dispId)
  6397. {
  6398. switch(dispId)
  6399. {
  6400. case 402:
  6401. case 401:
  6402. case 400:
  6403. case 403:
  6404. return true;
  6405. default:
  6406. return false
  6407. }
  6408. },
  6409. _displayNewAppointmentFormApi$p$0: function(parameters)
  6410. {
  6411. var normalizedRequiredAttendees=window["OSF"]["DDA"]["OutlookAppOm"]._validateAndNormalizeRecipientEmails$p(parameters["requiredAttendees"],"requiredAttendees");
  6412. var normalizedOptionalAttendees=window["OSF"]["DDA"]["OutlookAppOm"]._validateAndNormalizeRecipientEmails$p(parameters["optionalAttendees"],"optionalAttendees");
  6413. window["OSF"]["DDA"]["OutlookAppOm"]._validateOptionalStringParameter$p(parameters["location"],0,window["OSF"]["DDA"]["OutlookAppOm"]._maxLocationLength$p,"location");
  6414. window["OSF"]["DDA"]["OutlookAppOm"]._validateOptionalStringParameter$p(parameters["body"],0,window["OSF"]["DDA"]["OutlookAppOm"].maxBodyLength,"body");
  6415. window["OSF"]["DDA"]["OutlookAppOm"]._validateOptionalStringParameter$p(parameters["subject"],0,window["OSF"]["DDA"]["OutlookAppOm"]._maxSubjectLength$p,"subject");
  6416. if(!$h.ScriptHelpers.isNullOrUndefined(parameters["start"]))
  6417. {
  6418. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnArgumentType$p(parameters["start"],Date,"start");
  6419. var startDateTime=parameters["start"];
  6420. parameters["start"]=startDateTime["getTime"]();
  6421. if(!$h.ScriptHelpers.isNullOrUndefined(parameters["end"]))
  6422. {
  6423. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnArgumentType$p(parameters["end"],Date,"end");
  6424. var endDateTime=parameters["end"];
  6425. if(endDateTime < startDateTime)
  6426. throw Error.argumentOutOfRange("end",endDateTime,window["_u"]["ExtensibilityStrings"]["l_InvalidEventDates_Text"]);
  6427. parameters["end"]=endDateTime["getTime"]()
  6428. }
  6429. }
  6430. var updatedParameters=null;
  6431. if(normalizedRequiredAttendees || normalizedOptionalAttendees)
  6432. {
  6433. updatedParameters={};
  6434. var $$dict_7=parameters;
  6435. for(var $$key_8 in $$dict_7)
  6436. {
  6437. var entry={
  6438. key: $$key_8,
  6439. value: $$dict_7[$$key_8]
  6440. };
  6441. updatedParameters[entry["key"]]=entry["value"]
  6442. }
  6443. if(normalizedRequiredAttendees)
  6444. updatedParameters["requiredAttendees"]=normalizedRequiredAttendees;
  6445. if(normalizedOptionalAttendees)
  6446. updatedParameters["optionalAttendees"]=normalizedOptionalAttendees
  6447. }
  6448. this.invokeHostMethod(7,updatedParameters || parameters,null)
  6449. },
  6450. displayNewMessageFormApi: function(parameters)
  6451. {
  6452. var updatedParameters={};
  6453. if(parameters)
  6454. {
  6455. var normalizedToRecipients=window["OSF"]["DDA"]["OutlookAppOm"]._validateAndNormalizeRecipientEmails$p(parameters["toRecipients"],"toRecipients");
  6456. var normalizedCcRecipients=window["OSF"]["DDA"]["OutlookAppOm"]._validateAndNormalizeRecipientEmails$p(parameters["ccRecipients"],"ccRecipients");
  6457. var normalizedBccRecipients=window["OSF"]["DDA"]["OutlookAppOm"]._validateAndNormalizeRecipientEmails$p(parameters["bccRecipients"],"bccRecipients");
  6458. window["OSF"]["DDA"]["OutlookAppOm"]._validateOptionalStringParameter$p(parameters["htmlBody"],0,window["OSF"]["DDA"]["OutlookAppOm"].maxBodyLength,"htmlBody");
  6459. window["OSF"]["DDA"]["OutlookAppOm"]._validateOptionalStringParameter$p(parameters["subject"],0,window["OSF"]["DDA"]["OutlookAppOm"]._maxSubjectLength$p,"subject");
  6460. var attachments=window["OSF"]["DDA"]["OutlookAppOm"]._getAttachments$p(parameters);
  6461. var $$dict_7=parameters;
  6462. for(var $$key_8 in $$dict_7)
  6463. {
  6464. var entry={
  6465. key: $$key_8,
  6466. value: $$dict_7[$$key_8]
  6467. };
  6468. updatedParameters[entry["key"]]=entry["value"]
  6469. }
  6470. if(normalizedToRecipients)
  6471. updatedParameters["toRecipients"]=normalizedToRecipients;
  6472. if(normalizedCcRecipients)
  6473. updatedParameters["ccRecipients"]=normalizedCcRecipients;
  6474. if(normalizedBccRecipients)
  6475. updatedParameters["bccRecipients"]=normalizedBccRecipients;
  6476. if(attachments)
  6477. updatedParameters["attachments"]=window["OSF"]["DDA"]["OutlookAppOm"]._createAttachmentsDataForHost$p(attachments)
  6478. }
  6479. this.invokeHostMethod(44,updatedParameters || parameters,null)
  6480. },
  6481. displayContactCardAsync: function(ewsIdOrEmail, callback)
  6482. {
  6483. if($h.ScriptHelpers.isNullOrUndefined(ewsIdOrEmail))
  6484. throw Error.argumentNull("ewsIdOrEmail");
  6485. var asyncContext=null;
  6486. var asyncFunctionCallback=null;
  6487. if(callback)
  6488. {
  6489. var commonParameters=$h.CommonParameters.parse([callback],false);
  6490. asyncContext=commonParameters._asyncContext$p$0;
  6491. asyncFunctionCallback=commonParameters._callback$p$0
  6492. }
  6493. this._standardInvokeHostMethod$i$0(43,{ewsIdOrEmail: ewsIdOrEmail.trim()},null,asyncContext,asyncFunctionCallback)
  6494. },
  6495. _initializeMethods$p$0: function()
  6496. {
  6497. var currentInstance=this;
  6498. if($h.Item.isInstanceOfType(this._item$p$0) || this._hostItemType$p$0===6)
  6499. {
  6500. currentInstance["displayNewAppointmentForm"]=this.$$d__displayNewAppointmentFormApi$p$0;
  6501. currentInstance["displayNewMessageForm"]=this.$$d_displayNewMessageFormApi;
  6502. currentInstance["displayContactCardAsync"]=this.$$d_displayContactCardAsync
  6503. }
  6504. },
  6505. _getInitialDataResponseHandler$p$0: function(resultCode, data)
  6506. {
  6507. if(resultCode)
  6508. return;
  6509. this.initialize(data);
  6510. this["displayName"]="mailbox";
  6511. window.setTimeout(this.$$d__callAppReadyCallback$p$0,0)
  6512. },
  6513. _callAppReadyCallback$p$0: function()
  6514. {
  6515. this._appReadyCallback$p$0()
  6516. },
  6517. _invokeGetTokenMethodAsync$p$0: function(outlookDispid, methodName, callback, userContext)
  6518. {
  6519. if($h.ScriptHelpers.isNullOrUndefined(callback))
  6520. throw Error.argumentNull("callback");
  6521. var $$t_8=this;
  6522. this.invokeHostMethod(outlookDispid,null,function(resultCode, response)
  6523. {
  6524. var asyncResult;
  6525. if(resultCode)
  6526. asyncResult=$$t_8.createAsyncResult(null,1,9017,userContext,String.format(window["_u"]["ExtensibilityStrings"]["l_InternalProtocolError_Text"],resultCode));
  6527. else
  6528. {
  6529. var responseDictionary=response;
  6530. if(responseDictionary["wasSuccessful"])
  6531. asyncResult=$$t_8.createAsyncResult(responseDictionary["token"],0,0,userContext,null);
  6532. else
  6533. asyncResult=$$t_8.createAsyncResult(null,1,responseDictionary["errorCode"],userContext,responseDictionary["errorMessage"])
  6534. }
  6535. callback(asyncResult)
  6536. })
  6537. },
  6538. _getItem$p$0: function()
  6539. {
  6540. return this._item$p$0
  6541. },
  6542. _getUserProfile$p$0: function()
  6543. {
  6544. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0);
  6545. return this._userProfile$p$0
  6546. },
  6547. _getDiagnostics$p$0: function()
  6548. {
  6549. return this._diagnostics$p$0
  6550. },
  6551. _getEwsUrl$p$0: function()
  6552. {
  6553. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0);
  6554. return this._initialData$p$0.get__ewsUrl$i$0()
  6555. },
  6556. _findOffset$p$0: function(value)
  6557. {
  6558. var ranges=this._initialData$p$0.get__timeZoneOffsets$i$0();
  6559. for(var r=0; r < ranges["length"]; r++)
  6560. {
  6561. var range=ranges[r];
  6562. var start=window["parseInt"](range["start"]);
  6563. var end=window["parseInt"](range["end"]);
  6564. if(value["getTime"]() - start >=0 && value["getTime"]() - end < 0)
  6565. return window["parseInt"](range["offset"])
  6566. }
  6567. throw Error.format(window["_u"]["ExtensibilityStrings"]["l_InvalidDate_Text"]);
  6568. },
  6569. _areStringsLoaded$p$0: function()
  6570. {
  6571. var stringsLoaded=false;
  6572. try
  6573. {
  6574. stringsLoaded=!$h.ScriptHelpers.isNullOrUndefined(window["_u"]["ExtensibilityStrings"]["l_EwsRequestOversized_Text"])
  6575. }
  6576. catch($$e_1){}
  6577. return stringsLoaded
  6578. },
  6579. _loadLocalizedScript$p$0: function(stringLoadedCallback)
  6580. {
  6581. var url=null;
  6582. var baseUrl="";
  6583. var scripts=document.getElementsByTagName("script");
  6584. for(var i=scripts.length - 1; i >=0; i--)
  6585. {
  6586. var filename=null;
  6587. var attributes=scripts[i].attributes;
  6588. if(attributes)
  6589. {
  6590. var attribute=attributes.getNamedItem("src");
  6591. if(attribute)
  6592. filename=attribute.value;
  6593. if(filename)
  6594. {
  6595. var debug=false;
  6596. filename=filename["toLowerCase"]();
  6597. var officeIndex=filename["indexOf"]("office_strings.js");
  6598. if(officeIndex < 0)
  6599. {
  6600. officeIndex=filename["indexOf"]("office_strings.debug.js");
  6601. debug=true
  6602. }
  6603. if(officeIndex > 0 && officeIndex < filename["length"])
  6604. {
  6605. url=filename["replace"](debug ? "office_strings.debug.js" : "office_strings.js","outlook_strings.js");
  6606. var languageUrl=filename["substring"](0,officeIndex);
  6607. var lastIndexOfSlash=languageUrl["lastIndexOf"]("/",languageUrl["length"] - 2);
  6608. if(lastIndexOfSlash===-1)
  6609. lastIndexOfSlash=languageUrl["lastIndexOf"]("\\",languageUrl["length"] - 2);
  6610. if(lastIndexOfSlash !==-1 && languageUrl["length"] > lastIndexOfSlash+1)
  6611. baseUrl=languageUrl["substring"](0,lastIndexOfSlash+1);
  6612. break
  6613. }
  6614. }
  6615. }
  6616. }
  6617. if(url)
  6618. {
  6619. var head=document.getElementsByTagName("head")[0];
  6620. var scriptElement=null;
  6621. var $$t_H=this;
  6622. var scriptElementCallback=function()
  6623. {
  6624. if(stringLoadedCallback && (!scriptElement.readyState || scriptElement.readyState && (scriptElement.readyState==="loaded" || scriptElement.readyState==="complete")))
  6625. {
  6626. scriptElement.onload=null;
  6627. scriptElement.onreadystatechange=null;
  6628. stringLoadedCallback()
  6629. }
  6630. };
  6631. var $$t_I=this;
  6632. var failureCallback=function()
  6633. {
  6634. if(!$$t_I._areStringsLoaded$p$0())
  6635. {
  6636. var fallbackUrl=baseUrl+"en-us/"+"outlook_strings.js";
  6637. scriptElement.onload=null;
  6638. scriptElement.onreadystatechange=null;
  6639. scriptElement=$$t_I._createScriptElement$p$0(fallbackUrl);
  6640. scriptElement.onload=scriptElementCallback;
  6641. scriptElement.onreadystatechange=scriptElementCallback;
  6642. head.appendChild(scriptElement)
  6643. }
  6644. };
  6645. scriptElement=this._createScriptElement$p$0(url);
  6646. scriptElement.onload=scriptElementCallback;
  6647. scriptElement.onreadystatechange=scriptElementCallback;
  6648. window.setTimeout(failureCallback,2e3);
  6649. head.appendChild(scriptElement)
  6650. }
  6651. },
  6652. _createScriptElement$p$0: function(url)
  6653. {
  6654. var scriptElement=document.createElement("script");
  6655. scriptElement.type="text/javascript";
  6656. scriptElement.src=url;
  6657. return scriptElement
  6658. }
  6659. };
  6660. OSF.DDA.OutlookAppOm.prototype.makeEwsRequestAsync=function(data)
  6661. {
  6662. var args=[];
  6663. for(var $$pai_5=1; $$pai_5 < arguments["length"];++$$pai_5)
  6664. args[$$pai_5 - 1]=arguments[$$pai_5];
  6665. if($h.ScriptHelpers.isNullOrUndefined(data))
  6666. throw Error.argumentNull("data");
  6667. if(data["length"] > window["OSF"]["DDA"]["OutlookAppOm"]._maxEwsRequestSize$p)
  6668. throw Error.argument("data",window["_u"]["ExtensibilityStrings"]["l_EwsRequestOversized_Text"]);
  6669. this._throwOnMethodCallForInsufficientPermission$i$0(3,"makeEwsRequestAsync");
  6670. var parameters=$h.CommonParameters.parse(args,true,true);
  6671. var ewsRequest=new $h.EwsRequest(parameters._asyncContext$p$0);
  6672. var $$t_4=this;
  6673. ewsRequest.onreadystatechange=function()
  6674. {
  6675. if(4===ewsRequest.get__requestState$i$1())
  6676. parameters._callback$p$0(ewsRequest._asyncResult$p$0)
  6677. };
  6678. ewsRequest.send(data)
  6679. };
  6680. OSF.DDA.OutlookAppOm.prototype.recordDataPoint=function(data)
  6681. {
  6682. if($h.ScriptHelpers.isNullOrUndefined(data))
  6683. throw Error.argumentNull("data");
  6684. this.invokeHostMethod(402,data,null)
  6685. };
  6686. OSF.DDA.OutlookAppOm.prototype.recordTrace=function(data)
  6687. {
  6688. if($h.ScriptHelpers.isNullOrUndefined(data))
  6689. throw Error.argumentNull("data");
  6690. this.invokeHostMethod(401,data,null)
  6691. };
  6692. OSF.DDA.OutlookAppOm.prototype.trackCtq=function(data)
  6693. {
  6694. if($h.ScriptHelpers.isNullOrUndefined(data))
  6695. throw Error.argumentNull("data");
  6696. this.invokeHostMethod(400,data,null)
  6697. };
  6698. OSF.DDA.OutlookAppOm.prototype.convertToLocalClientTime=function(timeValue)
  6699. {
  6700. var date=new Date(timeValue["getTime"]());
  6701. var offset=date["getTimezoneOffset"]() * -1;
  6702. if(this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0())
  6703. {
  6704. date["setUTCMinutes"](date["getUTCMinutes"]() - offset);
  6705. offset=this._findOffset$p$0(date);
  6706. date["setUTCMinutes"](date["getUTCMinutes"]()+offset)
  6707. }
  6708. var retValue=this._dateToDictionary$i$0(date);
  6709. retValue["timezoneOffset"]=offset;
  6710. return retValue
  6711. };
  6712. OSF.DDA.OutlookAppOm.prototype.convertToUtcClientTime=function(input)
  6713. {
  6714. var retValue=this._dictionaryToDate$i$0(input);
  6715. if(this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0())
  6716. {
  6717. var offset=this._findOffset$p$0(retValue);
  6718. retValue["setUTCMinutes"](retValue["getUTCMinutes"]() - offset);
  6719. offset=!input["timezoneOffset"] ? retValue["getTimezoneOffset"]() * -1 : input["timezoneOffset"];
  6720. retValue["setUTCMinutes"](retValue["getUTCMinutes"]()+offset)
  6721. }
  6722. return retValue
  6723. };
  6724. OSF.DDA.OutlookAppOm.prototype.convertToRestId=function(itemId, restVersion)
  6725. {
  6726. if(!itemId)
  6727. throw Error.argumentNull("itemId");
  6728. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidRestVersion$p(restVersion);
  6729. return itemId["replace"](new RegExp("[/]","g"),"-")["replace"](new RegExp("[+]","g"),"_")
  6730. };
  6731. OSF.DDA.OutlookAppOm.prototype.convertToEwsId=function(itemId, restVersion)
  6732. {
  6733. if(!itemId)
  6734. throw Error.argumentNull("itemId");
  6735. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnInvalidRestVersion$p(restVersion);
  6736. return itemId["replace"](new RegExp("[-]","g"),"/")["replace"](new RegExp("[_]","g"),"+")
  6737. };
  6738. OSF.DDA.OutlookAppOm.prototype.getUserIdentityTokenAsync=function()
  6739. {
  6740. var args=[];
  6741. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  6742. args[$$pai_2]=arguments[$$pai_2];
  6743. this._throwOnMethodCallForInsufficientPermission$i$0(1,"getUserIdentityTokenAsync");
  6744. var parameters=$h.CommonParameters.parse(args,true,true);
  6745. this._invokeGetTokenMethodAsync$p$0(2,"GetUserIdentityToken",parameters._callback$p$0,parameters._asyncContext$p$0)
  6746. };
  6747. OSF.DDA.OutlookAppOm.prototype.getCallbackTokenAsync=function()
  6748. {
  6749. var args=[];
  6750. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  6751. args[$$pai_2]=arguments[$$pai_2];
  6752. this._throwOnMethodCallForInsufficientPermission$i$0(1,"getCallbackTokenAsync");
  6753. var parameters=$h.CommonParameters.parse(args,true,true);
  6754. this._invokeGetTokenMethodAsync$p$0(12,"GetCallbackToken",parameters._callback$p$0,parameters._asyncContext$p$0)
  6755. };
  6756. OSF.DDA.OutlookAppOm.prototype.displayMessageForm=function(itemId)
  6757. {
  6758. if($h.ScriptHelpers.isNullOrUndefined(itemId))
  6759. throw Error.argumentNull("itemId");
  6760. this.invokeHostMethod(8,{itemId: window["OSF"]["DDA"]["OutlookAppOm"].getItemIdBasedOnHost(itemId)},null)
  6761. };
  6762. OSF.DDA.OutlookAppOm.prototype.displayAppointmentForm=function(itemId)
  6763. {
  6764. if($h.ScriptHelpers.isNullOrUndefined(itemId))
  6765. throw Error.argumentNull("itemId");
  6766. this.invokeHostMethod(9,{itemId: window["OSF"]["DDA"]["OutlookAppOm"].getItemIdBasedOnHost(itemId)},null)
  6767. };
  6768. OSF.DDA.OutlookAppOm.prototype.RegisterConsentAsync=function(consentState)
  6769. {
  6770. if(consentState !==2 && consentState !==1 && consentState)
  6771. throw Error.argumentOutOfRange("consentState");
  6772. var parameters={};
  6773. parameters["consentState"]=consentState["toString"]();
  6774. parameters["extensionId"]=this["GetExtensionId"]();
  6775. this.invokeHostMethod(40,parameters,null)
  6776. };
  6777. OSF.DDA.OutlookAppOm.prototype.CloseApp=function()
  6778. {
  6779. this.invokeHostMethod(42,null,null)
  6780. };
  6781. OSF.DDA.OutlookAppOm.prototype.GetIsRead=function()
  6782. {
  6783. return this._initialData$p$0.get__isRead$i$0()
  6784. };
  6785. OSF.DDA.OutlookAppOm.prototype.GetEndNodeUrl=function()
  6786. {
  6787. return this._initialData$p$0.get__endNodeUrl$i$0()
  6788. };
  6789. OSF.DDA.OutlookAppOm.prototype.GetConsentMetadata=function()
  6790. {
  6791. return this._initialData$p$0.get__consentMetadata$i$0()
  6792. };
  6793. OSF.DDA.OutlookAppOm.prototype.GetEntryPointUrl=function()
  6794. {
  6795. return this._initialData$p$0.get__entryPointUrl$i$0()
  6796. };
  6797. OSF.DDA.OutlookAppOm.prototype.GetMarketplaceContentMarket=function()
  6798. {
  6799. return this._initialData$p$0.get__marketplaceContentMarket$i$0()
  6800. };
  6801. OSF.DDA.OutlookAppOm.prototype.GetMarketplaceAssetId=function()
  6802. {
  6803. return this._initialData$p$0.get__marketplaceAssetId$i$0()
  6804. };
  6805. OSF.DDA.OutlookAppOm.prototype.GetExtensionId=function()
  6806. {
  6807. return this._initialData$p$0.get__extensionId$i$0()
  6808. };
  6809. window["OSF"]["DDA"]["Settings"]=OSF.DDA.Settings=function(data)
  6810. {
  6811. this._rawData$p$0=data
  6812. };
  6813. window["OSF"]["DDA"]["Settings"]._convertFromRawSettings$p=function(rawSettings)
  6814. {
  6815. if(!rawSettings)
  6816. return{};
  6817. if(window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.get__appName$i$0()===8)
  6818. {
  6819. var outlookSettings=rawSettings["SettingsKey"];
  6820. if(outlookSettings)
  6821. return OSF.DDA.SettingsManager["deserializeSettings"](outlookSettings)
  6822. }
  6823. return rawSettings
  6824. };
  6825. OSF.DDA.Settings.prototype={
  6826. _rawData$p$0: null,
  6827. _settingsData$p$0: null,
  6828. get__data$p$0: function()
  6829. {
  6830. if(!this._settingsData$p$0)
  6831. {
  6832. this._settingsData$p$0=window["OSF"]["DDA"]["Settings"]._convertFromRawSettings$p(this._rawData$p$0);
  6833. this._rawData$p$0=null
  6834. }
  6835. return this._settingsData$p$0
  6836. },
  6837. _saveSettingsForOutlook$p$0: function(callback, userContext)
  6838. {
  6839. var storedException=null;
  6840. try
  6841. {
  6842. var serializedSettings=OSF.DDA.SettingsManager["serializeSettings"](this.get__data$p$0());
  6843. var jsonSettings=window["JSON"]["stringify"](serializedSettings);
  6844. var settingsObjectToSave={SettingsKey: jsonSettings};
  6845. OSF.DDA.ClientSettingsManager["write"](settingsObjectToSave)
  6846. }
  6847. catch(ex)
  6848. {
  6849. storedException=ex
  6850. }
  6851. if(callback)
  6852. {
  6853. var asyncResult;
  6854. if(storedException)
  6855. asyncResult=window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(null,1,9019,userContext,storedException["message"]);
  6856. else
  6857. asyncResult=window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(null,0,0,userContext,null);
  6858. callback(asyncResult)
  6859. }
  6860. },
  6861. _saveSettingsForOwa$p$0: function(callback, userContext)
  6862. {
  6863. var serializedSettings=OSF.DDA.SettingsManager["serializeSettings"](this.get__data$p$0());
  6864. var $$t_7=this;
  6865. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.invokeHostMethod(404,[serializedSettings],function(resultCode, response)
  6866. {
  6867. if(callback)
  6868. {
  6869. var asyncResult;
  6870. if(resultCode)
  6871. asyncResult=window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(null,1,9017,userContext,String.format(window["_u"]["ExtensibilityStrings"]["l_InternalProtocolError_Text"],resultCode));
  6872. else
  6873. {
  6874. var responseDictionary=response;
  6875. if(!responseDictionary["error"])
  6876. asyncResult=window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(null,0,0,userContext,null);
  6877. else
  6878. asyncResult=window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(null,1,9019,userContext,responseDictionary["errorMessage"])
  6879. }
  6880. callback(asyncResult)
  6881. }
  6882. })
  6883. }
  6884. };
  6885. OSF.DDA.Settings.prototype.get=function(name)
  6886. {
  6887. return this.get__data$p$0()[name]
  6888. };
  6889. OSF.DDA.Settings.prototype.set=function(name, value)
  6890. {
  6891. this.get__data$p$0()[name]=value
  6892. };
  6893. OSF.DDA.Settings.prototype.remove=function(name)
  6894. {
  6895. delete this.get__data$p$0()[name]
  6896. };
  6897. OSF.DDA.Settings.prototype.saveAsync=function()
  6898. {
  6899. var args=[];
  6900. for(var $$pai_4=0; $$pai_4 < arguments["length"];++$$pai_4)
  6901. args[$$pai_4]=arguments[$$pai_4];
  6902. var commonParameters=$h.CommonParameters.parse(args,false);
  6903. if(window["JSON"]["stringify"](OSF.DDA.SettingsManager["serializeSettings"](this.get__data$p$0()))["length"] > 32768)
  6904. {
  6905. var asyncResult=window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(null,1,9019,commonParameters._asyncContext$p$0,"");
  6906. var $$t_3=this;
  6907. window.setTimeout(function()
  6908. {
  6909. commonParameters._callback$p$0(asyncResult)
  6910. },0);
  6911. return
  6912. }
  6913. if(window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.get__appName$i$0()===64)
  6914. this._saveSettingsForOwa$p$0(commonParameters._callback$p$0,commonParameters._asyncContext$p$0);
  6915. else
  6916. this._saveSettingsForOutlook$p$0(commonParameters._callback$p$0,commonParameters._asyncContext$p$0)
  6917. };
  6918. Type.registerNamespace("$h");
  6919. var $h=window.$h || {};
  6920. Type.registerNamespace("Office.cast");
  6921. var Office=window.Office || {};
  6922. Office.cast=Office.cast || {};
  6923. $h.Appointment=function(dataDictionary)
  6924. {
  6925. this.$$d__getOrganizer$p$2=Function.createDelegate(this,this._getOrganizer$p$2);
  6926. this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this,this._getNormalizedSubject$p$2);
  6927. this.$$d__getSubject$p$2=Function.createDelegate(this,this._getSubject$p$2);
  6928. this.$$d__getResources$p$2=Function.createDelegate(this,this._getResources$p$2);
  6929. this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this,this._getRequiredAttendees$p$2);
  6930. this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this,this._getOptionalAttendees$p$2);
  6931. this.$$d__getLocation$p$2=Function.createDelegate(this,this._getLocation$p$2);
  6932. this.$$d__getEnd$p$2=Function.createDelegate(this,this._getEnd$p$2);
  6933. this.$$d__getStart$p$2=Function.createDelegate(this,this._getStart$p$2);
  6934. $h.Appointment.initializeBase(this,[dataDictionary]);
  6935. $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$2);
  6936. $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$2);
  6937. $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$2);
  6938. $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$2);
  6939. $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$2);
  6940. $h.InitialData._defineReadOnlyProperty$i(this,"resources",this.$$d__getResources$p$2);
  6941. $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$2);
  6942. $h.InitialData._defineReadOnlyProperty$i(this,"normalizedSubject",this.$$d__getNormalizedSubject$p$2);
  6943. $h.InitialData._defineReadOnlyProperty$i(this,"organizer",this.$$d__getOrganizer$p$2)
  6944. };
  6945. $h.Appointment.prototype={
  6946. getItemType: function()
  6947. {
  6948. return window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemType"]["Appointment"]
  6949. },
  6950. _getStart$p$2: function()
  6951. {
  6952. return this._data$p$0.get__start$i$0()
  6953. },
  6954. _getEnd$p$2: function()
  6955. {
  6956. return this._data$p$0.get__end$i$0()
  6957. },
  6958. _getLocation$p$2: function()
  6959. {
  6960. return this._data$p$0.get__location$i$0()
  6961. },
  6962. _getOptionalAttendees$p$2: function()
  6963. {
  6964. return this._data$p$0.get__cc$i$0()
  6965. },
  6966. _getRequiredAttendees$p$2: function()
  6967. {
  6968. return this._data$p$0.get__to$i$0()
  6969. },
  6970. _getResources$p$2: function()
  6971. {
  6972. return this._data$p$0.get__resources$i$0()
  6973. },
  6974. _getSubject$p$2: function()
  6975. {
  6976. return this._data$p$0.get__subject$i$0()
  6977. },
  6978. _getNormalizedSubject$p$2: function()
  6979. {
  6980. return this._data$p$0.get__normalizedSubject$i$0()
  6981. },
  6982. _getOrganizer$p$2: function()
  6983. {
  6984. return this._data$p$0.get__organizer$i$0()
  6985. }
  6986. };
  6987. $h.Appointment.prototype.getEntities=function()
  6988. {
  6989. return this._data$p$0._getEntities$i$0()
  6990. };
  6991. $h.Appointment.prototype.getEntitiesByType=function(entityType)
  6992. {
  6993. return this._data$p$0._getEntitiesByType$i$0(entityType)
  6994. };
  6995. $h.Appointment.prototype.getRegExMatches=function()
  6996. {
  6997. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatches");
  6998. return this._data$p$0._getRegExMatches$i$0()
  6999. };
  7000. $h.Appointment.prototype.getFilteredEntitiesByName=function(name)
  7001. {
  7002. return this._data$p$0._getFilteredEntitiesByName$i$0(name)
  7003. };
  7004. $h.Appointment.prototype.getRegExMatchesByName=function(name)
  7005. {
  7006. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatchesByName");
  7007. return this._data$p$0._getRegExMatchesByName$i$0(name)
  7008. };
  7009. $h.Appointment.prototype.displayReplyForm=function(obj)
  7010. {
  7011. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._displayReplyForm$i$0(obj)
  7012. };
  7013. $h.Appointment.prototype.displayReplyAllForm=function(obj)
  7014. {
  7015. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._displayReplyAllForm$i$0(obj)
  7016. };
  7017. $h.AppointmentCompose=function(data)
  7018. {
  7019. this.$$d__getLocation$p$2=Function.createDelegate(this,this._getLocation$p$2);
  7020. this.$$d__getEnd$p$2=Function.createDelegate(this,this._getEnd$p$2);
  7021. this.$$d__getStart$p$2=Function.createDelegate(this,this._getStart$p$2);
  7022. this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this,this._getOptionalAttendees$p$2);
  7023. this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this,this._getRequiredAttendees$p$2);
  7024. $h.AppointmentCompose.initializeBase(this,[data]);
  7025. $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$2);
  7026. $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$2);
  7027. $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$2);
  7028. $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$2);
  7029. $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$2)
  7030. };
  7031. $h.AppointmentCompose.prototype={
  7032. _requiredAttendees$p$2: null,
  7033. _optionalAttendees$p$2: null,
  7034. _start$p$2: null,
  7035. _end$p$2: null,
  7036. _location$p$2: null,
  7037. getItemType: function()
  7038. {
  7039. return window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemType"]["Appointment"]
  7040. },
  7041. _getRequiredAttendees$p$2: function()
  7042. {
  7043. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  7044. if(!this._requiredAttendees$p$2)
  7045. this._requiredAttendees$p$2=new $h.ComposeRecipient(0,"requiredAttendees");
  7046. return this._requiredAttendees$p$2
  7047. },
  7048. _getOptionalAttendees$p$2: function()
  7049. {
  7050. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  7051. if(!this._optionalAttendees$p$2)
  7052. this._optionalAttendees$p$2=new $h.ComposeRecipient(1,"optionalAttendees");
  7053. return this._optionalAttendees$p$2
  7054. },
  7055. _getStart$p$2: function()
  7056. {
  7057. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  7058. if(!this._start$p$2)
  7059. this._start$p$2=new $h.ComposeTime(1);
  7060. return this._start$p$2
  7061. },
  7062. _getEnd$p$2: function()
  7063. {
  7064. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  7065. if(!this._end$p$2)
  7066. this._end$p$2=new $h.ComposeTime(2);
  7067. return this._end$p$2
  7068. },
  7069. _getLocation$p$2: function()
  7070. {
  7071. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  7072. if(!this._location$p$2)
  7073. this._location$p$2=new $h.ComposeLocation;
  7074. return this._location$p$2
  7075. }
  7076. };
  7077. $h.AttachmentConstants=function(){};
  7078. $h.AttachmentDetails=function(data)
  7079. {
  7080. this.$$d__getIsInline$p$0=Function.createDelegate(this,this._getIsInline$p$0);
  7081. this.$$d__getAttachmentType$p$0=Function.createDelegate(this,this._getAttachmentType$p$0);
  7082. this.$$d__getSize$p$0=Function.createDelegate(this,this._getSize$p$0);
  7083. this.$$d__getContentType$p$0=Function.createDelegate(this,this._getContentType$p$0);
  7084. this.$$d__getName$p$0=Function.createDelegate(this,this._getName$p$0);
  7085. this.$$d__getId$p$0=Function.createDelegate(this,this._getId$p$0);
  7086. this._data$p$0=data;
  7087. $h.InitialData._defineReadOnlyProperty$i(this,"id",this.$$d__getId$p$0);
  7088. $h.InitialData._defineReadOnlyProperty$i(this,"name",this.$$d__getName$p$0);
  7089. $h.InitialData._defineReadOnlyProperty$i(this,"contentType",this.$$d__getContentType$p$0);
  7090. $h.InitialData._defineReadOnlyProperty$i(this,"size",this.$$d__getSize$p$0);
  7091. $h.InitialData._defineReadOnlyProperty$i(this,"attachmentType",this.$$d__getAttachmentType$p$0);
  7092. $h.InitialData._defineReadOnlyProperty$i(this,"isInline",this.$$d__getIsInline$p$0)
  7093. };
  7094. $h.AttachmentDetails.prototype={
  7095. _data$p$0: null,
  7096. _getId$p$0: function()
  7097. {
  7098. return this._data$p$0["id"]
  7099. },
  7100. _getName$p$0: function()
  7101. {
  7102. return this._data$p$0["name"]
  7103. },
  7104. _getContentType$p$0: function()
  7105. {
  7106. return this._data$p$0["contentType"]
  7107. },
  7108. _getSize$p$0: function()
  7109. {
  7110. return this._data$p$0["size"]
  7111. },
  7112. _getAttachmentType$p$0: function()
  7113. {
  7114. var response=this._data$p$0["attachmentType"];
  7115. return response < $h.AttachmentDetails._attachmentTypeMap$p["length"] ? $h.AttachmentDetails._attachmentTypeMap$p[response] : window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["AttachmentType"]["File"]
  7116. },
  7117. _getIsInline$p$0: function()
  7118. {
  7119. return this._data$p$0["isInline"]
  7120. }
  7121. };
  7122. $h.Body=function(){};
  7123. $h.Body._tryMapToHostCoercionType$i=function(coercionType, hostCoercionType)
  7124. {
  7125. hostCoercionType.val=undefined;
  7126. if(coercionType===window["Microsoft"]["Office"]["WebExtension"]["CoercionType"]["Html"])
  7127. hostCoercionType.val=3;
  7128. else if(coercionType===window["Microsoft"]["Office"]["WebExtension"]["CoercionType"]["Text"])
  7129. hostCoercionType.val=0;
  7130. else
  7131. return false;
  7132. return true
  7133. };
  7134. $h.Body.prototype.getAsync=function(coercionType)
  7135. {
  7136. var args=[];
  7137. for(var $$pai_7=1; $$pai_7 < arguments["length"];++$$pai_7)
  7138. args[$$pai_7 - 1]=arguments[$$pai_7];
  7139. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"body.getAsync");
  7140. var commonParameters=$h.CommonParameters.parse(args,true);
  7141. var hostCoercionType;
  7142. var $$t_5,
  7143. $$t_6;
  7144. if(!($$t_6=$h.Body._tryMapToHostCoercionType$i(coercionType,$$t_5={val: hostCoercionType}),hostCoercionType=$$t_5["val"],$$t_6))
  7145. throw Error.argument("coercionType");
  7146. var dataToHost={coercionType: hostCoercionType};
  7147. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(37,dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  7148. };
  7149. $h.ComposeBody=function()
  7150. {
  7151. $h.ComposeBody.initializeBase(this)
  7152. };
  7153. $h.ComposeBody._createParameterDictionaryToHost$i=function(data, parameters)
  7154. {
  7155. var dataToHost={data: data};
  7156. if(parameters._options$p$0 && !$h.ScriptHelpers.isNull(parameters._options$p$0["coercionType"]))
  7157. {
  7158. var hostCoercionType;
  7159. var $$t_4,
  7160. $$t_5;
  7161. if(!($$t_5=$h.Body._tryMapToHostCoercionType$i(parameters._options$p$0["coercionType"],$$t_4={val: hostCoercionType}),hostCoercionType=$$t_4["val"],$$t_5))
  7162. {
  7163. if(parameters._callback$p$0)
  7164. parameters._callback$p$0(window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(null,1,1e3,parameters._asyncContext$p$0,null));
  7165. return null
  7166. }
  7167. dataToHost["coercionType"]=hostCoercionType
  7168. }
  7169. else
  7170. dataToHost["coercionType"]=0;
  7171. return dataToHost
  7172. };
  7173. $h.ComposeBody.prototype.getTypeAsync=function()
  7174. {
  7175. var args=[];
  7176. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  7177. args[$$pai_2]=arguments[$$pai_2];
  7178. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"body.getTypeAsync");
  7179. var parameters=$h.CommonParameters.parse(args,true);
  7180. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(14,null,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7181. };
  7182. $h.ComposeBody.prototype.setSelectedDataAsync=function(data)
  7183. {
  7184. var args=[];
  7185. for(var $$pai_4=1; $$pai_4 < arguments["length"];++$$pai_4)
  7186. args[$$pai_4 - 1]=arguments[$$pai_4];
  7187. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.setSelectedDataAsync");
  7188. var parameters=$h.CommonParameters.parse(args,false);
  7189. if(!String.isInstanceOfType(data))
  7190. throw Error.argumentType("data",Object["getType"](data),String);
  7191. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(data["length"],0,1e6,"data");
  7192. var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters);
  7193. if(!dataToHost)
  7194. return;
  7195. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(13,dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7196. };
  7197. $h.ComposeBody.prototype.prependAsync=function(data)
  7198. {
  7199. var args=[];
  7200. for(var $$pai_4=1; $$pai_4 < arguments["length"];++$$pai_4)
  7201. args[$$pai_4 - 1]=arguments[$$pai_4];
  7202. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.prependAsync");
  7203. var parameters=$h.CommonParameters.parse(args,false);
  7204. if(!String.isInstanceOfType(data))
  7205. throw Error.argumentType("data",Object["getType"](data),String);
  7206. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(data["length"],0,1e6,"data");
  7207. var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters);
  7208. if(!dataToHost)
  7209. return;
  7210. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(23,dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7211. };
  7212. $h.ComposeBody.prototype.setAsync=function(data)
  7213. {
  7214. var args=[];
  7215. for(var $$pai_4=1; $$pai_4 < arguments["length"];++$$pai_4)
  7216. args[$$pai_4 - 1]=arguments[$$pai_4];
  7217. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.setAsync");
  7218. var parameters=$h.CommonParameters.parse(args,false);
  7219. if(!String.isInstanceOfType(data))
  7220. throw Error.argumentType("data",Object["getType"](data),String);
  7221. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(data["length"],0,1e6,"data");
  7222. var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters);
  7223. if(!dataToHost)
  7224. return;
  7225. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(38,dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7226. };
  7227. $h.ComposeItem=function(data)
  7228. {
  7229. this.$$d__getBody$p$1=Function.createDelegate(this,this._getBody$p$1);
  7230. this.$$d__getSubject$p$1=Function.createDelegate(this,this._getSubject$p$1);
  7231. $h.ComposeItem.initializeBase(this,[data]);
  7232. $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$1);
  7233. $h.InitialData._defineReadOnlyProperty$i(this,"body",this.$$d__getBody$p$1)
  7234. };
  7235. $h.ComposeItem.prototype={
  7236. _subject$p$1: null,
  7237. _body$p$1: null,
  7238. _getBody$p$1: function()
  7239. {
  7240. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  7241. if(!this._body$p$1)
  7242. this._body$p$1=new $h.ComposeBody;
  7243. return this._body$p$1
  7244. },
  7245. _getSubject$p$1: function()
  7246. {
  7247. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  7248. if(!this._subject$p$1)
  7249. this._subject$p$1=new $h.ComposeSubject;
  7250. return this._subject$p$1
  7251. }
  7252. };
  7253. $h.ComposeItem.prototype.addFileAttachmentAsync=function(uri, attachmentName)
  7254. {
  7255. var args=[];
  7256. for(var $$pai_5=2; $$pai_5 < arguments["length"];++$$pai_5)
  7257. args[$$pai_5 - 2]=arguments[$$pai_5];
  7258. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addFileAttachmentAsync");
  7259. if(!$h.ScriptHelpers.isNonEmptyString(uri))
  7260. throw Error.argument("uri");
  7261. if(!$h.ScriptHelpers.isNonEmptyString(attachmentName))
  7262. throw Error.argument("attachmentName");
  7263. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(uri["length"],0,2048,"uri");
  7264. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(attachmentName["length"],0,255,"attachmentName");
  7265. var commonParameters=$h.CommonParameters.parse(args,false);
  7266. var parameters={
  7267. uri: uri,
  7268. name: attachmentName,
  7269. __timeout__: 6e5
  7270. };
  7271. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(16,parameters,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  7272. };
  7273. $h.ComposeItem.prototype.addItemAttachmentAsync=function(itemId, attachmentName)
  7274. {
  7275. var args=[];
  7276. for(var $$pai_5=2; $$pai_5 < arguments["length"];++$$pai_5)
  7277. args[$$pai_5 - 2]=arguments[$$pai_5];
  7278. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addItemAttachmentAsync");
  7279. if(!$h.ScriptHelpers.isNonEmptyString(itemId))
  7280. throw Error.argument("itemId");
  7281. if(!$h.ScriptHelpers.isNonEmptyString(attachmentName))
  7282. throw Error.argument("attachmentName");
  7283. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(itemId["length"],0,200,"itemId");
  7284. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(attachmentName["length"],0,255,"attachmentName");
  7285. var commonParameters=$h.CommonParameters.parse(args,false);
  7286. var parameters={
  7287. itemId: window["OSF"]["DDA"]["OutlookAppOm"].getItemIdBasedOnHost(itemId),
  7288. name: attachmentName,
  7289. __timeout__: 6e5
  7290. };
  7291. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(19,parameters,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  7292. };
  7293. $h.ComposeItem.prototype.removeAttachmentAsync=function(attachmentId)
  7294. {
  7295. var args=[];
  7296. for(var $$pai_3=1; $$pai_3 < arguments["length"];++$$pai_3)
  7297. args[$$pai_3 - 1]=arguments[$$pai_3];
  7298. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"removeAttachmentAsync");
  7299. if(!$h.ScriptHelpers.isNonEmptyString(attachmentId))
  7300. throw Error.argument("attachmentId");
  7301. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(attachmentId["length"],0,200,"attachmentId");
  7302. var commonParameters=$h.CommonParameters.parse(args,false);
  7303. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(20,{attachmentIndex: attachmentId},null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  7304. };
  7305. $h.ComposeItem.prototype.getSelectedDataAsync=function(coercionType)
  7306. {
  7307. var args=[];
  7308. for(var $$pai_7=1; $$pai_7 < arguments["length"];++$$pai_7)
  7309. args[$$pai_7 - 1]=arguments[$$pai_7];
  7310. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getSelectedDataAsync");
  7311. var commonParameters=$h.CommonParameters.parse(args,true);
  7312. var hostCoercionType;
  7313. var $$t_5,
  7314. $$t_6;
  7315. if(coercionType !==window["Microsoft"]["Office"]["WebExtension"]["CoercionType"]["Html"] && coercionType !==window["Microsoft"]["Office"]["WebExtension"]["CoercionType"]["Text"] || !($$t_6=$h.Body._tryMapToHostCoercionType$i(coercionType,$$t_5={val: hostCoercionType}),hostCoercionType=$$t_5["val"],$$t_6))
  7316. throw Error.argument("coercionType");
  7317. var dataToHost={coercionType: hostCoercionType};
  7318. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(28,dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  7319. };
  7320. $h.ComposeItem.prototype.setSelectedDataAsync=function(data)
  7321. {
  7322. var args=[];
  7323. for(var $$pai_4=1; $$pai_4 < arguments["length"];++$$pai_4)
  7324. args[$$pai_4 - 1]=arguments[$$pai_4];
  7325. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"setSelectedDataAsync");
  7326. var parameters=$h.CommonParameters.parse(args,false);
  7327. if(!String.isInstanceOfType(data))
  7328. throw Error.argumentType("data",Object["getType"](data),String);
  7329. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(data["length"],0,1e6,"data");
  7330. var dataToHost=$h.ComposeBody._createParameterDictionaryToHost$i(data,parameters);
  7331. if(!dataToHost)
  7332. return;
  7333. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(29,dataToHost,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7334. };
  7335. $h.ComposeItem.prototype.close=function()
  7336. {
  7337. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(41,null,null,null,null)
  7338. };
  7339. $h.ComposeItem.prototype.saveAsync=function()
  7340. {
  7341. var args=[];
  7342. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  7343. args[$$pai_2]=arguments[$$pai_2];
  7344. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"saveAsync");
  7345. var parameters=$h.CommonParameters.parse(args,false);
  7346. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(32,null,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7347. };
  7348. $h.ComposeRecipient=function(type, propertyName)
  7349. {
  7350. this._type$p$0=type;
  7351. this._propertyName$p$0=propertyName
  7352. };
  7353. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p=function(displayName, emailAddress)
  7354. {
  7355. if(!displayName && !emailAddress)
  7356. throw Error.argument("recipients");
  7357. if(displayName && displayName["length"] > 255)
  7358. throw Error.argumentOutOfRange("recipients",displayName["length"],window["_u"]["ExtensibilityStrings"]["l_DisplayNameTooLong_Text"]);
  7359. if(emailAddress && emailAddress["length"] > 571)
  7360. throw Error.argumentOutOfRange("recipients",emailAddress["length"],window["_u"]["ExtensibilityStrings"]["l_EmailAddressTooLong_Text"]);
  7361. };
  7362. $h.ComposeRecipient._getAsyncFormatter$p=function(rawInput)
  7363. {
  7364. var input=rawInput;
  7365. var output=[];
  7366. for(var i=0; i < input["length"]; i++)
  7367. {
  7368. var email=new $h.EmailAddressDetails(input[i]);
  7369. output[i]=email
  7370. }
  7371. return output
  7372. };
  7373. $h.ComposeRecipient._createEmailDictionaryForHost$p=function(address, name)
  7374. {
  7375. return{
  7376. address: address,
  7377. name: name
  7378. }
  7379. };
  7380. $h.ComposeRecipient.prototype={
  7381. _propertyName$p$0: null,
  7382. _type$p$0: 0,
  7383. setAddHelper: function(recipients, args, isSet)
  7384. {
  7385. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(recipients["length"],0,100,"recipients");
  7386. var parameters=$h.CommonParameters.parse(args,false);
  7387. var recipientData=[];
  7388. if(Array.isInstanceOfType(recipients))
  7389. for(var i=0; i < recipients["length"]; i++)
  7390. if(String.isInstanceOfType(recipients[i]))
  7391. {
  7392. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(recipients[i],recipients[i]);
  7393. recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(recipients[i],recipients[i])
  7394. }
  7395. else if($h.EmailAddressDetails.isInstanceOfType(recipients[i]))
  7396. {
  7397. var address=recipients[i];
  7398. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(address["displayName"],address["emailAddress"]);
  7399. recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(address["emailAddress"],address["displayName"])
  7400. }
  7401. else if(Object.isInstanceOfType(recipients[i]))
  7402. {
  7403. var input=recipients[i];
  7404. var emailAddress=input["emailAddress"];
  7405. var displayName=input["displayName"];
  7406. $h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(displayName,emailAddress);
  7407. recipientData[i]=$h.ComposeRecipient._createEmailDictionaryForHost$p(emailAddress,displayName)
  7408. }
  7409. else
  7410. throw Error.argument("recipients");
  7411. else
  7412. throw Error.argument("recipients");
  7413. var $$t_B=this;
  7414. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(isSet ? 21 : 22,{
  7415. recipientField: this._type$p$0,
  7416. recipientArray: recipientData
  7417. },function(rawInput)
  7418. {
  7419. return rawInput
  7420. },parameters._asyncContext$p$0,parameters._callback$p$0)
  7421. }
  7422. };
  7423. $h.ComposeRecipient.prototype.getAsync=function()
  7424. {
  7425. var args=[];
  7426. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  7427. args[$$pai_2]=arguments[$$pai_2];
  7428. var parameters=$h.CommonParameters.parse(args,true);
  7429. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,this._propertyName$p$0+".getAsync");
  7430. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(15,{recipientField: this._type$p$0},$h.ComposeRecipient._getAsyncFormatter$p,parameters._asyncContext$p$0,parameters._callback$p$0)
  7431. };
  7432. $h.ComposeRecipient.prototype.setAsync=function(recipients)
  7433. {
  7434. var args=[];
  7435. for(var $$pai_2=1; $$pai_2 < arguments["length"];++$$pai_2)
  7436. args[$$pai_2 - 1]=arguments[$$pai_2];
  7437. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".setAsync");
  7438. this.setAddHelper(recipients,args,true)
  7439. };
  7440. $h.ComposeRecipient.prototype.addAsync=function(recipients)
  7441. {
  7442. var args=[];
  7443. for(var $$pai_2=1; $$pai_2 < arguments["length"];++$$pai_2)
  7444. args[$$pai_2 - 1]=arguments[$$pai_2];
  7445. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".addAsync");
  7446. this.setAddHelper(recipients,args,false)
  7447. };
  7448. $h.ComposeRecipient.RecipientField=function(){};
  7449. $h.ComposeRecipient.RecipientField.prototype={
  7450. to: 0,
  7451. cc: 1,
  7452. bcc: 2,
  7453. requiredAttendees: 0,
  7454. optionalAttendees: 1
  7455. };
  7456. $h.ComposeRecipient.RecipientField.registerEnum("$h.ComposeRecipient.RecipientField",false);
  7457. $h.ComposeLocation=function(){};
  7458. $h.ComposeLocation.prototype.getAsync=function()
  7459. {
  7460. var args=[];
  7461. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  7462. args[$$pai_2]=arguments[$$pai_2];
  7463. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"location.getAsync");
  7464. var parameters=$h.CommonParameters.parse(args,true);
  7465. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(26,null,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7466. };
  7467. $h.ComposeLocation.prototype.setAsync=function(location)
  7468. {
  7469. var args=[];
  7470. for(var $$pai_3=1; $$pai_3 < arguments["length"];++$$pai_3)
  7471. args[$$pai_3 - 1]=arguments[$$pai_3];
  7472. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"location.setAsync");
  7473. var parameters=$h.CommonParameters.parse(args,false);
  7474. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(location["length"],0,255,"location");
  7475. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(27,{location: location},null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7476. };
  7477. $h.ComposeSubject=function(){};
  7478. $h.ComposeSubject.prototype.getAsync=function()
  7479. {
  7480. var args=[];
  7481. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  7482. args[$$pai_2]=arguments[$$pai_2];
  7483. var parameters=$h.CommonParameters.parse(args,true);
  7484. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"subject.getAsync");
  7485. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(18,null,null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7486. };
  7487. $h.ComposeSubject.prototype.setAsync=function(data)
  7488. {
  7489. var args=[];
  7490. for(var $$pai_3=1; $$pai_3 < arguments["length"];++$$pai_3)
  7491. args[$$pai_3 - 1]=arguments[$$pai_3];
  7492. var parameters=$h.CommonParameters.parse(args,false);
  7493. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"subject.setAsync");
  7494. if(!String.isInstanceOfType(data))
  7495. throw Error.argument("data");
  7496. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(data["length"],0,255,"data");
  7497. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(17,{subject: data},null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7498. };
  7499. $h.ComposeTime=function(type)
  7500. {
  7501. this.$$d__ticksToDateFormatter$p$0=Function.createDelegate(this,this._ticksToDateFormatter$p$0);
  7502. this._timeType$p$0=type
  7503. };
  7504. $h.ComposeTime.prototype={
  7505. _timeType$p$0: 0,
  7506. _ticksToDateFormatter$p$0: function(rawInput)
  7507. {
  7508. var ticks=rawInput;
  7509. return new Date(ticks)
  7510. },
  7511. _getPropertyName$p$0: function()
  7512. {
  7513. return this._timeType$p$0===1 ? "start" : "end"
  7514. }
  7515. };
  7516. $h.ComposeTime.prototype.getAsync=function()
  7517. {
  7518. var args=[];
  7519. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  7520. args[$$pai_2]=arguments[$$pai_2];
  7521. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,this._getPropertyName$p$0()+".getAsync");
  7522. var parameters=$h.CommonParameters.parse(args,true);
  7523. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(24,{TimeProperty: this._timeType$p$0},this.$$d__ticksToDateFormatter$p$0,parameters._asyncContext$p$0,parameters._callback$p$0)
  7524. };
  7525. $h.ComposeTime.prototype.setAsync=function(dateTime)
  7526. {
  7527. var args=[];
  7528. for(var $$pai_3=1; $$pai_3 < arguments["length"];++$$pai_3)
  7529. args[$$pai_3 - 1]=arguments[$$pai_3];
  7530. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._getPropertyName$p$0()+".setAsync");
  7531. if(!Date.isInstanceOfType(dateTime))
  7532. throw Error.argumentType("dateTime",Object["getType"](dateTime),Date);
  7533. if(window["isNaN"](dateTime["getTime"]()))
  7534. throw Error.argument("dateTime");
  7535. if(dateTime["getTime"]() < -864e13 || dateTime["getTime"]() > 864e13)
  7536. throw Error.argumentOutOfRange("dateTime");
  7537. var parameters=$h.CommonParameters.parse(args,false);
  7538. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(25,{
  7539. TimeProperty: this._timeType$p$0,
  7540. time: dateTime["getTime"]()
  7541. },null,parameters._asyncContext$p$0,parameters._callback$p$0)
  7542. };
  7543. $h.ComposeTime.TimeType=function(){};
  7544. $h.ComposeTime.TimeType.prototype={
  7545. start: 1,
  7546. end: 2
  7547. };
  7548. $h.ComposeTime.TimeType.registerEnum("$h.ComposeTime.TimeType",false);
  7549. $h.Contact=function(data)
  7550. {
  7551. this.$$d__getContactString$p$0=Function.createDelegate(this,this._getContactString$p$0);
  7552. this.$$d__getAddresses$p$0=Function.createDelegate(this,this._getAddresses$p$0);
  7553. this.$$d__getUrls$p$0=Function.createDelegate(this,this._getUrls$p$0);
  7554. this.$$d__getEmailAddresses$p$0=Function.createDelegate(this,this._getEmailAddresses$p$0);
  7555. this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this,this._getPhoneNumbers$p$0);
  7556. this.$$d__getBusinessName$p$0=Function.createDelegate(this,this._getBusinessName$p$0);
  7557. this.$$d__getPersonName$p$0=Function.createDelegate(this,this._getPersonName$p$0);
  7558. this._data$p$0=data;
  7559. $h.InitialData._defineReadOnlyProperty$i(this,"personName",this.$$d__getPersonName$p$0);
  7560. $h.InitialData._defineReadOnlyProperty$i(this,"businessName",this.$$d__getBusinessName$p$0);
  7561. $h.InitialData._defineReadOnlyProperty$i(this,"phoneNumbers",this.$$d__getPhoneNumbers$p$0);
  7562. $h.InitialData._defineReadOnlyProperty$i(this,"emailAddresses",this.$$d__getEmailAddresses$p$0);
  7563. $h.InitialData._defineReadOnlyProperty$i(this,"urls",this.$$d__getUrls$p$0);
  7564. $h.InitialData._defineReadOnlyProperty$i(this,"addresses",this.$$d__getAddresses$p$0);
  7565. $h.InitialData._defineReadOnlyProperty$i(this,"contactString",this.$$d__getContactString$p$0)
  7566. };
  7567. $h.Contact.prototype={
  7568. _data$p$0: null,
  7569. _phoneNumbers$p$0: null,
  7570. _getPersonName$p$0: function()
  7571. {
  7572. return this._data$p$0["PersonName"]
  7573. },
  7574. _getBusinessName$p$0: function()
  7575. {
  7576. return this._data$p$0["BusinessName"]
  7577. },
  7578. _getAddresses$p$0: function()
  7579. {
  7580. return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"Addresses")
  7581. },
  7582. _getEmailAddresses$p$0: function()
  7583. {
  7584. return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"EmailAddresses")
  7585. },
  7586. _getUrls$p$0: function()
  7587. {
  7588. return $h.Entities._getExtractedStringProperty$i(this._data$p$0,"Urls")
  7589. },
  7590. _getPhoneNumbers$p$0: function()
  7591. {
  7592. if(!this._phoneNumbers$p$0)
  7593. {
  7594. var $$t_1=this;
  7595. this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber,this._data$p$0,"PhoneNumbers",function(data)
  7596. {
  7597. return new $h.PhoneNumber(data)
  7598. })
  7599. }
  7600. return this._phoneNumbers$p$0
  7601. },
  7602. _getContactString$p$0: function()
  7603. {
  7604. return this._data$p$0["ContactString"]
  7605. }
  7606. };
  7607. $h.CustomProperties=function(data)
  7608. {
  7609. if($h.ScriptHelpers.isNullOrUndefined(data))
  7610. throw Error.argumentNull("data");
  7611. if(Array.isInstanceOfType(data))
  7612. {
  7613. var customPropertiesArray=data;
  7614. if(customPropertiesArray["length"] > 0)
  7615. this._data$p$0=customPropertiesArray[0];
  7616. else
  7617. throw Error.argument("data");
  7618. }
  7619. else
  7620. this._data$p$0=data
  7621. };
  7622. $h.CustomProperties.prototype={_data$p$0: null};
  7623. $h.CustomProperties.prototype.get=function(name)
  7624. {
  7625. var value=this._data$p$0[name];
  7626. if(typeof value==="string")
  7627. {
  7628. var valueString=value;
  7629. if(valueString["length"] > 6 && valueString.startsWith("Date(") && valueString.endsWith(")"))
  7630. {
  7631. var ticksString=valueString["substring"](5,valueString["length"] - 1);
  7632. var ticks=window["parseInt"](ticksString);
  7633. if(!window["isNaN"](ticks))
  7634. {
  7635. var dateTimeValue=new Date(ticks);
  7636. if(dateTimeValue)
  7637. value=dateTimeValue
  7638. }
  7639. }
  7640. }
  7641. return value
  7642. };
  7643. $h.CustomProperties.prototype.set=function(name, value)
  7644. {
  7645. if(window["OSF"]["OUtil"]["isDate"](value))
  7646. value="Date("+value["getTime"]()+")";
  7647. this._data$p$0[name]=value
  7648. };
  7649. $h.CustomProperties.prototype.remove=function(name)
  7650. {
  7651. delete this._data$p$0[name]
  7652. };
  7653. $h.CustomProperties.prototype.saveAsync=function()
  7654. {
  7655. var args=[];
  7656. for(var $$pai_4=0; $$pai_4 < arguments["length"];++$$pai_4)
  7657. args[$$pai_4]=arguments[$$pai_4];
  7658. var MaxCustomPropertiesLength=2500;
  7659. if(window["JSON"]["stringify"](this._data$p$0)["length"] > MaxCustomPropertiesLength)
  7660. throw Error.argument();
  7661. var parameters=$h.CommonParameters.parse(args,false,true);
  7662. var saveCustomProperties=new $h.SaveDictionaryRequest(parameters._callback$p$0,parameters._asyncContext$p$0);
  7663. saveCustomProperties._sendRequest$i$0(4,"SaveCustomProperties",{customProperties: this._data$p$0})
  7664. };
  7665. $h.Diagnostics=function(data, appName)
  7666. {
  7667. this.$$d__getOwaView$p$0=Function.createDelegate(this,this._getOwaView$p$0);
  7668. this.$$d__getHostVersion$p$0=Function.createDelegate(this,this._getHostVersion$p$0);
  7669. this.$$d__getHostName$p$0=Function.createDelegate(this,this._getHostName$p$0);
  7670. this._data$p$0=data;
  7671. this._appName$p$0=appName;
  7672. $h.InitialData._defineReadOnlyProperty$i(this,"hostName",this.$$d__getHostName$p$0);
  7673. $h.InitialData._defineReadOnlyProperty$i(this,"hostVersion",this.$$d__getHostVersion$p$0);
  7674. if(64===this._appName$p$0)
  7675. $h.InitialData._defineReadOnlyProperty$i(this,"OWAView",this.$$d__getOwaView$p$0)
  7676. };
  7677. $h.Diagnostics.prototype={
  7678. _data$p$0: null,
  7679. _appName$p$0: 0,
  7680. _getHostName$p$0: function()
  7681. {
  7682. if(8===this._appName$p$0)
  7683. return"Outlook";
  7684. else if(64===this._appName$p$0)
  7685. return"OutlookWebApp";
  7686. return null
  7687. },
  7688. _getHostVersion$p$0: function()
  7689. {
  7690. return this._data$p$0.get__hostVersion$i$0()
  7691. },
  7692. _getOwaView$p$0: function()
  7693. {
  7694. return this._data$p$0.get__owaView$i$0()
  7695. }
  7696. };
  7697. $h.EmailAddressDetails=function(data)
  7698. {
  7699. this.$$d__getRecipientType$p$0=Function.createDelegate(this,this._getRecipientType$p$0);
  7700. this.$$d__getAppointmentResponse$p$0=Function.createDelegate(this,this._getAppointmentResponse$p$0);
  7701. this.$$d__getDisplayName$p$0=Function.createDelegate(this,this._getDisplayName$p$0);
  7702. this.$$d__getEmailAddress$p$0=Function.createDelegate(this,this._getEmailAddress$p$0);
  7703. this._data$p$0=data;
  7704. $h.InitialData._defineReadOnlyProperty$i(this,"emailAddress",this.$$d__getEmailAddress$p$0);
  7705. $h.InitialData._defineReadOnlyProperty$i(this,"displayName",this.$$d__getDisplayName$p$0);
  7706. if($h.ScriptHelpers.dictionaryContainsKey(data,"appointmentResponse"))
  7707. $h.InitialData._defineReadOnlyProperty$i(this,"appointmentResponse",this.$$d__getAppointmentResponse$p$0);
  7708. if($h.ScriptHelpers.dictionaryContainsKey(data,"recipientType"))
  7709. $h.InitialData._defineReadOnlyProperty$i(this,"recipientType",this.$$d__getRecipientType$p$0)
  7710. };
  7711. $h.EmailAddressDetails._createFromEmailUserDictionary$i=function(data)
  7712. {
  7713. var emailAddressDetailsDictionary={};
  7714. var displayName=data["Name"];
  7715. var emailAddress=data["UserId"];
  7716. emailAddressDetailsDictionary["name"]=displayName || $h.EmailAddressDetails._emptyString$p;
  7717. emailAddressDetailsDictionary["address"]=emailAddress || $h.EmailAddressDetails._emptyString$p;
  7718. return new $h.EmailAddressDetails(emailAddressDetailsDictionary)
  7719. };
  7720. $h.EmailAddressDetails.prototype={
  7721. _data$p$0: null,
  7722. _getEmailAddress$p$0: function()
  7723. {
  7724. return this._data$p$0["address"]
  7725. },
  7726. _getDisplayName$p$0: function()
  7727. {
  7728. return this._data$p$0["name"]
  7729. },
  7730. _getAppointmentResponse$p$0: function()
  7731. {
  7732. var response=this._data$p$0["appointmentResponse"];
  7733. return response < $h.EmailAddressDetails._responseTypeMap$p["length"] ? $h.EmailAddressDetails._responseTypeMap$p[response] : window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ResponseType"]["None"]
  7734. },
  7735. _getRecipientType$p$0: function()
  7736. {
  7737. var response=this._data$p$0["recipientType"];
  7738. return response < $h.EmailAddressDetails._recipientTypeMap$p["length"] ? $h.EmailAddressDetails._recipientTypeMap$p[response] : window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RecipientType"]["Other"]
  7739. }
  7740. };
  7741. $h.EmailAddressDetails.prototype.toJSON=function()
  7742. {
  7743. var result={};
  7744. result["emailAddress"]=this._getEmailAddress$p$0();
  7745. result["displayName"]=this._getDisplayName$p$0();
  7746. if($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0,"appointmentResponse"))
  7747. result["appointmentResponse"]=this._getAppointmentResponse$p$0();
  7748. if($h.ScriptHelpers.dictionaryContainsKey(this._data$p$0,"recipientType"))
  7749. result["recipientType"]=this._getRecipientType$p$0();
  7750. return result
  7751. };
  7752. $h.Entities=function(data, filteredEntitiesData, timeSent, permissionLevel)
  7753. {
  7754. this.$$d__createMeetingSuggestion$p$0=Function.createDelegate(this,this._createMeetingSuggestion$p$0);
  7755. this.$$d__getParcelDeliveries$p$0=Function.createDelegate(this,this._getParcelDeliveries$p$0);
  7756. this.$$d__getFlightReservations$p$0=Function.createDelegate(this,this._getFlightReservations$p$0);
  7757. this.$$d__getContacts$p$0=Function.createDelegate(this,this._getContacts$p$0);
  7758. this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this,this._getPhoneNumbers$p$0);
  7759. this.$$d__getUrls$p$0=Function.createDelegate(this,this._getUrls$p$0);
  7760. this.$$d__getEmailAddresses$p$0=Function.createDelegate(this,this._getEmailAddresses$p$0);
  7761. this.$$d__getMeetingSuggestions$p$0=Function.createDelegate(this,this._getMeetingSuggestions$p$0);
  7762. this.$$d__getTaskSuggestions$p$0=Function.createDelegate(this,this._getTaskSuggestions$p$0);
  7763. this.$$d__getAddresses$p$0=Function.createDelegate(this,this._getAddresses$p$0);
  7764. this._data$p$0=data || {};
  7765. this._filteredData$p$0=filteredEntitiesData || {};
  7766. this._dateTimeSent$p$0=timeSent;
  7767. $h.InitialData._defineReadOnlyProperty$i(this,"addresses",this.$$d__getAddresses$p$0);
  7768. $h.InitialData._defineReadOnlyProperty$i(this,"taskSuggestions",this.$$d__getTaskSuggestions$p$0);
  7769. $h.InitialData._defineReadOnlyProperty$i(this,"meetingSuggestions",this.$$d__getMeetingSuggestions$p$0);
  7770. $h.InitialData._defineReadOnlyProperty$i(this,"emailAddresses",this.$$d__getEmailAddresses$p$0);
  7771. $h.InitialData._defineReadOnlyProperty$i(this,"urls",this.$$d__getUrls$p$0);
  7772. $h.InitialData._defineReadOnlyProperty$i(this,"phoneNumbers",this.$$d__getPhoneNumbers$p$0);
  7773. $h.InitialData._defineReadOnlyProperty$i(this,"contacts",this.$$d__getContacts$p$0);
  7774. $h.InitialData._defineReadOnlyProperty$i(this,"flightReservations",this.$$d__getFlightReservations$p$0);
  7775. $h.InitialData._defineReadOnlyProperty$i(this,"parcelDeliveries",this.$$d__getParcelDeliveries$p$0);
  7776. this._permissionLevel$p$0=permissionLevel
  7777. };
  7778. $h.Entities._getExtractedObjects$i=function(T, data, name, creator, removeDuplicates, stringPropertyName)
  7779. {
  7780. var results=null;
  7781. var extractedObjects=data[name];
  7782. if(!extractedObjects)
  7783. return new Array(0);
  7784. if(removeDuplicates)
  7785. extractedObjects=$h.Entities._removeDuplicate$p(Object,extractedObjects,$h.Entities._entityDictionaryEquals$p,stringPropertyName);
  7786. results=new Array(extractedObjects["length"]);
  7787. var count=0;
  7788. for(var $$arr_9=extractedObjects, $$len_A=$$arr_9["length"], $$idx_B=0; $$idx_B < $$len_A;++$$idx_B)
  7789. {
  7790. var extractedObject=$$arr_9[$$idx_B];
  7791. if(creator)
  7792. results[count++]=creator(extractedObject);
  7793. else
  7794. results[count++]=extractedObject
  7795. }
  7796. return results
  7797. };
  7798. $h.Entities._getExtractedStringProperty$i=function(data, name, removeDuplicate)
  7799. {
  7800. var extractedProperties=data[name];
  7801. if(!extractedProperties)
  7802. return new Array(0);
  7803. if(removeDuplicate)
  7804. extractedProperties=$h.Entities._removeDuplicate$p(String,extractedProperties,$h.Entities._stringEquals$p,null);
  7805. return extractedProperties
  7806. };
  7807. $h.Entities._createContact$p=function(data)
  7808. {
  7809. return new $h.Contact(data)
  7810. };
  7811. $h.Entities._createTaskSuggestion$p=function(data)
  7812. {
  7813. return new $h.TaskSuggestion(data)
  7814. };
  7815. $h.Entities._createPhoneNumber$p=function(data)
  7816. {
  7817. return new $h.PhoneNumber(data)
  7818. };
  7819. $h.Entities._entityDictionaryEquals$p=function(dictionary1, dictionary2, entityPropertyIdentifier)
  7820. {
  7821. if(dictionary1===dictionary2)
  7822. return true;
  7823. if(!dictionary1 || !dictionary2)
  7824. return false;
  7825. if(dictionary1[entityPropertyIdentifier]===dictionary2[entityPropertyIdentifier])
  7826. return true;
  7827. return false
  7828. };
  7829. $h.Entities._stringEquals$p=function(string1, string2, entityProperty)
  7830. {
  7831. return string1===string2
  7832. };
  7833. $h.Entities._removeDuplicate$p=function(T, array, entityEquals, entityPropertyIdentifier)
  7834. {
  7835. for(var matchIndex1=array["length"] - 1; matchIndex1 >=0; matchIndex1--)
  7836. {
  7837. var removeMatch=false;
  7838. for(var matchIndex2=matchIndex1 - 1; matchIndex2 >=0; matchIndex2--)
  7839. if(entityEquals(array[matchIndex1],array[matchIndex2],entityPropertyIdentifier))
  7840. {
  7841. removeMatch=true;
  7842. break
  7843. }
  7844. if(removeMatch)
  7845. Array.removeAt(array,matchIndex1)
  7846. }
  7847. return array
  7848. };
  7849. $h.Entities.prototype={
  7850. _dateTimeSent$p$0: null,
  7851. _data$p$0: null,
  7852. _filteredData$p$0: null,
  7853. _filteredEntitiesCache$p$0: null,
  7854. _permissionLevel$p$0: 0,
  7855. _taskSuggestions$p$0: null,
  7856. _meetingSuggestions$p$0: null,
  7857. _phoneNumbers$p$0: null,
  7858. _contacts$p$0: null,
  7859. _addresses$p$0: null,
  7860. _emailAddresses$p$0: null,
  7861. _urls$p$0: null,
  7862. _flightReservations$p$0: null,
  7863. _parcelDeliveries$p$0: null,
  7864. _getByType$i$0: function(entityType)
  7865. {
  7866. if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["MeetingSuggestion"])
  7867. return this._getMeetingSuggestions$p$0();
  7868. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["TaskSuggestion"])
  7869. return this._getTaskSuggestions$p$0();
  7870. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["Address"])
  7871. return this._getAddresses$p$0();
  7872. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["PhoneNumber"])
  7873. return this._getPhoneNumbers$p$0();
  7874. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["EmailAddress"])
  7875. return this._getEmailAddresses$p$0();
  7876. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["Url"])
  7877. return this._getUrls$p$0();
  7878. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["Contact"])
  7879. return this._getContacts$p$0();
  7880. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["FlightReservations"])
  7881. return this._getFlightReservations$p$0();
  7882. else if(entityType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["EntityType"]["ParcelDeliveries"])
  7883. return this._getParcelDeliveries$p$0();
  7884. return null
  7885. },
  7886. _getFilteredEntitiesByName$i$0: function(name)
  7887. {
  7888. if(!this._filteredEntitiesCache$p$0)
  7889. this._filteredEntitiesCache$p$0={};
  7890. if(!$h.ScriptHelpers.dictionaryContainsKey(this._filteredEntitiesCache$p$0,name))
  7891. {
  7892. var found=false;
  7893. for(var i=0; i < $h.Entities._allEntityKeys$p["length"]; i++)
  7894. {
  7895. var entityTypeKey=$h.Entities._allEntityKeys$p[i];
  7896. var perEntityTypeDictionary=this._filteredData$p$0[entityTypeKey];
  7897. if(!perEntityTypeDictionary)
  7898. continue;
  7899. if($h.ScriptHelpers.dictionaryContainsKey(perEntityTypeDictionary,name))
  7900. {
  7901. switch(entityTypeKey)
  7902. {
  7903. case"EmailAddresses":
  7904. case"Urls":
  7905. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary,name);
  7906. break;
  7907. case"Addresses":
  7908. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary,name,true);
  7909. break;
  7910. case"PhoneNumbers":
  7911. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.PhoneNumber,perEntityTypeDictionary,name,$h.Entities._createPhoneNumber$p,false,null);
  7912. break;
  7913. case"TaskSuggestions":
  7914. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.TaskSuggestion,perEntityTypeDictionary,name,$h.Entities._createTaskSuggestion$p,true,"TaskString");
  7915. break;
  7916. case"MeetingSuggestions":
  7917. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion,perEntityTypeDictionary,name,this.$$d__createMeetingSuggestion$p$0,true,"MeetingString");
  7918. break;
  7919. case"Contacts":
  7920. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.Contact,perEntityTypeDictionary,name,$h.Entities._createContact$p,true,"ContactString");
  7921. break
  7922. }
  7923. found=true;
  7924. break
  7925. }
  7926. }
  7927. if(!found)
  7928. this._filteredEntitiesCache$p$0[name]=null
  7929. }
  7930. return this._filteredEntitiesCache$p$0[name]
  7931. },
  7932. _createMeetingSuggestion$p$0: function(data)
  7933. {
  7934. return new $h.MeetingSuggestion(data,this._dateTimeSent$p$0)
  7935. },
  7936. _getAddresses$p$0: function()
  7937. {
  7938. if(!this._addresses$p$0)
  7939. this._addresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"Addresses",true);
  7940. return this._addresses$p$0
  7941. },
  7942. _getEmailAddresses$p$0: function()
  7943. {
  7944. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  7945. if(!this._emailAddresses$p$0)
  7946. this._emailAddresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"EmailAddresses",false);
  7947. return this._emailAddresses$p$0
  7948. },
  7949. _getUrls$p$0: function()
  7950. {
  7951. if(!this._urls$p$0)
  7952. this._urls$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0,"Urls",false);
  7953. return this._urls$p$0
  7954. },
  7955. _getPhoneNumbers$p$0: function()
  7956. {
  7957. if(!this._phoneNumbers$p$0)
  7958. this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber,this._data$p$0,"PhoneNumbers",$h.Entities._createPhoneNumber$p);
  7959. return this._phoneNumbers$p$0
  7960. },
  7961. _getTaskSuggestions$p$0: function()
  7962. {
  7963. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  7964. if(!this._taskSuggestions$p$0)
  7965. this._taskSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.TaskSuggestion,this._data$p$0,"TaskSuggestions",$h.Entities._createTaskSuggestion$p,true,"TaskString");
  7966. return this._taskSuggestions$p$0
  7967. },
  7968. _getMeetingSuggestions$p$0: function()
  7969. {
  7970. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  7971. if(!this._meetingSuggestions$p$0)
  7972. this._meetingSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion,this._data$p$0,"MeetingSuggestions",this.$$d__createMeetingSuggestion$p$0,true,"MeetingString");
  7973. return this._meetingSuggestions$p$0
  7974. },
  7975. _getContacts$p$0: function()
  7976. {
  7977. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  7978. if(!this._contacts$p$0)
  7979. this._contacts$p$0=$h.Entities._getExtractedObjects$i($h.Contact,this._data$p$0,"Contacts",$h.Entities._createContact$p,true,"ContactString");
  7980. return this._contacts$p$0
  7981. },
  7982. _getParcelDeliveries$p$0: function()
  7983. {
  7984. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  7985. if(!this._parcelDeliveries$p$0)
  7986. this._parcelDeliveries$p$0=$h.Entities._getExtractedObjects$i(Object,this._data$p$0,"ParcelDeliveries",null);
  7987. return this._parcelDeliveries$p$0
  7988. },
  7989. _getFlightReservations$p$0: function()
  7990. {
  7991. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  7992. if(!this._flightReservations$p$0)
  7993. this._flightReservations$p$0=$h.Entities._getExtractedObjects$i(Object,this._data$p$0,"FlightReservations",null);
  7994. return this._flightReservations$p$0
  7995. }
  7996. };
  7997. $h.ReplyConstants=function(){};
  7998. $h.AsyncConstants=function(){};
  7999. window["Office"]["cast"]["item"]=Office.cast.item=function(){};
  8000. window["Office"]["cast"]["item"]["toItemRead"]=function(item)
  8001. {
  8002. if($h.Item.isInstanceOfType(item))
  8003. return item;
  8004. throw Error.argumentType();
  8005. };
  8006. window["Office"]["cast"]["item"]["toItemCompose"]=function(item)
  8007. {
  8008. if($h.ComposeItem.isInstanceOfType(item))
  8009. return item;
  8010. throw Error.argumentType();
  8011. };
  8012. window["Office"]["cast"]["item"]["toMessage"]=function(item)
  8013. {
  8014. return window["Office"]["cast"]["item"]["toMessageRead"](item)
  8015. };
  8016. window["Office"]["cast"]["item"]["toMessageRead"]=function(item)
  8017. {
  8018. if($h.Message.isInstanceOfType(item))
  8019. return item;
  8020. throw Error.argumentType();
  8021. };
  8022. window["Office"]["cast"]["item"]["toMessageCompose"]=function(item)
  8023. {
  8024. if($h.MessageCompose.isInstanceOfType(item))
  8025. return item;
  8026. throw Error.argumentType();
  8027. };
  8028. window["Office"]["cast"]["item"]["toMeetingRequest"]=function(item)
  8029. {
  8030. if($h.MeetingRequest.isInstanceOfType(item))
  8031. return item;
  8032. throw Error.argumentType();
  8033. };
  8034. window["Office"]["cast"]["item"]["toAppointment"]=function(item)
  8035. {
  8036. return window["Office"]["cast"]["item"]["toAppointmentRead"](item)
  8037. };
  8038. window["Office"]["cast"]["item"]["toAppointmentRead"]=function(item)
  8039. {
  8040. if($h.Appointment.isInstanceOfType(item))
  8041. return item;
  8042. throw Error.argumentType();
  8043. };
  8044. window["Office"]["cast"]["item"]["toAppointmentCompose"]=function(item)
  8045. {
  8046. if($h.AppointmentCompose.isInstanceOfType(item))
  8047. return item;
  8048. throw Error.argumentType();
  8049. };
  8050. $h.Item=function(data)
  8051. {
  8052. this.$$d__getBody$p$1=Function.createDelegate(this,this._getBody$p$1);
  8053. this.$$d__getAttachments$p$1=Function.createDelegate(this,this._getAttachments$p$1);
  8054. this.$$d__getItemClass$p$1=Function.createDelegate(this,this._getItemClass$p$1);
  8055. this.$$d__getItemId$p$1=Function.createDelegate(this,this._getItemId$p$1);
  8056. this.$$d__getDateTimeModified$p$1=Function.createDelegate(this,this._getDateTimeModified$p$1);
  8057. this.$$d__getDateTimeCreated$p$1=Function.createDelegate(this,this._getDateTimeCreated$p$1);
  8058. $h.Item.initializeBase(this,[data]);
  8059. $h.InitialData._defineReadOnlyProperty$i(this,"dateTimeCreated",this.$$d__getDateTimeCreated$p$1);
  8060. $h.InitialData._defineReadOnlyProperty$i(this,"dateTimeModified",this.$$d__getDateTimeModified$p$1);
  8061. $h.InitialData._defineReadOnlyProperty$i(this,"itemId",this.$$d__getItemId$p$1);
  8062. $h.InitialData._defineReadOnlyProperty$i(this,"itemClass",this.$$d__getItemClass$p$1);
  8063. $h.InitialData._defineReadOnlyProperty$i(this,"attachments",this.$$d__getAttachments$p$1);
  8064. $h.InitialData._defineReadOnlyProperty$i(this,"body",this.$$d__getBody$p$1)
  8065. };
  8066. $h.Item.prototype={
  8067. _body$p$1: null,
  8068. _getItemId$p$1: function()
  8069. {
  8070. return this._data$p$0.get__itemId$i$0()
  8071. },
  8072. _getItemClass$p$1: function()
  8073. {
  8074. return this._data$p$0.get__itemClass$i$0()
  8075. },
  8076. _getDateTimeCreated$p$1: function()
  8077. {
  8078. return this._data$p$0.get__dateTimeCreated$i$0()
  8079. },
  8080. _getDateTimeModified$p$1: function()
  8081. {
  8082. return this._data$p$0.get__dateTimeModified$i$0()
  8083. },
  8084. _getAttachments$p$1: function()
  8085. {
  8086. return this._data$p$0.get__attachments$i$0()
  8087. },
  8088. _getBody$p$1: function()
  8089. {
  8090. if(!this._body$p$1)
  8091. this._body$p$1=new $h.Body;
  8092. return this._body$p$1
  8093. }
  8094. };
  8095. $h.ItemBase=function(data)
  8096. {
  8097. this.$$d__createCustomProperties$i$0=Function.createDelegate(this,this._createCustomProperties$i$0);
  8098. this.$$d__getNotificationMessages$p$0=Function.createDelegate(this,this._getNotificationMessages$p$0);
  8099. this.$$d_getItemType=Function.createDelegate(this,this.getItemType);
  8100. this._data$p$0=data;
  8101. $h.InitialData._defineReadOnlyProperty$i(this,"itemType",this.$$d_getItemType);
  8102. $h.InitialData._defineReadOnlyProperty$i(this,"notificationMessages",this.$$d__getNotificationMessages$p$0)
  8103. };
  8104. $h.ItemBase.prototype={
  8105. _data$p$0: null,
  8106. _notificationMessages$p$0: null,
  8107. get_data: function()
  8108. {
  8109. return this._data$p$0
  8110. },
  8111. _createCustomProperties$i$0: function(data)
  8112. {
  8113. return new $h.CustomProperties(data)
  8114. },
  8115. _getNotificationMessages$p$0: function()
  8116. {
  8117. if(!this._notificationMessages$p$0)
  8118. this._notificationMessages$p$0=new $h.NotificationMessages;
  8119. return this._notificationMessages$p$0
  8120. }
  8121. };
  8122. $h.ItemBase.prototype.loadCustomPropertiesAsync=function()
  8123. {
  8124. var args=[];
  8125. for(var $$pai_3=0; $$pai_3 < arguments["length"];++$$pai_3)
  8126. args[$$pai_3]=arguments[$$pai_3];
  8127. var parameters=$h.CommonParameters.parse(args,true,true);
  8128. var loadCustomProperties=new $h._loadDictionaryRequest(this.$$d__createCustomProperties$i$0,"customProperties",parameters._callback$p$0,parameters._asyncContext$p$0);
  8129. loadCustomProperties._sendRequest$i$0(3,"LoadCustomProperties",{})
  8130. };
  8131. $h.MeetingRequest=function(data)
  8132. {
  8133. this.$$d__getRequiredAttendees$p$3=Function.createDelegate(this,this._getRequiredAttendees$p$3);
  8134. this.$$d__getOptionalAttendees$p$3=Function.createDelegate(this,this._getOptionalAttendees$p$3);
  8135. this.$$d__getLocation$p$3=Function.createDelegate(this,this._getLocation$p$3);
  8136. this.$$d__getEnd$p$3=Function.createDelegate(this,this._getEnd$p$3);
  8137. this.$$d__getStart$p$3=Function.createDelegate(this,this._getStart$p$3);
  8138. $h.MeetingRequest.initializeBase(this,[data]);
  8139. $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$3);
  8140. $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$3);
  8141. $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$3);
  8142. $h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$3);
  8143. $h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$3)
  8144. };
  8145. $h.MeetingRequest.prototype={
  8146. _getStart$p$3: function()
  8147. {
  8148. return this._data$p$0.get__start$i$0()
  8149. },
  8150. _getEnd$p$3: function()
  8151. {
  8152. return this._data$p$0.get__end$i$0()
  8153. },
  8154. _getLocation$p$3: function()
  8155. {
  8156. return this._data$p$0.get__location$i$0()
  8157. },
  8158. _getOptionalAttendees$p$3: function()
  8159. {
  8160. return this._data$p$0.get__cc$i$0()
  8161. },
  8162. _getRequiredAttendees$p$3: function()
  8163. {
  8164. return this._data$p$0.get__to$i$0()
  8165. }
  8166. };
  8167. $h.MeetingSuggestion=function(data, dateTimeSent)
  8168. {
  8169. this.$$d__getEndTime$p$0=Function.createDelegate(this,this._getEndTime$p$0);
  8170. this.$$d__getStartTime$p$0=Function.createDelegate(this,this._getStartTime$p$0);
  8171. this.$$d__getSubject$p$0=Function.createDelegate(this,this._getSubject$p$0);
  8172. this.$$d__getLocation$p$0=Function.createDelegate(this,this._getLocation$p$0);
  8173. this.$$d__getAttendees$p$0=Function.createDelegate(this,this._getAttendees$p$0);
  8174. this.$$d__getMeetingString$p$0=Function.createDelegate(this,this._getMeetingString$p$0);
  8175. this._data$p$0=data;
  8176. this._dateTimeSent$p$0=dateTimeSent;
  8177. $h.InitialData._defineReadOnlyProperty$i(this,"meetingString",this.$$d__getMeetingString$p$0);
  8178. $h.InitialData._defineReadOnlyProperty$i(this,"attendees",this.$$d__getAttendees$p$0);
  8179. $h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$0);
  8180. $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$0);
  8181. $h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStartTime$p$0);
  8182. $h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEndTime$p$0)
  8183. };
  8184. $h.MeetingSuggestion.prototype={
  8185. _dateTimeSent$p$0: null,
  8186. _data$p$0: null,
  8187. _attendees$p$0: null,
  8188. _getMeetingString$p$0: function()
  8189. {
  8190. return this._data$p$0["MeetingString"]
  8191. },
  8192. _getLocation$p$0: function()
  8193. {
  8194. return this._data$p$0["Location"]
  8195. },
  8196. _getSubject$p$0: function()
  8197. {
  8198. return this._data$p$0["Subject"]
  8199. },
  8200. _getStartTime$p$0: function()
  8201. {
  8202. var time=this._createDateTimeFromParameter$p$0("StartTime");
  8203. var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time,this._dateTimeSent$p$0);
  8204. if(resolvedTime["getTime"]() !==time["getTime"]())
  8205. return window["OSF"]["DDA"]["OutlookAppOm"]._instance$p["convertToUtcClientTime"](window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._dateToDictionary$i$0(resolvedTime));
  8206. return time
  8207. },
  8208. _getEndTime$p$0: function()
  8209. {
  8210. var time=this._createDateTimeFromParameter$p$0("EndTime");
  8211. var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time,this._dateTimeSent$p$0);
  8212. if(resolvedTime["getTime"]() !==time["getTime"]())
  8213. return window["OSF"]["DDA"]["OutlookAppOm"]._instance$p["convertToUtcClientTime"](window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._dateToDictionary$i$0(resolvedTime));
  8214. return time
  8215. },
  8216. _createDateTimeFromParameter$p$0: function(keyName)
  8217. {
  8218. var dateTimeString=this._data$p$0[keyName];
  8219. if(!dateTimeString)
  8220. return null;
  8221. return new Date(dateTimeString)
  8222. },
  8223. _getAttendees$p$0: function()
  8224. {
  8225. if(!this._attendees$p$0)
  8226. {
  8227. var $$t_1=this;
  8228. this._attendees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails,this._data$p$0,"Attendees",function(data)
  8229. {
  8230. return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data)
  8231. })
  8232. }
  8233. return this._attendees$p$0
  8234. }
  8235. };
  8236. $h.MeetingSuggestionTimeDecoder=function(){};
  8237. $h.MeetingSuggestionTimeDecoder.resolve=function(inTime, sentTime)
  8238. {
  8239. if(!sentTime)
  8240. return inTime;
  8241. try
  8242. {
  8243. var tod;
  8244. var outDate;
  8245. var extractedDate;
  8246. var sentDate=new Date(sentTime["getFullYear"](),sentTime["getMonth"](),sentTime["getDate"](),0,0,0,0);
  8247. var $$t_7,
  8248. $$t_8,
  8249. $$t_9;
  8250. 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))
  8251. return inTime;
  8252. else
  8253. {
  8254. if($h._preciseDate.isInstanceOfType(extractedDate))
  8255. outDate=$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p(sentDate,extractedDate);
  8256. else if($h._relativeDate.isInstanceOfType(extractedDate))
  8257. outDate=$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p(sentDate,extractedDate);
  8258. else
  8259. outDate=sentDate;
  8260. if(window["isNaN"](outDate["getTime"]()))
  8261. return sentTime;
  8262. outDate["setMilliseconds"](outDate["getMilliseconds"]()+tod);
  8263. return outDate
  8264. }
  8265. }
  8266. catch($$e_6)
  8267. {
  8268. return sentTime
  8269. }
  8270. };
  8271. $h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i=function(value)
  8272. {
  8273. return null===value || value===undefined
  8274. };
  8275. $h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p=function(sentDate, precise)
  8276. {
  8277. var year=precise._year$i$1;
  8278. var month=!precise._month$i$1 ? sentDate["getMonth"]() : precise._month$i$1 - 1;
  8279. var day=precise._day$i$1;
  8280. if(!day)
  8281. return sentDate;
  8282. var candidate;
  8283. if($h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year))
  8284. {
  8285. candidate=new Date(sentDate["getFullYear"](),month,day);
  8286. if(candidate["getTime"]() < sentDate["getTime"]())
  8287. candidate=new Date(sentDate["getFullYear"]()+1,month,day)
  8288. }
  8289. else
  8290. candidate=new Date(year < 50 ? 2e3+year : 1900+year,month,day);
  8291. if(candidate["getMonth"]() !==month)
  8292. return sentDate;
  8293. return candidate
  8294. };
  8295. $h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p=function(sentDate, relative)
  8296. {
  8297. var date;
  8298. switch(relative._unit$i$1)
  8299. {
  8300. case 0:
  8301. date=new Date(sentDate["getFullYear"](),sentDate["getMonth"](),sentDate["getDate"]());
  8302. date["setDate"](date["getDate"]()+relative._offset$i$1);
  8303. return date;
  8304. case 5:
  8305. return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p(sentDate,relative._offset$i$1,relative._tag$i$1);
  8306. case 2:
  8307. var days=1;
  8308. switch(relative._modifier$i$1)
  8309. {
  8310. case 1:
  8311. break;
  8312. case 2:
  8313. days=16;
  8314. break;
  8315. default:
  8316. if(!relative._offset$i$1)
  8317. days=sentDate["getDate"]();
  8318. break
  8319. }
  8320. date=new Date(sentDate["getFullYear"](),sentDate["getMonth"](),days);
  8321. date["setMonth"](date["getMonth"]()+relative._offset$i$1);
  8322. if(date["getTime"]() < sentDate["getTime"]())
  8323. date["setDate"](date["getDate"]()+sentDate["getDate"]() - 1);
  8324. return date;
  8325. case 1:
  8326. date=new Date(sentDate["getFullYear"](),sentDate["getMonth"](),sentDate["getDate"]());
  8327. date["setDate"](sentDate["getDate"]()+7 * relative._offset$i$1);
  8328. if(relative._modifier$i$1===1 || !relative._modifier$i$1)
  8329. {
  8330. date["setDate"](date["getDate"]()+1 - date["getDay"]());
  8331. if(date["getTime"]() < sentDate["getTime"]())
  8332. return sentDate;
  8333. return date
  8334. }
  8335. else if(relative._modifier$i$1===2)
  8336. {
  8337. date["setDate"](date["getDate"]()+5 - date["getDay"]());
  8338. return date
  8339. }
  8340. break;
  8341. case 4:
  8342. return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p(sentDate,relative);
  8343. case 3:
  8344. if(relative._offset$i$1 > 0)
  8345. return new Date(sentDate["getFullYear"]()+relative._offset$i$1,0,1);
  8346. break;
  8347. default:
  8348. break
  8349. }
  8350. return sentDate
  8351. };
  8352. $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p=function(sentDate, offset, tag)
  8353. {
  8354. if(offset > -5 && offset < 5)
  8355. {
  8356. var dayOfWeek;
  8357. var days;
  8358. dayOfWeek=(tag+6) % 7+1;
  8359. days=7 * offset+(dayOfWeek - sentDate["getDay"]());
  8360. sentDate["setDate"](sentDate["getDate"]()+days);
  8361. return sentDate
  8362. }
  8363. else
  8364. {
  8365. var days=(tag - sentDate["getDay"]()) % 7;
  8366. if(days < 0)
  8367. days+=7;
  8368. sentDate["setDate"](sentDate["getDate"]()+days);
  8369. return sentDate
  8370. }
  8371. };
  8372. $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p=function(sentDate, relative)
  8373. {
  8374. var date;
  8375. var firstDay;
  8376. var newDate;
  8377. date=sentDate;
  8378. if(relative._tag$i$1 <=0 || relative._tag$i$1 > 12 || relative._offset$i$1 <=0 || relative._offset$i$1 > 5)
  8379. return sentDate;
  8380. var monthOffset=(12+relative._tag$i$1 - date["getMonth"]() - 1) % 12;
  8381. firstDay=new Date(date["getFullYear"](),date["getMonth"]()+monthOffset,1);
  8382. if(relative._modifier$i$1===1)
  8383. if(relative._offset$i$1===1 && firstDay["getDay"]() !==6 && firstDay["getDay"]())
  8384. return firstDay;
  8385. else
  8386. {
  8387. newDate=new Date(firstDay["getFullYear"](),firstDay["getMonth"](),firstDay["getDate"]());
  8388. newDate["setDate"](newDate["getDate"]()+(7+(1 - firstDay["getDay"]())) % 7);
  8389. if(firstDay["getDay"]() !==6 && firstDay["getDay"]() && firstDay["getDay"]() !==1)
  8390. newDate["setDate"](newDate["getDate"]() - 7);
  8391. newDate["setDate"](newDate["getDate"]()+7 * (relative._offset$i$1 - 1));
  8392. if(newDate["getMonth"]()+1 !==relative._tag$i$1)
  8393. return sentDate;
  8394. return newDate
  8395. }
  8396. else
  8397. {
  8398. newDate=new Date(firstDay["getFullYear"](),firstDay["getMonth"](),$h.MeetingSuggestionTimeDecoder._daysInMonth$p(firstDay["getMonth"](),firstDay["getFullYear"]()));
  8399. var offset=1 - newDate["getDay"]();
  8400. if(offset > 0)
  8401. offset=offset - 7;
  8402. newDate["setDate"](newDate["getDate"]()+offset);
  8403. newDate["setDate"](newDate["getDate"]()+7 * (1 - relative._offset$i$1));
  8404. if(newDate["getMonth"]()+1 !==relative._tag$i$1)
  8405. if(firstDay["getDay"]() !==6 && firstDay["getDay"]())
  8406. return firstDay;
  8407. else
  8408. return sentDate;
  8409. else
  8410. return newDate
  8411. }
  8412. };
  8413. $h.MeetingSuggestionTimeDecoder._decode$p=function(inDate, date, time)
  8414. {
  8415. var DateValueMask=32767;
  8416. date.val=null;
  8417. time.val=0;
  8418. if(!inDate)
  8419. return false;
  8420. time.val=$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p(inDate);
  8421. var inDateAtMidnight=inDate["getTime"]() - time.val;
  8422. var value=(inDateAtMidnight - $h.MeetingSuggestionTimeDecoder._baseDate$p["getTime"]()) / 864e5;
  8423. if(value < 0)
  8424. return false;
  8425. else if(value >=262144)
  8426. return false;
  8427. else
  8428. {
  8429. var type=value >> 15;
  8430. value=value & DateValueMask;
  8431. switch(type)
  8432. {
  8433. case 0:
  8434. return $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p(value,date);
  8435. case 1:
  8436. return $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p(value,date);
  8437. default:
  8438. return false
  8439. }
  8440. }
  8441. };
  8442. $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p=function(value, date)
  8443. {
  8444. var c_SubTypeMask=7;
  8445. var c_MonthMask=15;
  8446. var c_DayMask=31;
  8447. var c_YearMask=127;
  8448. var year=null;
  8449. var month=0;
  8450. var day=0;
  8451. date.val=null;
  8452. var subType=value >> 12 & c_SubTypeMask;
  8453. if((subType & 4)===4)
  8454. {
  8455. year=value >> 5 & c_YearMask;
  8456. if((subType & 2)===2)
  8457. {
  8458. if((subType & 1)===1)
  8459. return false;
  8460. month=value >> 1 & c_MonthMask
  8461. }
  8462. }
  8463. else
  8464. {
  8465. if((subType & 2)===2)
  8466. month=value >> 8 & c_MonthMask;
  8467. if((subType & 1)===1)
  8468. day=value >> 3 & c_DayMask
  8469. }
  8470. date.val=new $h._preciseDate(day,month,year);
  8471. return true
  8472. };
  8473. $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p=function(value, date)
  8474. {
  8475. var TagMask=15;
  8476. var OffsetMask=63;
  8477. var UnitMask=7;
  8478. var ModifierMask=3;
  8479. var tag=value & TagMask;
  8480. value >>=4;
  8481. var offset=$h.MeetingSuggestionTimeDecoder._fromComplement$p(value & OffsetMask,6);
  8482. value >>=6;
  8483. var unit=value & UnitMask;
  8484. value >>=3;
  8485. var modifier=value & ModifierMask;
  8486. try
  8487. {
  8488. date.val=new $h._relativeDate(modifier,offset,unit,tag);
  8489. return true
  8490. }
  8491. catch($$e_A)
  8492. {
  8493. date.val=null;
  8494. return false
  8495. }
  8496. };
  8497. $h.MeetingSuggestionTimeDecoder._fromComplement$p=function(value, n)
  8498. {
  8499. var signed=1 << n - 1;
  8500. var mask=(1 << n) - 1;
  8501. if((value & signed)===signed)
  8502. return-((value ^ mask)+1);
  8503. else
  8504. return value
  8505. };
  8506. $h.MeetingSuggestionTimeDecoder._daysInMonth$p=function(month, year)
  8507. {
  8508. return 32 - new Date(year,month,32)["getDate"]()
  8509. };
  8510. $h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p=function(inputTime)
  8511. {
  8512. var timeOfDay=0;
  8513. timeOfDay+=inputTime["getUTCHours"]() * 3600;
  8514. timeOfDay+=inputTime["getUTCMinutes"]() * 60;
  8515. timeOfDay+=inputTime["getUTCSeconds"]();
  8516. timeOfDay *=1e3;
  8517. timeOfDay+=inputTime["getUTCMilliseconds"]();
  8518. return timeOfDay
  8519. };
  8520. $h._extractedDate=function(){};
  8521. $h._preciseDate=function(day, month, year)
  8522. {
  8523. $h._preciseDate.initializeBase(this);
  8524. if(day < 0 || day > 31)
  8525. throw Error.argumentOutOfRange("day");
  8526. if(month < 0 || month > 12)
  8527. throw Error.argumentOutOfRange("month");
  8528. this._day$i$1=day;
  8529. this._month$i$1=month;
  8530. if(!$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year))
  8531. {
  8532. if(!month && day)
  8533. throw Error.argument("Invalid arguments");
  8534. if(year < 0 || year > 2099)
  8535. throw Error.argumentOutOfRange("year");
  8536. this._year$i$1=year % 100
  8537. }
  8538. else if(!this._month$i$1 && !this._day$i$1)
  8539. throw Error.argument("Invalid datetime");
  8540. };
  8541. $h._preciseDate.prototype={
  8542. _day$i$1: 0,
  8543. _month$i$1: 0,
  8544. _year$i$1: null
  8545. };
  8546. $h._relativeDate=function(modifier, offset, unit, tag)
  8547. {
  8548. $h._relativeDate.initializeBase(this);
  8549. if(offset < -32 || offset > 31)
  8550. throw Error.argumentOutOfRange("offset");
  8551. if(tag < 0 || tag > 15)
  8552. throw Error.argumentOutOfRange("tag");
  8553. if(!unit && offset < 0)
  8554. throw Error.argument("unit & offset do not form a valid date");
  8555. this._modifier$i$1=modifier;
  8556. this._offset$i$1=offset;
  8557. this._unit$i$1=unit;
  8558. this._tag$i$1=tag
  8559. };
  8560. $h._relativeDate.prototype={
  8561. _modifier$i$1: 0,
  8562. _offset$i$1: 0,
  8563. _unit$i$1: 0,
  8564. _tag$i$1: 0
  8565. };
  8566. $h.Message=function(dataDictionary)
  8567. {
  8568. this.$$d__getConversationId$p$2=Function.createDelegate(this,this._getConversationId$p$2);
  8569. this.$$d__getInternetMessageId$p$2=Function.createDelegate(this,this._getInternetMessageId$p$2);
  8570. this.$$d__getCc$p$2=Function.createDelegate(this,this._getCc$p$2);
  8571. this.$$d__getTo$p$2=Function.createDelegate(this,this._getTo$p$2);
  8572. this.$$d__getFrom$p$2=Function.createDelegate(this,this._getFrom$p$2);
  8573. this.$$d__getSender$p$2=Function.createDelegate(this,this._getSender$p$2);
  8574. this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this,this._getNormalizedSubject$p$2);
  8575. this.$$d__getSubject$p$2=Function.createDelegate(this,this._getSubject$p$2);
  8576. $h.Message.initializeBase(this,[dataDictionary]);
  8577. $h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$2);
  8578. $h.InitialData._defineReadOnlyProperty$i(this,"normalizedSubject",this.$$d__getNormalizedSubject$p$2);
  8579. $h.InitialData._defineReadOnlyProperty$i(this,"sender",this.$$d__getSender$p$2);
  8580. $h.InitialData._defineReadOnlyProperty$i(this,"from",this.$$d__getFrom$p$2);
  8581. $h.InitialData._defineReadOnlyProperty$i(this,"to",this.$$d__getTo$p$2);
  8582. $h.InitialData._defineReadOnlyProperty$i(this,"cc",this.$$d__getCc$p$2);
  8583. $h.InitialData._defineReadOnlyProperty$i(this,"internetMessageId",this.$$d__getInternetMessageId$p$2);
  8584. $h.InitialData._defineReadOnlyProperty$i(this,"conversationId",this.$$d__getConversationId$p$2)
  8585. };
  8586. $h.Message.prototype={
  8587. getItemType: function()
  8588. {
  8589. return window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemType"]["Message"]
  8590. },
  8591. _getSubject$p$2: function()
  8592. {
  8593. return this._data$p$0.get__subject$i$0()
  8594. },
  8595. _getNormalizedSubject$p$2: function()
  8596. {
  8597. return this._data$p$0.get__normalizedSubject$i$0()
  8598. },
  8599. _getSender$p$2: function()
  8600. {
  8601. return this._data$p$0.get__sender$i$0()
  8602. },
  8603. _getFrom$p$2: function()
  8604. {
  8605. return this._data$p$0.get__from$i$0()
  8606. },
  8607. _getTo$p$2: function()
  8608. {
  8609. return this._data$p$0.get__to$i$0()
  8610. },
  8611. _getCc$p$2: function()
  8612. {
  8613. return this._data$p$0.get__cc$i$0()
  8614. },
  8615. _getInternetMessageId$p$2: function()
  8616. {
  8617. return this._data$p$0.get__internetMessageId$i$0()
  8618. },
  8619. _getConversationId$p$2: function()
  8620. {
  8621. return this._data$p$0.get__conversationId$i$0()
  8622. }
  8623. };
  8624. $h.Message.prototype.getEntities=function()
  8625. {
  8626. return this._data$p$0._getEntities$i$0()
  8627. };
  8628. $h.Message.prototype.getEntitiesByType=function(entityType)
  8629. {
  8630. return this._data$p$0._getEntitiesByType$i$0(entityType)
  8631. };
  8632. $h.Message.prototype.getFilteredEntitiesByName=function(name)
  8633. {
  8634. return this._data$p$0._getFilteredEntitiesByName$i$0(name)
  8635. };
  8636. $h.Message.prototype.getRegExMatches=function()
  8637. {
  8638. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatches");
  8639. return this._data$p$0._getRegExMatches$i$0()
  8640. };
  8641. $h.Message.prototype.getRegExMatchesByName=function(name)
  8642. {
  8643. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatchesByName");
  8644. return this._data$p$0._getRegExMatchesByName$i$0(name)
  8645. };
  8646. $h.Message.prototype.displayReplyForm=function(obj)
  8647. {
  8648. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._displayReplyForm$i$0(obj)
  8649. };
  8650. $h.Message.prototype.displayReplyAllForm=function(obj)
  8651. {
  8652. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._displayReplyAllForm$i$0(obj)
  8653. };
  8654. $h.MessageCompose=function(data)
  8655. {
  8656. this.$$d__getConversationId$p$2=Function.createDelegate(this,this._getConversationId$p$2);
  8657. this.$$d__getBcc$p$2=Function.createDelegate(this,this._getBcc$p$2);
  8658. this.$$d__getCc$p$2=Function.createDelegate(this,this._getCc$p$2);
  8659. this.$$d__getTo$p$2=Function.createDelegate(this,this._getTo$p$2);
  8660. $h.MessageCompose.initializeBase(this,[data]);
  8661. $h.InitialData._defineReadOnlyProperty$i(this,"to",this.$$d__getTo$p$2);
  8662. $h.InitialData._defineReadOnlyProperty$i(this,"cc",this.$$d__getCc$p$2);
  8663. $h.InitialData._defineReadOnlyProperty$i(this,"bcc",this.$$d__getBcc$p$2);
  8664. $h.InitialData._defineReadOnlyProperty$i(this,"conversationId",this.$$d__getConversationId$p$2)
  8665. };
  8666. $h.MessageCompose.prototype={
  8667. _to$p$2: null,
  8668. _cc$p$2: null,
  8669. _bcc$p$2: null,
  8670. getItemType: function()
  8671. {
  8672. return window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemType"]["Message"]
  8673. },
  8674. _getTo$p$2: function()
  8675. {
  8676. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  8677. if(!this._to$p$2)
  8678. this._to$p$2=new $h.ComposeRecipient(0,"to");
  8679. return this._to$p$2
  8680. },
  8681. _getCc$p$2: function()
  8682. {
  8683. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  8684. if(!this._cc$p$2)
  8685. this._cc$p$2=new $h.ComposeRecipient(1,"cc");
  8686. return this._cc$p$2
  8687. },
  8688. _getBcc$p$2: function()
  8689. {
  8690. this._data$p$0._throwOnRestrictedPermissionLevel$i$0();
  8691. if(!this._bcc$p$2)
  8692. this._bcc$p$2=new $h.ComposeRecipient(2,"bcc");
  8693. return this._bcc$p$2
  8694. },
  8695. _getConversationId$p$2: function()
  8696. {
  8697. return this._data$p$0.get__conversationId$i$0()
  8698. }
  8699. };
  8700. $h.NotificationMessages=function(){};
  8701. $h.NotificationMessages._mapToHostItemNotificationMessageType$p=function(dataToHost)
  8702. {
  8703. var notificationType;
  8704. var hostItemNotificationMessageType;
  8705. notificationType=dataToHost["type"];
  8706. if(notificationType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemNotificationMessageType"]["ProgressIndicator"])
  8707. hostItemNotificationMessageType=1;
  8708. else if(notificationType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemNotificationMessageType"]["InformationalMessage"])
  8709. hostItemNotificationMessageType=0;
  8710. else if(notificationType===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemNotificationMessageType"]["ErrorMessage"])
  8711. hostItemNotificationMessageType=2;
  8712. else
  8713. throw Error.argument("type");
  8714. dataToHost["type"]=hostItemNotificationMessageType
  8715. };
  8716. $h.NotificationMessages._validateKey$p=function(key)
  8717. {
  8718. if(!$h.ScriptHelpers.isNonEmptyString(key))
  8719. throw Error.argument("key");
  8720. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(key["length"],0,32,"key")
  8721. };
  8722. $h.NotificationMessages._validateDictionary$p=function(dictionary)
  8723. {
  8724. if(!$h.ScriptHelpers.isNonEmptyString(dictionary["type"]))
  8725. throw Error.argument("type");
  8726. if(dictionary["type"]===window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ItemNotificationMessageType"]["InformationalMessage"])
  8727. {
  8728. if(!$h.ScriptHelpers.isNonEmptyString(dictionary["icon"]))
  8729. throw Error.argument("icon");
  8730. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(dictionary["icon"]["length"],0,32,"icon");
  8731. if($h.ScriptHelpers.isUndefined(dictionary["persistent"]))
  8732. throw Error.argument("persistent");
  8733. if(!Boolean.isInstanceOfType(dictionary["persistent"]))
  8734. throw Error.argumentType("persistent",Object["getType"](dictionary["persistent"]),Boolean);
  8735. }
  8736. else
  8737. {
  8738. if(!$h.ScriptHelpers.isUndefined(dictionary["icon"]))
  8739. throw Error.argument("icon");
  8740. if(!$h.ScriptHelpers.isUndefined(dictionary["persistent"]))
  8741. throw Error.argument("persistent");
  8742. }
  8743. if(!$h.ScriptHelpers.isNonEmptyString(dictionary["message"]))
  8744. throw Error.argument("message");
  8745. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnOutOfRange$i(dictionary["message"]["length"],0,150,"message")
  8746. };
  8747. $h.NotificationMessages.prototype.addAsync=function(key, dictionary)
  8748. {
  8749. var args=[];
  8750. for(var $$pai_5=2; $$pai_5 < arguments["length"];++$$pai_5)
  8751. args[$$pai_5 - 2]=arguments[$$pai_5];
  8752. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.addAsync");
  8753. var commonParameters=$h.CommonParameters.parse(args,false);
  8754. $h.NotificationMessages._validateKey$p(key);
  8755. $h.NotificationMessages._validateDictionary$p(dictionary);
  8756. var dataToHost={};
  8757. dataToHost=$h.ScriptHelpers.deepClone(dictionary);
  8758. dataToHost["key"]=key;
  8759. $h.NotificationMessages._mapToHostItemNotificationMessageType$p(dataToHost);
  8760. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(33,dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  8761. };
  8762. $h.NotificationMessages.prototype.getAllAsync=function()
  8763. {
  8764. var args=[];
  8765. for(var $$pai_2=0; $$pai_2 < arguments["length"];++$$pai_2)
  8766. args[$$pai_2]=arguments[$$pai_2];
  8767. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.getAllAsync");
  8768. var commonParameters=$h.CommonParameters.parse(args,true);
  8769. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(34,null,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  8770. };
  8771. $h.NotificationMessages.prototype.replaceAsync=function(key, dictionary)
  8772. {
  8773. var args=[];
  8774. for(var $$pai_5=2; $$pai_5 < arguments["length"];++$$pai_5)
  8775. args[$$pai_5 - 2]=arguments[$$pai_5];
  8776. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.replaceAsync");
  8777. var commonParameters=$h.CommonParameters.parse(args,false);
  8778. $h.NotificationMessages._validateKey$p(key);
  8779. $h.NotificationMessages._validateDictionary$p(dictionary);
  8780. var dataToHost={};
  8781. dataToHost=$h.ScriptHelpers.deepClone(dictionary);
  8782. dataToHost["key"]=key;
  8783. $h.NotificationMessages._mapToHostItemNotificationMessageType$p(dataToHost);
  8784. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(35,dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  8785. };
  8786. $h.NotificationMessages.prototype.removeAsync=function(key)
  8787. {
  8788. var args=[];
  8789. for(var $$pai_4=1; $$pai_4 < arguments["length"];++$$pai_4)
  8790. args[$$pai_4 - 1]=arguments[$$pai_4];
  8791. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._throwOnMethodCallForInsufficientPermission$i$0(0,"NotificationMessages.removeAsync");
  8792. var commonParameters=$h.CommonParameters.parse(args,false);
  8793. $h.NotificationMessages._validateKey$p(key);
  8794. var dataToHost={key: key};
  8795. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p._standardInvokeHostMethod$i$0(36,dataToHost,null,commonParameters._asyncContext$p$0,commonParameters._callback$p$0)
  8796. };
  8797. $h.OutlookErrorManager=function(){};
  8798. $h.OutlookErrorManager.getErrorArgs=function(errorCode)
  8799. {
  8800. if(!$h.OutlookErrorManager._isInitialized$p)
  8801. $h.OutlookErrorManager._initialize$p();
  8802. return OSF.DDA.ErrorCodeManager["getErrorArgs"](errorCode)
  8803. };
  8804. $h.OutlookErrorManager._initialize$p=function()
  8805. {
  8806. $h.OutlookErrorManager._addErrorMessage$p(9e3,"AttachmentSizeExceeded",window["_u"]["ExtensibilityStrings"]["l_AttachmentExceededSize_Text"]);
  8807. $h.OutlookErrorManager._addErrorMessage$p(9001,"NumberOfAttachmentsExceeded",window["_u"]["ExtensibilityStrings"]["l_ExceededMaxNumberOfAttachments_Text"]);
  8808. $h.OutlookErrorManager._addErrorMessage$p(9002,"InternalFormatError",window["_u"]["ExtensibilityStrings"]["l_InternalFormatError_Text"]);
  8809. $h.OutlookErrorManager._addErrorMessage$p(9003,"InvalidAttachmentId",window["_u"]["ExtensibilityStrings"]["l_InvalidAttachmentId_Text"]);
  8810. $h.OutlookErrorManager._addErrorMessage$p(9004,"InvalidAttachmentPath",window["_u"]["ExtensibilityStrings"]["l_InvalidAttachmentPath_Text"]);
  8811. $h.OutlookErrorManager._addErrorMessage$p(9005,"CannotAddAttachmentBeforeUpgrade",window["_u"]["ExtensibilityStrings"]["l_CannotAddAttachmentBeforeUpgrade_Text"]);
  8812. $h.OutlookErrorManager._addErrorMessage$p(9006,"AttachmentDeletedBeforeUploadCompletes",window["_u"]["ExtensibilityStrings"]["l_AttachmentDeletedBeforeUploadCompletes_Text"]);
  8813. $h.OutlookErrorManager._addErrorMessage$p(9007,"AttachmentUploadGeneralFailure",window["_u"]["ExtensibilityStrings"]["l_AttachmentUploadGeneralFailure_Text"]);
  8814. $h.OutlookErrorManager._addErrorMessage$p(9008,"AttachmentToDeleteDoesNotExist",window["_u"]["ExtensibilityStrings"]["l_DeleteAttachmentDoesNotExist_Text"]);
  8815. $h.OutlookErrorManager._addErrorMessage$p(9009,"AttachmentDeleteGeneralFailure",window["_u"]["ExtensibilityStrings"]["l_AttachmentDeleteGeneralFailure_Text"]);
  8816. $h.OutlookErrorManager._addErrorMessage$p(9010,"InvalidEndTime",window["_u"]["ExtensibilityStrings"]["l_InvalidEndTime_Text"]);
  8817. $h.OutlookErrorManager._addErrorMessage$p(9011,"HtmlSanitizationFailure",window["_u"]["ExtensibilityStrings"]["l_HtmlSanitizationFailure_Text"]);
  8818. $h.OutlookErrorManager._addErrorMessage$p(9012,"NumberOfRecipientsExceeded",String.format(window["_u"]["ExtensibilityStrings"]["l_NumberOfRecipientsExceeded_Text"],500));
  8819. $h.OutlookErrorManager._addErrorMessage$p(9013,"NoValidRecipientsProvided",window["_u"]["ExtensibilityStrings"]["l_NoValidRecipientsProvided_Text"]);
  8820. $h.OutlookErrorManager._addErrorMessage$p(9014,"CursorPositionChanged",window["_u"]["ExtensibilityStrings"]["l_CursorPositionChanged_Text"]);
  8821. $h.OutlookErrorManager._addErrorMessage$p(9016,"InvalidSelection",window["_u"]["ExtensibilityStrings"]["l_InvalidSelection_Text"]);
  8822. $h.OutlookErrorManager._addErrorMessage$p(9017,"AccessRestricted","");
  8823. $h.OutlookErrorManager._addErrorMessage$p(9018,"GenericTokenError","");
  8824. $h.OutlookErrorManager._addErrorMessage$p(9019,"GenericSettingsError","");
  8825. $h.OutlookErrorManager._addErrorMessage$p(9020,"GenericResponseError","");
  8826. $h.OutlookErrorManager._addErrorMessage$p(9021,"SaveError",window["_u"]["ExtensibilityStrings"]["l_SaveError_Text"]);
  8827. $h.OutlookErrorManager._addErrorMessage$p(9022,"MessageInDifferentStoreError",window["_u"]["ExtensibilityStrings"]["l_MessageInDifferentStoreError_Text"]);
  8828. $h.OutlookErrorManager._addErrorMessage$p(9023,"DuplicateNotificationKey",window["_u"]["ExtensibilityStrings"]["l_DuplicateNotificationKey_Text"]);
  8829. $h.OutlookErrorManager._addErrorMessage$p(9024,"NotificationKeyNotFound",window["_u"]["ExtensibilityStrings"]["l_NotificationKeyNotFound_Text"]);
  8830. $h.OutlookErrorManager._addErrorMessage$p(9025,"NumberOfNotificationsExceeded",window["_u"]["ExtensibilityStrings"]["l_NumberOfNotificationsExceeded_Text"]);
  8831. $h.OutlookErrorManager._addErrorMessage$p(9026,"PersistedNotificationArrayReadError",window["_u"]["ExtensibilityStrings"]["l_PersistedNotificationArrayReadError_Text"]);
  8832. $h.OutlookErrorManager._addErrorMessage$p(9027,"PersistedNotificationArraySaveError",window["_u"]["ExtensibilityStrings"]["l_PersistedNotificationArraySaveError_Text"]);
  8833. $h.OutlookErrorManager._addErrorMessage$p(9028,"CannotPersistPropertyInUnsavedDraftError",window["_u"]["ExtensibilityStrings"]["l_CannotPersistPropertyInUnsavedDraftError_Text"]);
  8834. $h.OutlookErrorManager._isInitialized$p=true
  8835. };
  8836. $h.OutlookErrorManager._addErrorMessage$p=function(errorCode, errorName, errorMessage)
  8837. {
  8838. OSF.DDA.ErrorCodeManager["addErrorMessage"](errorCode,{
  8839. name: errorName,
  8840. message: errorMessage
  8841. })
  8842. };
  8843. $h.OutlookErrorManager.OutlookErrorCodes=function(){};
  8844. $h.OutlookErrorManager.OsfDdaErrorCodes=function(){};
  8845. $h.PhoneNumber=function(data)
  8846. {
  8847. this.$$d__getPhoneType$p$0=Function.createDelegate(this,this._getPhoneType$p$0);
  8848. this.$$d__getOriginalPhoneString$p$0=Function.createDelegate(this,this._getOriginalPhoneString$p$0);
  8849. this.$$d__getPhoneString$p$0=Function.createDelegate(this,this._getPhoneString$p$0);
  8850. this._data$p$0=data;
  8851. $h.InitialData._defineReadOnlyProperty$i(this,"phoneString",this.$$d__getPhoneString$p$0);
  8852. $h.InitialData._defineReadOnlyProperty$i(this,"originalPhoneString",this.$$d__getOriginalPhoneString$p$0);
  8853. $h.InitialData._defineReadOnlyProperty$i(this,"type",this.$$d__getPhoneType$p$0)
  8854. };
  8855. $h.PhoneNumber.prototype={
  8856. _data$p$0: null,
  8857. _getPhoneString$p$0: function()
  8858. {
  8859. return this._data$p$0["PhoneString"]
  8860. },
  8861. _getOriginalPhoneString$p$0: function()
  8862. {
  8863. return this._data$p$0["OriginalPhoneString"]
  8864. },
  8865. _getPhoneType$p$0: function()
  8866. {
  8867. return this._data$p$0["Type"]
  8868. }
  8869. };
  8870. $h.TaskSuggestion=function(data)
  8871. {
  8872. this.$$d__getAssignees$p$0=Function.createDelegate(this,this._getAssignees$p$0);
  8873. this.$$d__getTaskString$p$0=Function.createDelegate(this,this._getTaskString$p$0);
  8874. this._data$p$0=data;
  8875. $h.InitialData._defineReadOnlyProperty$i(this,"taskString",this.$$d__getTaskString$p$0);
  8876. $h.InitialData._defineReadOnlyProperty$i(this,"assignees",this.$$d__getAssignees$p$0)
  8877. };
  8878. $h.TaskSuggestion.prototype={
  8879. _data$p$0: null,
  8880. _assignees$p$0: null,
  8881. _getTaskString$p$0: function()
  8882. {
  8883. return this._data$p$0["TaskString"]
  8884. },
  8885. _getAssignees$p$0: function()
  8886. {
  8887. if(!this._assignees$p$0)
  8888. {
  8889. var $$t_1=this;
  8890. this._assignees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails,this._data$p$0,"Assignees",function(data)
  8891. {
  8892. return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data)
  8893. })
  8894. }
  8895. return this._assignees$p$0
  8896. }
  8897. };
  8898. $h.UserProfile=function(data)
  8899. {
  8900. this.$$d__getUserProfileType$p$0=Function.createDelegate(this,this._getUserProfileType$p$0);
  8901. this.$$d__getTimeZone$p$0=Function.createDelegate(this,this._getTimeZone$p$0);
  8902. this.$$d__getEmailAddress$p$0=Function.createDelegate(this,this._getEmailAddress$p$0);
  8903. this.$$d__getDisplayName$p$0=Function.createDelegate(this,this._getDisplayName$p$0);
  8904. this._data$p$0=data;
  8905. $h.InitialData._defineReadOnlyProperty$i(this,"displayName",this.$$d__getDisplayName$p$0);
  8906. $h.InitialData._defineReadOnlyProperty$i(this,"emailAddress",this.$$d__getEmailAddress$p$0);
  8907. $h.InitialData._defineReadOnlyProperty$i(this,"timeZone",this.$$d__getTimeZone$p$0);
  8908. $h.InitialData._defineReadOnlyProperty$i(this,"type",this.$$d__getUserProfileType$p$0)
  8909. };
  8910. $h.UserProfile.prototype={
  8911. _data$p$0: null,
  8912. _getUserProfileType$p$0: function()
  8913. {
  8914. return this._data$p$0.get__userProfileType$i$0()
  8915. },
  8916. _getDisplayName$p$0: function()
  8917. {
  8918. return this._data$p$0.get__userDisplayName$i$0()
  8919. },
  8920. _getEmailAddress$p$0: function()
  8921. {
  8922. return this._data$p$0.get__userEmailAddress$i$0()
  8923. },
  8924. _getTimeZone$p$0: function()
  8925. {
  8926. return this._data$p$0.get__userTimeZone$i$0()
  8927. }
  8928. };
  8929. $h.OutlookDispid=function(){};
  8930. $h.OutlookDispid.prototype={
  8931. owaOnlyMethod: 0,
  8932. getInitialData: 1,
  8933. getUserIdentityToken: 2,
  8934. loadCustomProperties: 3,
  8935. saveCustomProperties: 4,
  8936. ewsRequest: 5,
  8937. displayNewAppointmentForm: 7,
  8938. displayMessageForm: 8,
  8939. displayAppointmentForm: 9,
  8940. displayReplyForm: 10,
  8941. displayReplyAllForm: 11,
  8942. getCallbackToken: 12,
  8943. bodySetSelectedDataAsync: 13,
  8944. getBodyTypeAsync: 14,
  8945. getRecipientsAsync: 15,
  8946. addFileAttachmentAsync: 16,
  8947. setSubjectAsync: 17,
  8948. getSubjectAsync: 18,
  8949. addItemAttachmentAsync: 19,
  8950. removeAttachmentAsync: 20,
  8951. setRecipientsAsync: 21,
  8952. addRecipientsAsync: 22,
  8953. bodyPrependAsync: 23,
  8954. getTimeAsync: 24,
  8955. setTimeAsync: 25,
  8956. getLocationAsync: 26,
  8957. setLocationAsync: 27,
  8958. getSelectedDataAsync: 28,
  8959. setSelectedDataAsync: 29,
  8960. displayReplyFormWithAttachments: 30,
  8961. displayReplyAllFormWithAttachments: 31,
  8962. saveAsync: 32,
  8963. addNotficationMessageAsync: 33,
  8964. getAllNotficationMessagesAsync: 34,
  8965. replaceNotficationMessageAsync: 35,
  8966. removeNotficationMessageAsync: 36,
  8967. getBodyAsync: 37,
  8968. setBodyAsync: 38,
  8969. appCommands1: 39,
  8970. registerConsentAsync: 40,
  8971. close: 41,
  8972. closeApp: 42,
  8973. displayContactCardAsync: 43,
  8974. displayNewMessageForm: 44,
  8975. appCommands2: 94,
  8976. trackCtq: 400,
  8977. recordTrace: 401,
  8978. recordDataPoint: 402,
  8979. windowOpenOverrideHandler: 403,
  8980. saveSettingsRequest: 404
  8981. };
  8982. $h.OutlookDispid.registerEnum("$h.OutlookDispid",false);
  8983. $h.RequestState=function(){};
  8984. $h.RequestState.prototype={
  8985. unsent: 0,
  8986. opened: 1,
  8987. headersReceived: 2,
  8988. loading: 3,
  8989. done: 4
  8990. };
  8991. $h.RequestState.registerEnum("$h.RequestState",false);
  8992. $h.CommonParameters=function(options, callback, asyncContext)
  8993. {
  8994. this._options$p$0=options;
  8995. this._callback$p$0=callback;
  8996. this._asyncContext$p$0=asyncContext
  8997. };
  8998. $h.CommonParameters.parse=function(args, isCallbackRequired, tryLegacy)
  8999. {
  9000. var legacyParameters;
  9001. var $$t_8,
  9002. $$t_9;
  9003. if(tryLegacy && ($$t_9=$h.CommonParameters._tryParseLegacy$p(args,$$t_8={val: legacyParameters}),legacyParameters=$$t_8["val"],$$t_9))
  9004. return legacyParameters;
  9005. var argsLength=args["length"];
  9006. var options=null;
  9007. var callback=null;
  9008. var asyncContext=null;
  9009. if(argsLength===1)
  9010. if(Function.isInstanceOfType(args[0]))
  9011. callback=args[0];
  9012. else if(Object.isInstanceOfType(args[0]))
  9013. options=args[0];
  9014. else
  9015. throw Error.argumentType();
  9016. else if(argsLength===2)
  9017. {
  9018. if(!Object.isInstanceOfType(args[0]))
  9019. throw Error.argument("options");
  9020. if(!Function.isInstanceOfType(args[1]))
  9021. throw Error.argument("callback");
  9022. options=args[0];
  9023. callback=args[1]
  9024. }
  9025. else if(argsLength)
  9026. throw Error.parameterCount(window["_u"]["ExtensibilityStrings"]["l_ParametersNotAsExpected_Text"]);
  9027. if(isCallbackRequired && !callback)
  9028. throw Error.argumentNull("callback");
  9029. if(options && !$h.ScriptHelpers.isNullOrUndefined(options["asyncContext"]))
  9030. asyncContext=options["asyncContext"];
  9031. return new $h.CommonParameters(options,callback,asyncContext)
  9032. };
  9033. $h.CommonParameters._tryParseLegacy$p=function(args, commonParameters)
  9034. {
  9035. commonParameters.val=null;
  9036. var argsLength=args["length"];
  9037. var callback=null;
  9038. var userContext=null;
  9039. if(!argsLength || argsLength > 2)
  9040. return false;
  9041. if(!Function.isInstanceOfType(args[0]))
  9042. return false;
  9043. callback=args[0];
  9044. if(argsLength > 1)
  9045. userContext=args[1];
  9046. commonParameters.val=new $h.CommonParameters(null,callback,userContext);
  9047. return true
  9048. };
  9049. $h.CommonParameters.prototype={
  9050. _options$p$0: null,
  9051. _callback$p$0: null,
  9052. _asyncContext$p$0: null,
  9053. get_options: function()
  9054. {
  9055. return this._options$p$0
  9056. },
  9057. get_callback: function()
  9058. {
  9059. return this._callback$p$0
  9060. },
  9061. get_asyncContext: function()
  9062. {
  9063. return this._asyncContext$p$0
  9064. }
  9065. };
  9066. $h.EwsRequest=function(userContext)
  9067. {
  9068. $h.EwsRequest.initializeBase(this,[userContext])
  9069. };
  9070. $h.EwsRequest.prototype={
  9071. readyState: 1,
  9072. status: 0,
  9073. statusText: null,
  9074. onreadystatechange: null,
  9075. responseText: null,
  9076. get__statusCode$i$1: function()
  9077. {
  9078. return this.status
  9079. },
  9080. set__statusCode$i$1: function(value)
  9081. {
  9082. this.status=value;
  9083. return value
  9084. },
  9085. get__statusDescription$i$1: function()
  9086. {
  9087. return this.statusText
  9088. },
  9089. set__statusDescription$i$1: function(value)
  9090. {
  9091. this.statusText=value;
  9092. return value
  9093. },
  9094. get__requestState$i$1: function()
  9095. {
  9096. return this.readyState
  9097. },
  9098. set__requestState$i$1: function(value)
  9099. {
  9100. this.readyState=value;
  9101. return value
  9102. },
  9103. get_hasOnReadyStateChangeCallback: function()
  9104. {
  9105. return!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)
  9106. },
  9107. get__response$i$1: function()
  9108. {
  9109. return this.responseText
  9110. },
  9111. set__response$i$1: function(value)
  9112. {
  9113. this.responseText=value;
  9114. return value
  9115. },
  9116. send: function(data)
  9117. {
  9118. this._checkSendConditions$i$1();
  9119. if($h.ScriptHelpers.isNullOrUndefined(data))
  9120. this._throwInvalidStateException$i$1();
  9121. this._sendRequest$i$0(5,"EwsRequest",{body: data})
  9122. },
  9123. _callOnReadyStateChangeCallback$i$1: function()
  9124. {
  9125. if(!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange))
  9126. this.onreadystatechange()
  9127. },
  9128. _parseExtraResponseData$i$1: function(response){},
  9129. executeExtraFailedResponseSteps: function(){}
  9130. };
  9131. $h.InitialData=function(data)
  9132. {
  9133. this._data$p$0=data;
  9134. this._permissionLevel$p$0=this._calculatePermissionLevel$p$0()
  9135. };
  9136. $h.InitialData._defineReadOnlyProperty$i=function(o, methodName, getter)
  9137. {
  9138. var propertyDescriptor={
  9139. get: getter,
  9140. configurable: false
  9141. };
  9142. Object.defineProperty(o,methodName,propertyDescriptor)
  9143. };
  9144. $h.InitialData.prototype={
  9145. _toRecipients$p$0: null,
  9146. _ccRecipients$p$0: null,
  9147. _attachments$p$0: null,
  9148. _resources$p$0: null,
  9149. _entities$p$0: null,
  9150. _data$p$0: null,
  9151. _permissionLevel$p$0: 0,
  9152. get__isRestIdSupported$i$0: function()
  9153. {
  9154. return this._data$p$0["isRestIdSupported"]
  9155. },
  9156. get__itemId$i$0: function()
  9157. {
  9158. return this._data$p$0["id"]
  9159. },
  9160. get__itemClass$i$0: function()
  9161. {
  9162. return this._data$p$0["itemClass"]
  9163. },
  9164. get__dateTimeCreated$i$0: function()
  9165. {
  9166. return new Date(this._data$p$0["dateTimeCreated"])
  9167. },
  9168. get__dateTimeModified$i$0: function()
  9169. {
  9170. return new Date(this._data$p$0["dateTimeModified"])
  9171. },
  9172. get__dateTimeSent$i$0: function()
  9173. {
  9174. return new Date(this._data$p$0["dateTimeSent"])
  9175. },
  9176. get__subject$i$0: function()
  9177. {
  9178. this._throwOnRestrictedPermissionLevel$i$0();
  9179. return this._data$p$0["subject"]
  9180. },
  9181. get__normalizedSubject$i$0: function()
  9182. {
  9183. this._throwOnRestrictedPermissionLevel$i$0();
  9184. return this._data$p$0["normalizedSubject"]
  9185. },
  9186. get__internetMessageId$i$0: function()
  9187. {
  9188. return this._data$p$0["internetMessageId"]
  9189. },
  9190. get__conversationId$i$0: function()
  9191. {
  9192. return this._data$p$0["conversationId"]
  9193. },
  9194. get__sender$i$0: function()
  9195. {
  9196. this._throwOnRestrictedPermissionLevel$i$0();
  9197. var sender=this._data$p$0["sender"];
  9198. return $h.ScriptHelpers.isNullOrUndefined(sender) ? null : new $h.EmailAddressDetails(sender)
  9199. },
  9200. get__from$i$0: function()
  9201. {
  9202. this._throwOnRestrictedPermissionLevel$i$0();
  9203. var from=this._data$p$0["from"];
  9204. return $h.ScriptHelpers.isNullOrUndefined(from) ? null : new $h.EmailAddressDetails(from)
  9205. },
  9206. get__to$i$0: function()
  9207. {
  9208. this._throwOnRestrictedPermissionLevel$i$0();
  9209. if(null===this._toRecipients$p$0)
  9210. this._toRecipients$p$0=this._createEmailAddressDetails$p$0("to");
  9211. return this._toRecipients$p$0
  9212. },
  9213. get__cc$i$0: function()
  9214. {
  9215. this._throwOnRestrictedPermissionLevel$i$0();
  9216. if(null===this._ccRecipients$p$0)
  9217. this._ccRecipients$p$0=this._createEmailAddressDetails$p$0("cc");
  9218. return this._ccRecipients$p$0
  9219. },
  9220. get__attachments$i$0: function()
  9221. {
  9222. this._throwOnRestrictedPermissionLevel$i$0();
  9223. if(null===this._attachments$p$0)
  9224. this._attachments$p$0=this._createAttachmentDetails$p$0();
  9225. return this._attachments$p$0
  9226. },
  9227. get__ewsUrl$i$0: function()
  9228. {
  9229. return this._data$p$0["ewsUrl"]
  9230. },
  9231. get__marketplaceAssetId$i$0: function()
  9232. {
  9233. return this._data$p$0["marketplaceAssetId"]
  9234. },
  9235. get__extensionId$i$0: function()
  9236. {
  9237. return this._data$p$0["extensionId"]
  9238. },
  9239. get__marketplaceContentMarket$i$0: function()
  9240. {
  9241. return this._data$p$0["marketplaceContentMarket"]
  9242. },
  9243. get__consentMetadata$i$0: function()
  9244. {
  9245. return this._data$p$0["consentMetadata"]
  9246. },
  9247. get__isRead$i$0: function()
  9248. {
  9249. return this._data$p$0["isRead"]
  9250. },
  9251. get__endNodeUrl$i$0: function()
  9252. {
  9253. return this._data$p$0["endNodeUrl"]
  9254. },
  9255. get__entryPointUrl$i$0: function()
  9256. {
  9257. return this._data$p$0["entryPointUrl"]
  9258. },
  9259. get__start$i$0: function()
  9260. {
  9261. return new Date(this._data$p$0["start"])
  9262. },
  9263. get__end$i$0: function()
  9264. {
  9265. return new Date(this._data$p$0["end"])
  9266. },
  9267. get__location$i$0: function()
  9268. {
  9269. return this._data$p$0["location"]
  9270. },
  9271. get__userProfileType$i$0: function()
  9272. {
  9273. return this._data$p$0["userProfileType"]
  9274. },
  9275. get__resources$i$0: function()
  9276. {
  9277. this._throwOnRestrictedPermissionLevel$i$0();
  9278. if(null===this._resources$p$0)
  9279. this._resources$p$0=this._createEmailAddressDetails$p$0("resources");
  9280. return this._resources$p$0
  9281. },
  9282. get__organizer$i$0: function()
  9283. {
  9284. this._throwOnRestrictedPermissionLevel$i$0();
  9285. var organizer=this._data$p$0["organizer"];
  9286. return $h.ScriptHelpers.isNullOrUndefined(organizer) ? null : new $h.EmailAddressDetails(organizer)
  9287. },
  9288. get__userDisplayName$i$0: function()
  9289. {
  9290. return this._data$p$0["userDisplayName"]
  9291. },
  9292. get__userEmailAddress$i$0: function()
  9293. {
  9294. return this._data$p$0["userEmailAddress"]
  9295. },
  9296. get__userTimeZone$i$0: function()
  9297. {
  9298. return this._data$p$0["userTimeZone"]
  9299. },
  9300. get__timeZoneOffsets$i$0: function()
  9301. {
  9302. return this._data$p$0["timeZoneOffsets"]
  9303. },
  9304. get__hostVersion$i$0: function()
  9305. {
  9306. return this._data$p$0["hostVersion"]
  9307. },
  9308. get__owaView$i$0: function()
  9309. {
  9310. return this._data$p$0["owaView"]
  9311. },
  9312. get__overrideWindowOpen$i$0: function()
  9313. {
  9314. return this._data$p$0["overrideWindowOpen"]
  9315. },
  9316. _getEntities$i$0: function()
  9317. {
  9318. if(!this._entities$p$0)
  9319. 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);
  9320. return this._entities$p$0
  9321. },
  9322. _getEntitiesByType$i$0: function(entityType)
  9323. {
  9324. var entites=this._getEntities$i$0();
  9325. return entites._getByType$i$0(entityType)
  9326. },
  9327. _getFilteredEntitiesByName$i$0: function(name)
  9328. {
  9329. var entities=this._getEntities$i$0();
  9330. return entities._getFilteredEntitiesByName$i$0(name)
  9331. },
  9332. _getRegExMatches$i$0: function()
  9333. {
  9334. if(!this._data$p$0["regExMatches"])
  9335. return null;
  9336. return this._data$p$0["regExMatches"]
  9337. },
  9338. _getRegExMatchesByName$i$0: function(regexName)
  9339. {
  9340. var regexMatches=this._getRegExMatches$i$0();
  9341. if(!regexMatches || !regexMatches[regexName])
  9342. return null;
  9343. return regexMatches[regexName]
  9344. },
  9345. _throwOnRestrictedPermissionLevel$i$0: function()
  9346. {
  9347. window["OSF"]["DDA"]["OutlookAppOm"]._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0)
  9348. },
  9349. _createEmailAddressDetails$p$0: function(key)
  9350. {
  9351. var to=this._data$p$0[key];
  9352. if($h.ScriptHelpers.isNullOrUndefined(to))
  9353. return[];
  9354. var recipients=[];
  9355. for(var i=0; i < to["length"]; i++)
  9356. if(!$h.ScriptHelpers.isNullOrUndefined(to[i]))
  9357. recipients[i]=new $h.EmailAddressDetails(to[i]);
  9358. return recipients
  9359. },
  9360. _createAttachmentDetails$p$0: function()
  9361. {
  9362. var attachments=this._data$p$0["attachments"];
  9363. if($h.ScriptHelpers.isNullOrUndefined(attachments))
  9364. return[];
  9365. var attachmentDetails=[];
  9366. for(var i=0; i < attachments["length"]; i++)
  9367. if(!$h.ScriptHelpers.isNullOrUndefined(attachments[i]))
  9368. attachmentDetails[i]=new $h.AttachmentDetails(attachments[i]);
  9369. return attachmentDetails
  9370. },
  9371. _calculatePermissionLevel$p$0: function()
  9372. {
  9373. var HostReadItem=1;
  9374. var HostReadWriteMailbox=2;
  9375. var HostReadWriteItem=3;
  9376. var permissionLevelFromHost=this._data$p$0["permissionLevel"];
  9377. if($h.ScriptHelpers.isUndefined(this._permissionLevel$p$0))
  9378. return 0;
  9379. switch(permissionLevelFromHost)
  9380. {
  9381. case HostReadItem:
  9382. return 1;
  9383. case HostReadWriteItem:
  9384. return 2;
  9385. case HostReadWriteMailbox:
  9386. return 3;
  9387. default:
  9388. return 0
  9389. }
  9390. }
  9391. };
  9392. $h._loadDictionaryRequest=function(createResultObject, dictionaryName, callback, userContext)
  9393. {
  9394. $h._loadDictionaryRequest.initializeBase(this,[userContext]);
  9395. this._createResultObject$p$1=createResultObject;
  9396. this._dictionaryName$p$1=dictionaryName;
  9397. this._callback$p$1=callback
  9398. };
  9399. $h._loadDictionaryRequest.prototype={
  9400. _dictionaryName$p$1: null,
  9401. _createResultObject$p$1: null,
  9402. _callback$p$1: null,
  9403. handleResponse: function(response)
  9404. {
  9405. if(response["wasSuccessful"])
  9406. {
  9407. var value=response[this._dictionaryName$p$1];
  9408. var responseData=window["JSON"]["parse"](value);
  9409. this.createAsyncResult(this._createResultObject$p$1(responseData),0,0,null)
  9410. }
  9411. else
  9412. this.createAsyncResult(null,1,9020,response["errorMessage"]);
  9413. this._callback$p$1(this._asyncResult$p$0)
  9414. }
  9415. };
  9416. $h.ProxyRequestBase=function(userContext)
  9417. {
  9418. $h.ProxyRequestBase.initializeBase(this,[userContext])
  9419. };
  9420. $h.ProxyRequestBase.prototype={
  9421. handleResponse: function(response)
  9422. {
  9423. if(!response["wasProxySuccessful"])
  9424. {
  9425. this.set__statusCode$i$1(500);
  9426. this.set__statusDescription$i$1("Error");
  9427. var errorMessage=response["errorMessage"];
  9428. this.set__response$i$1(errorMessage);
  9429. this.createAsyncResult(null,1,9020,errorMessage)
  9430. }
  9431. else
  9432. {
  9433. this.set__statusCode$i$1(response["statusCode"]);
  9434. this.set__statusDescription$i$1(response["statusDescription"]);
  9435. this.set__response$i$1(response["body"]);
  9436. this.createAsyncResult(this.get__response$i$1(),0,0,null)
  9437. }
  9438. this._parseExtraResponseData$i$1(response);
  9439. this._cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1()
  9440. },
  9441. _throwInvalidStateException$i$1: function()
  9442. {
  9443. throw Error.create("DOMException",{
  9444. code: 11,
  9445. message: "INVALID_STATE_ERR"
  9446. });
  9447. },
  9448. _cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1: function()
  9449. {
  9450. var $$t_0=this;
  9451. this._changeReadyState$i$1(2,function()
  9452. {
  9453. $$t_0._changeReadyState$i$1(3,function()
  9454. {
  9455. $$t_0._changeReadyState$i$1(4,null)
  9456. })
  9457. })
  9458. },
  9459. _changeReadyState$i$1: function(state, nextStep)
  9460. {
  9461. this.set__requestState$i$1(state);
  9462. var $$t_2=this;
  9463. window.setTimeout(function()
  9464. {
  9465. try
  9466. {
  9467. $$t_2._callOnReadyStateChangeCallback$i$1()
  9468. }
  9469. finally
  9470. {
  9471. if(!$h.ScriptHelpers.isNullOrUndefined(nextStep))
  9472. nextStep()
  9473. }
  9474. },0)
  9475. },
  9476. _checkSendConditions$i$1: function()
  9477. {
  9478. if(this.get__requestState$i$1() !==1)
  9479. this._throwInvalidStateException$i$1();
  9480. if(this._isSent$p$0)
  9481. this._throwInvalidStateException$i$1()
  9482. }
  9483. };
  9484. $h.RequestBase=function(userContext)
  9485. {
  9486. this._userContext$p$0=userContext
  9487. };
  9488. $h.RequestBase.prototype={
  9489. _isSent$p$0: false,
  9490. _asyncResult$p$0: null,
  9491. _userContext$p$0: null,
  9492. get_asyncResult: function()
  9493. {
  9494. return this._asyncResult$p$0
  9495. },
  9496. _sendRequest$i$0: function(dispid, methodName, dataToSend)
  9497. {
  9498. this._isSent$p$0=true;
  9499. var $$t_5=this;
  9500. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.invokeHostMethod(dispid,dataToSend,function(resultCode, response)
  9501. {
  9502. if(resultCode)
  9503. $$t_5.createAsyncResult(null,1,9017,String.format(window["_u"]["ExtensibilityStrings"]["l_InternalProtocolError_Text"],resultCode));
  9504. else
  9505. $$t_5.handleResponse(response)
  9506. })
  9507. },
  9508. createAsyncResult: function(value, errorCode, detailedErrorCode, errorDescription)
  9509. {
  9510. this._asyncResult$p$0=window["OSF"]["DDA"]["OutlookAppOm"]._instance$p.createAsyncResult(value,errorCode,detailedErrorCode,this._userContext$p$0,errorDescription)
  9511. }
  9512. };
  9513. $h.SaveDictionaryRequest=function(callback, userContext)
  9514. {
  9515. $h.SaveDictionaryRequest.initializeBase(this,[userContext]);
  9516. if(!$h.ScriptHelpers.isNullOrUndefined(callback))
  9517. this._callback$p$1=callback
  9518. };
  9519. $h.SaveDictionaryRequest.prototype={
  9520. _callback$p$1: null,
  9521. handleResponse: function(response)
  9522. {
  9523. if(response["wasSuccessful"])
  9524. this.createAsyncResult(null,0,0,null);
  9525. else
  9526. this.createAsyncResult(null,1,9020,response["errorMessage"]);
  9527. if(!$h.ScriptHelpers.isNullOrUndefined(this._callback$p$1))
  9528. this._callback$p$1(this._asyncResult$p$0)
  9529. }
  9530. };
  9531. $h.ScriptHelpers=function(){};
  9532. $h.ScriptHelpers.isNull=function(value)
  9533. {
  9534. return null===value
  9535. };
  9536. $h.ScriptHelpers.isNullOrUndefined=function(value)
  9537. {
  9538. return $h.ScriptHelpers.isNull(value) || $h.ScriptHelpers.isUndefined(value)
  9539. };
  9540. $h.ScriptHelpers.isUndefined=function(value)
  9541. {
  9542. return value===undefined
  9543. };
  9544. $h.ScriptHelpers.dictionaryContainsKey=function(obj, keyName)
  9545. {
  9546. return Object.isInstanceOfType(obj) ? keyName in obj : false
  9547. };
  9548. $h.ScriptHelpers.isNonEmptyString=function(value)
  9549. {
  9550. if(!value)
  9551. return false;
  9552. return String.isInstanceOfType(value)
  9553. };
  9554. $h.ScriptHelpers.deepClone=function(obj)
  9555. {
  9556. return window["JSON"]["parse"](window["JSON"]["stringify"](obj))
  9557. };
  9558. window["OSF"]["DDA"]["OutlookAppOm"].registerClass("OSF.DDA.OutlookAppOm");
  9559. window["OSF"]["DDA"]["Settings"].registerClass("OSF.DDA.Settings");
  9560. $h.ItemBase.registerClass("$h.ItemBase");
  9561. $h.Item.registerClass("$h.Item",$h.ItemBase);
  9562. $h.Appointment.registerClass("$h.Appointment",$h.Item);
  9563. $h.ComposeItem.registerClass("$h.ComposeItem",$h.ItemBase);
  9564. $h.AppointmentCompose.registerClass("$h.AppointmentCompose",$h.ComposeItem);
  9565. $h.AttachmentConstants.registerClass("$h.AttachmentConstants");
  9566. $h.AttachmentDetails.registerClass("$h.AttachmentDetails");
  9567. $h.Body.registerClass("$h.Body");
  9568. $h.ComposeBody.registerClass("$h.ComposeBody",$h.Body);
  9569. $h.ComposeRecipient.registerClass("$h.ComposeRecipient");
  9570. $h.ComposeLocation.registerClass("$h.ComposeLocation");
  9571. $h.ComposeSubject.registerClass("$h.ComposeSubject");
  9572. $h.ComposeTime.registerClass("$h.ComposeTime");
  9573. $h.Contact.registerClass("$h.Contact");
  9574. $h.CustomProperties.registerClass("$h.CustomProperties");
  9575. $h.Diagnostics.registerClass("$h.Diagnostics");
  9576. $h.EmailAddressDetails.registerClass("$h.EmailAddressDetails");
  9577. $h.Entities.registerClass("$h.Entities");
  9578. $h.ReplyConstants.registerClass("$h.ReplyConstants");
  9579. $h.AsyncConstants.registerClass("$h.AsyncConstants");
  9580. window["Office"]["cast"]["item"].registerClass("Office.cast.item");
  9581. $h.Message.registerClass("$h.Message",$h.Item);
  9582. $h.MeetingRequest.registerClass("$h.MeetingRequest",$h.Message);
  9583. $h.MeetingSuggestion.registerClass("$h.MeetingSuggestion");
  9584. $h.MeetingSuggestionTimeDecoder.registerClass("$h.MeetingSuggestionTimeDecoder");
  9585. $h._extractedDate.registerClass("$h._extractedDate");
  9586. $h._preciseDate.registerClass("$h._preciseDate",$h._extractedDate);
  9587. $h._relativeDate.registerClass("$h._relativeDate",$h._extractedDate);
  9588. $h.MessageCompose.registerClass("$h.MessageCompose",$h.ComposeItem);
  9589. $h.NotificationMessages.registerClass("$h.NotificationMessages");
  9590. $h.OutlookErrorManager.registerClass("$h.OutlookErrorManager");
  9591. $h.OutlookErrorManager.OutlookErrorCodes.registerClass("$h.OutlookErrorManager.OutlookErrorCodes");
  9592. $h.OutlookErrorManager.OsfDdaErrorCodes.registerClass("$h.OutlookErrorManager.OsfDdaErrorCodes");
  9593. $h.PhoneNumber.registerClass("$h.PhoneNumber");
  9594. $h.TaskSuggestion.registerClass("$h.TaskSuggestion");
  9595. $h.UserProfile.registerClass("$h.UserProfile");
  9596. $h.CommonParameters.registerClass("$h.CommonParameters");
  9597. $h.RequestBase.registerClass("$h.RequestBase");
  9598. $h.ProxyRequestBase.registerClass("$h.ProxyRequestBase",$h.RequestBase);
  9599. $h.EwsRequest.registerClass("$h.EwsRequest",$h.ProxyRequestBase);
  9600. $h.InitialData.registerClass("$h.InitialData");
  9601. $h._loadDictionaryRequest.registerClass("$h._loadDictionaryRequest",$h.RequestBase);
  9602. $h.SaveDictionaryRequest.registerClass("$h.SaveDictionaryRequest",$h.RequestBase);
  9603. $h.ScriptHelpers.registerClass("$h.ScriptHelpers");
  9604. window["OSF"]["DDA"]["OutlookAppOm"].asyncMethodTimeoutKeyName="__timeout__";
  9605. window["OSF"]["DDA"]["OutlookAppOm"].ewsIdOrEmailParamName="ewsIdOrEmail";
  9606. window["OSF"]["DDA"]["OutlookAppOm"]._maxRecipients$p=100;
  9607. window["OSF"]["DDA"]["OutlookAppOm"]._maxSubjectLength$p=255;
  9608. window["OSF"]["DDA"]["OutlookAppOm"].maxBodyLength=32768;
  9609. window["OSF"]["DDA"]["OutlookAppOm"]._maxLocationLength$p=255;
  9610. window["OSF"]["DDA"]["OutlookAppOm"]._maxEwsRequestSize$p=1e6;
  9611. window["OSF"]["DDA"]["OutlookAppOm"].executeMethodName="ExecuteMethod";
  9612. window["OSF"]["DDA"]["OutlookAppOm"].getInitialDataMethodName="GetInitialData";
  9613. window["OSF"]["DDA"]["OutlookAppOm"].itemIdParameterName="itemId";
  9614. window["OSF"]["DDA"]["OutlookAppOm"].restVersionParameterName="restVersion";
  9615. window["OSF"]["DDA"]["OutlookAppOm"]._instance$p=null;
  9616. $h.AttachmentConstants.maxAttachmentNameLength=255;
  9617. $h.AttachmentConstants.maxUrlLength=2048;
  9618. $h.AttachmentConstants.maxItemIdLength=200;
  9619. $h.AttachmentConstants.maxRemoveIdLength=200;
  9620. $h.AttachmentConstants.attachmentParameterName="attachments";
  9621. $h.AttachmentConstants.attachmentTypeParameterName="type";
  9622. $h.AttachmentConstants.attachmentUrlParameterName="url";
  9623. $h.AttachmentConstants.attachmentItemIdParameterName="itemId";
  9624. $h.AttachmentConstants.attachmentNameParameterName="name";
  9625. $h.AttachmentConstants.attachmentTypeFileName="file";
  9626. $h.AttachmentConstants.attachmentTypeItemName="item";
  9627. $h.AttachmentDetails._attachmentTypeMap$p=[window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["AttachmentType"]["File"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["AttachmentType"]["Item"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["AttachmentType"]["Cloud"]];
  9628. $h.Body.coercionTypeParameterName="coercionType";
  9629. $h.ComposeRecipient.displayNameLengthLimit=255;
  9630. $h.ComposeRecipient.maxSmtpLength=571;
  9631. $h.ComposeRecipient.recipientsLimit=100;
  9632. $h.ComposeRecipient.totalRecipientsLimit=500;
  9633. $h.ComposeRecipient.addressParameterName="address";
  9634. $h.ComposeRecipient.nameParameterName="name";
  9635. $h.ComposeLocation.locationKey="location";
  9636. $h.ComposeLocation.maximumLocationLength=255;
  9637. $h.ComposeSubject.maximumSubjectLength=255;
  9638. $h.ComposeTime.timeTypeName="TimeProperty";
  9639. $h.ComposeTime.timeDataName="time";
  9640. $h.Diagnostics.outlookAppName="Outlook";
  9641. $h.Diagnostics.outlookWebAppName="OutlookWebApp";
  9642. $h.EmailAddressDetails._emptyString$p="";
  9643. $h.EmailAddressDetails._responseTypeMap$p=[window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ResponseType"]["None"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ResponseType"]["Organizer"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ResponseType"]["Tentative"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ResponseType"]["Accepted"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["ResponseType"]["Declined"]];
  9644. $h.EmailAddressDetails._recipientTypeMap$p=[window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RecipientType"]["Other"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RecipientType"]["DistributionList"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RecipientType"]["User"],window["Microsoft"]["Office"]["WebExtension"]["MailboxEnums"]["RecipientType"]["ExternalUser"]];
  9645. $h.Entities._allEntityKeys$p=["Addresses","EmailAddresses","Urls","PhoneNumbers","TaskSuggestions","MeetingSuggestions","Contacts","FlightReservations","ParcelDeliveries"];
  9646. $h.ReplyConstants.htmlBodyKeyName="htmlBody";
  9647. $h.AsyncConstants.optionsKeyName="options";
  9648. $h.AsyncConstants.callbackKeyName="callback";
  9649. $h.AsyncConstants.asyncResultKeyName="asyncResult";
  9650. $h.MeetingSuggestionTimeDecoder._baseDate$p=new Date("0001-01-01T00:00:00Z");
  9651. $h.NotificationMessages.maximumKeyLength=32;
  9652. $h.NotificationMessages.maximumIconLength=32;
  9653. $h.NotificationMessages.maximumMessageLength=150;
  9654. $h.NotificationMessages.notificationsKeyParameterName="key";
  9655. $h.NotificationMessages.notificationsTypeParameterName="type";
  9656. $h.NotificationMessages.notificationsIconParameterName="icon";
  9657. $h.NotificationMessages.notificationsMessageParameterName="message";
  9658. $h.NotificationMessages.notificationsPersistentParameterName="persistent";
  9659. $h.OutlookErrorManager.errorNameKey="name";
  9660. $h.OutlookErrorManager.errorMessageKey="message";
  9661. $h.OutlookErrorManager._isInitialized$p=false;
  9662. $h.OutlookErrorManager.OutlookErrorCodes.attachmentSizeExceeded=9e3;
  9663. $h.OutlookErrorManager.OutlookErrorCodes.numberOfAttachmentsExceeded=9001;
  9664. $h.OutlookErrorManager.OutlookErrorCodes.internalFormatError=9002;
  9665. $h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentId=9003;
  9666. $h.OutlookErrorManager.OutlookErrorCodes.invalidAttachmentPath=9004;
  9667. $h.OutlookErrorManager.OutlookErrorCodes.cannotAddAttachmentBeforeUpgrade=9005;
  9668. $h.OutlookErrorManager.OutlookErrorCodes.attachmentDeletedBeforeUploadCompletes=9006;
  9669. $h.OutlookErrorManager.OutlookErrorCodes.attachmentUploadGeneralFailure=9007;
  9670. $h.OutlookErrorManager.OutlookErrorCodes.attachmentToDeleteDoesNotExist=9008;
  9671. $h.OutlookErrorManager.OutlookErrorCodes.attachmentDeleteGeneralFailure=9009;
  9672. $h.OutlookErrorManager.OutlookErrorCodes.invalidEndTime=9010;
  9673. $h.OutlookErrorManager.OutlookErrorCodes.htmlSanitizationFailure=9011;
  9674. $h.OutlookErrorManager.OutlookErrorCodes.numberOfRecipientsExceeded=9012;
  9675. $h.OutlookErrorManager.OutlookErrorCodes.noValidRecipientsProvided=9013;
  9676. $h.OutlookErrorManager.OutlookErrorCodes.cursorPositionChanged=9014;
  9677. $h.OutlookErrorManager.OutlookErrorCodes.invalidSelection=9016;
  9678. $h.OutlookErrorManager.OutlookErrorCodes.accessRestricted=9017;
  9679. $h.OutlookErrorManager.OutlookErrorCodes.genericTokenError=9018;
  9680. $h.OutlookErrorManager.OutlookErrorCodes.genericSettingsError=9019;
  9681. $h.OutlookErrorManager.OutlookErrorCodes.genericResponseError=9020;
  9682. $h.OutlookErrorManager.OutlookErrorCodes.saveError=9021;
  9683. $h.OutlookErrorManager.OutlookErrorCodes.messageInDifferentStoreError=9022;
  9684. $h.OutlookErrorManager.OutlookErrorCodes.duplicateNotificationKey=9023;
  9685. $h.OutlookErrorManager.OutlookErrorCodes.notificationKeyNotFound=9024;
  9686. $h.OutlookErrorManager.OutlookErrorCodes.numberOfNotificationsExceeded=9025;
  9687. $h.OutlookErrorManager.OutlookErrorCodes.persistedNotificationArrayReadError=9026;
  9688. $h.OutlookErrorManager.OutlookErrorCodes.persistedNotificationArraySaveError=9027;
  9689. $h.OutlookErrorManager.OutlookErrorCodes.cannotPersistPropertyInUnsavedDraftError=9028;
  9690. $h.OutlookErrorManager.OutlookErrorCodes.ooeInvalidDataFormat=2006;
  9691. $h.OutlookErrorManager.OsfDdaErrorCodes.ooeCoercionTypeNotSupported=1e3;
  9692. $h.CommonParameters.asyncContextKeyName="asyncContext";
  9693. $h.InitialData.userProfileTypeKey="userProfileType";
  9694. $h.ScriptHelpers.emptyString="";
  9695. OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);
  9696. if(appContext.get_appName()==OSF.AppName.OutlookWebApp || appContext.get_appName()==OSF.AppName.OutlookIOS)
  9697. this._settings=this._initializeSettings(appContext,false);
  9698. else
  9699. this._settings=this._initializeSettings(false);
  9700. appContext.appOM=new OSF.DDA.OutlookAppOm(appContext,this._webAppState.wnd,appReady)
  9701. }