Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

outlook-web-16.00.debug.js 404KB

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