components.js 1.8 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428
  1. /*!
  2. * jQuery JavaScript Library v2.1.1-pre
  3. * http://jquery.com/
  4. *
  5. * Includes Sizzle.js
  6. * http://sizzlejs.com/
  7. *
  8. * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
  9. * Released under the MIT license
  10. * http://jquery.org/license
  11. *
  12. * Date: 2014-10-30T07:56Z
  13. */
  14. (function( global, factory ) {
  15. if ( typeof module === "object" && typeof module.exports === "object" ) {
  16. // For CommonJS and CommonJS-like environments where a proper window is present,
  17. // execute the factory and get jQuery
  18. // For environments that do not inherently posses a window with a document
  19. // (such as Node.js), expose a jQuery-making factory as module.exports
  20. // This accentuates the need for the creation of a real window
  21. // e.g. var jQuery = require("jquery")(window);
  22. // See ticket #14549 for more info
  23. module.exports = global.document ?
  24. factory( global, true ) :
  25. function( w ) {
  26. if ( !w.document ) {
  27. throw new Error( "jQuery requires a window with a document" );
  28. }
  29. return factory( w );
  30. };
  31. } else {
  32. factory( global );
  33. }
  34. // Pass this if window is not defined yet
  35. }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  36. // Can't do this because several apps including ASP.NET trace
  37. // the stack via arguments.caller.callee and Firefox dies if
  38. // you try to trace through "use strict" call chains. (#13335)
  39. // Support: Firefox 18+
  40. //
  41. var arr = [];
  42. var slice = arr.slice;
  43. var concat = arr.concat;
  44. var push = arr.push;
  45. var indexOf = arr.indexOf;
  46. var class2type = {};
  47. var toString = class2type.toString;
  48. var hasOwn = class2type.hasOwnProperty;
  49. var support = {};
  50. var
  51. // Use the correct document accordingly with window argument (sandbox)
  52. document = window.document,
  53. version = "2.1.1-pre",
  54. // Define a local copy of jQuery
  55. jQuery = function( selector, context ) {
  56. // The jQuery object is actually just the init constructor 'enhanced'
  57. // Need init if jQuery is called (just allow error to be thrown if not included)
  58. return new jQuery.fn.init( selector, context );
  59. },
  60. // Support: Android<4.1
  61. // Make sure we trim BOM and NBSP
  62. rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  63. // Matches dashed string for camelizing
  64. rmsPrefix = /^-ms-/,
  65. rdashAlpha = /-([\da-z])/gi,
  66. // Used by jQuery.camelCase as callback to replace()
  67. fcamelCase = function( all, letter ) {
  68. return letter.toUpperCase();
  69. };
  70. jQuery.fn = jQuery.prototype = {
  71. // The current version of jQuery being used
  72. jquery: version,
  73. constructor: jQuery,
  74. // Start with an empty selector
  75. selector: "",
  76. // The default length of a jQuery object is 0
  77. length: 0,
  78. toArray: function() {
  79. return slice.call( this );
  80. },
  81. // Get the Nth element in the matched element set OR
  82. // Get the whole matched element set as a clean array
  83. get: function( num ) {
  84. return num != null ?
  85. // Return just the one element from the set
  86. ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
  87. // Return all the elements in a clean array
  88. slice.call( this );
  89. },
  90. // Take an array of elements and push it onto the stack
  91. // (returning the new matched element set)
  92. pushStack: function( elems ) {
  93. // Build a new jQuery matched element set
  94. var ret = jQuery.merge( this.constructor(), elems );
  95. // Add the old object onto the stack (as a reference)
  96. ret.prevObject = this;
  97. ret.context = this.context;
  98. // Return the newly-formed element set
  99. return ret;
  100. },
  101. // Execute a callback for every element in the matched set.
  102. // (You can seed the arguments with an array of args, but this is
  103. // only used internally.)
  104. each: function( callback, args ) {
  105. return jQuery.each( this, callback, args );
  106. },
  107. map: function( callback ) {
  108. return this.pushStack( jQuery.map(this, function( elem, i ) {
  109. return callback.call( elem, i, elem );
  110. }));
  111. },
  112. slice: function() {
  113. return this.pushStack( slice.apply( this, arguments ) );
  114. },
  115. first: function() {
  116. return this.eq( 0 );
  117. },
  118. last: function() {
  119. return this.eq( -1 );
  120. },
  121. eq: function( i ) {
  122. var len = this.length,
  123. j = +i + ( i < 0 ? len : 0 );
  124. return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
  125. },
  126. end: function() {
  127. return this.prevObject || this.constructor(null);
  128. },
  129. // For internal use only.
  130. // Behaves like an Array's method, not like a jQuery method.
  131. push: push,
  132. sort: arr.sort,
  133. splice: arr.splice
  134. };
  135. jQuery.extend = jQuery.fn.extend = function() {
  136. var options, name, src, copy, copyIsArray, clone,
  137. target = arguments[0] || {},
  138. i = 1,
  139. length = arguments.length,
  140. deep = false;
  141. // Handle a deep copy situation
  142. if ( typeof target === "boolean" ) {
  143. deep = target;
  144. // skip the boolean and the target
  145. target = arguments[ i ] || {};
  146. i++;
  147. }
  148. // Handle case when target is a string or something (possible in deep copy)
  149. if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
  150. target = {};
  151. }
  152. // extend jQuery itself if only one argument is passed
  153. if ( i === length ) {
  154. target = this;
  155. i--;
  156. }
  157. for ( ; i < length; i++ ) {
  158. // Only deal with non-null/undefined values
  159. if ( (options = arguments[ i ]) != null ) {
  160. // Extend the base object
  161. for ( name in options ) {
  162. src = target[ name ];
  163. copy = options[ name ];
  164. // Prevent never-ending loop
  165. if ( target === copy ) {
  166. continue;
  167. }
  168. // Recurse if we're merging plain objects or arrays
  169. if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
  170. if ( copyIsArray ) {
  171. copyIsArray = false;
  172. clone = src && jQuery.isArray(src) ? src : [];
  173. } else {
  174. clone = src && jQuery.isPlainObject(src) ? src : {};
  175. }
  176. // Never move original objects, clone them
  177. target[ name ] = jQuery.extend( deep, clone, copy );
  178. // Don't bring in undefined values
  179. } else if ( copy !== undefined ) {
  180. target[ name ] = copy;
  181. }
  182. }
  183. }
  184. }
  185. // Return the modified object
  186. return target;
  187. };
  188. jQuery.extend({
  189. // Unique for each copy of jQuery on the page
  190. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  191. // Assume jQuery is ready without the ready module
  192. isReady: true,
  193. error: function( msg ) {
  194. throw new Error( msg );
  195. },
  196. noop: function() {},
  197. // See test/unit/core.js for details concerning isFunction.
  198. // Since version 1.3, DOM methods and functions like alert
  199. // aren't supported. They return false on IE (#2968).
  200. isFunction: function( obj ) {
  201. return jQuery.type(obj) === "function";
  202. },
  203. isArray: Array.isArray,
  204. isWindow: function( obj ) {
  205. return obj != null && obj === obj.window;
  206. },
  207. isNumeric: function( obj ) {
  208. // parseFloat NaNs numeric-cast false positives (null|true|false|"")
  209. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  210. // subtraction forces infinities to NaN
  211. return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0;
  212. },
  213. isPlainObject: function( obj ) {
  214. // Not plain objects:
  215. // - Any object or value whose internal [[Class]] property is not "[object Object]"
  216. // - DOM nodes
  217. // - window
  218. if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
  219. return false;
  220. }
  221. if ( obj.constructor &&
  222. !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
  223. return false;
  224. }
  225. // If the function hasn't returned already, we're confident that
  226. // |obj| is a plain object, created by {} or constructed with new Object
  227. return true;
  228. },
  229. isEmptyObject: function( obj ) {
  230. var name;
  231. for ( name in obj ) {
  232. return false;
  233. }
  234. return true;
  235. },
  236. type: function( obj ) {
  237. if ( obj == null ) {
  238. return obj + "";
  239. }
  240. // Support: Android < 4.0, iOS < 6 (functionish RegExp)
  241. return typeof obj === "object" || typeof obj === "function" ?
  242. class2type[ toString.call(obj) ] || "object" :
  243. typeof obj;
  244. },
  245. // Evaluates a script in a global context
  246. globalEval: function( code ) {
  247. var script,
  248. indirect = eval;
  249. code = jQuery.trim( code );
  250. if ( code ) {
  251. // If the code includes a valid, prologue position
  252. // strict mode pragma, execute code by injecting a
  253. // script tag into the document.
  254. if ( code.indexOf("use strict") === 1 ) {
  255. script = document.createElement("script");
  256. script.text = code;
  257. document.head.appendChild( script ).parentNode.removeChild( script );
  258. } else {
  259. // Otherwise, avoid the DOM node creation, insertion
  260. // and removal by using an indirect global eval
  261. indirect( code );
  262. }
  263. }
  264. },
  265. // Convert dashed to camelCase; used by the css and data modules
  266. // Microsoft forgot to hump their vendor prefix (#9572)
  267. camelCase: function( string ) {
  268. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  269. },
  270. nodeName: function( elem, name ) {
  271. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  272. },
  273. // args is for internal usage only
  274. each: function( obj, callback, args ) {
  275. var value,
  276. i = 0,
  277. length = obj.length,
  278. isArray = isArraylike( obj );
  279. if ( args ) {
  280. if ( isArray ) {
  281. for ( ; i < length; i++ ) {
  282. value = callback.apply( obj[ i ], args );
  283. if ( value === false ) {
  284. break;
  285. }
  286. }
  287. } else {
  288. for ( i in obj ) {
  289. value = callback.apply( obj[ i ], args );
  290. if ( value === false ) {
  291. break;
  292. }
  293. }
  294. }
  295. // A special, fast, case for the most common use of each
  296. } else {
  297. if ( isArray ) {
  298. for ( ; i < length; i++ ) {
  299. value = callback.call( obj[ i ], i, obj[ i ] );
  300. if ( value === false ) {
  301. break;
  302. }
  303. }
  304. } else {
  305. for ( i in obj ) {
  306. value = callback.call( obj[ i ], i, obj[ i ] );
  307. if ( value === false ) {
  308. break;
  309. }
  310. }
  311. }
  312. }
  313. return obj;
  314. },
  315. // Support: Android<4.1
  316. trim: function( text ) {
  317. return text == null ?
  318. "" :
  319. ( text + "" ).replace( rtrim, "" );
  320. },
  321. // results is for internal usage only
  322. makeArray: function( arr, results ) {
  323. var ret = results || [];
  324. if ( arr != null ) {
  325. if ( isArraylike( Object(arr) ) ) {
  326. jQuery.merge( ret,
  327. typeof arr === "string" ?
  328. [ arr ] : arr
  329. );
  330. } else {
  331. push.call( ret, arr );
  332. }
  333. }
  334. return ret;
  335. },
  336. inArray: function( elem, arr, i ) {
  337. return arr == null ? -1 : indexOf.call( arr, elem, i );
  338. },
  339. merge: function( first, second ) {
  340. var len = +second.length,
  341. j = 0,
  342. i = first.length;
  343. for ( ; j < len; j++ ) {
  344. first[ i++ ] = second[ j ];
  345. }
  346. first.length = i;
  347. return first;
  348. },
  349. grep: function( elems, callback, invert ) {
  350. var callbackInverse,
  351. matches = [],
  352. i = 0,
  353. length = elems.length,
  354. callbackExpect = !invert;
  355. // Go through the array, only saving the items
  356. // that pass the validator function
  357. for ( ; i < length; i++ ) {
  358. callbackInverse = !callback( elems[ i ], i );
  359. if ( callbackInverse !== callbackExpect ) {
  360. matches.push( elems[ i ] );
  361. }
  362. }
  363. return matches;
  364. },
  365. // arg is for internal usage only
  366. map: function( elems, callback, arg ) {
  367. var value,
  368. i = 0,
  369. length = elems.length,
  370. isArray = isArraylike( elems ),
  371. ret = [];
  372. // Go through the array, translating each of the items to their new values
  373. if ( isArray ) {
  374. for ( ; i < length; i++ ) {
  375. value = callback( elems[ i ], i, arg );
  376. if ( value != null ) {
  377. ret.push( value );
  378. }
  379. }
  380. // Go through every key on the object,
  381. } else {
  382. for ( i in elems ) {
  383. value = callback( elems[ i ], i, arg );
  384. if ( value != null ) {
  385. ret.push( value );
  386. }
  387. }
  388. }
  389. // Flatten any nested arrays
  390. return concat.apply( [], ret );
  391. },
  392. // A global GUID counter for objects
  393. guid: 1,
  394. // Bind a function to a context, optionally partially applying any
  395. // arguments.
  396. proxy: function( fn, context ) {
  397. var tmp, args, proxy;
  398. if ( typeof context === "string" ) {
  399. tmp = fn[ context ];
  400. context = fn;
  401. fn = tmp;
  402. }
  403. // Quick check to determine if target is callable, in the spec
  404. // this throws a TypeError, but we will just return undefined.
  405. if ( !jQuery.isFunction( fn ) ) {
  406. return undefined;
  407. }
  408. // Simulated bind
  409. args = slice.call( arguments, 2 );
  410. proxy = function() {
  411. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  412. };
  413. // Set the guid of unique handler to the same of original handler, so it can be removed
  414. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  415. return proxy;
  416. },
  417. now: Date.now,
  418. // jQuery.support is not used in Core but other projects attach their
  419. // properties to it so it needs to exist.
  420. support: support
  421. });
  422. // Populate the class2type map
  423. jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
  424. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  425. });
  426. function isArraylike( obj ) {
  427. var length = obj.length,
  428. type = jQuery.type( obj );
  429. if ( type === "function" || jQuery.isWindow( obj ) ) {
  430. return false;
  431. }
  432. if ( obj.nodeType === 1 && length ) {
  433. return true;
  434. }
  435. return type === "array" || length === 0 ||
  436. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  437. }
  438. var Sizzle =
  439. /*!
  440. * Sizzle CSS Selector Engine v1.10.19
  441. * http://sizzlejs.com/
  442. *
  443. * Copyright 2013 jQuery Foundation, Inc. and other contributors
  444. * Released under the MIT license
  445. * http://jquery.org/license
  446. *
  447. * Date: 2014-04-18
  448. */
  449. (function( window ) {
  450. var i,
  451. support,
  452. Expr,
  453. getText,
  454. isXML,
  455. tokenize,
  456. compile,
  457. select,
  458. outermostContext,
  459. sortInput,
  460. hasDuplicate,
  461. // Local document vars
  462. setDocument,
  463. document,
  464. docElem,
  465. documentIsHTML,
  466. rbuggyQSA,
  467. rbuggyMatches,
  468. matches,
  469. contains,
  470. // Instance-specific data
  471. expando = "sizzle" + -(new Date()),
  472. preferredDoc = window.document,
  473. dirruns = 0,
  474. done = 0,
  475. classCache = createCache(),
  476. tokenCache = createCache(),
  477. compilerCache = createCache(),
  478. sortOrder = function( a, b ) {
  479. if ( a === b ) {
  480. hasDuplicate = true;
  481. }
  482. return 0;
  483. },
  484. // General-purpose constants
  485. strundefined = typeof undefined,
  486. MAX_NEGATIVE = 1 << 31,
  487. // Instance methods
  488. hasOwn = ({}).hasOwnProperty,
  489. arr = [],
  490. pop = arr.pop,
  491. push_native = arr.push,
  492. push = arr.push,
  493. slice = arr.slice,
  494. // Use a stripped-down indexOf if we can't use a native one
  495. indexOf = arr.indexOf || function( elem ) {
  496. var i = 0,
  497. len = this.length;
  498. for ( ; i < len; i++ ) {
  499. if ( this[i] === elem ) {
  500. return i;
  501. }
  502. }
  503. return -1;
  504. },
  505. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  506. // Regular expressions
  507. // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
  508. whitespace = "[\\x20\\t\\r\\n\\f]",
  509. // http://www.w3.org/TR/css3-syntax/#characters
  510. characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
  511. // Loosely modeled on CSS identifier characters
  512. // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
  513. // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  514. identifier = characterEncoding.replace( "w", "w#" ),
  515. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  516. attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
  517. // Operator (capture 2)
  518. "*([*^$|!~]?=)" + whitespace +
  519. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  520. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
  521. "*\\]",
  522. pseudos = ":(" + characterEncoding + ")(?:\\((" +
  523. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  524. // 1. quoted (capture 3; capture 4 or capture 5)
  525. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  526. // 2. simple (capture 6)
  527. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  528. // 3. anything else (capture 2)
  529. ".*" +
  530. ")\\)|)",
  531. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  532. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
  533. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  534. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
  535. rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
  536. rpseudo = new RegExp( pseudos ),
  537. ridentifier = new RegExp( "^" + identifier + "$" ),
  538. matchExpr = {
  539. "ID": new RegExp( "^#(" + characterEncoding + ")" ),
  540. "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
  541. "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
  542. "ATTR": new RegExp( "^" + attributes ),
  543. "PSEUDO": new RegExp( "^" + pseudos ),
  544. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
  545. "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
  546. "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  547. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  548. // For use in libraries implementing .is()
  549. // We use this for POS matching in `select`
  550. "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
  551. whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  552. },
  553. rinputs = /^(?:input|select|textarea|button)$/i,
  554. rheader = /^h\d$/i,
  555. rnative = /^[^{]+\{\s*\[native \w/,
  556. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  557. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  558. rsibling = /[+~]/,
  559. rescape = /'|\\/g,
  560. // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  561. runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
  562. funescape = function( _, escaped, escapedWhitespace ) {
  563. var high = "0x" + escaped - 0x10000;
  564. // NaN means non-codepoint
  565. // Support: Firefox<24
  566. // Workaround erroneous numeric interpretation of +"0x"
  567. return high !== high || escapedWhitespace ?
  568. escaped :
  569. high < 0 ?
  570. // BMP codepoint
  571. String.fromCharCode( high + 0x10000 ) :
  572. // Supplemental Plane codepoint (surrogate pair)
  573. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  574. };
  575. // Optimize for push.apply( _, NodeList )
  576. try {
  577. push.apply(
  578. (arr = slice.call( preferredDoc.childNodes )),
  579. preferredDoc.childNodes
  580. );
  581. // Support: Android<4.0
  582. // Detect silently failing push.apply
  583. arr[ preferredDoc.childNodes.length ].nodeType;
  584. } catch ( e ) {
  585. push = { apply: arr.length ?
  586. // Leverage slice if possible
  587. function( target, els ) {
  588. push_native.apply( target, slice.call(els) );
  589. } :
  590. // Support: IE<9
  591. // Otherwise append directly
  592. function( target, els ) {
  593. var j = target.length,
  594. i = 0;
  595. // Can't trust NodeList.length
  596. while ( (target[j++] = els[i++]) ) {}
  597. target.length = j - 1;
  598. }
  599. };
  600. }
  601. function Sizzle( selector, context, results, seed ) {
  602. var match, elem, m, nodeType,
  603. // QSA vars
  604. i, groups, old, nid, newContext, newSelector;
  605. if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
  606. setDocument( context );
  607. }
  608. context = context || document;
  609. results = results || [];
  610. if ( !selector || typeof selector !== "string" ) {
  611. return results;
  612. }
  613. if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
  614. return [];
  615. }
  616. if ( documentIsHTML && !seed ) {
  617. // Shortcuts
  618. if ( (match = rquickExpr.exec( selector )) ) {
  619. // Speed-up: Sizzle("#ID")
  620. if ( (m = match[1]) ) {
  621. if ( nodeType === 9 ) {
  622. elem = context.getElementById( m );
  623. // Check parentNode to catch when Blackberry 4.6 returns
  624. // nodes that are no longer in the document (jQuery #6963)
  625. if ( elem && elem.parentNode ) {
  626. // Handle the case where IE, Opera, and Webkit return items
  627. // by name instead of ID
  628. if ( elem.id === m ) {
  629. results.push( elem );
  630. return results;
  631. }
  632. } else {
  633. return results;
  634. }
  635. } else {
  636. // Context is not a document
  637. if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
  638. contains( context, elem ) && elem.id === m ) {
  639. results.push( elem );
  640. return results;
  641. }
  642. }
  643. // Speed-up: Sizzle("TAG")
  644. } else if ( match[2] ) {
  645. push.apply( results, context.getElementsByTagName( selector ) );
  646. return results;
  647. // Speed-up: Sizzle(".CLASS")
  648. } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
  649. push.apply( results, context.getElementsByClassName( m ) );
  650. return results;
  651. }
  652. }
  653. // QSA path
  654. if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
  655. nid = old = expando;
  656. newContext = context;
  657. newSelector = nodeType === 9 && selector;
  658. // qSA works strangely on Element-rooted queries
  659. // We can work around this by specifying an extra ID on the root
  660. // and working up from there (Thanks to Andrew Dupont for the technique)
  661. // IE 8 doesn't work on object elements
  662. if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
  663. groups = tokenize( selector );
  664. if ( (old = context.getAttribute("id")) ) {
  665. nid = old.replace( rescape, "\\$&" );
  666. } else {
  667. context.setAttribute( "id", nid );
  668. }
  669. nid = "[id='" + nid + "'] ";
  670. i = groups.length;
  671. while ( i-- ) {
  672. groups[i] = nid + toSelector( groups[i] );
  673. }
  674. newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
  675. newSelector = groups.join(",");
  676. }
  677. if ( newSelector ) {
  678. try {
  679. push.apply( results,
  680. newContext.querySelectorAll( newSelector )
  681. );
  682. return results;
  683. } catch(qsaError) {
  684. } finally {
  685. if ( !old ) {
  686. context.removeAttribute("id");
  687. }
  688. }
  689. }
  690. }
  691. }
  692. // All others
  693. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  694. }
  695. /**
  696. * Create key-value caches of limited size
  697. * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
  698. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  699. * deleting the oldest entry
  700. */
  701. function createCache() {
  702. var keys = [];
  703. function cache( key, value ) {
  704. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  705. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  706. // Only keep the most recent entries
  707. delete cache[ keys.shift() ];
  708. }
  709. return (cache[ key + " " ] = value);
  710. }
  711. return cache;
  712. }
  713. /**
  714. * Mark a function for special use by Sizzle
  715. * @param {Function} fn The function to mark
  716. */
  717. function markFunction( fn ) {
  718. fn[ expando ] = true;
  719. return fn;
  720. }
  721. /**
  722. * Support testing using an element
  723. * @param {Function} fn Passed the created div and expects a boolean result
  724. */
  725. function assert( fn ) {
  726. var div = document.createElement("div");
  727. try {
  728. return !!fn( div );
  729. } catch (e) {
  730. return false;
  731. } finally {
  732. // Remove from its parent by default
  733. if ( div.parentNode ) {
  734. div.parentNode.removeChild( div );
  735. }
  736. // release memory in IE
  737. div = null;
  738. }
  739. }
  740. /**
  741. * Adds the same handler for all of the specified attrs
  742. * @param {String} attrs Pipe-separated list of attributes
  743. * @param {Function} handler The method that will be applied
  744. */
  745. function addHandle( attrs, handler ) {
  746. var arr = attrs.split("|"),
  747. i = attrs.length;
  748. while ( i-- ) {
  749. Expr.attrHandle[ arr[i] ] = handler;
  750. }
  751. }
  752. /**
  753. * Checks document order of two siblings
  754. * @param {Element} a
  755. * @param {Element} b
  756. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  757. */
  758. function siblingCheck( a, b ) {
  759. var cur = b && a,
  760. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  761. ( ~b.sourceIndex || MAX_NEGATIVE ) -
  762. ( ~a.sourceIndex || MAX_NEGATIVE );
  763. // Use IE sourceIndex if available on both nodes
  764. if ( diff ) {
  765. return diff;
  766. }
  767. // Check if b follows a
  768. if ( cur ) {
  769. while ( (cur = cur.nextSibling) ) {
  770. if ( cur === b ) {
  771. return -1;
  772. }
  773. }
  774. }
  775. return a ? 1 : -1;
  776. }
  777. /**
  778. * Returns a function to use in pseudos for input types
  779. * @param {String} type
  780. */
  781. function createInputPseudo( type ) {
  782. return function( elem ) {
  783. var name = elem.nodeName.toLowerCase();
  784. return name === "input" && elem.type === type;
  785. };
  786. }
  787. /**
  788. * Returns a function to use in pseudos for buttons
  789. * @param {String} type
  790. */
  791. function createButtonPseudo( type ) {
  792. return function( elem ) {
  793. var name = elem.nodeName.toLowerCase();
  794. return (name === "input" || name === "button") && elem.type === type;
  795. };
  796. }
  797. /**
  798. * Returns a function to use in pseudos for positionals
  799. * @param {Function} fn
  800. */
  801. function createPositionalPseudo( fn ) {
  802. return markFunction(function( argument ) {
  803. argument = +argument;
  804. return markFunction(function( seed, matches ) {
  805. var j,
  806. matchIndexes = fn( [], seed.length, argument ),
  807. i = matchIndexes.length;
  808. // Match elements found at the specified indexes
  809. while ( i-- ) {
  810. if ( seed[ (j = matchIndexes[i]) ] ) {
  811. seed[j] = !(matches[j] = seed[j]);
  812. }
  813. }
  814. });
  815. });
  816. }
  817. /**
  818. * Checks a node for validity as a Sizzle context
  819. * @param {Element|Object=} context
  820. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  821. */
  822. function testContext( context ) {
  823. return context && typeof context.getElementsByTagName !== strundefined && context;
  824. }
  825. // Expose support vars for convenience
  826. support = Sizzle.support = {};
  827. /**
  828. * Detects XML nodes
  829. * @param {Element|Object} elem An element or a document
  830. * @returns {Boolean} True iff elem is a non-HTML XML node
  831. */
  832. isXML = Sizzle.isXML = function( elem ) {
  833. // documentElement is verified for cases where it doesn't yet exist
  834. // (such as loading iframes in IE - #4833)
  835. var documentElement = elem && (elem.ownerDocument || elem).documentElement;
  836. return documentElement ? documentElement.nodeName !== "HTML" : false;
  837. };
  838. /**
  839. * Sets document-related variables once based on the current document
  840. * @param {Element|Object} [doc] An element or document object to use to set the document
  841. * @returns {Object} Returns the current document
  842. */
  843. setDocument = Sizzle.setDocument = function( node ) {
  844. var hasCompare,
  845. doc = node ? node.ownerDocument || node : preferredDoc,
  846. parent = doc.defaultView;
  847. // If no document and documentElement is available, return
  848. if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
  849. return document;
  850. }
  851. // Set our document
  852. document = doc;
  853. docElem = doc.documentElement;
  854. // Support tests
  855. documentIsHTML = !isXML( doc );
  856. // Support: IE>8
  857. // If iframe document is assigned to "document" variable and if iframe has been reloaded,
  858. // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
  859. // IE6-8 do not support the defaultView property so parent will be undefined
  860. if ( parent && parent !== parent.top ) {
  861. // IE11 does not have attachEvent, so all must suffer
  862. if ( parent.addEventListener ) {
  863. parent.addEventListener( "unload", function() {
  864. setDocument();
  865. }, false );
  866. } else if ( parent.attachEvent ) {
  867. parent.attachEvent( "onunload", function() {
  868. setDocument();
  869. });
  870. }
  871. }
  872. /* Attributes
  873. ---------------------------------------------------------------------- */
  874. // Support: IE<8
  875. // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
  876. support.attributes = assert(function( div ) {
  877. div.className = "i";
  878. return !div.getAttribute("className");
  879. });
  880. /* getElement(s)By*
  881. ---------------------------------------------------------------------- */
  882. // Check if getElementsByTagName("*") returns only elements
  883. support.getElementsByTagName = assert(function( div ) {
  884. div.appendChild( doc.createComment("") );
  885. return !div.getElementsByTagName("*").length;
  886. });
  887. // Check if getElementsByClassName can be trusted
  888. support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) {
  889. div.innerHTML = "<div class='a'></div><div class='a i'></div>";
  890. // Support: Safari<4
  891. // Catch class over-caching
  892. div.firstChild.className = "i";
  893. // Support: Opera<10
  894. // Catch gEBCN failure to find non-leading classes
  895. return div.getElementsByClassName("i").length === 2;
  896. });
  897. // Support: IE<10
  898. // Check if getElementById returns elements by name
  899. // The broken getElementById methods don't pick up programatically-set names,
  900. // so use a roundabout getElementsByName test
  901. support.getById = assert(function( div ) {
  902. docElem.appendChild( div ).id = expando;
  903. return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
  904. });
  905. // ID find and filter
  906. if ( support.getById ) {
  907. Expr.find["ID"] = function( id, context ) {
  908. if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
  909. var m = context.getElementById( id );
  910. // Check parentNode to catch when Blackberry 4.6 returns
  911. // nodes that are no longer in the document #6963
  912. return m && m.parentNode ? [ m ] : [];
  913. }
  914. };
  915. Expr.filter["ID"] = function( id ) {
  916. var attrId = id.replace( runescape, funescape );
  917. return function( elem ) {
  918. return elem.getAttribute("id") === attrId;
  919. };
  920. };
  921. } else {
  922. // Support: IE6/7
  923. // getElementById is not reliable as a find shortcut
  924. delete Expr.find["ID"];
  925. Expr.filter["ID"] = function( id ) {
  926. var attrId = id.replace( runescape, funescape );
  927. return function( elem ) {
  928. var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
  929. return node && node.value === attrId;
  930. };
  931. };
  932. }
  933. // Tag
  934. Expr.find["TAG"] = support.getElementsByTagName ?
  935. function( tag, context ) {
  936. if ( typeof context.getElementsByTagName !== strundefined ) {
  937. return context.getElementsByTagName( tag );
  938. }
  939. } :
  940. function( tag, context ) {
  941. var elem,
  942. tmp = [],
  943. i = 0,
  944. results = context.getElementsByTagName( tag );
  945. // Filter out possible comments
  946. if ( tag === "*" ) {
  947. while ( (elem = results[i++]) ) {
  948. if ( elem.nodeType === 1 ) {
  949. tmp.push( elem );
  950. }
  951. }
  952. return tmp;
  953. }
  954. return results;
  955. };
  956. // Class
  957. Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
  958. if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
  959. return context.getElementsByClassName( className );
  960. }
  961. };
  962. /* QSA/matchesSelector
  963. ---------------------------------------------------------------------- */
  964. // QSA and matchesSelector support
  965. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  966. rbuggyMatches = [];
  967. // qSa(:focus) reports false when true (Chrome 21)
  968. // We allow this because of a bug in IE8/9 that throws an error
  969. // whenever `document.activeElement` is accessed on an iframe
  970. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  971. // See http://bugs.jquery.com/ticket/13378
  972. rbuggyQSA = [];
  973. if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
  974. // Build QSA regex
  975. // Regex strategy adopted from Diego Perini
  976. assert(function( div ) {
  977. // Select is set to empty string on purpose
  978. // This is to test IE's treatment of not explicitly
  979. // setting a boolean content attribute,
  980. // since its presence should be enough
  981. // http://bugs.jquery.com/ticket/12359
  982. div.innerHTML = "<select msallowclip=''><option selected=''></option></select>";
  983. // Support: IE8, Opera 11-12.16
  984. // Nothing should be selected when empty strings follow ^= or $= or *=
  985. // The test attribute must be unknown in Opera but "safe" for WinRT
  986. // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  987. if ( div.querySelectorAll("[msallowclip^='']").length ) {
  988. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  989. }
  990. // Support: IE8
  991. // Boolean attributes and "value" are not treated correctly
  992. if ( !div.querySelectorAll("[selected]").length ) {
  993. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  994. }
  995. // Webkit/Opera - :checked should return selected option elements
  996. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  997. // IE8 throws error here and will not see later tests
  998. if ( !div.querySelectorAll(":checked").length ) {
  999. rbuggyQSA.push(":checked");
  1000. }
  1001. });
  1002. assert(function( div ) {
  1003. // Support: Windows 8 Native Apps
  1004. // The type and name attributes are restricted during .innerHTML assignment
  1005. var input = doc.createElement("input");
  1006. input.setAttribute( "type", "hidden" );
  1007. div.appendChild( input ).setAttribute( "name", "D" );
  1008. // Support: IE8
  1009. // Enforce case-sensitivity of name attribute
  1010. if ( div.querySelectorAll("[name=d]").length ) {
  1011. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  1012. }
  1013. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  1014. // IE8 throws error here and will not see later tests
  1015. if ( !div.querySelectorAll(":enabled").length ) {
  1016. rbuggyQSA.push( ":enabled", ":disabled" );
  1017. }
  1018. // Opera 10-11 does not throw on post-comma invalid pseudos
  1019. div.querySelectorAll("*,:x");
  1020. rbuggyQSA.push(",.*:");
  1021. });
  1022. }
  1023. if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
  1024. docElem.webkitMatchesSelector ||
  1025. docElem.mozMatchesSelector ||
  1026. docElem.oMatchesSelector ||
  1027. docElem.msMatchesSelector) )) ) {
  1028. assert(function( div ) {
  1029. // Check to see if it's possible to do matchesSelector
  1030. // on a disconnected node (IE 9)
  1031. support.disconnectedMatch = matches.call( div, "div" );
  1032. // This should fail with an exception
  1033. // Gecko does not error, returns false instead
  1034. matches.call( div, "[s!='']:x" );
  1035. rbuggyMatches.push( "!=", pseudos );
  1036. });
  1037. }
  1038. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
  1039. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
  1040. /* Contains
  1041. ---------------------------------------------------------------------- */
  1042. hasCompare = rnative.test( docElem.compareDocumentPosition );
  1043. // Element contains another
  1044. // Purposefully does not implement inclusive descendent
  1045. // As in, an element does not contain itself
  1046. contains = hasCompare || rnative.test( docElem.contains ) ?
  1047. function( a, b ) {
  1048. var adown = a.nodeType === 9 ? a.documentElement : a,
  1049. bup = b && b.parentNode;
  1050. return a === bup || !!( bup && bup.nodeType === 1 && (
  1051. adown.contains ?
  1052. adown.contains( bup ) :
  1053. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  1054. ));
  1055. } :
  1056. function( a, b ) {
  1057. if ( b ) {
  1058. while ( (b = b.parentNode) ) {
  1059. if ( b === a ) {
  1060. return true;
  1061. }
  1062. }
  1063. }
  1064. return false;
  1065. };
  1066. /* Sorting
  1067. ---------------------------------------------------------------------- */
  1068. // Document order sorting
  1069. sortOrder = hasCompare ?
  1070. function( a, b ) {
  1071. // Flag for duplicate removal
  1072. if ( a === b ) {
  1073. hasDuplicate = true;
  1074. return 0;
  1075. }
  1076. // Sort on method existence if only one input has compareDocumentPosition
  1077. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  1078. if ( compare ) {
  1079. return compare;
  1080. }
  1081. // Calculate position if both inputs belong to the same document
  1082. compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
  1083. a.compareDocumentPosition( b ) :
  1084. // Otherwise we know they are disconnected
  1085. 1;
  1086. // Disconnected nodes
  1087. if ( compare & 1 ||
  1088. (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
  1089. // Choose the first element that is related to our preferred document
  1090. if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
  1091. return -1;
  1092. }
  1093. if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
  1094. return 1;
  1095. }
  1096. // Maintain original order
  1097. return sortInput ?
  1098. ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
  1099. 0;
  1100. }
  1101. return compare & 4 ? -1 : 1;
  1102. } :
  1103. function( a, b ) {
  1104. // Exit early if the nodes are identical
  1105. if ( a === b ) {
  1106. hasDuplicate = true;
  1107. return 0;
  1108. }
  1109. var cur,
  1110. i = 0,
  1111. aup = a.parentNode,
  1112. bup = b.parentNode,
  1113. ap = [ a ],
  1114. bp = [ b ];
  1115. // Parentless nodes are either documents or disconnected
  1116. if ( !aup || !bup ) {
  1117. return a === doc ? -1 :
  1118. b === doc ? 1 :
  1119. aup ? -1 :
  1120. bup ? 1 :
  1121. sortInput ?
  1122. ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
  1123. 0;
  1124. // If the nodes are siblings, we can do a quick check
  1125. } else if ( aup === bup ) {
  1126. return siblingCheck( a, b );
  1127. }
  1128. // Otherwise we need full lists of their ancestors for comparison
  1129. cur = a;
  1130. while ( (cur = cur.parentNode) ) {
  1131. ap.unshift( cur );
  1132. }
  1133. cur = b;
  1134. while ( (cur = cur.parentNode) ) {
  1135. bp.unshift( cur );
  1136. }
  1137. // Walk down the tree looking for a discrepancy
  1138. while ( ap[i] === bp[i] ) {
  1139. i++;
  1140. }
  1141. return i ?
  1142. // Do a sibling check if the nodes have a common ancestor
  1143. siblingCheck( ap[i], bp[i] ) :
  1144. // Otherwise nodes in our document sort first
  1145. ap[i] === preferredDoc ? -1 :
  1146. bp[i] === preferredDoc ? 1 :
  1147. 0;
  1148. };
  1149. return doc;
  1150. };
  1151. Sizzle.matches = function( expr, elements ) {
  1152. return Sizzle( expr, null, null, elements );
  1153. };
  1154. Sizzle.matchesSelector = function( elem, expr ) {
  1155. // Set document vars if needed
  1156. if ( ( elem.ownerDocument || elem ) !== document ) {
  1157. setDocument( elem );
  1158. }
  1159. // Make sure that attribute selectors are quoted
  1160. expr = expr.replace( rattributeQuotes, "='$1']" );
  1161. if ( support.matchesSelector && documentIsHTML &&
  1162. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  1163. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  1164. try {
  1165. var ret = matches.call( elem, expr );
  1166. // IE 9's matchesSelector returns false on disconnected nodes
  1167. if ( ret || support.disconnectedMatch ||
  1168. // As well, disconnected nodes are said to be in a document
  1169. // fragment in IE 9
  1170. elem.document && elem.document.nodeType !== 11 ) {
  1171. return ret;
  1172. }
  1173. } catch(e) {}
  1174. }
  1175. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  1176. };
  1177. Sizzle.contains = function( context, elem ) {
  1178. // Set document vars if needed
  1179. if ( ( context.ownerDocument || context ) !== document ) {
  1180. setDocument( context );
  1181. }
  1182. return contains( context, elem );
  1183. };
  1184. Sizzle.attr = function( elem, name ) {
  1185. // Set document vars if needed
  1186. if ( ( elem.ownerDocument || elem ) !== document ) {
  1187. setDocument( elem );
  1188. }
  1189. var fn = Expr.attrHandle[ name.toLowerCase() ],
  1190. // Don't get fooled by Object.prototype properties (jQuery #13807)
  1191. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  1192. fn( elem, name, !documentIsHTML ) :
  1193. undefined;
  1194. return val !== undefined ?
  1195. val :
  1196. support.attributes || !documentIsHTML ?
  1197. elem.getAttribute( name ) :
  1198. (val = elem.getAttributeNode(name)) && val.specified ?
  1199. val.value :
  1200. null;
  1201. };
  1202. Sizzle.error = function( msg ) {
  1203. throw new Error( "Syntax error, unrecognized expression: " + msg );
  1204. };
  1205. /**
  1206. * Document sorting and removing duplicates
  1207. * @param {ArrayLike} results
  1208. */
  1209. Sizzle.uniqueSort = function( results ) {
  1210. var elem,
  1211. duplicates = [],
  1212. j = 0,
  1213. i = 0;
  1214. // Unless we *know* we can detect duplicates, assume their presence
  1215. hasDuplicate = !support.detectDuplicates;
  1216. sortInput = !support.sortStable && results.slice( 0 );
  1217. results.sort( sortOrder );
  1218. if ( hasDuplicate ) {
  1219. while ( (elem = results[i++]) ) {
  1220. if ( elem === results[ i ] ) {
  1221. j = duplicates.push( i );
  1222. }
  1223. }
  1224. while ( j-- ) {
  1225. results.splice( duplicates[ j ], 1 );
  1226. }
  1227. }
  1228. // Clear input after sorting to release objects
  1229. // See https://github.com/jquery/sizzle/pull/225
  1230. sortInput = null;
  1231. return results;
  1232. };
  1233. /**
  1234. * Utility function for retrieving the text value of an array of DOM nodes
  1235. * @param {Array|Element} elem
  1236. */
  1237. getText = Sizzle.getText = function( elem ) {
  1238. var node,
  1239. ret = "",
  1240. i = 0,
  1241. nodeType = elem.nodeType;
  1242. if ( !nodeType ) {
  1243. // If no nodeType, this is expected to be an array
  1244. while ( (node = elem[i++]) ) {
  1245. // Do not traverse comment nodes
  1246. ret += getText( node );
  1247. }
  1248. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  1249. // Use textContent for elements
  1250. // innerText usage removed for consistency of new lines (jQuery #11153)
  1251. if ( typeof elem.textContent === "string" ) {
  1252. return elem.textContent;
  1253. } else {
  1254. // Traverse its children
  1255. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1256. ret += getText( elem );
  1257. }
  1258. }
  1259. } else if ( nodeType === 3 || nodeType === 4 ) {
  1260. return elem.nodeValue;
  1261. }
  1262. // Do not include comment or processing instruction nodes
  1263. return ret;
  1264. };
  1265. Expr = Sizzle.selectors = {
  1266. // Can be adjusted by the user
  1267. cacheLength: 50,
  1268. createPseudo: markFunction,
  1269. match: matchExpr,
  1270. attrHandle: {},
  1271. find: {},
  1272. relative: {
  1273. ">": { dir: "parentNode", first: true },
  1274. " ": { dir: "parentNode" },
  1275. "+": { dir: "previousSibling", first: true },
  1276. "~": { dir: "previousSibling" }
  1277. },
  1278. preFilter: {
  1279. "ATTR": function( match ) {
  1280. match[1] = match[1].replace( runescape, funescape );
  1281. // Move the given value to match[3] whether quoted or unquoted
  1282. match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
  1283. if ( match[2] === "~=" ) {
  1284. match[3] = " " + match[3] + " ";
  1285. }
  1286. return match.slice( 0, 4 );
  1287. },
  1288. "CHILD": function( match ) {
  1289. /* matches from matchExpr["CHILD"]
  1290. 1 type (only|nth|...)
  1291. 2 what (child|of-type)
  1292. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  1293. 4 xn-component of xn+y argument ([+-]?\d*n|)
  1294. 5 sign of xn-component
  1295. 6 x of xn-component
  1296. 7 sign of y-component
  1297. 8 y of y-component
  1298. */
  1299. match[1] = match[1].toLowerCase();
  1300. if ( match[1].slice( 0, 3 ) === "nth" ) {
  1301. // nth-* requires argument
  1302. if ( !match[3] ) {
  1303. Sizzle.error( match[0] );
  1304. }
  1305. // numeric x and y parameters for Expr.filter.CHILD
  1306. // remember that false/true cast respectively to 0/1
  1307. match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
  1308. match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
  1309. // other types prohibit arguments
  1310. } else if ( match[3] ) {
  1311. Sizzle.error( match[0] );
  1312. }
  1313. return match;
  1314. },
  1315. "PSEUDO": function( match ) {
  1316. var excess,
  1317. unquoted = !match[6] && match[2];
  1318. if ( matchExpr["CHILD"].test( match[0] ) ) {
  1319. return null;
  1320. }
  1321. // Accept quoted arguments as-is
  1322. if ( match[3] ) {
  1323. match[2] = match[4] || match[5] || "";
  1324. // Strip excess characters from unquoted arguments
  1325. } else if ( unquoted && rpseudo.test( unquoted ) &&
  1326. // Get excess from tokenize (recursively)
  1327. (excess = tokenize( unquoted, true )) &&
  1328. // advance to the next closing parenthesis
  1329. (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
  1330. // excess is a negative index
  1331. match[0] = match[0].slice( 0, excess );
  1332. match[2] = unquoted.slice( 0, excess );
  1333. }
  1334. // Return only captures needed by the pseudo filter method (type and argument)
  1335. return match.slice( 0, 3 );
  1336. }
  1337. },
  1338. filter: {
  1339. "TAG": function( nodeNameSelector ) {
  1340. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  1341. return nodeNameSelector === "*" ?
  1342. function() { return true; } :
  1343. function( elem ) {
  1344. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  1345. };
  1346. },
  1347. "CLASS": function( className ) {
  1348. var pattern = classCache[ className + " " ];
  1349. return pattern ||
  1350. (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
  1351. classCache( className, function( elem ) {
  1352. return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
  1353. });
  1354. },
  1355. "ATTR": function( name, operator, check ) {
  1356. return function( elem ) {
  1357. var result = Sizzle.attr( elem, name );
  1358. if ( result == null ) {
  1359. return operator === "!=";
  1360. }
  1361. if ( !operator ) {
  1362. return true;
  1363. }
  1364. result += "";
  1365. return operator === "=" ? result === check :
  1366. operator === "!=" ? result !== check :
  1367. operator === "^=" ? check && result.indexOf( check ) === 0 :
  1368. operator === "*=" ? check && result.indexOf( check ) > -1 :
  1369. operator === "$=" ? check && result.slice( -check.length ) === check :
  1370. operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
  1371. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  1372. false;
  1373. };
  1374. },
  1375. "CHILD": function( type, what, argument, first, last ) {
  1376. var simple = type.slice( 0, 3 ) !== "nth",
  1377. forward = type.slice( -4 ) !== "last",
  1378. ofType = what === "of-type";
  1379. return first === 1 && last === 0 ?
  1380. // Shortcut for :nth-*(n)
  1381. function( elem ) {
  1382. return !!elem.parentNode;
  1383. } :
  1384. function( elem, context, xml ) {
  1385. var cache, outerCache, node, diff, nodeIndex, start,
  1386. dir = simple !== forward ? "nextSibling" : "previousSibling",
  1387. parent = elem.parentNode,
  1388. name = ofType && elem.nodeName.toLowerCase(),
  1389. useCache = !xml && !ofType;
  1390. if ( parent ) {
  1391. // :(first|last|only)-(child|of-type)
  1392. if ( simple ) {
  1393. while ( dir ) {
  1394. node = elem;
  1395. while ( (node = node[ dir ]) ) {
  1396. if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
  1397. return false;
  1398. }
  1399. }
  1400. // Reverse direction for :only-* (if we haven't yet done so)
  1401. start = dir = type === "only" && !start && "nextSibling";
  1402. }
  1403. return true;
  1404. }
  1405. start = [ forward ? parent.firstChild : parent.lastChild ];
  1406. // non-xml :nth-child(...) stores cache data on `parent`
  1407. if ( forward && useCache ) {
  1408. // Seek `elem` from a previously-cached index
  1409. outerCache = parent[ expando ] || (parent[ expando ] = {});
  1410. cache = outerCache[ type ] || [];
  1411. nodeIndex = cache[0] === dirruns && cache[1];
  1412. diff = cache[0] === dirruns && cache[2];
  1413. node = nodeIndex && parent.childNodes[ nodeIndex ];
  1414. while ( (node = ++nodeIndex && node && node[ dir ] ||
  1415. // Fallback to seeking `elem` from the start
  1416. (diff = nodeIndex = 0) || start.pop()) ) {
  1417. // When found, cache indexes on `parent` and break
  1418. if ( node.nodeType === 1 && ++diff && node === elem ) {
  1419. outerCache[ type ] = [ dirruns, nodeIndex, diff ];
  1420. break;
  1421. }
  1422. }
  1423. // Use previously-cached element index if available
  1424. } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
  1425. diff = cache[1];
  1426. // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
  1427. } else {
  1428. // Use the same loop as above to seek `elem` from the start
  1429. while ( (node = ++nodeIndex && node && node[ dir ] ||
  1430. (diff = nodeIndex = 0) || start.pop()) ) {
  1431. if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
  1432. // Cache the index of each encountered element
  1433. if ( useCache ) {
  1434. (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
  1435. }
  1436. if ( node === elem ) {
  1437. break;
  1438. }
  1439. }
  1440. }
  1441. }
  1442. // Incorporate the offset, then check against cycle size
  1443. diff -= last;
  1444. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  1445. }
  1446. };
  1447. },
  1448. "PSEUDO": function( pseudo, argument ) {
  1449. // pseudo-class names are case-insensitive
  1450. // http://www.w3.org/TR/selectors/#pseudo-classes
  1451. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  1452. // Remember that setFilters inherits from pseudos
  1453. var args,
  1454. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  1455. Sizzle.error( "unsupported pseudo: " + pseudo );
  1456. // The user may use createPseudo to indicate that
  1457. // arguments are needed to create the filter function
  1458. // just as Sizzle does
  1459. if ( fn[ expando ] ) {
  1460. return fn( argument );
  1461. }
  1462. // But maintain support for old signatures
  1463. if ( fn.length > 1 ) {
  1464. args = [ pseudo, pseudo, "", argument ];
  1465. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  1466. markFunction(function( seed, matches ) {
  1467. var idx,
  1468. matched = fn( seed, argument ),
  1469. i = matched.length;
  1470. while ( i-- ) {
  1471. idx = indexOf.call( seed, matched[i] );
  1472. seed[ idx ] = !( matches[ idx ] = matched[i] );
  1473. }
  1474. }) :
  1475. function( elem ) {
  1476. return fn( elem, 0, args );
  1477. };
  1478. }
  1479. return fn;
  1480. }
  1481. },
  1482. pseudos: {
  1483. // Potentially complex pseudos
  1484. "not": markFunction(function( selector ) {
  1485. // Trim the selector passed to compile
  1486. // to avoid treating leading and trailing
  1487. // spaces as combinators
  1488. var input = [],
  1489. results = [],
  1490. matcher = compile( selector.replace( rtrim, "$1" ) );
  1491. return matcher[ expando ] ?
  1492. markFunction(function( seed, matches, context, xml ) {
  1493. var elem,
  1494. unmatched = matcher( seed, null, xml, [] ),
  1495. i = seed.length;
  1496. // Match elements unmatched by `matcher`
  1497. while ( i-- ) {
  1498. if ( (elem = unmatched[i]) ) {
  1499. seed[i] = !(matches[i] = elem);
  1500. }
  1501. }
  1502. }) :
  1503. function( elem, context, xml ) {
  1504. input[0] = elem;
  1505. matcher( input, null, xml, results );
  1506. return !results.pop();
  1507. };
  1508. }),
  1509. "has": markFunction(function( selector ) {
  1510. return function( elem ) {
  1511. return Sizzle( selector, elem ).length > 0;
  1512. };
  1513. }),
  1514. "contains": markFunction(function( text ) {
  1515. return function( elem ) {
  1516. return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
  1517. };
  1518. }),
  1519. // "Whether an element is represented by a :lang() selector
  1520. // is based solely on the element's language value
  1521. // being equal to the identifier C,
  1522. // or beginning with the identifier C immediately followed by "-".
  1523. // The matching of C against the element's language value is performed case-insensitively.
  1524. // The identifier C does not have to be a valid language name."
  1525. // http://www.w3.org/TR/selectors/#lang-pseudo
  1526. "lang": markFunction( function( lang ) {
  1527. // lang value must be a valid identifier
  1528. if ( !ridentifier.test(lang || "") ) {
  1529. Sizzle.error( "unsupported lang: " + lang );
  1530. }
  1531. lang = lang.replace( runescape, funescape ).toLowerCase();
  1532. return function( elem ) {
  1533. var elemLang;
  1534. do {
  1535. if ( (elemLang = documentIsHTML ?
  1536. elem.lang :
  1537. elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
  1538. elemLang = elemLang.toLowerCase();
  1539. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  1540. }
  1541. } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
  1542. return false;
  1543. };
  1544. }),
  1545. // Miscellaneous
  1546. "target": function( elem ) {
  1547. var hash = window.location && window.location.hash;
  1548. return hash && hash.slice( 1 ) === elem.id;
  1549. },
  1550. "root": function( elem ) {
  1551. return elem === docElem;
  1552. },
  1553. "focus": function( elem ) {
  1554. return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
  1555. },
  1556. // Boolean properties
  1557. "enabled": function( elem ) {
  1558. return elem.disabled === false;
  1559. },
  1560. "disabled": function( elem ) {
  1561. return elem.disabled === true;
  1562. },
  1563. "checked": function( elem ) {
  1564. // In CSS3, :checked should return both checked and selected elements
  1565. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1566. var nodeName = elem.nodeName.toLowerCase();
  1567. return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
  1568. },
  1569. "selected": function( elem ) {
  1570. // Accessing this property makes selected-by-default
  1571. // options in Safari work properly
  1572. if ( elem.parentNode ) {
  1573. elem.parentNode.selectedIndex;
  1574. }
  1575. return elem.selected === true;
  1576. },
  1577. // Contents
  1578. "empty": function( elem ) {
  1579. // http://www.w3.org/TR/selectors/#empty-pseudo
  1580. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  1581. // but not by others (comment: 8; processing instruction: 7; etc.)
  1582. // nodeType < 6 works because attributes (2) do not appear as children
  1583. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1584. if ( elem.nodeType < 6 ) {
  1585. return false;
  1586. }
  1587. }
  1588. return true;
  1589. },
  1590. "parent": function( elem ) {
  1591. return !Expr.pseudos["empty"]( elem );
  1592. },
  1593. // Element/input types
  1594. "header": function( elem ) {
  1595. return rheader.test( elem.nodeName );
  1596. },
  1597. "input": function( elem ) {
  1598. return rinputs.test( elem.nodeName );
  1599. },
  1600. "button": function( elem ) {
  1601. var name = elem.nodeName.toLowerCase();
  1602. return name === "input" && elem.type === "button" || name === "button";
  1603. },
  1604. "text": function( elem ) {
  1605. var attr;
  1606. return elem.nodeName.toLowerCase() === "input" &&
  1607. elem.type === "text" &&
  1608. // Support: IE<8
  1609. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  1610. ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
  1611. },
  1612. // Position-in-collection
  1613. "first": createPositionalPseudo(function() {
  1614. return [ 0 ];
  1615. }),
  1616. "last": createPositionalPseudo(function( matchIndexes, length ) {
  1617. return [ length - 1 ];
  1618. }),
  1619. "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1620. return [ argument < 0 ? argument + length : argument ];
  1621. }),
  1622. "even": createPositionalPseudo(function( matchIndexes, length ) {
  1623. var i = 0;
  1624. for ( ; i < length; i += 2 ) {
  1625. matchIndexes.push( i );
  1626. }
  1627. return matchIndexes;
  1628. }),
  1629. "odd": createPositionalPseudo(function( matchIndexes, length ) {
  1630. var i = 1;
  1631. for ( ; i < length; i += 2 ) {
  1632. matchIndexes.push( i );
  1633. }
  1634. return matchIndexes;
  1635. }),
  1636. "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1637. var i = argument < 0 ? argument + length : argument;
  1638. for ( ; --i >= 0; ) {
  1639. matchIndexes.push( i );
  1640. }
  1641. return matchIndexes;
  1642. }),
  1643. "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1644. var i = argument < 0 ? argument + length : argument;
  1645. for ( ; ++i < length; ) {
  1646. matchIndexes.push( i );
  1647. }
  1648. return matchIndexes;
  1649. })
  1650. }
  1651. };
  1652. Expr.pseudos["nth"] = Expr.pseudos["eq"];
  1653. // Add button/input type pseudos
  1654. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  1655. Expr.pseudos[ i ] = createInputPseudo( i );
  1656. }
  1657. for ( i in { submit: true, reset: true } ) {
  1658. Expr.pseudos[ i ] = createButtonPseudo( i );
  1659. }
  1660. // Easy API for creating new setFilters
  1661. function setFilters() {}
  1662. setFilters.prototype = Expr.filters = Expr.pseudos;
  1663. Expr.setFilters = new setFilters();
  1664. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  1665. var matched, match, tokens, type,
  1666. soFar, groups, preFilters,
  1667. cached = tokenCache[ selector + " " ];
  1668. if ( cached ) {
  1669. return parseOnly ? 0 : cached.slice( 0 );
  1670. }
  1671. soFar = selector;
  1672. groups = [];
  1673. preFilters = Expr.preFilter;
  1674. while ( soFar ) {
  1675. // Comma and first run
  1676. if ( !matched || (match = rcomma.exec( soFar )) ) {
  1677. if ( match ) {
  1678. // Don't consume trailing commas as valid
  1679. soFar = soFar.slice( match[0].length ) || soFar;
  1680. }
  1681. groups.push( (tokens = []) );
  1682. }
  1683. matched = false;
  1684. // Combinators
  1685. if ( (match = rcombinators.exec( soFar )) ) {
  1686. matched = match.shift();
  1687. tokens.push({
  1688. value: matched,
  1689. // Cast descendant combinators to space
  1690. type: match[0].replace( rtrim, " " )
  1691. });
  1692. soFar = soFar.slice( matched.length );
  1693. }
  1694. // Filters
  1695. for ( type in Expr.filter ) {
  1696. if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
  1697. (match = preFilters[ type ]( match ))) ) {
  1698. matched = match.shift();
  1699. tokens.push({
  1700. value: matched,
  1701. type: type,
  1702. matches: match
  1703. });
  1704. soFar = soFar.slice( matched.length );
  1705. }
  1706. }
  1707. if ( !matched ) {
  1708. break;
  1709. }
  1710. }
  1711. // Return the length of the invalid excess
  1712. // if we're just parsing
  1713. // Otherwise, throw an error or return tokens
  1714. return parseOnly ?
  1715. soFar.length :
  1716. soFar ?
  1717. Sizzle.error( selector ) :
  1718. // Cache the tokens
  1719. tokenCache( selector, groups ).slice( 0 );
  1720. };
  1721. function toSelector( tokens ) {
  1722. var i = 0,
  1723. len = tokens.length,
  1724. selector = "";
  1725. for ( ; i < len; i++ ) {
  1726. selector += tokens[i].value;
  1727. }
  1728. return selector;
  1729. }
  1730. function addCombinator( matcher, combinator, base ) {
  1731. var dir = combinator.dir,
  1732. checkNonElements = base && dir === "parentNode",
  1733. doneName = done++;
  1734. return combinator.first ?
  1735. // Check against closest ancestor/preceding element
  1736. function( elem, context, xml ) {
  1737. while ( (elem = elem[ dir ]) ) {
  1738. if ( elem.nodeType === 1 || checkNonElements ) {
  1739. return matcher( elem, context, xml );
  1740. }
  1741. }
  1742. } :
  1743. // Check against all ancestor/preceding elements
  1744. function( elem, context, xml ) {
  1745. var oldCache, outerCache,
  1746. newCache = [ dirruns, doneName ];
  1747. // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
  1748. if ( xml ) {
  1749. while ( (elem = elem[ dir ]) ) {
  1750. if ( elem.nodeType === 1 || checkNonElements ) {
  1751. if ( matcher( elem, context, xml ) ) {
  1752. return true;
  1753. }
  1754. }
  1755. }
  1756. } else {
  1757. while ( (elem = elem[ dir ]) ) {
  1758. if ( elem.nodeType === 1 || checkNonElements ) {
  1759. outerCache = elem[ expando ] || (elem[ expando ] = {});
  1760. if ( (oldCache = outerCache[ dir ]) &&
  1761. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  1762. // Assign to newCache so results back-propagate to previous elements
  1763. return (newCache[ 2 ] = oldCache[ 2 ]);
  1764. } else {
  1765. // Reuse newcache so results back-propagate to previous elements
  1766. outerCache[ dir ] = newCache;
  1767. // A match means we're done; a fail means we have to keep checking
  1768. if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
  1769. return true;
  1770. }
  1771. }
  1772. }
  1773. }
  1774. }
  1775. };
  1776. }
  1777. function elementMatcher( matchers ) {
  1778. return matchers.length > 1 ?
  1779. function( elem, context, xml ) {
  1780. var i = matchers.length;
  1781. while ( i-- ) {
  1782. if ( !matchers[i]( elem, context, xml ) ) {
  1783. return false;
  1784. }
  1785. }
  1786. return true;
  1787. } :
  1788. matchers[0];
  1789. }
  1790. function multipleContexts( selector, contexts, results ) {
  1791. var i = 0,
  1792. len = contexts.length;
  1793. for ( ; i < len; i++ ) {
  1794. Sizzle( selector, contexts[i], results );
  1795. }
  1796. return results;
  1797. }
  1798. function condense( unmatched, map, filter, context, xml ) {
  1799. var elem,
  1800. newUnmatched = [],
  1801. i = 0,
  1802. len = unmatched.length,
  1803. mapped = map != null;
  1804. for ( ; i < len; i++ ) {
  1805. if ( (elem = unmatched[i]) ) {
  1806. if ( !filter || filter( elem, context, xml ) ) {
  1807. newUnmatched.push( elem );
  1808. if ( mapped ) {
  1809. map.push( i );
  1810. }
  1811. }
  1812. }
  1813. }
  1814. return newUnmatched;
  1815. }
  1816. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  1817. if ( postFilter && !postFilter[ expando ] ) {
  1818. postFilter = setMatcher( postFilter );
  1819. }
  1820. if ( postFinder && !postFinder[ expando ] ) {
  1821. postFinder = setMatcher( postFinder, postSelector );
  1822. }
  1823. return markFunction(function( seed, results, context, xml ) {
  1824. var temp, i, elem,
  1825. preMap = [],
  1826. postMap = [],
  1827. preexisting = results.length,
  1828. // Get initial elements from seed or context
  1829. elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
  1830. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  1831. matcherIn = preFilter && ( seed || !selector ) ?
  1832. condense( elems, preMap, preFilter, context, xml ) :
  1833. elems,
  1834. matcherOut = matcher ?
  1835. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  1836. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  1837. // ...intermediate processing is necessary
  1838. [] :
  1839. // ...otherwise use results directly
  1840. results :
  1841. matcherIn;
  1842. // Find primary matches
  1843. if ( matcher ) {
  1844. matcher( matcherIn, matcherOut, context, xml );
  1845. }
  1846. // Apply postFilter
  1847. if ( postFilter ) {
  1848. temp = condense( matcherOut, postMap );
  1849. postFilter( temp, [], context, xml );
  1850. // Un-match failing elements by moving them back to matcherIn
  1851. i = temp.length;
  1852. while ( i-- ) {
  1853. if ( (elem = temp[i]) ) {
  1854. matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
  1855. }
  1856. }
  1857. }
  1858. if ( seed ) {
  1859. if ( postFinder || preFilter ) {
  1860. if ( postFinder ) {
  1861. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  1862. temp = [];
  1863. i = matcherOut.length;
  1864. while ( i-- ) {
  1865. if ( (elem = matcherOut[i]) ) {
  1866. // Restore matcherIn since elem is not yet a final match
  1867. temp.push( (matcherIn[i] = elem) );
  1868. }
  1869. }
  1870. postFinder( null, (matcherOut = []), temp, xml );
  1871. }
  1872. // Move matched elements from seed to results to keep them synchronized
  1873. i = matcherOut.length;
  1874. while ( i-- ) {
  1875. if ( (elem = matcherOut[i]) &&
  1876. (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
  1877. seed[temp] = !(results[temp] = elem);
  1878. }
  1879. }
  1880. }
  1881. // Add elements to results, through postFinder if defined
  1882. } else {
  1883. matcherOut = condense(
  1884. matcherOut === results ?
  1885. matcherOut.splice( preexisting, matcherOut.length ) :
  1886. matcherOut
  1887. );
  1888. if ( postFinder ) {
  1889. postFinder( null, results, matcherOut, xml );
  1890. } else {
  1891. push.apply( results, matcherOut );
  1892. }
  1893. }
  1894. });
  1895. }
  1896. function matcherFromTokens( tokens ) {
  1897. var checkContext, matcher, j,
  1898. len = tokens.length,
  1899. leadingRelative = Expr.relative[ tokens[0].type ],
  1900. implicitRelative = leadingRelative || Expr.relative[" "],
  1901. i = leadingRelative ? 1 : 0,
  1902. // The foundational matcher ensures that elements are reachable from top-level context(s)
  1903. matchContext = addCombinator( function( elem ) {
  1904. return elem === checkContext;
  1905. }, implicitRelative, true ),
  1906. matchAnyContext = addCombinator( function( elem ) {
  1907. return indexOf.call( checkContext, elem ) > -1;
  1908. }, implicitRelative, true ),
  1909. matchers = [ function( elem, context, xml ) {
  1910. return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  1911. (checkContext = context).nodeType ?
  1912. matchContext( elem, context, xml ) :
  1913. matchAnyContext( elem, context, xml ) );
  1914. } ];
  1915. for ( ; i < len; i++ ) {
  1916. if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
  1917. matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
  1918. } else {
  1919. matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
  1920. // Return special upon seeing a positional matcher
  1921. if ( matcher[ expando ] ) {
  1922. // Find the next relative operator (if any) for proper handling
  1923. j = ++i;
  1924. for ( ; j < len; j++ ) {
  1925. if ( Expr.relative[ tokens[j].type ] ) {
  1926. break;
  1927. }
  1928. }
  1929. return setMatcher(
  1930. i > 1 && elementMatcher( matchers ),
  1931. i > 1 && toSelector(
  1932. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  1933. tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
  1934. ).replace( rtrim, "$1" ),
  1935. matcher,
  1936. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  1937. j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
  1938. j < len && toSelector( tokens )
  1939. );
  1940. }
  1941. matchers.push( matcher );
  1942. }
  1943. }
  1944. return elementMatcher( matchers );
  1945. }
  1946. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  1947. var bySet = setMatchers.length > 0,
  1948. byElement = elementMatchers.length > 0,
  1949. superMatcher = function( seed, context, xml, results, outermost ) {
  1950. var elem, j, matcher,
  1951. matchedCount = 0,
  1952. i = "0",
  1953. unmatched = seed && [],
  1954. setMatched = [],
  1955. contextBackup = outermostContext,
  1956. // We must always have either seed elements or outermost context
  1957. elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
  1958. // Use integer dirruns iff this is the outermost matcher
  1959. dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
  1960. len = elems.length;
  1961. if ( outermost ) {
  1962. outermostContext = context !== document && context;
  1963. }
  1964. // Add elements passing elementMatchers directly to results
  1965. // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
  1966. // Support: IE<9, Safari
  1967. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  1968. for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
  1969. if ( byElement && elem ) {
  1970. j = 0;
  1971. while ( (matcher = elementMatchers[j++]) ) {
  1972. if ( matcher( elem, context, xml ) ) {
  1973. results.push( elem );
  1974. break;
  1975. }
  1976. }
  1977. if ( outermost ) {
  1978. dirruns = dirrunsUnique;
  1979. }
  1980. }
  1981. // Track unmatched elements for set filters
  1982. if ( bySet ) {
  1983. // They will have gone through all possible matchers
  1984. if ( (elem = !matcher && elem) ) {
  1985. matchedCount--;
  1986. }
  1987. // Lengthen the array for every element, matched or not
  1988. if ( seed ) {
  1989. unmatched.push( elem );
  1990. }
  1991. }
  1992. }
  1993. // Apply set filters to unmatched elements
  1994. matchedCount += i;
  1995. if ( bySet && i !== matchedCount ) {
  1996. j = 0;
  1997. while ( (matcher = setMatchers[j++]) ) {
  1998. matcher( unmatched, setMatched, context, xml );
  1999. }
  2000. if ( seed ) {
  2001. // Reintegrate element matches to eliminate the need for sorting
  2002. if ( matchedCount > 0 ) {
  2003. while ( i-- ) {
  2004. if ( !(unmatched[i] || setMatched[i]) ) {
  2005. setMatched[i] = pop.call( results );
  2006. }
  2007. }
  2008. }
  2009. // Discard index placeholder values to get only actual matches
  2010. setMatched = condense( setMatched );
  2011. }
  2012. // Add matches to results
  2013. push.apply( results, setMatched );
  2014. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  2015. if ( outermost && !seed && setMatched.length > 0 &&
  2016. ( matchedCount + setMatchers.length ) > 1 ) {
  2017. Sizzle.uniqueSort( results );
  2018. }
  2019. }
  2020. // Override manipulation of globals by nested matchers
  2021. if ( outermost ) {
  2022. dirruns = dirrunsUnique;
  2023. outermostContext = contextBackup;
  2024. }
  2025. return unmatched;
  2026. };
  2027. return bySet ?
  2028. markFunction( superMatcher ) :
  2029. superMatcher;
  2030. }
  2031. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  2032. var i,
  2033. setMatchers = [],
  2034. elementMatchers = [],
  2035. cached = compilerCache[ selector + " " ];
  2036. if ( !cached ) {
  2037. // Generate a function of recursive functions that can be used to check each element
  2038. if ( !match ) {
  2039. match = tokenize( selector );
  2040. }
  2041. i = match.length;
  2042. while ( i-- ) {
  2043. cached = matcherFromTokens( match[i] );
  2044. if ( cached[ expando ] ) {
  2045. setMatchers.push( cached );
  2046. } else {
  2047. elementMatchers.push( cached );
  2048. }
  2049. }
  2050. // Cache the compiled function
  2051. cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  2052. // Save selector and tokenization
  2053. cached.selector = selector;
  2054. }
  2055. return cached;
  2056. };
  2057. /**
  2058. * A low-level selection function that works with Sizzle's compiled
  2059. * selector functions
  2060. * @param {String|Function} selector A selector or a pre-compiled
  2061. * selector function built with Sizzle.compile
  2062. * @param {Element} context
  2063. * @param {Array} [results]
  2064. * @param {Array} [seed] A set of elements to match against
  2065. */
  2066. select = Sizzle.select = function( selector, context, results, seed ) {
  2067. var i, tokens, token, type, find,
  2068. compiled = typeof selector === "function" && selector,
  2069. match = !seed && tokenize( (selector = compiled.selector || selector) );
  2070. results = results || [];
  2071. // Try to minimize operations if there is no seed and only one group
  2072. if ( match.length === 1 ) {
  2073. // Take a shortcut and set the context if the root selector is an ID
  2074. tokens = match[0] = match[0].slice( 0 );
  2075. if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
  2076. support.getById && context.nodeType === 9 && documentIsHTML &&
  2077. Expr.relative[ tokens[1].type ] ) {
  2078. context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
  2079. if ( !context ) {
  2080. return results;
  2081. // Precompiled matchers will still verify ancestry, so step up a level
  2082. } else if ( compiled ) {
  2083. context = context.parentNode;
  2084. }
  2085. selector = selector.slice( tokens.shift().value.length );
  2086. }
  2087. // Fetch a seed set for right-to-left matching
  2088. i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
  2089. while ( i-- ) {
  2090. token = tokens[i];
  2091. // Abort if we hit a combinator
  2092. if ( Expr.relative[ (type = token.type) ] ) {
  2093. break;
  2094. }
  2095. if ( (find = Expr.find[ type ]) ) {
  2096. // Search, expanding context for leading sibling combinators
  2097. if ( (seed = find(
  2098. token.matches[0].replace( runescape, funescape ),
  2099. rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
  2100. )) ) {
  2101. // If seed is empty or no tokens remain, we can return early
  2102. tokens.splice( i, 1 );
  2103. selector = seed.length && toSelector( tokens );
  2104. if ( !selector ) {
  2105. push.apply( results, seed );
  2106. return results;
  2107. }
  2108. break;
  2109. }
  2110. }
  2111. }
  2112. }
  2113. // Compile and execute a filtering function if one is not provided
  2114. // Provide `match` to avoid retokenization if we modified the selector above
  2115. ( compiled || compile( selector, match ) )(
  2116. seed,
  2117. context,
  2118. !documentIsHTML,
  2119. results,
  2120. rsibling.test( selector ) && testContext( context.parentNode ) || context
  2121. );
  2122. return results;
  2123. };
  2124. // One-time assignments
  2125. // Sort stability
  2126. support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
  2127. // Support: Chrome<14
  2128. // Always assume duplicates if they aren't passed to the comparison function
  2129. support.detectDuplicates = !!hasDuplicate;
  2130. // Initialize against the default document
  2131. setDocument();
  2132. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  2133. // Detached nodes confoundingly follow *each other*
  2134. support.sortDetached = assert(function( div1 ) {
  2135. // Should return 1, but returns 4 (following)
  2136. return div1.compareDocumentPosition( document.createElement("div") ) & 1;
  2137. });
  2138. // Support: IE<8
  2139. // Prevent attribute/property "interpolation"
  2140. // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  2141. if ( !assert(function( div ) {
  2142. div.innerHTML = "<a href='#'></a>";
  2143. return div.firstChild.getAttribute("href") === "#" ;
  2144. }) ) {
  2145. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  2146. if ( !isXML ) {
  2147. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  2148. }
  2149. });
  2150. }
  2151. // Support: IE<9
  2152. // Use defaultValue in place of getAttribute("value")
  2153. if ( !support.attributes || !assert(function( div ) {
  2154. div.innerHTML = "<input/>";
  2155. div.firstChild.setAttribute( "value", "" );
  2156. return div.firstChild.getAttribute( "value" ) === "";
  2157. }) ) {
  2158. addHandle( "value", function( elem, name, isXML ) {
  2159. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  2160. return elem.defaultValue;
  2161. }
  2162. });
  2163. }
  2164. // Support: IE<9
  2165. // Use getAttributeNode to fetch booleans when getAttribute lies
  2166. if ( !assert(function( div ) {
  2167. return div.getAttribute("disabled") == null;
  2168. }) ) {
  2169. addHandle( booleans, function( elem, name, isXML ) {
  2170. var val;
  2171. if ( !isXML ) {
  2172. return elem[ name ] === true ? name.toLowerCase() :
  2173. (val = elem.getAttributeNode( name )) && val.specified ?
  2174. val.value :
  2175. null;
  2176. }
  2177. });
  2178. }
  2179. return Sizzle;
  2180. })( window );
  2181. jQuery.find = Sizzle;
  2182. jQuery.expr = Sizzle.selectors;
  2183. jQuery.expr[":"] = jQuery.expr.pseudos;
  2184. jQuery.unique = Sizzle.uniqueSort;
  2185. jQuery.text = Sizzle.getText;
  2186. jQuery.isXMLDoc = Sizzle.isXML;
  2187. jQuery.contains = Sizzle.contains;
  2188. var rneedsContext = jQuery.expr.match.needsContext;
  2189. var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
  2190. var risSimple = /^.[^:#\[\.,]*$/;
  2191. // Implement the identical functionality for filter and not
  2192. function winnow( elements, qualifier, not ) {
  2193. if ( jQuery.isFunction( qualifier ) ) {
  2194. return jQuery.grep( elements, function( elem, i ) {
  2195. /* jshint -W018 */
  2196. return !!qualifier.call( elem, i, elem ) !== not;
  2197. });
  2198. }
  2199. if ( qualifier.nodeType ) {
  2200. return jQuery.grep( elements, function( elem ) {
  2201. return ( elem === qualifier ) !== not;
  2202. });
  2203. }
  2204. if ( typeof qualifier === "string" ) {
  2205. if ( risSimple.test( qualifier ) ) {
  2206. return jQuery.filter( qualifier, elements, not );
  2207. }
  2208. qualifier = jQuery.filter( qualifier, elements );
  2209. }
  2210. return jQuery.grep( elements, function( elem ) {
  2211. return ( indexOf.call( qualifier, elem ) >= 0 ) !== not;
  2212. });
  2213. }
  2214. jQuery.filter = function( expr, elems, not ) {
  2215. var elem = elems[ 0 ];
  2216. if ( not ) {
  2217. expr = ":not(" + expr + ")";
  2218. }
  2219. return elems.length === 1 && elem.nodeType === 1 ?
  2220. jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
  2221. jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  2222. return elem.nodeType === 1;
  2223. }));
  2224. };
  2225. jQuery.fn.extend({
  2226. find: function( selector ) {
  2227. var i,
  2228. len = this.length,
  2229. ret = [],
  2230. self = this;
  2231. if ( typeof selector !== "string" ) {
  2232. return this.pushStack( jQuery( selector ).filter(function() {
  2233. for ( i = 0; i < len; i++ ) {
  2234. if ( jQuery.contains( self[ i ], this ) ) {
  2235. return true;
  2236. }
  2237. }
  2238. }) );
  2239. }
  2240. for ( i = 0; i < len; i++ ) {
  2241. jQuery.find( selector, self[ i ], ret );
  2242. }
  2243. // Needed because $( selector, context ) becomes $( context ).find( selector )
  2244. ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
  2245. ret.selector = this.selector ? this.selector + " " + selector : selector;
  2246. return ret;
  2247. },
  2248. filter: function( selector ) {
  2249. return this.pushStack( winnow(this, selector || [], false) );
  2250. },
  2251. not: function( selector ) {
  2252. return this.pushStack( winnow(this, selector || [], true) );
  2253. },
  2254. is: function( selector ) {
  2255. return !!winnow(
  2256. this,
  2257. // If this is a positional/relative selector, check membership in the returned set
  2258. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  2259. typeof selector === "string" && rneedsContext.test( selector ) ?
  2260. jQuery( selector ) :
  2261. selector || [],
  2262. false
  2263. ).length;
  2264. }
  2265. });
  2266. // Initialize a jQuery object
  2267. // A central reference to the root jQuery(document)
  2268. var rootjQuery,
  2269. // A simple way to check for HTML strings
  2270. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  2271. // Strict HTML recognition (#11290: must start with <)
  2272. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
  2273. init = jQuery.fn.init = function( selector, context ) {
  2274. var match, elem;
  2275. // HANDLE: $(""), $(null), $(undefined), $(false)
  2276. if ( !selector ) {
  2277. return this;
  2278. }
  2279. // Handle HTML strings
  2280. if ( typeof selector === "string" ) {
  2281. if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) {
  2282. // Assume that strings that start and end with <> are HTML and skip the regex check
  2283. match = [ null, selector, null ];
  2284. } else {
  2285. match = rquickExpr.exec( selector );
  2286. }
  2287. // Match html or make sure no context is specified for #id
  2288. if ( match && (match[1] || !context) ) {
  2289. // HANDLE: $(html) -> $(array)
  2290. if ( match[1] ) {
  2291. context = context instanceof jQuery ? context[0] : context;
  2292. // scripts is true for back-compat
  2293. // Intentionally let the error be thrown if parseHTML is not present
  2294. jQuery.merge( this, jQuery.parseHTML(
  2295. match[1],
  2296. context && context.nodeType ? context.ownerDocument || context : document,
  2297. true
  2298. ) );
  2299. // HANDLE: $(html, props)
  2300. if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
  2301. for ( match in context ) {
  2302. // Properties of context are called as methods if possible
  2303. if ( jQuery.isFunction( this[ match ] ) ) {
  2304. this[ match ]( context[ match ] );
  2305. // ...and otherwise set as attributes
  2306. } else {
  2307. this.attr( match, context[ match ] );
  2308. }
  2309. }
  2310. }
  2311. return this;
  2312. // HANDLE: $(#id)
  2313. } else {
  2314. elem = document.getElementById( match[2] );
  2315. // Check parentNode to catch when Blackberry 4.6 returns
  2316. // nodes that are no longer in the document #6963
  2317. if ( elem && elem.parentNode ) {
  2318. // Inject the element directly into the jQuery object
  2319. this.length = 1;
  2320. this[0] = elem;
  2321. }
  2322. this.context = document;
  2323. this.selector = selector;
  2324. return this;
  2325. }
  2326. // HANDLE: $(expr, $(...))
  2327. } else if ( !context || context.jquery ) {
  2328. return ( context || rootjQuery ).find( selector );
  2329. // HANDLE: $(expr, context)
  2330. // (which is just equivalent to: $(context).find(expr)
  2331. } else {
  2332. return this.constructor( context ).find( selector );
  2333. }
  2334. // HANDLE: $(DOMElement)
  2335. } else if ( selector.nodeType ) {
  2336. this.context = this[0] = selector;
  2337. this.length = 1;
  2338. return this;
  2339. // HANDLE: $(function)
  2340. // Shortcut for document ready
  2341. } else if ( jQuery.isFunction( selector ) ) {
  2342. return typeof rootjQuery.ready !== "undefined" ?
  2343. rootjQuery.ready( selector ) :
  2344. // Execute immediately if ready is not present
  2345. selector( jQuery );
  2346. }
  2347. if ( selector.selector !== undefined ) {
  2348. this.selector = selector.selector;
  2349. this.context = selector.context;
  2350. }
  2351. return jQuery.makeArray( selector, this );
  2352. };
  2353. // Give the init function the jQuery prototype for later instantiation
  2354. init.prototype = jQuery.fn;
  2355. // Initialize central reference
  2356. rootjQuery = jQuery( document );
  2357. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  2358. // methods guaranteed to produce a unique set when starting from a unique set
  2359. guaranteedUnique = {
  2360. children: true,
  2361. contents: true,
  2362. next: true,
  2363. prev: true
  2364. };
  2365. jQuery.extend({
  2366. dir: function( elem, dir, until ) {
  2367. var matched = [],
  2368. truncate = until !== undefined;
  2369. while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
  2370. if ( elem.nodeType === 1 ) {
  2371. if ( truncate && jQuery( elem ).is( until ) ) {
  2372. break;
  2373. }
  2374. matched.push( elem );
  2375. }
  2376. }
  2377. return matched;
  2378. },
  2379. sibling: function( n, elem ) {
  2380. var matched = [];
  2381. for ( ; n; n = n.nextSibling ) {
  2382. if ( n.nodeType === 1 && n !== elem ) {
  2383. matched.push( n );
  2384. }
  2385. }
  2386. return matched;
  2387. }
  2388. });
  2389. jQuery.fn.extend({
  2390. has: function( target ) {
  2391. var targets = jQuery( target, this ),
  2392. l = targets.length;
  2393. return this.filter(function() {
  2394. var i = 0;
  2395. for ( ; i < l; i++ ) {
  2396. if ( jQuery.contains( this, targets[i] ) ) {
  2397. return true;
  2398. }
  2399. }
  2400. });
  2401. },
  2402. closest: function( selectors, context ) {
  2403. var cur,
  2404. i = 0,
  2405. l = this.length,
  2406. matched = [],
  2407. pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
  2408. jQuery( selectors, context || this.context ) :
  2409. 0;
  2410. for ( ; i < l; i++ ) {
  2411. for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
  2412. // Always skip document fragments
  2413. if ( cur.nodeType < 11 && (pos ?
  2414. pos.index(cur) > -1 :
  2415. // Don't pass non-elements to Sizzle
  2416. cur.nodeType === 1 &&
  2417. jQuery.find.matchesSelector(cur, selectors)) ) {
  2418. matched.push( cur );
  2419. break;
  2420. }
  2421. }
  2422. }
  2423. return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
  2424. },
  2425. // Determine the position of an element within
  2426. // the matched set of elements
  2427. index: function( elem ) {
  2428. // No argument, return index in parent
  2429. if ( !elem ) {
  2430. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  2431. }
  2432. // index in selector
  2433. if ( typeof elem === "string" ) {
  2434. return indexOf.call( jQuery( elem ), this[ 0 ] );
  2435. }
  2436. // Locate the position of the desired element
  2437. return indexOf.call( this,
  2438. // If it receives a jQuery object, the first element is used
  2439. elem.jquery ? elem[ 0 ] : elem
  2440. );
  2441. },
  2442. add: function( selector, context ) {
  2443. return this.pushStack(
  2444. jQuery.unique(
  2445. jQuery.merge( this.get(), jQuery( selector, context ) )
  2446. )
  2447. );
  2448. },
  2449. addBack: function( selector ) {
  2450. return this.add( selector == null ?
  2451. this.prevObject : this.prevObject.filter(selector)
  2452. );
  2453. }
  2454. });
  2455. function sibling( cur, dir ) {
  2456. while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
  2457. return cur;
  2458. }
  2459. jQuery.each({
  2460. parent: function( elem ) {
  2461. var parent = elem.parentNode;
  2462. return parent && parent.nodeType !== 11 ? parent : null;
  2463. },
  2464. parents: function( elem ) {
  2465. return jQuery.dir( elem, "parentNode" );
  2466. },
  2467. parentsUntil: function( elem, i, until ) {
  2468. return jQuery.dir( elem, "parentNode", until );
  2469. },
  2470. next: function( elem ) {
  2471. return sibling( elem, "nextSibling" );
  2472. },
  2473. prev: function( elem ) {
  2474. return sibling( elem, "previousSibling" );
  2475. },
  2476. nextAll: function( elem ) {
  2477. return jQuery.dir( elem, "nextSibling" );
  2478. },
  2479. prevAll: function( elem ) {
  2480. return jQuery.dir( elem, "previousSibling" );
  2481. },
  2482. nextUntil: function( elem, i, until ) {
  2483. return jQuery.dir( elem, "nextSibling", until );
  2484. },
  2485. prevUntil: function( elem, i, until ) {
  2486. return jQuery.dir( elem, "previousSibling", until );
  2487. },
  2488. siblings: function( elem ) {
  2489. return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
  2490. },
  2491. children: function( elem ) {
  2492. return jQuery.sibling( elem.firstChild );
  2493. },
  2494. contents: function( elem ) {
  2495. return elem.contentDocument || jQuery.merge( [], elem.childNodes );
  2496. }
  2497. }, function( name, fn ) {
  2498. jQuery.fn[ name ] = function( until, selector ) {
  2499. var matched = jQuery.map( this, fn, until );
  2500. if ( name.slice( -5 ) !== "Until" ) {
  2501. selector = until;
  2502. }
  2503. if ( selector && typeof selector === "string" ) {
  2504. matched = jQuery.filter( selector, matched );
  2505. }
  2506. if ( this.length > 1 ) {
  2507. // Remove duplicates
  2508. if ( !guaranteedUnique[ name ] ) {
  2509. jQuery.unique( matched );
  2510. }
  2511. // Reverse order for parents* and prev-derivatives
  2512. if ( rparentsprev.test( name ) ) {
  2513. matched.reverse();
  2514. }
  2515. }
  2516. return this.pushStack( matched );
  2517. };
  2518. });
  2519. var rnotwhite = (/\S+/g);
  2520. // String to Object options format cache
  2521. var optionsCache = {};
  2522. // Convert String-formatted options into Object-formatted ones and store in cache
  2523. function createOptions( options ) {
  2524. var object = optionsCache[ options ] = {};
  2525. jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
  2526. object[ flag ] = true;
  2527. });
  2528. return object;
  2529. }
  2530. /*
  2531. * Create a callback list using the following parameters:
  2532. *
  2533. * options: an optional list of space-separated options that will change how
  2534. * the callback list behaves or a more traditional option object
  2535. *
  2536. * By default a callback list will act like an event callback list and can be
  2537. * "fired" multiple times.
  2538. *
  2539. * Possible options:
  2540. *
  2541. * once: will ensure the callback list can only be fired once (like a Deferred)
  2542. *
  2543. * memory: will keep track of previous values and will call any callback added
  2544. * after the list has been fired right away with the latest "memorized"
  2545. * values (like a Deferred)
  2546. *
  2547. * unique: will ensure a callback can only be added once (no duplicate in the list)
  2548. *
  2549. * stopOnFalse: interrupt callings when a callback returns false
  2550. *
  2551. */
  2552. jQuery.Callbacks = function( options ) {
  2553. // Convert options from String-formatted to Object-formatted if needed
  2554. // (we check in cache first)
  2555. options = typeof options === "string" ?
  2556. ( optionsCache[ options ] || createOptions( options ) ) :
  2557. jQuery.extend( {}, options );
  2558. var // Last fire value (for non-forgettable lists)
  2559. memory,
  2560. // Flag to know if list was already fired
  2561. fired,
  2562. // Flag to know if list is currently firing
  2563. firing,
  2564. // First callback to fire (used internally by add and fireWith)
  2565. firingStart,
  2566. // End of the loop when firing
  2567. firingLength,
  2568. // Index of currently firing callback (modified by remove if needed)
  2569. firingIndex,
  2570. // Actual callback list
  2571. list = [],
  2572. // Stack of fire calls for repeatable lists
  2573. stack = !options.once && [],
  2574. // Fire callbacks
  2575. fire = function( data ) {
  2576. memory = options.memory && data;
  2577. fired = true;
  2578. firingIndex = firingStart || 0;
  2579. firingStart = 0;
  2580. firingLength = list.length;
  2581. firing = true;
  2582. for ( ; list && firingIndex < firingLength; firingIndex++ ) {
  2583. if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
  2584. memory = false; // To prevent further calls using add
  2585. break;
  2586. }
  2587. }
  2588. firing = false;
  2589. if ( list ) {
  2590. if ( stack ) {
  2591. if ( stack.length ) {
  2592. fire( stack.shift() );
  2593. }
  2594. } else if ( memory ) {
  2595. list = [];
  2596. } else {
  2597. self.disable();
  2598. }
  2599. }
  2600. },
  2601. // Actual Callbacks object
  2602. self = {
  2603. // Add a callback or a collection of callbacks to the list
  2604. add: function() {
  2605. if ( list ) {
  2606. // First, we save the current length
  2607. var start = list.length;
  2608. (function add( args ) {
  2609. jQuery.each( args, function( _, arg ) {
  2610. var type = jQuery.type( arg );
  2611. if ( type === "function" ) {
  2612. if ( !options.unique || !self.has( arg ) ) {
  2613. list.push( arg );
  2614. }
  2615. } else if ( arg && arg.length && type !== "string" ) {
  2616. // Inspect recursively
  2617. add( arg );
  2618. }
  2619. });
  2620. })( arguments );
  2621. // Do we need to add the callbacks to the
  2622. // current firing batch?
  2623. if ( firing ) {
  2624. firingLength = list.length;
  2625. // With memory, if we're not firing then
  2626. // we should call right away
  2627. } else if ( memory ) {
  2628. firingStart = start;
  2629. fire( memory );
  2630. }
  2631. }
  2632. return this;
  2633. },
  2634. // Remove a callback from the list
  2635. remove: function() {
  2636. if ( list ) {
  2637. jQuery.each( arguments, function( _, arg ) {
  2638. var index;
  2639. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  2640. list.splice( index, 1 );
  2641. // Handle firing indexes
  2642. if ( firing ) {
  2643. if ( index <= firingLength ) {
  2644. firingLength--;
  2645. }
  2646. if ( index <= firingIndex ) {
  2647. firingIndex--;
  2648. }
  2649. }
  2650. }
  2651. });
  2652. }
  2653. return this;
  2654. },
  2655. // Check if a given callback is in the list.
  2656. // If no argument is given, return whether or not list has callbacks attached.
  2657. has: function( fn ) {
  2658. return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
  2659. },
  2660. // Remove all callbacks from the list
  2661. empty: function() {
  2662. list = [];
  2663. firingLength = 0;
  2664. return this;
  2665. },
  2666. // Have the list do nothing anymore
  2667. disable: function() {
  2668. list = stack = memory = undefined;
  2669. return this;
  2670. },
  2671. // Is it disabled?
  2672. disabled: function() {
  2673. return !list;
  2674. },
  2675. // Lock the list in its current state
  2676. lock: function() {
  2677. stack = undefined;
  2678. if ( !memory ) {
  2679. self.disable();
  2680. }
  2681. return this;
  2682. },
  2683. // Is it locked?
  2684. locked: function() {
  2685. return !stack;
  2686. },
  2687. // Call all callbacks with the given context and arguments
  2688. fireWith: function( context, args ) {
  2689. if ( list && ( !fired || stack ) ) {
  2690. args = args || [];
  2691. args = [ context, args.slice ? args.slice() : args ];
  2692. if ( firing ) {
  2693. stack.push( args );
  2694. } else {
  2695. fire( args );
  2696. }
  2697. }
  2698. return this;
  2699. },
  2700. // Call all the callbacks with the given arguments
  2701. fire: function() {
  2702. self.fireWith( this, arguments );
  2703. return this;
  2704. },
  2705. // To know if the callbacks have already been called at least once
  2706. fired: function() {
  2707. return !!fired;
  2708. }
  2709. };
  2710. return self;
  2711. };
  2712. jQuery.extend({
  2713. Deferred: function( func ) {
  2714. var tuples = [
  2715. // action, add listener, listener list, final state
  2716. [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
  2717. [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
  2718. [ "notify", "progress", jQuery.Callbacks("memory") ]
  2719. ],
  2720. state = "pending",
  2721. promise = {
  2722. state: function() {
  2723. return state;
  2724. },
  2725. always: function() {
  2726. deferred.done( arguments ).fail( arguments );
  2727. return this;
  2728. },
  2729. then: function( /* fnDone, fnFail, fnProgress */ ) {
  2730. var fns = arguments;
  2731. return jQuery.Deferred(function( newDefer ) {
  2732. jQuery.each( tuples, function( i, tuple ) {
  2733. var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
  2734. // deferred[ done | fail | progress ] for forwarding actions to newDefer
  2735. deferred[ tuple[1] ](function() {
  2736. var returned = fn && fn.apply( this, arguments );
  2737. if ( returned && jQuery.isFunction( returned.promise ) ) {
  2738. returned.promise()
  2739. .done( newDefer.resolve )
  2740. .fail( newDefer.reject )
  2741. .progress( newDefer.notify );
  2742. } else {
  2743. newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
  2744. }
  2745. });
  2746. });
  2747. fns = null;
  2748. }).promise();
  2749. },
  2750. // Get a promise for this deferred
  2751. // If obj is provided, the promise aspect is added to the object
  2752. promise: function( obj ) {
  2753. return obj != null ? jQuery.extend( obj, promise ) : promise;
  2754. }
  2755. },
  2756. deferred = {};
  2757. // Keep pipe for back-compat
  2758. promise.pipe = promise.then;
  2759. // Add list-specific methods
  2760. jQuery.each( tuples, function( i, tuple ) {
  2761. var list = tuple[ 2 ],
  2762. stateString = tuple[ 3 ];
  2763. // promise[ done | fail | progress ] = list.add
  2764. promise[ tuple[1] ] = list.add;
  2765. // Handle state
  2766. if ( stateString ) {
  2767. list.add(function() {
  2768. // state = [ resolved | rejected ]
  2769. state = stateString;
  2770. // [ reject_list | resolve_list ].disable; progress_list.lock
  2771. }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
  2772. }
  2773. // deferred[ resolve | reject | notify ]
  2774. deferred[ tuple[0] ] = function() {
  2775. deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
  2776. return this;
  2777. };
  2778. deferred[ tuple[0] + "With" ] = list.fireWith;
  2779. });
  2780. // Make the deferred a promise
  2781. promise.promise( deferred );
  2782. // Call given func if any
  2783. if ( func ) {
  2784. func.call( deferred, deferred );
  2785. }
  2786. // All done!
  2787. return deferred;
  2788. },
  2789. // Deferred helper
  2790. when: function( subordinate /* , ..., subordinateN */ ) {
  2791. var i = 0,
  2792. resolveValues = slice.call( arguments ),
  2793. length = resolveValues.length,
  2794. // the count of uncompleted subordinates
  2795. remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
  2796. // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
  2797. deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
  2798. // Update function for both resolve and progress values
  2799. updateFunc = function( i, contexts, values ) {
  2800. return function( value ) {
  2801. contexts[ i ] = this;
  2802. values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  2803. if ( values === progressValues ) {
  2804. deferred.notifyWith( contexts, values );
  2805. } else if ( !( --remaining ) ) {
  2806. deferred.resolveWith( contexts, values );
  2807. }
  2808. };
  2809. },
  2810. progressValues, progressContexts, resolveContexts;
  2811. // add listeners to Deferred subordinates; treat others as resolved
  2812. if ( length > 1 ) {
  2813. progressValues = new Array( length );
  2814. progressContexts = new Array( length );
  2815. resolveContexts = new Array( length );
  2816. for ( ; i < length; i++ ) {
  2817. if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
  2818. resolveValues[ i ].promise()
  2819. .done( updateFunc( i, resolveContexts, resolveValues ) )
  2820. .fail( deferred.reject )
  2821. .progress( updateFunc( i, progressContexts, progressValues ) );
  2822. } else {
  2823. --remaining;
  2824. }
  2825. }
  2826. }
  2827. // if we're not waiting on anything, resolve the master
  2828. if ( !remaining ) {
  2829. deferred.resolveWith( resolveContexts, resolveValues );
  2830. }
  2831. return deferred.promise();
  2832. }
  2833. });
  2834. // The deferred used on DOM ready
  2835. var readyList;
  2836. jQuery.fn.ready = function( fn ) {
  2837. // Add the callback
  2838. jQuery.ready.promise().done( fn );
  2839. return this;
  2840. };
  2841. jQuery.extend({
  2842. // Is the DOM ready to be used? Set to true once it occurs.
  2843. isReady: false,
  2844. // A counter to track how many items to wait for before
  2845. // the ready event fires. See #6781
  2846. readyWait: 1,
  2847. // Hold (or release) the ready event
  2848. holdReady: function( hold ) {
  2849. if ( hold ) {
  2850. jQuery.readyWait++;
  2851. } else {
  2852. jQuery.ready( true );
  2853. }
  2854. },
  2855. // Handle when the DOM is ready
  2856. ready: function( wait ) {
  2857. // Abort if there are pending holds or we're already ready
  2858. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  2859. return;
  2860. }
  2861. // Remember that the DOM is ready
  2862. jQuery.isReady = true;
  2863. // If a normal DOM Ready event fired, decrement, and wait if need be
  2864. if ( wait !== true && --jQuery.readyWait > 0 ) {
  2865. return;
  2866. }
  2867. // If there are functions bound, to execute
  2868. readyList.resolveWith( document, [ jQuery ] );
  2869. // Trigger any bound ready events
  2870. if ( jQuery.fn.triggerHandler ) {
  2871. jQuery( document ).triggerHandler( "ready" );
  2872. jQuery( document ).off( "ready" );
  2873. }
  2874. }
  2875. });
  2876. /**
  2877. * The ready event handler and self cleanup method
  2878. */
  2879. function completed() {
  2880. document.removeEventListener( "DOMContentLoaded", completed, false );
  2881. window.removeEventListener( "load", completed, false );
  2882. jQuery.ready();
  2883. }
  2884. jQuery.ready.promise = function( obj ) {
  2885. if ( !readyList ) {
  2886. readyList = jQuery.Deferred();
  2887. // Catch cases where $(document).ready() is called after the browser event has already occurred.
  2888. // we once tried to use readyState "interactive" here, but it caused issues like the one
  2889. // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
  2890. if ( document.readyState === "complete" ) {
  2891. // Handle it asynchronously to allow scripts the opportunity to delay ready
  2892. setTimeout( jQuery.ready );
  2893. } else {
  2894. // Use the handy event callback
  2895. document.addEventListener( "DOMContentLoaded", completed, false );
  2896. // A fallback to window.onload, that will always work
  2897. window.addEventListener( "load", completed, false );
  2898. }
  2899. }
  2900. return readyList.promise( obj );
  2901. };
  2902. // Kick off the DOM ready check even if the user does not
  2903. jQuery.ready.promise();
  2904. // Multifunctional method to get and set values of a collection
  2905. // The value/s can optionally be executed if it's a function
  2906. var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  2907. var i = 0,
  2908. len = elems.length,
  2909. bulk = key == null;
  2910. // Sets many values
  2911. if ( jQuery.type( key ) === "object" ) {
  2912. chainable = true;
  2913. for ( i in key ) {
  2914. jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
  2915. }
  2916. // Sets one value
  2917. } else if ( value !== undefined ) {
  2918. chainable = true;
  2919. if ( !jQuery.isFunction( value ) ) {
  2920. raw = true;
  2921. }
  2922. if ( bulk ) {
  2923. // Bulk operations run against the entire set
  2924. if ( raw ) {
  2925. fn.call( elems, value );
  2926. fn = null;
  2927. // ...except when executing function values
  2928. } else {
  2929. bulk = fn;
  2930. fn = function( elem, key, value ) {
  2931. return bulk.call( jQuery( elem ), value );
  2932. };
  2933. }
  2934. }
  2935. if ( fn ) {
  2936. for ( ; i < len; i++ ) {
  2937. fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
  2938. }
  2939. }
  2940. }
  2941. return chainable ?
  2942. elems :
  2943. // Gets
  2944. bulk ?
  2945. fn.call( elems ) :
  2946. len ? fn( elems[0], key ) : emptyGet;
  2947. };
  2948. /**
  2949. * Determines whether an object can have data
  2950. */
  2951. jQuery.acceptData = function( owner ) {
  2952. // Accepts only:
  2953. // - Node
  2954. // - Node.ELEMENT_NODE
  2955. // - Node.DOCUMENT_NODE
  2956. // - Object
  2957. // - Any
  2958. /* jshint -W018 */
  2959. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  2960. };
  2961. function Data() {
  2962. // Support: Android < 4,
  2963. // Old WebKit does not have Object.preventExtensions/freeze method,
  2964. // return new empty object instead with no [[set]] accessor
  2965. Object.defineProperty( this.cache = {}, 0, {
  2966. get: function() {
  2967. return {};
  2968. }
  2969. });
  2970. this.expando = jQuery.expando + Math.random();
  2971. }
  2972. Data.uid = 1;
  2973. Data.accepts = jQuery.acceptData;
  2974. Data.prototype = {
  2975. key: function( owner ) {
  2976. // We can accept data for non-element nodes in modern browsers,
  2977. // but we should not, see #8335.
  2978. // Always return the key for a frozen object.
  2979. if ( !Data.accepts( owner ) ) {
  2980. return 0;
  2981. }
  2982. var descriptor = {},
  2983. // Check if the owner object already has a cache key
  2984. unlock = owner[ this.expando ];
  2985. // If not, create one
  2986. if ( !unlock ) {
  2987. unlock = Data.uid++;
  2988. // Secure it in a non-enumerable, non-writable property
  2989. try {
  2990. descriptor[ this.expando ] = { value: unlock };
  2991. Object.defineProperties( owner, descriptor );
  2992. // Support: Android < 4
  2993. // Fallback to a less secure definition
  2994. } catch ( e ) {
  2995. descriptor[ this.expando ] = unlock;
  2996. jQuery.extend( owner, descriptor );
  2997. }
  2998. }
  2999. // Ensure the cache object
  3000. if ( !this.cache[ unlock ] ) {
  3001. this.cache[ unlock ] = {};
  3002. }
  3003. return unlock;
  3004. },
  3005. set: function( owner, data, value ) {
  3006. var prop,
  3007. // There may be an unlock assigned to this node,
  3008. // if there is no entry for this "owner", create one inline
  3009. // and set the unlock as though an owner entry had always existed
  3010. unlock = this.key( owner ),
  3011. cache = this.cache[ unlock ];
  3012. // Handle: [ owner, key, value ] args
  3013. if ( typeof data === "string" ) {
  3014. cache[ data ] = value;
  3015. // Handle: [ owner, { properties } ] args
  3016. } else {
  3017. // Fresh assignments by object are shallow copied
  3018. if ( jQuery.isEmptyObject( cache ) ) {
  3019. jQuery.extend( this.cache[ unlock ], data );
  3020. // Otherwise, copy the properties one-by-one to the cache object
  3021. } else {
  3022. for ( prop in data ) {
  3023. cache[ prop ] = data[ prop ];
  3024. }
  3025. }
  3026. }
  3027. return cache;
  3028. },
  3029. get: function( owner, key ) {
  3030. // Either a valid cache is found, or will be created.
  3031. // New caches will be created and the unlock returned,
  3032. // allowing direct access to the newly created
  3033. // empty data object. A valid owner object must be provided.
  3034. var cache = this.cache[ this.key( owner ) ];
  3035. return key === undefined ?
  3036. cache : cache[ key ];
  3037. },
  3038. access: function( owner, key, value ) {
  3039. var stored;
  3040. // In cases where either:
  3041. //
  3042. // 1. No key was specified
  3043. // 2. A string key was specified, but no value provided
  3044. //
  3045. // Take the "read" path and allow the get method to determine
  3046. // which value to return, respectively either:
  3047. //
  3048. // 1. The entire cache object
  3049. // 2. The data stored at the key
  3050. //
  3051. if ( key === undefined ||
  3052. ((key && typeof key === "string") && value === undefined) ) {
  3053. stored = this.get( owner, key );
  3054. return stored !== undefined ?
  3055. stored : this.get( owner, jQuery.camelCase(key) );
  3056. }
  3057. // [*]When the key is not a string, or both a key and value
  3058. // are specified, set or extend (existing objects) with either:
  3059. //
  3060. // 1. An object of properties
  3061. // 2. A key and value
  3062. //
  3063. this.set( owner, key, value );
  3064. // Since the "set" path can have two possible entry points
  3065. // return the expected data based on which path was taken[*]
  3066. return value !== undefined ? value : key;
  3067. },
  3068. remove: function( owner, key ) {
  3069. var i, name, camel,
  3070. unlock = this.key( owner ),
  3071. cache = this.cache[ unlock ];
  3072. if ( key === undefined ) {
  3073. this.cache[ unlock ] = {};
  3074. } else {
  3075. // Support array or space separated string of keys
  3076. if ( jQuery.isArray( key ) ) {
  3077. // If "name" is an array of keys...
  3078. // When data is initially created, via ("key", "val") signature,
  3079. // keys will be converted to camelCase.
  3080. // Since there is no way to tell _how_ a key was added, remove
  3081. // both plain key and camelCase key. #12786
  3082. // This will only penalize the array argument path.
  3083. name = key.concat( key.map( jQuery.camelCase ) );
  3084. } else {
  3085. camel = jQuery.camelCase( key );
  3086. // Try the string as a key before any manipulation
  3087. if ( key in cache ) {
  3088. name = [ key, camel ];
  3089. } else {
  3090. // If a key with the spaces exists, use it.
  3091. // Otherwise, create an array by matching non-whitespace
  3092. name = camel;
  3093. name = name in cache ?
  3094. [ name ] : ( name.match( rnotwhite ) || [] );
  3095. }
  3096. }
  3097. i = name.length;
  3098. while ( i-- ) {
  3099. delete cache[ name[ i ] ];
  3100. }
  3101. }
  3102. },
  3103. hasData: function( owner ) {
  3104. return !jQuery.isEmptyObject(
  3105. this.cache[ owner[ this.expando ] ] || {}
  3106. );
  3107. },
  3108. discard: function( owner ) {
  3109. if ( owner[ this.expando ] ) {
  3110. delete this.cache[ owner[ this.expando ] ];
  3111. }
  3112. }
  3113. };
  3114. var data_priv = new Data();
  3115. var data_user = new Data();
  3116. /*
  3117. Implementation Summary
  3118. 1. Enforce API surface and semantic compatibility with 1.9.x branch
  3119. 2. Improve the module's maintainability by reducing the storage
  3120. paths to a single mechanism.
  3121. 3. Use the same single mechanism to support "private" and "user" data.
  3122. 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  3123. 5. Avoid exposing implementation details on user objects (eg. expando properties)
  3124. 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  3125. */
  3126. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  3127. rmultiDash = /([A-Z])/g;
  3128. function dataAttr( elem, key, data ) {
  3129. var name;
  3130. // If nothing was found internally, try to fetch any
  3131. // data from the HTML5 data-* attribute
  3132. if ( data === undefined && elem.nodeType === 1 ) {
  3133. name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
  3134. data = elem.getAttribute( name );
  3135. if ( typeof data === "string" ) {
  3136. try {
  3137. data = data === "true" ? true :
  3138. data === "false" ? false :
  3139. data === "null" ? null :
  3140. // Only convert to a number if it doesn't change the string
  3141. +data + "" === data ? +data :
  3142. rbrace.test( data ) ? jQuery.parseJSON( data ) :
  3143. data;
  3144. } catch( e ) {}
  3145. // Make sure we set the data so it isn't changed later
  3146. data_user.set( elem, key, data );
  3147. } else {
  3148. data = undefined;
  3149. }
  3150. }
  3151. return data;
  3152. }
  3153. jQuery.extend({
  3154. hasData: function( elem ) {
  3155. return data_user.hasData( elem ) || data_priv.hasData( elem );
  3156. },
  3157. data: function( elem, name, data ) {
  3158. return data_user.access( elem, name, data );
  3159. },
  3160. removeData: function( elem, name ) {
  3161. data_user.remove( elem, name );
  3162. },
  3163. // TODO: Now that all calls to _data and _removeData have been replaced
  3164. // with direct calls to data_priv methods, these can be deprecated.
  3165. _data: function( elem, name, data ) {
  3166. return data_priv.access( elem, name, data );
  3167. },
  3168. _removeData: function( elem, name ) {
  3169. data_priv.remove( elem, name );
  3170. }
  3171. });
  3172. jQuery.fn.extend({
  3173. data: function( key, value ) {
  3174. var i, name, data,
  3175. elem = this[ 0 ],
  3176. attrs = elem && elem.attributes;
  3177. // Gets all values
  3178. if ( key === undefined ) {
  3179. if ( this.length ) {
  3180. data = data_user.get( elem );
  3181. if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
  3182. i = attrs.length;
  3183. while ( i-- ) {
  3184. // Support: IE11+
  3185. // The attrs elements can be null (#14894)
  3186. if ( attrs[ i ] ) {
  3187. name = attrs[ i ].name;
  3188. if ( name.indexOf( "data-" ) === 0 ) {
  3189. name = jQuery.camelCase( name.slice(5) );
  3190. dataAttr( elem, name, data[ name ] );
  3191. }
  3192. }
  3193. }
  3194. data_priv.set( elem, "hasDataAttrs", true );
  3195. }
  3196. }
  3197. return data;
  3198. }
  3199. // Sets multiple values
  3200. if ( typeof key === "object" ) {
  3201. return this.each(function() {
  3202. data_user.set( this, key );
  3203. });
  3204. }
  3205. return access( this, function( value ) {
  3206. var data,
  3207. camelKey = jQuery.camelCase( key );
  3208. // The calling jQuery object (element matches) is not empty
  3209. // (and therefore has an element appears at this[ 0 ]) and the
  3210. // `value` parameter was not undefined. An empty jQuery object
  3211. // will result in `undefined` for elem = this[ 0 ] which will
  3212. // throw an exception if an attempt to read a data cache is made.
  3213. if ( elem && value === undefined ) {
  3214. // Attempt to get data from the cache
  3215. // with the key as-is
  3216. data = data_user.get( elem, key );
  3217. if ( data !== undefined ) {
  3218. return data;
  3219. }
  3220. // Attempt to get data from the cache
  3221. // with the key camelized
  3222. data = data_user.get( elem, camelKey );
  3223. if ( data !== undefined ) {
  3224. return data;
  3225. }
  3226. // Attempt to "discover" the data in
  3227. // HTML5 custom data-* attrs
  3228. data = dataAttr( elem, camelKey, undefined );
  3229. if ( data !== undefined ) {
  3230. return data;
  3231. }
  3232. // We tried really hard, but the data doesn't exist.
  3233. return;
  3234. }
  3235. // Set the data...
  3236. this.each(function() {
  3237. // First, attempt to store a copy or reference of any
  3238. // data that might've been store with a camelCased key.
  3239. var data = data_user.get( this, camelKey );
  3240. // For HTML5 data-* attribute interop, we have to
  3241. // store property names with dashes in a camelCase form.
  3242. // This might not apply to all properties...*
  3243. data_user.set( this, camelKey, value );
  3244. // *... In the case of properties that might _actually_
  3245. // have dashes, we need to also store a copy of that
  3246. // unchanged property.
  3247. if ( key.indexOf("-") !== -1 && data !== undefined ) {
  3248. data_user.set( this, key, value );
  3249. }
  3250. });
  3251. }, null, value, arguments.length > 1, null, true );
  3252. },
  3253. removeData: function( key ) {
  3254. return this.each(function() {
  3255. data_user.remove( this, key );
  3256. });
  3257. }
  3258. });
  3259. jQuery.extend({
  3260. queue: function( elem, type, data ) {
  3261. var queue;
  3262. if ( elem ) {
  3263. type = ( type || "fx" ) + "queue";
  3264. queue = data_priv.get( elem, type );
  3265. // Speed up dequeue by getting out quickly if this is just a lookup
  3266. if ( data ) {
  3267. if ( !queue || jQuery.isArray( data ) ) {
  3268. queue = data_priv.access( elem, type, jQuery.makeArray(data) );
  3269. } else {
  3270. queue.push( data );
  3271. }
  3272. }
  3273. return queue || [];
  3274. }
  3275. },
  3276. dequeue: function( elem, type ) {
  3277. type = type || "fx";
  3278. var queue = jQuery.queue( elem, type ),
  3279. startLength = queue.length,
  3280. fn = queue.shift(),
  3281. hooks = jQuery._queueHooks( elem, type ),
  3282. next = function() {
  3283. jQuery.dequeue( elem, type );
  3284. };
  3285. // If the fx queue is dequeued, always remove the progress sentinel
  3286. if ( fn === "inprogress" ) {
  3287. fn = queue.shift();
  3288. startLength--;
  3289. }
  3290. if ( fn ) {
  3291. // Add a progress sentinel to prevent the fx queue from being
  3292. // automatically dequeued
  3293. if ( type === "fx" ) {
  3294. queue.unshift( "inprogress" );
  3295. }
  3296. // clear up the last queue stop function
  3297. delete hooks.stop;
  3298. fn.call( elem, next, hooks );
  3299. }
  3300. if ( !startLength && hooks ) {
  3301. hooks.empty.fire();
  3302. }
  3303. },
  3304. // not intended for public consumption - generates a queueHooks object, or returns the current one
  3305. _queueHooks: function( elem, type ) {
  3306. var key = type + "queueHooks";
  3307. return data_priv.get( elem, key ) || data_priv.access( elem, key, {
  3308. empty: jQuery.Callbacks("once memory").add(function() {
  3309. data_priv.remove( elem, [ type + "queue", key ] );
  3310. })
  3311. });
  3312. }
  3313. });
  3314. jQuery.fn.extend({
  3315. queue: function( type, data ) {
  3316. var setter = 2;
  3317. if ( typeof type !== "string" ) {
  3318. data = type;
  3319. type = "fx";
  3320. setter--;
  3321. }
  3322. if ( arguments.length < setter ) {
  3323. return jQuery.queue( this[0], type );
  3324. }
  3325. return data === undefined ?
  3326. this :
  3327. this.each(function() {
  3328. var queue = jQuery.queue( this, type, data );
  3329. // ensure a hooks for this queue
  3330. jQuery._queueHooks( this, type );
  3331. if ( type === "fx" && queue[0] !== "inprogress" ) {
  3332. jQuery.dequeue( this, type );
  3333. }
  3334. });
  3335. },
  3336. dequeue: function( type ) {
  3337. return this.each(function() {
  3338. jQuery.dequeue( this, type );
  3339. });
  3340. },
  3341. clearQueue: function( type ) {
  3342. return this.queue( type || "fx", [] );
  3343. },
  3344. // Get a promise resolved when queues of a certain type
  3345. // are emptied (fx is the type by default)
  3346. promise: function( type, obj ) {
  3347. var tmp,
  3348. count = 1,
  3349. defer = jQuery.Deferred(),
  3350. elements = this,
  3351. i = this.length,
  3352. resolve = function() {
  3353. if ( !( --count ) ) {
  3354. defer.resolveWith( elements, [ elements ] );
  3355. }
  3356. };
  3357. if ( typeof type !== "string" ) {
  3358. obj = type;
  3359. type = undefined;
  3360. }
  3361. type = type || "fx";
  3362. while ( i-- ) {
  3363. tmp = data_priv.get( elements[ i ], type + "queueHooks" );
  3364. if ( tmp && tmp.empty ) {
  3365. count++;
  3366. tmp.empty.add( resolve );
  3367. }
  3368. }
  3369. resolve();
  3370. return defer.promise( obj );
  3371. }
  3372. });
  3373. var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
  3374. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  3375. var isHidden = function( elem, el ) {
  3376. // isHidden might be called from jQuery#filter function;
  3377. // in that case, element will be second argument
  3378. elem = el || elem;
  3379. return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
  3380. };
  3381. var rcheckableType = (/^(?:checkbox|radio)$/i);
  3382. (function() {
  3383. var fragment = document.createDocumentFragment(),
  3384. div = fragment.appendChild( document.createElement( "div" ) ),
  3385. input = document.createElement( "input" );
  3386. // #11217 - WebKit loses check when the name is after the checked attribute
  3387. // Support: Windows Web Apps (WWA)
  3388. // `name` and `type` need .setAttribute for WWA
  3389. input.setAttribute( "type", "radio" );
  3390. input.setAttribute( "checked", "checked" );
  3391. input.setAttribute( "name", "t" );
  3392. div.appendChild( input );
  3393. // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
  3394. // old WebKit doesn't clone checked state correctly in fragments
  3395. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  3396. // Make sure textarea (and checkbox) defaultValue is properly cloned
  3397. // Support: IE9-IE11+
  3398. div.innerHTML = "<textarea>x</textarea>";
  3399. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  3400. })();
  3401. var strundefined = typeof undefined;
  3402. support.focusinBubbles = "onfocusin" in window;
  3403. var
  3404. rkeyEvent = /^key/,
  3405. rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
  3406. rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  3407. rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
  3408. function returnTrue() {
  3409. return true;
  3410. }
  3411. function returnFalse() {
  3412. return false;
  3413. }
  3414. function safeActiveElement() {
  3415. try {
  3416. return document.activeElement;
  3417. } catch ( err ) { }
  3418. }
  3419. /*
  3420. * Helper functions for managing events -- not part of the public interface.
  3421. * Props to Dean Edwards' addEvent library for many of the ideas.
  3422. */
  3423. jQuery.event = {
  3424. global: {},
  3425. add: function( elem, types, handler, data, selector ) {
  3426. var handleObjIn, eventHandle, tmp,
  3427. events, t, handleObj,
  3428. special, handlers, type, namespaces, origType,
  3429. elemData = data_priv.get( elem );
  3430. // Don't attach events to noData or text/comment nodes (but allow plain objects)
  3431. if ( !elemData ) {
  3432. return;
  3433. }
  3434. // Caller can pass in an object of custom data in lieu of the handler
  3435. if ( handler.handler ) {
  3436. handleObjIn = handler;
  3437. handler = handleObjIn.handler;
  3438. selector = handleObjIn.selector;
  3439. }
  3440. // Make sure that the handler has a unique ID, used to find/remove it later
  3441. if ( !handler.guid ) {
  3442. handler.guid = jQuery.guid++;
  3443. }
  3444. // Init the element's event structure and main handler, if this is the first
  3445. if ( !(events = elemData.events) ) {
  3446. events = elemData.events = {};
  3447. }
  3448. if ( !(eventHandle = elemData.handle) ) {
  3449. eventHandle = elemData.handle = function( e ) {
  3450. // Discard the second event of a jQuery.event.trigger() and
  3451. // when an event is called after a page has unloaded
  3452. return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
  3453. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  3454. };
  3455. }
  3456. // Handle multiple events separated by a space
  3457. types = ( types || "" ).match( rnotwhite ) || [ "" ];
  3458. t = types.length;
  3459. while ( t-- ) {
  3460. tmp = rtypenamespace.exec( types[t] ) || [];
  3461. type = origType = tmp[1];
  3462. namespaces = ( tmp[2] || "" ).split( "." ).sort();
  3463. // There *must* be a type, no attaching namespace-only handlers
  3464. if ( !type ) {
  3465. continue;
  3466. }
  3467. // If event changes its type, use the special event handlers for the changed type
  3468. special = jQuery.event.special[ type ] || {};
  3469. // If selector defined, determine special event api type, otherwise given type
  3470. type = ( selector ? special.delegateType : special.bindType ) || type;
  3471. // Update special based on newly reset type
  3472. special = jQuery.event.special[ type ] || {};
  3473. // handleObj is passed to all event handlers
  3474. handleObj = jQuery.extend({
  3475. type: type,
  3476. origType: origType,
  3477. data: data,
  3478. handler: handler,
  3479. guid: handler.guid,
  3480. selector: selector,
  3481. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  3482. namespace: namespaces.join(".")
  3483. }, handleObjIn );
  3484. // Init the event handler queue if we're the first
  3485. if ( !(handlers = events[ type ]) ) {
  3486. handlers = events[ type ] = [];
  3487. handlers.delegateCount = 0;
  3488. // Only use addEventListener if the special events handler returns false
  3489. if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  3490. if ( elem.addEventListener ) {
  3491. elem.addEventListener( type, eventHandle, false );
  3492. }
  3493. }
  3494. }
  3495. if ( special.add ) {
  3496. special.add.call( elem, handleObj );
  3497. if ( !handleObj.handler.guid ) {
  3498. handleObj.handler.guid = handler.guid;
  3499. }
  3500. }
  3501. // Add to the element's handler list, delegates in front
  3502. if ( selector ) {
  3503. handlers.splice( handlers.delegateCount++, 0, handleObj );
  3504. } else {
  3505. handlers.push( handleObj );
  3506. }
  3507. // Keep track of which events have ever been used, for event optimization
  3508. jQuery.event.global[ type ] = true;
  3509. }
  3510. },
  3511. // Detach an event or set of events from an element
  3512. remove: function( elem, types, handler, selector, mappedTypes ) {
  3513. var j, origCount, tmp,
  3514. events, t, handleObj,
  3515. special, handlers, type, namespaces, origType,
  3516. elemData = data_priv.hasData( elem ) && data_priv.get( elem );
  3517. if ( !elemData || !(events = elemData.events) ) {
  3518. return;
  3519. }
  3520. // Once for each type.namespace in types; type may be omitted
  3521. types = ( types || "" ).match( rnotwhite ) || [ "" ];
  3522. t = types.length;
  3523. while ( t-- ) {
  3524. tmp = rtypenamespace.exec( types[t] ) || [];
  3525. type = origType = tmp[1];
  3526. namespaces = ( tmp[2] || "" ).split( "." ).sort();
  3527. // Unbind all events (on this namespace, if provided) for the element
  3528. if ( !type ) {
  3529. for ( type in events ) {
  3530. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  3531. }
  3532. continue;
  3533. }
  3534. special = jQuery.event.special[ type ] || {};
  3535. type = ( selector ? special.delegateType : special.bindType ) || type;
  3536. handlers = events[ type ] || [];
  3537. tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
  3538. // Remove matching events
  3539. origCount = j = handlers.length;
  3540. while ( j-- ) {
  3541. handleObj = handlers[ j ];
  3542. if ( ( mappedTypes || origType === handleObj.origType ) &&
  3543. ( !handler || handler.guid === handleObj.guid ) &&
  3544. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  3545. ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
  3546. handlers.splice( j, 1 );
  3547. if ( handleObj.selector ) {
  3548. handlers.delegateCount--;
  3549. }
  3550. if ( special.remove ) {
  3551. special.remove.call( elem, handleObj );
  3552. }
  3553. }
  3554. }
  3555. // Remove generic event handler if we removed something and no more handlers exist
  3556. // (avoids potential for endless recursion during removal of special event handlers)
  3557. if ( origCount && !handlers.length ) {
  3558. if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  3559. jQuery.removeEvent( elem, type, elemData.handle );
  3560. }
  3561. delete events[ type ];
  3562. }
  3563. }
  3564. // Remove the expando if it's no longer used
  3565. if ( jQuery.isEmptyObject( events ) ) {
  3566. delete elemData.handle;
  3567. data_priv.remove( elem, "events" );
  3568. }
  3569. },
  3570. trigger: function( event, data, elem, onlyHandlers ) {
  3571. var i, cur, tmp, bubbleType, ontype, handle, special,
  3572. eventPath = [ elem || document ],
  3573. type = hasOwn.call( event, "type" ) ? event.type : event,
  3574. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
  3575. cur = tmp = elem = elem || document;
  3576. // Don't do events on text and comment nodes
  3577. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  3578. return;
  3579. }
  3580. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  3581. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  3582. return;
  3583. }
  3584. if ( type.indexOf(".") >= 0 ) {
  3585. // Namespaced trigger; create a regexp to match event type in handle()
  3586. namespaces = type.split(".");
  3587. type = namespaces.shift();
  3588. namespaces.sort();
  3589. }
  3590. ontype = type.indexOf(":") < 0 && "on" + type;
  3591. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  3592. event = event[ jQuery.expando ] ?
  3593. event :
  3594. new jQuery.Event( type, typeof event === "object" && event );
  3595. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  3596. event.isTrigger = onlyHandlers ? 2 : 3;
  3597. event.namespace = namespaces.join(".");
  3598. event.namespace_re = event.namespace ?
  3599. new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
  3600. null;
  3601. // Clean up the event in case it is being reused
  3602. event.result = undefined;
  3603. if ( !event.target ) {
  3604. event.target = elem;
  3605. }
  3606. // Clone any incoming data and prepend the event, creating the handler arg list
  3607. data = data == null ?
  3608. [ event ] :
  3609. jQuery.makeArray( data, [ event ] );
  3610. // Allow special events to draw outside the lines
  3611. special = jQuery.event.special[ type ] || {};
  3612. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  3613. return;
  3614. }
  3615. // Determine event propagation path in advance, per W3C events spec (#9951)
  3616. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  3617. if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
  3618. bubbleType = special.delegateType || type;
  3619. if ( !rfocusMorph.test( bubbleType + type ) ) {
  3620. cur = cur.parentNode;
  3621. }
  3622. for ( ; cur; cur = cur.parentNode ) {
  3623. eventPath.push( cur );
  3624. tmp = cur;
  3625. }
  3626. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  3627. if ( tmp === (elem.ownerDocument || document) ) {
  3628. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  3629. }
  3630. }
  3631. // Fire handlers on the event path
  3632. i = 0;
  3633. while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
  3634. event.type = i > 1 ?
  3635. bubbleType :
  3636. special.bindType || type;
  3637. // jQuery handler
  3638. handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
  3639. if ( handle ) {
  3640. handle.apply( cur, data );
  3641. }
  3642. // Native handler
  3643. handle = ontype && cur[ ontype ];
  3644. if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
  3645. event.result = handle.apply( cur, data );
  3646. if ( event.result === false ) {
  3647. event.preventDefault();
  3648. }
  3649. }
  3650. }
  3651. event.type = type;
  3652. // If nobody prevented the default action, do it now
  3653. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  3654. if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
  3655. jQuery.acceptData( elem ) ) {
  3656. // Call a native DOM method on the target with the same name name as the event.
  3657. // Don't do default actions on window, that's where global variables be (#6170)
  3658. if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
  3659. // Don't re-trigger an onFOO event when we call its FOO() method
  3660. tmp = elem[ ontype ];
  3661. if ( tmp ) {
  3662. elem[ ontype ] = null;
  3663. }
  3664. // Prevent re-triggering of the same event, since we already bubbled it above
  3665. jQuery.event.triggered = type;
  3666. elem[ type ]();
  3667. jQuery.event.triggered = undefined;
  3668. if ( tmp ) {
  3669. elem[ ontype ] = tmp;
  3670. }
  3671. }
  3672. }
  3673. }
  3674. return event.result;
  3675. },
  3676. dispatch: function( event ) {
  3677. // Make a writable jQuery.Event from the native event object
  3678. event = jQuery.event.fix( event );
  3679. var i, j, ret, matched, handleObj,
  3680. handlerQueue = [],
  3681. args = slice.call( arguments ),
  3682. handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],
  3683. special = jQuery.event.special[ event.type ] || {};
  3684. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  3685. args[0] = event;
  3686. event.delegateTarget = this;
  3687. // Call the preDispatch hook for the mapped type, and let it bail if desired
  3688. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  3689. return;
  3690. }
  3691. // Determine handlers
  3692. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  3693. // Run delegates first; they may want to stop propagation beneath us
  3694. i = 0;
  3695. while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
  3696. event.currentTarget = matched.elem;
  3697. j = 0;
  3698. while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
  3699. // Triggered event must either 1) have no namespace, or
  3700. // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
  3701. if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
  3702. event.handleObj = handleObj;
  3703. event.data = handleObj.data;
  3704. ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
  3705. .apply( matched.elem, args );
  3706. if ( ret !== undefined ) {
  3707. if ( (event.result = ret) === false ) {
  3708. event.preventDefault();
  3709. event.stopPropagation();
  3710. }
  3711. }
  3712. }
  3713. }
  3714. }
  3715. // Call the postDispatch hook for the mapped type
  3716. if ( special.postDispatch ) {
  3717. special.postDispatch.call( this, event );
  3718. }
  3719. return event.result;
  3720. },
  3721. handlers: function( event, handlers ) {
  3722. var i, matches, sel, handleObj,
  3723. handlerQueue = [],
  3724. delegateCount = handlers.delegateCount,
  3725. cur = event.target;
  3726. // Find delegate handlers
  3727. // Black-hole SVG <use> instance trees (#13180)
  3728. // Avoid non-left-click bubbling in Firefox (#3861)
  3729. if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
  3730. for ( ; cur !== this; cur = cur.parentNode || this ) {
  3731. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  3732. if ( cur.disabled !== true || event.type !== "click" ) {
  3733. matches = [];
  3734. for ( i = 0; i < delegateCount; i++ ) {
  3735. handleObj = handlers[ i ];
  3736. // Don't conflict with Object.prototype properties (#13203)
  3737. sel = handleObj.selector + " ";
  3738. if ( matches[ sel ] === undefined ) {
  3739. matches[ sel ] = handleObj.needsContext ?
  3740. jQuery( sel, this ).index( cur ) >= 0 :
  3741. jQuery.find( sel, this, null, [ cur ] ).length;
  3742. }
  3743. if ( matches[ sel ] ) {
  3744. matches.push( handleObj );
  3745. }
  3746. }
  3747. if ( matches.length ) {
  3748. handlerQueue.push({ elem: cur, handlers: matches });
  3749. }
  3750. }
  3751. }
  3752. }
  3753. // Add the remaining (directly-bound) handlers
  3754. if ( delegateCount < handlers.length ) {
  3755. handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
  3756. }
  3757. return handlerQueue;
  3758. },
  3759. // Includes some event props shared by KeyEvent and MouseEvent
  3760. props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
  3761. fixHooks: {},
  3762. keyHooks: {
  3763. props: "char charCode key keyCode".split(" "),
  3764. filter: function( event, original ) {
  3765. // Add which for key events
  3766. if ( event.which == null ) {
  3767. event.which = original.charCode != null ? original.charCode : original.keyCode;
  3768. }
  3769. return event;
  3770. }
  3771. },
  3772. mouseHooks: {
  3773. props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
  3774. filter: function( event, original ) {
  3775. var eventDoc, doc, body,
  3776. button = original.button;
  3777. // Calculate pageX/Y if missing and clientX/Y available
  3778. if ( event.pageX == null && original.clientX != null ) {
  3779. eventDoc = event.target.ownerDocument || document;
  3780. doc = eventDoc.documentElement;
  3781. body = eventDoc.body;
  3782. event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
  3783. event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
  3784. }
  3785. // Add which for click: 1 === left; 2 === middle; 3 === right
  3786. // Note: button is not normalized, so don't use it
  3787. if ( !event.which && button !== undefined ) {
  3788. event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
  3789. }
  3790. return event;
  3791. }
  3792. },
  3793. fix: function( event ) {
  3794. if ( event[ jQuery.expando ] ) {
  3795. return event;
  3796. }
  3797. // Create a writable copy of the event object and normalize some properties
  3798. var i, prop, copy,
  3799. type = event.type,
  3800. originalEvent = event,
  3801. fixHook = this.fixHooks[ type ];
  3802. if ( !fixHook ) {
  3803. this.fixHooks[ type ] = fixHook =
  3804. rmouseEvent.test( type ) ? this.mouseHooks :
  3805. rkeyEvent.test( type ) ? this.keyHooks :
  3806. {};
  3807. }
  3808. copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
  3809. event = new jQuery.Event( originalEvent );
  3810. i = copy.length;
  3811. while ( i-- ) {
  3812. prop = copy[ i ];
  3813. event[ prop ] = originalEvent[ prop ];
  3814. }
  3815. // Support: Cordova 2.5 (WebKit) (#13255)
  3816. // All events should have a target; Cordova deviceready doesn't
  3817. if ( !event.target ) {
  3818. event.target = document;
  3819. }
  3820. // Support: Safari 6.0+, Chrome < 28
  3821. // Target should not be a text node (#504, #13143)
  3822. if ( event.target.nodeType === 3 ) {
  3823. event.target = event.target.parentNode;
  3824. }
  3825. return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
  3826. },
  3827. special: {
  3828. load: {
  3829. // Prevent triggered image.load events from bubbling to window.load
  3830. noBubble: true
  3831. },
  3832. focus: {
  3833. // Fire native event if possible so blur/focus sequence is correct
  3834. trigger: function() {
  3835. if ( this !== safeActiveElement() && this.focus ) {
  3836. this.focus();
  3837. return false;
  3838. }
  3839. },
  3840. delegateType: "focusin"
  3841. },
  3842. blur: {
  3843. trigger: function() {
  3844. if ( this === safeActiveElement() && this.blur ) {
  3845. this.blur();
  3846. return false;
  3847. }
  3848. },
  3849. delegateType: "focusout"
  3850. },
  3851. click: {
  3852. // For checkbox, fire native event so checked state will be right
  3853. trigger: function() {
  3854. if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
  3855. this.click();
  3856. return false;
  3857. }
  3858. },
  3859. // For cross-browser consistency, don't fire native .click() on links
  3860. _default: function( event ) {
  3861. return jQuery.nodeName( event.target, "a" );
  3862. }
  3863. },
  3864. beforeunload: {
  3865. postDispatch: function( event ) {
  3866. // Support: Firefox 20+
  3867. // Firefox doesn't alert if the returnValue field is not set.
  3868. if ( event.result !== undefined && event.originalEvent ) {
  3869. event.originalEvent.returnValue = event.result;
  3870. }
  3871. }
  3872. }
  3873. },
  3874. simulate: function( type, elem, event, bubble ) {
  3875. // Piggyback on a donor event to simulate a different one.
  3876. // Fake originalEvent to avoid donor's stopPropagation, but if the
  3877. // simulated event prevents default then we do the same on the donor.
  3878. var e = jQuery.extend(
  3879. new jQuery.Event(),
  3880. event,
  3881. {
  3882. type: type,
  3883. isSimulated: true,
  3884. originalEvent: {}
  3885. }
  3886. );
  3887. if ( bubble ) {
  3888. jQuery.event.trigger( e, null, elem );
  3889. } else {
  3890. jQuery.event.dispatch.call( elem, e );
  3891. }
  3892. if ( e.isDefaultPrevented() ) {
  3893. event.preventDefault();
  3894. }
  3895. }
  3896. };
  3897. jQuery.removeEvent = function( elem, type, handle ) {
  3898. if ( elem.removeEventListener ) {
  3899. elem.removeEventListener( type, handle, false );
  3900. }
  3901. };
  3902. jQuery.Event = function( src, props ) {
  3903. // Allow instantiation without the 'new' keyword
  3904. if ( !(this instanceof jQuery.Event) ) {
  3905. return new jQuery.Event( src, props );
  3906. }
  3907. // Event object
  3908. if ( src && src.type ) {
  3909. this.originalEvent = src;
  3910. this.type = src.type;
  3911. // Events bubbling up the document may have been marked as prevented
  3912. // by a handler lower down the tree; reflect the correct value.
  3913. this.isDefaultPrevented = src.defaultPrevented ||
  3914. src.defaultPrevented === undefined &&
  3915. // Support: Android < 4.0
  3916. src.returnValue === false ?
  3917. returnTrue :
  3918. returnFalse;
  3919. // Event type
  3920. } else {
  3921. this.type = src;
  3922. }
  3923. // Put explicitly provided properties onto the event object
  3924. if ( props ) {
  3925. jQuery.extend( this, props );
  3926. }
  3927. // Create a timestamp if incoming event doesn't have one
  3928. this.timeStamp = src && src.timeStamp || jQuery.now();
  3929. // Mark it as fixed
  3930. this[ jQuery.expando ] = true;
  3931. };
  3932. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  3933. // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  3934. jQuery.Event.prototype = {
  3935. isDefaultPrevented: returnFalse,
  3936. isPropagationStopped: returnFalse,
  3937. isImmediatePropagationStopped: returnFalse,
  3938. preventDefault: function() {
  3939. var e = this.originalEvent;
  3940. this.isDefaultPrevented = returnTrue;
  3941. if ( e && e.preventDefault ) {
  3942. e.preventDefault();
  3943. }
  3944. },
  3945. stopPropagation: function() {
  3946. var e = this.originalEvent;
  3947. this.isPropagationStopped = returnTrue;
  3948. if ( e && e.stopPropagation ) {
  3949. e.stopPropagation();
  3950. }
  3951. },
  3952. stopImmediatePropagation: function() {
  3953. var e = this.originalEvent;
  3954. this.isImmediatePropagationStopped = returnTrue;
  3955. if ( e && e.stopImmediatePropagation ) {
  3956. e.stopImmediatePropagation();
  3957. }
  3958. this.stopPropagation();
  3959. }
  3960. };
  3961. // Create mouseenter/leave events using mouseover/out and event-time checks
  3962. // Support: Chrome 15+
  3963. jQuery.each({
  3964. mouseenter: "mouseover",
  3965. mouseleave: "mouseout",
  3966. pointerenter: "pointerover",
  3967. pointerleave: "pointerout"
  3968. }, function( orig, fix ) {
  3969. jQuery.event.special[ orig ] = {
  3970. delegateType: fix,
  3971. bindType: fix,
  3972. handle: function( event ) {
  3973. var ret,
  3974. target = this,
  3975. related = event.relatedTarget,
  3976. handleObj = event.handleObj;
  3977. // For mousenter/leave call the handler if related is outside the target.
  3978. // NB: No relatedTarget if the mouse left/entered the browser window
  3979. if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
  3980. event.type = handleObj.origType;
  3981. ret = handleObj.handler.apply( this, arguments );
  3982. event.type = fix;
  3983. }
  3984. return ret;
  3985. }
  3986. };
  3987. });
  3988. // Create "bubbling" focus and blur events
  3989. // Support: Firefox, Chrome, Safari
  3990. if ( !support.focusinBubbles ) {
  3991. jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  3992. // Attach a single capturing handler on the document while someone wants focusin/focusout
  3993. var handler = function( event ) {
  3994. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
  3995. };
  3996. jQuery.event.special[ fix ] = {
  3997. setup: function() {
  3998. var doc = this.ownerDocument || this,
  3999. attaches = data_priv.access( doc, fix );
  4000. if ( !attaches ) {
  4001. doc.addEventListener( orig, handler, true );
  4002. }
  4003. data_priv.access( doc, fix, ( attaches || 0 ) + 1 );
  4004. },
  4005. teardown: function() {
  4006. var doc = this.ownerDocument || this,
  4007. attaches = data_priv.access( doc, fix ) - 1;
  4008. if ( !attaches ) {
  4009. doc.removeEventListener( orig, handler, true );
  4010. data_priv.remove( doc, fix );
  4011. } else {
  4012. data_priv.access( doc, fix, attaches );
  4013. }
  4014. }
  4015. };
  4016. });
  4017. }
  4018. jQuery.fn.extend({
  4019. on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
  4020. var origFn, type;
  4021. // Types can be a map of types/handlers
  4022. if ( typeof types === "object" ) {
  4023. // ( types-Object, selector, data )
  4024. if ( typeof selector !== "string" ) {
  4025. // ( types-Object, data )
  4026. data = data || selector;
  4027. selector = undefined;
  4028. }
  4029. for ( type in types ) {
  4030. this.on( type, selector, data, types[ type ], one );
  4031. }
  4032. return this;
  4033. }
  4034. if ( data == null && fn == null ) {
  4035. // ( types, fn )
  4036. fn = selector;
  4037. data = selector = undefined;
  4038. } else if ( fn == null ) {
  4039. if ( typeof selector === "string" ) {
  4040. // ( types, selector, fn )
  4041. fn = data;
  4042. data = undefined;
  4043. } else {
  4044. // ( types, data, fn )
  4045. fn = data;
  4046. data = selector;
  4047. selector = undefined;
  4048. }
  4049. }
  4050. if ( fn === false ) {
  4051. fn = returnFalse;
  4052. } else if ( !fn ) {
  4053. return this;
  4054. }
  4055. if ( one === 1 ) {
  4056. origFn = fn;
  4057. fn = function( event ) {
  4058. // Can use an empty set, since event contains the info
  4059. jQuery().off( event );
  4060. return origFn.apply( this, arguments );
  4061. };
  4062. // Use same guid so caller can remove using origFn
  4063. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  4064. }
  4065. return this.each( function() {
  4066. jQuery.event.add( this, types, fn, data, selector );
  4067. });
  4068. },
  4069. one: function( types, selector, data, fn ) {
  4070. return this.on( types, selector, data, fn, 1 );
  4071. },
  4072. off: function( types, selector, fn ) {
  4073. var handleObj, type;
  4074. if ( types && types.preventDefault && types.handleObj ) {
  4075. // ( event ) dispatched jQuery.Event
  4076. handleObj = types.handleObj;
  4077. jQuery( types.delegateTarget ).off(
  4078. handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
  4079. handleObj.selector,
  4080. handleObj.handler
  4081. );
  4082. return this;
  4083. }
  4084. if ( typeof types === "object" ) {
  4085. // ( types-object [, selector] )
  4086. for ( type in types ) {
  4087. this.off( type, selector, types[ type ] );
  4088. }
  4089. return this;
  4090. }
  4091. if ( selector === false || typeof selector === "function" ) {
  4092. // ( types [, fn] )
  4093. fn = selector;
  4094. selector = undefined;
  4095. }
  4096. if ( fn === false ) {
  4097. fn = returnFalse;
  4098. }
  4099. return this.each(function() {
  4100. jQuery.event.remove( this, types, fn, selector );
  4101. });
  4102. },
  4103. trigger: function( type, data ) {
  4104. return this.each(function() {
  4105. jQuery.event.trigger( type, data, this );
  4106. });
  4107. },
  4108. triggerHandler: function( type, data ) {
  4109. var elem = this[0];
  4110. if ( elem ) {
  4111. return jQuery.event.trigger( type, data, elem, true );
  4112. }
  4113. }
  4114. });
  4115. var
  4116. rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
  4117. rtagName = /<([\w:]+)/,
  4118. rhtml = /<|&#?\w+;/,
  4119. rnoInnerhtml = /<(?:script|style|link)/i,
  4120. // checked="checked" or checked
  4121. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  4122. rscriptType = /^$|\/(?:java|ecma)script/i,
  4123. rscriptTypeMasked = /^true\/(.*)/,
  4124. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
  4125. // We have to close these tags to support XHTML (#13200)
  4126. wrapMap = {
  4127. // Support: IE 9
  4128. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  4129. thead: [ 1, "<table>", "</table>" ],
  4130. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  4131. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  4132. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  4133. _default: [ 0, "", "" ]
  4134. };
  4135. // Support: IE 9
  4136. wrapMap.optgroup = wrapMap.option;
  4137. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  4138. wrapMap.th = wrapMap.td;
  4139. // Support: 1.x compatibility
  4140. // Manipulating tables requires a tbody
  4141. function manipulationTarget( elem, content ) {
  4142. return jQuery.nodeName( elem, "table" ) &&
  4143. jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
  4144. elem.getElementsByTagName("tbody")[0] ||
  4145. elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
  4146. elem;
  4147. }
  4148. // Replace/restore the type attribute of script elements for safe DOM manipulation
  4149. function disableScript( elem ) {
  4150. elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
  4151. return elem;
  4152. }
  4153. function restoreScript( elem ) {
  4154. var match = rscriptTypeMasked.exec( elem.type );
  4155. if ( match ) {
  4156. elem.type = match[ 1 ];
  4157. } else {
  4158. elem.removeAttribute("type");
  4159. }
  4160. return elem;
  4161. }
  4162. // Mark scripts as having already been evaluated
  4163. function setGlobalEval( elems, refElements ) {
  4164. var i = 0,
  4165. l = elems.length;
  4166. for ( ; i < l; i++ ) {
  4167. data_priv.set(
  4168. elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )
  4169. );
  4170. }
  4171. }
  4172. function cloneCopyEvent( src, dest ) {
  4173. var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
  4174. if ( dest.nodeType !== 1 ) {
  4175. return;
  4176. }
  4177. // 1. Copy private data: events, handlers, etc.
  4178. if ( data_priv.hasData( src ) ) {
  4179. pdataOld = data_priv.access( src );
  4180. pdataCur = data_priv.set( dest, pdataOld );
  4181. events = pdataOld.events;
  4182. if ( events ) {
  4183. delete pdataCur.handle;
  4184. pdataCur.events = {};
  4185. for ( type in events ) {
  4186. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  4187. jQuery.event.add( dest, type, events[ type ][ i ] );
  4188. }
  4189. }
  4190. }
  4191. }
  4192. // 2. Copy user data
  4193. if ( data_user.hasData( src ) ) {
  4194. udataOld = data_user.access( src );
  4195. udataCur = jQuery.extend( {}, udataOld );
  4196. data_user.set( dest, udataCur );
  4197. }
  4198. }
  4199. function getAll( context, tag ) {
  4200. var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :
  4201. context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :
  4202. [];
  4203. return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
  4204. jQuery.merge( [ context ], ret ) :
  4205. ret;
  4206. }
  4207. // Support: IE >= 9
  4208. function fixInput( src, dest ) {
  4209. var nodeName = dest.nodeName.toLowerCase();
  4210. // Fails to persist the checked state of a cloned checkbox or radio button.
  4211. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  4212. dest.checked = src.checked;
  4213. // Fails to return the selected option to the default selected state when cloning options
  4214. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  4215. dest.defaultValue = src.defaultValue;
  4216. }
  4217. }
  4218. jQuery.extend({
  4219. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  4220. var i, l, srcElements, destElements,
  4221. clone = elem.cloneNode( true ),
  4222. inPage = jQuery.contains( elem.ownerDocument, elem );
  4223. // Support: IE >= 9
  4224. // Fix Cloning issues
  4225. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  4226. !jQuery.isXMLDoc( elem ) ) {
  4227. // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
  4228. destElements = getAll( clone );
  4229. srcElements = getAll( elem );
  4230. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  4231. fixInput( srcElements[ i ], destElements[ i ] );
  4232. }
  4233. }
  4234. // Copy the events from the original to the clone
  4235. if ( dataAndEvents ) {
  4236. if ( deepDataAndEvents ) {
  4237. srcElements = srcElements || getAll( elem );
  4238. destElements = destElements || getAll( clone );
  4239. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  4240. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  4241. }
  4242. } else {
  4243. cloneCopyEvent( elem, clone );
  4244. }
  4245. }
  4246. // Preserve script evaluation history
  4247. destElements = getAll( clone, "script" );
  4248. if ( destElements.length > 0 ) {
  4249. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  4250. }
  4251. // Return the cloned set
  4252. return clone;
  4253. },
  4254. buildFragment: function( elems, context, scripts, selection ) {
  4255. var elem, tmp, tag, wrap, contains, j,
  4256. fragment = context.createDocumentFragment(),
  4257. nodes = [],
  4258. i = 0,
  4259. l = elems.length;
  4260. for ( ; i < l; i++ ) {
  4261. elem = elems[ i ];
  4262. if ( elem || elem === 0 ) {
  4263. // Add nodes directly
  4264. if ( jQuery.type( elem ) === "object" ) {
  4265. // Support: QtWebKit
  4266. // jQuery.merge because push.apply(_, arraylike) throws
  4267. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  4268. // Convert non-html into a text node
  4269. } else if ( !rhtml.test( elem ) ) {
  4270. nodes.push( context.createTextNode( elem ) );
  4271. // Convert html into DOM nodes
  4272. } else {
  4273. tmp = tmp || fragment.appendChild( context.createElement("div") );
  4274. // Deserialize a standard representation
  4275. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  4276. wrap = wrapMap[ tag ] || wrapMap._default;
  4277. tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
  4278. // Descend through wrappers to the right content
  4279. j = wrap[ 0 ];
  4280. while ( j-- ) {
  4281. tmp = tmp.lastChild;
  4282. }
  4283. // Support: QtWebKit
  4284. // jQuery.merge because push.apply(_, arraylike) throws
  4285. jQuery.merge( nodes, tmp.childNodes );
  4286. // Remember the top-level container
  4287. tmp = fragment.firstChild;
  4288. // Fixes #12346
  4289. // Support: Webkit, IE
  4290. tmp.textContent = "";
  4291. }
  4292. }
  4293. }
  4294. // Remove wrapper from fragment
  4295. fragment.textContent = "";
  4296. i = 0;
  4297. while ( (elem = nodes[ i++ ]) ) {
  4298. // #4087 - If origin and destination elements are the same, and this is
  4299. // that element, do not do anything
  4300. if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
  4301. continue;
  4302. }
  4303. contains = jQuery.contains( elem.ownerDocument, elem );
  4304. // Append to fragment
  4305. tmp = getAll( fragment.appendChild( elem ), "script" );
  4306. // Preserve script evaluation history
  4307. if ( contains ) {
  4308. setGlobalEval( tmp );
  4309. }
  4310. // Capture executables
  4311. if ( scripts ) {
  4312. j = 0;
  4313. while ( (elem = tmp[ j++ ]) ) {
  4314. if ( rscriptType.test( elem.type || "" ) ) {
  4315. scripts.push( elem );
  4316. }
  4317. }
  4318. }
  4319. }
  4320. return fragment;
  4321. },
  4322. cleanData: function( elems ) {
  4323. var data, elem, type, key,
  4324. special = jQuery.event.special,
  4325. i = 0;
  4326. for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
  4327. if ( jQuery.acceptData( elem ) ) {
  4328. key = elem[ data_priv.expando ];
  4329. if ( key && (data = data_priv.cache[ key ]) ) {
  4330. if ( data.events ) {
  4331. for ( type in data.events ) {
  4332. if ( special[ type ] ) {
  4333. jQuery.event.remove( elem, type );
  4334. // This is a shortcut to avoid jQuery.event.remove's overhead
  4335. } else {
  4336. jQuery.removeEvent( elem, type, data.handle );
  4337. }
  4338. }
  4339. }
  4340. if ( data_priv.cache[ key ] ) {
  4341. // Discard any remaining `private` data
  4342. delete data_priv.cache[ key ];
  4343. }
  4344. }
  4345. }
  4346. // Discard any remaining `user` data
  4347. delete data_user.cache[ elem[ data_user.expando ] ];
  4348. }
  4349. }
  4350. });
  4351. jQuery.fn.extend({
  4352. text: function( value ) {
  4353. return access( this, function( value ) {
  4354. return value === undefined ?
  4355. jQuery.text( this ) :
  4356. this.empty().each(function() {
  4357. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4358. this.textContent = value;
  4359. }
  4360. });
  4361. }, null, value, arguments.length );
  4362. },
  4363. append: function() {
  4364. return this.domManip( arguments, function( elem ) {
  4365. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4366. var target = manipulationTarget( this, elem );
  4367. target.appendChild( elem );
  4368. }
  4369. });
  4370. },
  4371. prepend: function() {
  4372. return this.domManip( arguments, function( elem ) {
  4373. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4374. var target = manipulationTarget( this, elem );
  4375. target.insertBefore( elem, target.firstChild );
  4376. }
  4377. });
  4378. },
  4379. before: function() {
  4380. return this.domManip( arguments, function( elem ) {
  4381. if ( this.parentNode ) {
  4382. this.parentNode.insertBefore( elem, this );
  4383. }
  4384. });
  4385. },
  4386. after: function() {
  4387. return this.domManip( arguments, function( elem ) {
  4388. if ( this.parentNode ) {
  4389. this.parentNode.insertBefore( elem, this.nextSibling );
  4390. }
  4391. });
  4392. },
  4393. remove: function( selector, keepData /* Internal Use Only */ ) {
  4394. var elem,
  4395. elems = selector ? jQuery.filter( selector, this ) : this,
  4396. i = 0;
  4397. for ( ; (elem = elems[i]) != null; i++ ) {
  4398. if ( !keepData && elem.nodeType === 1 ) {
  4399. jQuery.cleanData( getAll( elem ) );
  4400. }
  4401. if ( elem.parentNode ) {
  4402. if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
  4403. setGlobalEval( getAll( elem, "script" ) );
  4404. }
  4405. elem.parentNode.removeChild( elem );
  4406. }
  4407. }
  4408. return this;
  4409. },
  4410. empty: function() {
  4411. var elem,
  4412. i = 0;
  4413. for ( ; (elem = this[i]) != null; i++ ) {
  4414. if ( elem.nodeType === 1 ) {
  4415. // Prevent memory leaks
  4416. jQuery.cleanData( getAll( elem, false ) );
  4417. // Remove any remaining nodes
  4418. elem.textContent = "";
  4419. }
  4420. }
  4421. return this;
  4422. },
  4423. clone: function( dataAndEvents, deepDataAndEvents ) {
  4424. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  4425. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  4426. return this.map(function() {
  4427. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  4428. });
  4429. },
  4430. html: function( value ) {
  4431. return access( this, function( value ) {
  4432. var elem = this[ 0 ] || {},
  4433. i = 0,
  4434. l = this.length;
  4435. if ( value === undefined && elem.nodeType === 1 ) {
  4436. return elem.innerHTML;
  4437. }
  4438. // See if we can take a shortcut and just use innerHTML
  4439. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  4440. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  4441. value = value.replace( rxhtmlTag, "<$1></$2>" );
  4442. try {
  4443. for ( ; i < l; i++ ) {
  4444. elem = this[ i ] || {};
  4445. // Remove element nodes and prevent memory leaks
  4446. if ( elem.nodeType === 1 ) {
  4447. jQuery.cleanData( getAll( elem, false ) );
  4448. elem.innerHTML = value;
  4449. }
  4450. }
  4451. elem = 0;
  4452. // If using innerHTML throws an exception, use the fallback method
  4453. } catch( e ) {}
  4454. }
  4455. if ( elem ) {
  4456. this.empty().append( value );
  4457. }
  4458. }, null, value, arguments.length );
  4459. },
  4460. replaceWith: function() {
  4461. var arg = arguments[ 0 ];
  4462. // Make the changes, replacing each context element with the new content
  4463. this.domManip( arguments, function( elem ) {
  4464. arg = this.parentNode;
  4465. jQuery.cleanData( getAll( this ) );
  4466. if ( arg ) {
  4467. arg.replaceChild( elem, this );
  4468. }
  4469. });
  4470. // Force removal if there was no new content (e.g., from empty arguments)
  4471. return arg && (arg.length || arg.nodeType) ? this : this.remove();
  4472. },
  4473. detach: function( selector ) {
  4474. return this.remove( selector, true );
  4475. },
  4476. domManip: function( args, callback ) {
  4477. // Flatten any nested arrays
  4478. args = concat.apply( [], args );
  4479. var fragment, first, scripts, hasScripts, node, doc,
  4480. i = 0,
  4481. l = this.length,
  4482. set = this,
  4483. iNoClone = l - 1,
  4484. value = args[ 0 ],
  4485. isFunction = jQuery.isFunction( value );
  4486. // We can't cloneNode fragments that contain checked, in WebKit
  4487. if ( isFunction ||
  4488. ( l > 1 && typeof value === "string" &&
  4489. !support.checkClone && rchecked.test( value ) ) ) {
  4490. return this.each(function( index ) {
  4491. var self = set.eq( index );
  4492. if ( isFunction ) {
  4493. args[ 0 ] = value.call( this, index, self.html() );
  4494. }
  4495. self.domManip( args, callback );
  4496. });
  4497. }
  4498. if ( l ) {
  4499. fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
  4500. first = fragment.firstChild;
  4501. if ( fragment.childNodes.length === 1 ) {
  4502. fragment = first;
  4503. }
  4504. if ( first ) {
  4505. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  4506. hasScripts = scripts.length;
  4507. // Use the original fragment for the last item instead of the first because it can end up
  4508. // being emptied incorrectly in certain situations (#8070).
  4509. for ( ; i < l; i++ ) {
  4510. node = fragment;
  4511. if ( i !== iNoClone ) {
  4512. node = jQuery.clone( node, true, true );
  4513. // Keep references to cloned scripts for later restoration
  4514. if ( hasScripts ) {
  4515. // Support: QtWebKit
  4516. // jQuery.merge because push.apply(_, arraylike) throws
  4517. jQuery.merge( scripts, getAll( node, "script" ) );
  4518. }
  4519. }
  4520. callback.call( this[ i ], node, i );
  4521. }
  4522. if ( hasScripts ) {
  4523. doc = scripts[ scripts.length - 1 ].ownerDocument;
  4524. // Reenable scripts
  4525. jQuery.map( scripts, restoreScript );
  4526. // Evaluate executable scripts on first document insertion
  4527. for ( i = 0; i < hasScripts; i++ ) {
  4528. node = scripts[ i ];
  4529. if ( rscriptType.test( node.type || "" ) &&
  4530. !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
  4531. if ( node.src ) {
  4532. // Optional AJAX dependency, but won't run scripts if not present
  4533. if ( jQuery._evalUrl ) {
  4534. jQuery._evalUrl( node.src );
  4535. }
  4536. } else {
  4537. jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
  4538. }
  4539. }
  4540. }
  4541. }
  4542. }
  4543. }
  4544. return this;
  4545. }
  4546. });
  4547. jQuery.each({
  4548. appendTo: "append",
  4549. prependTo: "prepend",
  4550. insertBefore: "before",
  4551. insertAfter: "after",
  4552. replaceAll: "replaceWith"
  4553. }, function( name, original ) {
  4554. jQuery.fn[ name ] = function( selector ) {
  4555. var elems,
  4556. ret = [],
  4557. insert = jQuery( selector ),
  4558. last = insert.length - 1,
  4559. i = 0;
  4560. for ( ; i <= last; i++ ) {
  4561. elems = i === last ? this : this.clone( true );
  4562. jQuery( insert[ i ] )[ original ]( elems );
  4563. // Support: QtWebKit
  4564. // .get() because push.apply(_, arraylike) throws
  4565. push.apply( ret, elems.get() );
  4566. }
  4567. return this.pushStack( ret );
  4568. };
  4569. });
  4570. var iframe,
  4571. elemdisplay = {};
  4572. /**
  4573. * Retrieve the actual display of a element
  4574. * @param {String} name nodeName of the element
  4575. * @param {Object} doc Document object
  4576. */
  4577. // Called only from within defaultDisplay
  4578. function actualDisplay( name, doc ) {
  4579. var style,
  4580. elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
  4581. // getDefaultComputedStyle might be reliably used only on attached element
  4582. display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
  4583. // Use of this method is a temporary fix (more like optmization) until something better comes along,
  4584. // since it was removed from specification and supported only in FF
  4585. style.display : jQuery.css( elem[ 0 ], "display" );
  4586. // We don't have any data stored on the element,
  4587. // so use "detach" method as fast way to get rid of the element
  4588. elem.detach();
  4589. return display;
  4590. }
  4591. /**
  4592. * Try to determine the default display value of an element
  4593. * @param {String} nodeName
  4594. */
  4595. function defaultDisplay( nodeName ) {
  4596. var doc = document,
  4597. display = elemdisplay[ nodeName ];
  4598. if ( !display ) {
  4599. display = actualDisplay( nodeName, doc );
  4600. // If the simple way fails, read from inside an iframe
  4601. if ( display === "none" || !display ) {
  4602. // Use the already-created iframe if possible
  4603. iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
  4604. // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
  4605. doc = iframe[ 0 ].contentDocument;
  4606. // Support: IE
  4607. doc.write();
  4608. doc.close();
  4609. display = actualDisplay( nodeName, doc );
  4610. iframe.detach();
  4611. }
  4612. // Store the correct default display
  4613. elemdisplay[ nodeName ] = display;
  4614. }
  4615. return display;
  4616. }
  4617. var rmargin = (/^margin/);
  4618. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  4619. var getStyles = function( elem ) {
  4620. return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
  4621. };
  4622. function curCSS( elem, name, computed ) {
  4623. var width, minWidth, maxWidth, ret,
  4624. style = elem.style;
  4625. computed = computed || getStyles( elem );
  4626. // Support: IE9
  4627. // getPropertyValue is only needed for .css('filter') in IE9, see #12537
  4628. if ( computed ) {
  4629. ret = computed.getPropertyValue( name ) || computed[ name ];
  4630. }
  4631. if ( computed ) {
  4632. if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
  4633. ret = jQuery.style( elem, name );
  4634. }
  4635. // Support: iOS < 6
  4636. // A tribute to the "awesome hack by Dean Edwards"
  4637. // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
  4638. // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
  4639. if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
  4640. // Remember the original values
  4641. width = style.width;
  4642. minWidth = style.minWidth;
  4643. maxWidth = style.maxWidth;
  4644. // Put in the new values to get a computed value out
  4645. style.minWidth = style.maxWidth = style.width = ret;
  4646. ret = computed.width;
  4647. // Revert the changed values
  4648. style.width = width;
  4649. style.minWidth = minWidth;
  4650. style.maxWidth = maxWidth;
  4651. }
  4652. }
  4653. return ret !== undefined ?
  4654. // Support: IE
  4655. // IE returns zIndex value as an integer.
  4656. ret + "" :
  4657. ret;
  4658. }
  4659. function addGetHookIf( conditionFn, hookFn ) {
  4660. // Define the hook, we'll check on the first run if it's really needed.
  4661. return {
  4662. get: function() {
  4663. if ( conditionFn() ) {
  4664. // Hook not needed (or it's not possible to use it due to missing dependency),
  4665. // remove it.
  4666. // Since there are no other hooks for marginRight, remove the whole object.
  4667. delete this.get;
  4668. return;
  4669. }
  4670. // Hook needed; redefine it so that the support test is not executed again.
  4671. return (this.get = hookFn).apply( this, arguments );
  4672. }
  4673. };
  4674. }
  4675. (function() {
  4676. var pixelPositionVal, boxSizingReliableVal,
  4677. docElem = document.documentElement,
  4678. container = document.createElement( "div" ),
  4679. div = document.createElement( "div" );
  4680. if ( !div.style ) {
  4681. return;
  4682. }
  4683. div.style.backgroundClip = "content-box";
  4684. div.cloneNode( true ).style.backgroundClip = "";
  4685. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  4686. container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
  4687. "position:absolute";
  4688. container.appendChild( div );
  4689. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  4690. // so they're executed at the same time to save the second computation.
  4691. function computePixelPositionAndBoxSizingReliable() {
  4692. div.style.cssText =
  4693. // Support: Firefox<29, Android 2.3
  4694. // Vendor-prefix box-sizing
  4695. "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
  4696. "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
  4697. "border:1px;padding:1px;width:4px;position:absolute";
  4698. div.innerHTML = "";
  4699. docElem.appendChild( container );
  4700. var divStyle = window.getComputedStyle( div, null );
  4701. pixelPositionVal = divStyle.top !== "1%";
  4702. boxSizingReliableVal = divStyle.width === "4px";
  4703. docElem.removeChild( container );
  4704. }
  4705. // Support: node.js jsdom
  4706. // Don't assume that getComputedStyle is a property of the global object
  4707. if ( window.getComputedStyle ) {
  4708. jQuery.extend( support, {
  4709. pixelPosition: function() {
  4710. // This test is executed only once but we still do memoizing
  4711. // since we can use the boxSizingReliable pre-computing.
  4712. // No need to check if the test was already performed, though.
  4713. computePixelPositionAndBoxSizingReliable();
  4714. return pixelPositionVal;
  4715. },
  4716. boxSizingReliable: function() {
  4717. if ( boxSizingReliableVal == null ) {
  4718. computePixelPositionAndBoxSizingReliable();
  4719. }
  4720. return boxSizingReliableVal;
  4721. },
  4722. reliableMarginRight: function() {
  4723. // Support: Android 2.3
  4724. // Check if div with explicit width and no margin-right incorrectly
  4725. // gets computed margin-right based on width of container. (#3333)
  4726. // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  4727. // This support function is only executed once so no memoizing is needed.
  4728. var ret,
  4729. marginDiv = div.appendChild( document.createElement( "div" ) );
  4730. // Reset CSS: box-sizing; display; margin; border; padding
  4731. marginDiv.style.cssText = div.style.cssText =
  4732. // Support: Firefox<29, Android 2.3
  4733. // Vendor-prefix box-sizing
  4734. "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
  4735. "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
  4736. marginDiv.style.marginRight = marginDiv.style.width = "0";
  4737. div.style.width = "1px";
  4738. docElem.appendChild( container );
  4739. ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );
  4740. docElem.removeChild( container );
  4741. return ret;
  4742. }
  4743. });
  4744. }
  4745. })();
  4746. // A method for quickly swapping in/out CSS properties to get correct calculations.
  4747. jQuery.swap = function( elem, options, callback, args ) {
  4748. var ret, name,
  4749. old = {};
  4750. // Remember the old values, and insert the new ones
  4751. for ( name in options ) {
  4752. old[ name ] = elem.style[ name ];
  4753. elem.style[ name ] = options[ name ];
  4754. }
  4755. ret = callback.apply( elem, args || [] );
  4756. // Revert the old values
  4757. for ( name in options ) {
  4758. elem.style[ name ] = old[ name ];
  4759. }
  4760. return ret;
  4761. };
  4762. var
  4763. // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
  4764. // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  4765. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  4766. rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
  4767. rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
  4768. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  4769. cssNormalTransform = {
  4770. letterSpacing: "0",
  4771. fontWeight: "400"
  4772. },
  4773. cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
  4774. // return a css property mapped to a potentially vendor prefixed property
  4775. function vendorPropName( style, name ) {
  4776. // shortcut for names that are not vendor prefixed
  4777. if ( name in style ) {
  4778. return name;
  4779. }
  4780. // check for vendor prefixed names
  4781. var capName = name[0].toUpperCase() + name.slice(1),
  4782. origName = name,
  4783. i = cssPrefixes.length;
  4784. while ( i-- ) {
  4785. name = cssPrefixes[ i ] + capName;
  4786. if ( name in style ) {
  4787. return name;
  4788. }
  4789. }
  4790. return origName;
  4791. }
  4792. function setPositiveNumber( elem, value, subtract ) {
  4793. var matches = rnumsplit.exec( value );
  4794. return matches ?
  4795. // Guard against undefined "subtract", e.g., when used as in cssHooks
  4796. Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
  4797. value;
  4798. }
  4799. function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
  4800. var i = extra === ( isBorderBox ? "border" : "content" ) ?
  4801. // If we already have the right measurement, avoid augmentation
  4802. 4 :
  4803. // Otherwise initialize for horizontal or vertical properties
  4804. name === "width" ? 1 : 0,
  4805. val = 0;
  4806. for ( ; i < 4; i += 2 ) {
  4807. // both box models exclude margin, so add it if we want it
  4808. if ( extra === "margin" ) {
  4809. val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
  4810. }
  4811. if ( isBorderBox ) {
  4812. // border-box includes padding, so remove it if we want content
  4813. if ( extra === "content" ) {
  4814. val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  4815. }
  4816. // at this point, extra isn't border nor margin, so remove border
  4817. if ( extra !== "margin" ) {
  4818. val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  4819. }
  4820. } else {
  4821. // at this point, extra isn't content, so add padding
  4822. val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  4823. // at this point, extra isn't content nor padding, so add border
  4824. if ( extra !== "padding" ) {
  4825. val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  4826. }
  4827. }
  4828. }
  4829. return val;
  4830. }
  4831. function getWidthOrHeight( elem, name, extra ) {
  4832. // Start with offset property, which is equivalent to the border-box value
  4833. var valueIsBorderBox = true,
  4834. val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
  4835. styles = getStyles( elem ),
  4836. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  4837. // some non-html elements return undefined for offsetWidth, so check for null/undefined
  4838. // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
  4839. // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
  4840. if ( val <= 0 || val == null ) {
  4841. // Fall back to computed then uncomputed css if necessary
  4842. val = curCSS( elem, name, styles );
  4843. if ( val < 0 || val == null ) {
  4844. val = elem.style[ name ];
  4845. }
  4846. // Computed unit is not pixels. Stop here and return.
  4847. if ( rnumnonpx.test(val) ) {
  4848. return val;
  4849. }
  4850. // we need the check for style in case a browser which returns unreliable values
  4851. // for getComputedStyle silently falls back to the reliable elem.style
  4852. valueIsBorderBox = isBorderBox &&
  4853. ( support.boxSizingReliable() || val === elem.style[ name ] );
  4854. // Normalize "", auto, and prepare for extra
  4855. val = parseFloat( val ) || 0;
  4856. }
  4857. // use the active box-sizing model to add/subtract irrelevant styles
  4858. return ( val +
  4859. augmentWidthOrHeight(
  4860. elem,
  4861. name,
  4862. extra || ( isBorderBox ? "border" : "content" ),
  4863. valueIsBorderBox,
  4864. styles
  4865. )
  4866. ) + "px";
  4867. }
  4868. function showHide( elements, show ) {
  4869. var display, elem, hidden,
  4870. values = [],
  4871. index = 0,
  4872. length = elements.length;
  4873. for ( ; index < length; index++ ) {
  4874. elem = elements[ index ];
  4875. if ( !elem.style ) {
  4876. continue;
  4877. }
  4878. values[ index ] = data_priv.get( elem, "olddisplay" );
  4879. display = elem.style.display;
  4880. if ( show ) {
  4881. // Reset the inline display of this element to learn if it is
  4882. // being hidden by cascaded rules or not
  4883. if ( !values[ index ] && display === "none" ) {
  4884. elem.style.display = "";
  4885. }
  4886. // Set elements which have been overridden with display: none
  4887. // in a stylesheet to whatever the default browser style is
  4888. // for such an element
  4889. if ( elem.style.display === "" && isHidden( elem ) ) {
  4890. values[ index ] = data_priv.access( elem, "olddisplay", defaultDisplay(elem.nodeName) );
  4891. }
  4892. } else {
  4893. hidden = isHidden( elem );
  4894. if ( display !== "none" || !hidden ) {
  4895. data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
  4896. }
  4897. }
  4898. }
  4899. // Set the display of most of the elements in a second loop
  4900. // to avoid the constant reflow
  4901. for ( index = 0; index < length; index++ ) {
  4902. elem = elements[ index ];
  4903. if ( !elem.style ) {
  4904. continue;
  4905. }
  4906. if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
  4907. elem.style.display = show ? values[ index ] || "" : "none";
  4908. }
  4909. }
  4910. return elements;
  4911. }
  4912. jQuery.extend({
  4913. // Add in style property hooks for overriding the default
  4914. // behavior of getting and setting a style property
  4915. cssHooks: {
  4916. opacity: {
  4917. get: function( elem, computed ) {
  4918. if ( computed ) {
  4919. // We should always get a number back from opacity
  4920. var ret = curCSS( elem, "opacity" );
  4921. return ret === "" ? "1" : ret;
  4922. }
  4923. }
  4924. }
  4925. },
  4926. // Don't automatically add "px" to these possibly-unitless properties
  4927. cssNumber: {
  4928. "columnCount": true,
  4929. "fillOpacity": true,
  4930. "flexGrow": true,
  4931. "flexShrink": true,
  4932. "fontWeight": true,
  4933. "lineHeight": true,
  4934. "opacity": true,
  4935. "order": true,
  4936. "orphans": true,
  4937. "widows": true,
  4938. "zIndex": true,
  4939. "zoom": true
  4940. },
  4941. // Add in properties whose names you wish to fix before
  4942. // setting or getting the value
  4943. cssProps: {
  4944. // normalize float css property
  4945. "float": "cssFloat"
  4946. },
  4947. // Get and set the style property on a DOM Node
  4948. style: function( elem, name, value, extra ) {
  4949. // Don't set styles on text and comment nodes
  4950. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  4951. return;
  4952. }
  4953. // Make sure that we're working with the right name
  4954. var ret, type, hooks,
  4955. origName = jQuery.camelCase( name ),
  4956. style = elem.style;
  4957. name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
  4958. // gets hook for the prefixed version
  4959. // followed by the unprefixed version
  4960. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  4961. // Check if we're setting a value
  4962. if ( value !== undefined ) {
  4963. type = typeof value;
  4964. // convert relative number strings (+= or -=) to relative numbers. #7345
  4965. if ( type === "string" && (ret = rrelNum.exec( value )) ) {
  4966. value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
  4967. // Fixes bug #9237
  4968. type = "number";
  4969. }
  4970. // Make sure that null and NaN values aren't set. See: #7116
  4971. if ( value == null || value !== value ) {
  4972. return;
  4973. }
  4974. // If a number was passed in, add 'px' to the (except for certain CSS properties)
  4975. if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
  4976. value += "px";
  4977. }
  4978. // Fixes #8908, it can be done more correctly by specifying setters in cssHooks,
  4979. // but it would mean to define eight (for every problematic property) identical functions
  4980. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  4981. style[ name ] = "inherit";
  4982. }
  4983. // If a hook was provided, use that value, otherwise just set the specified value
  4984. if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
  4985. style[ name ] = value;
  4986. }
  4987. } else {
  4988. // If a hook was provided get the non-computed value from there
  4989. if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
  4990. return ret;
  4991. }
  4992. // Otherwise just get the value from the style object
  4993. return style[ name ];
  4994. }
  4995. },
  4996. css: function( elem, name, extra, styles ) {
  4997. var val, num, hooks,
  4998. origName = jQuery.camelCase( name );
  4999. // Make sure that we're working with the right name
  5000. name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
  5001. // gets hook for the prefixed version
  5002. // followed by the unprefixed version
  5003. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5004. // If a hook was provided get the computed value from there
  5005. if ( hooks && "get" in hooks ) {
  5006. val = hooks.get( elem, true, extra );
  5007. }
  5008. // Otherwise, if a way to get the computed value exists, use that
  5009. if ( val === undefined ) {
  5010. val = curCSS( elem, name, styles );
  5011. }
  5012. //convert "normal" to computed value
  5013. if ( val === "normal" && name in cssNormalTransform ) {
  5014. val = cssNormalTransform[ name ];
  5015. }
  5016. // Return, converting to number if forced or a qualifier was provided and val looks numeric
  5017. if ( extra === "" || extra ) {
  5018. num = parseFloat( val );
  5019. return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
  5020. }
  5021. return val;
  5022. }
  5023. });
  5024. jQuery.each([ "height", "width" ], function( i, name ) {
  5025. jQuery.cssHooks[ name ] = {
  5026. get: function( elem, computed, extra ) {
  5027. if ( computed ) {
  5028. // certain elements can have dimension info if we invisibly show them
  5029. // however, it must have a current display style that would benefit from this
  5030. return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
  5031. jQuery.swap( elem, cssShow, function() {
  5032. return getWidthOrHeight( elem, name, extra );
  5033. }) :
  5034. getWidthOrHeight( elem, name, extra );
  5035. }
  5036. },
  5037. set: function( elem, value, extra ) {
  5038. var styles = extra && getStyles( elem );
  5039. return setPositiveNumber( elem, value, extra ?
  5040. augmentWidthOrHeight(
  5041. elem,
  5042. name,
  5043. extra,
  5044. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5045. styles
  5046. ) : 0
  5047. );
  5048. }
  5049. };
  5050. });
  5051. // Support: Android 2.3
  5052. jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
  5053. function( elem, computed ) {
  5054. if ( computed ) {
  5055. // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  5056. // Work around by temporarily setting element display to inline-block
  5057. return jQuery.swap( elem, { "display": "inline-block" },
  5058. curCSS, [ elem, "marginRight" ] );
  5059. }
  5060. }
  5061. );
  5062. // These hooks are used by animate to expand properties
  5063. jQuery.each({
  5064. margin: "",
  5065. padding: "",
  5066. border: "Width"
  5067. }, function( prefix, suffix ) {
  5068. jQuery.cssHooks[ prefix + suffix ] = {
  5069. expand: function( value ) {
  5070. var i = 0,
  5071. expanded = {},
  5072. // assumes a single number if not a string
  5073. parts = typeof value === "string" ? value.split(" ") : [ value ];
  5074. for ( ; i < 4; i++ ) {
  5075. expanded[ prefix + cssExpand[ i ] + suffix ] =
  5076. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  5077. }
  5078. return expanded;
  5079. }
  5080. };
  5081. if ( !rmargin.test( prefix ) ) {
  5082. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  5083. }
  5084. });
  5085. jQuery.fn.extend({
  5086. css: function( name, value ) {
  5087. return access( this, function( elem, name, value ) {
  5088. var styles, len,
  5089. map = {},
  5090. i = 0;
  5091. if ( jQuery.isArray( name ) ) {
  5092. styles = getStyles( elem );
  5093. len = name.length;
  5094. for ( ; i < len; i++ ) {
  5095. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  5096. }
  5097. return map;
  5098. }
  5099. return value !== undefined ?
  5100. jQuery.style( elem, name, value ) :
  5101. jQuery.css( elem, name );
  5102. }, name, value, arguments.length > 1 );
  5103. },
  5104. show: function() {
  5105. return showHide( this, true );
  5106. },
  5107. hide: function() {
  5108. return showHide( this );
  5109. },
  5110. toggle: function( state ) {
  5111. if ( typeof state === "boolean" ) {
  5112. return state ? this.show() : this.hide();
  5113. }
  5114. return this.each(function() {
  5115. if ( isHidden( this ) ) {
  5116. jQuery( this ).show();
  5117. } else {
  5118. jQuery( this ).hide();
  5119. }
  5120. });
  5121. }
  5122. });
  5123. function Tween( elem, options, prop, end, easing ) {
  5124. return new Tween.prototype.init( elem, options, prop, end, easing );
  5125. }
  5126. jQuery.Tween = Tween;
  5127. Tween.prototype = {
  5128. constructor: Tween,
  5129. init: function( elem, options, prop, end, easing, unit ) {
  5130. this.elem = elem;
  5131. this.prop = prop;
  5132. this.easing = easing || "swing";
  5133. this.options = options;
  5134. this.start = this.now = this.cur();
  5135. this.end = end;
  5136. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  5137. },
  5138. cur: function() {
  5139. var hooks = Tween.propHooks[ this.prop ];
  5140. return hooks && hooks.get ?
  5141. hooks.get( this ) :
  5142. Tween.propHooks._default.get( this );
  5143. },
  5144. run: function( percent ) {
  5145. var eased,
  5146. hooks = Tween.propHooks[ this.prop ];
  5147. if ( this.options.duration ) {
  5148. this.pos = eased = jQuery.easing[ this.easing ](
  5149. percent, this.options.duration * percent, 0, 1, this.options.duration
  5150. );
  5151. } else {
  5152. this.pos = eased = percent;
  5153. }
  5154. this.now = ( this.end - this.start ) * eased + this.start;
  5155. if ( this.options.step ) {
  5156. this.options.step.call( this.elem, this.now, this );
  5157. }
  5158. if ( hooks && hooks.set ) {
  5159. hooks.set( this );
  5160. } else {
  5161. Tween.propHooks._default.set( this );
  5162. }
  5163. return this;
  5164. }
  5165. };
  5166. Tween.prototype.init.prototype = Tween.prototype;
  5167. Tween.propHooks = {
  5168. _default: {
  5169. get: function( tween ) {
  5170. var result;
  5171. if ( tween.elem[ tween.prop ] != null &&
  5172. (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
  5173. return tween.elem[ tween.prop ];
  5174. }
  5175. // passing an empty string as a 3rd parameter to .css will automatically
  5176. // attempt a parseFloat and fallback to a string if the parse fails
  5177. // so, simple values such as "10px" are parsed to Float.
  5178. // complex values such as "rotate(1rad)" are returned as is.
  5179. result = jQuery.css( tween.elem, tween.prop, "" );
  5180. // Empty strings, null, undefined and "auto" are converted to 0.
  5181. return !result || result === "auto" ? 0 : result;
  5182. },
  5183. set: function( tween ) {
  5184. // use step hook for back compat - use cssHook if its there - use .style if its
  5185. // available and use plain properties where available
  5186. if ( jQuery.fx.step[ tween.prop ] ) {
  5187. jQuery.fx.step[ tween.prop ]( tween );
  5188. } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
  5189. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  5190. } else {
  5191. tween.elem[ tween.prop ] = tween.now;
  5192. }
  5193. }
  5194. }
  5195. };
  5196. // Support: IE9
  5197. // Panic based approach to setting things on disconnected nodes
  5198. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  5199. set: function( tween ) {
  5200. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  5201. tween.elem[ tween.prop ] = tween.now;
  5202. }
  5203. }
  5204. };
  5205. jQuery.easing = {
  5206. linear: function( p ) {
  5207. return p;
  5208. },
  5209. swing: function( p ) {
  5210. return 0.5 - Math.cos( p * Math.PI ) / 2;
  5211. }
  5212. };
  5213. jQuery.fx = Tween.prototype.init;
  5214. // Back Compat <1.8 extension point
  5215. jQuery.fx.step = {};
  5216. var
  5217. fxNow, timerId,
  5218. rfxtypes = /^(?:toggle|show|hide)$/,
  5219. rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
  5220. rrun = /queueHooks$/,
  5221. animationPrefilters = [ defaultPrefilter ],
  5222. tweeners = {
  5223. "*": [ function( prop, value ) {
  5224. var tween = this.createTween( prop, value ),
  5225. target = tween.cur(),
  5226. parts = rfxnum.exec( value ),
  5227. unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  5228. // Starting value computation is required for potential unit mismatches
  5229. start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
  5230. rfxnum.exec( jQuery.css( tween.elem, prop ) ),
  5231. scale = 1,
  5232. maxIterations = 20;
  5233. if ( start && start[ 3 ] !== unit ) {
  5234. // Trust units reported by jQuery.css
  5235. unit = unit || start[ 3 ];
  5236. // Make sure we update the tween properties later on
  5237. parts = parts || [];
  5238. // Iteratively approximate from a nonzero starting point
  5239. start = +target || 1;
  5240. do {
  5241. // If previous iteration zeroed out, double until we get *something*
  5242. // Use a string for doubling factor so we don't accidentally see scale as unchanged below
  5243. scale = scale || ".5";
  5244. // Adjust and apply
  5245. start = start / scale;
  5246. jQuery.style( tween.elem, prop, start + unit );
  5247. // Update scale, tolerating zero or NaN from tween.cur()
  5248. // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
  5249. } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
  5250. }
  5251. // Update tween properties
  5252. if ( parts ) {
  5253. start = tween.start = +start || +target || 0;
  5254. tween.unit = unit;
  5255. // If a +=/-= token was provided, we're doing a relative animation
  5256. tween.end = parts[ 1 ] ?
  5257. start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
  5258. +parts[ 2 ];
  5259. }
  5260. return tween;
  5261. } ]
  5262. };
  5263. // Animations created synchronously will run synchronously
  5264. function createFxNow() {
  5265. setTimeout(function() {
  5266. fxNow = undefined;
  5267. });
  5268. return ( fxNow = jQuery.now() );
  5269. }
  5270. // Generate parameters to create a standard animation
  5271. function genFx( type, includeWidth ) {
  5272. var which,
  5273. i = 0,
  5274. attrs = { height: type };
  5275. // if we include width, step value is 1 to do all cssExpand values,
  5276. // if we don't include width, step value is 2 to skip over Left and Right
  5277. includeWidth = includeWidth ? 1 : 0;
  5278. for ( ; i < 4 ; i += 2 - includeWidth ) {
  5279. which = cssExpand[ i ];
  5280. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  5281. }
  5282. if ( includeWidth ) {
  5283. attrs.opacity = attrs.width = type;
  5284. }
  5285. return attrs;
  5286. }
  5287. function createTween( value, prop, animation ) {
  5288. var tween,
  5289. collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
  5290. index = 0,
  5291. length = collection.length;
  5292. for ( ; index < length; index++ ) {
  5293. if ( (tween = collection[ index ].call( animation, prop, value )) ) {
  5294. // we're done with this property
  5295. return tween;
  5296. }
  5297. }
  5298. }
  5299. function defaultPrefilter( elem, props, opts ) {
  5300. /* jshint validthis: true */
  5301. var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
  5302. anim = this,
  5303. orig = {},
  5304. style = elem.style,
  5305. hidden = elem.nodeType && isHidden( elem ),
  5306. dataShow = data_priv.get( elem, "fxshow" );
  5307. // handle queue: false promises
  5308. if ( !opts.queue ) {
  5309. hooks = jQuery._queueHooks( elem, "fx" );
  5310. if ( hooks.unqueued == null ) {
  5311. hooks.unqueued = 0;
  5312. oldfire = hooks.empty.fire;
  5313. hooks.empty.fire = function() {
  5314. if ( !hooks.unqueued ) {
  5315. oldfire();
  5316. }
  5317. };
  5318. }
  5319. hooks.unqueued++;
  5320. anim.always(function() {
  5321. // doing this makes sure that the complete handler will be called
  5322. // before this completes
  5323. anim.always(function() {
  5324. hooks.unqueued--;
  5325. if ( !jQuery.queue( elem, "fx" ).length ) {
  5326. hooks.empty.fire();
  5327. }
  5328. });
  5329. });
  5330. }
  5331. // height/width overflow pass
  5332. if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
  5333. // Make sure that nothing sneaks out
  5334. // Record all 3 overflow attributes because IE9-10 do not
  5335. // change the overflow attribute when overflowX and
  5336. // overflowY are set to the same value
  5337. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  5338. // Set display property to inline-block for height/width
  5339. // animations on inline elements that are having width/height animated
  5340. display = jQuery.css( elem, "display" );
  5341. // Test default display if display is currently "none"
  5342. checkDisplay = display === "none" ?
  5343. data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
  5344. if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
  5345. style.display = "inline-block";
  5346. }
  5347. }
  5348. if ( opts.overflow ) {
  5349. style.overflow = "hidden";
  5350. anim.always(function() {
  5351. style.overflow = opts.overflow[ 0 ];
  5352. style.overflowX = opts.overflow[ 1 ];
  5353. style.overflowY = opts.overflow[ 2 ];
  5354. });
  5355. }
  5356. // show/hide pass
  5357. for ( prop in props ) {
  5358. value = props[ prop ];
  5359. if ( rfxtypes.exec( value ) ) {
  5360. delete props[ prop ];
  5361. toggle = toggle || value === "toggle";
  5362. if ( value === ( hidden ? "hide" : "show" ) ) {
  5363. // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
  5364. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  5365. hidden = true;
  5366. } else {
  5367. continue;
  5368. }
  5369. }
  5370. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  5371. // Any non-fx value stops us from restoring the original display value
  5372. } else {
  5373. display = undefined;
  5374. }
  5375. }
  5376. if ( !jQuery.isEmptyObject( orig ) ) {
  5377. if ( dataShow ) {
  5378. if ( "hidden" in dataShow ) {
  5379. hidden = dataShow.hidden;
  5380. }
  5381. } else {
  5382. dataShow = data_priv.access( elem, "fxshow", {} );
  5383. }
  5384. // store state if its toggle - enables .stop().toggle() to "reverse"
  5385. if ( toggle ) {
  5386. dataShow.hidden = !hidden;
  5387. }
  5388. if ( hidden ) {
  5389. jQuery( elem ).show();
  5390. } else {
  5391. anim.done(function() {
  5392. jQuery( elem ).hide();
  5393. });
  5394. }
  5395. anim.done(function() {
  5396. var prop;
  5397. data_priv.remove( elem, "fxshow" );
  5398. for ( prop in orig ) {
  5399. jQuery.style( elem, prop, orig[ prop ] );
  5400. }
  5401. });
  5402. for ( prop in orig ) {
  5403. tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  5404. if ( !( prop in dataShow ) ) {
  5405. dataShow[ prop ] = tween.start;
  5406. if ( hidden ) {
  5407. tween.end = tween.start;
  5408. tween.start = prop === "width" || prop === "height" ? 1 : 0;
  5409. }
  5410. }
  5411. }
  5412. // If this is a noop like .hide().hide(), restore an overwritten display value
  5413. } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
  5414. style.display = display;
  5415. }
  5416. }
  5417. function propFilter( props, specialEasing ) {
  5418. var index, name, easing, value, hooks;
  5419. // camelCase, specialEasing and expand cssHook pass
  5420. for ( index in props ) {
  5421. name = jQuery.camelCase( index );
  5422. easing = specialEasing[ name ];
  5423. value = props[ index ];
  5424. if ( jQuery.isArray( value ) ) {
  5425. easing = value[ 1 ];
  5426. value = props[ index ] = value[ 0 ];
  5427. }
  5428. if ( index !== name ) {
  5429. props[ name ] = value;
  5430. delete props[ index ];
  5431. }
  5432. hooks = jQuery.cssHooks[ name ];
  5433. if ( hooks && "expand" in hooks ) {
  5434. value = hooks.expand( value );
  5435. delete props[ name ];
  5436. // not quite $.extend, this wont overwrite keys already present.
  5437. // also - reusing 'index' from above because we have the correct "name"
  5438. for ( index in value ) {
  5439. if ( !( index in props ) ) {
  5440. props[ index ] = value[ index ];
  5441. specialEasing[ index ] = easing;
  5442. }
  5443. }
  5444. } else {
  5445. specialEasing[ name ] = easing;
  5446. }
  5447. }
  5448. }
  5449. function Animation( elem, properties, options ) {
  5450. var result,
  5451. stopped,
  5452. index = 0,
  5453. length = animationPrefilters.length,
  5454. deferred = jQuery.Deferred().always( function() {
  5455. // don't match elem in the :animated selector
  5456. delete tick.elem;
  5457. }),
  5458. tick = function() {
  5459. if ( stopped ) {
  5460. return false;
  5461. }
  5462. var currentTime = fxNow || createFxNow(),
  5463. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  5464. // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
  5465. temp = remaining / animation.duration || 0,
  5466. percent = 1 - temp,
  5467. index = 0,
  5468. length = animation.tweens.length;
  5469. for ( ; index < length ; index++ ) {
  5470. animation.tweens[ index ].run( percent );
  5471. }
  5472. deferred.notifyWith( elem, [ animation, percent, remaining ]);
  5473. if ( percent < 1 && length ) {
  5474. return remaining;
  5475. } else {
  5476. deferred.resolveWith( elem, [ animation ] );
  5477. return false;
  5478. }
  5479. },
  5480. animation = deferred.promise({
  5481. elem: elem,
  5482. props: jQuery.extend( {}, properties ),
  5483. opts: jQuery.extend( true, { specialEasing: {} }, options ),
  5484. originalProperties: properties,
  5485. originalOptions: options,
  5486. startTime: fxNow || createFxNow(),
  5487. duration: options.duration,
  5488. tweens: [],
  5489. createTween: function( prop, end ) {
  5490. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  5491. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  5492. animation.tweens.push( tween );
  5493. return tween;
  5494. },
  5495. stop: function( gotoEnd ) {
  5496. var index = 0,
  5497. // if we are going to the end, we want to run all the tweens
  5498. // otherwise we skip this part
  5499. length = gotoEnd ? animation.tweens.length : 0;
  5500. if ( stopped ) {
  5501. return this;
  5502. }
  5503. stopped = true;
  5504. for ( ; index < length ; index++ ) {
  5505. animation.tweens[ index ].run( 1 );
  5506. }
  5507. // resolve when we played the last frame
  5508. // otherwise, reject
  5509. if ( gotoEnd ) {
  5510. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  5511. } else {
  5512. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  5513. }
  5514. return this;
  5515. }
  5516. }),
  5517. props = animation.props;
  5518. propFilter( props, animation.opts.specialEasing );
  5519. for ( ; index < length ; index++ ) {
  5520. result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
  5521. if ( result ) {
  5522. return result;
  5523. }
  5524. }
  5525. jQuery.map( props, createTween, animation );
  5526. if ( jQuery.isFunction( animation.opts.start ) ) {
  5527. animation.opts.start.call( elem, animation );
  5528. }
  5529. jQuery.fx.timer(
  5530. jQuery.extend( tick, {
  5531. elem: elem,
  5532. anim: animation,
  5533. queue: animation.opts.queue
  5534. })
  5535. );
  5536. // attach callbacks from options
  5537. return animation.progress( animation.opts.progress )
  5538. .done( animation.opts.done, animation.opts.complete )
  5539. .fail( animation.opts.fail )
  5540. .always( animation.opts.always );
  5541. }
  5542. jQuery.Animation = jQuery.extend( Animation, {
  5543. tweener: function( props, callback ) {
  5544. if ( jQuery.isFunction( props ) ) {
  5545. callback = props;
  5546. props = [ "*" ];
  5547. } else {
  5548. props = props.split(" ");
  5549. }
  5550. var prop,
  5551. index = 0,
  5552. length = props.length;
  5553. for ( ; index < length ; index++ ) {
  5554. prop = props[ index ];
  5555. tweeners[ prop ] = tweeners[ prop ] || [];
  5556. tweeners[ prop ].unshift( callback );
  5557. }
  5558. },
  5559. prefilter: function( callback, prepend ) {
  5560. if ( prepend ) {
  5561. animationPrefilters.unshift( callback );
  5562. } else {
  5563. animationPrefilters.push( callback );
  5564. }
  5565. }
  5566. });
  5567. jQuery.speed = function( speed, easing, fn ) {
  5568. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  5569. complete: fn || !fn && easing ||
  5570. jQuery.isFunction( speed ) && speed,
  5571. duration: speed,
  5572. easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
  5573. };
  5574. opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
  5575. opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
  5576. // normalize opt.queue - true/undefined/null -> "fx"
  5577. if ( opt.queue == null || opt.queue === true ) {
  5578. opt.queue = "fx";
  5579. }
  5580. // Queueing
  5581. opt.old = opt.complete;
  5582. opt.complete = function() {
  5583. if ( jQuery.isFunction( opt.old ) ) {
  5584. opt.old.call( this );
  5585. }
  5586. if ( opt.queue ) {
  5587. jQuery.dequeue( this, opt.queue );
  5588. }
  5589. };
  5590. return opt;
  5591. };
  5592. jQuery.fn.extend({
  5593. fadeTo: function( speed, to, easing, callback ) {
  5594. // show any hidden elements after setting opacity to 0
  5595. return this.filter( isHidden ).css( "opacity", 0 ).show()
  5596. // animate to the value specified
  5597. .end().animate({ opacity: to }, speed, easing, callback );
  5598. },
  5599. animate: function( prop, speed, easing, callback ) {
  5600. var empty = jQuery.isEmptyObject( prop ),
  5601. optall = jQuery.speed( speed, easing, callback ),
  5602. doAnimation = function() {
  5603. // Operate on a copy of prop so per-property easing won't be lost
  5604. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  5605. // Empty animations, or finishing resolves immediately
  5606. if ( empty || data_priv.get( this, "finish" ) ) {
  5607. anim.stop( true );
  5608. }
  5609. };
  5610. doAnimation.finish = doAnimation;
  5611. return empty || optall.queue === false ?
  5612. this.each( doAnimation ) :
  5613. this.queue( optall.queue, doAnimation );
  5614. },
  5615. stop: function( type, clearQueue, gotoEnd ) {
  5616. var stopQueue = function( hooks ) {
  5617. var stop = hooks.stop;
  5618. delete hooks.stop;
  5619. stop( gotoEnd );
  5620. };
  5621. if ( typeof type !== "string" ) {
  5622. gotoEnd = clearQueue;
  5623. clearQueue = type;
  5624. type = undefined;
  5625. }
  5626. if ( clearQueue && type !== false ) {
  5627. this.queue( type || "fx", [] );
  5628. }
  5629. return this.each(function() {
  5630. var dequeue = true,
  5631. index = type != null && type + "queueHooks",
  5632. timers = jQuery.timers,
  5633. data = data_priv.get( this );
  5634. if ( index ) {
  5635. if ( data[ index ] && data[ index ].stop ) {
  5636. stopQueue( data[ index ] );
  5637. }
  5638. } else {
  5639. for ( index in data ) {
  5640. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  5641. stopQueue( data[ index ] );
  5642. }
  5643. }
  5644. }
  5645. for ( index = timers.length; index--; ) {
  5646. if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
  5647. timers[ index ].anim.stop( gotoEnd );
  5648. dequeue = false;
  5649. timers.splice( index, 1 );
  5650. }
  5651. }
  5652. // start the next in the queue if the last step wasn't forced
  5653. // timers currently will call their complete callbacks, which will dequeue
  5654. // but only if they were gotoEnd
  5655. if ( dequeue || !gotoEnd ) {
  5656. jQuery.dequeue( this, type );
  5657. }
  5658. });
  5659. },
  5660. finish: function( type ) {
  5661. if ( type !== false ) {
  5662. type = type || "fx";
  5663. }
  5664. return this.each(function() {
  5665. var index,
  5666. data = data_priv.get( this ),
  5667. queue = data[ type + "queue" ],
  5668. hooks = data[ type + "queueHooks" ],
  5669. timers = jQuery.timers,
  5670. length = queue ? queue.length : 0;
  5671. // enable finishing flag on private data
  5672. data.finish = true;
  5673. // empty the queue first
  5674. jQuery.queue( this, type, [] );
  5675. if ( hooks && hooks.stop ) {
  5676. hooks.stop.call( this, true );
  5677. }
  5678. // look for any active animations, and finish them
  5679. for ( index = timers.length; index--; ) {
  5680. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  5681. timers[ index ].anim.stop( true );
  5682. timers.splice( index, 1 );
  5683. }
  5684. }
  5685. // look for any animations in the old queue and finish them
  5686. for ( index = 0; index < length; index++ ) {
  5687. if ( queue[ index ] && queue[ index ].finish ) {
  5688. queue[ index ].finish.call( this );
  5689. }
  5690. }
  5691. // turn off finishing flag
  5692. delete data.finish;
  5693. });
  5694. }
  5695. });
  5696. jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
  5697. var cssFn = jQuery.fn[ name ];
  5698. jQuery.fn[ name ] = function( speed, easing, callback ) {
  5699. return speed == null || typeof speed === "boolean" ?
  5700. cssFn.apply( this, arguments ) :
  5701. this.animate( genFx( name, true ), speed, easing, callback );
  5702. };
  5703. });
  5704. // Generate shortcuts for custom animations
  5705. jQuery.each({
  5706. slideDown: genFx("show"),
  5707. slideUp: genFx("hide"),
  5708. slideToggle: genFx("toggle"),
  5709. fadeIn: { opacity: "show" },
  5710. fadeOut: { opacity: "hide" },
  5711. fadeToggle: { opacity: "toggle" }
  5712. }, function( name, props ) {
  5713. jQuery.fn[ name ] = function( speed, easing, callback ) {
  5714. return this.animate( props, speed, easing, callback );
  5715. };
  5716. });
  5717. jQuery.timers = [];
  5718. jQuery.fx.tick = function() {
  5719. var timer,
  5720. i = 0,
  5721. timers = jQuery.timers;
  5722. fxNow = jQuery.now();
  5723. for ( ; i < timers.length; i++ ) {
  5724. timer = timers[ i ];
  5725. // Checks the timer has not already been removed
  5726. if ( !timer() && timers[ i ] === timer ) {
  5727. timers.splice( i--, 1 );
  5728. }
  5729. }
  5730. if ( !timers.length ) {
  5731. jQuery.fx.stop();
  5732. }
  5733. fxNow = undefined;
  5734. };
  5735. jQuery.fx.timer = function( timer ) {
  5736. jQuery.timers.push( timer );
  5737. if ( timer() ) {
  5738. jQuery.fx.start();
  5739. } else {
  5740. jQuery.timers.pop();
  5741. }
  5742. };
  5743. jQuery.fx.interval = 13;
  5744. jQuery.fx.start = function() {
  5745. if ( !timerId ) {
  5746. timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
  5747. }
  5748. };
  5749. jQuery.fx.stop = function() {
  5750. clearInterval( timerId );
  5751. timerId = null;
  5752. };
  5753. jQuery.fx.speeds = {
  5754. slow: 600,
  5755. fast: 200,
  5756. // Default speed
  5757. _default: 400
  5758. };
  5759. // Based off of the plugin by Clint Helfers, with permission.
  5760. // http://blindsignals.com/index.php/2009/07/jquery-delay/
  5761. jQuery.fn.delay = function( time, type ) {
  5762. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  5763. type = type || "fx";
  5764. return this.queue( type, function( next, hooks ) {
  5765. var timeout = setTimeout( next, time );
  5766. hooks.stop = function() {
  5767. clearTimeout( timeout );
  5768. };
  5769. });
  5770. };
  5771. (function() {
  5772. var input = document.createElement( "input" ),
  5773. select = document.createElement( "select" ),
  5774. opt = select.appendChild( document.createElement( "option" ) );
  5775. input.type = "checkbox";
  5776. // Support: iOS 5.1, Android 4.x, Android 2.3
  5777. // Check the default checkbox/radio value ("" on old WebKit; "on" elsewhere)
  5778. support.checkOn = input.value !== "";
  5779. // Must access the parent to make an option select properly
  5780. // Support: IE9, IE10
  5781. support.optSelected = opt.selected;
  5782. // Make sure that the options inside disabled selects aren't marked as disabled
  5783. // (WebKit marks them as disabled)
  5784. select.disabled = true;
  5785. support.optDisabled = !opt.disabled;
  5786. // Check if an input maintains its value after becoming a radio
  5787. // Support: IE9, IE10
  5788. input = document.createElement( "input" );
  5789. input.value = "t";
  5790. input.type = "radio";
  5791. support.radioValue = input.value === "t";
  5792. })();
  5793. var nodeHook, boolHook,
  5794. attrHandle = jQuery.expr.attrHandle;
  5795. jQuery.fn.extend({
  5796. attr: function( name, value ) {
  5797. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  5798. },
  5799. removeAttr: function( name ) {
  5800. return this.each(function() {
  5801. jQuery.removeAttr( this, name );
  5802. });
  5803. }
  5804. });
  5805. jQuery.extend({
  5806. attr: function( elem, name, value ) {
  5807. var hooks, ret,
  5808. nType = elem.nodeType;
  5809. // don't get/set attributes on text, comment and attribute nodes
  5810. if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  5811. return;
  5812. }
  5813. // Fallback to prop when attributes are not supported
  5814. if ( typeof elem.getAttribute === strundefined ) {
  5815. return jQuery.prop( elem, name, value );
  5816. }
  5817. // All attributes are lowercase
  5818. // Grab necessary hook if one is defined
  5819. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  5820. name = name.toLowerCase();
  5821. hooks = jQuery.attrHooks[ name ] ||
  5822. ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
  5823. }
  5824. if ( value !== undefined ) {
  5825. if ( value === null ) {
  5826. jQuery.removeAttr( elem, name );
  5827. } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
  5828. return ret;
  5829. } else {
  5830. elem.setAttribute( name, value + "" );
  5831. return value;
  5832. }
  5833. } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
  5834. return ret;
  5835. } else {
  5836. ret = jQuery.find.attr( elem, name );
  5837. // Non-existent attributes return null, we normalize to undefined
  5838. return ret == null ?
  5839. undefined :
  5840. ret;
  5841. }
  5842. },
  5843. removeAttr: function( elem, value ) {
  5844. var name, propName,
  5845. i = 0,
  5846. attrNames = value && value.match( rnotwhite );
  5847. if ( attrNames && elem.nodeType === 1 ) {
  5848. while ( (name = attrNames[i++]) ) {
  5849. propName = jQuery.propFix[ name ] || name;
  5850. // Boolean attributes get special treatment (#10870)
  5851. if ( jQuery.expr.match.bool.test( name ) ) {
  5852. // Set corresponding property to false
  5853. elem[ propName ] = false;
  5854. }
  5855. elem.removeAttribute( name );
  5856. }
  5857. }
  5858. },
  5859. attrHooks: {
  5860. type: {
  5861. set: function( elem, value ) {
  5862. if ( !support.radioValue && value === "radio" &&
  5863. jQuery.nodeName( elem, "input" ) ) {
  5864. // Setting the type on a radio button after the value resets the value in IE6-9
  5865. // Reset value to default in case type is set after value during creation
  5866. var val = elem.value;
  5867. elem.setAttribute( "type", value );
  5868. if ( val ) {
  5869. elem.value = val;
  5870. }
  5871. return value;
  5872. }
  5873. }
  5874. }
  5875. }
  5876. });
  5877. // Hooks for boolean attributes
  5878. boolHook = {
  5879. set: function( elem, value, name ) {
  5880. if ( value === false ) {
  5881. // Remove boolean attributes when set to false
  5882. jQuery.removeAttr( elem, name );
  5883. } else {
  5884. elem.setAttribute( name, name );
  5885. }
  5886. return name;
  5887. }
  5888. };
  5889. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
  5890. var getter = attrHandle[ name ] || jQuery.find.attr;
  5891. attrHandle[ name ] = function( elem, name, isXML ) {
  5892. var ret, handle;
  5893. if ( !isXML ) {
  5894. // Avoid an infinite loop by temporarily removing this function from the getter
  5895. handle = attrHandle[ name ];
  5896. attrHandle[ name ] = ret;
  5897. ret = getter( elem, name, isXML ) != null ?
  5898. name.toLowerCase() :
  5899. null;
  5900. attrHandle[ name ] = handle;
  5901. }
  5902. return ret;
  5903. };
  5904. });
  5905. var rfocusable = /^(?:input|select|textarea|button)$/i;
  5906. jQuery.fn.extend({
  5907. prop: function( name, value ) {
  5908. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  5909. },
  5910. removeProp: function( name ) {
  5911. return this.each(function() {
  5912. delete this[ jQuery.propFix[ name ] || name ];
  5913. });
  5914. }
  5915. });
  5916. jQuery.extend({
  5917. propFix: {
  5918. "for": "htmlFor",
  5919. "class": "className"
  5920. },
  5921. prop: function( elem, name, value ) {
  5922. var ret, hooks, notxml,
  5923. nType = elem.nodeType;
  5924. // don't get/set properties on text, comment and attribute nodes
  5925. if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  5926. return;
  5927. }
  5928. notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
  5929. if ( notxml ) {
  5930. // Fix name and attach hooks
  5931. name = jQuery.propFix[ name ] || name;
  5932. hooks = jQuery.propHooks[ name ];
  5933. }
  5934. if ( value !== undefined ) {
  5935. return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
  5936. ret :
  5937. ( elem[ name ] = value );
  5938. } else {
  5939. return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
  5940. ret :
  5941. elem[ name ];
  5942. }
  5943. },
  5944. propHooks: {
  5945. tabIndex: {
  5946. get: function( elem ) {
  5947. return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
  5948. elem.tabIndex :
  5949. -1;
  5950. }
  5951. }
  5952. }
  5953. });
  5954. // Support: IE9+
  5955. // Selectedness for an option in an optgroup can be inaccurate
  5956. if ( !support.optSelected ) {
  5957. jQuery.propHooks.selected = {
  5958. get: function( elem ) {
  5959. var parent = elem.parentNode;
  5960. if ( parent && parent.parentNode ) {
  5961. parent.parentNode.selectedIndex;
  5962. }
  5963. return null;
  5964. }
  5965. };
  5966. }
  5967. jQuery.each([
  5968. "tabIndex",
  5969. "readOnly",
  5970. "maxLength",
  5971. "cellSpacing",
  5972. "cellPadding",
  5973. "rowSpan",
  5974. "colSpan",
  5975. "useMap",
  5976. "frameBorder",
  5977. "contentEditable"
  5978. ], function() {
  5979. jQuery.propFix[ this.toLowerCase() ] = this;
  5980. });
  5981. var rclass = /[\t\r\n\f]/g;
  5982. jQuery.fn.extend({
  5983. addClass: function( value ) {
  5984. var classes, elem, cur, clazz, j, finalValue,
  5985. proceed = typeof value === "string" && value,
  5986. i = 0,
  5987. len = this.length;
  5988. if ( jQuery.isFunction( value ) ) {
  5989. return this.each(function( j ) {
  5990. jQuery( this ).addClass( value.call( this, j, this.className ) );
  5991. });
  5992. }
  5993. if ( proceed ) {
  5994. // The disjunction here is for better compressibility (see removeClass)
  5995. classes = ( value || "" ).match( rnotwhite ) || [];
  5996. for ( ; i < len; i++ ) {
  5997. elem = this[ i ];
  5998. cur = elem.nodeType === 1 && ( elem.className ?
  5999. ( " " + elem.className + " " ).replace( rclass, " " ) :
  6000. " "
  6001. );
  6002. if ( cur ) {
  6003. j = 0;
  6004. while ( (clazz = classes[j++]) ) {
  6005. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  6006. cur += clazz + " ";
  6007. }
  6008. }
  6009. // only assign if different to avoid unneeded rendering.
  6010. finalValue = jQuery.trim( cur );
  6011. if ( elem.className !== finalValue ) {
  6012. elem.className = finalValue;
  6013. }
  6014. }
  6015. }
  6016. }
  6017. return this;
  6018. },
  6019. removeClass: function( value ) {
  6020. var classes, elem, cur, clazz, j, finalValue,
  6021. proceed = arguments.length === 0 || typeof value === "string" && value,
  6022. i = 0,
  6023. len = this.length;
  6024. if ( jQuery.isFunction( value ) ) {
  6025. return this.each(function( j ) {
  6026. jQuery( this ).removeClass( value.call( this, j, this.className ) );
  6027. });
  6028. }
  6029. if ( proceed ) {
  6030. classes = ( value || "" ).match( rnotwhite ) || [];
  6031. for ( ; i < len; i++ ) {
  6032. elem = this[ i ];
  6033. // This expression is here for better compressibility (see addClass)
  6034. cur = elem.nodeType === 1 && ( elem.className ?
  6035. ( " " + elem.className + " " ).replace( rclass, " " ) :
  6036. ""
  6037. );
  6038. if ( cur ) {
  6039. j = 0;
  6040. while ( (clazz = classes[j++]) ) {
  6041. // Remove *all* instances
  6042. while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
  6043. cur = cur.replace( " " + clazz + " ", " " );
  6044. }
  6045. }
  6046. // only assign if different to avoid unneeded rendering.
  6047. finalValue = value ? jQuery.trim( cur ) : "";
  6048. if ( elem.className !== finalValue ) {
  6049. elem.className = finalValue;
  6050. }
  6051. }
  6052. }
  6053. }
  6054. return this;
  6055. },
  6056. toggleClass: function( value, stateVal ) {
  6057. var type = typeof value;
  6058. if ( typeof stateVal === "boolean" && type === "string" ) {
  6059. return stateVal ? this.addClass( value ) : this.removeClass( value );
  6060. }
  6061. if ( jQuery.isFunction( value ) ) {
  6062. return this.each(function( i ) {
  6063. jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
  6064. });
  6065. }
  6066. return this.each(function() {
  6067. if ( type === "string" ) {
  6068. // toggle individual class names
  6069. var className,
  6070. i = 0,
  6071. self = jQuery( this ),
  6072. classNames = value.match( rnotwhite ) || [];
  6073. while ( (className = classNames[ i++ ]) ) {
  6074. // check each className given, space separated list
  6075. if ( self.hasClass( className ) ) {
  6076. self.removeClass( className );
  6077. } else {
  6078. self.addClass( className );
  6079. }
  6080. }
  6081. // Toggle whole class name
  6082. } else if ( type === strundefined || type === "boolean" ) {
  6083. if ( this.className ) {
  6084. // store className if set
  6085. data_priv.set( this, "__className__", this.className );
  6086. }
  6087. // If the element has a class name or if we're passed "false",
  6088. // then remove the whole classname (if there was one, the above saved it).
  6089. // Otherwise bring back whatever was previously saved (if anything),
  6090. // falling back to the empty string if nothing was stored.
  6091. this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
  6092. }
  6093. });
  6094. },
  6095. hasClass: function( selector ) {
  6096. var className = " " + selector + " ",
  6097. i = 0,
  6098. l = this.length;
  6099. for ( ; i < l; i++ ) {
  6100. if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
  6101. return true;
  6102. }
  6103. }
  6104. return false;
  6105. }
  6106. });
  6107. var rreturn = /\r/g;
  6108. jQuery.fn.extend({
  6109. val: function( value ) {
  6110. var hooks, ret, isFunction,
  6111. elem = this[0];
  6112. if ( !arguments.length ) {
  6113. if ( elem ) {
  6114. hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  6115. if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
  6116. return ret;
  6117. }
  6118. ret = elem.value;
  6119. return typeof ret === "string" ?
  6120. // handle most common string cases
  6121. ret.replace(rreturn, "") :
  6122. // handle cases where value is null/undef or number
  6123. ret == null ? "" : ret;
  6124. }
  6125. return;
  6126. }
  6127. isFunction = jQuery.isFunction( value );
  6128. return this.each(function( i ) {
  6129. var val;
  6130. if ( this.nodeType !== 1 ) {
  6131. return;
  6132. }
  6133. if ( isFunction ) {
  6134. val = value.call( this, i, jQuery( this ).val() );
  6135. } else {
  6136. val = value;
  6137. }
  6138. // Treat null/undefined as ""; convert numbers to string
  6139. if ( val == null ) {
  6140. val = "";
  6141. } else if ( typeof val === "number" ) {
  6142. val += "";
  6143. } else if ( jQuery.isArray( val ) ) {
  6144. val = jQuery.map( val, function( value ) {
  6145. return value == null ? "" : value + "";
  6146. });
  6147. }
  6148. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  6149. // If set returns undefined, fall back to normal setting
  6150. if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
  6151. this.value = val;
  6152. }
  6153. });
  6154. }
  6155. });
  6156. jQuery.extend({
  6157. valHooks: {
  6158. option: {
  6159. get: function( elem ) {
  6160. var val = jQuery.find.attr( elem, "value" );
  6161. return val != null ?
  6162. val :
  6163. // Support: IE10-11+
  6164. // option.text throws exceptions (#14686, #14858)
  6165. jQuery.trim( jQuery.text( elem ) );
  6166. }
  6167. },
  6168. select: {
  6169. get: function( elem ) {
  6170. var value, option,
  6171. options = elem.options,
  6172. index = elem.selectedIndex,
  6173. one = elem.type === "select-one" || index < 0,
  6174. values = one ? null : [],
  6175. max = one ? index + 1 : options.length,
  6176. i = index < 0 ?
  6177. max :
  6178. one ? index : 0;
  6179. // Loop through all the selected options
  6180. for ( ; i < max; i++ ) {
  6181. option = options[ i ];
  6182. // IE6-9 doesn't update selected after form reset (#2551)
  6183. if ( ( option.selected || i === index ) &&
  6184. // Don't return options that are disabled or in a disabled optgroup
  6185. ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
  6186. ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
  6187. // Get the specific value for the option
  6188. value = jQuery( option ).val();
  6189. // We don't need an array for one selects
  6190. if ( one ) {
  6191. return value;
  6192. }
  6193. // Multi-Selects return an array
  6194. values.push( value );
  6195. }
  6196. }
  6197. return values;
  6198. },
  6199. set: function( elem, value ) {
  6200. var optionSet, option,
  6201. options = elem.options,
  6202. values = jQuery.makeArray( value ),
  6203. i = options.length;
  6204. while ( i-- ) {
  6205. option = options[ i ];
  6206. if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {
  6207. optionSet = true;
  6208. }
  6209. }
  6210. // force browsers to behave consistently when non-matching value is set
  6211. if ( !optionSet ) {
  6212. elem.selectedIndex = -1;
  6213. }
  6214. return values;
  6215. }
  6216. }
  6217. }
  6218. });
  6219. // Radios and checkboxes getter/setter
  6220. jQuery.each([ "radio", "checkbox" ], function() {
  6221. jQuery.valHooks[ this ] = {
  6222. set: function( elem, value ) {
  6223. if ( jQuery.isArray( value ) ) {
  6224. return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
  6225. }
  6226. }
  6227. };
  6228. if ( !support.checkOn ) {
  6229. jQuery.valHooks[ this ].get = function( elem ) {
  6230. // Support: Webkit
  6231. // "" is returned instead of "on" if a value isn't specified
  6232. return elem.getAttribute("value") === null ? "on" : elem.value;
  6233. };
  6234. }
  6235. });
  6236. // Return jQuery for attributes-only inclusion
  6237. jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
  6238. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  6239. "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
  6240. // Handle event binding
  6241. jQuery.fn[ name ] = function( data, fn ) {
  6242. return arguments.length > 0 ?
  6243. this.on( name, null, data, fn ) :
  6244. this.trigger( name );
  6245. };
  6246. });
  6247. jQuery.fn.extend({
  6248. hover: function( fnOver, fnOut ) {
  6249. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  6250. },
  6251. bind: function( types, data, fn ) {
  6252. return this.on( types, null, data, fn );
  6253. },
  6254. unbind: function( types, fn ) {
  6255. return this.off( types, null, fn );
  6256. },
  6257. delegate: function( selector, types, data, fn ) {
  6258. return this.on( types, selector, data, fn );
  6259. },
  6260. undelegate: function( selector, types, fn ) {
  6261. // ( namespace ) or ( selector, types [, fn] )
  6262. return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
  6263. }
  6264. });
  6265. var nonce = jQuery.now();
  6266. var rquery = (/\?/);
  6267. // Support: Android 2.3
  6268. // Workaround failure to string-cast null input
  6269. jQuery.parseJSON = function( data ) {
  6270. return JSON.parse( data + "" );
  6271. };
  6272. // Cross-browser xml parsing
  6273. jQuery.parseXML = function( data ) {
  6274. var xml, tmp;
  6275. if ( !data || typeof data !== "string" ) {
  6276. return null;
  6277. }
  6278. // Support: IE9
  6279. try {
  6280. tmp = new DOMParser();
  6281. xml = tmp.parseFromString( data, "text/xml" );
  6282. } catch ( e ) {
  6283. xml = undefined;
  6284. }
  6285. if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
  6286. jQuery.error( "Invalid XML: " + data );
  6287. }
  6288. return xml;
  6289. };
  6290. var
  6291. // Document location
  6292. ajaxLocParts,
  6293. ajaxLocation,
  6294. rhash = /#.*$/,
  6295. rts = /([?&])_=[^&]*/,
  6296. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  6297. // #7653, #8125, #8152: local protocol detection
  6298. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  6299. rnoContent = /^(?:GET|HEAD)$/,
  6300. rprotocol = /^\/\//,
  6301. rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
  6302. /* Prefilters
  6303. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  6304. * 2) These are called:
  6305. * - BEFORE asking for a transport
  6306. * - AFTER param serialization (s.data is a string if s.processData is true)
  6307. * 3) key is the dataType
  6308. * 4) the catchall symbol "*" can be used
  6309. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  6310. */
  6311. prefilters = {},
  6312. /* Transports bindings
  6313. * 1) key is the dataType
  6314. * 2) the catchall symbol "*" can be used
  6315. * 3) selection will start with transport dataType and THEN go to "*" if needed
  6316. */
  6317. transports = {},
  6318. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  6319. allTypes = "*/".concat("*");
  6320. // #8138, IE may throw an exception when accessing
  6321. // a field from window.location if document.domain has been set
  6322. try {
  6323. ajaxLocation = location.href;
  6324. } catch( e ) {
  6325. // Use the href attribute of an A element
  6326. // since IE will modify it given document.location
  6327. ajaxLocation = document.createElement( "a" );
  6328. ajaxLocation.href = "";
  6329. ajaxLocation = ajaxLocation.href;
  6330. }
  6331. // Segment location into parts
  6332. ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
  6333. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  6334. function addToPrefiltersOrTransports( structure ) {
  6335. // dataTypeExpression is optional and defaults to "*"
  6336. return function( dataTypeExpression, func ) {
  6337. if ( typeof dataTypeExpression !== "string" ) {
  6338. func = dataTypeExpression;
  6339. dataTypeExpression = "*";
  6340. }
  6341. var dataType,
  6342. i = 0,
  6343. dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
  6344. if ( jQuery.isFunction( func ) ) {
  6345. // For each dataType in the dataTypeExpression
  6346. while ( (dataType = dataTypes[i++]) ) {
  6347. // Prepend if requested
  6348. if ( dataType[0] === "+" ) {
  6349. dataType = dataType.slice( 1 ) || "*";
  6350. (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
  6351. // Otherwise append
  6352. } else {
  6353. (structure[ dataType ] = structure[ dataType ] || []).push( func );
  6354. }
  6355. }
  6356. }
  6357. };
  6358. }
  6359. // Base inspection function for prefilters and transports
  6360. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  6361. var inspected = {},
  6362. seekingTransport = ( structure === transports );
  6363. function inspect( dataType ) {
  6364. var selected;
  6365. inspected[ dataType ] = true;
  6366. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  6367. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  6368. if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  6369. options.dataTypes.unshift( dataTypeOrTransport );
  6370. inspect( dataTypeOrTransport );
  6371. return false;
  6372. } else if ( seekingTransport ) {
  6373. return !( selected = dataTypeOrTransport );
  6374. }
  6375. });
  6376. return selected;
  6377. }
  6378. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  6379. }
  6380. // A special extend for ajax options
  6381. // that takes "flat" options (not to be deep extended)
  6382. // Fixes #9887
  6383. function ajaxExtend( target, src ) {
  6384. var key, deep,
  6385. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  6386. for ( key in src ) {
  6387. if ( src[ key ] !== undefined ) {
  6388. ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
  6389. }
  6390. }
  6391. if ( deep ) {
  6392. jQuery.extend( true, target, deep );
  6393. }
  6394. return target;
  6395. }
  6396. /* Handles responses to an ajax request:
  6397. * - finds the right dataType (mediates between content-type and expected dataType)
  6398. * - returns the corresponding response
  6399. */
  6400. function ajaxHandleResponses( s, jqXHR, responses ) {
  6401. var ct, type, finalDataType, firstDataType,
  6402. contents = s.contents,
  6403. dataTypes = s.dataTypes;
  6404. // Remove auto dataType and get content-type in the process
  6405. while ( dataTypes[ 0 ] === "*" ) {
  6406. dataTypes.shift();
  6407. if ( ct === undefined ) {
  6408. ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
  6409. }
  6410. }
  6411. // Check if we're dealing with a known content-type
  6412. if ( ct ) {
  6413. for ( type in contents ) {
  6414. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  6415. dataTypes.unshift( type );
  6416. break;
  6417. }
  6418. }
  6419. }
  6420. // Check to see if we have a response for the expected dataType
  6421. if ( dataTypes[ 0 ] in responses ) {
  6422. finalDataType = dataTypes[ 0 ];
  6423. } else {
  6424. // Try convertible dataTypes
  6425. for ( type in responses ) {
  6426. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
  6427. finalDataType = type;
  6428. break;
  6429. }
  6430. if ( !firstDataType ) {
  6431. firstDataType = type;
  6432. }
  6433. }
  6434. // Or just use first one
  6435. finalDataType = finalDataType || firstDataType;
  6436. }
  6437. // If we found a dataType
  6438. // We add the dataType to the list if needed
  6439. // and return the corresponding response
  6440. if ( finalDataType ) {
  6441. if ( finalDataType !== dataTypes[ 0 ] ) {
  6442. dataTypes.unshift( finalDataType );
  6443. }
  6444. return responses[ finalDataType ];
  6445. }
  6446. }
  6447. /* Chain conversions given the request and the original response
  6448. * Also sets the responseXXX fields on the jqXHR instance
  6449. */
  6450. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  6451. var conv2, current, conv, tmp, prev,
  6452. converters = {},
  6453. // Work with a copy of dataTypes in case we need to modify it for conversion
  6454. dataTypes = s.dataTypes.slice();
  6455. // Create converters map with lowercased keys
  6456. if ( dataTypes[ 1 ] ) {
  6457. for ( conv in s.converters ) {
  6458. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  6459. }
  6460. }
  6461. current = dataTypes.shift();
  6462. // Convert to each sequential dataType
  6463. while ( current ) {
  6464. if ( s.responseFields[ current ] ) {
  6465. jqXHR[ s.responseFields[ current ] ] = response;
  6466. }
  6467. // Apply the dataFilter if provided
  6468. if ( !prev && isSuccess && s.dataFilter ) {
  6469. response = s.dataFilter( response, s.dataType );
  6470. }
  6471. prev = current;
  6472. current = dataTypes.shift();
  6473. if ( current ) {
  6474. // There's only work to do if current dataType is non-auto
  6475. if ( current === "*" ) {
  6476. current = prev;
  6477. // Convert response if prev dataType is non-auto and differs from current
  6478. } else if ( prev !== "*" && prev !== current ) {
  6479. // Seek a direct converter
  6480. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  6481. // If none found, seek a pair
  6482. if ( !conv ) {
  6483. for ( conv2 in converters ) {
  6484. // If conv2 outputs current
  6485. tmp = conv2.split( " " );
  6486. if ( tmp[ 1 ] === current ) {
  6487. // If prev can be converted to accepted input
  6488. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  6489. converters[ "* " + tmp[ 0 ] ];
  6490. if ( conv ) {
  6491. // Condense equivalence converters
  6492. if ( conv === true ) {
  6493. conv = converters[ conv2 ];
  6494. // Otherwise, insert the intermediate dataType
  6495. } else if ( converters[ conv2 ] !== true ) {
  6496. current = tmp[ 0 ];
  6497. dataTypes.unshift( tmp[ 1 ] );
  6498. }
  6499. break;
  6500. }
  6501. }
  6502. }
  6503. }
  6504. // Apply converter (if not an equivalence)
  6505. if ( conv !== true ) {
  6506. // Unless errors are allowed to bubble, catch and return them
  6507. if ( conv && s[ "throws" ] ) {
  6508. response = conv( response );
  6509. } else {
  6510. try {
  6511. response = conv( response );
  6512. } catch ( e ) {
  6513. return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
  6514. }
  6515. }
  6516. }
  6517. }
  6518. }
  6519. }
  6520. return { state: "success", data: response };
  6521. }
  6522. jQuery.extend({
  6523. // Counter for holding the number of active queries
  6524. active: 0,
  6525. // Last-Modified header cache for next request
  6526. lastModified: {},
  6527. etag: {},
  6528. ajaxSettings: {
  6529. url: ajaxLocation,
  6530. type: "GET",
  6531. isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
  6532. global: true,
  6533. processData: true,
  6534. async: true,
  6535. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  6536. /*
  6537. timeout: 0,
  6538. data: null,
  6539. dataType: null,
  6540. username: null,
  6541. password: null,
  6542. cache: null,
  6543. throws: false,
  6544. traditional: false,
  6545. headers: {},
  6546. */
  6547. accepts: {
  6548. "*": allTypes,
  6549. text: "text/plain",
  6550. html: "text/html",
  6551. xml: "application/xml, text/xml",
  6552. json: "application/json, text/javascript"
  6553. },
  6554. contents: {
  6555. xml: /xml/,
  6556. html: /html/,
  6557. json: /json/
  6558. },
  6559. responseFields: {
  6560. xml: "responseXML",
  6561. text: "responseText",
  6562. json: "responseJSON",
  6563. native: "responseNative"
  6564. },
  6565. // Data converters
  6566. // Keys separate source (or catchall "*") and destination types with a single space
  6567. converters: {
  6568. // Convert anything to text
  6569. "* text": String,
  6570. // Text to html (true = no transformation)
  6571. "text html": true,
  6572. // Evaluate text as a json expression
  6573. "text json": jQuery.parseJSON,
  6574. // Parse text as xml
  6575. "text xml": jQuery.parseXML,
  6576. // Don't convert a native response
  6577. "* native": true
  6578. },
  6579. // For options that shouldn't be deep extended:
  6580. // you can add your own custom options here if
  6581. // and when you create one that shouldn't be
  6582. // deep extended (see ajaxExtend)
  6583. flatOptions: {
  6584. url: true,
  6585. context: true
  6586. }
  6587. },
  6588. // Creates a full fledged settings object into target
  6589. // with both ajaxSettings and settings fields.
  6590. // If target is omitted, writes into ajaxSettings.
  6591. ajaxSetup: function( target, settings ) {
  6592. return settings ?
  6593. // Building a settings object
  6594. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  6595. // Extending ajaxSettings
  6596. ajaxExtend( jQuery.ajaxSettings, target );
  6597. },
  6598. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  6599. ajaxTransport: addToPrefiltersOrTransports( transports ),
  6600. // Main method
  6601. ajax: function( url, options ) {
  6602. // If url is an object, simulate pre-1.5 signature
  6603. if ( typeof url === "object" ) {
  6604. options = url;
  6605. url = undefined;
  6606. }
  6607. // Force options to be an object
  6608. options = options || {};
  6609. var transport,
  6610. // URL without anti-cache param
  6611. cacheURL,
  6612. // Response headers
  6613. responseHeadersString,
  6614. responseHeaders,
  6615. // timeout handle
  6616. timeoutTimer,
  6617. // Cross-domain detection vars
  6618. parts,
  6619. // To know if global events are to be dispatched
  6620. fireGlobals,
  6621. // Loop variable
  6622. i,
  6623. // Create the final options object
  6624. s = jQuery.ajaxSetup( {}, options ),
  6625. // Callbacks context
  6626. callbackContext = s.context || s,
  6627. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  6628. globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
  6629. jQuery( callbackContext ) :
  6630. jQuery.event,
  6631. // Deferreds
  6632. deferred = jQuery.Deferred(),
  6633. completeDeferred = jQuery.Callbacks("once memory"),
  6634. // Status-dependent callbacks
  6635. statusCode = s.statusCode || {},
  6636. // Headers (they are sent all at once)
  6637. requestHeaders = {},
  6638. requestHeadersNames = {},
  6639. // The jqXHR state
  6640. state = 0,
  6641. // Default abort message
  6642. strAbort = "canceled",
  6643. // Fake xhr
  6644. jqXHR = {
  6645. readyState: 0,
  6646. // Builds headers hashtable if needed
  6647. getResponseHeader: function( key ) {
  6648. var match;
  6649. if ( state === 2 ) {
  6650. if ( !responseHeaders ) {
  6651. responseHeaders = {};
  6652. while ( (match = rheaders.exec( responseHeadersString )) ) {
  6653. responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
  6654. }
  6655. }
  6656. match = responseHeaders[ key.toLowerCase() ];
  6657. }
  6658. return match == null ? null : match;
  6659. },
  6660. // Raw string
  6661. getAllResponseHeaders: function() {
  6662. return state === 2 ? responseHeadersString : null;
  6663. },
  6664. // Caches the header
  6665. setRequestHeader: function( name, value ) {
  6666. var lname = name.toLowerCase();
  6667. if ( !state ) {
  6668. name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
  6669. requestHeaders[ name ] = value;
  6670. }
  6671. return this;
  6672. },
  6673. // Overrides response content-type header
  6674. overrideMimeType: function( type ) {
  6675. if ( !state ) {
  6676. s.mimeType = type;
  6677. }
  6678. return this;
  6679. },
  6680. // Status-dependent callbacks
  6681. statusCode: function( map ) {
  6682. var code;
  6683. if ( map ) {
  6684. if ( state < 2 ) {
  6685. for ( code in map ) {
  6686. // Lazy-add the new callback in a way that preserves old ones
  6687. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  6688. }
  6689. } else {
  6690. // Execute the appropriate callbacks
  6691. jqXHR.always( map[ jqXHR.status ] );
  6692. }
  6693. }
  6694. return this;
  6695. },
  6696. // Cancel the request
  6697. abort: function( statusText ) {
  6698. var finalText = statusText || strAbort;
  6699. if ( transport ) {
  6700. transport.abort( finalText );
  6701. }
  6702. done( 0, finalText );
  6703. return this;
  6704. }
  6705. };
  6706. // Attach deferreds
  6707. deferred.promise( jqXHR ).complete = completeDeferred.add;
  6708. jqXHR.success = jqXHR.done;
  6709. jqXHR.error = jqXHR.fail;
  6710. // Remove hash character (#7531: and string promotion)
  6711. // Add protocol if not provided (prefilters might expect it)
  6712. // Handle falsy url in the settings object (#10093: consistency with old signature)
  6713. // We also use the url parameter if available
  6714. s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
  6715. .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
  6716. // Alias method option to type as per ticket #12004
  6717. s.type = options.method || options.type || s.method || s.type;
  6718. // Extract dataTypes list
  6719. s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
  6720. // A cross-domain request is in order when we have a protocol:host:port mismatch
  6721. if ( s.crossDomain == null ) {
  6722. parts = rurl.exec( s.url.toLowerCase() );
  6723. s.crossDomain = !!( parts &&
  6724. ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
  6725. ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
  6726. ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
  6727. );
  6728. }
  6729. // Convert data if not already a string
  6730. if ( s.data && s.processData && typeof s.data !== "string" ) {
  6731. s.data = jQuery.param( s.data, s.traditional );
  6732. }
  6733. // Apply prefilters
  6734. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  6735. // If request was aborted inside a prefilter, stop there
  6736. if ( state === 2 ) {
  6737. return jqXHR;
  6738. }
  6739. // We can fire global events as of now if asked to
  6740. fireGlobals = s.global;
  6741. // Watch for a new set of requests
  6742. if ( fireGlobals && jQuery.active++ === 0 ) {
  6743. jQuery.event.trigger("ajaxStart");
  6744. }
  6745. // Uppercase the type
  6746. s.type = s.type.toUpperCase();
  6747. // Determine if request has content
  6748. s.hasContent = !rnoContent.test( s.type );
  6749. // Save the URL in case we're toying with the If-Modified-Since
  6750. // and/or If-None-Match header later on
  6751. cacheURL = s.url;
  6752. // More options handling for requests with no content
  6753. if ( !s.hasContent ) {
  6754. // If data is available, append data to url
  6755. if ( s.data ) {
  6756. cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
  6757. // #9682: remove data so that it's not used in an eventual retry
  6758. delete s.data;
  6759. }
  6760. // Add anti-cache in url if needed
  6761. if ( s.cache === false ) {
  6762. s.url = rts.test( cacheURL ) ?
  6763. // If there is already a '_' parameter, set its value
  6764. cacheURL.replace( rts, "$1_=" + nonce++ ) :
  6765. // Otherwise add one to the end
  6766. cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
  6767. }
  6768. }
  6769. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  6770. if ( s.ifModified ) {
  6771. if ( jQuery.lastModified[ cacheURL ] ) {
  6772. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  6773. }
  6774. if ( jQuery.etag[ cacheURL ] ) {
  6775. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  6776. }
  6777. }
  6778. // Set the correct header, if data is being sent
  6779. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  6780. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  6781. }
  6782. // Set the Accepts header for the server, depending on the dataType
  6783. jqXHR.setRequestHeader(
  6784. "Accept",
  6785. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
  6786. s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  6787. s.accepts[ "*" ]
  6788. );
  6789. // Check for headers option
  6790. for ( i in s.headers ) {
  6791. jqXHR.setRequestHeader( i, s.headers[ i ] );
  6792. }
  6793. // Allow custom headers/mimetypes and early abort
  6794. if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
  6795. // Abort if not done already and return
  6796. return jqXHR.abort();
  6797. }
  6798. // aborting is no longer a cancellation
  6799. strAbort = "abort";
  6800. // Install callbacks on deferreds
  6801. for ( i in { success: 1, error: 1, complete: 1 } ) {
  6802. jqXHR[ i ]( s[ i ] );
  6803. }
  6804. // Get transport
  6805. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  6806. // If no transport, we auto-abort
  6807. if ( !transport ) {
  6808. done( -1, "No Transport" );
  6809. } else {
  6810. jqXHR.readyState = 1;
  6811. // Send global event
  6812. if ( fireGlobals ) {
  6813. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  6814. }
  6815. // Timeout
  6816. if ( s.async && s.timeout > 0 ) {
  6817. timeoutTimer = setTimeout(function() {
  6818. jqXHR.abort("timeout");
  6819. }, s.timeout );
  6820. }
  6821. try {
  6822. state = 1;
  6823. transport.send( requestHeaders, done );
  6824. } catch ( e ) {
  6825. // Propagate exception as error if not done
  6826. if ( state < 2 ) {
  6827. done( -1, e );
  6828. // Simply rethrow otherwise
  6829. } else {
  6830. throw e;
  6831. }
  6832. }
  6833. }
  6834. // Callback for when everything is done
  6835. function done( status, nativeStatusText, responses, headers ) {
  6836. var isSuccess, success, error, response, modified,
  6837. statusText = nativeStatusText;
  6838. // Called once
  6839. if ( state === 2 ) {
  6840. return;
  6841. }
  6842. // State is "done" now
  6843. state = 2;
  6844. // Clear timeout if it exists
  6845. if ( timeoutTimer ) {
  6846. clearTimeout( timeoutTimer );
  6847. }
  6848. // Dereference transport for early garbage collection
  6849. // (no matter how long the jqXHR object will be used)
  6850. transport = undefined;
  6851. // Cache response headers
  6852. responseHeadersString = headers || "";
  6853. // Set readyState
  6854. jqXHR.readyState = status > 0 ? 4 : 0;
  6855. // Determine if successful
  6856. isSuccess = status >= 200 && status < 300 || status === 304;
  6857. // Get response data
  6858. if ( responses ) {
  6859. response = ajaxHandleResponses( s, jqXHR, responses );
  6860. }
  6861. // Convert no matter what (that way responseXXX fields are always set)
  6862. response = ajaxConvert( s, response, jqXHR, isSuccess );
  6863. // If successful, handle type chaining
  6864. if ( isSuccess ) {
  6865. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  6866. if ( s.ifModified ) {
  6867. modified = jqXHR.getResponseHeader("Last-Modified");
  6868. if ( modified ) {
  6869. jQuery.lastModified[ cacheURL ] = modified;
  6870. }
  6871. modified = jqXHR.getResponseHeader("etag");
  6872. if ( modified ) {
  6873. jQuery.etag[ cacheURL ] = modified;
  6874. }
  6875. }
  6876. // if no content
  6877. if ( status === 204 || s.type === "HEAD" ) {
  6878. statusText = "nocontent";
  6879. // if not modified
  6880. } else if ( status === 304 ) {
  6881. statusText = "notmodified";
  6882. // If we have data, let's convert it
  6883. } else {
  6884. statusText = response.state;
  6885. success = response.data;
  6886. error = response.error;
  6887. isSuccess = !error;
  6888. }
  6889. } else {
  6890. // We extract error from statusText
  6891. // then normalize statusText and status for non-aborts
  6892. error = statusText;
  6893. if ( status || !statusText ) {
  6894. statusText = "error";
  6895. if ( status < 0 ) {
  6896. status = 0;
  6897. }
  6898. }
  6899. }
  6900. // Set data for the fake xhr object
  6901. jqXHR.status = status;
  6902. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  6903. // Success/Error
  6904. if ( isSuccess ) {
  6905. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  6906. } else {
  6907. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  6908. }
  6909. // Status-dependent callbacks
  6910. jqXHR.statusCode( statusCode );
  6911. statusCode = undefined;
  6912. if ( fireGlobals ) {
  6913. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  6914. [ jqXHR, s, isSuccess ? success : error ] );
  6915. }
  6916. // Complete
  6917. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  6918. if ( fireGlobals ) {
  6919. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  6920. // Handle the global AJAX counter
  6921. if ( !( --jQuery.active ) ) {
  6922. jQuery.event.trigger("ajaxStop");
  6923. }
  6924. }
  6925. }
  6926. return jqXHR;
  6927. },
  6928. getJSON: function( url, data, callback ) {
  6929. return jQuery.get( url, data, callback, "json" );
  6930. },
  6931. getScript: function( url, callback ) {
  6932. return jQuery.get( url, undefined, callback, "script" );
  6933. }
  6934. });
  6935. jQuery.each( [ "get", "post" ], function( i, method ) {
  6936. jQuery[ method ] = function( url, data, callback, type ) {
  6937. // shift arguments if data argument was omitted
  6938. if ( jQuery.isFunction( data ) ) {
  6939. type = type || callback;
  6940. callback = data;
  6941. data = undefined;
  6942. }
  6943. return jQuery.ajax({
  6944. url: url,
  6945. type: method,
  6946. dataType: type,
  6947. data: data,
  6948. success: callback
  6949. });
  6950. };
  6951. });
  6952. // Attach a bunch of functions for handling common AJAX events
  6953. jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
  6954. jQuery.fn[ type ] = function( fn ) {
  6955. return this.on( type, fn );
  6956. };
  6957. });
  6958. jQuery._evalUrl = function( url ) {
  6959. return jQuery.ajax({
  6960. url: url,
  6961. type: "GET",
  6962. dataType: "script",
  6963. async: false,
  6964. global: false,
  6965. "throws": true
  6966. });
  6967. };
  6968. jQuery.fn.extend({
  6969. wrapAll: function( html ) {
  6970. var wrap;
  6971. if ( jQuery.isFunction( html ) ) {
  6972. return this.each(function( i ) {
  6973. jQuery( this ).wrapAll( html.call(this, i) );
  6974. });
  6975. }
  6976. if ( this[ 0 ] ) {
  6977. // The elements to wrap the target around
  6978. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  6979. if ( this[ 0 ].parentNode ) {
  6980. wrap.insertBefore( this[ 0 ] );
  6981. }
  6982. wrap.map(function() {
  6983. var elem = this;
  6984. while ( elem.firstElementChild ) {
  6985. elem = elem.firstElementChild;
  6986. }
  6987. return elem;
  6988. }).append( this );
  6989. }
  6990. return this;
  6991. },
  6992. wrapInner: function( html ) {
  6993. if ( jQuery.isFunction( html ) ) {
  6994. return this.each(function( i ) {
  6995. jQuery( this ).wrapInner( html.call(this, i) );
  6996. });
  6997. }
  6998. return this.each(function() {
  6999. var self = jQuery( this ),
  7000. contents = self.contents();
  7001. if ( contents.length ) {
  7002. contents.wrapAll( html );
  7003. } else {
  7004. self.append( html );
  7005. }
  7006. });
  7007. },
  7008. wrap: function( html ) {
  7009. var isFunction = jQuery.isFunction( html );
  7010. return this.each(function( i ) {
  7011. jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
  7012. });
  7013. },
  7014. unwrap: function() {
  7015. return this.parent().each(function() {
  7016. if ( !jQuery.nodeName( this, "body" ) ) {
  7017. jQuery( this ).replaceWith( this.childNodes );
  7018. }
  7019. }).end();
  7020. }
  7021. });
  7022. jQuery.expr.filters.hidden = function( elem ) {
  7023. // Support: Opera <= 12.12
  7024. // Opera reports offsetWidths and offsetHeights less than zero on some elements
  7025. return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
  7026. };
  7027. jQuery.expr.filters.visible = function( elem ) {
  7028. return !jQuery.expr.filters.hidden( elem );
  7029. };
  7030. var r20 = /%20/g,
  7031. rbracket = /\[\]$/,
  7032. rCRLF = /\r?\n/g,
  7033. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  7034. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  7035. function buildParams( prefix, obj, traditional, add ) {
  7036. var name;
  7037. if ( jQuery.isArray( obj ) ) {
  7038. // Serialize array item.
  7039. jQuery.each( obj, function( i, v ) {
  7040. if ( traditional || rbracket.test( prefix ) ) {
  7041. // Treat each array item as a scalar.
  7042. add( prefix, v );
  7043. } else {
  7044. // Item is non-scalar (array or object), encode its numeric index.
  7045. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
  7046. }
  7047. });
  7048. } else if ( !traditional && jQuery.type( obj ) === "object" ) {
  7049. // Serialize object item.
  7050. for ( name in obj ) {
  7051. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  7052. }
  7053. } else {
  7054. // Serialize scalar item.
  7055. add( prefix, obj );
  7056. }
  7057. }
  7058. // Serialize an array of form elements or a set of
  7059. // key/values into a query string
  7060. jQuery.param = function( a, traditional ) {
  7061. var prefix,
  7062. s = [],
  7063. add = function( key, value ) {
  7064. // If value is a function, invoke it and return its value
  7065. value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
  7066. s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
  7067. };
  7068. // Set traditional to true for jQuery <= 1.3.2 behavior.
  7069. if ( traditional === undefined ) {
  7070. traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
  7071. }
  7072. // If an array was passed in, assume that it is an array of form elements.
  7073. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  7074. // Serialize the form elements
  7075. jQuery.each( a, function() {
  7076. add( this.name, this.value );
  7077. });
  7078. } else {
  7079. // If traditional, encode the "old" way (the way 1.3.2 or older
  7080. // did it), otherwise encode params recursively.
  7081. for ( prefix in a ) {
  7082. buildParams( prefix, a[ prefix ], traditional, add );
  7083. }
  7084. }
  7085. // Return the resulting serialization
  7086. return s.join( "&" ).replace( r20, "+" );
  7087. };
  7088. jQuery.fn.extend({
  7089. serialize: function() {
  7090. return jQuery.param( this.serializeArray() );
  7091. },
  7092. serializeArray: function() {
  7093. return this.map(function() {
  7094. // Can add propHook for "elements" to filter or add form elements
  7095. var elements = jQuery.prop( this, "elements" );
  7096. return elements ? jQuery.makeArray( elements ) : this;
  7097. })
  7098. .filter(function() {
  7099. var type = this.type;
  7100. // Use .is( ":disabled" ) so that fieldset[disabled] works
  7101. return this.name && !jQuery( this ).is( ":disabled" ) &&
  7102. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  7103. ( this.checked || !rcheckableType.test( type ) );
  7104. })
  7105. .map(function( i, elem ) {
  7106. var val = jQuery( this ).val();
  7107. return val == null ?
  7108. null :
  7109. jQuery.isArray( val ) ?
  7110. jQuery.map( val, function( val ) {
  7111. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7112. }) :
  7113. { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7114. }).get();
  7115. }
  7116. });
  7117. jQuery.ajaxSettings.xhr = function() {
  7118. try {
  7119. return new XMLHttpRequest();
  7120. } catch( e ) {}
  7121. };
  7122. var xhrId = 0,
  7123. xhrCallbacks = {},
  7124. xhrSuccessStatus = {
  7125. // file protocol always yields status code 0, assume 200
  7126. 0: 200,
  7127. // Support: IE9
  7128. // #1450: sometimes IE returns 1223 when it should be 204
  7129. 1223: 204
  7130. },
  7131. xhrSupported = jQuery.ajaxSettings.xhr();
  7132. // Support: IE9
  7133. // Open requests must be manually aborted on unload (#5280)
  7134. if ( window.ActiveXObject ) {
  7135. jQuery( window ).on( "unload", function() {
  7136. for ( var key in xhrCallbacks ) {
  7137. xhrCallbacks[ key ]();
  7138. }
  7139. });
  7140. }
  7141. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  7142. support.ajax = xhrSupported = !!xhrSupported;
  7143. jQuery.ajaxTransport(function( options ) {
  7144. var callback;
  7145. // Cross domain only allowed if supported through XMLHttpRequest
  7146. if ( support.cors || xhrSupported && !options.crossDomain ) {
  7147. return {
  7148. send: function( headers, complete ) {
  7149. var i,
  7150. xhr = options.xhr(),
  7151. id = ++xhrId,
  7152. responses = {};
  7153. xhr.open( options.type, options.url, options.async, options.username, options.password );
  7154. // Apply custom fields if provided
  7155. if ( options.xhrFields ) {
  7156. for ( i in options.xhrFields ) {
  7157. xhr[ i ] = options.xhrFields[ i ];
  7158. }
  7159. }
  7160. // Override mime type if needed
  7161. if ( options.mimeType && xhr.overrideMimeType ) {
  7162. xhr.overrideMimeType( options.mimeType );
  7163. }
  7164. // X-Requested-With header
  7165. // For cross-domain requests, seeing as conditions for a preflight are
  7166. // akin to a jigsaw puzzle, we simply never set it to be sure.
  7167. // (it can always be set on a per-request basis or even using ajaxSetup)
  7168. // For same-domain requests, won't change header if already provided.
  7169. if ( !options.crossDomain && !headers["X-Requested-With"] ) {
  7170. headers["X-Requested-With"] = "XMLHttpRequest";
  7171. }
  7172. // Set headers
  7173. for ( i in headers ) {
  7174. xhr.setRequestHeader( i, headers[ i ] );
  7175. }
  7176. // Callback
  7177. callback = function( type ) {
  7178. return function() {
  7179. if ( callback ) {
  7180. delete xhrCallbacks[ id ];
  7181. callback = xhr.onload = xhr.onerror = null;
  7182. if ( type === "abort" ) {
  7183. xhr.abort();
  7184. } else if ( type === "error" ) {
  7185. complete(
  7186. // file: protocol always yields status 0; see #8605, #14207
  7187. xhr.status,
  7188. xhr.statusText
  7189. );
  7190. } else {
  7191. // Verify the responseType attribute to avoid InvalidStateError Exception (XHR2 Spec)
  7192. // Support: IE9
  7193. // Accessing binary-data responseText throws an exception
  7194. // (#11426)
  7195. if ( (!xhr.responseType || xhr.responseType === "text") &&
  7196. typeof xhr.responseText === "string" ) {
  7197. responses.text = xhr.responseText;
  7198. }
  7199. // The native response associated with the responseType
  7200. // Stored in the xhr.response attribute (XHR2 Spec)
  7201. if ( xhr.response ) {
  7202. responses.native = xhr.response;
  7203. }
  7204. complete(
  7205. xhrSuccessStatus[ xhr.status ] || xhr.status,
  7206. xhr.statusText,
  7207. responses,
  7208. xhr.getAllResponseHeaders()
  7209. );
  7210. }
  7211. }
  7212. };
  7213. };
  7214. // Listen to events
  7215. xhr.onload = callback();
  7216. xhr.onerror = callback("error");
  7217. // Create the abort callback
  7218. callback = xhrCallbacks[ id ] = callback("abort");
  7219. try {
  7220. // Do send the request (this may raise an exception)
  7221. xhr.send( options.hasContent && options.data || null );
  7222. } catch ( e ) {
  7223. // #14683: Only rethrow if this hasn't been notified as an error yet
  7224. if ( callback ) {
  7225. throw e;
  7226. }
  7227. }
  7228. },
  7229. abort: function() {
  7230. if ( callback ) {
  7231. callback();
  7232. }
  7233. }
  7234. };
  7235. }
  7236. });
  7237. // Install script dataType
  7238. jQuery.ajaxSetup({
  7239. accepts: {
  7240. script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  7241. },
  7242. contents: {
  7243. script: /(?:java|ecma)script/
  7244. },
  7245. converters: {
  7246. "text script": function( text ) {
  7247. jQuery.globalEval( text );
  7248. return text;
  7249. }
  7250. }
  7251. });
  7252. // Handle cache's special case and crossDomain
  7253. jQuery.ajaxPrefilter( "script", function( s ) {
  7254. if ( s.cache === undefined ) {
  7255. s.cache = false;
  7256. }
  7257. if ( s.crossDomain ) {
  7258. s.type = "GET";
  7259. }
  7260. });
  7261. // Bind script tag hack transport
  7262. jQuery.ajaxTransport( "script", function( s ) {
  7263. // This transport only deals with cross domain requests
  7264. if ( s.crossDomain ) {
  7265. var script, callback;
  7266. return {
  7267. send: function( _, complete ) {
  7268. script = jQuery("<script>").prop({
  7269. async: true,
  7270. charset: s.scriptCharset,
  7271. src: s.url
  7272. }).on(
  7273. "load error",
  7274. callback = function( evt ) {
  7275. script.remove();
  7276. callback = null;
  7277. if ( evt ) {
  7278. complete( evt.type === "error" ? 404 : 200, evt.type );
  7279. }
  7280. }
  7281. );
  7282. document.head.appendChild( script[ 0 ] );
  7283. },
  7284. abort: function() {
  7285. if ( callback ) {
  7286. callback();
  7287. }
  7288. }
  7289. };
  7290. }
  7291. });
  7292. var oldCallbacks = [],
  7293. rjsonp = /(=)\?(?=&|$)|\?\?/;
  7294. // Default jsonp settings
  7295. jQuery.ajaxSetup({
  7296. jsonp: "callback",
  7297. jsonpCallback: function() {
  7298. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
  7299. this[ callback ] = true;
  7300. return callback;
  7301. }
  7302. });
  7303. // Detect, normalize options and install callbacks for jsonp requests
  7304. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  7305. var callbackName, overwritten, responseContainer,
  7306. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  7307. "url" :
  7308. typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
  7309. );
  7310. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  7311. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  7312. // Get callback name, remembering preexisting value associated with it
  7313. callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
  7314. s.jsonpCallback() :
  7315. s.jsonpCallback;
  7316. // Insert callback into url or form data
  7317. if ( jsonProp ) {
  7318. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  7319. } else if ( s.jsonp !== false ) {
  7320. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  7321. }
  7322. // Use data converter to retrieve json after script execution
  7323. s.converters["script json"] = function() {
  7324. if ( !responseContainer ) {
  7325. jQuery.error( callbackName + " was not called" );
  7326. }
  7327. return responseContainer[ 0 ];
  7328. };
  7329. // force json dataType
  7330. s.dataTypes[ 0 ] = "json";
  7331. // Install callback
  7332. overwritten = window[ callbackName ];
  7333. window[ callbackName ] = function() {
  7334. responseContainer = arguments;
  7335. };
  7336. // Clean-up function (fires after converters)
  7337. jqXHR.always(function() {
  7338. // Restore preexisting value
  7339. window[ callbackName ] = overwritten;
  7340. // Save back as free
  7341. if ( s[ callbackName ] ) {
  7342. // make sure that re-using the options doesn't screw things around
  7343. s.jsonpCallback = originalSettings.jsonpCallback;
  7344. // save the callback name for future use
  7345. oldCallbacks.push( callbackName );
  7346. }
  7347. // Call if it was a function and we have a response
  7348. if ( responseContainer && jQuery.isFunction( overwritten ) ) {
  7349. overwritten( responseContainer[ 0 ] );
  7350. }
  7351. responseContainer = overwritten = undefined;
  7352. });
  7353. // Delegate to script
  7354. return "script";
  7355. }
  7356. });
  7357. // data: string of html
  7358. // context (optional): If specified, the fragment will be created in this context, defaults to document
  7359. // keepScripts (optional): If true, will include scripts passed in the html string
  7360. jQuery.parseHTML = function( data, context, keepScripts ) {
  7361. if ( !data || typeof data !== "string" ) {
  7362. return null;
  7363. }
  7364. if ( typeof context === "boolean" ) {
  7365. keepScripts = context;
  7366. context = false;
  7367. }
  7368. context = context || document;
  7369. var parsed = rsingleTag.exec( data ),
  7370. scripts = !keepScripts && [];
  7371. // Single tag
  7372. if ( parsed ) {
  7373. return [ context.createElement( parsed[1] ) ];
  7374. }
  7375. parsed = jQuery.buildFragment( [ data ], context, scripts );
  7376. if ( scripts && scripts.length ) {
  7377. jQuery( scripts ).remove();
  7378. }
  7379. return jQuery.merge( [], parsed.childNodes );
  7380. };
  7381. // Keep a copy of the old load method
  7382. var _load = jQuery.fn.load;
  7383. /**
  7384. * Load a url into a page
  7385. */
  7386. jQuery.fn.load = function( url, params, callback ) {
  7387. if ( typeof url !== "string" && _load ) {
  7388. return _load.apply( this, arguments );
  7389. }
  7390. var selector, type, response,
  7391. self = this,
  7392. off = url.indexOf(" ");
  7393. if ( off >= 0 ) {
  7394. selector = jQuery.trim( url.slice( off ) );
  7395. url = url.slice( 0, off );
  7396. }
  7397. // If it's a function
  7398. if ( jQuery.isFunction( params ) ) {
  7399. // We assume that it's the callback
  7400. callback = params;
  7401. params = undefined;
  7402. // Otherwise, build a param string
  7403. } else if ( params && typeof params === "object" ) {
  7404. type = "POST";
  7405. }
  7406. // If we have elements to modify, make the request
  7407. if ( self.length > 0 ) {
  7408. jQuery.ajax({
  7409. url: url,
  7410. // if "type" variable is undefined, then "GET" method will be used
  7411. type: type,
  7412. dataType: "html",
  7413. data: params
  7414. }).done(function( responseText ) {
  7415. // Save response for use in complete callback
  7416. response = arguments;
  7417. self.html( selector ?
  7418. // If a selector was specified, locate the right elements in a dummy div
  7419. // Exclude scripts to avoid IE 'Permission Denied' errors
  7420. jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
  7421. // Otherwise use the full result
  7422. responseText );
  7423. }).complete( callback && function( jqXHR, status ) {
  7424. self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
  7425. });
  7426. }
  7427. return this;
  7428. };
  7429. jQuery.expr.filters.animated = function( elem ) {
  7430. return jQuery.grep(jQuery.timers, function( fn ) {
  7431. return elem === fn.elem;
  7432. }).length;
  7433. };
  7434. var docElem = window.document.documentElement;
  7435. /**
  7436. * Gets a window from an element
  7437. */
  7438. function getWindow( elem ) {
  7439. return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
  7440. }
  7441. jQuery.offset = {
  7442. setOffset: function( elem, options, i ) {
  7443. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  7444. position = jQuery.css( elem, "position" ),
  7445. curElem = jQuery( elem ),
  7446. props = {};
  7447. // Set position first, in-case top/left are set even on static elem
  7448. if ( position === "static" ) {
  7449. elem.style.position = "relative";
  7450. }
  7451. curOffset = curElem.offset();
  7452. curCSSTop = jQuery.css( elem, "top" );
  7453. curCSSLeft = jQuery.css( elem, "left" );
  7454. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  7455. ( curCSSTop + curCSSLeft ).indexOf("auto") > -1;
  7456. // Need to be able to calculate position if either top or left is auto and position is either absolute or fixed
  7457. if ( calculatePosition ) {
  7458. curPosition = curElem.position();
  7459. curTop = curPosition.top;
  7460. curLeft = curPosition.left;
  7461. } else {
  7462. curTop = parseFloat( curCSSTop ) || 0;
  7463. curLeft = parseFloat( curCSSLeft ) || 0;
  7464. }
  7465. if ( jQuery.isFunction( options ) ) {
  7466. options = options.call( elem, i, curOffset );
  7467. }
  7468. if ( options.top != null ) {
  7469. props.top = ( options.top - curOffset.top ) + curTop;
  7470. }
  7471. if ( options.left != null ) {
  7472. props.left = ( options.left - curOffset.left ) + curLeft;
  7473. }
  7474. if ( "using" in options ) {
  7475. options.using.call( elem, props );
  7476. } else {
  7477. curElem.css( props );
  7478. }
  7479. }
  7480. };
  7481. jQuery.fn.extend({
  7482. offset: function( options ) {
  7483. if ( arguments.length ) {
  7484. return options === undefined ?
  7485. this :
  7486. this.each(function( i ) {
  7487. jQuery.offset.setOffset( this, options, i );
  7488. });
  7489. }
  7490. var docElem, win,
  7491. elem = this[ 0 ],
  7492. box = { top: 0, left: 0 },
  7493. doc = elem && elem.ownerDocument;
  7494. if ( !doc ) {
  7495. return;
  7496. }
  7497. docElem = doc.documentElement;
  7498. // Make sure it's not a disconnected DOM node
  7499. if ( !jQuery.contains( docElem, elem ) ) {
  7500. return box;
  7501. }
  7502. // If we don't have gBCR, just use 0,0 rather than error
  7503. // BlackBerry 5, iOS 3 (original iPhone)
  7504. if ( typeof elem.getBoundingClientRect !== strundefined ) {
  7505. box = elem.getBoundingClientRect();
  7506. }
  7507. win = getWindow( doc );
  7508. return {
  7509. top: box.top + win.pageYOffset - docElem.clientTop,
  7510. left: box.left + win.pageXOffset - docElem.clientLeft
  7511. };
  7512. },
  7513. position: function() {
  7514. if ( !this[ 0 ] ) {
  7515. return;
  7516. }
  7517. var offsetParent, offset,
  7518. elem = this[ 0 ],
  7519. parentOffset = { top: 0, left: 0 };
  7520. // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
  7521. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  7522. // We assume that getBoundingClientRect is available when computed position is fixed
  7523. offset = elem.getBoundingClientRect();
  7524. } else {
  7525. // Get *real* offsetParent
  7526. offsetParent = this.offsetParent();
  7527. // Get correct offsets
  7528. offset = this.offset();
  7529. if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
  7530. parentOffset = offsetParent.offset();
  7531. }
  7532. // Add offsetParent borders
  7533. parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
  7534. parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
  7535. }
  7536. // Subtract parent offsets and element margins
  7537. return {
  7538. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  7539. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  7540. };
  7541. },
  7542. offsetParent: function() {
  7543. return this.map(function() {
  7544. var offsetParent = this.offsetParent || docElem;
  7545. while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
  7546. offsetParent = offsetParent.offsetParent;
  7547. }
  7548. return offsetParent || docElem;
  7549. });
  7550. }
  7551. });
  7552. // Create scrollLeft and scrollTop methods
  7553. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  7554. var top = "pageYOffset" === prop;
  7555. jQuery.fn[ method ] = function( val ) {
  7556. return access( this, function( elem, method, val ) {
  7557. var win = getWindow( elem );
  7558. if ( val === undefined ) {
  7559. return win ? win[ prop ] : elem[ method ];
  7560. }
  7561. if ( win ) {
  7562. win.scrollTo(
  7563. !top ? val : window.pageXOffset,
  7564. top ? val : window.pageYOffset
  7565. );
  7566. } else {
  7567. elem[ method ] = val;
  7568. }
  7569. }, method, val, arguments.length, null );
  7570. };
  7571. });
  7572. // Add the top/left cssHooks using jQuery.fn.position
  7573. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  7574. // getComputedStyle returns percent when specified for top/left/bottom/right
  7575. // rather than make the css module depend on the offset module, we just check for it here
  7576. jQuery.each( [ "top", "left" ], function( i, prop ) {
  7577. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  7578. function( elem, computed ) {
  7579. if ( computed ) {
  7580. computed = curCSS( elem, prop );
  7581. // if curCSS returns percentage, fallback to offset
  7582. return rnumnonpx.test( computed ) ?
  7583. jQuery( elem ).position()[ prop ] + "px" :
  7584. computed;
  7585. }
  7586. }
  7587. );
  7588. });
  7589. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  7590. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  7591. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
  7592. // margin is only for outerHeight, outerWidth
  7593. jQuery.fn[ funcName ] = function( margin, value ) {
  7594. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  7595. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  7596. return access( this, function( elem, type, value ) {
  7597. var doc;
  7598. if ( jQuery.isWindow( elem ) ) {
  7599. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  7600. // isn't a whole lot we can do. See pull request at this URL for discussion:
  7601. // https://github.com/jquery/jquery/pull/764
  7602. return elem.document.documentElement[ "client" + name ];
  7603. }
  7604. // Get document width or height
  7605. if ( elem.nodeType === 9 ) {
  7606. doc = elem.documentElement;
  7607. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  7608. // whichever is greatest
  7609. return Math.max(
  7610. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  7611. elem.body[ "offset" + name ], doc[ "offset" + name ],
  7612. doc[ "client" + name ]
  7613. );
  7614. }
  7615. return value === undefined ?
  7616. // Get width or height on the element, requesting but not forcing parseFloat
  7617. jQuery.css( elem, type, extra ) :
  7618. // Set width or height on the element
  7619. jQuery.style( elem, type, value, extra );
  7620. }, type, chainable ? margin : undefined, chainable, null );
  7621. };
  7622. });
  7623. });
  7624. // The number of elements contained in the matched element set
  7625. jQuery.fn.size = function() {
  7626. return this.length;
  7627. };
  7628. jQuery.fn.andSelf = jQuery.fn.addBack;
  7629. // Register as a named AMD module, since jQuery can be concatenated with other
  7630. // files that may use define, but not via a proper concatenation script that
  7631. // understands anonymous AMD modules. A named AMD is safest and most robust
  7632. // way to register. Lowercase jquery is used because AMD module names are
  7633. // derived from file names, and jQuery is normally delivered in a lowercase
  7634. // file name. Do this after creating the global so that if an AMD module wants
  7635. // to call noConflict to hide this version of jQuery, it will work.
  7636. // Note that for maximum portability, libraries that are not jQuery should
  7637. // declare themselves as anonymous modules, and avoid setting a global if an
  7638. // AMD loader is present. jQuery is a special case. For more information, see
  7639. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  7640. if ( typeof define === "function" && define.amd ) {
  7641. define( "jquery", [], function() {
  7642. return jQuery;
  7643. });
  7644. }
  7645. var
  7646. // Map over jQuery in case of overwrite
  7647. _jQuery = window.jQuery,
  7648. // Map over the $ in case of overwrite
  7649. _$ = window.$;
  7650. jQuery.noConflict = function( deep ) {
  7651. if ( window.$ === jQuery ) {
  7652. window.$ = _$;
  7653. }
  7654. if ( deep && window.jQuery === jQuery ) {
  7655. window.jQuery = _jQuery;
  7656. }
  7657. return jQuery;
  7658. };
  7659. // Expose jQuery and $ identifiers, even in
  7660. // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  7661. // and CommonJS for browser emulators (#13566)
  7662. if ( typeof noGlobal === strundefined ) {
  7663. window.jQuery = window.$ = jQuery;
  7664. }
  7665. return jQuery;
  7666. }));
  7667. /*
  7668. Copyright 2013 Daniel Wirtz <dcode@dcode.io>
  7669. Copyright 2009 The Closure Library Authors. All Rights Reserved.
  7670. Licensed under the Apache License, Version 2.0 (the "License");
  7671. you may not use this file except in compliance with the License.
  7672. You may obtain a copy of the License at
  7673. http://www.apache.org/licenses/LICENSE-2.0
  7674. Unless required by applicable law or agreed to in writing, software
  7675. distributed under the License is distributed on an "AS-IS" BASIS,
  7676. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7677. See the License for the specific language governing permissions and
  7678. limitations under the License.
  7679. */
  7680. /**
  7681. * @license Long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
  7682. * Released under the Apache License, Version 2.0
  7683. * see: https://github.com/dcodeIO/Long.js for details
  7684. */
  7685. (function(global) {
  7686. "use strict";
  7687. /**
  7688. * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.
  7689. * See the from* functions below for more convenient ways of constructing Longs.
  7690. * @exports Long
  7691. * @class A Long class for representing a 64 bit two's-complement integer value.
  7692. * @param {number} low The low (signed) 32 bits of the long
  7693. * @param {number} high The high (signed) 32 bits of the long
  7694. * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed
  7695. * @constructor
  7696. */
  7697. var Long = function(low, high, unsigned) {
  7698. /**
  7699. * The low 32 bits as a signed value.
  7700. * @type {number}
  7701. * @expose
  7702. */
  7703. this.low = low|0;
  7704. /**
  7705. * The high 32 bits as a signed value.
  7706. * @type {number}
  7707. * @expose
  7708. */
  7709. this.high = high|0;
  7710. /**
  7711. * Whether unsigned or not.
  7712. * @type {boolean}
  7713. * @expose
  7714. */
  7715. this.unsigned = !!unsigned;
  7716. };
  7717. // The internal representation of a long is the two given signed, 32-bit values.
  7718. // We use 32-bit pieces because these are the size of integers on which
  7719. // Javascript performs bit-operations. For operations like addition and
  7720. // multiplication, we split each number into 16 bit pieces, which can easily be
  7721. // multiplied within Javascript's floating-point representation without overflow
  7722. // or change in sign.
  7723. //
  7724. // In the algorithms below, we frequently reduce the negative case to the
  7725. // positive case by negating the input(s) and then post-processing the result.
  7726. // Note that we must ALWAYS check specially whether those values are MIN_VALUE
  7727. // (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
  7728. // a positive number, it overflows back into a negative). Not handling this
  7729. // case would often result in infinite recursion.
  7730. //
  7731. // Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*
  7732. // methods on which they depend.
  7733. /**
  7734. * Tests if the specified object is a Long.
  7735. * @param {*} obj Object
  7736. * @returns {boolean}
  7737. * @expose
  7738. */
  7739. Long.isLong = function(obj) {
  7740. return (obj && obj instanceof Long) === true;
  7741. };
  7742. /**
  7743. * A cache of the Long representations of small integer values.
  7744. * @type {!Object}
  7745. * @inner
  7746. */
  7747. var INT_CACHE = {};
  7748. /**
  7749. * A cache of the Long representations of small unsigned integer values.
  7750. * @type {!Object}
  7751. * @inner
  7752. */
  7753. var UINT_CACHE = {};
  7754. /**
  7755. * Returns a Long representing the given 32 bit integer value.
  7756. * @param {number} value The 32 bit integer in question
  7757. * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed
  7758. * @returns {!Long} The corresponding Long value
  7759. * @expose
  7760. */
  7761. Long.fromInt = function(value, unsigned) {
  7762. var obj, cachedObj;
  7763. if (!unsigned) {
  7764. value = value | 0;
  7765. if (-128 <= value && value < 128) {
  7766. cachedObj = INT_CACHE[value];
  7767. if (cachedObj)
  7768. return cachedObj;
  7769. }
  7770. obj = new Long(value, value < 0 ? -1 : 0, false);
  7771. if (-128 <= value && value < 128)
  7772. INT_CACHE[value] = obj;
  7773. return obj;
  7774. } else {
  7775. value = value >>> 0;
  7776. if (0 <= value && value < 256) {
  7777. cachedObj = UINT_CACHE[value];
  7778. if (cachedObj)
  7779. return cachedObj;
  7780. }
  7781. obj = new Long(value, (value | 0) < 0 ? -1 : 0, true);
  7782. if (0 <= value && value < 256)
  7783. UINT_CACHE[value] = obj;
  7784. return obj;
  7785. }
  7786. };
  7787. /**
  7788. * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
  7789. * @param {number} value The number in question
  7790. * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed
  7791. * @returns {!Long} The corresponding Long value
  7792. * @expose
  7793. */
  7794. Long.fromNumber = function(value, unsigned) {
  7795. unsigned = !!unsigned;
  7796. if (isNaN(value) || !isFinite(value))
  7797. return Long.ZERO;
  7798. if (!unsigned && value <= -TWO_PWR_63_DBL)
  7799. return Long.MIN_VALUE;
  7800. if (!unsigned && value + 1 >= TWO_PWR_63_DBL)
  7801. return Long.MAX_VALUE;
  7802. if (unsigned && value >= TWO_PWR_64_DBL)
  7803. return Long.MAX_UNSIGNED_VALUE;
  7804. if (value < 0)
  7805. return Long.fromNumber(-value, unsigned).negate();
  7806. return new Long((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);
  7807. };
  7808. /**
  7809. * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is
  7810. * assumed to use 32 bits.
  7811. * @param {number} lowBits The low 32 bits
  7812. * @param {number} highBits The high 32 bits
  7813. * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed
  7814. * @returns {!Long} The corresponding Long value
  7815. * @expose
  7816. */
  7817. Long.fromBits = function(lowBits, highBits, unsigned) {
  7818. return new Long(lowBits, highBits, unsigned);
  7819. };
  7820. /**
  7821. * Returns a Long representation of the given string, written using the specified radix.
  7822. * @param {string} str The textual representation of the Long
  7823. * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to `false` for signed
  7824. * @param {number=} radix The radix in which the text is written (2-36), defaults to 10
  7825. * @returns {!Long} The corresponding Long value
  7826. * @expose
  7827. */
  7828. Long.fromString = function(str, unsigned, radix) {
  7829. if (str.length === 0)
  7830. throw Error('number format error: empty string');
  7831. if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity")
  7832. return Long.ZERO;
  7833. if (typeof unsigned === 'number') // For goog.math.long compatibility
  7834. radix = unsigned,
  7835. unsigned = false;
  7836. radix = radix || 10;
  7837. if (radix < 2 || 36 < radix)
  7838. throw Error('radix out of range: ' + radix);
  7839. var p;
  7840. if ((p = str.indexOf('-')) > 0)
  7841. throw Error('number format error: interior "-" character: ' + str);
  7842. else if (p === 0)
  7843. return Long.fromString(str.substring(1), unsigned, radix).negate();
  7844. // Do several (8) digits each time through the loop, so as to
  7845. // minimize the calls to the very expensive emulated div.
  7846. var radixToPower = Long.fromNumber(Math.pow(radix, 8));
  7847. var result = Long.ZERO;
  7848. for (var i = 0; i < str.length; i += 8) {
  7849. var size = Math.min(8, str.length - i);
  7850. var value = parseInt(str.substring(i, i + size), radix);
  7851. if (size < 8) {
  7852. var power = Long.fromNumber(Math.pow(radix, size));
  7853. result = result.multiply(power).add(Long.fromNumber(value));
  7854. } else {
  7855. result = result.multiply(radixToPower);
  7856. result = result.add(Long.fromNumber(value));
  7857. }
  7858. }
  7859. result.unsigned = unsigned;
  7860. return result;
  7861. };
  7862. /**
  7863. * Converts the specified value to a Long.
  7864. * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value
  7865. * @returns {!Long}
  7866. * @expose
  7867. */
  7868. Long.fromValue = function(val) {
  7869. if (typeof val === 'number')
  7870. return Long.fromNumber(val);
  7871. if (typeof val === 'string')
  7872. return Long.fromString(val);
  7873. if (Long.isLong(val))
  7874. return val;
  7875. // Throws for not an object (undefined, null):
  7876. return new Long(val.low, val.high, val.unsigned);
  7877. };
  7878. // NOTE: the compiler should inline these constant values below and then remove these variables, so there should be
  7879. // no runtime penalty for these.
  7880. /**
  7881. * @type {number}
  7882. * @const
  7883. * @inner
  7884. */
  7885. var TWO_PWR_16_DBL = 1 << 16;
  7886. /**
  7887. * @type {number}
  7888. * @const
  7889. * @inner
  7890. */
  7891. var TWO_PWR_24_DBL = 1 << 24;
  7892. /**
  7893. * @type {number}
  7894. * @const
  7895. * @inner
  7896. */
  7897. var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;
  7898. /**
  7899. * @type {number}
  7900. * @const
  7901. * @inner
  7902. */
  7903. var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;
  7904. /**
  7905. * @type {number}
  7906. * @const
  7907. * @inner
  7908. */
  7909. var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;
  7910. /**
  7911. * @type {!Long}
  7912. * @const
  7913. * @inner
  7914. */
  7915. var TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL);
  7916. /**
  7917. * Signed zero.
  7918. * @type {!Long}
  7919. * @expose
  7920. */
  7921. Long.ZERO = Long.fromInt(0);
  7922. /**
  7923. * Unsigned zero.
  7924. * @type {!Long}
  7925. * @expose
  7926. */
  7927. Long.UZERO = Long.fromInt(0, true);
  7928. /**
  7929. * Signed one.
  7930. * @type {!Long}
  7931. * @expose
  7932. */
  7933. Long.ONE = Long.fromInt(1);
  7934. /**
  7935. * Unsigned one.
  7936. * @type {!Long}
  7937. * @expose
  7938. */
  7939. Long.UONE = Long.fromInt(1, true);
  7940. /**
  7941. * Signed negative one.
  7942. * @type {!Long}
  7943. * @expose
  7944. */
  7945. Long.NEG_ONE = Long.fromInt(-1);
  7946. /**
  7947. * Maximum signed value.
  7948. * @type {!Long}
  7949. * @expose
  7950. */
  7951. Long.MAX_VALUE = Long.fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);
  7952. /**
  7953. * Maximum unsigned value.
  7954. * @type {!Long}
  7955. * @expose
  7956. */
  7957. Long.MAX_UNSIGNED_VALUE = Long.fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);
  7958. /**
  7959. * Minimum signed value.
  7960. * @type {!Long}
  7961. * @expose
  7962. */
  7963. Long.MIN_VALUE = Long.fromBits(0, 0x80000000|0, false);
  7964. /**
  7965. * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.
  7966. * @returns {number}
  7967. * @expose
  7968. */
  7969. Long.prototype.toInt = function() {
  7970. return this.unsigned ? this.low >>> 0 : this.low;
  7971. };
  7972. /**
  7973. * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).
  7974. * @returns {number}
  7975. * @expose
  7976. */
  7977. Long.prototype.toNumber = function() {
  7978. if (this.unsigned) {
  7979. return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);
  7980. }
  7981. return this.high * TWO_PWR_32_DBL + (this.low >>> 0);
  7982. };
  7983. /**
  7984. * Converts the Long to a string written in the specified radix.
  7985. * @param {number=} radix Radix (2-36), defaults to 10
  7986. * @returns {string}
  7987. * @override
  7988. * @throws {RangeError} If `radix` is out of range
  7989. * @expose
  7990. */
  7991. Long.prototype.toString = function(radix) {
  7992. radix = radix || 10;
  7993. if (radix < 2 || 36 < radix)
  7994. throw RangeError('radix out of range: ' + radix);
  7995. if (this.isZero())
  7996. return '0';
  7997. var rem;
  7998. if (this.isNegative()) { // Unsigned Longs are never negative
  7999. if (this.equals(Long.MIN_VALUE)) {
  8000. // We need to change the Long value before it can be negated, so we remove
  8001. // the bottom-most digit in this base and then recurse to do the rest.
  8002. var radixLong = Long.fromNumber(radix);
  8003. var div = this.div(radixLong);
  8004. rem = div.multiply(radixLong).subtract(this);
  8005. return div.toString(radix) + rem.toInt().toString(radix);
  8006. } else
  8007. return '-' + this.negate().toString(radix);
  8008. }
  8009. // Do several (6) digits each time through the loop, so as to
  8010. // minimize the calls to the very expensive emulated div.
  8011. var radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned);
  8012. rem = this;
  8013. var result = '';
  8014. while (true) {
  8015. var remDiv = rem.div(radixToPower),
  8016. intval = rem.subtract(remDiv.multiply(radixToPower)).toInt() >>> 0,
  8017. digits = intval.toString(radix);
  8018. rem = remDiv;
  8019. if (rem.isZero())
  8020. return digits + result;
  8021. else {
  8022. while (digits.length < 6)
  8023. digits = '0' + digits;
  8024. result = '' + digits + result;
  8025. }
  8026. }
  8027. };
  8028. /**
  8029. * Gets the high 32 bits as a signed integer.
  8030. * @returns {number} Signed high bits
  8031. * @expose
  8032. */
  8033. Long.prototype.getHighBits = function() {
  8034. return this.high;
  8035. };
  8036. /**
  8037. * Gets the high 32 bits as an unsigned integer.
  8038. * @returns {number} Unsigned high bits
  8039. * @expose
  8040. */
  8041. Long.prototype.getHighBitsUnsigned = function() {
  8042. return this.high >>> 0;
  8043. };
  8044. /**
  8045. * Gets the low 32 bits as a signed integer.
  8046. * @returns {number} Signed low bits
  8047. * @expose
  8048. */
  8049. Long.prototype.getLowBits = function() {
  8050. return this.low;
  8051. };
  8052. /**
  8053. * Gets the low 32 bits as an unsigned integer.
  8054. * @returns {number} Unsigned low bits
  8055. * @expose
  8056. */
  8057. Long.prototype.getLowBitsUnsigned = function() {
  8058. return this.low >>> 0;
  8059. };
  8060. /**
  8061. * Gets the number of bits needed to represent the absolute value of this Long.
  8062. * @returns {number}
  8063. * @expose
  8064. */
  8065. Long.prototype.getNumBitsAbs = function() {
  8066. if (this.isNegative()) // Unsigned Longs are never negative
  8067. return this.equals(Long.MIN_VALUE) ? 64 : this.negate().getNumBitsAbs();
  8068. var val = this.high != 0 ? this.high : this.low;
  8069. for (var bit = 31; bit > 0; bit--)
  8070. if ((val & (1 << bit)) != 0)
  8071. break;
  8072. return this.high != 0 ? bit + 33 : bit + 1;
  8073. };
  8074. /**
  8075. * Tests if this Long's value equals zero.
  8076. * @returns {boolean}
  8077. * @expose
  8078. */
  8079. Long.prototype.isZero = function() {
  8080. return this.high === 0 && this.low === 0;
  8081. };
  8082. /**
  8083. * Tests if this Long's value is negative.
  8084. * @returns {boolean}
  8085. * @expose
  8086. */
  8087. Long.prototype.isNegative = function() {
  8088. return !this.unsigned && this.high < 0;
  8089. };
  8090. /**
  8091. * Tests if this Long's value is positive.
  8092. * @returns {boolean}
  8093. * @expose
  8094. */
  8095. Long.prototype.isPositive = function() {
  8096. return this.unsigned || this.high >= 0;
  8097. };
  8098. /**
  8099. * Tests if this Long's value is odd.
  8100. * @returns {boolean}
  8101. * @expose
  8102. */
  8103. Long.prototype.isOdd = function() {
  8104. return (this.low & 1) === 1;
  8105. };
  8106. /**
  8107. * Tests if this Long's value is even.
  8108. * @returns {boolean}
  8109. * @expose
  8110. */
  8111. Long.prototype.isEven = function() {
  8112. return (this.low & 1) === 0;
  8113. };
  8114. /**
  8115. * Tests if this Long's value equals the specified's.
  8116. * @param {!Long|number|string} other Other value
  8117. * @returns {boolean}
  8118. * @expose
  8119. */
  8120. Long.prototype.equals = function(other) {
  8121. if (!Long.isLong(other))
  8122. other = Long.fromValue(other);
  8123. if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)
  8124. return false;
  8125. return this.high === other.high && this.low === other.low;
  8126. };
  8127. /**
  8128. * Tests if this Long's value differs from the specified's.
  8129. * @param {!Long|number|string} other Other value
  8130. * @returns {boolean}
  8131. * @expose
  8132. */
  8133. Long.prototype.notEquals = function(other) {
  8134. if (!Long.isLong(other))
  8135. other = Long.fromValue(other);
  8136. return !this.equals(other);
  8137. };
  8138. /**
  8139. * Tests if this Long's value is less than the specified's.
  8140. * @param {!Long|number|string} other Other value
  8141. * @returns {boolean}
  8142. * @expose
  8143. */
  8144. Long.prototype.lessThan = function(other) {
  8145. if (!Long.isLong(other))
  8146. other = Long.fromValue(other);
  8147. return this.compare(other) < 0;
  8148. };
  8149. /**
  8150. * Tests if this Long's value is less than or equal the specified's.
  8151. * @param {!Long|number|string} other Other value
  8152. * @returns {boolean}
  8153. * @expose
  8154. */
  8155. Long.prototype.lessThanOrEqual = function(other) {
  8156. if (!Long.isLong(other))
  8157. other = Long.fromValue(other);
  8158. return this.compare(other) <= 0;
  8159. };
  8160. /**
  8161. * Tests if this Long's value is greater than the specified's.
  8162. * @param {!Long|number|string} other Other value
  8163. * @returns {boolean}
  8164. * @expose
  8165. */
  8166. Long.prototype.greaterThan = function(other) {
  8167. if (!Long.isLong(other))
  8168. other = Long.fromValue(other);
  8169. return this.compare(other) > 0;
  8170. };
  8171. /**
  8172. * Tests if this Long's value is greater than or equal the specified's.
  8173. * @param {!Long|number|string} other Other value
  8174. * @returns {boolean}
  8175. * @expose
  8176. */
  8177. Long.prototype.greaterThanOrEqual = function(other) {
  8178. return this.compare(other) >= 0;
  8179. };
  8180. /**
  8181. * Compares this Long's value with the specified's.
  8182. * @param {!Long|number|string} other Other value
  8183. * @returns {number} 0 if they are the same, 1 if the this is greater and -1
  8184. * if the given one is greater
  8185. * @expose
  8186. */
  8187. Long.prototype.compare = function(other) {
  8188. if (this.equals(other))
  8189. return 0;
  8190. var thisNeg = this.isNegative(),
  8191. otherNeg = other.isNegative();
  8192. if (thisNeg && !otherNeg)
  8193. return -1;
  8194. if (!thisNeg && otherNeg)
  8195. return 1;
  8196. // At this point the sign bits are the same
  8197. if (!this.unsigned)
  8198. return this.subtract(other).isNegative() ? -1 : 1;
  8199. // Both are positive if at least one is unsigned
  8200. return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;
  8201. };
  8202. /**
  8203. * Negates this Long's value.
  8204. * @returns {!Long} Negated Long
  8205. * @expose
  8206. */
  8207. Long.prototype.negate = function() {
  8208. if (!this.unsigned && this.equals(Long.MIN_VALUE))
  8209. return Long.MIN_VALUE;
  8210. return this.not().add(Long.ONE);
  8211. };
  8212. /**
  8213. * Returns the sum of this and the specified Long.
  8214. * @param {!Long|number|string} addend Addend
  8215. * @returns {!Long} Sum
  8216. * @expose
  8217. */
  8218. Long.prototype.add = function(addend) {
  8219. if (!Long.isLong(addend))
  8220. addend = Long.fromValue(addend);
  8221. // Divide each number into 4 chunks of 16 bits, and then sum the chunks.
  8222. var a48 = this.high >>> 16;
  8223. var a32 = this.high & 0xFFFF;
  8224. var a16 = this.low >>> 16;
  8225. var a00 = this.low & 0xFFFF;
  8226. var b48 = addend.high >>> 16;
  8227. var b32 = addend.high & 0xFFFF;
  8228. var b16 = addend.low >>> 16;
  8229. var b00 = addend.low & 0xFFFF;
  8230. var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
  8231. c00 += a00 + b00;
  8232. c16 += c00 >>> 16;
  8233. c00 &= 0xFFFF;
  8234. c16 += a16 + b16;
  8235. c32 += c16 >>> 16;
  8236. c16 &= 0xFFFF;
  8237. c32 += a32 + b32;
  8238. c48 += c32 >>> 16;
  8239. c32 &= 0xFFFF;
  8240. c48 += a48 + b48;
  8241. c48 &= 0xFFFF;
  8242. return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);
  8243. };
  8244. /**
  8245. * Returns the difference of this and the specified Long.
  8246. * @param {!Long|number|string} subtrahend Subtrahend
  8247. * @returns {!Long} Difference
  8248. * @expose
  8249. */
  8250. Long.prototype.subtract = function(subtrahend) {
  8251. if (!Long.isLong(subtrahend))
  8252. subtrahend = Long.fromValue(subtrahend);
  8253. return this.add(subtrahend.negate());
  8254. };
  8255. /**
  8256. * Returns the product of this and the specified Long.
  8257. * @param {!Long|number|string} multiplier Multiplier
  8258. * @returns {!Long} Product
  8259. * @expose
  8260. */
  8261. Long.prototype.multiply = function(multiplier) {
  8262. if (this.isZero())
  8263. return Long.ZERO;
  8264. if (!Long.isLong(multiplier))
  8265. multiplier = Long.fromValue(multiplier);
  8266. if (multiplier.isZero())
  8267. return Long.ZERO;
  8268. if (this.equals(Long.MIN_VALUE))
  8269. return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO;
  8270. if (multiplier.equals(Long.MIN_VALUE))
  8271. return this.isOdd() ? Long.MIN_VALUE : Long.ZERO;
  8272. if (this.isNegative()) {
  8273. if (multiplier.isNegative())
  8274. return this.negate().multiply(multiplier.negate());
  8275. else
  8276. return this.negate().multiply(multiplier).negate();
  8277. } else if (multiplier.isNegative())
  8278. return this.multiply(multiplier.negate()).negate();
  8279. // If both longs are small, use float multiplication
  8280. if (this.lessThan(TWO_PWR_24) && multiplier.lessThan(TWO_PWR_24))
  8281. return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);
  8282. // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.
  8283. // We can skip products that would overflow.
  8284. var a48 = this.high >>> 16;
  8285. var a32 = this.high & 0xFFFF;
  8286. var a16 = this.low >>> 16;
  8287. var a00 = this.low & 0xFFFF;
  8288. var b48 = multiplier.high >>> 16;
  8289. var b32 = multiplier.high & 0xFFFF;
  8290. var b16 = multiplier.low >>> 16;
  8291. var b00 = multiplier.low & 0xFFFF;
  8292. var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
  8293. c00 += a00 * b00;
  8294. c16 += c00 >>> 16;
  8295. c00 &= 0xFFFF;
  8296. c16 += a16 * b00;
  8297. c32 += c16 >>> 16;
  8298. c16 &= 0xFFFF;
  8299. c16 += a00 * b16;
  8300. c32 += c16 >>> 16;
  8301. c16 &= 0xFFFF;
  8302. c32 += a32 * b00;
  8303. c48 += c32 >>> 16;
  8304. c32 &= 0xFFFF;
  8305. c32 += a16 * b16;
  8306. c48 += c32 >>> 16;
  8307. c32 &= 0xFFFF;
  8308. c32 += a00 * b32;
  8309. c48 += c32 >>> 16;
  8310. c32 &= 0xFFFF;
  8311. c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
  8312. c48 &= 0xFFFF;
  8313. return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);
  8314. };
  8315. /**
  8316. * Returns this Long divided by the specified.
  8317. * @param {!Long|number|string} divisor Divisor
  8318. * @returns {!Long} Quotient
  8319. * @expose
  8320. */
  8321. Long.prototype.div = function(divisor) {
  8322. if (!Long.isLong(divisor))
  8323. divisor = Long.fromValue(divisor);
  8324. if (divisor.isZero())
  8325. throw(new Error('division by zero'));
  8326. if (this.isZero())
  8327. return this.unsigned ? Long.UZERO : Long.ZERO;
  8328. var approx, rem, res;
  8329. if (this.equals(Long.MIN_VALUE)) {
  8330. if (divisor.equals(Long.ONE) || divisor.equals(Long.NEG_ONE))
  8331. return Long.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
  8332. else if (divisor.equals(Long.MIN_VALUE))
  8333. return Long.ONE;
  8334. else {
  8335. // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
  8336. var halfThis = this.shiftRight(1);
  8337. approx = halfThis.div(divisor).shiftLeft(1);
  8338. if (approx.equals(Long.ZERO)) {
  8339. return divisor.isNegative() ? Long.ONE : Long.NEG_ONE;
  8340. } else {
  8341. rem = this.subtract(divisor.multiply(approx));
  8342. res = approx.add(rem.div(divisor));
  8343. return res;
  8344. }
  8345. }
  8346. } else if (divisor.equals(Long.MIN_VALUE))
  8347. return this.unsigned ? Long.UZERO : Long.ZERO;
  8348. if (this.isNegative()) {
  8349. if (divisor.isNegative())
  8350. return this.negate().div(divisor.negate());
  8351. return this.negate().div(divisor).negate();
  8352. } else if (divisor.isNegative())
  8353. return this.div(divisor.negate()).negate();
  8354. // Repeat the following until the remainder is less than other: find a
  8355. // floating-point that approximates remainder / other *from below*, add this
  8356. // into the result, and subtract it from the remainder. It is critical that
  8357. // the approximate value is less than or equal to the real value so that the
  8358. // remainder never becomes negative.
  8359. res = Long.ZERO;
  8360. rem = this;
  8361. while (rem.greaterThanOrEqual(divisor)) {
  8362. // Approximate the result of division. This may be a little greater or
  8363. // smaller than the actual value.
  8364. approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));
  8365. // We will tweak the approximate result by changing it in the 48-th digit or
  8366. // the smallest non-fractional digit, whichever is larger.
  8367. var log2 = Math.ceil(Math.log(approx) / Math.LN2),
  8368. delta = (log2 <= 48) ? 1 : Math.pow(2, log2 - 48),
  8369. // Decrease the approximation until it is smaller than the remainder. Note
  8370. // that if it is too large, the product overflows and is negative.
  8371. approxRes = Long.fromNumber(approx),
  8372. approxRem = approxRes.multiply(divisor);
  8373. while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
  8374. approx -= delta;
  8375. approxRes = Long.fromNumber(approx, this.unsigned);
  8376. approxRem = approxRes.multiply(divisor);
  8377. }
  8378. // We know the answer can't be zero... and actually, zero would cause
  8379. // infinite recursion since we would make no progress.
  8380. if (approxRes.isZero())
  8381. approxRes = Long.ONE;
  8382. res = res.add(approxRes);
  8383. rem = rem.subtract(approxRem);
  8384. }
  8385. return res;
  8386. };
  8387. /**
  8388. * Returns this Long modulo the specified.
  8389. * @param {!Long|number|string} divisor Divisor
  8390. * @returns {!Long} Remainder
  8391. * @expose
  8392. */
  8393. Long.prototype.modulo = function(divisor) {
  8394. if (!Long.isLong(divisor))
  8395. divisor = Long.fromValue(divisor);
  8396. return this.subtract(this.div(divisor).multiply(divisor));
  8397. };
  8398. /**
  8399. * Returns the bitwise NOT of this Long.
  8400. * @returns {!Long}
  8401. * @expose
  8402. */
  8403. Long.prototype.not = function() {
  8404. return Long.fromBits(~this.low, ~this.high, this.unsigned);
  8405. };
  8406. /**
  8407. * Returns the bitwise AND of this Long and the specified.
  8408. * @param {!Long|number|string} other Other Long
  8409. * @returns {!Long}
  8410. * @expose
  8411. */
  8412. Long.prototype.and = function(other) {
  8413. if (!Long.isLong(other))
  8414. other = Long.fromValue(other);
  8415. return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned);
  8416. };
  8417. /**
  8418. * Returns the bitwise OR of this Long and the specified.
  8419. * @param {!Long|number|string} other Other Long
  8420. * @returns {!Long}
  8421. * @expose
  8422. */
  8423. Long.prototype.or = function(other) {
  8424. if (!Long.isLong(other))
  8425. other = Long.fromValue(other);
  8426. return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned);
  8427. };
  8428. /**
  8429. * Returns the bitwise XOR of this Long and the given one.
  8430. * @param {!Long|number|string} other Other Long
  8431. * @returns {!Long}
  8432. * @expose
  8433. */
  8434. Long.prototype.xor = function(other) {
  8435. if (!Long.isLong(other))
  8436. other = Long.fromValue(other);
  8437. return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);
  8438. };
  8439. /**
  8440. * Returns this Long with bits shifted to the left by the given amount.
  8441. * @param {number|!Long} numBits Number of bits
  8442. * @returns {!Long} Shifted Long
  8443. * @expose
  8444. */
  8445. Long.prototype.shiftLeft = function(numBits) {
  8446. if (Long.isLong(numBits))
  8447. numBits = numBits.toInt();
  8448. if ((numBits &= 63) === 0)
  8449. return this;
  8450. else if (numBits < 32)
  8451. return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);
  8452. else
  8453. return Long.fromBits(0, this.low << (numBits - 32), this.unsigned);
  8454. };
  8455. /**
  8456. * Returns this Long with bits arithmetically shifted to the right by the given amount.
  8457. * @param {number|!Long} numBits Number of bits
  8458. * @returns {!Long} Shifted Long
  8459. * @expose
  8460. */
  8461. Long.prototype.shiftRight = function(numBits) {
  8462. if (Long.isLong(numBits))
  8463. numBits = numBits.toInt();
  8464. if ((numBits &= 63) === 0)
  8465. return this;
  8466. else if (numBits < 32)
  8467. return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);
  8468. else
  8469. return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);
  8470. };
  8471. /**
  8472. * Returns this Long with bits logically shifted to the right by the given amount.
  8473. * @param {number|!Long} numBits Number of bits
  8474. * @returns {!Long} Shifted Long
  8475. * @expose
  8476. */
  8477. Long.prototype.shiftRightUnsigned = function(numBits) {
  8478. if (Long.isLong(numBits))
  8479. numBits = numBits.toInt();
  8480. numBits &= 63;
  8481. if (numBits === 0)
  8482. return this;
  8483. else {
  8484. var high = this.high;
  8485. if (numBits < 32) {
  8486. var low = this.low;
  8487. return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);
  8488. } else if (numBits === 32)
  8489. return Long.fromBits(high, 0, this.unsigned);
  8490. else
  8491. return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned);
  8492. }
  8493. };
  8494. /**
  8495. * Converts this Long to signed.
  8496. * @returns {!Long} Signed long
  8497. * @expose
  8498. */
  8499. Long.prototype.toSigned = function() {
  8500. if (!this.unsigned)
  8501. return this;
  8502. return new Long(this.low, this.high, false);
  8503. };
  8504. /**
  8505. * Converts this Long to unsigned.
  8506. * @returns {!Long} Unsigned long
  8507. * @expose
  8508. */
  8509. Long.prototype.toUnsigned = function() {
  8510. if (this.unsigned)
  8511. return this;
  8512. return new Long(this.low, this.high, true);
  8513. };
  8514. /* CommonJS */ if (typeof require === 'function' && typeof module === 'object' && module && typeof exports === 'object' && exports)
  8515. module["exports"] = Long;
  8516. /* AMD */ else if (typeof define === 'function' && define["amd"])
  8517. define(function() { return Long; });
  8518. /* Global */ else
  8519. (global["dcodeIO"] = global["dcodeIO"] || {})["Long"] = Long;
  8520. })(this);
  8521. /*
  8522. Copyright 2013-2014 Daniel Wirtz <dcode@dcode.io>
  8523. Licensed under the Apache License, Version 2.0 (the "License");
  8524. you may not use this file except in compliance with the License.
  8525. You may obtain a copy of the License at
  8526. http://www.apache.org/licenses/LICENSE-2.0
  8527. Unless required by applicable law or agreed to in writing, software
  8528. distributed under the License is distributed on an "AS IS" BASIS,
  8529. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8530. See the License for the specific language governing permissions and
  8531. limitations under the License.
  8532. */
  8533. /**
  8534. * @license ByteBuffer.js (c) 2013-2014 Daniel Wirtz <dcode@dcode.io>
  8535. * This version of ByteBuffer.js uses an ArrayBuffer (AB) as its backing buffer and is compatible with modern browsers.
  8536. * Released under the Apache License, Version 2.0
  8537. * see: https://github.com/dcodeIO/ByteBuffer.js for details
  8538. */ //
  8539. (function(global) {
  8540. "use strict";
  8541. /**
  8542. * @param {function(new: Long, number, number, boolean=)=} Long
  8543. * @returns {function(new: ByteBuffer, number=, boolean=, boolean=)}}
  8544. * @inner
  8545. */
  8546. function loadByteBuffer(Long) {
  8547. /**
  8548. * Constructs a new ByteBuffer.
  8549. * @class The swiss army knife for binary data in JavaScript.
  8550. * @exports ByteBuffer
  8551. * @constructor
  8552. * @param {number=} capacity Initial capacity. Defaults to {@link ByteBuffer.DEFAULT_CAPACITY}.
  8553. * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to
  8554. * {@link ByteBuffer.DEFAULT_ENDIAN}.
  8555. * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to
  8556. * {@link ByteBuffer.DEFAULT_NOASSERT}.
  8557. * @expose
  8558. */
  8559. var ByteBuffer = function(capacity, littleEndian, noAssert) {
  8560. if (typeof capacity === 'undefined') capacity = ByteBuffer.DEFAULT_CAPACITY;
  8561. if (typeof littleEndian === 'undefined') littleEndian = ByteBuffer.DEFAULT_ENDIAN;
  8562. if (typeof noAssert === 'undefined') noAssert = ByteBuffer.DEFAULT_NOASSERT;
  8563. if (!noAssert) {
  8564. capacity = capacity | 0;
  8565. if (capacity < 0)
  8566. throw RangeError("Illegal capacity");
  8567. littleEndian = !!littleEndian;
  8568. noAssert = !!noAssert;
  8569. }
  8570. /**
  8571. * Backing buffer.
  8572. * @type {!ArrayBuffer}
  8573. * @expose
  8574. */
  8575. this.buffer = capacity === 0 ? EMPTY_BUFFER : new ArrayBuffer(capacity);
  8576. /**
  8577. * Data view to manipulate the backing buffer. Becomes `null` if the backing buffer has a capacity of `0`.
  8578. * @type {?DataView}
  8579. * @expose
  8580. */
  8581. this.view = capacity === 0 ? null : new DataView(this.buffer);
  8582. /**
  8583. * Absolute read/write offset.
  8584. * @type {number}
  8585. * @expose
  8586. * @see ByteBuffer#flip
  8587. * @see ByteBuffer#clear
  8588. */
  8589. this.offset = 0;
  8590. /**
  8591. * Marked offset.
  8592. * @type {number}
  8593. * @expose
  8594. * @see ByteBuffer#mark
  8595. * @see ByteBuffer#reset
  8596. */
  8597. this.markedOffset = -1;
  8598. /**
  8599. * Absolute limit of the contained data. Set to the backing buffer's capacity upon allocation.
  8600. * @type {number}
  8601. * @expose
  8602. * @see ByteBuffer#flip
  8603. * @see ByteBuffer#clear
  8604. */
  8605. this.limit = capacity;
  8606. /**
  8607. * Whether to use little endian byte order, defaults to `false` for big endian.
  8608. * @type {boolean}
  8609. * @expose
  8610. */
  8611. this.littleEndian = typeof littleEndian !== 'undefined' ? !!littleEndian : false;
  8612. /**
  8613. * Whether to skip assertions of offsets and values, defaults to `false`.
  8614. * @type {boolean}
  8615. * @expose
  8616. */
  8617. this.noAssert = !!noAssert;
  8618. };
  8619. /**
  8620. * ByteBuffer version.
  8621. * @type {string}
  8622. * @const
  8623. * @expose
  8624. */
  8625. ByteBuffer.VERSION = "3.5.4";
  8626. /**
  8627. * Little endian constant that can be used instead of its boolean value. Evaluates to `true`.
  8628. * @type {boolean}
  8629. * @const
  8630. * @expose
  8631. */
  8632. ByteBuffer.LITTLE_ENDIAN = true;
  8633. /**
  8634. * Big endian constant that can be used instead of its boolean value. Evaluates to `false`.
  8635. * @type {boolean}
  8636. * @const
  8637. * @expose
  8638. */
  8639. ByteBuffer.BIG_ENDIAN = false;
  8640. /**
  8641. * Default initial capacity of `16`.
  8642. * @type {number}
  8643. * @expose
  8644. */
  8645. ByteBuffer.DEFAULT_CAPACITY = 16;
  8646. /**
  8647. * Default endianess of `false` for big endian.
  8648. * @type {boolean}
  8649. * @expose
  8650. */
  8651. ByteBuffer.DEFAULT_ENDIAN = ByteBuffer.BIG_ENDIAN;
  8652. /**
  8653. * Default no assertions flag of `false`.
  8654. * @type {boolean}
  8655. * @expose
  8656. */
  8657. ByteBuffer.DEFAULT_NOASSERT = false;
  8658. /**
  8659. * A `Long` class for representing a 64-bit two's-complement integer value. May be `null` if Long.js has not been loaded
  8660. * and int64 support is not available.
  8661. * @type {?Long}
  8662. * @const
  8663. * @see https://github.com/dcodeIO/Long.js
  8664. * @expose
  8665. */
  8666. ByteBuffer.Long = Long || null;
  8667. /**
  8668. * @alias ByteBuffer.prototype
  8669. * @inner
  8670. */
  8671. var ByteBufferPrototype = ByteBuffer.prototype;
  8672. // helpers
  8673. /**
  8674. * @type {!ArrayBuffer}
  8675. * @inner
  8676. */
  8677. var EMPTY_BUFFER = new ArrayBuffer(0);
  8678. /**
  8679. * String.fromCharCode reference for compile-time renaming.
  8680. * @type {function(...number):string}
  8681. * @inner
  8682. */
  8683. var stringFromCharCode = String.fromCharCode;
  8684. /**
  8685. * Creates a source function for a string.
  8686. * @param {string} s String to read from
  8687. * @returns {function():number|null} Source function returning the next char code respectively `null` if there are
  8688. * no more characters left.
  8689. * @throws {TypeError} If the argument is invalid
  8690. * @inner
  8691. */
  8692. function stringSource(s) {
  8693. var i=0; return function() {
  8694. return i < s.length ? s.charCodeAt(i++) : null;
  8695. };
  8696. }
  8697. /**
  8698. * Creates a destination function for a string.
  8699. * @returns {function(number=):undefined|string} Destination function successively called with the next char code.
  8700. * Returns the final string when called without arguments.
  8701. * @inner
  8702. */
  8703. function stringDestination() {
  8704. var cs = [], ps = []; return function() {
  8705. if (arguments.length === 0)
  8706. return ps.join('')+stringFromCharCode.apply(String, cs);
  8707. if (cs.length + arguments.length > 1024)
  8708. ps.push(stringFromCharCode.apply(String, cs)),
  8709. cs.length = 0;
  8710. Array.prototype.push.apply(cs, arguments);
  8711. };
  8712. }
  8713. /**
  8714. * Allocates a new ByteBuffer backed by a buffer of the specified capacity.
  8715. * @param {number=} capacity Initial capacity. Defaults to {@link ByteBuffer.DEFAULT_CAPACITY}.
  8716. * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to
  8717. * {@link ByteBuffer.DEFAULT_ENDIAN}.
  8718. * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to
  8719. * {@link ByteBuffer.DEFAULT_NOASSERT}.
  8720. * @returns {!ByteBuffer}
  8721. * @expose
  8722. */
  8723. ByteBuffer.allocate = function(capacity, littleEndian, noAssert) {
  8724. return new ByteBuffer(capacity, littleEndian, noAssert);
  8725. };
  8726. /**
  8727. * Concatenates multiple ByteBuffers into one.
  8728. * @param {!Array.<!ByteBuffer|!ArrayBuffer|!Uint8Array|string>} buffers Buffers to concatenate
  8729. * @param {(string|boolean)=} encoding String encoding if `buffers` contains a string ("base64", "hex", "binary",
  8730. * defaults to "utf8")
  8731. * @param {boolean=} littleEndian Whether to use little or big endian byte order for the resulting ByteBuffer. Defaults
  8732. * to {@link ByteBuffer.DEFAULT_ENDIAN}.
  8733. * @param {boolean=} noAssert Whether to skip assertions of offsets and values for the resulting ByteBuffer. Defaults to
  8734. * {@link ByteBuffer.DEFAULT_NOASSERT}.
  8735. * @returns {!ByteBuffer} Concatenated ByteBuffer
  8736. * @expose
  8737. */
  8738. ByteBuffer.concat = function(buffers, encoding, littleEndian, noAssert) {
  8739. if (typeof encoding === 'boolean' || typeof encoding !== 'string') {
  8740. noAssert = littleEndian;
  8741. littleEndian = encoding;
  8742. encoding = undefined;
  8743. }
  8744. var capacity = 0;
  8745. for (var i=0, k=buffers.length, length; i<k; ++i) {
  8746. if (!ByteBuffer.isByteBuffer(buffers[i]))
  8747. buffers[i] = ByteBuffer.wrap(buffers[i], encoding);
  8748. length = buffers[i].limit - buffers[i].offset;
  8749. if (length > 0) capacity += length;
  8750. }
  8751. if (capacity === 0)
  8752. return new ByteBuffer(0, littleEndian, noAssert);
  8753. var bb = new ByteBuffer(capacity, littleEndian, noAssert),
  8754. bi;
  8755. var view = new Uint8Array(bb.buffer);
  8756. i=0; while (i<k) {
  8757. bi = buffers[i++];
  8758. length = bi.limit - bi.offset;
  8759. if (length <= 0) continue;
  8760. view.set(new Uint8Array(bi.buffer).subarray(bi.offset, bi.limit), bb.offset);
  8761. bb.offset += length;
  8762. }
  8763. bb.limit = bb.offset;
  8764. bb.offset = 0;
  8765. return bb;
  8766. };
  8767. /**
  8768. * Tests if the specified type is a ByteBuffer.
  8769. * @param {*} bb ByteBuffer to test
  8770. * @returns {boolean} `true` if it is a ByteBuffer, otherwise `false`
  8771. * @expose
  8772. */
  8773. ByteBuffer.isByteBuffer = function(bb) {
  8774. return (bb && bb instanceof ByteBuffer) === true;
  8775. };
  8776. /**
  8777. * Gets the backing buffer type.
  8778. * @returns {Function} `Buffer` for NB builds, `ArrayBuffer` for AB builds (classes)
  8779. * @expose
  8780. */
  8781. ByteBuffer.type = function() {
  8782. return ArrayBuffer;
  8783. };
  8784. /**
  8785. * Wraps a buffer or a string. Sets the allocated ByteBuffer's {@link ByteBuffer#offset} to `0` and its
  8786. * {@link ByteBuffer#limit} to the length of the wrapped data.
  8787. * @param {!ByteBuffer|!ArrayBuffer|!Uint8Array|string|!Array.<number>} buffer Anything that can be wrapped
  8788. * @param {(string|boolean)=} encoding String encoding if `buffer` is a string ("base64", "hex", "binary", defaults to
  8789. * "utf8")
  8790. * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to
  8791. * {@link ByteBuffer.DEFAULT_ENDIAN}.
  8792. * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to
  8793. * {@link ByteBuffer.DEFAULT_NOASSERT}.
  8794. * @returns {!ByteBuffer} A ByteBuffer wrapping `buffer`
  8795. * @expose
  8796. */
  8797. ByteBuffer.wrap = function(buffer, encoding, littleEndian, noAssert) {
  8798. if (typeof encoding !== 'string') {
  8799. noAssert = littleEndian;
  8800. littleEndian = encoding;
  8801. encoding = undefined;
  8802. }
  8803. if (typeof buffer === 'string') {
  8804. if (typeof encoding === 'undefined')
  8805. encoding = "utf8";
  8806. switch (encoding) {
  8807. case "base64":
  8808. return ByteBuffer.fromBase64(buffer, littleEndian);
  8809. case "hex":
  8810. return ByteBuffer.fromHex(buffer, littleEndian);
  8811. case "binary":
  8812. return ByteBuffer.fromBinary(buffer, littleEndian);
  8813. case "utf8":
  8814. return ByteBuffer.fromUTF8(buffer, littleEndian);
  8815. case "debug":
  8816. return ByteBuffer.fromDebug(buffer, littleEndian);
  8817. default:
  8818. throw Error("Unsupported encoding: "+encoding);
  8819. }
  8820. }
  8821. if (buffer === null || typeof buffer !== 'object')
  8822. throw TypeError("Illegal buffer");
  8823. var bb;
  8824. if (ByteBuffer.isByteBuffer(buffer)) {
  8825. bb = ByteBufferPrototype.clone.call(buffer);
  8826. bb.markedOffset = -1;
  8827. return bb;
  8828. }
  8829. if (buffer instanceof Uint8Array) { // Extract ArrayBuffer from Uint8Array
  8830. bb = new ByteBuffer(0, littleEndian, noAssert);
  8831. if (buffer.length > 0) { // Avoid references to more than one EMPTY_BUFFER
  8832. bb.buffer = buffer.buffer;
  8833. bb.offset = buffer.byteOffset;
  8834. bb.limit = buffer.byteOffset + buffer.length;
  8835. bb.view = buffer.length > 0 ? new DataView(buffer.buffer) : null;
  8836. }
  8837. } else if (buffer instanceof ArrayBuffer) { // Reuse ArrayBuffer
  8838. bb = new ByteBuffer(0, littleEndian, noAssert);
  8839. if (buffer.byteLength > 0) {
  8840. bb.buffer = buffer;
  8841. bb.offset = 0;
  8842. bb.limit = buffer.byteLength;
  8843. bb.view = buffer.byteLength > 0 ? new DataView(buffer) : null;
  8844. }
  8845. } else if (Object.prototype.toString.call(buffer) === "[object Array]") { // Create from octets
  8846. bb = new ByteBuffer(buffer.length, littleEndian, noAssert);
  8847. bb.limit = buffer.length;
  8848. for (i=0; i<buffer.length; ++i)
  8849. bb.view.setUint8(i, buffer[i]);
  8850. } else
  8851. throw TypeError("Illegal buffer"); // Otherwise fail
  8852. return bb;
  8853. };
  8854. // types/ints/int8
  8855. /**
  8856. * Writes an 8bit signed integer.
  8857. * @param {number} value Value to write
  8858. * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.
  8859. * @returns {!ByteBuffer} this
  8860. * @expose
  8861. */
  8862. ByteBufferPrototype.writeInt8 = function(value, offset) {
  8863. var relative = typeof offset === 'undefined';
  8864. if (relative) offset = this.offset;
  8865. if (!this.noAssert) {
  8866. if (typeof value !== 'number' || value % 1 !== 0)
  8867. throw TypeError("Illegal value: "+value+" (not an integer)");
  8868. value |= 0;
  8869. if (typeof offset !== 'number' || offset % 1 !== 0)
  8870. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  8871. offset >>>= 0;
  8872. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  8873. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  8874. }
  8875. offset += 1;
  8876. var capacity0 = this.buffer.byteLength;
  8877. if (offset > capacity0)
  8878. this.resize((capacity0 *= 2) > offset ? capacity0 : offset);
  8879. offset -= 1;
  8880. this.view.setInt8(offset, value);
  8881. if (relative) this.offset += 1;
  8882. return this;
  8883. };
  8884. /**
  8885. * Writes an 8bit signed integer. This is an alias of {@link ByteBuffer#writeInt8}.
  8886. * @function
  8887. * @param {number} value Value to write
  8888. * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.
  8889. * @returns {!ByteBuffer} this
  8890. * @expose
  8891. */
  8892. ByteBufferPrototype.writeByte = ByteBufferPrototype.writeInt8;
  8893. /**
  8894. * Reads an 8bit signed integer.
  8895. * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.
  8896. * @returns {number} Value read
  8897. * @expose
  8898. */
  8899. ByteBufferPrototype.readInt8 = function(offset) {
  8900. var relative = typeof offset === 'undefined';
  8901. if (relative) offset = this.offset;
  8902. if (!this.noAssert) {
  8903. if (typeof offset !== 'number' || offset % 1 !== 0)
  8904. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  8905. offset >>>= 0;
  8906. if (offset < 0 || offset + 1 > this.buffer.byteLength)
  8907. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
  8908. }
  8909. var value = this.view.getInt8(offset);
  8910. if (relative) this.offset += 1;
  8911. return value;
  8912. };
  8913. /**
  8914. * Reads an 8bit signed integer. This is an alias of {@link ByteBuffer#readInt8}.
  8915. * @function
  8916. * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.
  8917. * @returns {number} Value read
  8918. * @expose
  8919. */
  8920. ByteBufferPrototype.readByte = ByteBufferPrototype.readInt8;
  8921. /**
  8922. * Writes an 8bit unsigned integer.
  8923. * @param {number} value Value to write
  8924. * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.
  8925. * @returns {!ByteBuffer} this
  8926. * @expose
  8927. */
  8928. ByteBufferPrototype.writeUint8 = function(value, offset) {
  8929. var relative = typeof offset === 'undefined';
  8930. if (relative) offset = this.offset;
  8931. if (!this.noAssert) {
  8932. if (typeof value !== 'number' || value % 1 !== 0)
  8933. throw TypeError("Illegal value: "+value+" (not an integer)");
  8934. value >>>= 0;
  8935. if (typeof offset !== 'number' || offset % 1 !== 0)
  8936. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  8937. offset >>>= 0;
  8938. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  8939. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  8940. }
  8941. offset += 1;
  8942. var capacity1 = this.buffer.byteLength;
  8943. if (offset > capacity1)
  8944. this.resize((capacity1 *= 2) > offset ? capacity1 : offset);
  8945. offset -= 1;
  8946. this.view.setUint8(offset, value);
  8947. if (relative) this.offset += 1;
  8948. return this;
  8949. };
  8950. /**
  8951. * Reads an 8bit unsigned integer.
  8952. * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.
  8953. * @returns {number} Value read
  8954. * @expose
  8955. */
  8956. ByteBufferPrototype.readUint8 = function(offset) {
  8957. var relative = typeof offset === 'undefined';
  8958. if (relative) offset = this.offset;
  8959. if (!this.noAssert) {
  8960. if (typeof offset !== 'number' || offset % 1 !== 0)
  8961. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  8962. offset >>>= 0;
  8963. if (offset < 0 || offset + 1 > this.buffer.byteLength)
  8964. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
  8965. }
  8966. var value = this.view.getUint8(offset);
  8967. if (relative) this.offset += 1;
  8968. return value;
  8969. };
  8970. // types/ints/int16
  8971. /**
  8972. * Writes a 16bit signed integer.
  8973. * @param {number} value Value to write
  8974. * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.
  8975. * @throws {TypeError} If `offset` or `value` is not a valid number
  8976. * @throws {RangeError} If `offset` is out of bounds
  8977. * @expose
  8978. */
  8979. ByteBufferPrototype.writeInt16 = function(value, offset) {
  8980. var relative = typeof offset === 'undefined';
  8981. if (relative) offset = this.offset;
  8982. if (!this.noAssert) {
  8983. if (typeof value !== 'number' || value % 1 !== 0)
  8984. throw TypeError("Illegal value: "+value+" (not an integer)");
  8985. value |= 0;
  8986. if (typeof offset !== 'number' || offset % 1 !== 0)
  8987. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  8988. offset >>>= 0;
  8989. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  8990. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  8991. }
  8992. offset += 2;
  8993. var capacity2 = this.buffer.byteLength;
  8994. if (offset > capacity2)
  8995. this.resize((capacity2 *= 2) > offset ? capacity2 : offset);
  8996. offset -= 2;
  8997. this.view.setInt16(offset, value, this.littleEndian);
  8998. if (relative) this.offset += 2;
  8999. return this;
  9000. };
  9001. /**
  9002. * Writes a 16bit signed integer. This is an alias of {@link ByteBuffer#writeInt16}.
  9003. * @function
  9004. * @param {number} value Value to write
  9005. * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.
  9006. * @throws {TypeError} If `offset` or `value` is not a valid number
  9007. * @throws {RangeError} If `offset` is out of bounds
  9008. * @expose
  9009. */
  9010. ByteBufferPrototype.writeShort = ByteBufferPrototype.writeInt16;
  9011. /**
  9012. * Reads a 16bit signed integer.
  9013. * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.
  9014. * @returns {number} Value read
  9015. * @throws {TypeError} If `offset` is not a valid number
  9016. * @throws {RangeError} If `offset` is out of bounds
  9017. * @expose
  9018. */
  9019. ByteBufferPrototype.readInt16 = function(offset) {
  9020. var relative = typeof offset === 'undefined';
  9021. if (relative) offset = this.offset;
  9022. if (!this.noAssert) {
  9023. if (typeof offset !== 'number' || offset % 1 !== 0)
  9024. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9025. offset >>>= 0;
  9026. if (offset < 0 || offset + 2 > this.buffer.byteLength)
  9027. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+2+") <= "+this.buffer.byteLength);
  9028. }
  9029. var value = this.view.getInt16(offset, this.littleEndian);
  9030. if (relative) this.offset += 2;
  9031. return value;
  9032. };
  9033. /**
  9034. * Reads a 16bit signed integer. This is an alias of {@link ByteBuffer#readInt16}.
  9035. * @function
  9036. * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.
  9037. * @returns {number} Value read
  9038. * @throws {TypeError} If `offset` is not a valid number
  9039. * @throws {RangeError} If `offset` is out of bounds
  9040. * @expose
  9041. */
  9042. ByteBufferPrototype.readShort = ByteBufferPrototype.readInt16;
  9043. /**
  9044. * Writes a 16bit unsigned integer.
  9045. * @param {number} value Value to write
  9046. * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.
  9047. * @throws {TypeError} If `offset` or `value` is not a valid number
  9048. * @throws {RangeError} If `offset` is out of bounds
  9049. * @expose
  9050. */
  9051. ByteBufferPrototype.writeUint16 = function(value, offset) {
  9052. var relative = typeof offset === 'undefined';
  9053. if (relative) offset = this.offset;
  9054. if (!this.noAssert) {
  9055. if (typeof value !== 'number' || value % 1 !== 0)
  9056. throw TypeError("Illegal value: "+value+" (not an integer)");
  9057. value >>>= 0;
  9058. if (typeof offset !== 'number' || offset % 1 !== 0)
  9059. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9060. offset >>>= 0;
  9061. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  9062. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  9063. }
  9064. offset += 2;
  9065. var capacity3 = this.buffer.byteLength;
  9066. if (offset > capacity3)
  9067. this.resize((capacity3 *= 2) > offset ? capacity3 : offset);
  9068. offset -= 2;
  9069. this.view.setUint16(offset, value, this.littleEndian);
  9070. if (relative) this.offset += 2;
  9071. return this;
  9072. };
  9073. /**
  9074. * Reads a 16bit unsigned integer.
  9075. * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.
  9076. * @returns {number} Value read
  9077. * @throws {TypeError} If `offset` is not a valid number
  9078. * @throws {RangeError} If `offset` is out of bounds
  9079. * @expose
  9080. */
  9081. ByteBufferPrototype.readUint16 = function(offset) {
  9082. var relative = typeof offset === 'undefined';
  9083. if (relative) offset = this.offset;
  9084. if (!this.noAssert) {
  9085. if (typeof offset !== 'number' || offset % 1 !== 0)
  9086. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9087. offset >>>= 0;
  9088. if (offset < 0 || offset + 2 > this.buffer.byteLength)
  9089. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+2+") <= "+this.buffer.byteLength);
  9090. }
  9091. var value = this.view.getUint16(offset, this.littleEndian);
  9092. if (relative) this.offset += 2;
  9093. return value;
  9094. };
  9095. // types/ints/int32
  9096. /**
  9097. * Writes a 32bit signed integer.
  9098. * @param {number} value Value to write
  9099. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.
  9100. * @expose
  9101. */
  9102. ByteBufferPrototype.writeInt32 = function(value, offset) {
  9103. var relative = typeof offset === 'undefined';
  9104. if (relative) offset = this.offset;
  9105. if (!this.noAssert) {
  9106. if (typeof value !== 'number' || value % 1 !== 0)
  9107. throw TypeError("Illegal value: "+value+" (not an integer)");
  9108. value |= 0;
  9109. if (typeof offset !== 'number' || offset % 1 !== 0)
  9110. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9111. offset >>>= 0;
  9112. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  9113. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  9114. }
  9115. offset += 4;
  9116. var capacity4 = this.buffer.byteLength;
  9117. if (offset > capacity4)
  9118. this.resize((capacity4 *= 2) > offset ? capacity4 : offset);
  9119. offset -= 4;
  9120. this.view.setInt32(offset, value, this.littleEndian);
  9121. if (relative) this.offset += 4;
  9122. return this;
  9123. };
  9124. /**
  9125. * Writes a 32bit signed integer. This is an alias of {@link ByteBuffer#writeInt32}.
  9126. * @param {number} value Value to write
  9127. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.
  9128. * @expose
  9129. */
  9130. ByteBufferPrototype.writeInt = ByteBufferPrototype.writeInt32;
  9131. /**
  9132. * Reads a 32bit signed integer.
  9133. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.
  9134. * @returns {number} Value read
  9135. * @expose
  9136. */
  9137. ByteBufferPrototype.readInt32 = function(offset) {
  9138. var relative = typeof offset === 'undefined';
  9139. if (relative) offset = this.offset;
  9140. if (!this.noAssert) {
  9141. if (typeof offset !== 'number' || offset % 1 !== 0)
  9142. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9143. offset >>>= 0;
  9144. if (offset < 0 || offset + 4 > this.buffer.byteLength)
  9145. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
  9146. }
  9147. var value = this.view.getInt32(offset, this.littleEndian);
  9148. if (relative) this.offset += 4;
  9149. return value;
  9150. };
  9151. /**
  9152. * Reads a 32bit signed integer. This is an alias of {@link ByteBuffer#readInt32}.
  9153. * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `4` if omitted.
  9154. * @returns {number} Value read
  9155. * @expose
  9156. */
  9157. ByteBufferPrototype.readInt = ByteBufferPrototype.readInt32;
  9158. /**
  9159. * Writes a 32bit unsigned integer.
  9160. * @param {number} value Value to write
  9161. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.
  9162. * @expose
  9163. */
  9164. ByteBufferPrototype.writeUint32 = function(value, offset) {
  9165. var relative = typeof offset === 'undefined';
  9166. if (relative) offset = this.offset;
  9167. if (!this.noAssert) {
  9168. if (typeof value !== 'number' || value % 1 !== 0)
  9169. throw TypeError("Illegal value: "+value+" (not an integer)");
  9170. value >>>= 0;
  9171. if (typeof offset !== 'number' || offset % 1 !== 0)
  9172. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9173. offset >>>= 0;
  9174. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  9175. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  9176. }
  9177. offset += 4;
  9178. var capacity5 = this.buffer.byteLength;
  9179. if (offset > capacity5)
  9180. this.resize((capacity5 *= 2) > offset ? capacity5 : offset);
  9181. offset -= 4;
  9182. this.view.setUint32(offset, value, this.littleEndian);
  9183. if (relative) this.offset += 4;
  9184. return this;
  9185. };
  9186. /**
  9187. * Reads a 32bit unsigned integer.
  9188. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.
  9189. * @returns {number} Value read
  9190. * @expose
  9191. */
  9192. ByteBufferPrototype.readUint32 = function(offset) {
  9193. var relative = typeof offset === 'undefined';
  9194. if (relative) offset = this.offset;
  9195. if (!this.noAssert) {
  9196. if (typeof offset !== 'number' || offset % 1 !== 0)
  9197. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9198. offset >>>= 0;
  9199. if (offset < 0 || offset + 4 > this.buffer.byteLength)
  9200. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
  9201. }
  9202. var value = this.view.getUint32(offset, this.littleEndian);
  9203. if (relative) this.offset += 4;
  9204. return value;
  9205. };
  9206. // types/ints/int64
  9207. if (Long) {
  9208. /**
  9209. * Writes a 64bit signed integer.
  9210. * @param {number|!Long} value Value to write
  9211. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.
  9212. * @returns {!ByteBuffer} this
  9213. * @expose
  9214. */
  9215. ByteBufferPrototype.writeInt64 = function(value, offset) {
  9216. var relative = typeof offset === 'undefined';
  9217. if (relative) offset = this.offset;
  9218. if (!this.noAssert) {
  9219. if (typeof value === 'number')
  9220. value = Long.fromNumber(value);
  9221. else if (!(value && value instanceof Long))
  9222. throw TypeError("Illegal value: "+value+" (not an integer or Long)");
  9223. if (typeof offset !== 'number' || offset % 1 !== 0)
  9224. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9225. offset >>>= 0;
  9226. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  9227. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  9228. }
  9229. if (typeof value === 'number')
  9230. value = Long.fromNumber(value);
  9231. offset += 8;
  9232. var capacity6 = this.buffer.byteLength;
  9233. if (offset > capacity6)
  9234. this.resize((capacity6 *= 2) > offset ? capacity6 : offset);
  9235. offset -= 8;
  9236. if (this.littleEndian) {
  9237. this.view.setInt32(offset , value.low , true);
  9238. this.view.setInt32(offset+4, value.high, true);
  9239. } else {
  9240. this.view.setInt32(offset , value.high, false);
  9241. this.view.setInt32(offset+4, value.low , false);
  9242. }
  9243. if (relative) this.offset += 8;
  9244. return this;
  9245. };
  9246. /**
  9247. * Writes a 64bit signed integer. This is an alias of {@link ByteBuffer#writeInt64}.
  9248. * @param {number|!Long} value Value to write
  9249. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.
  9250. * @returns {!ByteBuffer} this
  9251. * @expose
  9252. */
  9253. ByteBufferPrototype.writeLong = ByteBufferPrototype.writeInt64;
  9254. /**
  9255. * Reads a 64bit signed integer.
  9256. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.
  9257. * @returns {!Long}
  9258. * @expose
  9259. */
  9260. ByteBufferPrototype.readInt64 = function(offset) {
  9261. var relative = typeof offset === 'undefined';
  9262. if (relative) offset = this.offset;
  9263. if (!this.noAssert) {
  9264. if (typeof offset !== 'number' || offset % 1 !== 0)
  9265. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9266. offset >>>= 0;
  9267. if (offset < 0 || offset + 8 > this.buffer.byteLength)
  9268. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength);
  9269. }
  9270. var value = this.littleEndian
  9271. ? new Long(this.view.getInt32(offset , true ), this.view.getInt32(offset+4, true ), false)
  9272. : new Long(this.view.getInt32(offset+4, false), this.view.getInt32(offset , false), false);
  9273. if (relative) this.offset += 8;
  9274. return value;
  9275. };
  9276. /**
  9277. * Reads a 64bit signed integer. This is an alias of {@link ByteBuffer#readInt64}.
  9278. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.
  9279. * @returns {!Long}
  9280. * @expose
  9281. */
  9282. ByteBufferPrototype.readLong = ByteBufferPrototype.readInt64;
  9283. /**
  9284. * Writes a 64bit unsigned integer.
  9285. * @param {number|!Long} value Value to write
  9286. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.
  9287. * @returns {!ByteBuffer} this
  9288. * @expose
  9289. */
  9290. ByteBufferPrototype.writeUint64 = function(value, offset) {
  9291. var relative = typeof offset === 'undefined';
  9292. if (relative) offset = this.offset;
  9293. if (!this.noAssert) {
  9294. if (typeof value === 'number')
  9295. value = Long.fromNumber(value);
  9296. else if (!(value && value instanceof Long))
  9297. throw TypeError("Illegal value: "+value+" (not an integer or Long)");
  9298. if (typeof offset !== 'number' || offset % 1 !== 0)
  9299. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9300. offset >>>= 0;
  9301. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  9302. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  9303. }
  9304. if (typeof value === 'number')
  9305. value = Long.fromNumber(value);
  9306. offset += 8;
  9307. var capacity7 = this.buffer.byteLength;
  9308. if (offset > capacity7)
  9309. this.resize((capacity7 *= 2) > offset ? capacity7 : offset);
  9310. offset -= 8;
  9311. if (this.littleEndian) {
  9312. this.view.setInt32(offset , value.low , true);
  9313. this.view.setInt32(offset+4, value.high, true);
  9314. } else {
  9315. this.view.setInt32(offset , value.high, false);
  9316. this.view.setInt32(offset+4, value.low , false);
  9317. }
  9318. if (relative) this.offset += 8;
  9319. return this;
  9320. };
  9321. /**
  9322. * Reads a 64bit unsigned integer.
  9323. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.
  9324. * @returns {!Long}
  9325. * @expose
  9326. */
  9327. ByteBufferPrototype.readUint64 = function(offset) {
  9328. var relative = typeof offset === 'undefined';
  9329. if (relative) offset = this.offset;
  9330. if (!this.noAssert) {
  9331. if (typeof offset !== 'number' || offset % 1 !== 0)
  9332. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9333. offset >>>= 0;
  9334. if (offset < 0 || offset + 8 > this.buffer.byteLength)
  9335. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength);
  9336. }
  9337. var value = this.littleEndian
  9338. ? new Long(this.view.getInt32(offset , true ), this.view.getInt32(offset+4, true ), true)
  9339. : new Long(this.view.getInt32(offset+4, false), this.view.getInt32(offset , false), true);
  9340. if (relative) this.offset += 8;
  9341. return value;
  9342. };
  9343. } // Long
  9344. // types/floats/float32
  9345. /**
  9346. * Writes a 32bit float.
  9347. * @param {number} value Value to write
  9348. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.
  9349. * @returns {!ByteBuffer} this
  9350. * @expose
  9351. */
  9352. ByteBufferPrototype.writeFloat32 = function(value, offset) {
  9353. var relative = typeof offset === 'undefined';
  9354. if (relative) offset = this.offset;
  9355. if (!this.noAssert) {
  9356. if (typeof value !== 'number')
  9357. throw TypeError("Illegal value: "+value+" (not a number)");
  9358. if (typeof offset !== 'number' || offset % 1 !== 0)
  9359. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9360. offset >>>= 0;
  9361. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  9362. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  9363. }
  9364. offset += 4;
  9365. var capacity8 = this.buffer.byteLength;
  9366. if (offset > capacity8)
  9367. this.resize((capacity8 *= 2) > offset ? capacity8 : offset);
  9368. offset -= 4;
  9369. this.view.setFloat32(offset, value, this.littleEndian);
  9370. if (relative) this.offset += 4;
  9371. return this;
  9372. };
  9373. /**
  9374. * Writes a 32bit float. This is an alias of {@link ByteBuffer#writeFloat32}.
  9375. * @function
  9376. * @param {number} value Value to write
  9377. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.
  9378. * @returns {!ByteBuffer} this
  9379. * @expose
  9380. */
  9381. ByteBufferPrototype.writeFloat = ByteBufferPrototype.writeFloat32;
  9382. /**
  9383. * Reads a 32bit float.
  9384. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.
  9385. * @returns {number}
  9386. * @expose
  9387. */
  9388. ByteBufferPrototype.readFloat32 = function(offset) {
  9389. var relative = typeof offset === 'undefined';
  9390. if (relative) offset = this.offset;
  9391. if (!this.noAssert) {
  9392. if (typeof offset !== 'number' || offset % 1 !== 0)
  9393. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9394. offset >>>= 0;
  9395. if (offset < 0 || offset + 4 > this.buffer.byteLength)
  9396. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
  9397. }
  9398. var value = this.view.getFloat32(offset, this.littleEndian);
  9399. if (relative) this.offset += 4;
  9400. return value;
  9401. };
  9402. /**
  9403. * Reads a 32bit float. This is an alias of {@link ByteBuffer#readFloat32}.
  9404. * @function
  9405. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.
  9406. * @returns {number}
  9407. * @expose
  9408. */
  9409. ByteBufferPrototype.readFloat = ByteBufferPrototype.readFloat32;
  9410. // types/floats/float64
  9411. /**
  9412. * Writes a 64bit float.
  9413. * @param {number} value Value to write
  9414. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.
  9415. * @returns {!ByteBuffer} this
  9416. * @expose
  9417. */
  9418. ByteBufferPrototype.writeFloat64 = function(value, offset) {
  9419. var relative = typeof offset === 'undefined';
  9420. if (relative) offset = this.offset;
  9421. if (!this.noAssert) {
  9422. if (typeof value !== 'number')
  9423. throw TypeError("Illegal value: "+value+" (not a number)");
  9424. if (typeof offset !== 'number' || offset % 1 !== 0)
  9425. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9426. offset >>>= 0;
  9427. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  9428. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  9429. }
  9430. offset += 8;
  9431. var capacity9 = this.buffer.byteLength;
  9432. if (offset > capacity9)
  9433. this.resize((capacity9 *= 2) > offset ? capacity9 : offset);
  9434. offset -= 8;
  9435. this.view.setFloat64(offset, value, this.littleEndian);
  9436. if (relative) this.offset += 8;
  9437. return this;
  9438. };
  9439. /**
  9440. * Writes a 64bit float. This is an alias of {@link ByteBuffer#writeFloat64}.
  9441. * @function
  9442. * @param {number} value Value to write
  9443. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.
  9444. * @returns {!ByteBuffer} this
  9445. * @expose
  9446. */
  9447. ByteBufferPrototype.writeDouble = ByteBufferPrototype.writeFloat64;
  9448. /**
  9449. * Reads a 64bit float.
  9450. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.
  9451. * @returns {number}
  9452. * @expose
  9453. */
  9454. ByteBufferPrototype.readFloat64 = function(offset) {
  9455. var relative = typeof offset === 'undefined';
  9456. if (relative) offset = this.offset;
  9457. if (!this.noAssert) {
  9458. if (typeof offset !== 'number' || offset % 1 !== 0)
  9459. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9460. offset >>>= 0;
  9461. if (offset < 0 || offset + 8 > this.buffer.byteLength)
  9462. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength);
  9463. }
  9464. var value = this.view.getFloat64(offset, this.littleEndian);
  9465. if (relative) this.offset += 8;
  9466. return value;
  9467. };
  9468. /**
  9469. * Reads a 64bit float. This is an alias of {@link ByteBuffer#readFloat64}.
  9470. * @function
  9471. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.
  9472. * @returns {number}
  9473. * @expose
  9474. */
  9475. ByteBufferPrototype.readDouble = ByteBufferPrototype.readFloat64;
  9476. // types/varints/varint32
  9477. /**
  9478. * Maximum number of bytes required to store a 32bit base 128 variable-length integer.
  9479. * @type {number}
  9480. * @const
  9481. * @expose
  9482. */
  9483. ByteBuffer.MAX_VARINT32_BYTES = 5;
  9484. /**
  9485. * Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer.
  9486. * @param {number} value Value to encode
  9487. * @returns {number} Number of bytes required. Capped to {@link ByteBuffer.MAX_VARINT32_BYTES}
  9488. * @expose
  9489. */
  9490. ByteBuffer.calculateVarint32 = function(value) {
  9491. // ref: src/google/protobuf/io/coded_stream.cc
  9492. value = value >>> 0;
  9493. if (value < 1 << 7 ) return 1;
  9494. else if (value < 1 << 14) return 2;
  9495. else if (value < 1 << 21) return 3;
  9496. else if (value < 1 << 28) return 4;
  9497. else return 5;
  9498. };
  9499. /**
  9500. * Zigzag encodes a signed 32bit integer so that it can be effectively used with varint encoding.
  9501. * @param {number} n Signed 32bit integer
  9502. * @returns {number} Unsigned zigzag encoded 32bit integer
  9503. * @expose
  9504. */
  9505. ByteBuffer.zigZagEncode32 = function(n) {
  9506. return (((n |= 0) << 1) ^ (n >> 31)) >>> 0; // ref: src/google/protobuf/wire_format_lite.h
  9507. };
  9508. /**
  9509. * Decodes a zigzag encoded signed 32bit integer.
  9510. * @param {number} n Unsigned zigzag encoded 32bit integer
  9511. * @returns {number} Signed 32bit integer
  9512. * @expose
  9513. */
  9514. ByteBuffer.zigZagDecode32 = function(n) {
  9515. return ((n >>> 1) ^ -(n & 1)) | 0; // // ref: src/google/protobuf/wire_format_lite.h
  9516. };
  9517. /**
  9518. * Writes a 32bit base 128 variable-length integer.
  9519. * @param {number} value Value to write
  9520. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  9521. * written if omitted.
  9522. * @returns {!ByteBuffer|number} this if `offset` is omitted, else the actual number of bytes written
  9523. * @expose
  9524. */
  9525. ByteBufferPrototype.writeVarint32 = function(value, offset) {
  9526. var relative = typeof offset === 'undefined';
  9527. if (relative) offset = this.offset;
  9528. if (!this.noAssert) {
  9529. if (typeof value !== 'number' || value % 1 !== 0)
  9530. throw TypeError("Illegal value: "+value+" (not an integer)");
  9531. value |= 0;
  9532. if (typeof offset !== 'number' || offset % 1 !== 0)
  9533. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9534. offset >>>= 0;
  9535. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  9536. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  9537. }
  9538. var size = ByteBuffer.calculateVarint32(value),
  9539. b;
  9540. offset += size;
  9541. var capacity10 = this.buffer.byteLength;
  9542. if (offset > capacity10)
  9543. this.resize((capacity10 *= 2) > offset ? capacity10 : offset);
  9544. offset -= size;
  9545. // ref: http://code.google.com/searchframe#WTeibokF6gE/trunk/src/google/protobuf/io/coded_stream.cc
  9546. this.view.setUint8(offset, b = value | 0x80);
  9547. value >>>= 0;
  9548. if (value >= 1 << 7) {
  9549. b = (value >> 7) | 0x80;
  9550. this.view.setUint8(offset+1, b);
  9551. if (value >= 1 << 14) {
  9552. b = (value >> 14) | 0x80;
  9553. this.view.setUint8(offset+2, b);
  9554. if (value >= 1 << 21) {
  9555. b = (value >> 21) | 0x80;
  9556. this.view.setUint8(offset+3, b);
  9557. if (value >= 1 << 28) {
  9558. this.view.setUint8(offset+4, (value >> 28) & 0x0F);
  9559. size = 5;
  9560. } else {
  9561. this.view.setUint8(offset+3, b & 0x7F);
  9562. size = 4;
  9563. }
  9564. } else {
  9565. this.view.setUint8(offset+2, b & 0x7F);
  9566. size = 3;
  9567. }
  9568. } else {
  9569. this.view.setUint8(offset+1, b & 0x7F);
  9570. size = 2;
  9571. }
  9572. } else {
  9573. this.view.setUint8(offset, b & 0x7F);
  9574. size = 1;
  9575. }
  9576. if (relative) {
  9577. this.offset += size;
  9578. return this;
  9579. }
  9580. return size;
  9581. };
  9582. /**
  9583. * Writes a zig-zag encoded 32bit base 128 variable-length integer.
  9584. * @param {number} value Value to write
  9585. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  9586. * written if omitted.
  9587. * @returns {!ByteBuffer|number} this if `offset` is omitted, else the actual number of bytes written
  9588. * @expose
  9589. */
  9590. ByteBufferPrototype.writeVarint32ZigZag = function(value, offset) {
  9591. return this.writeVarint32(ByteBuffer.zigZagEncode32(value), offset);
  9592. };
  9593. /**
  9594. * Reads a 32bit base 128 variable-length integer.
  9595. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  9596. * written if omitted.
  9597. * @returns {number|!{value: number, length: number}} The value read if offset is omitted, else the value read
  9598. * and the actual number of bytes read.
  9599. * @throws {Error} If it's not a valid varint. Has a property `truncated = true` if there is not enough data available
  9600. * to fully decode the varint.
  9601. * @expose
  9602. */
  9603. ByteBufferPrototype.readVarint32 = function(offset) {
  9604. var relative = typeof offset === 'undefined';
  9605. if (relative) offset = this.offset;
  9606. if (!this.noAssert) {
  9607. if (typeof offset !== 'number' || offset % 1 !== 0)
  9608. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9609. offset >>>= 0;
  9610. if (offset < 0 || offset + 1 > this.buffer.byteLength)
  9611. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
  9612. }
  9613. // ref: src/google/protobuf/io/coded_stream.cc
  9614. var size = 0,
  9615. value = 0 >>> 0,
  9616. temp,
  9617. ioffset;
  9618. do {
  9619. ioffset = offset+size;
  9620. if (!this.noAssert && ioffset > this.limit) {
  9621. var err = Error("Truncated");
  9622. err['truncated'] = true;
  9623. throw err;
  9624. }
  9625. temp = this.view.getUint8(ioffset);
  9626. if (size < 5)
  9627. value |= ((temp&0x7F)<<(7*size)) >>> 0;
  9628. ++size;
  9629. } while ((temp & 0x80) === 0x80);
  9630. value = value | 0; // Make sure to discard the higher order bits
  9631. if (relative) {
  9632. this.offset += size;
  9633. return value;
  9634. }
  9635. return {
  9636. "value": value,
  9637. "length": size
  9638. };
  9639. };
  9640. /**
  9641. * Reads a zig-zag encoded 32bit base 128 variable-length integer.
  9642. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  9643. * written if omitted.
  9644. * @returns {number|!{value: number, length: number}} The value read if offset is omitted, else the value read
  9645. * and the actual number of bytes read.
  9646. * @throws {Error} If it's not a valid varint
  9647. * @expose
  9648. */
  9649. ByteBufferPrototype.readVarint32ZigZag = function(offset) {
  9650. var val = this.readVarint32(offset);
  9651. if (typeof val === 'object')
  9652. val["value"] = ByteBuffer.zigZagDecode32(val["value"]);
  9653. else
  9654. val = ByteBuffer.zigZagDecode32(val);
  9655. return val;
  9656. };
  9657. // types/varints/varint64
  9658. if (Long) {
  9659. /**
  9660. * Maximum number of bytes required to store a 64bit base 128 variable-length integer.
  9661. * @type {number}
  9662. * @const
  9663. * @expose
  9664. */
  9665. ByteBuffer.MAX_VARINT64_BYTES = 10;
  9666. /**
  9667. * Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer.
  9668. * @param {number|!Long} value Value to encode
  9669. * @returns {number} Number of bytes required. Capped to {@link ByteBuffer.MAX_VARINT64_BYTES}
  9670. * @expose
  9671. */
  9672. ByteBuffer.calculateVarint64 = function(value) {
  9673. if (typeof value === 'number')
  9674. value = Long.fromNumber(value);
  9675. // ref: src/google/protobuf/io/coded_stream.cc
  9676. var part0 = value.toInt() >>> 0,
  9677. part1 = value.shiftRightUnsigned(28).toInt() >>> 0,
  9678. part2 = value.shiftRightUnsigned(56).toInt() >>> 0;
  9679. if (part2 == 0) {
  9680. if (part1 == 0) {
  9681. if (part0 < 1 << 14)
  9682. return part0 < 1 << 7 ? 1 : 2;
  9683. else
  9684. return part0 < 1 << 21 ? 3 : 4;
  9685. } else {
  9686. if (part1 < 1 << 14)
  9687. return part1 < 1 << 7 ? 5 : 6;
  9688. else
  9689. return part1 < 1 << 21 ? 7 : 8;
  9690. }
  9691. } else
  9692. return part2 < 1 << 7 ? 9 : 10;
  9693. };
  9694. /**
  9695. * Zigzag encodes a signed 64bit integer so that it can be effectively used with varint encoding.
  9696. * @param {number|!Long} value Signed long
  9697. * @returns {!Long} Unsigned zigzag encoded long
  9698. * @expose
  9699. */
  9700. ByteBuffer.zigZagEncode64 = function(value) {
  9701. if (typeof value === 'number')
  9702. value = Long.fromNumber(value, false);
  9703. else if (value.unsigned !== false) value = value.toSigned();
  9704. // ref: src/google/protobuf/wire_format_lite.h
  9705. return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned();
  9706. };
  9707. /**
  9708. * Decodes a zigzag encoded signed 64bit integer.
  9709. * @param {!Long|number} value Unsigned zigzag encoded long or JavaScript number
  9710. * @returns {!Long} Signed long
  9711. * @expose
  9712. */
  9713. ByteBuffer.zigZagDecode64 = function(value) {
  9714. if (typeof value === 'number')
  9715. value = Long.fromNumber(value, false);
  9716. else if (value.unsigned !== false) value = value.toSigned();
  9717. // ref: src/google/protobuf/wire_format_lite.h
  9718. return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned();
  9719. };
  9720. /**
  9721. * Writes a 64bit base 128 variable-length integer.
  9722. * @param {number|Long} value Value to write
  9723. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  9724. * written if omitted.
  9725. * @returns {!ByteBuffer|number} `this` if offset is omitted, else the actual number of bytes written.
  9726. * @expose
  9727. */
  9728. ByteBufferPrototype.writeVarint64 = function(value, offset) {
  9729. var relative = typeof offset === 'undefined';
  9730. if (relative) offset = this.offset;
  9731. if (!this.noAssert) {
  9732. if (typeof value === 'number')
  9733. value = Long.fromNumber(value);
  9734. else if (!(value && value instanceof Long))
  9735. throw TypeError("Illegal value: "+value+" (not an integer or Long)");
  9736. if (typeof offset !== 'number' || offset % 1 !== 0)
  9737. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9738. offset >>>= 0;
  9739. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  9740. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  9741. }
  9742. if (typeof value === 'number')
  9743. value = Long.fromNumber(value, false);
  9744. else if (value.unsigned !== false) value = value.toSigned();
  9745. var size = ByteBuffer.calculateVarint64(value),
  9746. part0 = value.toInt() >>> 0,
  9747. part1 = value.shiftRightUnsigned(28).toInt() >>> 0,
  9748. part2 = value.shiftRightUnsigned(56).toInt() >>> 0;
  9749. offset += size;
  9750. var capacity11 = this.buffer.byteLength;
  9751. if (offset > capacity11)
  9752. this.resize((capacity11 *= 2) > offset ? capacity11 : offset);
  9753. offset -= size;
  9754. switch (size) {
  9755. case 10: this.view.setUint8(offset+9, (part2 >>> 7) & 0x01);
  9756. case 9 : this.view.setUint8(offset+8, size !== 9 ? (part2 ) | 0x80 : (part2 ) & 0x7F);
  9757. case 8 : this.view.setUint8(offset+7, size !== 8 ? (part1 >>> 21) | 0x80 : (part1 >>> 21) & 0x7F);
  9758. case 7 : this.view.setUint8(offset+6, size !== 7 ? (part1 >>> 14) | 0x80 : (part1 >>> 14) & 0x7F);
  9759. case 6 : this.view.setUint8(offset+5, size !== 6 ? (part1 >>> 7) | 0x80 : (part1 >>> 7) & 0x7F);
  9760. case 5 : this.view.setUint8(offset+4, size !== 5 ? (part1 ) | 0x80 : (part1 ) & 0x7F);
  9761. case 4 : this.view.setUint8(offset+3, size !== 4 ? (part0 >>> 21) | 0x80 : (part0 >>> 21) & 0x7F);
  9762. case 3 : this.view.setUint8(offset+2, size !== 3 ? (part0 >>> 14) | 0x80 : (part0 >>> 14) & 0x7F);
  9763. case 2 : this.view.setUint8(offset+1, size !== 2 ? (part0 >>> 7) | 0x80 : (part0 >>> 7) & 0x7F);
  9764. case 1 : this.view.setUint8(offset , size !== 1 ? (part0 ) | 0x80 : (part0 ) & 0x7F);
  9765. }
  9766. if (relative) {
  9767. this.offset += size;
  9768. return this;
  9769. } else {
  9770. return size;
  9771. }
  9772. };
  9773. /**
  9774. * Writes a zig-zag encoded 64bit base 128 variable-length integer.
  9775. * @param {number|Long} value Value to write
  9776. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  9777. * written if omitted.
  9778. * @returns {!ByteBuffer|number} `this` if offset is omitted, else the actual number of bytes written.
  9779. * @expose
  9780. */
  9781. ByteBufferPrototype.writeVarint64ZigZag = function(value, offset) {
  9782. return this.writeVarint64(ByteBuffer.zigZagEncode64(value), offset);
  9783. };
  9784. /**
  9785. * Reads a 64bit base 128 variable-length integer. Requires Long.js.
  9786. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  9787. * read if omitted.
  9788. * @returns {!Long|!{value: Long, length: number}} The value read if offset is omitted, else the value read and
  9789. * the actual number of bytes read.
  9790. * @throws {Error} If it's not a valid varint
  9791. * @expose
  9792. */
  9793. ByteBufferPrototype.readVarint64 = function(offset) {
  9794. var relative = typeof offset === 'undefined';
  9795. if (relative) offset = this.offset;
  9796. if (!this.noAssert) {
  9797. if (typeof offset !== 'number' || offset % 1 !== 0)
  9798. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9799. offset >>>= 0;
  9800. if (offset < 0 || offset + 1 > this.buffer.byteLength)
  9801. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
  9802. }
  9803. // ref: src/google/protobuf/io/coded_stream.cc
  9804. var start = offset,
  9805. part0 = 0,
  9806. part1 = 0,
  9807. part2 = 0,
  9808. b = 0;
  9809. b = this.view.getUint8(offset++); part0 = (b & 0x7F) ; if (b & 0x80) {
  9810. b = this.view.getUint8(offset++); part0 |= (b & 0x7F) << 7; if (b & 0x80) {
  9811. b = this.view.getUint8(offset++); part0 |= (b & 0x7F) << 14; if (b & 0x80) {
  9812. b = this.view.getUint8(offset++); part0 |= (b & 0x7F) << 21; if (b & 0x80) {
  9813. b = this.view.getUint8(offset++); part1 = (b & 0x7F) ; if (b & 0x80) {
  9814. b = this.view.getUint8(offset++); part1 |= (b & 0x7F) << 7; if (b & 0x80) {
  9815. b = this.view.getUint8(offset++); part1 |= (b & 0x7F) << 14; if (b & 0x80) {
  9816. b = this.view.getUint8(offset++); part1 |= (b & 0x7F) << 21; if (b & 0x80) {
  9817. b = this.view.getUint8(offset++); part2 = (b & 0x7F) ; if (b & 0x80) {
  9818. b = this.view.getUint8(offset++); part2 |= (b & 0x7F) << 7; if (b & 0x80) {
  9819. throw Error("Buffer overrun"); }}}}}}}}}}
  9820. var value = Long.fromBits(part0 | (part1 << 28), (part1 >>> 4) | (part2) << 24, false);
  9821. if (relative) {
  9822. this.offset = offset;
  9823. return value;
  9824. } else {
  9825. return {
  9826. 'value': value,
  9827. 'length': offset-start
  9828. };
  9829. }
  9830. };
  9831. /**
  9832. * Reads a zig-zag encoded 64bit base 128 variable-length integer. Requires Long.js.
  9833. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  9834. * read if omitted.
  9835. * @returns {!Long|!{value: Long, length: number}} The value read if offset is omitted, else the value read and
  9836. * the actual number of bytes read.
  9837. * @throws {Error} If it's not a valid varint
  9838. * @expose
  9839. */
  9840. ByteBufferPrototype.readVarint64ZigZag = function(offset) {
  9841. var val = this.readVarint64(offset);
  9842. if (val && val['value'] instanceof Long)
  9843. val["value"] = ByteBuffer.zigZagDecode64(val["value"]);
  9844. else
  9845. val = ByteBuffer.zigZagDecode64(val);
  9846. return val;
  9847. };
  9848. } // Long
  9849. // types/strings/cstring
  9850. /**
  9851. * Writes a NULL-terminated UTF8 encoded string. For this to work the specified string must not contain any NULL
  9852. * characters itself.
  9853. * @param {string} str String to write
  9854. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  9855. * contained in `str` + 1 if omitted.
  9856. * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written
  9857. * @expose
  9858. */
  9859. ByteBufferPrototype.writeCString = function(str, offset) {
  9860. var relative = typeof offset === 'undefined';
  9861. if (relative) offset = this.offset;
  9862. var i,
  9863. k = str.length;
  9864. if (!this.noAssert) {
  9865. if (typeof str !== 'string')
  9866. throw TypeError("Illegal str: Not a string");
  9867. for (i=0; i<k; ++i) {
  9868. if (str.charCodeAt(i) === 0)
  9869. throw RangeError("Illegal str: Contains NULL-characters");
  9870. }
  9871. if (typeof offset !== 'number' || offset % 1 !== 0)
  9872. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9873. offset >>>= 0;
  9874. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  9875. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  9876. }
  9877. var start = offset;
  9878. // UTF8 strings do not contain zero bytes in between except for the zero character, so:
  9879. k = utfx.calculateUTF16asUTF8(stringSource(str))[1];
  9880. offset += k+1;
  9881. var capacity12 = this.buffer.byteLength;
  9882. if (offset > capacity12)
  9883. this.resize((capacity12 *= 2) > offset ? capacity12 : offset);
  9884. offset -= k+1;
  9885. utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
  9886. this.view.setUint8(offset++, b);
  9887. }.bind(this));
  9888. this.view.setUint8(offset++, 0);
  9889. if (relative) {
  9890. this.offset = offset - start;
  9891. return this;
  9892. }
  9893. return k;
  9894. };
  9895. /**
  9896. * Reads a NULL-terminated UTF8 encoded string. For this to work the string read must not contain any NULL characters
  9897. * itself.
  9898. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  9899. * read if omitted.
  9900. * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string
  9901. * read and the actual number of bytes read.
  9902. * @expose
  9903. */
  9904. ByteBufferPrototype.readCString = function(offset) {
  9905. var relative = typeof offset === 'undefined';
  9906. if (relative) offset = this.offset;
  9907. if (!this.noAssert) {
  9908. if (typeof offset !== 'number' || offset % 1 !== 0)
  9909. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9910. offset >>>= 0;
  9911. if (offset < 0 || offset + 1 > this.buffer.byteLength)
  9912. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
  9913. }
  9914. var start = offset,
  9915. temp;
  9916. // UTF8 strings do not contain zero bytes in between except for the zero character itself, so:
  9917. var sd, b = -1;
  9918. utfx.decodeUTF8toUTF16(function() {
  9919. if (b === 0) return null;
  9920. if (offset >= this.limit)
  9921. throw RangeError("Illegal range: Truncated data, "+offset+" < "+this.limit);
  9922. return (b = this.view.getUint8(offset++)) === 0 ? null : b;
  9923. }.bind(this), sd = stringDestination(), true);
  9924. if (relative) {
  9925. this.offset = offset;
  9926. return sd();
  9927. } else {
  9928. return {
  9929. "string": sd(),
  9930. "length": offset - start
  9931. };
  9932. }
  9933. };
  9934. // types/strings/istring
  9935. /**
  9936. * Writes a length as uint32 prefixed UTF8 encoded string.
  9937. * @param {string} str String to write
  9938. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  9939. * written if omitted.
  9940. * @returns {!ByteBuffer|number} `this` if `offset` is omitted, else the actual number of bytes written
  9941. * @expose
  9942. * @see ByteBuffer#writeVarint32
  9943. */
  9944. ByteBufferPrototype.writeIString = function(str, offset) {
  9945. var relative = typeof offset === 'undefined';
  9946. if (relative) offset = this.offset;
  9947. if (!this.noAssert) {
  9948. if (typeof str !== 'string')
  9949. throw TypeError("Illegal str: Not a string");
  9950. if (typeof offset !== 'number' || offset % 1 !== 0)
  9951. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9952. offset >>>= 0;
  9953. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  9954. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  9955. }
  9956. var start = offset,
  9957. k;
  9958. k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];
  9959. offset += 4+k;
  9960. var capacity13 = this.buffer.byteLength;
  9961. if (offset > capacity13)
  9962. this.resize((capacity13 *= 2) > offset ? capacity13 : offset);
  9963. offset -= 4+k;
  9964. this.view.setUint32(offset, k, this.littleEndian);
  9965. offset += 4;
  9966. utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
  9967. this.view.setUint8(offset++, b);
  9968. }.bind(this));
  9969. if (offset !== start + 4 + k)
  9970. throw RangeError("Illegal range: Truncated data, "+offset+" == "+(offset+4+k));
  9971. if (relative) {
  9972. this.offset = offset;
  9973. return this;
  9974. }
  9975. return offset - start;
  9976. };
  9977. /**
  9978. * Reads a length as uint32 prefixed UTF8 encoded string.
  9979. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  9980. * read if omitted.
  9981. * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string
  9982. * read and the actual number of bytes read.
  9983. * @expose
  9984. * @see ByteBuffer#readVarint32
  9985. */
  9986. ByteBufferPrototype.readIString = function(offset) {
  9987. var relative = typeof offset === 'undefined';
  9988. if (relative) offset = this.offset;
  9989. if (!this.noAssert) {
  9990. if (typeof offset !== 'number' || offset % 1 !== 0)
  9991. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  9992. offset >>>= 0;
  9993. if (offset < 0 || offset + 4 > this.buffer.byteLength)
  9994. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
  9995. }
  9996. var temp = 0,
  9997. start = offset,
  9998. str;
  9999. temp = this.view.getUint32(offset, this.littleEndian);
  10000. offset += 4;
  10001. var k = offset + temp,
  10002. sd;
  10003. utfx.decodeUTF8toUTF16(function() {
  10004. return offset < k ? this.view.getUint8(offset++) : null;
  10005. }.bind(this), sd = stringDestination(), this.noAssert);
  10006. str = sd();
  10007. if (relative) {
  10008. this.offset = offset;
  10009. return str;
  10010. } else {
  10011. return {
  10012. 'string': str,
  10013. 'length': offset - start
  10014. };
  10015. }
  10016. };
  10017. // types/strings/utf8string
  10018. /**
  10019. * Metrics representing number of UTF8 characters. Evaluates to `c`.
  10020. * @type {string}
  10021. * @const
  10022. * @expose
  10023. */
  10024. ByteBuffer.METRICS_CHARS = 'c';
  10025. /**
  10026. * Metrics representing number of bytes. Evaluates to `b`.
  10027. * @type {string}
  10028. * @const
  10029. * @expose
  10030. */
  10031. ByteBuffer.METRICS_BYTES = 'b';
  10032. /**
  10033. * Writes an UTF8 encoded string.
  10034. * @param {string} str String to write
  10035. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} if omitted.
  10036. * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written.
  10037. * @expose
  10038. */
  10039. ByteBufferPrototype.writeUTF8String = function(str, offset) {
  10040. var relative = typeof offset === 'undefined';
  10041. if (relative) offset = this.offset;
  10042. if (!this.noAssert) {
  10043. if (typeof offset !== 'number' || offset % 1 !== 0)
  10044. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  10045. offset >>>= 0;
  10046. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  10047. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  10048. }
  10049. var k;
  10050. var start = offset;
  10051. k = utfx.calculateUTF16asUTF8(stringSource(str))[1];
  10052. offset += k;
  10053. var capacity14 = this.buffer.byteLength;
  10054. if (offset > capacity14)
  10055. this.resize((capacity14 *= 2) > offset ? capacity14 : offset);
  10056. offset -= k;
  10057. utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
  10058. this.view.setUint8(offset++, b);
  10059. }.bind(this));
  10060. if (relative) {
  10061. this.offset = offset;
  10062. return this;
  10063. }
  10064. return offset - start;
  10065. };
  10066. /**
  10067. * Writes an UTF8 encoded string. This is an alias of {@link ByteBuffer#writeUTF8String}.
  10068. * @function
  10069. * @param {string} str String to write
  10070. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} if omitted.
  10071. * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written.
  10072. * @expose
  10073. */
  10074. ByteBufferPrototype.writeString = ByteBufferPrototype.writeUTF8String;
  10075. /**
  10076. * Calculates the number of UTF8 characters of a string. JavaScript itself uses UTF-16, so that a string's
  10077. * `length` property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF.
  10078. * @function
  10079. * @param {string} str String to calculate
  10080. * @returns {number} Number of UTF8 characters
  10081. * @expose
  10082. */
  10083. ByteBuffer.calculateUTF8Chars = function(str) {
  10084. return utfx.calculateUTF16asUTF8(stringSource(str))[0];
  10085. };
  10086. /**
  10087. * Calculates the number of UTF8 bytes of a string.
  10088. * @function
  10089. * @param {string} str String to calculate
  10090. * @returns {number} Number of UTF8 bytes
  10091. * @expose
  10092. */
  10093. ByteBuffer.calculateUTF8Bytes = function(str) {
  10094. return utfx.calculateUTF16asUTF8(stringSource(str))[1];
  10095. };
  10096. /**
  10097. * Reads an UTF8 encoded string.
  10098. * @param {number} length Number of characters or bytes to read.
  10099. * @param {string=} metrics Metrics specifying what `length` is meant to count. Defaults to
  10100. * {@link ByteBuffer.METRICS_CHARS}.
  10101. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  10102. * read if omitted.
  10103. * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string
  10104. * read and the actual number of bytes read.
  10105. * @expose
  10106. */
  10107. ByteBufferPrototype.readUTF8String = function(length, metrics, offset) {
  10108. if (typeof metrics === 'number') {
  10109. offset = metrics;
  10110. metrics = undefined;
  10111. }
  10112. var relative = typeof offset === 'undefined';
  10113. if (relative) offset = this.offset;
  10114. if (typeof metrics === 'undefined') metrics = ByteBuffer.METRICS_CHARS;
  10115. if (!this.noAssert) {
  10116. if (typeof length !== 'number' || length % 1 !== 0)
  10117. throw TypeError("Illegal length: "+length+" (not an integer)");
  10118. length |= 0;
  10119. if (typeof offset !== 'number' || offset % 1 !== 0)
  10120. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  10121. offset >>>= 0;
  10122. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  10123. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  10124. }
  10125. var i = 0,
  10126. start = offset,
  10127. sd;
  10128. if (metrics === ByteBuffer.METRICS_CHARS) { // The same for node and the browser
  10129. sd = stringDestination();
  10130. utfx.decodeUTF8(function() {
  10131. return i < length && offset < this.limit ? this.view.getUint8(offset++) : null;
  10132. }.bind(this), function(cp) {
  10133. ++i; utfx.UTF8toUTF16(cp, sd);
  10134. }.bind(this));
  10135. if (i !== length)
  10136. throw RangeError("Illegal range: Truncated data, "+i+" == "+length);
  10137. if (relative) {
  10138. this.offset = offset;
  10139. return sd();
  10140. } else {
  10141. return {
  10142. "string": sd(),
  10143. "length": offset - start
  10144. };
  10145. }
  10146. } else if (metrics === ByteBuffer.METRICS_BYTES) {
  10147. if (!this.noAssert) {
  10148. if (typeof offset !== 'number' || offset % 1 !== 0)
  10149. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  10150. offset >>>= 0;
  10151. if (offset < 0 || offset + length > this.buffer.byteLength)
  10152. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+length+") <= "+this.buffer.byteLength);
  10153. }
  10154. var k = offset + length;
  10155. utfx.decodeUTF8toUTF16(function() {
  10156. return offset < k ? this.view.getUint8(offset++) : null;
  10157. }.bind(this), sd = stringDestination(), this.noAssert);
  10158. if (offset !== k)
  10159. throw RangeError("Illegal range: Truncated data, "+offset+" == "+k);
  10160. if (relative) {
  10161. this.offset = offset;
  10162. return sd();
  10163. } else {
  10164. return {
  10165. 'string': sd(),
  10166. 'length': offset - start
  10167. };
  10168. }
  10169. } else
  10170. throw TypeError("Unsupported metrics: "+metrics);
  10171. };
  10172. /**
  10173. * Reads an UTF8 encoded string. This is an alias of {@link ByteBuffer#readUTF8String}.
  10174. * @function
  10175. * @param {number} length Number of characters or bytes to read
  10176. * @param {number=} metrics Metrics specifying what `n` is meant to count. Defaults to
  10177. * {@link ByteBuffer.METRICS_CHARS}.
  10178. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  10179. * read if omitted.
  10180. * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string
  10181. * read and the actual number of bytes read.
  10182. * @expose
  10183. */
  10184. ByteBufferPrototype.readString = ByteBufferPrototype.readUTF8String;
  10185. // types/strings/vstring
  10186. /**
  10187. * Writes a length as varint32 prefixed UTF8 encoded string.
  10188. * @param {string} str String to write
  10189. * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  10190. * written if omitted.
  10191. * @returns {!ByteBuffer|number} `this` if `offset` is omitted, else the actual number of bytes written
  10192. * @expose
  10193. * @see ByteBuffer#writeVarint32
  10194. */
  10195. ByteBufferPrototype.writeVString = function(str, offset) {
  10196. var relative = typeof offset === 'undefined';
  10197. if (relative) offset = this.offset;
  10198. if (!this.noAssert) {
  10199. if (typeof str !== 'string')
  10200. throw TypeError("Illegal str: Not a string");
  10201. if (typeof offset !== 'number' || offset % 1 !== 0)
  10202. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  10203. offset >>>= 0;
  10204. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  10205. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  10206. }
  10207. var start = offset,
  10208. k, l;
  10209. k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];
  10210. l = ByteBuffer.calculateVarint32(k);
  10211. offset += l+k;
  10212. var capacity15 = this.buffer.byteLength;
  10213. if (offset > capacity15)
  10214. this.resize((capacity15 *= 2) > offset ? capacity15 : offset);
  10215. offset -= l+k;
  10216. offset += this.writeVarint32(k, offset);
  10217. utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
  10218. this.view.setUint8(offset++, b);
  10219. }.bind(this));
  10220. if (offset !== start+k+l)
  10221. throw RangeError("Illegal range: Truncated data, "+offset+" == "+(offset+k+l));
  10222. if (relative) {
  10223. this.offset = offset;
  10224. return this;
  10225. }
  10226. return offset - start;
  10227. };
  10228. /**
  10229. * Reads a length as varint32 prefixed UTF8 encoded string.
  10230. * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  10231. * read if omitted.
  10232. * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string
  10233. * read and the actual number of bytes read.
  10234. * @expose
  10235. * @see ByteBuffer#readVarint32
  10236. */
  10237. ByteBufferPrototype.readVString = function(offset) {
  10238. var relative = typeof offset === 'undefined';
  10239. if (relative) offset = this.offset;
  10240. if (!this.noAssert) {
  10241. if (typeof offset !== 'number' || offset % 1 !== 0)
  10242. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  10243. offset >>>= 0;
  10244. if (offset < 0 || offset + 1 > this.buffer.byteLength)
  10245. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
  10246. }
  10247. var temp = this.readVarint32(offset),
  10248. start = offset,
  10249. str;
  10250. offset += temp['length'];
  10251. temp = temp['value'];
  10252. var k = offset + temp,
  10253. sd = stringDestination();
  10254. utfx.decodeUTF8toUTF16(function() {
  10255. return offset < k ? this.view.getUint8(offset++) : null;
  10256. }.bind(this), sd, this.noAssert);
  10257. str = sd();
  10258. if (relative) {
  10259. this.offset = offset;
  10260. return str;
  10261. } else {
  10262. return {
  10263. 'string': str,
  10264. 'length': offset - start
  10265. };
  10266. }
  10267. };
  10268. /**
  10269. * Appends some data to this ByteBuffer. This will overwrite any contents behind the specified offset up to the appended
  10270. * data's length.
  10271. * @param {!ByteBuffer|!ArrayBuffer|!Uint8Array|string} source Data to append. If `source` is a ByteBuffer, its offsets
  10272. * will be modified according to the performed read operation.
  10273. * @param {(string|number)=} encoding Encoding if `data` is a string ("base64", "hex", "binary", defaults to "utf8")
  10274. * @param {number=} offset Offset to append at. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  10275. * read if omitted.
  10276. * @returns {!ByteBuffer} this
  10277. * @expose
  10278. * @example A relative `<01 02>03.append(<04 05>)` will result in `<01 02 04 05>, 04 05|`
  10279. * @example An absolute `<01 02>03.append(04 05>, 1)` will result in `<01 04>05, 04 05|`
  10280. */
  10281. ByteBufferPrototype.append = function(source, encoding, offset) {
  10282. if (typeof encoding === 'number' || typeof encoding !== 'string') {
  10283. offset = encoding;
  10284. encoding = undefined;
  10285. }
  10286. var relative = typeof offset === 'undefined';
  10287. if (relative) offset = this.offset;
  10288. if (!this.noAssert) {
  10289. if (typeof offset !== 'number' || offset % 1 !== 0)
  10290. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  10291. offset >>>= 0;
  10292. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  10293. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  10294. }
  10295. if (!(source instanceof ByteBuffer))
  10296. source = ByteBuffer.wrap(source, encoding);
  10297. var length = source.limit - source.offset;
  10298. if (length <= 0) return this; // Nothing to append
  10299. offset += length;
  10300. var capacity16 = this.buffer.byteLength;
  10301. if (offset > capacity16)
  10302. this.resize((capacity16 *= 2) > offset ? capacity16 : offset);
  10303. offset -= length;
  10304. new Uint8Array(this.buffer, offset).set(new Uint8Array(source.buffer).subarray(source.offset, source.limit));
  10305. source.offset += length;
  10306. if (relative) this.offset += length;
  10307. return this;
  10308. };
  10309. /**
  10310. * Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents behind the specified
  10311. * offset up to the length of this ByteBuffer's data.
  10312. * @param {!ByteBuffer} target Target ByteBuffer
  10313. * @param {number=} offset Offset to append to. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  10314. * read if omitted.
  10315. * @returns {!ByteBuffer} this
  10316. * @expose
  10317. * @see ByteBuffer#append
  10318. */
  10319. ByteBufferPrototype.appendTo = function(target, offset) {
  10320. target.append(this, offset);
  10321. return this;
  10322. };
  10323. /**
  10324. * Enables or disables assertions of argument types and offsets. Assertions are enabled by default but you can opt to
  10325. * disable them if your code already makes sure that everything is valid.
  10326. * @param {boolean} assert `true` to enable assertions, otherwise `false`
  10327. * @returns {!ByteBuffer} this
  10328. * @expose
  10329. */
  10330. ByteBufferPrototype.assert = function(assert) {
  10331. this.noAssert = !assert;
  10332. return this;
  10333. };
  10334. /**
  10335. * Gets the capacity of this ByteBuffer's backing buffer.
  10336. * @returns {number} Capacity of the backing buffer
  10337. * @expose
  10338. */
  10339. ByteBufferPrototype.capacity = function() {
  10340. return this.buffer.byteLength;
  10341. };
  10342. /**
  10343. * Clears this ByteBuffer's offsets by setting {@link ByteBuffer#offset} to `0` and {@link ByteBuffer#limit} to the
  10344. * backing buffer's capacity. Discards {@link ByteBuffer#markedOffset}.
  10345. * @returns {!ByteBuffer} this
  10346. * @expose
  10347. */
  10348. ByteBufferPrototype.clear = function() {
  10349. this.offset = 0;
  10350. this.limit = this.buffer.byteLength;
  10351. this.markedOffset = -1;
  10352. return this;
  10353. };
  10354. /**
  10355. * Creates a cloned instance of this ByteBuffer, preset with this ByteBuffer's values for {@link ByteBuffer#offset},
  10356. * {@link ByteBuffer#markedOffset} and {@link ByteBuffer#limit}.
  10357. * @param {boolean=} copy Whether to copy the backing buffer or to return another view on the same, defaults to `false`
  10358. * @returns {!ByteBuffer} Cloned instance
  10359. * @expose
  10360. */
  10361. ByteBufferPrototype.clone = function(copy) {
  10362. var bb = new ByteBuffer(0, this.littleEndian, this.noAssert);
  10363. if (copy) {
  10364. var buffer = new ArrayBuffer(this.buffer.byteLength);
  10365. new Uint8Array(buffer).set(this.buffer);
  10366. bb.buffer = buffer;
  10367. bb.view = new DataView(buffer);
  10368. } else {
  10369. bb.buffer = this.buffer;
  10370. bb.view = this.view;
  10371. }
  10372. bb.offset = this.offset;
  10373. bb.markedOffset = this.markedOffset;
  10374. bb.limit = this.limit;
  10375. return bb;
  10376. };
  10377. /**
  10378. * Compacts this ByteBuffer to be backed by a {@link ByteBuffer#buffer} of its contents' length. Contents are the bytes
  10379. * between {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. Will set `offset = 0` and `limit = capacity` and
  10380. * adapt {@link ByteBuffer#markedOffset} to the same relative position if set.
  10381. * @param {number=} begin Offset to start at, defaults to {@link ByteBuffer#offset}
  10382. * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}
  10383. * @returns {!ByteBuffer} this
  10384. * @expose
  10385. */
  10386. ByteBufferPrototype.compact = function(begin, end) {
  10387. if (typeof begin === 'undefined') begin = this.offset;
  10388. if (typeof end === 'undefined') end = this.limit;
  10389. if (!this.noAssert) {
  10390. if (typeof begin !== 'number' || begin % 1 !== 0)
  10391. throw TypeError("Illegal begin: Not an integer");
  10392. begin >>>= 0;
  10393. if (typeof end !== 'number' || end % 1 !== 0)
  10394. throw TypeError("Illegal end: Not an integer");
  10395. end >>>= 0;
  10396. if (begin < 0 || begin > end || end > this.buffer.byteLength)
  10397. throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
  10398. }
  10399. if (begin === 0 && end === this.buffer.byteLength)
  10400. return this; // Already compacted
  10401. var len = end - begin;
  10402. if (len === 0) {
  10403. this.buffer = EMPTY_BUFFER;
  10404. this.view = null;
  10405. if (this.markedOffset >= 0) this.markedOffset -= begin;
  10406. this.offset = 0;
  10407. this.limit = 0;
  10408. return this;
  10409. }
  10410. var buffer = new ArrayBuffer(len);
  10411. new Uint8Array(buffer).set(new Uint8Array(this.buffer).subarray(begin, end));
  10412. this.buffer = buffer;
  10413. this.view = new DataView(buffer);
  10414. if (this.markedOffset >= 0) this.markedOffset -= begin;
  10415. this.offset = 0;
  10416. this.limit = len;
  10417. return this;
  10418. };
  10419. /**
  10420. * Creates a copy of this ByteBuffer's contents. Contents are the bytes between {@link ByteBuffer#offset} and
  10421. * {@link ByteBuffer#limit}.
  10422. * @param {number=} begin Begin offset, defaults to {@link ByteBuffer#offset}.
  10423. * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}.
  10424. * @returns {!ByteBuffer} Copy
  10425. * @expose
  10426. */
  10427. ByteBufferPrototype.copy = function(begin, end) {
  10428. if (typeof begin === 'undefined') begin = this.offset;
  10429. if (typeof end === 'undefined') end = this.limit;
  10430. if (!this.noAssert) {
  10431. if (typeof begin !== 'number' || begin % 1 !== 0)
  10432. throw TypeError("Illegal begin: Not an integer");
  10433. begin >>>= 0;
  10434. if (typeof end !== 'number' || end % 1 !== 0)
  10435. throw TypeError("Illegal end: Not an integer");
  10436. end >>>= 0;
  10437. if (begin < 0 || begin > end || end > this.buffer.byteLength)
  10438. throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
  10439. }
  10440. if (begin === end)
  10441. return new ByteBuffer(0, this.littleEndian, this.noAssert);
  10442. var capacity = end - begin,
  10443. bb = new ByteBuffer(capacity, this.littleEndian, this.noAssert);
  10444. bb.offset = 0;
  10445. bb.limit = capacity;
  10446. if (bb.markedOffset >= 0) bb.markedOffset -= begin;
  10447. this.copyTo(bb, 0, begin, end);
  10448. return bb;
  10449. };
  10450. /**
  10451. * Copies this ByteBuffer's contents to another ByteBuffer. Contents are the bytes between {@link ByteBuffer#offset} and
  10452. * {@link ByteBuffer#limit}.
  10453. * @param {!ByteBuffer} target Target ByteBuffer
  10454. * @param {number=} targetOffset Offset to copy to. Will use and increase the target's {@link ByteBuffer#offset}
  10455. * by the number of bytes copied if omitted.
  10456. * @param {number=} sourceOffset Offset to start copying from. Will use and increase {@link ByteBuffer#offset} by the
  10457. * number of bytes copied if omitted.
  10458. * @param {number=} sourceLimit Offset to end copying from, defaults to {@link ByteBuffer#limit}
  10459. * @returns {!ByteBuffer} this
  10460. * @expose
  10461. */
  10462. ByteBufferPrototype.copyTo = function(target, targetOffset, sourceOffset, sourceLimit) {
  10463. var relative,
  10464. targetRelative;
  10465. if (!this.noAssert) {
  10466. if (!ByteBuffer.isByteBuffer(target))
  10467. throw TypeError("Illegal target: Not a ByteBuffer");
  10468. }
  10469. targetOffset = (targetRelative = typeof targetOffset === 'undefined') ? target.offset : targetOffset | 0;
  10470. sourceOffset = (relative = typeof sourceOffset === 'undefined') ? this.offset : sourceOffset | 0;
  10471. sourceLimit = typeof sourceLimit === 'undefined' ? this.limit : sourceLimit | 0;
  10472. if (targetOffset < 0 || targetOffset > target.buffer.byteLength)
  10473. throw RangeError("Illegal target range: 0 <= "+targetOffset+" <= "+target.buffer.byteLength);
  10474. if (sourceOffset < 0 || sourceLimit > this.buffer.byteLength)
  10475. throw RangeError("Illegal source range: 0 <= "+sourceOffset+" <= "+this.buffer.byteLength);
  10476. var len = sourceLimit - sourceOffset;
  10477. if (len === 0)
  10478. return target; // Nothing to copy
  10479. target.ensureCapacity(targetOffset + len);
  10480. new Uint8Array(target.buffer).set(new Uint8Array(this.buffer).subarray(sourceOffset, sourceLimit), targetOffset);
  10481. if (relative) this.offset += len;
  10482. if (targetRelative) target.offset += len;
  10483. return this;
  10484. };
  10485. /**
  10486. * Makes sure that this ByteBuffer is backed by a {@link ByteBuffer#buffer} of at least the specified capacity. If the
  10487. * current capacity is exceeded, it will be doubled. If double the current capacity is less than the required capacity,
  10488. * the required capacity will be used instead.
  10489. * @param {number} capacity Required capacity
  10490. * @returns {!ByteBuffer} this
  10491. * @expose
  10492. */
  10493. ByteBufferPrototype.ensureCapacity = function(capacity) {
  10494. var current = this.buffer.byteLength;
  10495. if (current < capacity)
  10496. return this.resize((current *= 2) > capacity ? current : capacity);
  10497. return this;
  10498. };
  10499. /**
  10500. * Overwrites this ByteBuffer's contents with the specified value. Contents are the bytes between
  10501. * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}.
  10502. * @param {number|string} value Byte value to fill with. If given as a string, the first character is used.
  10503. * @param {number=} begin Begin offset. Will use and increase {@link ByteBuffer#offset} by the number of bytes
  10504. * written if omitted. defaults to {@link ByteBuffer#offset}.
  10505. * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}.
  10506. * @returns {!ByteBuffer} this
  10507. * @expose
  10508. * @example `someByteBuffer.clear().fill(0)` fills the entire backing buffer with zeroes
  10509. */
  10510. ByteBufferPrototype.fill = function(value, begin, end) {
  10511. var relative = typeof begin === 'undefined';
  10512. if (relative) begin = this.offset;
  10513. if (typeof value === 'string' && value.length > 0)
  10514. value = value.charCodeAt(0);
  10515. if (typeof begin === 'undefined') begin = this.offset;
  10516. if (typeof end === 'undefined') end = this.limit;
  10517. if (!this.noAssert) {
  10518. if (typeof value !== 'number' || value % 1 !== 0)
  10519. throw TypeError("Illegal value: "+value+" (not an integer)");
  10520. value |= 0;
  10521. if (typeof begin !== 'number' || begin % 1 !== 0)
  10522. throw TypeError("Illegal begin: Not an integer");
  10523. begin >>>= 0;
  10524. if (typeof end !== 'number' || end % 1 !== 0)
  10525. throw TypeError("Illegal end: Not an integer");
  10526. end >>>= 0;
  10527. if (begin < 0 || begin > end || end > this.buffer.byteLength)
  10528. throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
  10529. }
  10530. if (begin >= end)
  10531. return this; // Nothing to fill
  10532. while (begin < end) this.view.setUint8(begin++, value);
  10533. if (relative) this.offset = begin;
  10534. return this;
  10535. };
  10536. /**
  10537. * Makes this ByteBuffer ready for a new sequence of write or relative read operations. Sets `limit = offset` and
  10538. * `offset = 0`. Make sure always to flip a ByteBuffer when all relative read or write operations are complete.
  10539. * @returns {!ByteBuffer} this
  10540. * @expose
  10541. */
  10542. ByteBufferPrototype.flip = function() {
  10543. this.limit = this.offset;
  10544. this.offset = 0;
  10545. return this;
  10546. };
  10547. /**
  10548. * Marks an offset on this ByteBuffer to be used later.
  10549. * @param {number=} offset Offset to mark. Defaults to {@link ByteBuffer#offset}.
  10550. * @returns {!ByteBuffer} this
  10551. * @throws {TypeError} If `offset` is not a valid number
  10552. * @throws {RangeError} If `offset` is out of bounds
  10553. * @see ByteBuffer#reset
  10554. * @expose
  10555. */
  10556. ByteBufferPrototype.mark = function(offset) {
  10557. offset = typeof offset === 'undefined' ? this.offset : offset;
  10558. if (!this.noAssert) {
  10559. if (typeof offset !== 'number' || offset % 1 !== 0)
  10560. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  10561. offset >>>= 0;
  10562. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  10563. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  10564. }
  10565. this.markedOffset = offset;
  10566. return this;
  10567. };
  10568. /**
  10569. * Sets the byte order.
  10570. * @param {boolean} littleEndian `true` for little endian byte order, `false` for big endian
  10571. * @returns {!ByteBuffer} this
  10572. * @expose
  10573. */
  10574. ByteBufferPrototype.order = function(littleEndian) {
  10575. if (!this.noAssert) {
  10576. if (typeof littleEndian !== 'boolean')
  10577. throw TypeError("Illegal littleEndian: Not a boolean");
  10578. }
  10579. this.littleEndian = !!littleEndian;
  10580. return this;
  10581. };
  10582. /**
  10583. * Switches (to) little endian byte order.
  10584. * @param {boolean=} littleEndian Defaults to `true`, otherwise uses big endian
  10585. * @returns {!ByteBuffer} this
  10586. * @expose
  10587. */
  10588. ByteBufferPrototype.LE = function(littleEndian) {
  10589. this.littleEndian = typeof littleEndian !== 'undefined' ? !!littleEndian : true;
  10590. return this;
  10591. };
  10592. /**
  10593. * Switches (to) big endian byte order.
  10594. * @param {boolean=} bigEndian Defaults to `true`, otherwise uses little endian
  10595. * @returns {!ByteBuffer} this
  10596. * @expose
  10597. */
  10598. ByteBufferPrototype.BE = function(bigEndian) {
  10599. this.littleEndian = typeof bigEndian !== 'undefined' ? !bigEndian : false;
  10600. return this;
  10601. };
  10602. /**
  10603. * Prepends some data to this ByteBuffer. This will overwrite any contents before the specified offset up to the
  10604. * prepended data's length. If there is not enough space available before the specified `offset`, the backing buffer
  10605. * will be resized and its contents moved accordingly.
  10606. * @param {!ByteBuffer|string|!ArrayBuffer} source Data to prepend. If `source` is a ByteBuffer, its offset will be
  10607. * modified according to the performed read operation.
  10608. * @param {(string|number)=} encoding Encoding if `data` is a string ("base64", "hex", "binary", defaults to "utf8")
  10609. * @param {number=} offset Offset to prepend at. Will use and decrease {@link ByteBuffer#offset} by the number of bytes
  10610. * prepended if omitted.
  10611. * @returns {!ByteBuffer} this
  10612. * @expose
  10613. * @example A relative `00<01 02 03>.prepend(<04 05>)` results in `<04 05 01 02 03>, 04 05|`
  10614. * @example An absolute `00<01 02 03>.prepend(<04 05>, 2)` results in `04<05 02 03>, 04 05|`
  10615. */
  10616. ByteBufferPrototype.prepend = function(source, encoding, offset) {
  10617. if (typeof encoding === 'number' || typeof encoding !== 'string') {
  10618. offset = encoding;
  10619. encoding = undefined;
  10620. }
  10621. var relative = typeof offset === 'undefined';
  10622. if (relative) offset = this.offset;
  10623. if (!this.noAssert) {
  10624. if (typeof offset !== 'number' || offset % 1 !== 0)
  10625. throw TypeError("Illegal offset: "+offset+" (not an integer)");
  10626. offset >>>= 0;
  10627. if (offset < 0 || offset + 0 > this.buffer.byteLength)
  10628. throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
  10629. }
  10630. if (!(source instanceof ByteBuffer))
  10631. source = ByteBuffer.wrap(source, encoding);
  10632. var len = source.limit - source.offset;
  10633. if (len <= 0) return this; // Nothing to prepend
  10634. var diff = len - offset;
  10635. var arrayView;
  10636. if (diff > 0) { // Not enough space before offset, so resize + move
  10637. var buffer = new ArrayBuffer(this.buffer.byteLength + diff);
  10638. arrayView = new Uint8Array(buffer);
  10639. arrayView.set(new Uint8Array(this.buffer).subarray(offset, this.buffer.byteLength), len);
  10640. this.buffer = buffer;
  10641. this.view = new DataView(buffer);
  10642. this.offset += diff;
  10643. if (this.markedOffset >= 0) this.markedOffset += diff;
  10644. this.limit += diff;
  10645. offset += diff;
  10646. } else {
  10647. arrayView = new Uint8Array(this.buffer);
  10648. }
  10649. arrayView.set(new Uint8Array(source.buffer).subarray(source.offset, source.limit), offset - len);
  10650. source.offset = source.limit;
  10651. if (relative)
  10652. this.offset -= len;
  10653. return this;
  10654. };
  10655. /**
  10656. * Prepends this ByteBuffer to another ByteBuffer. This will overwrite any contents before the specified offset up to the
  10657. * prepended data's length. If there is not enough space available before the specified `offset`, the backing buffer
  10658. * will be resized and its contents moved accordingly.
  10659. * @param {!ByteBuffer} target Target ByteBuffer
  10660. * @param {number=} offset Offset to prepend at. Will use and decrease {@link ByteBuffer#offset} by the number of bytes
  10661. * prepended if omitted.
  10662. * @returns {!ByteBuffer} this
  10663. * @expose
  10664. * @see ByteBuffer#prepend
  10665. */
  10666. ByteBufferPrototype.prependTo = function(target, offset) {
  10667. target.prepend(this, offset);
  10668. return this;
  10669. };
  10670. /**
  10671. * Prints debug information about this ByteBuffer's contents.
  10672. * @param {function(string)=} out Output function to call, defaults to console.log
  10673. * @expose
  10674. */
  10675. ByteBufferPrototype.printDebug = function(out) {
  10676. if (typeof out !== 'function') out = console.log.bind(console);
  10677. out(
  10678. this.toString()+"\n"+
  10679. "-------------------------------------------------------------------\n"+
  10680. this.toDebug(/* columns */ true)
  10681. );
  10682. };
  10683. /**
  10684. * Gets the number of remaining readable bytes. Contents are the bytes between {@link ByteBuffer#offset} and
  10685. * {@link ByteBuffer#limit}, so this returns `limit - offset`.
  10686. * @returns {number} Remaining readable bytes. May be negative if `offset > limit`.
  10687. * @expose
  10688. */
  10689. ByteBufferPrototype.remaining = function() {
  10690. return this.limit - this.offset;
  10691. };
  10692. /**
  10693. * Resets this ByteBuffer's {@link ByteBuffer#offset}. If an offset has been marked through {@link ByteBuffer#mark}
  10694. * before, `offset` will be set to {@link ByteBuffer#markedOffset}, which will then be discarded. If no offset has been
  10695. * marked, sets `offset = 0`.
  10696. * @returns {!ByteBuffer} this
  10697. * @see ByteBuffer#mark
  10698. * @expose
  10699. */
  10700. ByteBufferPrototype.reset = function() {
  10701. if (this.markedOffset >= 0) {
  10702. this.offset = this.markedOffset;
  10703. this.markedOffset = -1;
  10704. } else {
  10705. this.offset = 0;
  10706. }
  10707. return this;
  10708. };
  10709. /**
  10710. * Resizes this ByteBuffer to be backed by a buffer of at least the given capacity. Will do nothing if already that
  10711. * large or larger.
  10712. * @param {number} capacity Capacity required
  10713. * @returns {!ByteBuffer} this
  10714. * @throws {TypeError} If `capacity` is not a number
  10715. * @throws {RangeError} If `capacity < 0`
  10716. * @expose
  10717. */
  10718. ByteBufferPrototype.resize = function(capacity) {
  10719. if (!this.noAssert) {
  10720. if (typeof capacity !== 'number' || capacity % 1 !== 0)
  10721. throw TypeError("Illegal capacity: "+capacity+" (not an integer)");
  10722. capacity |= 0;
  10723. if (capacity < 0)
  10724. throw RangeError("Illegal capacity: 0 <= "+capacity);
  10725. }
  10726. if (this.buffer.byteLength < capacity) {
  10727. var buffer = new ArrayBuffer(capacity);
  10728. new Uint8Array(buffer).set(new Uint8Array(this.buffer));
  10729. this.buffer = buffer;
  10730. this.view = new DataView(buffer);
  10731. }
  10732. return this;
  10733. };
  10734. /**
  10735. * Reverses this ByteBuffer's contents.
  10736. * @param {number=} begin Offset to start at, defaults to {@link ByteBuffer#offset}
  10737. * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}
  10738. * @returns {!ByteBuffer} this
  10739. * @expose
  10740. */
  10741. ByteBufferPrototype.reverse = function(begin, end) {
  10742. if (typeof begin === 'undefined') begin = this.offset;
  10743. if (typeof end === 'undefined') end = this.limit;
  10744. if (!this.noAssert) {
  10745. if (typeof begin !== 'number' || begin % 1 !== 0)
  10746. throw TypeError("Illegal begin: Not an integer");
  10747. begin >>>= 0;
  10748. if (typeof end !== 'number' || end % 1 !== 0)
  10749. throw TypeError("Illegal end: Not an integer");
  10750. end >>>= 0;
  10751. if (begin < 0 || begin > end || end > this.buffer.byteLength)
  10752. throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
  10753. }
  10754. if (begin === end)
  10755. return this; // Nothing to reverse
  10756. Array.prototype.reverse.call(new Uint8Array(this.buffer).subarray(begin, end));
  10757. this.view = new DataView(this.buffer); // FIXME: Why exactly is this necessary?
  10758. return this;
  10759. };
  10760. /**
  10761. * Skips the next `length` bytes. This will just advance
  10762. * @param {number} length Number of bytes to skip. May also be negative to move the offset back.
  10763. * @returns {!ByteBuffer} this
  10764. * @expose
  10765. */
  10766. ByteBufferPrototype.skip = function(length) {
  10767. if (!this.noAssert) {
  10768. if (typeof length !== 'number' || length % 1 !== 0)
  10769. throw TypeError("Illegal length: "+length+" (not an integer)");
  10770. length |= 0;
  10771. }
  10772. var offset = this.offset + length;
  10773. if (!this.noAssert) {
  10774. if (offset < 0 || offset > this.buffer.byteLength)
  10775. throw RangeError("Illegal length: 0 <= "+this.offset+" + "+length+" <= "+this.buffer.byteLength);
  10776. }
  10777. this.offset = offset;
  10778. return this;
  10779. };
  10780. /**
  10781. * Slices this ByteBuffer by creating a cloned instance with `offset = begin` and `limit = end`.
  10782. * @param {number=} begin Begin offset, defaults to {@link ByteBuffer#offset}.
  10783. * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}.
  10784. * @returns {!ByteBuffer} Clone of this ByteBuffer with slicing applied, backed by the same {@link ByteBuffer#buffer}
  10785. * @expose
  10786. */
  10787. ByteBufferPrototype.slice = function(begin, end) {
  10788. if (typeof begin === 'undefined') begin = this.offset;
  10789. if (typeof end === 'undefined') end = this.limit;
  10790. if (!this.noAssert) {
  10791. if (typeof begin !== 'number' || begin % 1 !== 0)
  10792. throw TypeError("Illegal begin: Not an integer");
  10793. begin >>>= 0;
  10794. if (typeof end !== 'number' || end % 1 !== 0)
  10795. throw TypeError("Illegal end: Not an integer");
  10796. end >>>= 0;
  10797. if (begin < 0 || begin > end || end > this.buffer.byteLength)
  10798. throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
  10799. }
  10800. var bb = this.clone();
  10801. bb.offset = begin;
  10802. bb.limit = end;
  10803. return bb;
  10804. };
  10805. /**
  10806. * Returns a copy of the backing buffer that contains this ByteBuffer's contents. Contents are the bytes between
  10807. * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. Will transparently {@link ByteBuffer#flip} this
  10808. * ByteBuffer if `offset > limit` but the actual offsets remain untouched.
  10809. * @param {boolean=} forceCopy If `true` returns a copy, otherwise returns a view referencing the same memory if
  10810. * possible. Defaults to `false`
  10811. * @returns {!ArrayBuffer} Contents as an ArrayBuffer
  10812. * @expose
  10813. */
  10814. ByteBufferPrototype.toBuffer = function(forceCopy) {
  10815. var offset = this.offset,
  10816. limit = this.limit;
  10817. if (offset > limit) {
  10818. var t = offset;
  10819. offset = limit;
  10820. limit = t;
  10821. }
  10822. if (!this.noAssert) {
  10823. if (typeof offset !== 'number' || offset % 1 !== 0)
  10824. throw TypeError("Illegal offset: Not an integer");
  10825. offset >>>= 0;
  10826. if (typeof limit !== 'number' || limit % 1 !== 0)
  10827. throw TypeError("Illegal limit: Not an integer");
  10828. limit >>>= 0;
  10829. if (offset < 0 || offset > limit || limit > this.buffer.byteLength)
  10830. throw RangeError("Illegal range: 0 <= "+offset+" <= "+limit+" <= "+this.buffer.byteLength);
  10831. }
  10832. // NOTE: It's not possible to have another ArrayBuffer reference the same memory as the backing buffer. This is
  10833. // possible with Uint8Array#subarray only, but we have to return an ArrayBuffer by contract. So:
  10834. if (!forceCopy && offset === 0 && limit === this.buffer.byteLength) {
  10835. return this.buffer;
  10836. }
  10837. if (offset === limit) {
  10838. return EMPTY_BUFFER;
  10839. }
  10840. var buffer = new ArrayBuffer(limit - offset);
  10841. new Uint8Array(buffer).set(new Uint8Array(this.buffer).subarray(offset, limit), 0);
  10842. return buffer;
  10843. };
  10844. /**
  10845. * Returns a raw buffer compacted to contain this ByteBuffer's contents. Contents are the bytes between
  10846. * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. Will transparently {@link ByteBuffer#flip} this
  10847. * ByteBuffer if `offset > limit` but the actual offsets remain untouched. This is an alias of
  10848. * {@link ByteBuffer#toBuffer}.
  10849. * @function
  10850. * @param {boolean=} forceCopy If `true` returns a copy, otherwise returns a view referencing the same memory.
  10851. * Defaults to `false`
  10852. * @returns {!ArrayBuffer} Contents as an ArrayBuffer
  10853. * @expose
  10854. */
  10855. ByteBufferPrototype.toArrayBuffer = ByteBufferPrototype.toBuffer;
  10856. /**
  10857. * Converts the ByteBuffer's contents to a string.
  10858. * @param {string=} encoding Output encoding. Returns an informative string representation if omitted but also allows
  10859. * direct conversion to "utf8", "hex", "base64" and "binary" encoding. "debug" returns a hex representation with
  10860. * highlighted offsets.
  10861. * @param {number=} begin Offset to begin at, defaults to {@link ByteBuffer#offset}
  10862. * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}
  10863. * @returns {string} String representation
  10864. * @throws {Error} If `encoding` is invalid
  10865. * @expose
  10866. */
  10867. ByteBufferPrototype.toString = function(encoding, begin, end) {
  10868. if (typeof encoding === 'undefined')
  10869. return "ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";
  10870. if (typeof encoding === 'number')
  10871. encoding = "utf8",
  10872. begin = encoding,
  10873. end = begin;
  10874. switch (encoding) {
  10875. case "utf8":
  10876. return this.toUTF8(begin, end);
  10877. case "base64":
  10878. return this.toBase64(begin, end);
  10879. case "hex":
  10880. return this.toHex(begin, end);
  10881. case "binary":
  10882. return this.toBinary(begin, end);
  10883. case "debug":
  10884. return this.toDebug();
  10885. case "columns":
  10886. return this.toColumns();
  10887. default:
  10888. throw Error("Unsupported encoding: "+encoding);
  10889. }
  10890. };
  10891. // lxiv-embeddable
  10892. /**
  10893. * lxiv-embeddable (c) 2014 Daniel Wirtz <dcode@dcode.io>
  10894. * Released under the Apache License, Version 2.0
  10895. * see: https://github.com/dcodeIO/lxiv for details
  10896. */
  10897. var lxiv = function() {
  10898. "use strict";
  10899. /**
  10900. * lxiv namespace.
  10901. * @type {!Object.<string,*>}
  10902. * @exports lxiv
  10903. */
  10904. var lxiv = {};
  10905. /**
  10906. * Character codes for output.
  10907. * @type {!Array.<number>}
  10908. * @inner
  10909. */
  10910. var aout = [
  10911. 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
  10912. 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102,
  10913. 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
  10914. 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47
  10915. ];
  10916. /**
  10917. * Character codes for input.
  10918. * @type {!Array.<number>}
  10919. * @inner
  10920. */
  10921. var ain = [];
  10922. for (var i=0, k=aout.length; i<k; ++i)
  10923. ain[aout[i]] = i;
  10924. /**
  10925. * Encodes bytes to base64 char codes.
  10926. * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if
  10927. * there are no more bytes left.
  10928. * @param {!function(number)} dst Characters destination as a function successively called with each encoded char
  10929. * code.
  10930. */
  10931. lxiv.encode = function(src, dst) {
  10932. var b, t;
  10933. while ((b = src()) !== null) {
  10934. dst(aout[(b>>2)&0x3f]);
  10935. t = (b&0x3)<<4;
  10936. if ((b = src()) !== null) {
  10937. t |= (b>>4)&0xf;
  10938. dst(aout[(t|((b>>4)&0xf))&0x3f]);
  10939. t = (b&0xf)<<2;
  10940. if ((b = src()) !== null)
  10941. dst(aout[(t|((b>>6)&0x3))&0x3f]),
  10942. dst(aout[b&0x3f]);
  10943. else
  10944. dst(aout[t&0x3f]),
  10945. dst(61);
  10946. } else
  10947. dst(aout[t&0x3f]),
  10948. dst(61),
  10949. dst(61);
  10950. }
  10951. };
  10952. /**
  10953. * Decodes base64 char codes to bytes.
  10954. * @param {!function():number|null} src Characters source as a function returning the next char code respectively
  10955. * `null` if there are no more characters left.
  10956. * @param {!function(number)} dst Bytes destination as a function successively called with the next byte.
  10957. * @throws {Error} If a character code is invalid
  10958. */
  10959. lxiv.decode = function(src, dst) {
  10960. var c, t1, t2;
  10961. function fail(c) {
  10962. throw Error("Illegal character code: "+c);
  10963. }
  10964. while ((c = src()) !== null) {
  10965. t1 = ain[c];
  10966. if (typeof t1 === 'undefined') fail(c);
  10967. if ((c = src()) !== null) {
  10968. t2 = ain[c];
  10969. if (typeof t2 === 'undefined') fail(c);
  10970. dst((t1<<2)>>>0|(t2&0x30)>>4);
  10971. if ((c = src()) !== null) {
  10972. t1 = ain[c];
  10973. if (typeof t1 === 'undefined')
  10974. if (c === 61) break; else fail(c);
  10975. dst(((t2&0xf)<<4)>>>0|(t1&0x3c)>>2);
  10976. if ((c = src()) !== null) {
  10977. t2 = ain[c];
  10978. if (typeof t2 === 'undefined')
  10979. if (c === 61) break; else fail(c);
  10980. dst(((t1&0x3)<<6)>>>0|t2);
  10981. }
  10982. }
  10983. }
  10984. }
  10985. };
  10986. /**
  10987. * Tests if a string is valid base64.
  10988. * @param {string} str String to test
  10989. * @returns {boolean} `true` if valid, otherwise `false`
  10990. */
  10991. lxiv.test = function(str) {
  10992. return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(str);
  10993. };
  10994. return lxiv;
  10995. }();
  10996. // encodings/base64
  10997. /**
  10998. * Encodes this ByteBuffer's contents to a base64 encoded string.
  10999. * @param {number=} begin Offset to begin at, defaults to {@link ByteBuffer#offset}.
  11000. * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}.
  11001. * @returns {string} Base64 encoded string
  11002. * @expose
  11003. */
  11004. ByteBufferPrototype.toBase64 = function(begin, end) {
  11005. if (typeof begin === 'undefined')
  11006. begin = this.offset;
  11007. if (typeof end === 'undefined')
  11008. end = this.limit;
  11009. if (!this.noAssert) {
  11010. if (typeof begin !== 'number' || begin % 1 !== 0)
  11011. throw TypeError("Illegal begin: Not an integer");
  11012. begin >>>= 0;
  11013. if (typeof end !== 'number' || end % 1 !== 0)
  11014. throw TypeError("Illegal end: Not an integer");
  11015. end >>>= 0;
  11016. if (begin < 0 || begin > end || end > this.buffer.byteLength)
  11017. throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
  11018. }
  11019. var sd; lxiv.encode(function() {
  11020. return begin < end ? this.view.getUint8(begin++) : null;
  11021. }.bind(this), sd = stringDestination());
  11022. return sd();
  11023. };
  11024. /**
  11025. * Decodes a base64 encoded string to a ByteBuffer.
  11026. * @param {string} str String to decode
  11027. * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to
  11028. * {@link ByteBuffer.DEFAULT_ENDIAN}.
  11029. * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to
  11030. * {@link ByteBuffer.DEFAULT_NOASSERT}.
  11031. * @returns {!ByteBuffer} ByteBuffer
  11032. * @expose
  11033. */
  11034. ByteBuffer.fromBase64 = function(str, littleEndian, noAssert) {
  11035. if (!noAssert) {
  11036. if (typeof str !== 'string')
  11037. throw TypeError("Illegal str: Not a string");
  11038. if (str.length % 4 !== 0)
  11039. throw TypeError("Illegal str: Length not a multiple of 4");
  11040. }
  11041. var bb = new ByteBuffer(str.length/4*3, littleEndian, noAssert),
  11042. i = 0;
  11043. lxiv.decode(stringSource(str), function(b) {
  11044. bb.view.setUint8(i++, b);
  11045. });
  11046. bb.limit = i;
  11047. return bb;
  11048. };
  11049. /**
  11050. * Encodes a binary string to base64 like `window.btoa` does.
  11051. * @param {string} str Binary string
  11052. * @returns {string} Base64 encoded string
  11053. * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.btoa
  11054. * @expose
  11055. */
  11056. ByteBuffer.btoa = function(str) {
  11057. return ByteBuffer.fromBinary(str).toBase64();
  11058. };
  11059. /**
  11060. * Decodes a base64 encoded string to binary like `window.atob` does.
  11061. * @param {string} b64 Base64 encoded string
  11062. * @returns {string} Binary string
  11063. * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.atob
  11064. * @expose
  11065. */
  11066. ByteBuffer.atob = function(b64) {
  11067. return ByteBuffer.fromBase64(b64).toBinary();
  11068. };
  11069. // encodings/binary
  11070. /**
  11071. * Encodes this ByteBuffer to a binary encoded string, that is using only characters 0x00-0xFF as bytes.
  11072. * @param {number=} begin Offset to begin at. Defaults to {@link ByteBuffer#offset}.
  11073. * @param {number=} end Offset to end at. Defaults to {@link ByteBuffer#limit}.
  11074. * @returns {string} Binary encoded string
  11075. * @throws {RangeError} If `offset > limit`
  11076. * @expose
  11077. */
  11078. ByteBufferPrototype.toBinary = function(begin, end) {
  11079. begin = typeof begin === 'undefined' ? this.offset : begin;
  11080. end = typeof end === 'undefined' ? this.limit : end;
  11081. if (!this.noAssert) {
  11082. if (typeof begin !== 'number' || begin % 1 !== 0)
  11083. throw TypeError("Illegal begin: Not an integer");
  11084. begin >>>= 0;
  11085. if (typeof end !== 'number' || end % 1 !== 0)
  11086. throw TypeError("Illegal end: Not an integer");
  11087. end >>>= 0;
  11088. if (begin < 0 || begin > end || end > this.buffer.byteLength)
  11089. throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
  11090. }
  11091. if (begin === end)
  11092. return "";
  11093. var cc = [], pt = [];
  11094. while (begin < end) {
  11095. cc.push(this.view.getUint8(begin++));
  11096. if (cc.length >= 1024)
  11097. pt.push(String.fromCharCode.apply(String, cc)),
  11098. cc = [];
  11099. }
  11100. return pt.join('') + String.fromCharCode.apply(String, cc);
  11101. };
  11102. /**
  11103. * Decodes a binary encoded string, that is using only characters 0x00-0xFF as bytes, to a ByteBuffer.
  11104. * @param {string} str String to decode
  11105. * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to
  11106. * {@link ByteBuffer.DEFAULT_ENDIAN}.
  11107. * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to
  11108. * {@link ByteBuffer.DEFAULT_NOASSERT}.
  11109. * @returns {!ByteBuffer} ByteBuffer
  11110. * @expose
  11111. */
  11112. ByteBuffer.fromBinary = function(str, littleEndian, noAssert) {
  11113. if (!noAssert) {
  11114. if (typeof str !== 'string')
  11115. throw TypeError("Illegal str: Not a string");
  11116. }
  11117. var i = 0, k = str.length, charCode,
  11118. bb = new ByteBuffer(k, littleEndian, noAssert);
  11119. while (i<k) {
  11120. charCode = str.charCodeAt(i);
  11121. if (!noAssert && charCode > 255)
  11122. throw RangeError("Illegal charCode at "+i+": 0 <= "+charCode+" <= 255");
  11123. bb.view.setUint8(i++, charCode);
  11124. }
  11125. bb.limit = k;
  11126. return bb;
  11127. };
  11128. // encodings/debug
  11129. /**
  11130. * Encodes this ByteBuffer to a hex encoded string with marked offsets. Offset symbols are:
  11131. * * `<` : offset,
  11132. * * `'` : markedOffset,
  11133. * * `>` : limit,
  11134. * * `|` : offset and limit,
  11135. * * `[` : offset and markedOffset,
  11136. * * `]` : markedOffset and limit,
  11137. * * `!` : offset, markedOffset and limit
  11138. * @param {boolean=} columns If `true` returns two columns hex + ascii, defaults to `false`
  11139. * @returns {string|!Array.<string>} Debug string or array of lines if `asArray = true`
  11140. * @expose
  11141. * @example `>00'01 02<03` contains four bytes with `limit=0, markedOffset=1, offset=3`
  11142. * @example `00[01 02 03>` contains four bytes with `offset=markedOffset=1, limit=4`
  11143. * @example `00|01 02 03` contains four bytes with `offset=limit=1, markedOffset=-1`
  11144. * @example `|` contains zero bytes with `offset=limit=0, markedOffset=-1`
  11145. */
  11146. ByteBufferPrototype.toDebug = function(columns) {
  11147. var i = -1,
  11148. k = this.buffer.byteLength,
  11149. b,
  11150. hex = "",
  11151. asc = "",
  11152. out = "";
  11153. while (i<k) {
  11154. if (i !== -1) {
  11155. b = this.view.getUint8(i);
  11156. if (b < 0x10) hex += "0"+b.toString(16).toUpperCase();
  11157. else hex += b.toString(16).toUpperCase();
  11158. if (columns) {
  11159. asc += b > 32 && b < 127 ? String.fromCharCode(b) : '.';
  11160. }
  11161. }
  11162. ++i;
  11163. if (columns) {
  11164. if (i > 0 && i % 16 === 0 && i !== k) {
  11165. while (hex.length < 3*16+3) hex += " ";
  11166. out += hex+asc+"\n";
  11167. hex = asc = "";
  11168. }
  11169. }
  11170. if (i === this.offset && i === this.limit)
  11171. hex += i === this.markedOffset ? "!" : "|";
  11172. else if (i === this.offset)
  11173. hex += i === this.markedOffset ? "[" : "<";
  11174. else if (i === this.limit)
  11175. hex += i === this.markedOffset ? "]" : ">";
  11176. else
  11177. hex += i === this.markedOffset ? "'" : (columns || (i !== 0 && i !== k) ? " " : "");
  11178. }
  11179. if (columns && hex !== " ") {
  11180. while (hex.length < 3*16+3) hex += " ";
  11181. out += hex+asc+"\n";
  11182. }
  11183. return columns ? out : hex;
  11184. };
  11185. /**
  11186. * Decodes a hex encoded string with marked offsets to a ByteBuffer.
  11187. * @param {string} str Debug string to decode (not be generated with `columns = true`)
  11188. * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to
  11189. * {@link ByteBuffer.DEFAULT_ENDIAN}.
  11190. * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to
  11191. * {@link ByteBuffer.DEFAULT_NOASSERT}.
  11192. * @returns {!ByteBuffer} ByteBuffer
  11193. * @expose
  11194. * @see ByteBuffer#toDebug
  11195. */
  11196. ByteBuffer.fromDebug = function(str, littleEndian, noAssert) {
  11197. var k = str.length,
  11198. bb = new ByteBuffer(((k+1)/3)|0, littleEndian, noAssert);
  11199. var i = 0, j = 0, ch, b,
  11200. rs = false, // Require symbol next
  11201. ho = false, hm = false, hl = false, // Already has offset, markedOffset, limit?
  11202. fail = false;
  11203. while (i<k) {
  11204. switch (ch = str.charAt(i++)) {
  11205. case '!':
  11206. if (!noAssert) {
  11207. if (ho || hm || hl) {
  11208. fail = true; break;
  11209. }
  11210. ho = hm = hl = true;
  11211. }
  11212. bb.offset = bb.markedOffset = bb.limit = j;
  11213. rs = false;
  11214. break;
  11215. case '|':
  11216. if (!noAssert) {
  11217. if (ho || hl) {
  11218. fail = true; break;
  11219. }
  11220. ho = hl = true;
  11221. }
  11222. bb.offset = bb.limit = j;
  11223. rs = false;
  11224. break;
  11225. case '[':
  11226. if (!noAssert) {
  11227. if (ho || hm) {
  11228. fail = true; break;
  11229. }
  11230. ho = hm = true;
  11231. }
  11232. bb.offset = bb.markedOffset = j;
  11233. rs = false;
  11234. break;
  11235. case '<':
  11236. if (!noAssert) {
  11237. if (ho) {
  11238. fail = true; break;
  11239. }
  11240. ho = true;
  11241. }
  11242. bb.offset = j;
  11243. rs = false;
  11244. break;
  11245. case ']':
  11246. if (!noAssert) {
  11247. if (hl || hm) {
  11248. fail = true; break;
  11249. }
  11250. hl = hm = true;
  11251. }
  11252. bb.limit = bb.markedOffset = j;
  11253. rs = false;
  11254. break;
  11255. case '>':
  11256. if (!noAssert) {
  11257. if (hl) {
  11258. fail = true; break;
  11259. }
  11260. hl = true;
  11261. }
  11262. bb.limit = j;
  11263. rs = false;
  11264. break;
  11265. case "'":
  11266. if (!noAssert) {
  11267. if (hm) {
  11268. fail = true; break;
  11269. }
  11270. hm = true;
  11271. }
  11272. bb.markedOffset = j;
  11273. rs = false;
  11274. break;
  11275. case ' ':
  11276. rs = false;
  11277. break;
  11278. default:
  11279. if (!noAssert) {
  11280. if (rs) {
  11281. fail = true; break;
  11282. }
  11283. }
  11284. b = parseInt(ch+str.charAt(i++), 16);
  11285. if (!noAssert) {
  11286. if (isNaN(b) || b < 0 || b > 255)
  11287. throw TypeError("Illegal str: Not a debug encoded string");
  11288. }
  11289. bb.view.setUint8(j++, b);
  11290. rs = true;
  11291. }
  11292. if (fail)
  11293. throw TypeError("Illegal str: Invalid symbol at "+i);
  11294. }
  11295. if (!noAssert) {
  11296. if (!ho || !hl)
  11297. throw TypeError("Illegal str: Missing offset or limit");
  11298. if (j<bb.buffer.byteLength)
  11299. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+j+" < "+k);
  11300. }
  11301. return bb;
  11302. };
  11303. // encodings/hex
  11304. /**
  11305. * Encodes this ByteBuffer's contents to a hex encoded string.
  11306. * @param {number=} begin Offset to begin at. Defaults to {@link ByteBuffer#offset}.
  11307. * @param {number=} end Offset to end at. Defaults to {@link ByteBuffer#limit}.
  11308. * @returns {string} Hex encoded string
  11309. * @expose
  11310. */
  11311. ByteBufferPrototype.toHex = function(begin, end) {
  11312. begin = typeof begin === 'undefined' ? this.offset : begin;
  11313. end = typeof end === 'undefined' ? this.limit : end;
  11314. if (!this.noAssert) {
  11315. if (typeof begin !== 'number' || begin % 1 !== 0)
  11316. throw TypeError("Illegal begin: Not an integer");
  11317. begin >>>= 0;
  11318. if (typeof end !== 'number' || end % 1 !== 0)
  11319. throw TypeError("Illegal end: Not an integer");
  11320. end >>>= 0;
  11321. if (begin < 0 || begin > end || end > this.buffer.byteLength)
  11322. throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
  11323. }
  11324. var out = new Array(end - begin),
  11325. b;
  11326. while (begin < end) {
  11327. b = this.view.getUint8(begin++);
  11328. if (b < 0x10)
  11329. out.push("0", b.toString(16));
  11330. else out.push(b.toString(16));
  11331. }
  11332. return out.join('');
  11333. };
  11334. /**
  11335. * Decodes a hex encoded string to a ByteBuffer.
  11336. * @param {string} str String to decode
  11337. * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to
  11338. * {@link ByteBuffer.DEFAULT_ENDIAN}.
  11339. * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to
  11340. * {@link ByteBuffer.DEFAULT_NOASSERT}.
  11341. * @returns {!ByteBuffer} ByteBuffer
  11342. * @expose
  11343. */
  11344. ByteBuffer.fromHex = function(str, littleEndian, noAssert) {
  11345. if (!noAssert) {
  11346. if (typeof str !== 'string')
  11347. throw TypeError("Illegal str: Not a string");
  11348. if (str.length % 2 !== 0)
  11349. throw TypeError("Illegal str: Length not a multiple of 2");
  11350. }
  11351. var k = str.length,
  11352. bb = new ByteBuffer((k / 2) | 0, littleEndian),
  11353. b;
  11354. for (var i=0, j=0; i<k; i+=2) {
  11355. b = parseInt(str.substring(i, i+2), 16);
  11356. if (!noAssert)
  11357. if (!isFinite(b) || b < 0 || b > 255)
  11358. throw TypeError("Illegal str: Contains non-hex characters");
  11359. bb.view.setUint8(j++, b);
  11360. }
  11361. bb.limit = j;
  11362. return bb;
  11363. };
  11364. // utfx-embeddable
  11365. /**
  11366. * utfx-embeddable (c) 2014 Daniel Wirtz <dcode@dcode.io>
  11367. * Released under the Apache License, Version 2.0
  11368. * see: https://github.com/dcodeIO/utfx for details
  11369. */
  11370. var utfx = function() {
  11371. "use strict";
  11372. /**
  11373. * utfx namespace.
  11374. * @inner
  11375. * @type {!Object.<string,*>}
  11376. */
  11377. var utfx = {};
  11378. /**
  11379. * Maximum valid code point.
  11380. * @type {number}
  11381. * @const
  11382. */
  11383. utfx.MAX_CODEPOINT = 0x10FFFF;
  11384. /**
  11385. * Encodes UTF8 code points to UTF8 bytes.
  11386. * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point
  11387. * respectively `null` if there are no more code points left or a single numeric code point.
  11388. * @param {!function(number)} dst Bytes destination as a function successively called with the next byte
  11389. */
  11390. utfx.encodeUTF8 = function(src, dst) {
  11391. var cp = null;
  11392. if (typeof src === 'number')
  11393. cp = src,
  11394. src = function() { return null; };
  11395. while (cp !== null || (cp = src()) !== null) {
  11396. if (cp < 0x80)
  11397. dst(cp&0x7F);
  11398. else if (cp < 0x800)
  11399. dst(((cp>>6)&0x1F)|0xC0),
  11400. dst((cp&0x3F)|0x80);
  11401. else if (cp < 0x10000)
  11402. dst(((cp>>12)&0x0F)|0xE0),
  11403. dst(((cp>>6)&0x3F)|0x80),
  11404. dst((cp&0x3F)|0x80);
  11405. else
  11406. dst(((cp>>18)&0x07)|0xF0),
  11407. dst(((cp>>12)&0x3F)|0x80),
  11408. dst(((cp>>6)&0x3F)|0x80),
  11409. dst((cp&0x3F)|0x80);
  11410. cp = null;
  11411. }
  11412. };
  11413. /**
  11414. * Decodes UTF8 bytes to UTF8 code points.
  11415. * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there
  11416. * are no more bytes left.
  11417. * @param {!function(number)} dst Code points destination as a function successively called with each decoded code point.
  11418. * @throws {RangeError} If a starting byte is invalid in UTF8
  11419. * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the
  11420. * remaining bytes.
  11421. */
  11422. utfx.decodeUTF8 = function(src, dst) {
  11423. var a, b, c, d, fail = function(b) {
  11424. b = b.slice(0, b.indexOf(null));
  11425. var err = Error(b.toString());
  11426. err.name = "TruncatedError";
  11427. err['bytes'] = b;
  11428. throw err;
  11429. };
  11430. while ((a = src()) !== null) {
  11431. if ((a&0x80) === 0)
  11432. dst(a);
  11433. else if ((a&0xE0) === 0xC0)
  11434. ((b = src()) === null) && fail([a, b]),
  11435. dst(((a&0x1F)<<6) | (b&0x3F));
  11436. else if ((a&0xF0) === 0xE0)
  11437. ((b=src()) === null || (c=src()) === null) && fail([a, b, c]),
  11438. dst(((a&0x0F)<<12) | ((b&0x3F)<<6) | (c&0x3F));
  11439. else if ((a&0xF8) === 0xF0)
  11440. ((b=src()) === null || (c=src()) === null || (d=src()) === null) && fail([a, b, c ,d]),
  11441. dst(((a&0x07)<<18) | ((b&0x3F)<<12) | ((c&0x3F)<<6) | (d&0x3F));
  11442. else throw RangeError("Illegal starting byte: "+a);
  11443. }
  11444. };
  11445. /**
  11446. * Converts UTF16 characters to UTF8 code points.
  11447. * @param {!function():number|null} src Characters source as a function returning the next char code respectively
  11448. * `null` if there are no more characters left.
  11449. * @param {!function(number)} dst Code points destination as a function successively called with each converted code
  11450. * point.
  11451. */
  11452. utfx.UTF16toUTF8 = function(src, dst) {
  11453. var c1, c2 = null;
  11454. while (true) {
  11455. if ((c1 = c2 !== null ? c2 : src()) === null)
  11456. break;
  11457. if (c1 >= 0xD800 && c1 <= 0xDFFF) {
  11458. if ((c2 = src()) !== null) {
  11459. if (c2 >= 0xDC00 && c2 <= 0xDFFF) {
  11460. dst((c1-0xD800)*0x400+c2-0xDC00+0x10000);
  11461. c2 = null; continue;
  11462. }
  11463. }
  11464. }
  11465. dst(c1);
  11466. }
  11467. if (c2 !== null) dst(c2);
  11468. };
  11469. /**
  11470. * Converts UTF8 code points to UTF16 characters.
  11471. * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point
  11472. * respectively `null` if there are no more code points left or a single numeric code point.
  11473. * @param {!function(number)} dst Characters destination as a function successively called with each converted char code.
  11474. * @throws {RangeError} If a code point is out of range
  11475. */
  11476. utfx.UTF8toUTF16 = function(src, dst) {
  11477. var cp = null;
  11478. if (typeof src === 'number')
  11479. cp = src, src = function() { return null; };
  11480. while (cp !== null || (cp = src()) !== null) {
  11481. if (cp <= 0xFFFF)
  11482. dst(cp);
  11483. else
  11484. cp -= 0x10000,
  11485. dst((cp>>10)+0xD800),
  11486. dst((cp%0x400)+0xDC00);
  11487. cp = null;
  11488. }
  11489. };
  11490. /**
  11491. * Converts and encodes UTF16 characters to UTF8 bytes.
  11492. * @param {!function():number|null} src Characters source as a function returning the next char code respectively `null`
  11493. * if there are no more characters left.
  11494. * @param {!function(number)} dst Bytes destination as a function successively called with the next byte.
  11495. */
  11496. utfx.encodeUTF16toUTF8 = function(src, dst) {
  11497. utfx.UTF16toUTF8(src, function(cp) {
  11498. utfx.encodeUTF8(cp, dst);
  11499. });
  11500. };
  11501. /**
  11502. * Decodes and converts UTF8 bytes to UTF16 characters.
  11503. * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there
  11504. * are no more bytes left.
  11505. * @param {!function(number)} dst Characters destination as a function successively called with each converted char code.
  11506. * @throws {RangeError} If a starting byte is invalid in UTF8
  11507. * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the remaining bytes.
  11508. */
  11509. utfx.decodeUTF8toUTF16 = function(src, dst) {
  11510. utfx.decodeUTF8(src, function(cp) {
  11511. utfx.UTF8toUTF16(cp, dst);
  11512. });
  11513. };
  11514. /**
  11515. * Calculates the byte length of an UTF8 code point.
  11516. * @param {number} cp UTF8 code point
  11517. * @returns {number} Byte length
  11518. */
  11519. utfx.calculateCodePoint = function(cp) {
  11520. return (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
  11521. };
  11522. /**
  11523. * Calculates the number of UTF8 bytes required to store UTF8 code points.
  11524. * @param {(!function():number|null)} src Code points source as a function returning the next code point respectively
  11525. * `null` if there are no more code points left.
  11526. * @returns {number} The number of UTF8 bytes required
  11527. */
  11528. utfx.calculateUTF8 = function(src) {
  11529. var cp, l=0;
  11530. while ((cp = src()) !== null)
  11531. l += utfx.calculateCodePoint(cp);
  11532. return l;
  11533. };
  11534. /**
  11535. * Calculates the number of UTF8 code points respectively UTF8 bytes required to store UTF16 char codes.
  11536. * @param {(!function():number|null)} src Characters source as a function returning the next char code respectively
  11537. * `null` if there are no more characters left.
  11538. * @returns {!Array.<number>} The number of UTF8 code points at index 0 and the number of UTF8 bytes required at index 1.
  11539. */
  11540. utfx.calculateUTF16asUTF8 = function(src) {
  11541. var n=0, l=0;
  11542. utfx.UTF16toUTF8(src, function(cp) {
  11543. ++n; l += utfx.calculateCodePoint(cp);
  11544. });
  11545. return [n,l];
  11546. };
  11547. return utfx;
  11548. }();
  11549. // encodings/utf8
  11550. /**
  11551. * Encodes this ByteBuffer's contents between {@link ByteBuffer#offset} and {@link ByteBuffer#limit} to an UTF8 encoded
  11552. * string.
  11553. * @returns {string} Hex encoded string
  11554. * @throws {RangeError} If `offset > limit`
  11555. * @expose
  11556. */
  11557. ByteBufferPrototype.toUTF8 = function(begin, end) {
  11558. if (typeof begin === 'undefined') begin = this.offset;
  11559. if (typeof end === 'undefined') end = this.limit;
  11560. if (!this.noAssert) {
  11561. if (typeof begin !== 'number' || begin % 1 !== 0)
  11562. throw TypeError("Illegal begin: Not an integer");
  11563. begin >>>= 0;
  11564. if (typeof end !== 'number' || end % 1 !== 0)
  11565. throw TypeError("Illegal end: Not an integer");
  11566. end >>>= 0;
  11567. if (begin < 0 || begin > end || end > this.buffer.byteLength)
  11568. throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
  11569. }
  11570. var sd; try {
  11571. utfx.decodeUTF8toUTF16(function() {
  11572. return begin < end ? this.view.getUint8(begin++) : null;
  11573. }.bind(this), sd = stringDestination());
  11574. } catch (e) {
  11575. if (begin !== end)
  11576. throw RangeError("Illegal range: Truncated data, "+begin+" != "+end);
  11577. }
  11578. return sd();
  11579. };
  11580. /**
  11581. * Decodes an UTF8 encoded string to a ByteBuffer.
  11582. * @param {string} str String to decode
  11583. * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to
  11584. * {@link ByteBuffer.DEFAULT_ENDIAN}.
  11585. * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to
  11586. * {@link ByteBuffer.DEFAULT_NOASSERT}.
  11587. * @returns {!ByteBuffer} ByteBuffer
  11588. * @expose
  11589. */
  11590. ByteBuffer.fromUTF8 = function(str, littleEndian, noAssert) {
  11591. if (!noAssert)
  11592. if (typeof str !== 'string')
  11593. throw TypeError("Illegal str: Not a string");
  11594. var bb = new ByteBuffer(utfx.calculateUTF16asUTF8(stringSource(str), true)[1], littleEndian, noAssert),
  11595. i = 0;
  11596. utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
  11597. bb.view.setUint8(i++, b);
  11598. });
  11599. bb.limit = i;
  11600. return bb;
  11601. };
  11602. return ByteBuffer;
  11603. }
  11604. /* CommonJS */ if (typeof require === 'function' && typeof module === 'object' && module && typeof exports === 'object' && exports)
  11605. module['exports'] = (function() {
  11606. var Long; try { Long = require("long"); } catch (e) {}
  11607. return loadByteBuffer(Long);
  11608. })();
  11609. /* AMD */ else if (typeof define === 'function' && define["amd"])
  11610. define("ByteBuffer", ["Long"], function(Long) { return loadByteBuffer(Long); });
  11611. /* Global */ else
  11612. (global["dcodeIO"] = global["dcodeIO"] || {})["ByteBuffer"] = loadByteBuffer(global["dcodeIO"]["Long"]);
  11613. })(this);
  11614. /*
  11615. Copyright 2013 Daniel Wirtz <dcode@dcode.io>
  11616. Licensed under the Apache License, Version 2.0 (the "License");
  11617. you may not use this file except in compliance with the License.
  11618. You may obtain a copy of the License at
  11619. http://www.apache.org/licenses/LICENSE-2.0
  11620. Unless required by applicable law or agreed to in writing, software
  11621. distributed under the License is distributed on an "AS IS" BASIS,
  11622. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11623. See the License for the specific language governing permissions and
  11624. limitations under the License.
  11625. */
  11626. /**
  11627. * @license ProtoBuf.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
  11628. * Released under the Apache License, Version 2.0
  11629. * see: https://github.com/dcodeIO/ProtoBuf.js for details
  11630. */
  11631. (function(global) {
  11632. "use strict";
  11633. function init(ByteBuffer) {
  11634. /**
  11635. * The ProtoBuf namespace.
  11636. * @exports ProtoBuf
  11637. * @namespace
  11638. * @expose
  11639. */
  11640. var ProtoBuf = {};
  11641. /**
  11642. * ProtoBuf.js version.
  11643. * @type {string}
  11644. * @const
  11645. * @expose
  11646. */
  11647. ProtoBuf.VERSION = "3.8.0";
  11648. /**
  11649. * Wire types.
  11650. * @type {Object.<string,number>}
  11651. * @const
  11652. * @expose
  11653. */
  11654. ProtoBuf.WIRE_TYPES = {};
  11655. /**
  11656. * Varint wire type.
  11657. * @type {number}
  11658. * @expose
  11659. */
  11660. ProtoBuf.WIRE_TYPES.VARINT = 0;
  11661. /**
  11662. * Fixed 64 bits wire type.
  11663. * @type {number}
  11664. * @const
  11665. * @expose
  11666. */
  11667. ProtoBuf.WIRE_TYPES.BITS64 = 1;
  11668. /**
  11669. * Length delimited wire type.
  11670. * @type {number}
  11671. * @const
  11672. * @expose
  11673. */
  11674. ProtoBuf.WIRE_TYPES.LDELIM = 2;
  11675. /**
  11676. * Start group wire type.
  11677. * @type {number}
  11678. * @const
  11679. * @expose
  11680. */
  11681. ProtoBuf.WIRE_TYPES.STARTGROUP = 3;
  11682. /**
  11683. * End group wire type.
  11684. * @type {number}
  11685. * @const
  11686. * @expose
  11687. */
  11688. ProtoBuf.WIRE_TYPES.ENDGROUP = 4;
  11689. /**
  11690. * Fixed 32 bits wire type.
  11691. * @type {number}
  11692. * @const
  11693. * @expose
  11694. */
  11695. ProtoBuf.WIRE_TYPES.BITS32 = 5;
  11696. /**
  11697. * Packable wire types.
  11698. * @type {!Array.<number>}
  11699. * @const
  11700. * @expose
  11701. */
  11702. ProtoBuf.PACKABLE_WIRE_TYPES = [
  11703. ProtoBuf.WIRE_TYPES.VARINT,
  11704. ProtoBuf.WIRE_TYPES.BITS64,
  11705. ProtoBuf.WIRE_TYPES.BITS32
  11706. ];
  11707. /**
  11708. * Types.
  11709. * @dict
  11710. * @type {Object.<string,{name: string, wireType: number}>}
  11711. * @const
  11712. * @expose
  11713. */
  11714. ProtoBuf.TYPES = {
  11715. // According to the protobuf spec.
  11716. "int32": {
  11717. name: "int32",
  11718. wireType: ProtoBuf.WIRE_TYPES.VARINT
  11719. },
  11720. "uint32": {
  11721. name: "uint32",
  11722. wireType: ProtoBuf.WIRE_TYPES.VARINT
  11723. },
  11724. "sint32": {
  11725. name: "sint32",
  11726. wireType: ProtoBuf.WIRE_TYPES.VARINT
  11727. },
  11728. "int64": {
  11729. name: "int64",
  11730. wireType: ProtoBuf.WIRE_TYPES.VARINT
  11731. },
  11732. "uint64": {
  11733. name: "uint64",
  11734. wireType: ProtoBuf.WIRE_TYPES.VARINT
  11735. },
  11736. "sint64": {
  11737. name: "sint64",
  11738. wireType: ProtoBuf.WIRE_TYPES.VARINT
  11739. },
  11740. "bool": {
  11741. name: "bool",
  11742. wireType: ProtoBuf.WIRE_TYPES.VARINT
  11743. },
  11744. "double": {
  11745. name: "double",
  11746. wireType: ProtoBuf.WIRE_TYPES.BITS64
  11747. },
  11748. "string": {
  11749. name: "string",
  11750. wireType: ProtoBuf.WIRE_TYPES.LDELIM
  11751. },
  11752. "bytes": {
  11753. name: "bytes",
  11754. wireType: ProtoBuf.WIRE_TYPES.LDELIM
  11755. },
  11756. "fixed32": {
  11757. name: "fixed32",
  11758. wireType: ProtoBuf.WIRE_TYPES.BITS32
  11759. },
  11760. "sfixed32": {
  11761. name: "sfixed32",
  11762. wireType: ProtoBuf.WIRE_TYPES.BITS32
  11763. },
  11764. "fixed64": {
  11765. name: "fixed64",
  11766. wireType: ProtoBuf.WIRE_TYPES.BITS64
  11767. },
  11768. "sfixed64": {
  11769. name: "sfixed64",
  11770. wireType: ProtoBuf.WIRE_TYPES.BITS64
  11771. },
  11772. "float": {
  11773. name: "float",
  11774. wireType: ProtoBuf.WIRE_TYPES.BITS32
  11775. },
  11776. "enum": {
  11777. name: "enum",
  11778. wireType: ProtoBuf.WIRE_TYPES.VARINT
  11779. },
  11780. "message": {
  11781. name: "message",
  11782. wireType: ProtoBuf.WIRE_TYPES.LDELIM
  11783. },
  11784. "group": {
  11785. name: "group",
  11786. wireType: ProtoBuf.WIRE_TYPES.STARTGROUP
  11787. }
  11788. };
  11789. /**
  11790. * Minimum field id.
  11791. * @type {number}
  11792. * @const
  11793. * @expose
  11794. */
  11795. ProtoBuf.ID_MIN = 1;
  11796. /**
  11797. * Maximum field id.
  11798. * @type {number}
  11799. * @const
  11800. * @expose
  11801. */
  11802. ProtoBuf.ID_MAX = 0x1FFFFFFF;
  11803. /**
  11804. * @type {!function(new: ByteBuffer, ...[*])}
  11805. * @expose
  11806. */
  11807. ProtoBuf.ByteBuffer = ByteBuffer;
  11808. /**
  11809. * @type {?function(new: Long, ...[*])}
  11810. * @expose
  11811. */
  11812. ProtoBuf.Long = ByteBuffer.Long || null;
  11813. /**
  11814. * If set to `true`, field names will be converted from underscore notation to camel case. Defaults to `false`.
  11815. * Must be set prior to parsing.
  11816. * @type {boolean}
  11817. * @expose
  11818. */
  11819. ProtoBuf.convertFieldsToCamelCase = false;
  11820. /**
  11821. * By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by
  11822. * setting this to `false` prior to building messages.
  11823. * @type {boolean}
  11824. * @expose
  11825. */
  11826. ProtoBuf.populateAccessors = true;
  11827. /**
  11828. * @alias ProtoBuf.Util
  11829. * @expose
  11830. */
  11831. ProtoBuf.Util = (function() {
  11832. "use strict";
  11833. // Object.create polyfill
  11834. // ref: https://developer.mozilla.org/de/docs/JavaScript/Reference/Global_Objects/Object/create
  11835. if (!Object.create)
  11836. /** @expose */
  11837. Object.create = function (o) {
  11838. if (arguments.length > 1)
  11839. throw Error('Object.create polyfill only accepts the first parameter.');
  11840. function F() {}
  11841. F.prototype = o;
  11842. return new F();
  11843. };
  11844. /**
  11845. * ProtoBuf utilities.
  11846. * @exports ProtoBuf.Util
  11847. * @namespace
  11848. */
  11849. var Util = {};
  11850. /**
  11851. * Flag if running in node (fs is available) or not.
  11852. * @type {boolean}
  11853. * @const
  11854. * @expose
  11855. */
  11856. Util.IS_NODE = false;
  11857. try {
  11858. // There is no reliable way to detect node.js as an environment, so our
  11859. // best bet is to feature-detect what we actually need.
  11860. Util.IS_NODE =
  11861. typeof require === 'function' &&
  11862. typeof require("fs").readFileSync === 'function' &&
  11863. typeof require("path").resolve === 'function';
  11864. } catch (e) {}
  11865. /**
  11866. * Constructs a XMLHttpRequest object.
  11867. * @return {XMLHttpRequest}
  11868. * @throws {Error} If XMLHttpRequest is not supported
  11869. * @expose
  11870. */
  11871. Util.XHR = function() {
  11872. // No dependencies please, ref: http://www.quirksmode.org/js/xmlhttp.html
  11873. var XMLHttpFactories = [
  11874. function () {return new XMLHttpRequest()},
  11875. function () {return new ActiveXObject("Msxml2.XMLHTTP")},
  11876. function () {return new ActiveXObject("Msxml3.XMLHTTP")},
  11877. function () {return new ActiveXObject("Microsoft.XMLHTTP")}
  11878. ];
  11879. /** @type {?XMLHttpRequest} */
  11880. var xhr = null;
  11881. for (var i=0;i<XMLHttpFactories.length;i++) {
  11882. try { xhr = XMLHttpFactories[i](); }
  11883. catch (e) { continue; }
  11884. break;
  11885. }
  11886. if (!xhr)
  11887. throw Error("XMLHttpRequest is not supported");
  11888. return xhr;
  11889. };
  11890. /**
  11891. * Fetches a resource.
  11892. * @param {string} path Resource path
  11893. * @param {function(?string)=} callback Callback receiving the resource's contents. If omitted the resource will
  11894. * be fetched synchronously. If the request failed, contents will be null.
  11895. * @return {?string|undefined} Resource contents if callback is omitted (null if the request failed), else undefined.
  11896. * @expose
  11897. */
  11898. Util.fetch = function(path, callback) {
  11899. if (callback && typeof callback != 'function')
  11900. callback = null;
  11901. if (Util.IS_NODE) {
  11902. if (callback) {
  11903. require("fs").readFile(path, function(err, data) {
  11904. if (err)
  11905. callback(null);
  11906. else
  11907. callback(""+data);
  11908. });
  11909. } else
  11910. try {
  11911. return require("fs").readFileSync(path);
  11912. } catch (e) {
  11913. return null;
  11914. }
  11915. } else {
  11916. var xhr = Util.XHR();
  11917. xhr.open('GET', path, callback ? true : false);
  11918. // xhr.setRequestHeader('User-Agent', 'XMLHTTP/1.0');
  11919. xhr.setRequestHeader('Accept', 'text/plain');
  11920. if (typeof xhr.overrideMimeType === 'function') xhr.overrideMimeType('text/plain');
  11921. if (callback) {
  11922. xhr.onreadystatechange = function() {
  11923. if (xhr.readyState != 4) return;
  11924. if (/* remote */ xhr.status == 200 || /* local */ (xhr.status == 0 && typeof xhr.responseText === 'string'))
  11925. callback(xhr.responseText);
  11926. else
  11927. callback(null);
  11928. };
  11929. if (xhr.readyState == 4)
  11930. return;
  11931. xhr.send(null);
  11932. } else {
  11933. xhr.send(null);
  11934. if (/* remote */ xhr.status == 200 || /* local */ (xhr.status == 0 && typeof xhr.responseText === 'string'))
  11935. return xhr.responseText;
  11936. return null;
  11937. }
  11938. }
  11939. };
  11940. /**
  11941. * Tests if an object is an array.
  11942. * @function
  11943. * @param {*} obj Object to test
  11944. * @returns {boolean} true if it is an array, else false
  11945. * @expose
  11946. */
  11947. Util.isArray = Array.isArray || function(obj) {
  11948. return Object.prototype.toString.call(obj) === "[object Array]";
  11949. };
  11950. return Util;
  11951. })();
  11952. /**
  11953. * Language expressions.
  11954. * @type {!Object.<string,string|!RegExp>}
  11955. * @expose
  11956. */
  11957. ProtoBuf.Lang = {
  11958. OPEN: "{",
  11959. CLOSE: "}",
  11960. OPTOPEN: "[",
  11961. OPTCLOSE: "]",
  11962. OPTEND: ",",
  11963. EQUAL: "=",
  11964. END: ";",
  11965. STRINGOPEN: '"',
  11966. STRINGCLOSE: '"',
  11967. STRINGOPEN_SQ: "'",
  11968. STRINGCLOSE_SQ: "'",
  11969. COPTOPEN: '(',
  11970. COPTCLOSE: ')',
  11971. DELIM: /[\s\{\}=;\[\],'"\(\)]/g,
  11972. // KEYWORD: /^(?:package|option|import|message|enum|extend|service|syntax|extensions|group)$/,
  11973. RULE: /^(?:required|optional|repeated)$/,
  11974. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  11975. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  11976. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  11977. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  11978. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  11979. NUMBER: /^-?(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+|([0-9]*\.[0-9]+([Ee][+-]?[0-9]+)?))$/,
  11980. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  11981. NUMBER_HEX: /^0x[0-9a-fA-F]+$/,
  11982. NUMBER_OCT: /^0[0-7]+$/,
  11983. NUMBER_FLT: /^[0-9]*\.[0-9]+([Ee][+-]?[0-9]+)?$/,
  11984. ID: /^(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/,
  11985. NEGID: /^\-?(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/,
  11986. WHITESPACE: /\s/,
  11987. STRING: /['"]([^'"\\]*(\\.[^"\\]*)*)['"]/g,
  11988. BOOL: /^(?:true|false)$/i
  11989. };
  11990. /**
  11991. * @alias ProtoBuf.DotProto
  11992. * @expose
  11993. */
  11994. ProtoBuf.DotProto = (function(ProtoBuf, Lang) {
  11995. "use strict";
  11996. /**
  11997. * Utilities to parse .proto files.
  11998. * @exports ProtoBuf.DotProto
  11999. * @namespace
  12000. */
  12001. var DotProto = {};
  12002. /**
  12003. * Constructs a new Tokenizer.
  12004. * @exports ProtoBuf.DotProto.Tokenizer
  12005. * @class prototype tokenizer
  12006. * @param {string} proto Proto to tokenize
  12007. * @constructor
  12008. */
  12009. var Tokenizer = function(proto) {
  12010. /**
  12011. * Source to parse.
  12012. * @type {string}
  12013. * @expose
  12014. */
  12015. this.source = ""+proto; // In case it's a buffer
  12016. /**
  12017. * Current index.
  12018. * @type {number}
  12019. * @expose
  12020. */
  12021. this.index = 0;
  12022. /**
  12023. * Current line.
  12024. * @type {number}
  12025. * @expose
  12026. */
  12027. this.line = 1;
  12028. /**
  12029. * Stacked values.
  12030. * @type {Array}
  12031. * @expose
  12032. */
  12033. this.stack = [];
  12034. /**
  12035. * Whether currently reading a string or not.
  12036. * @type {boolean}
  12037. * @expose
  12038. */
  12039. this.readingString = false;
  12040. /**
  12041. * Whatever character ends the string. Either a single or double quote character.
  12042. * @type {string}
  12043. * @expose
  12044. */
  12045. this.stringEndsWith = Lang.STRINGCLOSE;
  12046. };
  12047. /**
  12048. * @alias ProtoBuf.DotProto.Tokenizer.prototype
  12049. * @inner
  12050. */
  12051. var TokenizerPrototype = Tokenizer.prototype;
  12052. /**
  12053. * Reads a string beginning at the current index.
  12054. * @return {string} The string
  12055. * @throws {Error} If it's not a valid string
  12056. * @private
  12057. */
  12058. TokenizerPrototype._readString = function() {
  12059. Lang.STRING.lastIndex = this.index-1; // Include the open quote
  12060. var match;
  12061. if ((match = Lang.STRING.exec(this.source)) !== null) {
  12062. var s = match[1];
  12063. this.index = Lang.STRING.lastIndex;
  12064. this.stack.push(this.stringEndsWith);
  12065. return s;
  12066. }
  12067. throw Error("Unterminated string at line "+this.line+", index "+this.index);
  12068. };
  12069. /**
  12070. * Gets the next token and advances by one.
  12071. * @return {?string} Token or `null` on EOF
  12072. * @throws {Error} If it's not a valid proto file
  12073. * @expose
  12074. */
  12075. TokenizerPrototype.next = function() {
  12076. if (this.stack.length > 0)
  12077. return this.stack.shift();
  12078. if (this.index >= this.source.length)
  12079. return null; // No more tokens
  12080. if (this.readingString) {
  12081. this.readingString = false;
  12082. return this._readString();
  12083. }
  12084. var repeat, last;
  12085. do {
  12086. repeat = false;
  12087. // Strip white spaces
  12088. while (Lang.WHITESPACE.test(last = this.source.charAt(this.index))) {
  12089. this.index++;
  12090. if (last === "\n")
  12091. this.line++;
  12092. if (this.index === this.source.length)
  12093. return null;
  12094. }
  12095. // Strip comments
  12096. if (this.source.charAt(this.index) === '/') {
  12097. if (this.source.charAt(++this.index) === '/') { // Single line
  12098. while (this.source.charAt(this.index) !== "\n") {
  12099. this.index++;
  12100. if (this.index == this.source.length)
  12101. return null;
  12102. }
  12103. this.index++;
  12104. this.line++;
  12105. repeat = true;
  12106. } else if (this.source.charAt(this.index) === '*') { /* Block */
  12107. last = '';
  12108. while (last+(last=this.source.charAt(this.index)) !== '*/') {
  12109. this.index++;
  12110. if (last === "\n")
  12111. this.line++;
  12112. if (this.index === this.source.length)
  12113. return null;
  12114. }
  12115. this.index++;
  12116. repeat = true;
  12117. } else
  12118. throw Error("Unterminated comment at line "+this.line+": /"+this.source.charAt(this.index));
  12119. }
  12120. } while (repeat);
  12121. if (this.index === this.source.length) return null;
  12122. // Read the next token
  12123. var end = this.index;
  12124. Lang.DELIM.lastIndex = 0;
  12125. var delim = Lang.DELIM.test(this.source.charAt(end));
  12126. if (!delim) {
  12127. ++end;
  12128. while(end < this.source.length && !Lang.DELIM.test(this.source.charAt(end)))
  12129. end++;
  12130. } else
  12131. ++end;
  12132. var token = this.source.substring(this.index, this.index = end);
  12133. if (token === Lang.STRINGOPEN)
  12134. this.readingString = true,
  12135. this.stringEndsWith = Lang.STRINGCLOSE;
  12136. else if (token === Lang.STRINGOPEN_SQ)
  12137. this.readingString = true,
  12138. this.stringEndsWith = Lang.STRINGCLOSE_SQ;
  12139. return token;
  12140. };
  12141. /**
  12142. * Peeks for the next token.
  12143. * @return {?string} Token or `null` on EOF
  12144. * @throws {Error} If it's not a valid proto file
  12145. * @expose
  12146. */
  12147. TokenizerPrototype.peek = function() {
  12148. if (this.stack.length === 0) {
  12149. var token = this.next();
  12150. if (token === null)
  12151. return null;
  12152. this.stack.push(token);
  12153. }
  12154. return this.stack[0];
  12155. };
  12156. /**
  12157. * Returns a string representation of this object.
  12158. * @return {string} String representation as of "Tokenizer(index/length)"
  12159. * @expose
  12160. */
  12161. TokenizerPrototype.toString = function() {
  12162. return "Tokenizer("+this.index+"/"+this.source.length+" at line "+this.line+")";
  12163. };
  12164. /**
  12165. * @alias ProtoBuf.DotProto.Tokenizer
  12166. * @expose
  12167. */
  12168. DotProto.Tokenizer = Tokenizer;
  12169. /**
  12170. * Constructs a new Parser.
  12171. * @exports ProtoBuf.DotProto.Parser
  12172. * @class prototype parser
  12173. * @param {string} proto Protocol source
  12174. * @constructor
  12175. */
  12176. var Parser = function(proto) {
  12177. /**
  12178. * Tokenizer.
  12179. * @type {ProtoBuf.DotProto.Tokenizer}
  12180. * @expose
  12181. */
  12182. this.tn = new Tokenizer(proto);
  12183. };
  12184. /**
  12185. * @alias ProtoBuf.DotProto.Parser.prototype
  12186. * @inner
  12187. */
  12188. var ParserPrototype = Parser.prototype;
  12189. /**
  12190. * Runs the parser.
  12191. * @return {{package: string|null, messages: Array.<object>, enums: Array.<object>, imports: Array.<string>, options: object<string,*>}}
  12192. * @throws {Error} If the source cannot be parsed
  12193. * @expose
  12194. */
  12195. ParserPrototype.parse = function() {
  12196. var topLevel = {
  12197. "name": "[ROOT]", // temporary
  12198. "package": null,
  12199. "messages": [],
  12200. "enums": [],
  12201. "imports": [],
  12202. "options": {},
  12203. "services": []
  12204. };
  12205. var token, head = true;
  12206. while(token = this.tn.next()) {
  12207. switch (token) {
  12208. case 'package':
  12209. if (!head || topLevel["package"] !== null)
  12210. throw Error("Unexpected package at line "+this.tn.line);
  12211. topLevel["package"] = this._parsePackage(token);
  12212. break;
  12213. case 'import':
  12214. if (!head)
  12215. throw Error("Unexpected import at line "+this.tn.line);
  12216. topLevel.imports.push(this._parseImport(token));
  12217. break;
  12218. case 'message':
  12219. this._parseMessage(topLevel, null, token);
  12220. head = false;
  12221. break;
  12222. case 'enum':
  12223. this._parseEnum(topLevel, token);
  12224. head = false;
  12225. break;
  12226. case 'option':
  12227. if (!head)
  12228. throw Error("Unexpected option at line "+this.tn.line);
  12229. this._parseOption(topLevel, token);
  12230. break;
  12231. case 'service':
  12232. this._parseService(topLevel, token);
  12233. break;
  12234. case 'extend':
  12235. this._parseExtend(topLevel, token);
  12236. break;
  12237. case 'syntax':
  12238. this._parseIgnoredStatement(topLevel, token);
  12239. break;
  12240. default:
  12241. throw Error("Unexpected token at line "+this.tn.line+": "+token);
  12242. }
  12243. }
  12244. delete topLevel["name"];
  12245. return topLevel;
  12246. };
  12247. /**
  12248. * Parses a number value.
  12249. * @param {string} val Number value to parse
  12250. * @return {number} Number
  12251. * @throws {Error} If the number value is invalid
  12252. * @private
  12253. */
  12254. ParserPrototype._parseNumber = function(val) {
  12255. var sign = 1;
  12256. if (val.charAt(0) == '-')
  12257. sign = -1,
  12258. val = val.substring(1);
  12259. if (Lang.NUMBER_DEC.test(val))
  12260. return sign*parseInt(val, 10);
  12261. else if (Lang.NUMBER_HEX.test(val))
  12262. return sign*parseInt(val.substring(2), 16);
  12263. else if (Lang.NUMBER_OCT.test(val))
  12264. return sign*parseInt(val.substring(1), 8);
  12265. else if (Lang.NUMBER_FLT.test(val))
  12266. return sign*parseFloat(val);
  12267. throw Error("Illegal number at line "+this.tn.line+": "+(sign < 0 ? '-' : '')+val);
  12268. };
  12269. /**
  12270. * Parses a (possibly multiline) string.
  12271. * @returns {string}
  12272. * @private
  12273. */
  12274. ParserPrototype._parseString = function() {
  12275. var value = "", token;
  12276. do {
  12277. token = this.tn.next(); // Known to be = this.tn.stringEndsWith
  12278. value += this.tn.next();
  12279. token = this.tn.next();
  12280. if (token !== this.tn.stringEndsWith)
  12281. throw Error("Illegal end of string at line "+this.tn.line+": "+token);
  12282. token = this.tn.peek();
  12283. } while (token === Lang.STRINGOPEN || token === Lang.STRINGOPEN_SQ);
  12284. return value;
  12285. };
  12286. /**
  12287. * Parses an ID value.
  12288. * @param {string} val ID value to parse
  12289. * @param {boolean=} neg Whether the ID may be negative, defaults to `false`
  12290. * @returns {number} ID
  12291. * @throws {Error} If the ID value is invalid
  12292. * @private
  12293. */
  12294. ParserPrototype._parseId = function(val, neg) {
  12295. var id = -1;
  12296. var sign = 1;
  12297. if (val.charAt(0) == '-')
  12298. sign = -1,
  12299. val = val.substring(1);
  12300. if (Lang.NUMBER_DEC.test(val))
  12301. id = parseInt(val);
  12302. else if (Lang.NUMBER_HEX.test(val))
  12303. id = parseInt(val.substring(2), 16);
  12304. else if (Lang.NUMBER_OCT.test(val))
  12305. id = parseInt(val.substring(1), 8);
  12306. else
  12307. throw Error("Illegal id at line "+this.tn.line+": "+(sign < 0 ? '-' : '')+val);
  12308. id = (sign*id)|0; // Force to 32bit
  12309. if (!neg && id < 0)
  12310. throw Error("Illegal id at line "+this.tn.line+": "+(sign < 0 ? '-' : '')+val);
  12311. return id;
  12312. };
  12313. /**
  12314. * Parses the package definition.
  12315. * @param {string} token Initial token
  12316. * @return {string} Package name
  12317. * @throws {Error} If the package definition cannot be parsed
  12318. * @private
  12319. */
  12320. ParserPrototype._parsePackage = function(token) {
  12321. token = this.tn.next();
  12322. if (!Lang.TYPEREF.test(token))
  12323. throw Error("Illegal package name at line "+this.tn.line+": "+token);
  12324. var pkg = token;
  12325. token = this.tn.next();
  12326. if (token != Lang.END)
  12327. throw Error("Illegal end of package at line "+this.tn.line+": "+token);
  12328. return pkg;
  12329. };
  12330. /**
  12331. * Parses an import definition.
  12332. * @param {string} token Initial token
  12333. * @return {string} Import file name
  12334. * @throws {Error} If the import definition cannot be parsed
  12335. * @private
  12336. */
  12337. ParserPrototype._parseImport = function(token) {
  12338. token = this.tn.peek();
  12339. if (token === "public")
  12340. this.tn.next(),
  12341. token = this.tn.peek();
  12342. if (token !== Lang.STRINGOPEN && token !== Lang.STRINGOPEN_SQ)
  12343. throw Error("Illegal start of import at line "+this.tn.line+": "+token);
  12344. var imported = this._parseString();
  12345. token = this.tn.next();
  12346. if (token !== Lang.END)
  12347. throw Error("Illegal end of import at line "+this.tn.line+": "+token);
  12348. return imported;
  12349. };
  12350. /**
  12351. * Parses a namespace option.
  12352. * @param {Object} parent Parent definition
  12353. * @param {string} token Initial token
  12354. * @throws {Error} If the option cannot be parsed
  12355. * @private
  12356. */
  12357. ParserPrototype._parseOption = function(parent, token) {
  12358. token = this.tn.next();
  12359. var custom = false;
  12360. if (token == Lang.COPTOPEN)
  12361. custom = true,
  12362. token = this.tn.next();
  12363. if (!Lang.TYPEREF.test(token))
  12364. // we can allow options of the form google.protobuf.* since they will just get ignored anyways
  12365. if (!/google\.protobuf\./.test(token))
  12366. throw Error("Illegal option name in message "+parent.name+" at line "+this.tn.line+": "+token);
  12367. var name = token;
  12368. token = this.tn.next();
  12369. if (custom) { // (my_method_option).foo, (my_method_option), some_method_option, (foo.my_option).bar
  12370. if (token !== Lang.COPTCLOSE)
  12371. throw Error("Illegal end in message "+parent.name+", option "+name+" at line "+this.tn.line+": "+token);
  12372. name = '('+name+')';
  12373. token = this.tn.next();
  12374. if (Lang.FQTYPEREF.test(token))
  12375. name += token,
  12376. token = this.tn.next();
  12377. }
  12378. if (token !== Lang.EQUAL)
  12379. throw Error("Illegal operator in message "+parent.name+", option "+name+" at line "+this.tn.line+": "+token);
  12380. var value;
  12381. token = this.tn.peek();
  12382. if (token === Lang.STRINGOPEN || token === Lang.STRINGOPEN_SQ)
  12383. value = this._parseString();
  12384. else {
  12385. this.tn.next();
  12386. if (Lang.NUMBER.test(token))
  12387. value = this._parseNumber(token, true);
  12388. else if (Lang.BOOL.test(token))
  12389. value = token === 'true';
  12390. else if (Lang.TYPEREF.test(token))
  12391. value = token;
  12392. else
  12393. throw Error("Illegal option value in message "+parent.name+", option "+name+" at line "+this.tn.line+": "+token);
  12394. }
  12395. token = this.tn.next();
  12396. if (token !== Lang.END)
  12397. throw Error("Illegal end of option in message "+parent.name+", option "+name+" at line "+this.tn.line+": "+token);
  12398. parent["options"][name] = value;
  12399. };
  12400. /**
  12401. * Parses an ignored statement of the form ['keyword', ..., ';'].
  12402. * @param {Object} parent Parent definition
  12403. * @param {string} keyword Initial token
  12404. * @throws {Error} If the directive cannot be parsed
  12405. * @private
  12406. */
  12407. ParserPrototype._parseIgnoredStatement = function(parent, keyword) {
  12408. var token;
  12409. do {
  12410. token = this.tn.next();
  12411. if (token === null)
  12412. throw Error("Unexpected EOF in "+parent.name+", "+keyword+" at line "+this.tn.line);
  12413. if (token === Lang.END)
  12414. break;
  12415. } while (true);
  12416. };
  12417. /**
  12418. * Parses a service definition.
  12419. * @param {Object} parent Parent definition
  12420. * @param {string} token Initial token
  12421. * @throws {Error} If the service cannot be parsed
  12422. * @private
  12423. */
  12424. ParserPrototype._parseService = function(parent, token) {
  12425. token = this.tn.next();
  12426. if (!Lang.NAME.test(token))
  12427. throw Error("Illegal service name at line "+this.tn.line+": "+token);
  12428. var name = token;
  12429. var svc = {
  12430. "name": name,
  12431. "rpc": {},
  12432. "options": {}
  12433. };
  12434. token = this.tn.next();
  12435. if (token !== Lang.OPEN)
  12436. throw Error("Illegal start of service "+name+" at line "+this.tn.line+": "+token);
  12437. do {
  12438. token = this.tn.next();
  12439. if (token === "option")
  12440. this._parseOption(svc, token);
  12441. else if (token === 'rpc')
  12442. this._parseServiceRPC(svc, token);
  12443. else if (token !== Lang.CLOSE)
  12444. throw Error("Illegal type of service "+name+" at line "+this.tn.line+": "+token);
  12445. } while (token !== Lang.CLOSE);
  12446. parent["services"].push(svc);
  12447. };
  12448. /**
  12449. * Parses a RPC service definition of the form ['rpc', name, (request), 'returns', (response)].
  12450. * @param {Object} svc Parent definition
  12451. * @param {string} token Initial token
  12452. * @private
  12453. */
  12454. ParserPrototype._parseServiceRPC = function(svc, token) {
  12455. var type = token;
  12456. token = this.tn.next();
  12457. if (!Lang.NAME.test(token))
  12458. throw Error("Illegal method name in service "+svc["name"]+" at line "+this.tn.line+": "+token);
  12459. var name = token;
  12460. var method = {
  12461. "request": null,
  12462. "response": null,
  12463. "options": {}
  12464. };
  12465. token = this.tn.next();
  12466. if (token !== Lang.COPTOPEN)
  12467. throw Error("Illegal start of request type in service "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token);
  12468. token = this.tn.next();
  12469. if (!Lang.TYPEREF.test(token))
  12470. throw Error("Illegal request type in service "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token);
  12471. method["request"] = token;
  12472. token = this.tn.next();
  12473. if (token != Lang.COPTCLOSE)
  12474. throw Error("Illegal end of request type in service "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token);
  12475. token = this.tn.next();
  12476. if (token.toLowerCase() !== "returns")
  12477. throw Error("Illegal delimiter in service "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token);
  12478. token = this.tn.next();
  12479. if (token != Lang.COPTOPEN)
  12480. throw Error("Illegal start of response type in service "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token);
  12481. token = this.tn.next();
  12482. method["response"] = token;
  12483. token = this.tn.next();
  12484. if (token !== Lang.COPTCLOSE)
  12485. throw Error("Illegal end of response type in service "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token);
  12486. token = this.tn.next();
  12487. if (token === Lang.OPEN) {
  12488. do {
  12489. token = this.tn.next();
  12490. if (token === 'option')
  12491. this._parseOption(method, token); // <- will fail for the custom-options example
  12492. else if (token !== Lang.CLOSE)
  12493. throw Error("Illegal start of option inservice "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token);
  12494. } while (token !== Lang.CLOSE);
  12495. if (this.tn.peek() === Lang.END)
  12496. this.tn.next();
  12497. } else if (token !== Lang.END)
  12498. throw Error("Illegal delimiter in service "+svc["name"]+"#"+name+" at line "+this.tn.line+": "+token);
  12499. if (typeof svc[type] === 'undefined')
  12500. svc[type] = {};
  12501. svc[type][name] = method;
  12502. };
  12503. /**
  12504. * Parses a message definition.
  12505. * @param {Object} parent Parent definition
  12506. * @param {Object} fld Field definition if this is a group, otherwise `null`
  12507. * @param {string} token First token
  12508. * @return {Object}
  12509. * @throws {Error} If the message cannot be parsed
  12510. * @private
  12511. */
  12512. ParserPrototype._parseMessage = function(parent, fld, token) {
  12513. /** @dict */
  12514. var msg = {}; // Note: At some point we might want to exclude the parser, so we need a dict.
  12515. var isGroup = token === "group";
  12516. token = this.tn.next();
  12517. if (!Lang.NAME.test(token))
  12518. throw Error("Illegal "+(isGroup ? "group" : "message")+" name"+(parent ? " in message "+parent["name"] : "")+" at line "+this.tn.line+": "+token);
  12519. msg["name"] = token;
  12520. if (isGroup) {
  12521. token = this.tn.next();
  12522. if (token !== Lang.EQUAL)
  12523. throw Error("Illegal id assignment after group "+msg.name+" at line "+this.tn.line+": "+token);
  12524. token = this.tn.next();
  12525. try {
  12526. fld["id"] = this._parseId(token);
  12527. } catch (e) {
  12528. throw Error("Illegal field id value for group "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token);
  12529. }
  12530. msg["isGroup"] = true;
  12531. }
  12532. msg["fields"] = []; // Note: Using arrays to support also browser that cannot preserve order of object keys.
  12533. msg["enums"] = [];
  12534. msg["messages"] = [];
  12535. msg["options"] = {};
  12536. msg["oneofs"] = {};
  12537. token = this.tn.next();
  12538. if (token === Lang.OPTOPEN && fld)
  12539. this._parseFieldOptions(msg, fld, token),
  12540. token = this.tn.next();
  12541. if (token !== Lang.OPEN)
  12542. throw Error("Illegal start of "+(isGroup ? "group" : "message")+" "+msg.name+" at line "+this.tn.line+": "+token);
  12543. // msg["extensions"] = undefined
  12544. do {
  12545. token = this.tn.next();
  12546. if (token === Lang.CLOSE) {
  12547. token = this.tn.peek();
  12548. if (token === Lang.END)
  12549. this.tn.next();
  12550. break;
  12551. } else if (Lang.RULE.test(token))
  12552. this._parseMessageField(msg, token);
  12553. else if (token === "oneof")
  12554. this._parseMessageOneOf(msg, token);
  12555. else if (token === "enum")
  12556. this._parseEnum(msg, token);
  12557. else if (token === "message")
  12558. this._parseMessage(msg, null, token);
  12559. else if (token === "option")
  12560. this._parseOption(msg, token);
  12561. else if (token === "extensions")
  12562. msg["extensions"] = this._parseExtensions(msg, token);
  12563. else if (token === "extend")
  12564. this._parseExtend(msg, token);
  12565. else
  12566. throw Error("Illegal token in message "+msg.name+" at line "+this.tn.line+": "+token);
  12567. } while (true);
  12568. parent["messages"].push(msg);
  12569. return msg;
  12570. };
  12571. /**
  12572. * Parses a message field.
  12573. * @param {Object} msg Message definition
  12574. * @param {string} token Initial token
  12575. * @returns {!Object} Field descriptor
  12576. * @throws {Error} If the message field cannot be parsed
  12577. * @private
  12578. */
  12579. ParserPrototype._parseMessageField = function(msg, token) {
  12580. /** @dict */
  12581. var fld = {}, grp = null;
  12582. fld["rule"] = token;
  12583. /** @dict */
  12584. fld["options"] = {};
  12585. token = this.tn.next();
  12586. if (token === "group") {
  12587. // "A [legacy] group simply combines a nested message type and a field into a single declaration. In your
  12588. // code, you can treat this message just as if it had a Result type field called result (the latter name is
  12589. // converted to lower-case so that it does not conflict with the former)."
  12590. grp = this._parseMessage(msg, fld, token);
  12591. if (!/^[A-Z]/.test(grp["name"]))
  12592. throw Error('Group names must start with a capital letter');
  12593. fld["type"] = grp["name"];
  12594. fld["name"] = grp["name"].toLowerCase();
  12595. token = this.tn.peek();
  12596. if (token === Lang.END)
  12597. this.tn.next();
  12598. } else {
  12599. if (!Lang.TYPE.test(token) && !Lang.TYPEREF.test(token))
  12600. throw Error("Illegal field type in message "+msg.name+" at line "+this.tn.line+": "+token);
  12601. fld["type"] = token;
  12602. token = this.tn.next();
  12603. if (!Lang.NAME.test(token))
  12604. throw Error("Illegal field name in message "+msg.name+" at line "+this.tn.line+": "+token);
  12605. fld["name"] = token;
  12606. token = this.tn.next();
  12607. if (token !== Lang.EQUAL)
  12608. throw Error("Illegal token in field "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token);
  12609. token = this.tn.next();
  12610. try {
  12611. fld["id"] = this._parseId(token);
  12612. } catch (e) {
  12613. throw Error("Illegal field id in message "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token);
  12614. }
  12615. token = this.tn.next();
  12616. if (token === Lang.OPTOPEN)
  12617. this._parseFieldOptions(msg, fld, token),
  12618. token = this.tn.next();
  12619. if (token !== Lang.END)
  12620. throw Error("Illegal delimiter in message "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token);
  12621. }
  12622. msg["fields"].push(fld);
  12623. return fld;
  12624. };
  12625. /**
  12626. * Parses a message oneof.
  12627. * @param {Object} msg Message definition
  12628. * @param {string} token Initial token
  12629. * @throws {Error} If the message oneof cannot be parsed
  12630. * @private
  12631. */
  12632. ParserPrototype._parseMessageOneOf = function(msg, token) {
  12633. token = this.tn.next();
  12634. if (!Lang.NAME.test(token))
  12635. throw Error("Illegal oneof name in message "+msg.name+" at line "+this.tn.line+": "+token);
  12636. var name = token,
  12637. fld;
  12638. var fields = [];
  12639. token = this.tn.next();
  12640. if (token !== Lang.OPEN)
  12641. throw Error("Illegal start of oneof "+name+" at line "+this.tn.line+": "+token);
  12642. while (this.tn.peek() !== Lang.CLOSE) {
  12643. fld = this._parseMessageField(msg, "optional");
  12644. fld["oneof"] = name;
  12645. fields.push(fld["id"]);
  12646. }
  12647. this.tn.next();
  12648. msg["oneofs"][name] = fields;
  12649. };
  12650. /**
  12651. * Parses a set of field option definitions.
  12652. * @param {Object} msg Message definition
  12653. * @param {Object} fld Field definition
  12654. * @param {string} token Initial token
  12655. * @throws {Error} If the message field options cannot be parsed
  12656. * @private
  12657. */
  12658. ParserPrototype._parseFieldOptions = function(msg, fld, token) {
  12659. var first = true;
  12660. do {
  12661. token = this.tn.next();
  12662. if (token === Lang.OPTCLOSE)
  12663. break;
  12664. else if (token === Lang.OPTEND) {
  12665. if (first)
  12666. throw Error("Illegal start of options in message "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token);
  12667. token = this.tn.next();
  12668. }
  12669. this._parseFieldOption(msg, fld, token);
  12670. first = false;
  12671. } while (true);
  12672. };
  12673. /**
  12674. * Parses a single field option.
  12675. * @param {Object} msg Message definition
  12676. * @param {Object} fld Field definition
  12677. * @param {string} token Initial token
  12678. * @throws {Error} If the mesage field option cannot be parsed
  12679. * @private
  12680. */
  12681. ParserPrototype._parseFieldOption = function(msg, fld, token) {
  12682. var custom = false;
  12683. if (token === Lang.COPTOPEN)
  12684. token = this.tn.next(),
  12685. custom = true;
  12686. if (!Lang.TYPEREF.test(token))
  12687. throw Error("Illegal field option in "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token);
  12688. var name = token;
  12689. token = this.tn.next();
  12690. if (custom) {
  12691. if (token !== Lang.COPTCLOSE)
  12692. throw Error("Illegal delimiter in "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token);
  12693. name = '('+name+')';
  12694. token = this.tn.next();
  12695. if (Lang.FQTYPEREF.test(token))
  12696. name += token,
  12697. token = this.tn.next();
  12698. }
  12699. if (token !== Lang.EQUAL)
  12700. throw Error("Illegal token in "+msg.name+"#"+fld.name+" at line "+this.tn.line+": "+token);
  12701. var value;
  12702. token = this.tn.peek();
  12703. if (token === Lang.STRINGOPEN || token === Lang.STRINGOPEN_SQ) {
  12704. value = this._parseString();
  12705. } else if (Lang.NUMBER.test(token, true))
  12706. value = this._parseNumber(this.tn.next(), true);
  12707. else if (Lang.BOOL.test(token))
  12708. value = this.tn.next().toLowerCase() === 'true';
  12709. else if (Lang.TYPEREF.test(token))
  12710. value = this.tn.next(); // TODO: Resolve?
  12711. else
  12712. throw Error("Illegal value in message "+msg.name+"#"+fld.name+", option "+name+" at line "+this.tn.line+": "+token);
  12713. fld["options"][name] = value;
  12714. };
  12715. /**
  12716. * Parses an enum.
  12717. * @param {Object} msg Message definition
  12718. * @param {string} token Initial token
  12719. * @throws {Error} If the enum cannot be parsed
  12720. * @private
  12721. */
  12722. ParserPrototype._parseEnum = function(msg, token) {
  12723. /** @dict */
  12724. var enm = {};
  12725. token = this.tn.next();
  12726. if (!Lang.NAME.test(token))
  12727. throw Error("Illegal enum name in message "+msg.name+" at line "+this.tn.line+": "+token);
  12728. enm["name"] = token;
  12729. token = this.tn.next();
  12730. if (token !== Lang.OPEN)
  12731. throw Error("Illegal start of enum "+enm.name+" at line "+this.tn.line+": "+token);
  12732. enm["values"] = [];
  12733. enm["options"] = {};
  12734. do {
  12735. token = this.tn.next();
  12736. if (token === Lang.CLOSE) {
  12737. token = this.tn.peek();
  12738. if (token === Lang.END)
  12739. this.tn.next();
  12740. break;
  12741. }
  12742. if (token == 'option')
  12743. this._parseOption(enm, token);
  12744. else {
  12745. if (!Lang.NAME.test(token))
  12746. throw Error("Illegal name in enum "+enm.name+" at line "+this.tn.line+": "+token);
  12747. this._parseEnumValue(enm, token);
  12748. }
  12749. } while (true);
  12750. msg["enums"].push(enm);
  12751. };
  12752. /**
  12753. * Parses an enum value.
  12754. * @param {Object} enm Enum definition
  12755. * @param {string} token Initial token
  12756. * @throws {Error} If the enum value cannot be parsed
  12757. * @private
  12758. */
  12759. ParserPrototype._parseEnumValue = function(enm, token) {
  12760. /** @dict */
  12761. var val = {};
  12762. val["name"] = token;
  12763. token = this.tn.next();
  12764. if (token !== Lang.EQUAL)
  12765. throw Error("Illegal token in enum "+enm.name+" at line "+this.tn.line+": "+token);
  12766. token = this.tn.next();
  12767. try {
  12768. val["id"] = this._parseId(token, true);
  12769. } catch (e) {
  12770. throw Error("Illegal id in enum "+enm.name+" at line "+this.tn.line+": "+token);
  12771. }
  12772. enm["values"].push(val);
  12773. token = this.tn.next();
  12774. if (token === Lang.OPTOPEN) {
  12775. var opt = { 'options' : {} }; // TODO: Actually expose them somehow.
  12776. this._parseFieldOptions(enm, opt, token);
  12777. token = this.tn.next();
  12778. }
  12779. if (token !== Lang.END)
  12780. throw Error("Illegal delimiter in enum "+enm.name+" at line "+this.tn.line+": "+token);
  12781. };
  12782. /**
  12783. * Parses an extensions statement.
  12784. * @param {Object} msg Message object
  12785. * @param {string} token Initial token
  12786. * @throws {Error} If the extensions statement cannot be parsed
  12787. * @private
  12788. */
  12789. ParserPrototype._parseExtensions = function(msg, token) {
  12790. /** @type {Array.<number>} */
  12791. var range = [];
  12792. token = this.tn.next();
  12793. if (token === "min") // FIXME: Does the official implementation support this?
  12794. range.push(ProtoBuf.ID_MIN);
  12795. else if (token === "max")
  12796. range.push(ProtoBuf.ID_MAX);
  12797. else
  12798. range.push(this._parseNumber(token));
  12799. token = this.tn.next();
  12800. if (token !== 'to')
  12801. throw Error("Illegal extensions delimiter in message "+msg.name+" at line "+this.tn.line+": "+token);
  12802. token = this.tn.next();
  12803. if (token === "min")
  12804. range.push(ProtoBuf.ID_MIN);
  12805. else if (token === "max")
  12806. range.push(ProtoBuf.ID_MAX);
  12807. else
  12808. range.push(this._parseNumber(token));
  12809. token = this.tn.next();
  12810. if (token !== Lang.END)
  12811. throw Error("Illegal extensions delimiter in message "+msg.name+" at line "+this.tn.line+": "+token);
  12812. return range;
  12813. };
  12814. /**
  12815. * Parses an extend block.
  12816. * @param {Object} parent Parent object
  12817. * @param {string} token Initial token
  12818. * @throws {Error} If the extend block cannot be parsed
  12819. * @private
  12820. */
  12821. ParserPrototype._parseExtend = function(parent, token) {
  12822. token = this.tn.next();
  12823. if (!Lang.TYPEREF.test(token))
  12824. throw Error("Illegal message name at line "+this.tn.line+": "+token);
  12825. /** @dict */
  12826. var ext = {};
  12827. ext["ref"] = token;
  12828. ext["fields"] = [];
  12829. token = this.tn.next();
  12830. if (token !== Lang.OPEN)
  12831. throw Error("Illegal start of extend "+ext.name+" at line "+this.tn.line+": "+token);
  12832. do {
  12833. token = this.tn.next();
  12834. if (token === Lang.CLOSE) {
  12835. token = this.tn.peek();
  12836. if (token == Lang.END)
  12837. this.tn.next();
  12838. break;
  12839. } else if (Lang.RULE.test(token))
  12840. this._parseMessageField(ext, token);
  12841. else
  12842. throw Error("Illegal token in extend "+ext.name+" at line "+this.tn.line+": "+token);
  12843. } while (true);
  12844. parent["messages"].push(ext);
  12845. return ext;
  12846. };
  12847. /**
  12848. * Returns a string representation of this object.
  12849. * @returns {string} String representation as of "Parser"
  12850. */
  12851. ParserPrototype.toString = function() {
  12852. return "Parser";
  12853. };
  12854. /**
  12855. * @alias ProtoBuf.DotProto.Parser
  12856. * @expose
  12857. */
  12858. DotProto.Parser = Parser;
  12859. return DotProto;
  12860. })(ProtoBuf, ProtoBuf.Lang);
  12861. /**
  12862. * @alias ProtoBuf.Reflect
  12863. * @expose
  12864. */
  12865. ProtoBuf.Reflect = (function(ProtoBuf) {
  12866. "use strict";
  12867. /**
  12868. * Reflection types.
  12869. * @exports ProtoBuf.Reflect
  12870. * @namespace
  12871. */
  12872. var Reflect = {};
  12873. /**
  12874. * Constructs a Reflect base class.
  12875. * @exports ProtoBuf.Reflect.T
  12876. * @constructor
  12877. * @abstract
  12878. * @param {!ProtoBuf.Builder} builder Builder reference
  12879. * @param {?ProtoBuf.Reflect.T} parent Parent object
  12880. * @param {string} name Object name
  12881. */
  12882. var T = function(builder, parent, name) {
  12883. /**
  12884. * Builder reference.
  12885. * @type {!ProtoBuf.Builder}
  12886. * @expose
  12887. */
  12888. this.builder = builder;
  12889. /**
  12890. * Parent object.
  12891. * @type {?ProtoBuf.Reflect.T}
  12892. * @expose
  12893. */
  12894. this.parent = parent;
  12895. /**
  12896. * Object name in namespace.
  12897. * @type {string}
  12898. * @expose
  12899. */
  12900. this.name = name;
  12901. /**
  12902. * Fully qualified class name
  12903. * @type {string}
  12904. * @expose
  12905. */
  12906. this.className;
  12907. };
  12908. /**
  12909. * @alias ProtoBuf.Reflect.T.prototype
  12910. * @inner
  12911. */
  12912. var TPrototype = T.prototype;
  12913. /**
  12914. * Returns the fully qualified name of this object.
  12915. * @returns {string} Fully qualified name as of ".PATH.TO.THIS"
  12916. * @expose
  12917. */
  12918. TPrototype.fqn = function() {
  12919. var name = this.name,
  12920. ptr = this;
  12921. do {
  12922. ptr = ptr.parent;
  12923. if (ptr == null)
  12924. break;
  12925. name = ptr.name+"."+name;
  12926. } while (true);
  12927. return name;
  12928. };
  12929. /**
  12930. * Returns a string representation of this Reflect object (its fully qualified name).
  12931. * @param {boolean=} includeClass Set to true to include the class name. Defaults to false.
  12932. * @return String representation
  12933. * @expose
  12934. */
  12935. TPrototype.toString = function(includeClass) {
  12936. return (includeClass ? this.className + " " : "") + this.fqn();
  12937. };
  12938. /**
  12939. * Builds this type.
  12940. * @throws {Error} If this type cannot be built directly
  12941. * @expose
  12942. */
  12943. TPrototype.build = function() {
  12944. throw Error(this.toString(true)+" cannot be built directly");
  12945. };
  12946. /**
  12947. * @alias ProtoBuf.Reflect.T
  12948. * @expose
  12949. */
  12950. Reflect.T = T;
  12951. /**
  12952. * Constructs a new Namespace.
  12953. * @exports ProtoBuf.Reflect.Namespace
  12954. * @param {!ProtoBuf.Builder} builder Builder reference
  12955. * @param {?ProtoBuf.Reflect.Namespace} parent Namespace parent
  12956. * @param {string} name Namespace name
  12957. * @param {Object.<string,*>=} options Namespace options
  12958. * @constructor
  12959. * @extends ProtoBuf.Reflect.T
  12960. */
  12961. var Namespace = function(builder, parent, name, options) {
  12962. T.call(this, builder, parent, name);
  12963. /**
  12964. * @override
  12965. */
  12966. this.className = "Namespace";
  12967. /**
  12968. * Children inside the namespace.
  12969. * @type {!Array.<ProtoBuf.Reflect.T>}
  12970. */
  12971. this.children = [];
  12972. /**
  12973. * Options.
  12974. * @type {!Object.<string, *>}
  12975. */
  12976. this.options = options || {};
  12977. };
  12978. /**
  12979. * @alias ProtoBuf.Reflect.Namespace.prototype
  12980. * @inner
  12981. */
  12982. var NamespacePrototype = Namespace.prototype = Object.create(T.prototype);
  12983. /**
  12984. * Returns an array of the namespace's children.
  12985. * @param {ProtoBuf.Reflect.T=} type Filter type (returns instances of this type only). Defaults to null (all children).
  12986. * @return {Array.<ProtoBuf.Reflect.T>}
  12987. * @expose
  12988. */
  12989. NamespacePrototype.getChildren = function(type) {
  12990. type = type || null;
  12991. if (type == null)
  12992. return this.children.slice();
  12993. var children = [];
  12994. for (var i=0, k=this.children.length; i<k; ++i)
  12995. if (this.children[i] instanceof type)
  12996. children.push(this.children[i]);
  12997. return children;
  12998. };
  12999. /**
  13000. * Adds a child to the namespace.
  13001. * @param {ProtoBuf.Reflect.T} child Child
  13002. * @throws {Error} If the child cannot be added (duplicate)
  13003. * @expose
  13004. */
  13005. NamespacePrototype.addChild = function(child) {
  13006. var other;
  13007. if (other = this.getChild(child.name)) {
  13008. // Try to revert camelcase transformation on collision
  13009. if (other instanceof Message.Field && other.name !== other.originalName && this.getChild(other.originalName) === null)
  13010. other.name = other.originalName; // Revert previous first (effectively keeps both originals)
  13011. else if (child instanceof Message.Field && child.name !== child.originalName && this.getChild(child.originalName) === null)
  13012. child.name = child.originalName;
  13013. else
  13014. throw Error("Duplicate name in namespace "+this.toString(true)+": "+child.name);
  13015. }
  13016. this.children.push(child);
  13017. };
  13018. /**
  13019. * Gets a child by its name or id.
  13020. * @param {string|number} nameOrId Child name or id
  13021. * @return {?ProtoBuf.Reflect.T} The child or null if not found
  13022. * @expose
  13023. */
  13024. NamespacePrototype.getChild = function(nameOrId) {
  13025. var key = typeof nameOrId === 'number' ? 'id' : 'name';
  13026. for (var i=0, k=this.children.length; i<k; ++i)
  13027. if (this.children[i][key] === nameOrId)
  13028. return this.children[i];
  13029. return null;
  13030. };
  13031. /**
  13032. * Resolves a reflect object inside of this namespace.
  13033. * @param {string} qn Qualified name to resolve
  13034. * @param {boolean=} excludeFields Excludes fields, defaults to `false`
  13035. * @return {?ProtoBuf.Reflect.Namespace} The resolved type or null if not found
  13036. * @expose
  13037. */
  13038. NamespacePrototype.resolve = function(qn, excludeFields) {
  13039. var part = qn.split("."),
  13040. ptr = this,
  13041. i = 0;
  13042. if (part[i] === "") { // Fully qualified name, e.g. ".My.Message'
  13043. while (ptr.parent !== null)
  13044. ptr = ptr.parent;
  13045. i++;
  13046. }
  13047. var child;
  13048. do {
  13049. do {
  13050. child = ptr.getChild(part[i]);
  13051. if (!child || !(child instanceof Reflect.T) || (excludeFields && child instanceof Reflect.Message.Field)) {
  13052. ptr = null;
  13053. break;
  13054. }
  13055. ptr = child; i++;
  13056. } while (i < part.length);
  13057. if (ptr != null)
  13058. break; // Found
  13059. // Else search the parent
  13060. if (this.parent !== null) {
  13061. return this.parent.resolve(qn, excludeFields);
  13062. }
  13063. } while (ptr != null);
  13064. return ptr;
  13065. };
  13066. /**
  13067. * Builds the namespace and returns the runtime counterpart.
  13068. * @return {Object.<string,Function|Object>} Runtime namespace
  13069. * @expose
  13070. */
  13071. NamespacePrototype.build = function() {
  13072. /** @dict */
  13073. var ns = {};
  13074. var children = this.children;
  13075. for (var i=0, k=children.length, child; i<k; ++i) {
  13076. child = children[i];
  13077. if (child instanceof Namespace)
  13078. ns[child.name] = child.build();
  13079. }
  13080. if (Object.defineProperty)
  13081. Object.defineProperty(ns, "$options", { "value": this.buildOpt() });
  13082. return ns;
  13083. };
  13084. /**
  13085. * Builds the namespace's '$options' property.
  13086. * @return {Object.<string,*>}
  13087. */
  13088. NamespacePrototype.buildOpt = function() {
  13089. var opt = {},
  13090. keys = Object.keys(this.options);
  13091. for (var i=0, k=keys.length; i<k; ++i) {
  13092. var key = keys[i],
  13093. val = this.options[keys[i]];
  13094. // TODO: Options are not resolved, yet.
  13095. // if (val instanceof Namespace) {
  13096. // opt[key] = val.build();
  13097. // } else {
  13098. opt[key] = val;
  13099. // }
  13100. }
  13101. return opt;
  13102. };
  13103. /**
  13104. * Gets the value assigned to the option with the specified name.
  13105. * @param {string=} name Returns the option value if specified, otherwise all options are returned.
  13106. * @return {*|Object.<string,*>}null} Option value or NULL if there is no such option
  13107. */
  13108. NamespacePrototype.getOption = function(name) {
  13109. if (typeof name === 'undefined')
  13110. return this.options;
  13111. return typeof this.options[name] !== 'undefined' ? this.options[name] : null;
  13112. };
  13113. /**
  13114. * @alias ProtoBuf.Reflect.Namespace
  13115. * @expose
  13116. */
  13117. Reflect.Namespace = Namespace;
  13118. /**
  13119. * Constructs a new Message.
  13120. * @exports ProtoBuf.Reflect.Message
  13121. * @param {!ProtoBuf.Builder} builder Builder reference
  13122. * @param {!ProtoBuf.Reflect.Namespace} parent Parent message or namespace
  13123. * @param {string} name Message name
  13124. * @param {Object.<string,*>=} options Message options
  13125. * @param {boolean=} isGroup `true` if this is a legacy group
  13126. * @constructor
  13127. * @extends ProtoBuf.Reflect.Namespace
  13128. */
  13129. var Message = function(builder, parent, name, options, isGroup) {
  13130. Namespace.call(this, builder, parent, name, options);
  13131. /**
  13132. * @override
  13133. */
  13134. this.className = "Message";
  13135. /**
  13136. * Extensions range.
  13137. * @type {!Array.<number>}
  13138. * @expose
  13139. */
  13140. this.extensions = [ProtoBuf.ID_MIN, ProtoBuf.ID_MAX];
  13141. /**
  13142. * Runtime message class.
  13143. * @type {?function(new:ProtoBuf.Builder.Message)}
  13144. * @expose
  13145. */
  13146. this.clazz = null;
  13147. /**
  13148. * Whether this is a legacy group or not.
  13149. * @type {boolean}
  13150. * @expose
  13151. */
  13152. this.isGroup = !!isGroup;
  13153. // The following cached collections are used to efficiently iterate over or look up fields when decoding.
  13154. /**
  13155. * Cached fields.
  13156. * @type {?Array.<!ProtoBuf.Reflect.Message.Field>}
  13157. * @private
  13158. */
  13159. this._fields = null;
  13160. /**
  13161. * Cached fields by id.
  13162. * @type {?Object.<number,!ProtoBuf.Reflect.Message.Field>}
  13163. * @private
  13164. */
  13165. this._fieldsById = null;
  13166. /**
  13167. * Cached fields by name.
  13168. * @type {?Object.<string,!ProtoBuf.Reflect.Message.Field>}
  13169. * @private
  13170. */
  13171. this._fieldsByName = null;
  13172. };
  13173. /**
  13174. * @alias ProtoBuf.Reflect.Message.prototype
  13175. * @inner
  13176. */
  13177. var MessagePrototype = Message.prototype = Object.create(Namespace.prototype);
  13178. /**
  13179. * Builds the message and returns the runtime counterpart, which is a fully functional class.
  13180. * @see ProtoBuf.Builder.Message
  13181. * @param {boolean=} rebuild Whether to rebuild or not, defaults to false
  13182. * @return {ProtoBuf.Reflect.Message} Message class
  13183. * @throws {Error} If the message cannot be built
  13184. * @expose
  13185. */
  13186. MessagePrototype.build = function(rebuild) {
  13187. if (this.clazz && !rebuild)
  13188. return this.clazz;
  13189. // Create the runtime Message class in its own scope
  13190. var clazz = (function(ProtoBuf, T) {
  13191. var fields = T.getChildren(ProtoBuf.Reflect.Message.Field),
  13192. oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf);
  13193. /**
  13194. * Constructs a new runtime Message.
  13195. * @name ProtoBuf.Builder.Message
  13196. * @class Barebone of all runtime messages.
  13197. * @param {!Object.<string,*>|string} values Preset values
  13198. * @param {...string} var_args
  13199. * @constructor
  13200. * @throws {Error} If the message cannot be created
  13201. */
  13202. var Message = function(values, var_args) {
  13203. ProtoBuf.Builder.Message.call(this);
  13204. // Create virtual oneof properties
  13205. for (var i=0, k=oneofs.length; i<k; ++i)
  13206. this[oneofs[i].name] = null;
  13207. // Create fields and set default values
  13208. for (i=0, k=fields.length; i<k; ++i) {
  13209. var field = fields[i];
  13210. this[field.name] = field.repeated ? [] : null;
  13211. if (field.required && field.defaultValue !== null)
  13212. this[field.name] = field.defaultValue;
  13213. }
  13214. if (arguments.length > 0) {
  13215. // Set field values from a values object
  13216. if (arguments.length === 1 && typeof values === 'object' &&
  13217. /* not another Message */ typeof values.encode !== 'function' &&
  13218. /* not a repeated field */ !ProtoBuf.Util.isArray(values) &&
  13219. /* not a ByteBuffer */ !(values instanceof ByteBuffer) &&
  13220. /* not an ArrayBuffer */ !(values instanceof ArrayBuffer) &&
  13221. /* not a Long */ !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) {
  13222. var keys = Object.keys(values);
  13223. for (i=0, k=keys.length; i<k; ++i)
  13224. this.$set(keys[i], values[keys[i]]); // May throw
  13225. } else // Set field values from arguments, in declaration order
  13226. for (i=0, k=arguments.length; i<k; ++i)
  13227. this.$set(fields[i].name, arguments[i]); // May throw
  13228. }
  13229. };
  13230. /**
  13231. * @alias ProtoBuf.Builder.Message.prototype
  13232. * @inner
  13233. */
  13234. var MessagePrototype = Message.prototype = Object.create(ProtoBuf.Builder.Message.prototype);
  13235. /**
  13236. * Adds a value to a repeated field.
  13237. * @name ProtoBuf.Builder.Message#add
  13238. * @function
  13239. * @param {string} key Field name
  13240. * @param {*} value Value to add
  13241. * @param {boolean=} noAssert Whether to assert the value or not (asserts by default)
  13242. * @throws {Error} If the value cannot be added
  13243. * @expose
  13244. */
  13245. MessagePrototype.add = function(key, value, noAssert) {
  13246. var field = T._fieldsByName[key];
  13247. if (!noAssert) {
  13248. if (!field)
  13249. throw Error(this+"#"+key+" is undefined");
  13250. if (!(field instanceof ProtoBuf.Reflect.Message.Field))
  13251. throw Error(this+"#"+key+" is not a field: "+field.toString(true)); // May throw if it's an enum or embedded message
  13252. if (!field.repeated)
  13253. throw Error(this+"#"+key+" is not a repeated field");
  13254. }
  13255. if (this[field.name] === null)
  13256. this[field.name] = [];
  13257. this[field.name].push(noAssert ? value : field.verifyValue(value, true));
  13258. };
  13259. /**
  13260. * Adds a value to a repeated field. This is an alias for {@link ProtoBuf.Builder.Message#add}.
  13261. * @name ProtoBuf.Builder.Message#$add
  13262. * @function
  13263. * @param {string} key Field name
  13264. * @param {*} value Value to add
  13265. * @param {boolean=} noAssert Whether to assert the value or not (asserts by default)
  13266. * @throws {Error} If the value cannot be added
  13267. * @expose
  13268. */
  13269. MessagePrototype.$add = MessagePrototype.add;
  13270. /**
  13271. * Sets a field's value.
  13272. * @name ProtoBuf.Builder.Message#set
  13273. * @function
  13274. * @param {string} key Key
  13275. * @param {*} value Value to set
  13276. * @param {boolean=} noAssert Whether to not assert for an actual field / proper value type, defaults to `false`
  13277. * @returns {!ProtoBuf.Builder.Message} this
  13278. * @throws {Error} If the value cannot be set
  13279. * @expose
  13280. */
  13281. MessagePrototype.set = function(key, value, noAssert) {
  13282. if (key && typeof key === 'object') {
  13283. for (var i in key)
  13284. if (key.hasOwnProperty(i))
  13285. this.$set(i, key[i], noAssert);
  13286. return this;
  13287. }
  13288. var field = T._fieldsByName[key];
  13289. if (!noAssert) {
  13290. if (!field)
  13291. throw Error(this+"#"+key+" is not a field: undefined");
  13292. if (!(field instanceof ProtoBuf.Reflect.Message.Field))
  13293. throw Error(this+"#"+key+" is not a field: "+field.toString(true));
  13294. this[field.name] = (value = field.verifyValue(value)); // May throw
  13295. } else {
  13296. this[field.name] = value;
  13297. }
  13298. if (field.oneof) {
  13299. if (value !== null) {
  13300. if (this[field.oneof.name] !== null)
  13301. this[this[field.oneof.name]] = null; // Unset the previous (field name is the oneof field's value)
  13302. this[field.oneof.name] = field.name;
  13303. } else if (field.oneof.name === key)
  13304. this[field.oneof.name] = null;
  13305. }
  13306. return this;
  13307. };
  13308. /**
  13309. * Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}.
  13310. * @name ProtoBuf.Builder.Message#$set
  13311. * @function
  13312. * @param {string} key Key
  13313. * @param {*} value Value to set
  13314. * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`
  13315. * @throws {Error} If the value cannot be set
  13316. * @expose
  13317. */
  13318. MessagePrototype.$set = MessagePrototype.set;
  13319. /**
  13320. * Gets a field's value.
  13321. * @name ProtoBuf.Builder.Message#get
  13322. * @function
  13323. * @param {string} key Key
  13324. * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false`
  13325. * @return {*} Value
  13326. * @throws {Error} If there is no such field
  13327. * @expose
  13328. */
  13329. MessagePrototype.get = function(key, noAssert) {
  13330. if (noAssert)
  13331. return this[key];
  13332. var field = T._fieldsByName[key];
  13333. if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field))
  13334. throw Error(this+"#"+key+" is not a field: undefined");
  13335. if (!(field instanceof ProtoBuf.Reflect.Message.Field))
  13336. throw Error(this+"#"+key+" is not a field: "+field.toString(true));
  13337. return this[field.name];
  13338. };
  13339. /**
  13340. * Gets a field's value. This is an alias for {@link ProtoBuf.Builder.Message#$get}.
  13341. * @name ProtoBuf.Builder.Message#$get
  13342. * @function
  13343. * @param {string} key Key
  13344. * @return {*} Value
  13345. * @throws {Error} If there is no such field
  13346. * @expose
  13347. */
  13348. MessagePrototype.$get = MessagePrototype.get;
  13349. // Getters and setters
  13350. for (var i=0; i<fields.length; i++) {
  13351. var field = fields[i];
  13352. // no setters for extension fields as these are named by their fqn
  13353. if (field instanceof ProtoBuf.Reflect.Message.ExtensionField)
  13354. continue;
  13355. if (T.builder.options['populateAccessors'])
  13356. (function(field) {
  13357. // set/get[SomeValue]
  13358. var Name = field.originalName.replace(/(_[a-zA-Z])/g, function(match) {
  13359. return match.toUpperCase().replace('_','');
  13360. });
  13361. Name = Name.substring(0,1).toUpperCase() + Name.substring(1);
  13362. // set/get_[some_value] FIXME: Do we really need these?
  13363. var name = field.originalName.replace(/([A-Z])/g, function(match) {
  13364. return "_"+match;
  13365. });
  13366. /**
  13367. * The current field's unbound setter function.
  13368. * @function
  13369. * @param {*} value
  13370. * @param {boolean=} noAssert
  13371. * @returns {!ProtoBuf.Builder.Message}
  13372. * @inner
  13373. */
  13374. var setter = function(value, noAssert) {
  13375. this[field.name] = noAssert ? value : field.verifyValue(value);
  13376. return this;
  13377. };
  13378. /**
  13379. * The current field's unbound getter function.
  13380. * @function
  13381. * @returns {*}
  13382. * @inner
  13383. */
  13384. var getter = function() {
  13385. return this[field.name];
  13386. };
  13387. /**
  13388. * Sets a value. This method is present for each field, but only if there is no name conflict with
  13389. * another field.
  13390. * @name ProtoBuf.Builder.Message#set[SomeField]
  13391. * @function
  13392. * @param {*} value Value to set
  13393. * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`
  13394. * @returns {!ProtoBuf.Builder.Message} this
  13395. * @abstract
  13396. * @throws {Error} If the value cannot be set
  13397. */
  13398. if (T.getChild("set"+Name) === null)
  13399. MessagePrototype["set"+Name] = setter;
  13400. /**
  13401. * Sets a value. This method is present for each field, but only if there is no name conflict with
  13402. * another field.
  13403. * @name ProtoBuf.Builder.Message#set_[some_field]
  13404. * @function
  13405. * @param {*} value Value to set
  13406. * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`
  13407. * @returns {!ProtoBuf.Builder.Message} this
  13408. * @abstract
  13409. * @throws {Error} If the value cannot be set
  13410. */
  13411. if (T.getChild("set_"+name) === null)
  13412. MessagePrototype["set_"+name] = setter;
  13413. /**
  13414. * Gets a value. This method is present for each field, but only if there is no name conflict with
  13415. * another field.
  13416. * @name ProtoBuf.Builder.Message#get[SomeField]
  13417. * @function
  13418. * @abstract
  13419. * @return {*} The value
  13420. */
  13421. if (T.getChild("get"+Name) === null)
  13422. MessagePrototype["get"+Name] = getter;
  13423. /**
  13424. * Gets a value. This method is present for each field, but only if there is no name conflict with
  13425. * another field.
  13426. * @name ProtoBuf.Builder.Message#get_[some_field]
  13427. * @function
  13428. * @return {*} The value
  13429. * @abstract
  13430. */
  13431. if (T.getChild("get_"+name) === null)
  13432. MessagePrototype["get_"+name] = getter;
  13433. })(field);
  13434. }
  13435. // En-/decoding
  13436. /**
  13437. * Encodes the message.
  13438. * @name ProtoBuf.Builder.Message#$encode
  13439. * @function
  13440. * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.
  13441. * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`
  13442. * @return {!ByteBuffer} Encoded message as a ByteBuffer
  13443. * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still
  13444. * returns the encoded ByteBuffer in the `encoded` property on the error.
  13445. * @expose
  13446. * @see ProtoBuf.Builder.Message#encode64
  13447. * @see ProtoBuf.Builder.Message#encodeHex
  13448. * @see ProtoBuf.Builder.Message#encodeAB
  13449. */
  13450. MessagePrototype.encode = function(buffer, noVerify) {
  13451. if (typeof buffer === 'boolean')
  13452. noVerify = buffer,
  13453. buffer = undefined;
  13454. var isNew = false;
  13455. if (!buffer)
  13456. buffer = new ByteBuffer(),
  13457. isNew = true;
  13458. var le = buffer.littleEndian;
  13459. try {
  13460. T.encode(this, buffer.LE(), noVerify);
  13461. return (isNew ? buffer.flip() : buffer).LE(le);
  13462. } catch (e) {
  13463. buffer.LE(le);
  13464. throw(e);
  13465. }
  13466. };
  13467. /**
  13468. * Calculates the byte length of the message.
  13469. * @name ProtoBuf.Builder.Message#calculate
  13470. * @function
  13471. * @returns {number} Byte length
  13472. * @throws {Error} If the message cannot be calculated or if required fields are missing.
  13473. * @expose
  13474. */
  13475. MessagePrototype.calculate = function() {
  13476. return T.calculate(this);
  13477. };
  13478. /**
  13479. * Encodes the varint32 length-delimited message.
  13480. * @name ProtoBuf.Builder.Message#encodeDelimited
  13481. * @function
  13482. * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.
  13483. * @return {!ByteBuffer} Encoded message as a ByteBuffer
  13484. * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still
  13485. * returns the encoded ByteBuffer in the `encoded` property on the error.
  13486. * @expose
  13487. */
  13488. MessagePrototype.encodeDelimited = function(buffer) {
  13489. var isNew = false;
  13490. if (!buffer)
  13491. buffer = new ByteBuffer(),
  13492. isNew = true;
  13493. var enc = new ByteBuffer().LE();
  13494. T.encode(this, enc).flip();
  13495. buffer.writeVarint32(enc.remaining());
  13496. buffer.append(enc);
  13497. return isNew ? buffer.flip() : buffer;
  13498. };
  13499. /**
  13500. * Directly encodes the message to an ArrayBuffer.
  13501. * @name ProtoBuf.Builder.Message#encodeAB
  13502. * @function
  13503. * @return {ArrayBuffer} Encoded message as ArrayBuffer
  13504. * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still
  13505. * returns the encoded ArrayBuffer in the `encoded` property on the error.
  13506. * @expose
  13507. */
  13508. MessagePrototype.encodeAB = function() {
  13509. try {
  13510. return this.encode().toArrayBuffer();
  13511. } catch (e) {
  13512. if (e["encoded"]) e["encoded"] = e["encoded"].toArrayBuffer();
  13513. throw(e);
  13514. }
  13515. };
  13516. /**
  13517. * Returns the message as an ArrayBuffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeAB}.
  13518. * @name ProtoBuf.Builder.Message#toArrayBuffer
  13519. * @function
  13520. * @return {ArrayBuffer} Encoded message as ArrayBuffer
  13521. * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still
  13522. * returns the encoded ArrayBuffer in the `encoded` property on the error.
  13523. * @expose
  13524. */
  13525. MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB;
  13526. /**
  13527. * Directly encodes the message to a node Buffer.
  13528. * @name ProtoBuf.Builder.Message#encodeNB
  13529. * @function
  13530. * @return {!Buffer}
  13531. * @throws {Error} If the message cannot be encoded, not running under node.js or if required fields are
  13532. * missing. The later still returns the encoded node Buffer in the `encoded` property on the error.
  13533. * @expose
  13534. */
  13535. MessagePrototype.encodeNB = function() {
  13536. try {
  13537. return this.encode().toBuffer();
  13538. } catch (e) {
  13539. if (e["encoded"]) e["encoded"] = e["encoded"].toBuffer();
  13540. throw(e);
  13541. }
  13542. };
  13543. /**
  13544. * Returns the message as a node Buffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeNB}.
  13545. * @name ProtoBuf.Builder.Message#toBuffer
  13546. * @function
  13547. * @return {!Buffer}
  13548. * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still
  13549. * returns the encoded node Buffer in the `encoded` property on the error.
  13550. * @expose
  13551. */
  13552. MessagePrototype.toBuffer = MessagePrototype.encodeNB;
  13553. /**
  13554. * Directly encodes the message to a base64 encoded string.
  13555. * @name ProtoBuf.Builder.Message#encode64
  13556. * @function
  13557. * @return {string} Base64 encoded string
  13558. * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later
  13559. * still returns the encoded base64 string in the `encoded` property on the error.
  13560. * @expose
  13561. */
  13562. MessagePrototype.encode64 = function() {
  13563. try {
  13564. return this.encode().toBase64();
  13565. } catch (e) {
  13566. if (e["encoded"]) e["encoded"] = e["encoded"].toBase64();
  13567. throw(e);
  13568. }
  13569. };
  13570. /**
  13571. * Returns the message as a base64 encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encode64}.
  13572. * @name ProtoBuf.Builder.Message#toBase64
  13573. * @function
  13574. * @return {string} Base64 encoded string
  13575. * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still
  13576. * returns the encoded base64 string in the `encoded` property on the error.
  13577. * @expose
  13578. */
  13579. MessagePrototype.toBase64 = MessagePrototype.encode64;
  13580. /**
  13581. * Directly encodes the message to a hex encoded string.
  13582. * @name ProtoBuf.Builder.Message#encodeHex
  13583. * @function
  13584. * @return {string} Hex encoded string
  13585. * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later
  13586. * still returns the encoded hex string in the `encoded` property on the error.
  13587. * @expose
  13588. */
  13589. MessagePrototype.encodeHex = function() {
  13590. try {
  13591. return this.encode().toHex();
  13592. } catch (e) {
  13593. if (e["encoded"]) e["encoded"] = e["encoded"].toHex();
  13594. throw(e);
  13595. }
  13596. };
  13597. /**
  13598. * Returns the message as a hex encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encodeHex}.
  13599. * @name ProtoBuf.Builder.Message#toHex
  13600. * @function
  13601. * @return {string} Hex encoded string
  13602. * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still
  13603. * returns the encoded hex string in the `encoded` property on the error.
  13604. * @expose
  13605. */
  13606. MessagePrototype.toHex = MessagePrototype.encodeHex;
  13607. /**
  13608. * Clones a message object to a raw object.
  13609. * @param {*} obj Object to clone
  13610. * @param {boolean} includeBinaryAsBase64 Whether to include binary data as base64 strings or not
  13611. * @returns {*} Cloned object
  13612. * @inner
  13613. */
  13614. function cloneRaw(obj, includeBinaryAsBase64) {
  13615. var clone = {};
  13616. for (var i in obj)
  13617. if (obj.hasOwnProperty(i)) {
  13618. if (obj[i] === null || typeof obj[i] !== 'object')
  13619. clone[i] = obj[i];
  13620. else if (obj[i] instanceof ByteBuffer) {
  13621. if (includeBinaryAsBase64)
  13622. clone[i] = obj[i].toBase64();
  13623. } else // is a non-null object
  13624. clone[i] = cloneRaw(obj[i], includeBinaryAsBase64);
  13625. }
  13626. return clone;
  13627. }
  13628. /**
  13629. * Returns the message's raw payload.
  13630. * @param {boolean=} includeBinaryAsBase64 Whether to include binary data as base64 strings or not, defaults to `false`
  13631. * @returns {Object.<string,*>} Raw payload
  13632. * @expose
  13633. */
  13634. MessagePrototype.toRaw = function(includeBinaryAsBase64) {
  13635. return cloneRaw(this, !!includeBinaryAsBase64);
  13636. };
  13637. /**
  13638. * Decodes a message from the specified buffer or string.
  13639. * @name ProtoBuf.Builder.Message.decode
  13640. * @function
  13641. * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from
  13642. * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64
  13643. * @return {!ProtoBuf.Builder.Message} Decoded message
  13644. * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still
  13645. * returns the decoded message with missing fields in the `decoded` property on the error.
  13646. * @expose
  13647. * @see ProtoBuf.Builder.Message.decode64
  13648. * @see ProtoBuf.Builder.Message.decodeHex
  13649. */
  13650. Message.decode = function(buffer, enc) {
  13651. if (typeof buffer === 'string')
  13652. buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");
  13653. buffer = buffer instanceof ByteBuffer ? buffer : ByteBuffer.wrap(buffer); // May throw
  13654. var le = buffer.littleEndian;
  13655. try {
  13656. var msg = T.decode(buffer.LE());
  13657. buffer.LE(le);
  13658. return msg;
  13659. } catch (e) {
  13660. buffer.LE(le);
  13661. throw(e);
  13662. }
  13663. };
  13664. /**
  13665. * Decodes a varint32 length-delimited message from the specified buffer or string.
  13666. * @name ProtoBuf.Builder.Message.decodeDelimited
  13667. * @function
  13668. * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from
  13669. * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64
  13670. * @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet
  13671. * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still
  13672. * returns the decoded message with missing fields in the `decoded` property on the error.
  13673. * @expose
  13674. */
  13675. Message.decodeDelimited = function(buffer, enc) {
  13676. if (typeof buffer === 'string')
  13677. buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");
  13678. buffer = buffer instanceof ByteBuffer ? buffer : ByteBuffer.wrap(buffer); // May throw
  13679. if (buffer.remaining() < 1)
  13680. return null;
  13681. var off = buffer.offset,
  13682. len = buffer.readVarint32();
  13683. if (buffer.remaining() < len) {
  13684. buffer.offset = off;
  13685. return null;
  13686. }
  13687. try {
  13688. var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE());
  13689. buffer.offset += len;
  13690. return msg;
  13691. } catch (err) {
  13692. buffer.offset += len;
  13693. throw err;
  13694. }
  13695. };
  13696. /**
  13697. * Decodes the message from the specified base64 encoded string.
  13698. * @name ProtoBuf.Builder.Message.decode64
  13699. * @function
  13700. * @param {string} str String to decode from
  13701. * @return {!ProtoBuf.Builder.Message} Decoded message
  13702. * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still
  13703. * returns the decoded message with missing fields in the `decoded` property on the error.
  13704. * @expose
  13705. */
  13706. Message.decode64 = function(str) {
  13707. return Message.decode(str, "base64");
  13708. };
  13709. /**
  13710. * Decodes the message from the specified hex encoded string.
  13711. * @name ProtoBuf.Builder.Message.decodeHex
  13712. * @function
  13713. * @param {string} str String to decode from
  13714. * @return {!ProtoBuf.Builder.Message} Decoded message
  13715. * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still
  13716. * returns the decoded message with missing fields in the `decoded` property on the error.
  13717. * @expose
  13718. */
  13719. Message.decodeHex = function(str) {
  13720. return Message.decode(str, "hex");
  13721. };
  13722. // Utility
  13723. /**
  13724. * Returns a string representation of this Message.
  13725. * @name ProtoBuf.Builder.Message#toString
  13726. * @function
  13727. * @return {string} String representation as of ".Fully.Qualified.MessageName"
  13728. * @expose
  13729. */
  13730. MessagePrototype.toString = function() {
  13731. return T.toString();
  13732. };
  13733. // Properties
  13734. /**
  13735. * Options.
  13736. * @name ProtoBuf.Builder.Message.$options
  13737. * @type {Object.<string,*>}
  13738. * @expose
  13739. */
  13740. var $options; // cc
  13741. /**
  13742. * Reflection type.
  13743. * @name ProtoBuf.Builder.Message#$type
  13744. * @type {!ProtoBuf.Reflect.Message}
  13745. * @expose
  13746. */
  13747. var $type; // cc
  13748. if (Object.defineProperty)
  13749. Object.defineProperty(Message, '$options', { "value": T.buildOpt() }),
  13750. Object.defineProperty(MessagePrototype, "$type", {
  13751. get: function() { return T; }
  13752. });
  13753. return Message;
  13754. })(ProtoBuf, this);
  13755. // Static enums and prototyped sub-messages / cached collections
  13756. this._fields = [];
  13757. this._fieldsById = {};
  13758. this._fieldsByName = {};
  13759. for (var i=0, k=this.children.length, child; i<k; i++) {
  13760. child = this.children[i];
  13761. if (child instanceof Enum)
  13762. clazz[child.name] = child.build();
  13763. else if (child instanceof Message)
  13764. clazz[child.name] = child.build();
  13765. else if (child instanceof Message.Field)
  13766. child.build(),
  13767. this._fields.push(child),
  13768. this._fieldsById[child.id] = child,
  13769. this._fieldsByName[child.name] = child;
  13770. else if (!(child instanceof Message.OneOf) && !(child instanceof Extension)) // Not built
  13771. throw Error("Illegal reflect child of "+this.toString(true)+": "+children[i].toString(true));
  13772. }
  13773. return this.clazz = clazz;
  13774. };
  13775. /**
  13776. * Encodes a runtime message's contents to the specified buffer.
  13777. * @param {!ProtoBuf.Builder.Message} message Runtime message to encode
  13778. * @param {ByteBuffer} buffer ByteBuffer to write to
  13779. * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`
  13780. * @return {ByteBuffer} The ByteBuffer for chaining
  13781. * @throws {Error} If required fields are missing or the message cannot be encoded for another reason
  13782. * @expose
  13783. */
  13784. MessagePrototype.encode = function(message, buffer, noVerify) {
  13785. var fieldMissing = null,
  13786. field;
  13787. for (var i=0, k=this._fields.length, val; i<k; ++i) {
  13788. field = this._fields[i];
  13789. val = message[field.name];
  13790. if (field.required && val === null) {
  13791. if (fieldMissing === null)
  13792. fieldMissing = field;
  13793. } else
  13794. field.encode(noVerify ? val : field.verifyValue(val), buffer);
  13795. }
  13796. if (fieldMissing !== null) {
  13797. var err = Error("Missing at least one required field for "+this.toString(true)+": "+fieldMissing);
  13798. err["encoded"] = buffer; // Still expose what we got
  13799. throw(err);
  13800. }
  13801. return buffer;
  13802. };
  13803. /**
  13804. * Calculates a runtime message's byte length.
  13805. * @param {!ProtoBuf.Builder.Message} message Runtime message to encode
  13806. * @returns {number} Byte length
  13807. * @throws {Error} If required fields are missing or the message cannot be calculated for another reason
  13808. * @expose
  13809. */
  13810. MessagePrototype.calculate = function(message) {
  13811. for (var n=0, i=0, k=this._fields.length, field, val; i<k; ++i) {
  13812. field = this._fields[i];
  13813. val = message[field.name];
  13814. if (field.required && val === null)
  13815. throw Error("Missing at least one required field for "+this.toString(true)+": "+field);
  13816. else
  13817. n += field.calculate(val);
  13818. }
  13819. return n;
  13820. };
  13821. /**
  13822. * Skips all data until the end of the specified group has been reached.
  13823. * @param {number} expectedId Expected GROUPEND id
  13824. * @param {!ByteBuffer} buf ByteBuffer
  13825. * @returns {boolean} `true` if a value as been skipped, `false` if the end has been reached
  13826. * @throws {Error} If it wasn't possible to find the end of the group (buffer overrun or end tag mismatch)
  13827. * @inner
  13828. */
  13829. function skipTillGroupEnd(expectedId, buf) {
  13830. var tag = buf.readVarint32(), // Throws on OOB
  13831. wireType = tag & 0x07,
  13832. id = tag >> 3;
  13833. switch (wireType) {
  13834. case ProtoBuf.WIRE_TYPES.VARINT:
  13835. do tag = buf.readUint8();
  13836. while ((tag & 0x80) === 0x80);
  13837. break;
  13838. case ProtoBuf.WIRE_TYPES.BITS64:
  13839. buf.offset += 8;
  13840. break;
  13841. case ProtoBuf.WIRE_TYPES.LDELIM:
  13842. tag = buf.readVarint32(); // reads the varint
  13843. buf.offset += tag; // skips n bytes
  13844. break;
  13845. case ProtoBuf.WIRE_TYPES.STARTGROUP:
  13846. skipTillGroupEnd(id, buf);
  13847. break;
  13848. case ProtoBuf.WIRE_TYPES.ENDGROUP:
  13849. if (id === expectedId)
  13850. return false;
  13851. else
  13852. throw Error("Illegal GROUPEND after unknown group: "+id+" ("+expectedId+" expected)");
  13853. case ProtoBuf.WIRE_TYPES.BITS32:
  13854. buf.offset += 4;
  13855. break;
  13856. default:
  13857. throw Error("Illegal wire type in unknown group "+expectedId+": "+wireType);
  13858. }
  13859. return true;
  13860. }
  13861. /**
  13862. * Decodes an encoded message and returns the decoded message.
  13863. * @param {ByteBuffer} buffer ByteBuffer to decode from
  13864. * @param {number=} length Message length. Defaults to decode all the available data.
  13865. * @param {number=} expectedGroupEndId Expected GROUPEND id if this is a legacy group
  13866. * @return {ProtoBuf.Builder.Message} Decoded message
  13867. * @throws {Error} If the message cannot be decoded
  13868. * @expose
  13869. */
  13870. MessagePrototype.decode = function(buffer, length, expectedGroupEndId) {
  13871. length = typeof length === 'number' ? length : -1;
  13872. var start = buffer.offset,
  13873. msg = new (this.clazz)(),
  13874. tag, wireType, id, field;
  13875. while (buffer.offset < start+length || (length === -1 && buffer.remaining() > 0)) {
  13876. tag = buffer.readVarint32();
  13877. wireType = tag & 0x07;
  13878. id = tag >> 3;
  13879. if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) {
  13880. if (id !== expectedGroupEndId)
  13881. throw Error("Illegal group end indicator for "+this.toString(true)+": "+id+" ("+(expectedGroupEndId ? expectedGroupEndId+" expected" : "not a group")+")");
  13882. break;
  13883. }
  13884. if (!(field = this._fieldsById[id])) {
  13885. // "messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing."
  13886. switch (wireType) {
  13887. case ProtoBuf.WIRE_TYPES.VARINT:
  13888. buffer.readVarint32();
  13889. break;
  13890. case ProtoBuf.WIRE_TYPES.BITS32:
  13891. buffer.offset += 4;
  13892. break;
  13893. case ProtoBuf.WIRE_TYPES.BITS64:
  13894. buffer.offset += 8;
  13895. break;
  13896. case ProtoBuf.WIRE_TYPES.LDELIM:
  13897. var len = buffer.readVarint32();
  13898. buffer.offset += len;
  13899. break;
  13900. case ProtoBuf.WIRE_TYPES.STARTGROUP:
  13901. while (skipTillGroupEnd(id, buffer)) {}
  13902. break;
  13903. default:
  13904. throw Error("Illegal wire type for unknown field "+id+" in "+this.toString(true)+"#decode: "+wireType);
  13905. }
  13906. continue;
  13907. }
  13908. if (field.repeated && !field.options["packed"])
  13909. msg[field.name].push(field.decode(wireType, buffer));
  13910. else {
  13911. msg[field.name] = field.decode(wireType, buffer);
  13912. if (field.oneof) {
  13913. if (this[field.oneof.name] !== null)
  13914. this[this[field.oneof.name]] = null;
  13915. msg[field.oneof.name] = field.name;
  13916. }
  13917. }
  13918. }
  13919. // Check if all required fields are present and set default values for optional fields that are not
  13920. for (var i=0, k=this._fields.length; i<k; ++i) {
  13921. field = this._fields[i];
  13922. if (msg[field.name] === null)
  13923. if (field.required) {
  13924. var err = Error("Missing at least one required field for "+this.toString(true)+": "+field.name);
  13925. err["decoded"] = msg; // Still expose what we got
  13926. throw(err);
  13927. } else if (field.defaultValue !== null)
  13928. msg[field.name] = field.defaultValue;
  13929. }
  13930. return msg;
  13931. };
  13932. /**
  13933. * @alias ProtoBuf.Reflect.Message
  13934. * @expose
  13935. */
  13936. Reflect.Message = Message;
  13937. /**
  13938. * Constructs a new Message Field.
  13939. * @exports ProtoBuf.Reflect.Message.Field
  13940. * @param {!ProtoBuf.Builder} builder Builder reference
  13941. * @param {!ProtoBuf.Reflect.Message} message Message reference
  13942. * @param {string} rule Rule, one of requried, optional, repeated
  13943. * @param {string} type Data type, e.g. int32
  13944. * @param {string} name Field name
  13945. * @param {number} id Unique field id
  13946. * @param {Object.<string,*>=} options Options
  13947. * @param {!ProtoBuf.Reflect.Message.OneOf=} oneof Enclosing OneOf
  13948. * @constructor
  13949. * @extends ProtoBuf.Reflect.T
  13950. */
  13951. var Field = function(builder, message, rule, type, name, id, options, oneof) {
  13952. T.call(this, builder, message, name);
  13953. /**
  13954. * @override
  13955. */
  13956. this.className = "Message.Field";
  13957. /**
  13958. * Message field required flag.
  13959. * @type {boolean}
  13960. * @expose
  13961. */
  13962. this.required = rule === "required";
  13963. /**
  13964. * Message field repeated flag.
  13965. * @type {boolean}
  13966. * @expose
  13967. */
  13968. this.repeated = rule === "repeated";
  13969. /**
  13970. * Message field type. Type reference string if unresolved, protobuf type if resolved.
  13971. * @type {string|{name: string, wireType: number}}
  13972. * @expose
  13973. */
  13974. this.type = type;
  13975. /**
  13976. * Resolved type reference inside the global namespace.
  13977. * @type {ProtoBuf.Reflect.T|null}
  13978. * @expose
  13979. */
  13980. this.resolvedType = null;
  13981. /**
  13982. * Unique message field id.
  13983. * @type {number}
  13984. * @expose
  13985. */
  13986. this.id = id;
  13987. /**
  13988. * Message field options.
  13989. * @type {!Object.<string,*>}
  13990. * @dict
  13991. * @expose
  13992. */
  13993. this.options = options || {};
  13994. /**
  13995. * Default value.
  13996. * @type {*}
  13997. * @expose
  13998. */
  13999. this.defaultValue = null;
  14000. /**
  14001. * Enclosing OneOf.
  14002. * @type {?ProtoBuf.Reflect.Message.OneOf}
  14003. * @expose
  14004. */
  14005. this.oneof = oneof || null;
  14006. /**
  14007. * Original field name.
  14008. * @type {string}
  14009. * @expose
  14010. */
  14011. this.originalName = this.name; // Used to revert camelcase transformation on naming collisions
  14012. // Convert field names to camel case notation if the override is set
  14013. if (this.builder.options['convertFieldsToCamelCase'] && !(this instanceof Message.ExtensionField))
  14014. this.name = Field._toCamelCase(this.name);
  14015. };
  14016. /**
  14017. * Converts a field name to camel case.
  14018. * @param {string} name Likely underscore notated name
  14019. * @returns {string} Camel case notated name
  14020. * @private
  14021. */
  14022. Field._toCamelCase = function(name) {
  14023. return name.replace(/_([a-zA-Z])/g, function($0, $1) {
  14024. return $1.toUpperCase();
  14025. });
  14026. };
  14027. /**
  14028. * @alias ProtoBuf.Reflect.Message.Field.prototype
  14029. * @inner
  14030. */
  14031. var FieldPrototype = Field.prototype = Object.create(T.prototype);
  14032. /**
  14033. * Builds the field.
  14034. * @override
  14035. * @expose
  14036. */
  14037. FieldPrototype.build = function() {
  14038. this.defaultValue = typeof this.options['default'] !== 'undefined'
  14039. ? this.verifyValue(this.options['default']) : null;
  14040. };
  14041. /**
  14042. * Makes a Long from a value.
  14043. * @param {{low: number, high: number, unsigned: boolean}|string|number} value Value
  14044. * @param {boolean=} unsigned Whether unsigned or not, defaults to reuse it from Long-like objects or to signed for
  14045. * strings and numbers
  14046. * @returns {!Long}
  14047. * @throws {Error} If the value cannot be converted to a Long
  14048. * @inner
  14049. */
  14050. function mkLong(value, unsigned) {
  14051. if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean'
  14052. && value.low === value.low && value.high === value.high)
  14053. return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned);
  14054. if (typeof value === 'string')
  14055. return ProtoBuf.Long.fromString(value, unsigned || false, 10);
  14056. if (typeof value === 'number')
  14057. return ProtoBuf.Long.fromNumber(value, unsigned || false);
  14058. throw Error("not convertible to Long");
  14059. }
  14060. /**
  14061. * Checks if the given value can be set for this field.
  14062. * @param {*} value Value to check
  14063. * @param {boolean=} skipRepeated Whether to skip the repeated value check or not. Defaults to false.
  14064. * @return {*} Verified, maybe adjusted, value
  14065. * @throws {Error} If the value cannot be set for this field
  14066. * @expose
  14067. */
  14068. FieldPrototype.verifyValue = function(value, skipRepeated) {
  14069. skipRepeated = skipRepeated || false;
  14070. var fail = function(val, msg) {
  14071. throw Error("Illegal value for "+this.toString(true)+" of type "+this.type.name+": "+val+" ("+msg+")");
  14072. }.bind(this);
  14073. if (value === null) { // NULL values for optional fields
  14074. if (this.required)
  14075. fail(typeof value, "required");
  14076. return null;
  14077. }
  14078. var i;
  14079. if (this.repeated && !skipRepeated) { // Repeated values as arrays
  14080. if (!ProtoBuf.Util.isArray(value))
  14081. value = [value];
  14082. var res = [];
  14083. for (i=0; i<value.length; i++)
  14084. res.push(this.verifyValue(value[i], true));
  14085. return res;
  14086. }
  14087. // All non-repeated fields expect no array
  14088. if (!this.repeated && ProtoBuf.Util.isArray(value))
  14089. fail(typeof value, "no array expected");
  14090. switch (this.type) {
  14091. // Signed 32bit
  14092. case ProtoBuf.TYPES["int32"]:
  14093. case ProtoBuf.TYPES["sint32"]:
  14094. case ProtoBuf.TYPES["sfixed32"]:
  14095. // Account for !NaN: value === value
  14096. if (typeof value !== 'number' || (value === value && value % 1 !== 0))
  14097. fail(typeof value, "not an integer");
  14098. return value > 4294967295 ? value | 0 : value;
  14099. // Unsigned 32bit
  14100. case ProtoBuf.TYPES["uint32"]:
  14101. case ProtoBuf.TYPES["fixed32"]:
  14102. if (typeof value !== 'number' || (value === value && value % 1 !== 0))
  14103. fail(typeof value, "not an integer");
  14104. return value < 0 ? value >>> 0 : value;
  14105. // Signed 64bit
  14106. case ProtoBuf.TYPES["int64"]:
  14107. case ProtoBuf.TYPES["sint64"]:
  14108. case ProtoBuf.TYPES["sfixed64"]: {
  14109. if (ProtoBuf.Long)
  14110. try {
  14111. return mkLong(value, false);
  14112. } catch (e) {
  14113. fail(typeof value, e.message);
  14114. }
  14115. else
  14116. fail(typeof value, "requires Long.js");
  14117. }
  14118. // Unsigned 64bit
  14119. case ProtoBuf.TYPES["uint64"]:
  14120. case ProtoBuf.TYPES["fixed64"]: {
  14121. if (ProtoBuf.Long)
  14122. try {
  14123. return mkLong(value, true);
  14124. } catch (e) {
  14125. fail(typeof value, e.message);
  14126. }
  14127. else
  14128. fail(typeof value, "requires Long.js");
  14129. }
  14130. // Bool
  14131. case ProtoBuf.TYPES["bool"]:
  14132. if (typeof value !== 'boolean')
  14133. fail(typeof value, "not a boolean");
  14134. return value;
  14135. // Float
  14136. case ProtoBuf.TYPES["float"]:
  14137. case ProtoBuf.TYPES["double"]:
  14138. if (typeof value !== 'number')
  14139. fail(typeof value, "not a number");
  14140. return value;
  14141. // Length-delimited string
  14142. case ProtoBuf.TYPES["string"]:
  14143. if (typeof value !== 'string' && !(value && value instanceof String))
  14144. fail(typeof value, "not a string");
  14145. return ""+value; // Convert String object to string
  14146. // Length-delimited bytes
  14147. case ProtoBuf.TYPES["bytes"]:
  14148. if (ByteBuffer.isByteBuffer(value))
  14149. return value;
  14150. return ByteBuffer.wrap(value, "base64");
  14151. // Constant enum value
  14152. case ProtoBuf.TYPES["enum"]: {
  14153. var values = this.resolvedType.getChildren(Enum.Value);
  14154. for (i=0; i<values.length; i++)
  14155. if (values[i].name == value)
  14156. return values[i].id;
  14157. else if (values[i].id == value)
  14158. return values[i].id;
  14159. fail(value, "not a valid enum value");
  14160. }
  14161. // Embedded message
  14162. case ProtoBuf.TYPES["group"]:
  14163. case ProtoBuf.TYPES["message"]: {
  14164. if (!value || typeof value !== 'object')
  14165. fail(typeof value, "object expected");
  14166. if (value instanceof this.resolvedType.clazz)
  14167. return value;
  14168. if (value instanceof ProtoBuf.Builder.Message) {
  14169. // Mismatched type: Convert to object (see: https://github.com/dcodeIO/ProtoBuf.js/issues/180)
  14170. var obj = {};
  14171. for (var i in value)
  14172. if (value.hasOwnProperty(i))
  14173. obj[i] = value[i];
  14174. value = obj;
  14175. }
  14176. // Else let's try to construct one from a key-value object
  14177. return new (this.resolvedType.clazz)(value); // May throw for a hundred of reasons
  14178. }
  14179. }
  14180. // We should never end here
  14181. throw Error("[INTERNAL] Illegal value for "+this.toString(true)+": "+value+" (undefined type "+this.type+")");
  14182. };
  14183. /**
  14184. * Encodes the specified field value to the specified buffer.
  14185. * @param {*} value Verified field value
  14186. * @param {ByteBuffer} buffer ByteBuffer to encode to
  14187. * @return {ByteBuffer} The ByteBuffer for chaining
  14188. * @throws {Error} If the field cannot be encoded
  14189. * @expose
  14190. */
  14191. FieldPrototype.encode = function(value, buffer) {
  14192. if (this.type === null || typeof this.type !== 'object')
  14193. throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);
  14194. if (value === null || (this.repeated && value.length == 0))
  14195. return buffer; // Optional omitted
  14196. try {
  14197. if (this.repeated) {
  14198. var i;
  14199. // "Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire
  14200. // types) can be declared 'packed'."
  14201. if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  14202. // "All of the elements of the field are packed into a single key-value pair with wire type 2
  14203. // (length-delimited). Each element is encoded the same way it would be normally, except without a
  14204. // tag preceding it."
  14205. buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);
  14206. buffer.ensureCapacity(buffer.offset += 1); // We do not know the length yet, so let's assume a varint of length 1
  14207. var start = buffer.offset; // Remember where the contents begin
  14208. for (i=0; i<value.length; i++)
  14209. this.encodeValue(value[i], buffer);
  14210. var len = buffer.offset-start,
  14211. varintLen = ByteBuffer.calculateVarint32(len);
  14212. if (varintLen > 1) { // We need to move the contents
  14213. var contents = buffer.slice(start, buffer.offset);
  14214. start += varintLen-1;
  14215. buffer.offset = start;
  14216. buffer.append(contents);
  14217. }
  14218. buffer.writeVarint32(len, start-varintLen);
  14219. } else {
  14220. // "If your message definition has repeated elements (without the [packed=true] option), the encoded
  14221. // message has zero or more key-value pairs with the same tag number"
  14222. for (i=0; i<value.length; i++)
  14223. buffer.writeVarint32((this.id << 3) | this.type.wireType),
  14224. this.encodeValue(value[i], buffer);
  14225. }
  14226. } else
  14227. buffer.writeVarint32((this.id << 3) | this.type.wireType),
  14228. this.encodeValue(value, buffer);
  14229. } catch (e) {
  14230. throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");
  14231. }
  14232. return buffer;
  14233. };
  14234. /**
  14235. * Encodes a value to the specified buffer. Does not encode the key.
  14236. * @param {*} value Field value
  14237. * @param {ByteBuffer} buffer ByteBuffer to encode to
  14238. * @return {ByteBuffer} The ByteBuffer for chaining
  14239. * @throws {Error} If the value cannot be encoded
  14240. * @expose
  14241. */
  14242. FieldPrototype.encodeValue = function(value, buffer) {
  14243. if (value === null) return buffer; // Nothing to encode
  14244. // Tag has already been written
  14245. switch (this.type) {
  14246. // 32bit signed varint
  14247. case ProtoBuf.TYPES["int32"]:
  14248. // "If you use int32 or int64 as the type for a negative number, the resulting varint is always ten bytes
  14249. // long – it is, effectively, treated like a very large unsigned integer." (see #122)
  14250. if (value < 0)
  14251. buffer.writeVarint64(value);
  14252. else
  14253. buffer.writeVarint32(value);
  14254. break;
  14255. // 32bit unsigned varint
  14256. case ProtoBuf.TYPES["uint32"]:
  14257. buffer.writeVarint32(value);
  14258. break;
  14259. // 32bit varint zig-zag
  14260. case ProtoBuf.TYPES["sint32"]:
  14261. buffer.writeVarint32ZigZag(value);
  14262. break;
  14263. // Fixed unsigned 32bit
  14264. case ProtoBuf.TYPES["fixed32"]:
  14265. buffer.writeUint32(value);
  14266. break;
  14267. // Fixed signed 32bit
  14268. case ProtoBuf.TYPES["sfixed32"]:
  14269. buffer.writeInt32(value);
  14270. break;
  14271. // 64bit varint as-is
  14272. case ProtoBuf.TYPES["int64"]:
  14273. case ProtoBuf.TYPES["uint64"]:
  14274. buffer.writeVarint64(value); // throws
  14275. break;
  14276. // 64bit varint zig-zag
  14277. case ProtoBuf.TYPES["sint64"]:
  14278. buffer.writeVarint64ZigZag(value); // throws
  14279. break;
  14280. // Fixed unsigned 64bit
  14281. case ProtoBuf.TYPES["fixed64"]:
  14282. buffer.writeUint64(value); // throws
  14283. break;
  14284. // Fixed signed 64bit
  14285. case ProtoBuf.TYPES["sfixed64"]:
  14286. buffer.writeInt64(value); // throws
  14287. break;
  14288. // Bool
  14289. case ProtoBuf.TYPES["bool"]:
  14290. if (typeof value === 'string')
  14291. buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value);
  14292. else
  14293. buffer.writeVarint32(value ? 1 : 0);
  14294. break;
  14295. // Constant enum value
  14296. case ProtoBuf.TYPES["enum"]:
  14297. buffer.writeVarint32(value);
  14298. break;
  14299. // 32bit float
  14300. case ProtoBuf.TYPES["float"]:
  14301. buffer.writeFloat32(value);
  14302. break;
  14303. // 64bit float
  14304. case ProtoBuf.TYPES["double"]:
  14305. buffer.writeFloat64(value);
  14306. break;
  14307. // Length-delimited string
  14308. case ProtoBuf.TYPES["string"]:
  14309. buffer.writeVString(value);
  14310. break;
  14311. // Length-delimited bytes
  14312. case ProtoBuf.TYPES["bytes"]:
  14313. if (value.remaining() < 0)
  14314. throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");
  14315. var prevOffset = value.offset;
  14316. buffer.writeVarint32(value.remaining());
  14317. buffer.append(value);
  14318. value.offset = prevOffset;
  14319. break;
  14320. // Embedded message
  14321. case ProtoBuf.TYPES["message"]:
  14322. var bb = new ByteBuffer().LE();
  14323. this.resolvedType.encode(value, bb);
  14324. buffer.writeVarint32(bb.offset);
  14325. buffer.append(bb.flip());
  14326. break;
  14327. // Legacy group
  14328. case ProtoBuf.TYPES["group"]:
  14329. this.resolvedType.encode(value, buffer);
  14330. buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);
  14331. break;
  14332. default:
  14333. // We should never end here
  14334. throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");
  14335. }
  14336. return buffer;
  14337. };
  14338. /**
  14339. * Calculates the length of this field's value on the network level.
  14340. * @param {*} value Field value
  14341. * @returns {number} Byte length
  14342. * @expose
  14343. */
  14344. FieldPrototype.calculate = function(value) {
  14345. value = this.verifyValue(value); // May throw
  14346. if (this.type === null || typeof this.type !== 'object')
  14347. throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);
  14348. if (value === null || (this.repeated && value.length == 0))
  14349. return 0; // Optional omitted
  14350. var n = 0;
  14351. try {
  14352. if (this.repeated) {
  14353. var i, ni;
  14354. if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  14355. n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);
  14356. ni = 0;
  14357. for (i=0; i<value.length; i++)
  14358. ni += this.calculateValue(value[i]);
  14359. n += ByteBuffer.calculateVarint32(ni);
  14360. n += ni;
  14361. } else {
  14362. for (i=0; i<value.length; i++)
  14363. n += ByteBuffer.calculateVarint32((this.id << 3) | this.type.wireType),
  14364. n += this.calculateValue(value[i]);
  14365. }
  14366. } else {
  14367. n += ByteBuffer.calculateVarint32((this.id << 3) | this.type.wireType);
  14368. n += this.calculateValue(value);
  14369. }
  14370. } catch (e) {
  14371. throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");
  14372. }
  14373. return n;
  14374. };
  14375. /**
  14376. * Calculates the byte length of a value.
  14377. * @param {*} value Field value
  14378. * @returns {number} Byte length
  14379. * @throws {Error} If the value cannot be calculated
  14380. * @expose
  14381. */
  14382. FieldPrototype.calculateValue = function(value) {
  14383. if (value === null) return 0; // Nothing to encode
  14384. // Tag has already been written
  14385. var n;
  14386. switch (this.type) {
  14387. case ProtoBuf.TYPES["int32"]:
  14388. return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value);
  14389. case ProtoBuf.TYPES["uint32"]:
  14390. return ByteBuffer.calculateVarint32(value);
  14391. case ProtoBuf.TYPES["sint32"]:
  14392. return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value));
  14393. case ProtoBuf.TYPES["fixed32"]:
  14394. case ProtoBuf.TYPES["sfixed32"]:
  14395. case ProtoBuf.TYPES["float"]:
  14396. return 4;
  14397. case ProtoBuf.TYPES["int64"]:
  14398. case ProtoBuf.TYPES["uint64"]:
  14399. return ByteBuffer.calculateVarint64(value);
  14400. case ProtoBuf.TYPES["sint64"]:
  14401. return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value));
  14402. case ProtoBuf.TYPES["fixed64"]:
  14403. case ProtoBuf.TYPES["sfixed64"]:
  14404. return 8;
  14405. case ProtoBuf.TYPES["bool"]:
  14406. return 1;
  14407. case ProtoBuf.TYPES["enum"]:
  14408. return ByteBuffer.calculateVarint32(value);
  14409. case ProtoBuf.TYPES["double"]:
  14410. return 8;
  14411. case ProtoBuf.TYPES["string"]:
  14412. n = ByteBuffer.calculateUTF8Bytes(value);
  14413. return ByteBuffer.calculateVarint32(n) + n;
  14414. case ProtoBuf.TYPES["bytes"]:
  14415. if (value.remaining() < 0)
  14416. throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");
  14417. return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining();
  14418. case ProtoBuf.TYPES["message"]:
  14419. n = this.resolvedType.calculate(value);
  14420. return ByteBuffer.calculateVarint32(n) + n;
  14421. case ProtoBuf.TYPES["group"]:
  14422. n = this.resolvedType.calculate(value);
  14423. return n + ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);
  14424. }
  14425. // We should never end here
  14426. throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");
  14427. };
  14428. /**
  14429. * Decode the field value from the specified buffer.
  14430. * @param {number} wireType Leading wire type
  14431. * @param {ByteBuffer} buffer ByteBuffer to decode from
  14432. * @param {boolean=} skipRepeated Whether to skip the repeated check or not. Defaults to false.
  14433. * @return {*} Decoded value
  14434. * @throws {Error} If the field cannot be decoded
  14435. * @expose
  14436. */
  14437. FieldPrototype.decode = function(wireType, buffer, skipRepeated) {
  14438. var value, nBytes;
  14439. if (wireType != this.type.wireType && (skipRepeated || (wireType != ProtoBuf.WIRE_TYPES.LDELIM || !this.repeated)))
  14440. throw Error("Illegal wire type for field "+this.toString(true)+": "+wireType+" ("+this.type.wireType+" expected)");
  14441. if (wireType == ProtoBuf.WIRE_TYPES.LDELIM && this.repeated && this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  14442. if (!skipRepeated) {
  14443. nBytes = buffer.readVarint32();
  14444. nBytes = buffer.offset + nBytes; // Limit
  14445. var values = [];
  14446. while (buffer.offset < nBytes)
  14447. values.push(this.decode(this.type.wireType, buffer, true));
  14448. return values;
  14449. }
  14450. // Read the next value otherwise...
  14451. }
  14452. switch (this.type) {
  14453. // 32bit signed varint
  14454. case ProtoBuf.TYPES["int32"]:
  14455. return buffer.readVarint32() | 0;
  14456. // 32bit unsigned varint
  14457. case ProtoBuf.TYPES["uint32"]:
  14458. return buffer.readVarint32() >>> 0;
  14459. // 32bit signed varint zig-zag
  14460. case ProtoBuf.TYPES["sint32"]:
  14461. return buffer.readVarint32ZigZag() | 0;
  14462. // Fixed 32bit unsigned
  14463. case ProtoBuf.TYPES["fixed32"]:
  14464. return buffer.readUint32() >>> 0;
  14465. case ProtoBuf.TYPES["sfixed32"]:
  14466. return buffer.readInt32() | 0;
  14467. // 64bit signed varint
  14468. case ProtoBuf.TYPES["int64"]:
  14469. return buffer.readVarint64();
  14470. // 64bit unsigned varint
  14471. case ProtoBuf.TYPES["uint64"]:
  14472. return buffer.readVarint64().toUnsigned();
  14473. // 64bit signed varint zig-zag
  14474. case ProtoBuf.TYPES["sint64"]:
  14475. return buffer.readVarint64ZigZag();
  14476. // Fixed 64bit unsigned
  14477. case ProtoBuf.TYPES["fixed64"]:
  14478. return buffer.readUint64();
  14479. // Fixed 64bit signed
  14480. case ProtoBuf.TYPES["sfixed64"]:
  14481. return buffer.readInt64();
  14482. // Bool varint
  14483. case ProtoBuf.TYPES["bool"]:
  14484. return !!buffer.readVarint32();
  14485. // Constant enum value (varint)
  14486. case ProtoBuf.TYPES["enum"]:
  14487. // The following Builder.Message#set will already throw
  14488. return buffer.readVarint32();
  14489. // 32bit float
  14490. case ProtoBuf.TYPES["float"]:
  14491. return buffer.readFloat();
  14492. // 64bit float
  14493. case ProtoBuf.TYPES["double"]:
  14494. return buffer.readDouble();
  14495. // Length-delimited string
  14496. case ProtoBuf.TYPES["string"]:
  14497. return buffer.readVString();
  14498. // Length-delimited bytes
  14499. case ProtoBuf.TYPES["bytes"]: {
  14500. nBytes = buffer.readVarint32();
  14501. if (buffer.remaining() < nBytes)
  14502. throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining());
  14503. value = buffer.clone(); // Offset already set
  14504. value.limit = value.offset+nBytes;
  14505. buffer.offset += nBytes;
  14506. return value;
  14507. }
  14508. // Length-delimited embedded message
  14509. case ProtoBuf.TYPES["message"]: {
  14510. nBytes = buffer.readVarint32();
  14511. return this.resolvedType.decode(buffer, nBytes);
  14512. }
  14513. // Legacy group
  14514. case ProtoBuf.TYPES["group"]:
  14515. return this.resolvedType.decode(buffer, -1, this.id);
  14516. }
  14517. // We should never end here
  14518. throw Error("[INTERNAL] Illegal wire type for "+this.toString(true)+": "+wireType);
  14519. };
  14520. /**
  14521. * @alias ProtoBuf.Reflect.Message.Field
  14522. * @expose
  14523. */
  14524. Reflect.Message.Field = Field;
  14525. /**
  14526. * Constructs a new Message ExtensionField.
  14527. * @exports ProtoBuf.Reflect.Message.ExtensionField
  14528. * @param {!ProtoBuf.Builder} builder Builder reference
  14529. * @param {!ProtoBuf.Reflect.Message} message Message reference
  14530. * @param {string} rule Rule, one of requried, optional, repeated
  14531. * @param {string} type Data type, e.g. int32
  14532. * @param {string} name Field name
  14533. * @param {number} id Unique field id
  14534. * @param {Object.<string,*>=} options Options
  14535. * @constructor
  14536. * @extends ProtoBuf.Reflect.Message.Field
  14537. */
  14538. var ExtensionField = function(builder, message, rule, type, name, id, options) {
  14539. Field.call(this, builder, message, rule, type, name, id, options);
  14540. /**
  14541. * Extension reference.
  14542. * @type {!ProtoBuf.Reflect.Extension}
  14543. * @expose
  14544. */
  14545. this.extension;
  14546. };
  14547. // Extends Field
  14548. ExtensionField.prototype = Object.create(Field.prototype);
  14549. /**
  14550. * @alias ProtoBuf.Reflect.Message.ExtensionField
  14551. * @expose
  14552. */
  14553. Reflect.Message.ExtensionField = ExtensionField;
  14554. /**
  14555. * Constructs a new Message OneOf.
  14556. * @exports ProtoBuf.Reflect.Message.OneOf
  14557. * @param {!ProtoBuf.Builder} builder Builder reference
  14558. * @param {!ProtoBuf.Reflect.Message} message Message reference
  14559. * @param {string} name OneOf name
  14560. * @constructor
  14561. * @extends ProtoBuf.Reflect.T
  14562. */
  14563. var OneOf = function(builder, message, name) {
  14564. T.call(this, builder, message, name);
  14565. /**
  14566. * Enclosed fields.
  14567. * @type {!Array.<!ProtoBuf.Reflect.Message.Field>}
  14568. * @expose
  14569. */
  14570. this.fields = [];
  14571. };
  14572. /**
  14573. * @alias ProtoBuf.Reflect.Message.OneOf
  14574. * @expose
  14575. */
  14576. Reflect.Message.OneOf = OneOf;
  14577. /**
  14578. * Constructs a new Enum.
  14579. * @exports ProtoBuf.Reflect.Enum
  14580. * @param {!ProtoBuf.Builder} builder Builder reference
  14581. * @param {!ProtoBuf.Reflect.T} parent Parent Reflect object
  14582. * @param {string} name Enum name
  14583. * @param {Object.<string,*>=} options Enum options
  14584. * @constructor
  14585. * @extends ProtoBuf.Reflect.Namespace
  14586. */
  14587. var Enum = function(builder, parent, name, options) {
  14588. Namespace.call(this, builder, parent, name, options);
  14589. /**
  14590. * @override
  14591. */
  14592. this.className = "Enum";
  14593. /**
  14594. * Runtime enum object.
  14595. * @type {Object.<string,number>|null}
  14596. * @expose
  14597. */
  14598. this.object = null;
  14599. };
  14600. /**
  14601. * @alias ProtoBuf.Reflect.Enum.prototype
  14602. * @inner
  14603. */
  14604. var EnumPrototype = Enum.prototype = Object.create(Namespace.prototype);
  14605. /**
  14606. * Builds this enum and returns the runtime counterpart.
  14607. * @return {Object<string,*>}
  14608. * @expose
  14609. */
  14610. EnumPrototype.build = function() {
  14611. var enm = {},
  14612. values = this.getChildren(Enum.Value);
  14613. for (var i=0, k=values.length; i<k; ++i)
  14614. enm[values[i]['name']] = values[i]['id'];
  14615. if (Object.defineProperty)
  14616. Object.defineProperty(enm, '$options', { "value": this.buildOpt() });
  14617. return this.object = enm;
  14618. };
  14619. /**
  14620. * @alias ProtoBuf.Reflect.Enum
  14621. * @expose
  14622. */
  14623. Reflect.Enum = Enum;
  14624. /**
  14625. * Constructs a new Enum Value.
  14626. * @exports ProtoBuf.Reflect.Enum.Value
  14627. * @param {!ProtoBuf.Builder} builder Builder reference
  14628. * @param {!ProtoBuf.Reflect.Enum} enm Enum reference
  14629. * @param {string} name Field name
  14630. * @param {number} id Unique field id
  14631. * @constructor
  14632. * @extends ProtoBuf.Reflect.T
  14633. */
  14634. var Value = function(builder, enm, name, id) {
  14635. T.call(this, builder, enm, name);
  14636. /**
  14637. * @override
  14638. */
  14639. this.className = "Enum.Value";
  14640. /**
  14641. * Unique enum value id.
  14642. * @type {number}
  14643. * @expose
  14644. */
  14645. this.id = id;
  14646. };
  14647. // Extends T
  14648. Value.prototype = Object.create(T.prototype);
  14649. /**
  14650. * @alias ProtoBuf.Reflect.Enum.Value
  14651. * @expose
  14652. */
  14653. Reflect.Enum.Value = Value;
  14654. /**
  14655. * An extension (field).
  14656. * @exports ProtoBuf.Reflect.Extension
  14657. * @constructor
  14658. * @param {!ProtoBuf.Builder} builder Builder reference
  14659. * @param {!ProtoBuf.Reflect.T} parent Parent object
  14660. * @param {string} name Object name
  14661. * @param {!ProtoBuf.Reflect.Message.Field} field Extension field
  14662. */
  14663. var Extension = function(builder, parent, name, field) {
  14664. T.call(this, builder, parent, name);
  14665. /**
  14666. * Extended message field.
  14667. * @type {!ProtoBuf.Reflect.Message.Field}
  14668. * @expose
  14669. */
  14670. this.field = field;
  14671. };
  14672. // Extends T
  14673. Extension.prototype = Object.create(T.prototype);
  14674. /**
  14675. * @alias ProtoBuf.Reflect.Extension
  14676. * @expose
  14677. */
  14678. Reflect.Extension = Extension;
  14679. /**
  14680. * Constructs a new Service.
  14681. * @exports ProtoBuf.Reflect.Service
  14682. * @param {!ProtoBuf.Builder} builder Builder reference
  14683. * @param {!ProtoBuf.Reflect.Namespace} root Root
  14684. * @param {string} name Service name
  14685. * @param {Object.<string,*>=} options Options
  14686. * @constructor
  14687. * @extends ProtoBuf.Reflect.Namespace
  14688. */
  14689. var Service = function(builder, root, name, options) {
  14690. Namespace.call(this, builder, root, name, options);
  14691. /**
  14692. * @override
  14693. */
  14694. this.className = "Service";
  14695. /**
  14696. * Built runtime service class.
  14697. * @type {?function(new:ProtoBuf.Builder.Service)}
  14698. */
  14699. this.clazz = null;
  14700. };
  14701. /**
  14702. * @alias ProtoBuf.Reflect.Service.prototype
  14703. * @inner
  14704. */
  14705. var ServicePrototype = Service.prototype = Object.create(Namespace.prototype);
  14706. /**
  14707. * Builds the service and returns the runtime counterpart, which is a fully functional class.
  14708. * @see ProtoBuf.Builder.Service
  14709. * @param {boolean=} rebuild Whether to rebuild or not
  14710. * @return {Function} Service class
  14711. * @throws {Error} If the message cannot be built
  14712. * @expose
  14713. */
  14714. ServicePrototype.build = function(rebuild) {
  14715. if (this.clazz && !rebuild)
  14716. return this.clazz;
  14717. // Create the runtime Service class in its own scope
  14718. return this.clazz = (function(ProtoBuf, T) {
  14719. /**
  14720. * Constructs a new runtime Service.
  14721. * @name ProtoBuf.Builder.Service
  14722. * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message
  14723. * @class Barebone of all runtime services.
  14724. * @constructor
  14725. * @throws {Error} If the service cannot be created
  14726. */
  14727. var Service = function(rpcImpl) {
  14728. ProtoBuf.Builder.Service.call(this);
  14729. /**
  14730. * Service implementation.
  14731. * @name ProtoBuf.Builder.Service#rpcImpl
  14732. * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))}
  14733. * @expose
  14734. */
  14735. this.rpcImpl = rpcImpl || function(name, msg, callback) {
  14736. // This is what a user has to implement: A function receiving the method name, the actual message to
  14737. // send (type checked) and the callback that's either provided with the error as its first
  14738. // argument or null and the actual response message.
  14739. setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0); // Must be async!
  14740. };
  14741. };
  14742. /**
  14743. * @alias ProtoBuf.Builder.Service.prototype
  14744. * @inner
  14745. */
  14746. var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype);
  14747. if (Object.defineProperty)
  14748. Object.defineProperty(Service, "$options", { "value": T.buildOpt() }),
  14749. Object.defineProperty(ServicePrototype, "$options", { "value": Service["$options"] });
  14750. /**
  14751. * Asynchronously performs an RPC call using the given RPC implementation.
  14752. * @name ProtoBuf.Builder.Service.[Method]
  14753. * @function
  14754. * @param {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl RPC implementation
  14755. * @param {ProtoBuf.Builder.Message} req Request
  14756. * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving
  14757. * the error if any and the response either as a pre-parsed message or as its raw bytes
  14758. * @abstract
  14759. */
  14760. /**
  14761. * Asynchronously performs an RPC call using the instance's RPC implementation.
  14762. * @name ProtoBuf.Builder.Service#[Method]
  14763. * @function
  14764. * @param {ProtoBuf.Builder.Message} req Request
  14765. * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving
  14766. * the error if any and the response either as a pre-parsed message or as its raw bytes
  14767. * @abstract
  14768. */
  14769. var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod);
  14770. for (var i=0; i<rpc.length; i++) {
  14771. (function(method) {
  14772. // service#Method(message, callback)
  14773. ServicePrototype[method.name] = function(req, callback) {
  14774. try {
  14775. if (!req || !(req instanceof method.resolvedRequestType.clazz)) {
  14776. setTimeout(callback.bind(this, Error("Illegal request type provided to service method "+T.name+"#"+method.name)), 0);
  14777. return;
  14778. }
  14779. this.rpcImpl(method.fqn(), req, function(err, res) { // Assumes that this is properly async
  14780. if (err) {
  14781. callback(err);
  14782. return;
  14783. }
  14784. try { res = method.resolvedResponseType.clazz.decode(res); } catch (notABuffer) {}
  14785. if (!res || !(res instanceof method.resolvedResponseType.clazz)) {
  14786. callback(Error("Illegal response type received in service method "+ T.name+"#"+method.name));
  14787. return;
  14788. }
  14789. callback(null, res);
  14790. });
  14791. } catch (err) {
  14792. setTimeout(callback.bind(this, err), 0);
  14793. }
  14794. };
  14795. // Service.Method(rpcImpl, message, callback)
  14796. Service[method.name] = function(rpcImpl, req, callback) {
  14797. new Service(rpcImpl)[method.name](req, callback);
  14798. };
  14799. if (Object.defineProperty)
  14800. Object.defineProperty(Service[method.name], "$options", { "value": method.buildOpt() }),
  14801. Object.defineProperty(ServicePrototype[method.name], "$options", { "value": Service[method.name]["$options"] });
  14802. })(rpc[i]);
  14803. }
  14804. return Service;
  14805. })(ProtoBuf, this);
  14806. };
  14807. /**
  14808. * @alias ProtoBuf.Reflect.Service
  14809. * @expose
  14810. */
  14811. Reflect.Service = Service;
  14812. /**
  14813. * Abstract service method.
  14814. * @exports ProtoBuf.Reflect.Service.Method
  14815. * @param {!ProtoBuf.Builder} builder Builder reference
  14816. * @param {!ProtoBuf.Reflect.Service} svc Service
  14817. * @param {string} name Method name
  14818. * @param {Object.<string,*>=} options Options
  14819. * @constructor
  14820. * @extends ProtoBuf.Reflect.T
  14821. */
  14822. var Method = function(builder, svc, name, options) {
  14823. T.call(this, builder, svc, name);
  14824. /**
  14825. * @override
  14826. */
  14827. this.className = "Service.Method";
  14828. /**
  14829. * Options.
  14830. * @type {Object.<string, *>}
  14831. * @expose
  14832. */
  14833. this.options = options || {};
  14834. };
  14835. /**
  14836. * @alias ProtoBuf.Reflect.Service.Method.prototype
  14837. * @inner
  14838. */
  14839. var MethodPrototype = Method.prototype = Object.create(T.prototype);
  14840. /**
  14841. * Builds the method's '$options' property.
  14842. * @name ProtoBuf.Reflect.Service.Method#buildOpt
  14843. * @function
  14844. * @return {Object.<string,*>}
  14845. */
  14846. MethodPrototype.buildOpt = NamespacePrototype.buildOpt;
  14847. /**
  14848. * @alias ProtoBuf.Reflect.Service.Method
  14849. * @expose
  14850. */
  14851. Reflect.Service.Method = Method;
  14852. /**
  14853. * RPC service method.
  14854. * @exports ProtoBuf.Reflect.Service.RPCMethod
  14855. * @param {!ProtoBuf.Builder} builder Builder reference
  14856. * @param {!ProtoBuf.Reflect.Service} svc Service
  14857. * @param {string} name Method name
  14858. * @param {string} request Request message name
  14859. * @param {string} response Response message name
  14860. * @param {Object.<string,*>=} options Options
  14861. * @constructor
  14862. * @extends ProtoBuf.Reflect.Service.Method
  14863. */
  14864. var RPCMethod = function(builder, svc, name, request, response, options) {
  14865. Method.call(this, builder, svc, name, options);
  14866. /**
  14867. * @override
  14868. */
  14869. this.className = "Service.RPCMethod";
  14870. /**
  14871. * Request message name.
  14872. * @type {string}
  14873. * @expose
  14874. */
  14875. this.requestName = request;
  14876. /**
  14877. * Response message name.
  14878. * @type {string}
  14879. * @expose
  14880. */
  14881. this.responseName = response;
  14882. /**
  14883. * Resolved request message type.
  14884. * @type {ProtoBuf.Reflect.Message}
  14885. * @expose
  14886. */
  14887. this.resolvedRequestType = null;
  14888. /**
  14889. * Resolved response message type.
  14890. * @type {ProtoBuf.Reflect.Message}
  14891. * @expose
  14892. */
  14893. this.resolvedResponseType = null;
  14894. };
  14895. // Extends Method
  14896. RPCMethod.prototype = Object.create(Method.prototype);
  14897. /**
  14898. * @alias ProtoBuf.Reflect.Service.RPCMethod
  14899. * @expose
  14900. */
  14901. Reflect.Service.RPCMethod = RPCMethod;
  14902. return Reflect;
  14903. })(ProtoBuf);
  14904. /**
  14905. * @alias ProtoBuf.Builder
  14906. * @expose
  14907. */
  14908. ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) {
  14909. "use strict";
  14910. /**
  14911. * Constructs a new Builder.
  14912. * @exports ProtoBuf.Builder
  14913. * @class Provides the functionality to build protocol messages.
  14914. * @param {Object.<string,*>=} options Options
  14915. * @constructor
  14916. */
  14917. var Builder = function(options) {
  14918. /**
  14919. * Namespace.
  14920. * @type {ProtoBuf.Reflect.Namespace}
  14921. * @expose
  14922. */
  14923. this.ns = new Reflect.Namespace(this, null, ""); // Global namespace
  14924. /**
  14925. * Namespace pointer.
  14926. * @type {ProtoBuf.Reflect.T}
  14927. * @expose
  14928. */
  14929. this.ptr = this.ns;
  14930. /**
  14931. * Resolved flag.
  14932. * @type {boolean}
  14933. * @expose
  14934. */
  14935. this.resolved = false;
  14936. /**
  14937. * The current building result.
  14938. * @type {Object.<string,ProtoBuf.Builder.Message|Object>|null}
  14939. * @expose
  14940. */
  14941. this.result = null;
  14942. /**
  14943. * Imported files.
  14944. * @type {Array.<string>}
  14945. * @expose
  14946. */
  14947. this.files = {};
  14948. /**
  14949. * Import root override.
  14950. * @type {?string}
  14951. * @expose
  14952. */
  14953. this.importRoot = null;
  14954. /**
  14955. * Options.
  14956. * @type {!Object.<string, *>}
  14957. * @expose
  14958. */
  14959. this.options = options || {};
  14960. };
  14961. /**
  14962. * @alias ProtoBuf.Builder.prototype
  14963. * @inner
  14964. */
  14965. var BuilderPrototype = Builder.prototype;
  14966. /**
  14967. * Resets the pointer to the root namespace.
  14968. * @expose
  14969. */
  14970. BuilderPrototype.reset = function() {
  14971. this.ptr = this.ns;
  14972. };
  14973. /**
  14974. * Defines a package on top of the current pointer position and places the pointer on it.
  14975. * @param {string} pkg
  14976. * @param {Object.<string,*>=} options
  14977. * @return {ProtoBuf.Builder} this
  14978. * @throws {Error} If the package name is invalid
  14979. * @expose
  14980. */
  14981. BuilderPrototype.define = function(pkg, options) {
  14982. if (typeof pkg !== 'string' || !Lang.TYPEREF.test(pkg))
  14983. throw Error("Illegal package: "+pkg);
  14984. var part = pkg.split("."), i;
  14985. for (i=0; i<part.length; i++) // To be absolutely sure
  14986. if (!Lang.NAME.test(part[i]))
  14987. throw Error("Illegal package: "+part[i]);
  14988. for (i=0; i<part.length; i++) {
  14989. if (this.ptr.getChild(part[i]) === null) // Keep existing namespace
  14990. this.ptr.addChild(new Reflect.Namespace(this, this.ptr, part[i], options));
  14991. this.ptr = this.ptr.getChild(part[i]);
  14992. }
  14993. return this;
  14994. };
  14995. /**
  14996. * Tests if a definition is a valid message definition.
  14997. * @param {Object.<string,*>} def Definition
  14998. * @return {boolean} true if valid, else false
  14999. * @expose
  15000. */
  15001. Builder.isValidMessage = function(def) {
  15002. // Messages require a string name
  15003. if (typeof def["name"] !== 'string' || !Lang.NAME.test(def["name"]))
  15004. return false;
  15005. // Messages must not contain values (that'd be an enum) or methods (that'd be a service)
  15006. if (typeof def["values"] !== 'undefined' || typeof def["rpc"] !== 'undefined')
  15007. return false;
  15008. // Fields, enums and messages are arrays if provided
  15009. var i;
  15010. if (typeof def["fields"] !== 'undefined') {
  15011. if (!ProtoBuf.Util.isArray(def["fields"]))
  15012. return false;
  15013. var ids = [], id; // IDs must be unique
  15014. for (i=0; i<def["fields"].length; i++) {
  15015. if (!Builder.isValidMessageField(def["fields"][i]))
  15016. return false;
  15017. id = parseInt(def["fields"][i]["id"], 10);
  15018. if (ids.indexOf(id) >= 0)
  15019. return false;
  15020. ids.push(id);
  15021. }
  15022. ids = null;
  15023. }
  15024. if (typeof def["enums"] !== 'undefined') {
  15025. if (!ProtoBuf.Util.isArray(def["enums"]))
  15026. return false;
  15027. for (i=0; i<def["enums"].length; i++)
  15028. if (!Builder.isValidEnum(def["enums"][i]))
  15029. return false;
  15030. }
  15031. if (typeof def["messages"] !== 'undefined') {
  15032. if (!ProtoBuf.Util.isArray(def["messages"]))
  15033. return false;
  15034. for (i=0; i<def["messages"].length; i++)
  15035. if (!Builder.isValidMessage(def["messages"][i]) && !Builder.isValidExtend(def["messages"][i]))
  15036. return false;
  15037. }
  15038. if (typeof def["extensions"] !== 'undefined')
  15039. if (!ProtoBuf.Util.isArray(def["extensions"]) || def["extensions"].length !== 2 || typeof def["extensions"][0] !== 'number' || typeof def["extensions"][1] !== 'number')
  15040. return false;
  15041. return true;
  15042. };
  15043. /**
  15044. * Tests if a definition is a valid message field definition.
  15045. * @param {Object} def Definition
  15046. * @return {boolean} true if valid, else false
  15047. * @expose
  15048. */
  15049. Builder.isValidMessageField = function(def) {
  15050. // Message fields require a string rule, name and type and an id
  15051. if (typeof def["rule"] !== 'string' || typeof def["name"] !== 'string' || typeof def["type"] !== 'string' || typeof def["id"] === 'undefined')
  15052. return false;
  15053. if (!Lang.RULE.test(def["rule"]) || !Lang.NAME.test(def["name"]) || !Lang.TYPEREF.test(def["type"]) || !Lang.ID.test(""+def["id"]))
  15054. return false;
  15055. if (typeof def["options"] !== 'undefined') {
  15056. // Options are objects
  15057. if (typeof def["options"] !== 'object')
  15058. return false;
  15059. // Options are <string,string|number|boolean>
  15060. var keys = Object.keys(def["options"]);
  15061. for (var i=0, key; i<keys.length; i++)
  15062. if (typeof (key = keys[i]) !== 'string' || (typeof def["options"][key] !== 'string' && typeof def["options"][key] !== 'number' && typeof def["options"][key] !== 'boolean'))
  15063. return false;
  15064. }
  15065. return true;
  15066. };
  15067. /**
  15068. * Tests if a definition is a valid enum definition.
  15069. * @param {Object} def Definition
  15070. * @return {boolean} true if valid, else false
  15071. * @expose
  15072. */
  15073. Builder.isValidEnum = function(def) {
  15074. // Enums require a string name
  15075. if (typeof def["name"] !== 'string' || !Lang.NAME.test(def["name"]))
  15076. return false;
  15077. // Enums require at least one value
  15078. if (typeof def["values"] === 'undefined' || !ProtoBuf.Util.isArray(def["values"]) || def["values"].length == 0)
  15079. return false;
  15080. for (var i=0; i<def["values"].length; i++) {
  15081. // Values are objects
  15082. if (typeof def["values"][i] != "object")
  15083. return false;
  15084. // Values require a string name and an id
  15085. if (typeof def["values"][i]["name"] !== 'string' || typeof def["values"][i]["id"] === 'undefined')
  15086. return false;
  15087. if (!Lang.NAME.test(def["values"][i]["name"]) || !Lang.NEGID.test(""+def["values"][i]["id"]))
  15088. return false;
  15089. }
  15090. // It's not important if there are other fields because ["values"] is already unique
  15091. return true;
  15092. };
  15093. /**
  15094. * Creates ths specified protocol types at the current pointer position.
  15095. * @param {Array.<Object.<string,*>>} defs Messages, enums or services to create
  15096. * @return {ProtoBuf.Builder} this
  15097. * @throws {Error} If a message definition is invalid
  15098. * @expose
  15099. */
  15100. BuilderPrototype.create = function(defs) {
  15101. if (!defs)
  15102. return this; // Nothing to create
  15103. if (!ProtoBuf.Util.isArray(defs))
  15104. defs = [defs];
  15105. if (defs.length == 0)
  15106. return this;
  15107. // It's quite hard to keep track of scopes and memory here, so let's do this iteratively.
  15108. var stack = [];
  15109. stack.push(defs); // One level [a, b, c]
  15110. while (stack.length > 0) {
  15111. defs = stack.pop();
  15112. if (ProtoBuf.Util.isArray(defs)) { // Stack always contains entire namespaces
  15113. while (defs.length > 0) {
  15114. var def = defs.shift(); // Namespace always contains an array of messages, enums and services
  15115. if (Builder.isValidMessage(def)) {
  15116. var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"]);
  15117. // Create OneOfs
  15118. var oneofs = {};
  15119. if (def["oneofs"]) {
  15120. var keys = Object.keys(def["oneofs"]);
  15121. for (var i=0, k=keys.length; i<k; ++i)
  15122. obj.addChild(oneofs[keys[i]] = new Reflect.Message.OneOf(this, obj, keys[i]));
  15123. }
  15124. // Create fields
  15125. if (def["fields"] && def["fields"].length > 0) {
  15126. for (i=0, k=def["fields"].length; i<k; ++i) { // i:k=Fields
  15127. var fld = def['fields'][i];
  15128. if (obj.getChild(fld['id']) !== null)
  15129. throw Error("Duplicate field id in message "+obj.name+": "+fld['id']);
  15130. if (fld["options"]) {
  15131. var opts = Object.keys(fld["options"]);
  15132. for (var j= 0,l=opts.length; j<l; ++j) { // j:l=Option names
  15133. if (typeof opts[j] !== 'string')
  15134. throw Error("Illegal field option name in message "+obj.name+"#"+fld["name"]+": "+opts[j]);
  15135. if (typeof fld["options"][opts[j]] !== 'string' && typeof fld["options"][opts[j]] !== 'number' && typeof fld["options"][opts[j]] !== 'boolean')
  15136. throw Error("Illegal field option value in message "+obj.name+"#"+fld["name"]+"#"+opts[j]+": "+fld["options"][opts[j]]);
  15137. }
  15138. }
  15139. var oneof = null;
  15140. if (typeof fld["oneof"] === 'string') {
  15141. oneof = oneofs[fld["oneof"]];
  15142. if (typeof oneof === 'undefined')
  15143. throw Error("Illegal oneof in message "+obj.name+"#"+fld["name"]+": "+fld["oneof"]);
  15144. }
  15145. fld = new Reflect.Message.Field(this, obj, fld["rule"], fld["type"], fld["name"], fld["id"], fld["options"], oneof);
  15146. if (oneof)
  15147. oneof.fields.push(fld);
  15148. obj.addChild(fld);
  15149. }
  15150. }
  15151. // Push enums and messages to stack
  15152. var subObj = [];
  15153. if (typeof def["enums"] !== 'undefined' && def['enums'].length > 0)
  15154. for (i=0; i<def["enums"].length; i++)
  15155. subObj.push(def["enums"][i]);
  15156. if (def["messages"] && def["messages"].length > 0)
  15157. for (i=0; i<def["messages"].length; i++)
  15158. subObj.push(def["messages"][i]);
  15159. // Set extension range
  15160. if (def["extensions"]) {
  15161. obj.extensions = def["extensions"];
  15162. if (obj.extensions[0] < ProtoBuf.ID_MIN)
  15163. obj.extensions[0] = ProtoBuf.ID_MIN;
  15164. if (obj.extensions[1] > ProtoBuf.ID_MAX)
  15165. obj.extensions[1] = ProtoBuf.ID_MAX;
  15166. }
  15167. this.ptr.addChild(obj); // Add to current namespace
  15168. if (subObj.length > 0) {
  15169. stack.push(defs); // Push the current level back
  15170. defs = subObj; // Continue processing sub level
  15171. subObj = null;
  15172. this.ptr = obj; // And move the pointer to this namespace
  15173. obj = null;
  15174. continue;
  15175. }
  15176. subObj = null;
  15177. obj = null;
  15178. } else if (Builder.isValidEnum(def)) {
  15179. obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"]);
  15180. for (i=0; i<def["values"].length; i++)
  15181. obj.addChild(new Reflect.Enum.Value(this, obj, def["values"][i]["name"], def["values"][i]["id"]));
  15182. this.ptr.addChild(obj);
  15183. obj = null;
  15184. } else if (Builder.isValidService(def)) {
  15185. obj = new Reflect.Service(this, this.ptr, def["name"], def["options"]);
  15186. for (i in def["rpc"])
  15187. if (def["rpc"].hasOwnProperty(i))
  15188. obj.addChild(new Reflect.Service.RPCMethod(this, obj, i, def["rpc"][i]["request"], def["rpc"][i]["response"], def["rpc"][i]["options"]));
  15189. this.ptr.addChild(obj);
  15190. obj = null;
  15191. } else if (Builder.isValidExtend(def)) {
  15192. obj = this.ptr.resolve(def["ref"]);
  15193. if (obj) {
  15194. for (i=0; i<def["fields"].length; i++) { // i=Fields
  15195. if (obj.getChild(def['fields'][i]['id']) !== null)
  15196. throw Error("Duplicate extended field id in message "+obj.name+": "+def['fields'][i]['id']);
  15197. if (def['fields'][i]['id'] < obj.extensions[0] || def['fields'][i]['id'] > obj.extensions[1])
  15198. throw Error("Illegal extended field id in message "+obj.name+": "+def['fields'][i]['id']+" ("+obj.extensions.join(' to ')+" expected)");
  15199. // Convert extension field names to camel case notation if the override is set
  15200. var name = def["fields"][i]["name"];
  15201. if (this.options['convertFieldsToCamelCase'])
  15202. name = Reflect.Message.Field._toCamelCase(def["fields"][i]["name"]);
  15203. // see #161: Extensions use their fully qualified name as their runtime key and...
  15204. fld = new Reflect.Message.ExtensionField(this, obj, def["fields"][i]["rule"], def["fields"][i]["type"], this.ptr.fqn()+'.'+name, def["fields"][i]["id"], def["fields"][i]["options"]);
  15205. // ...are added on top of the current namespace as an extension which is used for
  15206. // resolving their type later on (the extension always keeps the original name to
  15207. // prevent naming collisions)
  15208. var ext = new Reflect.Extension(this, this.ptr, def["fields"][i]["name"], fld);
  15209. fld.extension = ext;
  15210. this.ptr.addChild(ext);
  15211. obj.addChild(fld);
  15212. }
  15213. } else if (!/\.?google\.protobuf\./.test(def["ref"])) // Silently skip internal extensions
  15214. throw Error("Extended message "+def["ref"]+" is not defined");
  15215. } else
  15216. throw Error("Not a valid definition: "+JSON.stringify(def));
  15217. def = null;
  15218. }
  15219. // Break goes here
  15220. } else
  15221. throw Error("Not a valid namespace: "+JSON.stringify(defs));
  15222. defs = null;
  15223. this.ptr = this.ptr.parent; // This namespace is s done
  15224. }
  15225. this.resolved = false; // Require re-resolve
  15226. this.result = null; // Require re-build
  15227. return this;
  15228. };
  15229. /**
  15230. * Imports another definition into this builder.
  15231. * @param {Object.<string,*>} json Parsed import
  15232. * @param {(string|{root: string, file: string})=} filename Imported file name
  15233. * @return {ProtoBuf.Builder} this
  15234. * @throws {Error} If the definition or file cannot be imported
  15235. * @expose
  15236. */
  15237. BuilderPrototype["import"] = function(json, filename) {
  15238. if (typeof filename === 'string') {
  15239. if (ProtoBuf.Util.IS_NODE)
  15240. filename = require("path")['resolve'](filename);
  15241. if (this.files[filename] === true) {
  15242. this.reset();
  15243. return this; // Skip duplicate imports
  15244. }
  15245. this.files[filename] = true;
  15246. }
  15247. if (!!json['imports'] && json['imports'].length > 0) {
  15248. var importRoot, delim = '/', resetRoot = false;
  15249. if (typeof filename === 'object') { // If an import root is specified, override
  15250. this.importRoot = filename["root"]; resetRoot = true; // ... and reset afterwards
  15251. importRoot = this.importRoot;
  15252. filename = filename["file"];
  15253. if (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0) delim = '\\';
  15254. } else if (typeof filename === 'string') {
  15255. if (this.importRoot) // If import root is overridden, use it
  15256. importRoot = this.importRoot;
  15257. else { // Otherwise compute from filename
  15258. if (filename.indexOf("/") >= 0) { // Unix
  15259. importRoot = filename.replace(/\/[^\/]*$/, "");
  15260. if (/* /file.proto */ importRoot === "")
  15261. importRoot = "/";
  15262. } else if (filename.indexOf("\\") >= 0) { // Windows
  15263. importRoot = filename.replace(/\\[^\\]*$/, "");
  15264. delim = '\\';
  15265. } else
  15266. importRoot = ".";
  15267. }
  15268. } else
  15269. importRoot = null;
  15270. for (var i=0; i<json['imports'].length; i++) {
  15271. if (typeof json['imports'][i] === 'string') { // Import file
  15272. if (!importRoot)
  15273. throw Error("Cannot determine import root: File name is unknown");
  15274. var importFilename = json['imports'][i];
  15275. if (/^google\/protobuf\//.test(importFilename))
  15276. continue; // Not needed and therefore not used
  15277. importFilename = importRoot+delim+importFilename;
  15278. if (this.files[importFilename] === true)
  15279. continue; // Already imported
  15280. if (/\.proto$/i.test(importFilename) && !ProtoBuf.DotProto) // If this is a NOPARSE build
  15281. importFilename = importFilename.replace(/\.proto$/, ".json"); // always load the JSON file
  15282. var contents = ProtoBuf.Util.fetch(importFilename);
  15283. if (contents === null)
  15284. throw Error("Failed to import '"+importFilename+"' in '"+filename+"': File not found");
  15285. if (/\.json$/i.test(importFilename)) // Always possible
  15286. this["import"](JSON.parse(contents+""), importFilename); // May throw
  15287. else
  15288. this["import"]((new ProtoBuf.DotProto.Parser(contents+"")).parse(), importFilename); // May throw
  15289. } else // Import structure
  15290. if (!filename)
  15291. this["import"](json['imports'][i]);
  15292. else if (/\.(\w+)$/.test(filename)) // With extension: Append _importN to the name portion to make it unique
  15293. this["import"](json['imports'][i], filename.replace(/^(.+)\.(\w+)$/, function($0, $1, $2) { return $1+"_import"+i+"."+$2; }));
  15294. else // Without extension: Append _importN to make it unique
  15295. this["import"](json['imports'][i], filename+"_import"+i);
  15296. }
  15297. if (resetRoot) // Reset import root override when all imports are done
  15298. this.importRoot = null;
  15299. }
  15300. if (json['messages']) {
  15301. if (json['package'])
  15302. this.define(json['package'], json["options"]);
  15303. this.create(json['messages']);
  15304. this.reset();
  15305. }
  15306. if (json['enums']) {
  15307. if (json['package'])
  15308. this.define(json['package'], json["options"]);
  15309. this.create(json['enums']);
  15310. this.reset();
  15311. }
  15312. if (json['services']) {
  15313. if (json['package'])
  15314. this.define(json['package'], json["options"]);
  15315. this.create(json['services']);
  15316. this.reset();
  15317. }
  15318. if (json['extends']) {
  15319. if (json['package'])
  15320. this.define(json['package'], json["options"]);
  15321. this.create(json['extends']);
  15322. this.reset();
  15323. }
  15324. return this;
  15325. };
  15326. /**
  15327. * Tests if a definition is a valid service definition.
  15328. * @param {Object} def Definition
  15329. * @return {boolean} true if valid, else false
  15330. * @expose
  15331. */
  15332. Builder.isValidService = function(def) {
  15333. // Services require a string name and an rpc object
  15334. return !(typeof def["name"] !== 'string' || !Lang.NAME.test(def["name"]) || typeof def["rpc"] !== 'object');
  15335. };
  15336. /**
  15337. * Tests if a definition is a valid extension.
  15338. * @param {Object} def Definition
  15339. * @returns {boolean} true if valid, else false
  15340. * @expose
  15341. */
  15342. Builder.isValidExtend = function(def) {
  15343. if (typeof def["ref"] !== 'string' || !Lang.TYPEREF.test(def["ref"]))
  15344. return false;
  15345. var i;
  15346. if (typeof def["fields"] !== 'undefined') {
  15347. if (!ProtoBuf.Util.isArray(def["fields"]))
  15348. return false;
  15349. var ids = [], id; // IDs must be unique (does not yet test for the extended message's ids)
  15350. for (i=0; i<def["fields"].length; i++) {
  15351. if (!Builder.isValidMessageField(def["fields"][i]))
  15352. return false;
  15353. id = parseInt(def["id"], 10);
  15354. if (ids.indexOf(id) >= 0)
  15355. return false;
  15356. ids.push(id);
  15357. }
  15358. ids = null;
  15359. }
  15360. return true;
  15361. };
  15362. /**
  15363. * Resolves all namespace objects.
  15364. * @throws {Error} If a type cannot be resolved
  15365. * @expose
  15366. */
  15367. BuilderPrototype.resolveAll = function() {
  15368. // Resolve all reflected objects
  15369. var res;
  15370. if (this.ptr == null || typeof this.ptr.type === 'object')
  15371. return; // Done (already resolved)
  15372. if (this.ptr instanceof Reflect.Namespace) {
  15373. // Build all children
  15374. var children = this.ptr.children;
  15375. for (var i= 0, k=children.length; i<k; ++i)
  15376. this.ptr = children[i],
  15377. this.resolveAll();
  15378. } else if (this.ptr instanceof Reflect.Message.Field) {
  15379. if (!Lang.TYPE.test(this.ptr.type)) { // Resolve type...
  15380. if (!Lang.TYPEREF.test(this.ptr.type))
  15381. throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);
  15382. res = (this.ptr instanceof Reflect.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, true);
  15383. if (!res)
  15384. throw Error("Unresolvable type reference in "+this.ptr.toString(true)+": "+this.ptr.type);
  15385. this.ptr.resolvedType = res;
  15386. if (res instanceof Reflect.Enum)
  15387. this.ptr.type = ProtoBuf.TYPES["enum"];
  15388. else if (res instanceof Reflect.Message)
  15389. this.ptr.type = res.isGroup ? ProtoBuf.TYPES["group"] : ProtoBuf.TYPES["message"];
  15390. else
  15391. throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);
  15392. } else
  15393. this.ptr.type = ProtoBuf.TYPES[this.ptr.type];
  15394. } else if (this.ptr instanceof ProtoBuf.Reflect.Enum.Value) {
  15395. // No need to build enum values (built in enum)
  15396. } else if (this.ptr instanceof ProtoBuf.Reflect.Service.Method) {
  15397. if (this.ptr instanceof ProtoBuf.Reflect.Service.RPCMethod) {
  15398. res = this.ptr.parent.resolve(this.ptr.requestName);
  15399. if (!res || !(res instanceof ProtoBuf.Reflect.Message))
  15400. throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.requestName);
  15401. this.ptr.resolvedRequestType = res;
  15402. res = this.ptr.parent.resolve(this.ptr.responseName);
  15403. if (!res || !(res instanceof ProtoBuf.Reflect.Message))
  15404. throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.responseName);
  15405. this.ptr.resolvedResponseType = res;
  15406. } else {
  15407. // Should not happen as nothing else is implemented
  15408. throw Error("Illegal service type in "+this.ptr.toString(true));
  15409. }
  15410. } else if (!(this.ptr instanceof ProtoBuf.Reflect.Message.OneOf) && !(this.ptr instanceof ProtoBuf.Reflect.Extension))
  15411. throw Error("Illegal object in namespace: "+typeof(this.ptr)+":"+this.ptr);
  15412. this.reset();
  15413. };
  15414. /**
  15415. * Builds the protocol. This will first try to resolve all definitions and, if this has been successful,
  15416. * return the built package.
  15417. * @param {string=} path Specifies what to return. If omitted, the entire namespace will be returned.
  15418. * @return {ProtoBuf.Builder.Message|Object.<string,*>}
  15419. * @throws {Error} If a type could not be resolved
  15420. * @expose
  15421. */
  15422. BuilderPrototype.build = function(path) {
  15423. this.reset();
  15424. if (!this.resolved)
  15425. this.resolveAll(),
  15426. this.resolved = true,
  15427. this.result = null; // Require re-build
  15428. if (this.result == null) // (Re-)Build
  15429. this.result = this.ns.build();
  15430. if (!path)
  15431. return this.result;
  15432. else {
  15433. var part = path.split(".");
  15434. var ptr = this.result; // Build namespace pointer (no hasChild etc.)
  15435. for (var i=0; i<part.length; i++)
  15436. if (ptr[part[i]])
  15437. ptr = ptr[part[i]];
  15438. else {
  15439. ptr = null;
  15440. break;
  15441. }
  15442. return ptr;
  15443. }
  15444. };
  15445. /**
  15446. * Similar to {@link ProtoBuf.Builder#build}, but looks up the internal reflection descriptor.
  15447. * @param {string=} path Specifies what to return. If omitted, the entire namespace wiil be returned.
  15448. * @return {ProtoBuf.Reflect.T} Reflection descriptor or `null` if not found
  15449. */
  15450. BuilderPrototype.lookup = function(path) {
  15451. return path ? this.ns.resolve(path) : this.ns;
  15452. };
  15453. /**
  15454. * Returns a string representation of this object.
  15455. * @return {string} String representation as of "Builder"
  15456. * @expose
  15457. */
  15458. BuilderPrototype.toString = function() {
  15459. return "Builder";
  15460. };
  15461. // Pseudo types documented in Reflect.js.
  15462. // Exist for the sole purpose of being able to "... instanceof ProtoBuf.Builder.Message" etc.
  15463. Builder.Message = function() {};
  15464. Builder.Service = function() {};
  15465. return Builder;
  15466. })(ProtoBuf, ProtoBuf.Lang, ProtoBuf.Reflect);
  15467. /**
  15468. * Loads a .proto string and returns the Builder.
  15469. * @param {string} proto .proto file contents
  15470. * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted.
  15471. * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.
  15472. * @return {ProtoBuf.Builder} Builder to create new messages
  15473. * @throws {Error} If the definition cannot be parsed or built
  15474. * @expose
  15475. */
  15476. ProtoBuf.loadProto = function(proto, builder, filename) {
  15477. if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string'))
  15478. filename = builder,
  15479. builder = undefined;
  15480. return ProtoBuf.loadJson((new ProtoBuf.DotProto.Parser(proto)).parse(), builder, filename);
  15481. };
  15482. /**
  15483. * Loads a .proto string and returns the Builder. This is an alias of {@link ProtoBuf.loadProto}.
  15484. * @function
  15485. * @param {string} proto .proto file contents
  15486. * @param {(ProtoBuf.Builder|string)=} builder Builder to append to. Will create a new one if omitted.
  15487. * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.
  15488. * @return {ProtoBuf.Builder} Builder to create new messages
  15489. * @throws {Error} If the definition cannot be parsed or built
  15490. * @expose
  15491. */
  15492. ProtoBuf.protoFromString = ProtoBuf.loadProto; // Legacy
  15493. /**
  15494. * Loads a .proto file and returns the Builder.
  15495. * @param {string|{root: string, file: string}} filename Path to proto file or an object specifying 'file' with
  15496. * an overridden 'root' path for all imported files.
  15497. * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and
  15498. * the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the
  15499. * file will be read synchronously and this function will return the Builder.
  15500. * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.
  15501. * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the
  15502. * request has failed), else undefined
  15503. * @expose
  15504. */
  15505. ProtoBuf.loadProtoFile = function(filename, callback, builder) {
  15506. if (callback && typeof callback === 'object')
  15507. builder = callback,
  15508. callback = null;
  15509. else if (!callback || typeof callback !== 'function')
  15510. callback = null;
  15511. if (callback)
  15512. return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) {
  15513. if (contents === null) {
  15514. callback(Error("Failed to fetch file"));
  15515. return;
  15516. }
  15517. try {
  15518. callback(null, ProtoBuf.loadProto(contents, builder, filename));
  15519. } catch (e) {
  15520. callback(e);
  15521. }
  15522. });
  15523. var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename);
  15524. return contents === null ? null : ProtoBuf.loadProto(contents, builder, filename);
  15525. };
  15526. /**
  15527. * Loads a .proto file and returns the Builder. This is an alias of {@link ProtoBuf.loadProtoFile}.
  15528. * @function
  15529. * @param {string|{root: string, file: string}} filename Path to proto file or an object specifying 'file' with
  15530. * an overridden 'root' path for all imported files.
  15531. * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and
  15532. * the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the
  15533. * file will be read synchronously and this function will return the Builder.
  15534. * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.
  15535. * @return {!ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the
  15536. * request has failed), else undefined
  15537. * @expose
  15538. */
  15539. ProtoBuf.protoFromFile = ProtoBuf.loadProtoFile; // Legacy
  15540. /**
  15541. * Constructs a new empty Builder.
  15542. * @param {Object.<string,*>=} options Builder options, defaults to global options set on ProtoBuf
  15543. * @return {!ProtoBuf.Builder} Builder
  15544. * @expose
  15545. */
  15546. ProtoBuf.newBuilder = function(options) {
  15547. options = options || {};
  15548. if (typeof options['convertFieldsToCamelCase'] === 'undefined')
  15549. options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase;
  15550. if (typeof options['populateAccessors'] === 'undefined')
  15551. options['populateAccessors'] = ProtoBuf.populateAccessors;
  15552. return new ProtoBuf.Builder(options);
  15553. };
  15554. /**
  15555. * Loads a .json definition and returns the Builder.
  15556. * @param {!*|string} json JSON definition
  15557. * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted.
  15558. * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.
  15559. * @return {ProtoBuf.Builder} Builder to create new messages
  15560. * @throws {Error} If the definition cannot be parsed or built
  15561. * @expose
  15562. */
  15563. ProtoBuf.loadJson = function(json, builder, filename) {
  15564. if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string'))
  15565. filename = builder,
  15566. builder = null;
  15567. if (!builder || typeof builder !== 'object')
  15568. builder = ProtoBuf.newBuilder();
  15569. if (typeof json === 'string')
  15570. json = JSON.parse(json);
  15571. builder["import"](json, filename);
  15572. builder.resolveAll();
  15573. builder.build();
  15574. return builder;
  15575. };
  15576. /**
  15577. * Loads a .json file and returns the Builder.
  15578. * @param {string|!{root: string, file: string}} filename Path to json file or an object specifying 'file' with
  15579. * an overridden 'root' path for all imported files.
  15580. * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and
  15581. * the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the
  15582. * file will be read synchronously and this function will return the Builder.
  15583. * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.
  15584. * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the
  15585. * request has failed), else undefined
  15586. * @expose
  15587. */
  15588. ProtoBuf.loadJsonFile = function(filename, callback, builder) {
  15589. if (callback && typeof callback === 'object')
  15590. builder = callback,
  15591. callback = null;
  15592. else if (!callback || typeof callback !== 'function')
  15593. callback = null;
  15594. if (callback)
  15595. return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) {
  15596. if (contents === null) {
  15597. callback(Error("Failed to fetch file"));
  15598. return;
  15599. }
  15600. try {
  15601. callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename));
  15602. } catch (e) {
  15603. callback(e);
  15604. }
  15605. });
  15606. var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename);
  15607. return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename);
  15608. };
  15609. return ProtoBuf;
  15610. }
  15611. /* CommonJS */ if (typeof require === 'function' && typeof module === 'object' && module && typeof exports === 'object' && exports)
  15612. module['exports'] = init(require("bytebuffer"));
  15613. /* AMD */ else if (typeof define === 'function' && define["amd"])
  15614. define(["ByteBuffer"], init);
  15615. /* Global */ else
  15616. (global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = init(global["dcodeIO"]["ByteBuffer"]);
  15617. })(this);
  15618. /*!
  15619. * mustache.js - Logic-less {{mustache}} templates with JavaScript
  15620. * http://github.com/janl/mustache.js
  15621. */
  15622. /*global define: false*/
  15623. (function (root, factory) {
  15624. if (typeof exports === "object" && exports) {
  15625. factory(exports); // CommonJS
  15626. } else {
  15627. var mustache = {};
  15628. factory(mustache);
  15629. if (typeof define === "function" && define.amd) {
  15630. define(mustache); // AMD
  15631. } else {
  15632. root.Mustache = mustache; // <script>
  15633. }
  15634. }
  15635. }(this, function (mustache) {
  15636. // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577
  15637. // See https://github.com/janl/mustache.js/issues/189
  15638. var RegExp_test = RegExp.prototype.test;
  15639. function testRegExp(re, string) {
  15640. return RegExp_test.call(re, string);
  15641. }
  15642. var nonSpaceRe = /\S/;
  15643. function isWhitespace(string) {
  15644. return !testRegExp(nonSpaceRe, string);
  15645. }
  15646. var Object_toString = Object.prototype.toString;
  15647. var isArray = Array.isArray || function (object) {
  15648. return Object_toString.call(object) === '[object Array]';
  15649. };
  15650. function isFunction(object) {
  15651. return typeof object === 'function';
  15652. }
  15653. function escapeRegExp(string) {
  15654. return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
  15655. }
  15656. var entityMap = {
  15657. "&": "&amp;",
  15658. "<": "&lt;",
  15659. ">": "&gt;",
  15660. '"': '&quot;',
  15661. "'": '&#39;',
  15662. "/": '&#x2F;'
  15663. };
  15664. function escapeHtml(string) {
  15665. return String(string).replace(/[&<>"'\/]/g, function (s) {
  15666. return entityMap[s];
  15667. });
  15668. }
  15669. function escapeTags(tags) {
  15670. if (!isArray(tags) || tags.length !== 2) {
  15671. throw new Error('Invalid tags: ' + tags);
  15672. }
  15673. return [
  15674. new RegExp(escapeRegExp(tags[0]) + "\\s*"),
  15675. new RegExp("\\s*" + escapeRegExp(tags[1]))
  15676. ];
  15677. }
  15678. var whiteRe = /\s*/;
  15679. var spaceRe = /\s+/;
  15680. var equalsRe = /\s*=/;
  15681. var curlyRe = /\s*\}/;
  15682. var tagRe = /#|\^|\/|>|\{|&|=|!/;
  15683. /**
  15684. * Breaks up the given `template` string into a tree of tokens. If the `tags`
  15685. * argument is given here it must be an array with two string values: the
  15686. * opening and closing tags used in the template (e.g. [ "<%", "%>" ]). Of
  15687. * course, the default is to use mustaches (i.e. mustache.tags).
  15688. *
  15689. * A token is an array with at least 4 elements. The first element is the
  15690. * mustache symbol that was used inside the tag, e.g. "#" or "&". If the tag
  15691. * did not contain a symbol (i.e. {{myValue}}) this element is "name". For
  15692. * all text that appears outside a symbol this element is "text".
  15693. *
  15694. * The second element of a token is its "value". For mustache tags this is
  15695. * whatever else was inside the tag besides the opening symbol. For text tokens
  15696. * this is the text itself.
  15697. *
  15698. * The third and fourth elements of the token are the start and end indices,
  15699. * respectively, of the token in the original template.
  15700. *
  15701. * Tokens that are the root node of a subtree contain two more elements: 1) an
  15702. * array of tokens in the subtree and 2) the index in the original template at
  15703. * which the closing tag for that section begins.
  15704. */
  15705. function parseTemplate(template, tags) {
  15706. tags = tags || mustache.tags;
  15707. template = template || '';
  15708. if (typeof tags === 'string') {
  15709. tags = tags.split(spaceRe);
  15710. }
  15711. var tagRes = escapeTags(tags);
  15712. var scanner = new Scanner(template);
  15713. var sections = []; // Stack to hold section tokens
  15714. var tokens = []; // Buffer to hold the tokens
  15715. var spaces = []; // Indices of whitespace tokens on the current line
  15716. var hasTag = false; // Is there a {{tag}} on the current line?
  15717. var nonSpace = false; // Is there a non-space char on the current line?
  15718. // Strips all whitespace tokens array for the current line
  15719. // if there was a {{#tag}} on it and otherwise only space.
  15720. function stripSpace() {
  15721. if (hasTag && !nonSpace) {
  15722. while (spaces.length) {
  15723. delete tokens[spaces.pop()];
  15724. }
  15725. } else {
  15726. spaces = [];
  15727. }
  15728. hasTag = false;
  15729. nonSpace = false;
  15730. }
  15731. var start, type, value, chr, token, openSection;
  15732. while (!scanner.eos()) {
  15733. start = scanner.pos;
  15734. // Match any text between tags.
  15735. value = scanner.scanUntil(tagRes[0]);
  15736. if (value) {
  15737. for (var i = 0, len = value.length; i < len; ++i) {
  15738. chr = value.charAt(i);
  15739. if (isWhitespace(chr)) {
  15740. spaces.push(tokens.length);
  15741. } else {
  15742. nonSpace = true;
  15743. }
  15744. tokens.push(['text', chr, start, start + 1]);
  15745. start += 1;
  15746. // Check for whitespace on the current line.
  15747. if (chr === '\n') {
  15748. stripSpace();
  15749. }
  15750. }
  15751. }
  15752. // Match the opening tag.
  15753. if (!scanner.scan(tagRes[0])) break;
  15754. hasTag = true;
  15755. // Get the tag type.
  15756. type = scanner.scan(tagRe) || 'name';
  15757. scanner.scan(whiteRe);
  15758. // Get the tag value.
  15759. if (type === '=') {
  15760. value = scanner.scanUntil(equalsRe);
  15761. scanner.scan(equalsRe);
  15762. scanner.scanUntil(tagRes[1]);
  15763. } else if (type === '{') {
  15764. value = scanner.scanUntil(new RegExp('\\s*' + escapeRegExp('}' + tags[1])));
  15765. scanner.scan(curlyRe);
  15766. scanner.scanUntil(tagRes[1]);
  15767. type = '&';
  15768. } else {
  15769. value = scanner.scanUntil(tagRes[1]);
  15770. }
  15771. // Match the closing tag.
  15772. if (!scanner.scan(tagRes[1])) {
  15773. throw new Error('Unclosed tag at ' + scanner.pos);
  15774. }
  15775. token = [ type, value, start, scanner.pos ];
  15776. tokens.push(token);
  15777. if (type === '#' || type === '^') {
  15778. sections.push(token);
  15779. } else if (type === '/') {
  15780. // Check section nesting.
  15781. openSection = sections.pop();
  15782. if (!openSection) {
  15783. throw new Error('Unopened section "' + value + '" at ' + start);
  15784. }
  15785. if (openSection[1] !== value) {
  15786. throw new Error('Unclosed section "' + openSection[1] + '" at ' + start);
  15787. }
  15788. } else if (type === 'name' || type === '{' || type === '&') {
  15789. nonSpace = true;
  15790. } else if (type === '=') {
  15791. // Set the tags for the next time around.
  15792. tagRes = escapeTags(tags = value.split(spaceRe));
  15793. }
  15794. }
  15795. // Make sure there are no open sections when we're done.
  15796. openSection = sections.pop();
  15797. if (openSection) {
  15798. throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos);
  15799. }
  15800. return nestTokens(squashTokens(tokens));
  15801. }
  15802. /**
  15803. * Combines the values of consecutive text tokens in the given `tokens` array
  15804. * to a single token.
  15805. */
  15806. function squashTokens(tokens) {
  15807. var squashedTokens = [];
  15808. var token, lastToken;
  15809. for (var i = 0, len = tokens.length; i < len; ++i) {
  15810. token = tokens[i];
  15811. if (token) {
  15812. if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {
  15813. lastToken[1] += token[1];
  15814. lastToken[3] = token[3];
  15815. } else {
  15816. squashedTokens.push(token);
  15817. lastToken = token;
  15818. }
  15819. }
  15820. }
  15821. return squashedTokens;
  15822. }
  15823. /**
  15824. * Forms the given array of `tokens` into a nested tree structure where
  15825. * tokens that represent a section have two additional items: 1) an array of
  15826. * all tokens that appear in that section and 2) the index in the original
  15827. * template that represents the end of that section.
  15828. */
  15829. function nestTokens(tokens) {
  15830. var nestedTokens = [];
  15831. var collector = nestedTokens;
  15832. var sections = [];
  15833. var token, section;
  15834. for (var i = 0, len = tokens.length; i < len; ++i) {
  15835. token = tokens[i];
  15836. switch (token[0]) {
  15837. case '#':
  15838. case '^':
  15839. collector.push(token);
  15840. sections.push(token);
  15841. collector = token[4] = [];
  15842. break;
  15843. case '/':
  15844. section = sections.pop();
  15845. section[5] = token[2];
  15846. collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;
  15847. break;
  15848. default:
  15849. collector.push(token);
  15850. }
  15851. }
  15852. return nestedTokens;
  15853. }
  15854. /**
  15855. * A simple string scanner that is used by the template parser to find
  15856. * tokens in template strings.
  15857. */
  15858. function Scanner(string) {
  15859. this.string = string;
  15860. this.tail = string;
  15861. this.pos = 0;
  15862. }
  15863. /**
  15864. * Returns `true` if the tail is empty (end of string).
  15865. */
  15866. Scanner.prototype.eos = function () {
  15867. return this.tail === "";
  15868. };
  15869. /**
  15870. * Tries to match the given regular expression at the current position.
  15871. * Returns the matched text if it can match, the empty string otherwise.
  15872. */
  15873. Scanner.prototype.scan = function (re) {
  15874. var match = this.tail.match(re);
  15875. if (match && match.index === 0) {
  15876. var string = match[0];
  15877. this.tail = this.tail.substring(string.length);
  15878. this.pos += string.length;
  15879. return string;
  15880. }
  15881. return "";
  15882. };
  15883. /**
  15884. * Skips all text until the given regular expression can be matched. Returns
  15885. * the skipped string, which is the entire tail if no match can be made.
  15886. */
  15887. Scanner.prototype.scanUntil = function (re) {
  15888. var index = this.tail.search(re), match;
  15889. switch (index) {
  15890. case -1:
  15891. match = this.tail;
  15892. this.tail = "";
  15893. break;
  15894. case 0:
  15895. match = "";
  15896. break;
  15897. default:
  15898. match = this.tail.substring(0, index);
  15899. this.tail = this.tail.substring(index);
  15900. }
  15901. this.pos += match.length;
  15902. return match;
  15903. };
  15904. /**
  15905. * Represents a rendering context by wrapping a view object and
  15906. * maintaining a reference to the parent context.
  15907. */
  15908. function Context(view, parentContext) {
  15909. this.view = view == null ? {} : view;
  15910. this.cache = { '.': this.view };
  15911. this.parent = parentContext;
  15912. }
  15913. /**
  15914. * Creates a new context using the given view with this context
  15915. * as the parent.
  15916. */
  15917. Context.prototype.push = function (view) {
  15918. return new Context(view, this);
  15919. };
  15920. /**
  15921. * Returns the value of the given name in this context, traversing
  15922. * up the context hierarchy if the value is absent in this context's view.
  15923. */
  15924. Context.prototype.lookup = function (name) {
  15925. var value;
  15926. if (name in this.cache) {
  15927. value = this.cache[name];
  15928. } else {
  15929. var context = this;
  15930. while (context) {
  15931. if (name.indexOf('.') > 0) {
  15932. value = context.view;
  15933. var names = name.split('.'), i = 0;
  15934. while (value != null && i < names.length) {
  15935. value = value[names[i++]];
  15936. }
  15937. } else {
  15938. value = context.view[name];
  15939. }
  15940. if (value != null) break;
  15941. context = context.parent;
  15942. }
  15943. this.cache[name] = value;
  15944. }
  15945. if (isFunction(value)) {
  15946. value = value.call(this.view);
  15947. }
  15948. return value;
  15949. };
  15950. /**
  15951. * A Writer knows how to take a stream of tokens and render them to a
  15952. * string, given a context. It also maintains a cache of templates to
  15953. * avoid the need to parse the same template twice.
  15954. */
  15955. function Writer() {
  15956. this.cache = {};
  15957. }
  15958. /**
  15959. * Clears all cached templates in this writer.
  15960. */
  15961. Writer.prototype.clearCache = function () {
  15962. this.cache = {};
  15963. };
  15964. /**
  15965. * Parses and caches the given `template` and returns the array of tokens
  15966. * that is generated from the parse.
  15967. */
  15968. Writer.prototype.parse = function (template, tags) {
  15969. var cache = this.cache;
  15970. var tokens = cache[template];
  15971. if (tokens == null) {
  15972. tokens = cache[template] = parseTemplate(template, tags);
  15973. }
  15974. return tokens;
  15975. };
  15976. /**
  15977. * High-level method that is used to render the given `template` with
  15978. * the given `view`.
  15979. *
  15980. * The optional `partials` argument may be an object that contains the
  15981. * names and templates of partials that are used in the template. It may
  15982. * also be a function that is used to load partial templates on the fly
  15983. * that takes a single argument: the name of the partial.
  15984. */
  15985. Writer.prototype.render = function (template, view, partials) {
  15986. var tokens = this.parse(template);
  15987. var context = (view instanceof Context) ? view : new Context(view);
  15988. return this.renderTokens(tokens, context, partials, template);
  15989. };
  15990. /**
  15991. * Low-level method that renders the given array of `tokens` using
  15992. * the given `context` and `partials`.
  15993. *
  15994. * Note: The `originalTemplate` is only ever used to extract the portion
  15995. * of the original template that was contained in a higher-order section.
  15996. * If the template doesn't use higher-order sections, this argument may
  15997. * be omitted.
  15998. */
  15999. Writer.prototype.renderTokens = function (tokens, context, partials, originalTemplate) {
  16000. var buffer = '';
  16001. // This function is used to render an arbitrary template
  16002. // in the current context by higher-order sections.
  16003. var self = this;
  16004. function subRender(template) {
  16005. return self.render(template, context, partials);
  16006. }
  16007. var token, value;
  16008. for (var i = 0, len = tokens.length; i < len; ++i) {
  16009. token = tokens[i];
  16010. switch (token[0]) {
  16011. case '#':
  16012. value = context.lookup(token[1]);
  16013. if (!value) continue;
  16014. if (isArray(value)) {
  16015. for (var j = 0, jlen = value.length; j < jlen; ++j) {
  16016. buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate);
  16017. }
  16018. } else if (typeof value === 'object' || typeof value === 'string') {
  16019. buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate);
  16020. } else if (isFunction(value)) {
  16021. if (typeof originalTemplate !== 'string') {
  16022. throw new Error('Cannot use higher-order sections without the original template');
  16023. }
  16024. // Extract the portion of the original template that the section contains.
  16025. value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);
  16026. if (value != null) buffer += value;
  16027. } else {
  16028. buffer += this.renderTokens(token[4], context, partials, originalTemplate);
  16029. }
  16030. break;
  16031. case '^':
  16032. value = context.lookup(token[1]);
  16033. // Use JavaScript's definition of falsy. Include empty arrays.
  16034. // See https://github.com/janl/mustache.js/issues/186
  16035. if (!value || (isArray(value) && value.length === 0)) {
  16036. buffer += this.renderTokens(token[4], context, partials, originalTemplate);
  16037. }
  16038. break;
  16039. case '>':
  16040. if (!partials) continue;
  16041. value = isFunction(partials) ? partials(token[1]) : partials[token[1]];
  16042. if (value != null) buffer += this.renderTokens(this.parse(value), context, partials, value);
  16043. break;
  16044. case '&':
  16045. value = context.lookup(token[1]);
  16046. if (value != null) buffer += value;
  16047. break;
  16048. case 'name':
  16049. value = context.lookup(token[1]);
  16050. if (value != null) buffer += mustache.escape(value);
  16051. break;
  16052. case 'text':
  16053. buffer += token[1];
  16054. break;
  16055. }
  16056. }
  16057. return buffer;
  16058. };
  16059. mustache.name = "mustache.js";
  16060. mustache.version = "0.8.1";
  16061. mustache.tags = [ "{{", "}}" ];
  16062. // All high-level mustache.* functions use this writer.
  16063. var defaultWriter = new Writer();
  16064. /**
  16065. * Clears all cached templates in the default writer.
  16066. */
  16067. mustache.clearCache = function () {
  16068. return defaultWriter.clearCache();
  16069. };
  16070. /**
  16071. * Parses and caches the given template in the default writer and returns the
  16072. * array of tokens it contains. Doing this ahead of time avoids the need to
  16073. * parse templates on the fly as they are rendered.
  16074. */
  16075. mustache.parse = function (template, tags) {
  16076. return defaultWriter.parse(template, tags);
  16077. };
  16078. /**
  16079. * Renders the `template` with the given `view` and `partials` using the
  16080. * default writer.
  16081. */
  16082. mustache.render = function (template, view, partials) {
  16083. return defaultWriter.render(template, view, partials);
  16084. };
  16085. // This is here for backwards compatibility with 0.4.x.
  16086. mustache.to_html = function (template, view, partials, send) {
  16087. var result = mustache.render(template, view, partials);
  16088. if (isFunction(send)) {
  16089. send(result);
  16090. } else {
  16091. return result;
  16092. }
  16093. };
  16094. // Export the escaping function so that the user may override it.
  16095. // See https://github.com/janl/mustache.js/issues/244
  16096. mustache.escape = escapeHtml;
  16097. // Export these mainly for testing, but also for advanced usage.
  16098. mustache.Scanner = Scanner;
  16099. mustache.Context = Context;
  16100. mustache.Writer = Writer;
  16101. }));
  16102. // Underscore.js 1.7.0
  16103. // http://underscorejs.org
  16104. // (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  16105. // Underscore may be freely distributed under the MIT license.
  16106. (function() {
  16107. // Baseline setup
  16108. // --------------
  16109. // Establish the root object, `window` in the browser, or `exports` on the server.
  16110. var root = this;
  16111. // Save the previous value of the `_` variable.
  16112. var previousUnderscore = root._;
  16113. // Save bytes in the minified (but not gzipped) version:
  16114. var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
  16115. // Create quick reference variables for speed access to core prototypes.
  16116. var
  16117. push = ArrayProto.push,
  16118. slice = ArrayProto.slice,
  16119. concat = ArrayProto.concat,
  16120. toString = ObjProto.toString,
  16121. hasOwnProperty = ObjProto.hasOwnProperty;
  16122. // All **ECMAScript 5** native function implementations that we hope to use
  16123. // are declared here.
  16124. var
  16125. nativeIsArray = Array.isArray,
  16126. nativeKeys = Object.keys,
  16127. nativeBind = FuncProto.bind;
  16128. // Create a safe reference to the Underscore object for use below.
  16129. var _ = function(obj) {
  16130. if (obj instanceof _) return obj;
  16131. if (!(this instanceof _)) return new _(obj);
  16132. this._wrapped = obj;
  16133. };
  16134. // Export the Underscore object for **Node.js**, with
  16135. // backwards-compatibility for the old `require()` API. If we're in
  16136. // the browser, add `_` as a global object.
  16137. if (typeof exports !== 'undefined') {
  16138. if (typeof module !== 'undefined' && module.exports) {
  16139. exports = module.exports = _;
  16140. }
  16141. exports._ = _;
  16142. } else {
  16143. root._ = _;
  16144. }
  16145. // Current version.
  16146. _.VERSION = '1.7.0';
  16147. // Internal function that returns an efficient (for current engines) version
  16148. // of the passed-in callback, to be repeatedly applied in other Underscore
  16149. // functions.
  16150. var createCallback = function(func, context, argCount) {
  16151. if (context === void 0) return func;
  16152. switch (argCount == null ? 3 : argCount) {
  16153. case 1: return function(value) {
  16154. return func.call(context, value);
  16155. };
  16156. case 2: return function(value, other) {
  16157. return func.call(context, value, other);
  16158. };
  16159. case 3: return function(value, index, collection) {
  16160. return func.call(context, value, index, collection);
  16161. };
  16162. case 4: return function(accumulator, value, index, collection) {
  16163. return func.call(context, accumulator, value, index, collection);
  16164. };
  16165. }
  16166. return function() {
  16167. return func.apply(context, arguments);
  16168. };
  16169. };
  16170. // A mostly-internal function to generate callbacks that can be applied
  16171. // to each element in a collection, returning the desired result — either
  16172. // identity, an arbitrary callback, a property matcher, or a property accessor.
  16173. _.iteratee = function(value, context, argCount) {
  16174. if (value == null) return _.identity;
  16175. if (_.isFunction(value)) return createCallback(value, context, argCount);
  16176. if (_.isObject(value)) return _.matches(value);
  16177. return _.property(value);
  16178. };
  16179. // Collection Functions
  16180. // --------------------
  16181. // The cornerstone, an `each` implementation, aka `forEach`.
  16182. // Handles raw objects in addition to array-likes. Treats all
  16183. // sparse array-likes as if they were dense.
  16184. _.each = _.forEach = function(obj, iteratee, context) {
  16185. if (obj == null) return obj;
  16186. iteratee = createCallback(iteratee, context);
  16187. var i, length = obj.length;
  16188. if (length === +length) {
  16189. for (i = 0; i < length; i++) {
  16190. iteratee(obj[i], i, obj);
  16191. }
  16192. } else {
  16193. var keys = _.keys(obj);
  16194. for (i = 0, length = keys.length; i < length; i++) {
  16195. iteratee(obj[keys[i]], keys[i], obj);
  16196. }
  16197. }
  16198. return obj;
  16199. };
  16200. // Return the results of applying the iteratee to each element.
  16201. _.map = _.collect = function(obj, iteratee, context) {
  16202. if (obj == null) return [];
  16203. iteratee = _.iteratee(iteratee, context);
  16204. var keys = obj.length !== +obj.length && _.keys(obj),
  16205. length = (keys || obj).length,
  16206. results = Array(length),
  16207. currentKey;
  16208. for (var index = 0; index < length; index++) {
  16209. currentKey = keys ? keys[index] : index;
  16210. results[index] = iteratee(obj[currentKey], currentKey, obj);
  16211. }
  16212. return results;
  16213. };
  16214. var reduceError = 'Reduce of empty array with no initial value';
  16215. // **Reduce** builds up a single result from a list of values, aka `inject`,
  16216. // or `foldl`.
  16217. _.reduce = _.foldl = _.inject = function(obj, iteratee, memo, context) {
  16218. if (obj == null) obj = [];
  16219. iteratee = createCallback(iteratee, context, 4);
  16220. var keys = obj.length !== +obj.length && _.keys(obj),
  16221. length = (keys || obj).length,
  16222. index = 0, currentKey;
  16223. if (arguments.length < 3) {
  16224. if (!length) throw new TypeError(reduceError);
  16225. memo = obj[keys ? keys[index++] : index++];
  16226. }
  16227. for (; index < length; index++) {
  16228. currentKey = keys ? keys[index] : index;
  16229. memo = iteratee(memo, obj[currentKey], currentKey, obj);
  16230. }
  16231. return memo;
  16232. };
  16233. // The right-associative version of reduce, also known as `foldr`.
  16234. _.reduceRight = _.foldr = function(obj, iteratee, memo, context) {
  16235. if (obj == null) obj = [];
  16236. iteratee = createCallback(iteratee, context, 4);
  16237. var keys = obj.length !== + obj.length && _.keys(obj),
  16238. index = (keys || obj).length,
  16239. currentKey;
  16240. if (arguments.length < 3) {
  16241. if (!index) throw new TypeError(reduceError);
  16242. memo = obj[keys ? keys[--index] : --index];
  16243. }
  16244. while (index--) {
  16245. currentKey = keys ? keys[index] : index;
  16246. memo = iteratee(memo, obj[currentKey], currentKey, obj);
  16247. }
  16248. return memo;
  16249. };
  16250. // Return the first value which passes a truth test. Aliased as `detect`.
  16251. _.find = _.detect = function(obj, predicate, context) {
  16252. var result;
  16253. predicate = _.iteratee(predicate, context);
  16254. _.some(obj, function(value, index, list) {
  16255. if (predicate(value, index, list)) {
  16256. result = value;
  16257. return true;
  16258. }
  16259. });
  16260. return result;
  16261. };
  16262. // Return all the elements that pass a truth test.
  16263. // Aliased as `select`.
  16264. _.filter = _.select = function(obj, predicate, context) {
  16265. var results = [];
  16266. if (obj == null) return results;
  16267. predicate = _.iteratee(predicate, context);
  16268. _.each(obj, function(value, index, list) {
  16269. if (predicate(value, index, list)) results.push(value);
  16270. });
  16271. return results;
  16272. };
  16273. // Return all the elements for which a truth test fails.
  16274. _.reject = function(obj, predicate, context) {
  16275. return _.filter(obj, _.negate(_.iteratee(predicate)), context);
  16276. };
  16277. // Determine whether all of the elements match a truth test.
  16278. // Aliased as `all`.
  16279. _.every = _.all = function(obj, predicate, context) {
  16280. if (obj == null) return true;
  16281. predicate = _.iteratee(predicate, context);
  16282. var keys = obj.length !== +obj.length && _.keys(obj),
  16283. length = (keys || obj).length,
  16284. index, currentKey;
  16285. for (index = 0; index < length; index++) {
  16286. currentKey = keys ? keys[index] : index;
  16287. if (!predicate(obj[currentKey], currentKey, obj)) return false;
  16288. }
  16289. return true;
  16290. };
  16291. // Determine if at least one element in the object matches a truth test.
  16292. // Aliased as `any`.
  16293. _.some = _.any = function(obj, predicate, context) {
  16294. if (obj == null) return false;
  16295. predicate = _.iteratee(predicate, context);
  16296. var keys = obj.length !== +obj.length && _.keys(obj),
  16297. length = (keys || obj).length,
  16298. index, currentKey;
  16299. for (index = 0; index < length; index++) {
  16300. currentKey = keys ? keys[index] : index;
  16301. if (predicate(obj[currentKey], currentKey, obj)) return true;
  16302. }
  16303. return false;
  16304. };
  16305. // Determine if the array or object contains a given value (using `===`).
  16306. // Aliased as `include`.
  16307. _.contains = _.include = function(obj, target) {
  16308. if (obj == null) return false;
  16309. if (obj.length !== +obj.length) obj = _.values(obj);
  16310. return _.indexOf(obj, target) >= 0;
  16311. };
  16312. // Invoke a method (with arguments) on every item in a collection.
  16313. _.invoke = function(obj, method) {
  16314. var args = slice.call(arguments, 2);
  16315. var isFunc = _.isFunction(method);
  16316. return _.map(obj, function(value) {
  16317. return (isFunc ? method : value[method]).apply(value, args);
  16318. });
  16319. };
  16320. // Convenience version of a common use case of `map`: fetching a property.
  16321. _.pluck = function(obj, key) {
  16322. return _.map(obj, _.property(key));
  16323. };
  16324. // Convenience version of a common use case of `filter`: selecting only objects
  16325. // containing specific `key:value` pairs.
  16326. _.where = function(obj, attrs) {
  16327. return _.filter(obj, _.matches(attrs));
  16328. };
  16329. // Convenience version of a common use case of `find`: getting the first object
  16330. // containing specific `key:value` pairs.
  16331. _.findWhere = function(obj, attrs) {
  16332. return _.find(obj, _.matches(attrs));
  16333. };
  16334. // Return the maximum element (or element-based computation).
  16335. _.max = function(obj, iteratee, context) {
  16336. var result = -Infinity, lastComputed = -Infinity,
  16337. value, computed;
  16338. if (iteratee == null && obj != null) {
  16339. obj = obj.length === +obj.length ? obj : _.values(obj);
  16340. for (var i = 0, length = obj.length; i < length; i++) {
  16341. value = obj[i];
  16342. if (value > result) {
  16343. result = value;
  16344. }
  16345. }
  16346. } else {
  16347. iteratee = _.iteratee(iteratee, context);
  16348. _.each(obj, function(value, index, list) {
  16349. computed = iteratee(value, index, list);
  16350. if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
  16351. result = value;
  16352. lastComputed = computed;
  16353. }
  16354. });
  16355. }
  16356. return result;
  16357. };
  16358. // Return the minimum element (or element-based computation).
  16359. _.min = function(obj, iteratee, context) {
  16360. var result = Infinity, lastComputed = Infinity,
  16361. value, computed;
  16362. if (iteratee == null && obj != null) {
  16363. obj = obj.length === +obj.length ? obj : _.values(obj);
  16364. for (var i = 0, length = obj.length; i < length; i++) {
  16365. value = obj[i];
  16366. if (value < result) {
  16367. result = value;
  16368. }
  16369. }
  16370. } else {
  16371. iteratee = _.iteratee(iteratee, context);
  16372. _.each(obj, function(value, index, list) {
  16373. computed = iteratee(value, index, list);
  16374. if (computed < lastComputed || computed === Infinity && result === Infinity) {
  16375. result = value;
  16376. lastComputed = computed;
  16377. }
  16378. });
  16379. }
  16380. return result;
  16381. };
  16382. // Shuffle a collection, using the modern version of the
  16383. // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
  16384. _.shuffle = function(obj) {
  16385. var set = obj && obj.length === +obj.length ? obj : _.values(obj);
  16386. var length = set.length;
  16387. var shuffled = Array(length);
  16388. for (var index = 0, rand; index < length; index++) {
  16389. rand = _.random(0, index);
  16390. if (rand !== index) shuffled[index] = shuffled[rand];
  16391. shuffled[rand] = set[index];
  16392. }
  16393. return shuffled;
  16394. };
  16395. // Sample **n** random values from a collection.
  16396. // If **n** is not specified, returns a single random element.
  16397. // The internal `guard` argument allows it to work with `map`.
  16398. _.sample = function(obj, n, guard) {
  16399. if (n == null || guard) {
  16400. if (obj.length !== +obj.length) obj = _.values(obj);
  16401. return obj[_.random(obj.length - 1)];
  16402. }
  16403. return _.shuffle(obj).slice(0, Math.max(0, n));
  16404. };
  16405. // Sort the object's values by a criterion produced by an iteratee.
  16406. _.sortBy = function(obj, iteratee, context) {
  16407. iteratee = _.iteratee(iteratee, context);
  16408. return _.pluck(_.map(obj, function(value, index, list) {
  16409. return {
  16410. value: value,
  16411. index: index,
  16412. criteria: iteratee(value, index, list)
  16413. };
  16414. }).sort(function(left, right) {
  16415. var a = left.criteria;
  16416. var b = right.criteria;
  16417. if (a !== b) {
  16418. if (a > b || a === void 0) return 1;
  16419. if (a < b || b === void 0) return -1;
  16420. }
  16421. return left.index - right.index;
  16422. }), 'value');
  16423. };
  16424. // An internal function used for aggregate "group by" operations.
  16425. var group = function(behavior) {
  16426. return function(obj, iteratee, context) {
  16427. var result = {};
  16428. iteratee = _.iteratee(iteratee, context);
  16429. _.each(obj, function(value, index) {
  16430. var key = iteratee(value, index, obj);
  16431. behavior(result, value, key);
  16432. });
  16433. return result;
  16434. };
  16435. };
  16436. // Groups the object's values by a criterion. Pass either a string attribute
  16437. // to group by, or a function that returns the criterion.
  16438. _.groupBy = group(function(result, value, key) {
  16439. if (_.has(result, key)) result[key].push(value); else result[key] = [value];
  16440. });
  16441. // Indexes the object's values by a criterion, similar to `groupBy`, but for
  16442. // when you know that your index values will be unique.
  16443. _.indexBy = group(function(result, value, key) {
  16444. result[key] = value;
  16445. });
  16446. // Counts instances of an object that group by a certain criterion. Pass
  16447. // either a string attribute to count by, or a function that returns the
  16448. // criterion.
  16449. _.countBy = group(function(result, value, key) {
  16450. if (_.has(result, key)) result[key]++; else result[key] = 1;
  16451. });
  16452. // Use a comparator function to figure out the smallest index at which
  16453. // an object should be inserted so as to maintain order. Uses binary search.
  16454. _.sortedIndex = function(array, obj, iteratee, context) {
  16455. iteratee = _.iteratee(iteratee, context, 1);
  16456. var value = iteratee(obj);
  16457. var low = 0, high = array.length;
  16458. while (low < high) {
  16459. var mid = low + high >>> 1;
  16460. if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
  16461. }
  16462. return low;
  16463. };
  16464. // Safely create a real, live array from anything iterable.
  16465. _.toArray = function(obj) {
  16466. if (!obj) return [];
  16467. if (_.isArray(obj)) return slice.call(obj);
  16468. if (obj.length === +obj.length) return _.map(obj, _.identity);
  16469. return _.values(obj);
  16470. };
  16471. // Return the number of elements in an object.
  16472. _.size = function(obj) {
  16473. if (obj == null) return 0;
  16474. return obj.length === +obj.length ? obj.length : _.keys(obj).length;
  16475. };
  16476. // Split a collection into two arrays: one whose elements all satisfy the given
  16477. // predicate, and one whose elements all do not satisfy the predicate.
  16478. _.partition = function(obj, predicate, context) {
  16479. predicate = _.iteratee(predicate, context);
  16480. var pass = [], fail = [];
  16481. _.each(obj, function(value, key, obj) {
  16482. (predicate(value, key, obj) ? pass : fail).push(value);
  16483. });
  16484. return [pass, fail];
  16485. };
  16486. // Array Functions
  16487. // ---------------
  16488. // Get the first element of an array. Passing **n** will return the first N
  16489. // values in the array. Aliased as `head` and `take`. The **guard** check
  16490. // allows it to work with `_.map`.
  16491. _.first = _.head = _.take = function(array, n, guard) {
  16492. if (array == null) return void 0;
  16493. if (n == null || guard) return array[0];
  16494. if (n < 0) return [];
  16495. return slice.call(array, 0, n);
  16496. };
  16497. // Returns everything but the last entry of the array. Especially useful on
  16498. // the arguments object. Passing **n** will return all the values in
  16499. // the array, excluding the last N. The **guard** check allows it to work with
  16500. // `_.map`.
  16501. _.initial = function(array, n, guard) {
  16502. return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
  16503. };
  16504. // Get the last element of an array. Passing **n** will return the last N
  16505. // values in the array. The **guard** check allows it to work with `_.map`.
  16506. _.last = function(array, n, guard) {
  16507. if (array == null) return void 0;
  16508. if (n == null || guard) return array[array.length - 1];
  16509. return slice.call(array, Math.max(array.length - n, 0));
  16510. };
  16511. // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
  16512. // Especially useful on the arguments object. Passing an **n** will return
  16513. // the rest N values in the array. The **guard**
  16514. // check allows it to work with `_.map`.
  16515. _.rest = _.tail = _.drop = function(array, n, guard) {
  16516. return slice.call(array, n == null || guard ? 1 : n);
  16517. };
  16518. // Trim out all falsy values from an array.
  16519. _.compact = function(array) {
  16520. return _.filter(array, _.identity);
  16521. };
  16522. // Internal implementation of a recursive `flatten` function.
  16523. var flatten = function(input, shallow, strict, output) {
  16524. if (shallow && _.every(input, _.isArray)) {
  16525. return concat.apply(output, input);
  16526. }
  16527. for (var i = 0, length = input.length; i < length; i++) {
  16528. var value = input[i];
  16529. if (!_.isArray(value) && !_.isArguments(value)) {
  16530. if (!strict) output.push(value);
  16531. } else if (shallow) {
  16532. push.apply(output, value);
  16533. } else {
  16534. flatten(value, shallow, strict, output);
  16535. }
  16536. }
  16537. return output;
  16538. };
  16539. // Flatten out an array, either recursively (by default), or just one level.
  16540. _.flatten = function(array, shallow) {
  16541. return flatten(array, shallow, false, []);
  16542. };
  16543. // Return a version of the array that does not contain the specified value(s).
  16544. _.without = function(array) {
  16545. return _.difference(array, slice.call(arguments, 1));
  16546. };
  16547. // Produce a duplicate-free version of the array. If the array has already
  16548. // been sorted, you have the option of using a faster algorithm.
  16549. // Aliased as `unique`.
  16550. _.uniq = _.unique = function(array, isSorted, iteratee, context) {
  16551. if (array == null) return [];
  16552. if (!_.isBoolean(isSorted)) {
  16553. context = iteratee;
  16554. iteratee = isSorted;
  16555. isSorted = false;
  16556. }
  16557. if (iteratee != null) iteratee = _.iteratee(iteratee, context);
  16558. var result = [];
  16559. var seen = [];
  16560. for (var i = 0, length = array.length; i < length; i++) {
  16561. var value = array[i];
  16562. if (isSorted) {
  16563. if (!i || seen !== value) result.push(value);
  16564. seen = value;
  16565. } else if (iteratee) {
  16566. var computed = iteratee(value, i, array);
  16567. if (_.indexOf(seen, computed) < 0) {
  16568. seen.push(computed);
  16569. result.push(value);
  16570. }
  16571. } else if (_.indexOf(result, value) < 0) {
  16572. result.push(value);
  16573. }
  16574. }
  16575. return result;
  16576. };
  16577. // Produce an array that contains the union: each distinct element from all of
  16578. // the passed-in arrays.
  16579. _.union = function() {
  16580. return _.uniq(flatten(arguments, true, true, []));
  16581. };
  16582. // Produce an array that contains every item shared between all the
  16583. // passed-in arrays.
  16584. _.intersection = function(array) {
  16585. if (array == null) return [];
  16586. var result = [];
  16587. var argsLength = arguments.length;
  16588. for (var i = 0, length = array.length; i < length; i++) {
  16589. var item = array[i];
  16590. if (_.contains(result, item)) continue;
  16591. for (var j = 1; j < argsLength; j++) {
  16592. if (!_.contains(arguments[j], item)) break;
  16593. }
  16594. if (j === argsLength) result.push(item);
  16595. }
  16596. return result;
  16597. };
  16598. // Take the difference between one array and a number of other arrays.
  16599. // Only the elements present in just the first array will remain.
  16600. _.difference = function(array) {
  16601. var rest = flatten(slice.call(arguments, 1), true, true, []);
  16602. return _.filter(array, function(value){
  16603. return !_.contains(rest, value);
  16604. });
  16605. };
  16606. // Zip together multiple lists into a single array -- elements that share
  16607. // an index go together.
  16608. _.zip = function(array) {
  16609. if (array == null) return [];
  16610. var length = _.max(arguments, 'length').length;
  16611. var results = Array(length);
  16612. for (var i = 0; i < length; i++) {
  16613. results[i] = _.pluck(arguments, i);
  16614. }
  16615. return results;
  16616. };
  16617. // Converts lists into objects. Pass either a single array of `[key, value]`
  16618. // pairs, or two parallel arrays of the same length -- one of keys, and one of
  16619. // the corresponding values.
  16620. _.object = function(list, values) {
  16621. if (list == null) return {};
  16622. var result = {};
  16623. for (var i = 0, length = list.length; i < length; i++) {
  16624. if (values) {
  16625. result[list[i]] = values[i];
  16626. } else {
  16627. result[list[i][0]] = list[i][1];
  16628. }
  16629. }
  16630. return result;
  16631. };
  16632. // Return the position of the first occurrence of an item in an array,
  16633. // or -1 if the item is not included in the array.
  16634. // If the array is large and already in sort order, pass `true`
  16635. // for **isSorted** to use binary search.
  16636. _.indexOf = function(array, item, isSorted) {
  16637. if (array == null) return -1;
  16638. var i = 0, length = array.length;
  16639. if (isSorted) {
  16640. if (typeof isSorted == 'number') {
  16641. i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted;
  16642. } else {
  16643. i = _.sortedIndex(array, item);
  16644. return array[i] === item ? i : -1;
  16645. }
  16646. }
  16647. for (; i < length; i++) if (array[i] === item) return i;
  16648. return -1;
  16649. };
  16650. _.lastIndexOf = function(array, item, from) {
  16651. if (array == null) return -1;
  16652. var idx = array.length;
  16653. if (typeof from == 'number') {
  16654. idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1);
  16655. }
  16656. while (--idx >= 0) if (array[idx] === item) return idx;
  16657. return -1;
  16658. };
  16659. // Generate an integer Array containing an arithmetic progression. A port of
  16660. // the native Python `range()` function. See
  16661. // [the Python documentation](http://docs.python.org/library/functions.html#range).
  16662. _.range = function(start, stop, step) {
  16663. if (arguments.length <= 1) {
  16664. stop = start || 0;
  16665. start = 0;
  16666. }
  16667. step = step || 1;
  16668. var length = Math.max(Math.ceil((stop - start) / step), 0);
  16669. var range = Array(length);
  16670. for (var idx = 0; idx < length; idx++, start += step) {
  16671. range[idx] = start;
  16672. }
  16673. return range;
  16674. };
  16675. // Function (ahem) Functions
  16676. // ------------------
  16677. // Reusable constructor function for prototype setting.
  16678. var Ctor = function(){};
  16679. // Create a function bound to a given object (assigning `this`, and arguments,
  16680. // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
  16681. // available.
  16682. _.bind = function(func, context) {
  16683. var args, bound;
  16684. if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
  16685. if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');
  16686. args = slice.call(arguments, 2);
  16687. bound = function() {
  16688. if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
  16689. Ctor.prototype = func.prototype;
  16690. var self = new Ctor;
  16691. Ctor.prototype = null;
  16692. var result = func.apply(self, args.concat(slice.call(arguments)));
  16693. if (_.isObject(result)) return result;
  16694. return self;
  16695. };
  16696. return bound;
  16697. };
  16698. // Partially apply a function by creating a version that has had some of its
  16699. // arguments pre-filled, without changing its dynamic `this` context. _ acts
  16700. // as a placeholder, allowing any combination of arguments to be pre-filled.
  16701. _.partial = function(func) {
  16702. var boundArgs = slice.call(arguments, 1);
  16703. return function() {
  16704. var position = 0;
  16705. var args = boundArgs.slice();
  16706. for (var i = 0, length = args.length; i < length; i++) {
  16707. if (args[i] === _) args[i] = arguments[position++];
  16708. }
  16709. while (position < arguments.length) args.push(arguments[position++]);
  16710. return func.apply(this, args);
  16711. };
  16712. };
  16713. // Bind a number of an object's methods to that object. Remaining arguments
  16714. // are the method names to be bound. Useful for ensuring that all callbacks
  16715. // defined on an object belong to it.
  16716. _.bindAll = function(obj) {
  16717. var i, length = arguments.length, key;
  16718. if (length <= 1) throw new Error('bindAll must be passed function names');
  16719. for (i = 1; i < length; i++) {
  16720. key = arguments[i];
  16721. obj[key] = _.bind(obj[key], obj);
  16722. }
  16723. return obj;
  16724. };
  16725. // Memoize an expensive function by storing its results.
  16726. _.memoize = function(func, hasher) {
  16727. var memoize = function(key) {
  16728. var cache = memoize.cache;
  16729. var address = hasher ? hasher.apply(this, arguments) : key;
  16730. if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
  16731. return cache[address];
  16732. };
  16733. memoize.cache = {};
  16734. return memoize;
  16735. };
  16736. // Delays a function for the given number of milliseconds, and then calls
  16737. // it with the arguments supplied.
  16738. _.delay = function(func, wait) {
  16739. var args = slice.call(arguments, 2);
  16740. return setTimeout(function(){
  16741. return func.apply(null, args);
  16742. }, wait);
  16743. };
  16744. // Defers a function, scheduling it to run after the current call stack has
  16745. // cleared.
  16746. _.defer = function(func) {
  16747. return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
  16748. };
  16749. // Returns a function, that, when invoked, will only be triggered at most once
  16750. // during a given window of time. Normally, the throttled function will run
  16751. // as much as it can, without ever going more than once per `wait` duration;
  16752. // but if you'd like to disable the execution on the leading edge, pass
  16753. // `{leading: false}`. To disable execution on the trailing edge, ditto.
  16754. _.throttle = function(func, wait, options) {
  16755. var context, args, result;
  16756. var timeout = null;
  16757. var previous = 0;
  16758. if (!options) options = {};
  16759. var later = function() {
  16760. previous = options.leading === false ? 0 : _.now();
  16761. timeout = null;
  16762. result = func.apply(context, args);
  16763. if (!timeout) context = args = null;
  16764. };
  16765. return function() {
  16766. var now = _.now();
  16767. if (!previous && options.leading === false) previous = now;
  16768. var remaining = wait - (now - previous);
  16769. context = this;
  16770. args = arguments;
  16771. if (remaining <= 0 || remaining > wait) {
  16772. clearTimeout(timeout);
  16773. timeout = null;
  16774. previous = now;
  16775. result = func.apply(context, args);
  16776. if (!timeout) context = args = null;
  16777. } else if (!timeout && options.trailing !== false) {
  16778. timeout = setTimeout(later, remaining);
  16779. }
  16780. return result;
  16781. };
  16782. };
  16783. // Returns a function, that, as long as it continues to be invoked, will not
  16784. // be triggered. The function will be called after it stops being called for
  16785. // N milliseconds. If `immediate` is passed, trigger the function on the
  16786. // leading edge, instead of the trailing.
  16787. _.debounce = function(func, wait, immediate) {
  16788. var timeout, args, context, timestamp, result;
  16789. var later = function() {
  16790. var last = _.now() - timestamp;
  16791. if (last < wait && last > 0) {
  16792. timeout = setTimeout(later, wait - last);
  16793. } else {
  16794. timeout = null;
  16795. if (!immediate) {
  16796. result = func.apply(context, args);
  16797. if (!timeout) context = args = null;
  16798. }
  16799. }
  16800. };
  16801. return function() {
  16802. context = this;
  16803. args = arguments;
  16804. timestamp = _.now();
  16805. var callNow = immediate && !timeout;
  16806. if (!timeout) timeout = setTimeout(later, wait);
  16807. if (callNow) {
  16808. result = func.apply(context, args);
  16809. context = args = null;
  16810. }
  16811. return result;
  16812. };
  16813. };
  16814. // Returns the first function passed as an argument to the second,
  16815. // allowing you to adjust arguments, run code before and after, and
  16816. // conditionally execute the original function.
  16817. _.wrap = function(func, wrapper) {
  16818. return _.partial(wrapper, func);
  16819. };
  16820. // Returns a negated version of the passed-in predicate.
  16821. _.negate = function(predicate) {
  16822. return function() {
  16823. return !predicate.apply(this, arguments);
  16824. };
  16825. };
  16826. // Returns a function that is the composition of a list of functions, each
  16827. // consuming the return value of the function that follows.
  16828. _.compose = function() {
  16829. var args = arguments;
  16830. var start = args.length - 1;
  16831. return function() {
  16832. var i = start;
  16833. var result = args[start].apply(this, arguments);
  16834. while (i--) result = args[i].call(this, result);
  16835. return result;
  16836. };
  16837. };
  16838. // Returns a function that will only be executed after being called N times.
  16839. _.after = function(times, func) {
  16840. return function() {
  16841. if (--times < 1) {
  16842. return func.apply(this, arguments);
  16843. }
  16844. };
  16845. };
  16846. // Returns a function that will only be executed before being called N times.
  16847. _.before = function(times, func) {
  16848. var memo;
  16849. return function() {
  16850. if (--times > 0) {
  16851. memo = func.apply(this, arguments);
  16852. } else {
  16853. func = null;
  16854. }
  16855. return memo;
  16856. };
  16857. };
  16858. // Returns a function that will be executed at most one time, no matter how
  16859. // often you call it. Useful for lazy initialization.
  16860. _.once = _.partial(_.before, 2);
  16861. // Object Functions
  16862. // ----------------
  16863. // Retrieve the names of an object's properties.
  16864. // Delegates to **ECMAScript 5**'s native `Object.keys`
  16865. _.keys = function(obj) {
  16866. if (!_.isObject(obj)) return [];
  16867. if (nativeKeys) return nativeKeys(obj);
  16868. var keys = [];
  16869. for (var key in obj) if (_.has(obj, key)) keys.push(key);
  16870. return keys;
  16871. };
  16872. // Retrieve the values of an object's properties.
  16873. _.values = function(obj) {
  16874. var keys = _.keys(obj);
  16875. var length = keys.length;
  16876. var values = Array(length);
  16877. for (var i = 0; i < length; i++) {
  16878. values[i] = obj[keys[i]];
  16879. }
  16880. return values;
  16881. };
  16882. // Convert an object into a list of `[key, value]` pairs.
  16883. _.pairs = function(obj) {
  16884. var keys = _.keys(obj);
  16885. var length = keys.length;
  16886. var pairs = Array(length);
  16887. for (var i = 0; i < length; i++) {
  16888. pairs[i] = [keys[i], obj[keys[i]]];
  16889. }
  16890. return pairs;
  16891. };
  16892. // Invert the keys and values of an object. The values must be serializable.
  16893. _.invert = function(obj) {
  16894. var result = {};
  16895. var keys = _.keys(obj);
  16896. for (var i = 0, length = keys.length; i < length; i++) {
  16897. result[obj[keys[i]]] = keys[i];
  16898. }
  16899. return result;
  16900. };
  16901. // Return a sorted list of the function names available on the object.
  16902. // Aliased as `methods`
  16903. _.functions = _.methods = function(obj) {
  16904. var names = [];
  16905. for (var key in obj) {
  16906. if (_.isFunction(obj[key])) names.push(key);
  16907. }
  16908. return names.sort();
  16909. };
  16910. // Extend a given object with all the properties in passed-in object(s).
  16911. _.extend = function(obj) {
  16912. if (!_.isObject(obj)) return obj;
  16913. var source, prop;
  16914. for (var i = 1, length = arguments.length; i < length; i++) {
  16915. source = arguments[i];
  16916. for (prop in source) {
  16917. if (hasOwnProperty.call(source, prop)) {
  16918. obj[prop] = source[prop];
  16919. }
  16920. }
  16921. }
  16922. return obj;
  16923. };
  16924. // Return a copy of the object only containing the whitelisted properties.
  16925. _.pick = function(obj, iteratee, context) {
  16926. var result = {}, key;
  16927. if (obj == null) return result;
  16928. if (_.isFunction(iteratee)) {
  16929. iteratee = createCallback(iteratee, context);
  16930. for (key in obj) {
  16931. var value = obj[key];
  16932. if (iteratee(value, key, obj)) result[key] = value;
  16933. }
  16934. } else {
  16935. var keys = concat.apply([], slice.call(arguments, 1));
  16936. obj = new Object(obj);
  16937. for (var i = 0, length = keys.length; i < length; i++) {
  16938. key = keys[i];
  16939. if (key in obj) result[key] = obj[key];
  16940. }
  16941. }
  16942. return result;
  16943. };
  16944. // Return a copy of the object without the blacklisted properties.
  16945. _.omit = function(obj, iteratee, context) {
  16946. if (_.isFunction(iteratee)) {
  16947. iteratee = _.negate(iteratee);
  16948. } else {
  16949. var keys = _.map(concat.apply([], slice.call(arguments, 1)), String);
  16950. iteratee = function(value, key) {
  16951. return !_.contains(keys, key);
  16952. };
  16953. }
  16954. return _.pick(obj, iteratee, context);
  16955. };
  16956. // Fill in a given object with default properties.
  16957. _.defaults = function(obj) {
  16958. if (!_.isObject(obj)) return obj;
  16959. for (var i = 1, length = arguments.length; i < length; i++) {
  16960. var source = arguments[i];
  16961. for (var prop in source) {
  16962. if (obj[prop] === void 0) obj[prop] = source[prop];
  16963. }
  16964. }
  16965. return obj;
  16966. };
  16967. // Create a (shallow-cloned) duplicate of an object.
  16968. _.clone = function(obj) {
  16969. if (!_.isObject(obj)) return obj;
  16970. return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
  16971. };
  16972. // Invokes interceptor with the obj, and then returns obj.
  16973. // The primary purpose of this method is to "tap into" a method chain, in
  16974. // order to perform operations on intermediate results within the chain.
  16975. _.tap = function(obj, interceptor) {
  16976. interceptor(obj);
  16977. return obj;
  16978. };
  16979. // Internal recursive comparison function for `isEqual`.
  16980. var eq = function(a, b, aStack, bStack) {
  16981. // Identical objects are equal. `0 === -0`, but they aren't identical.
  16982. // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
  16983. if (a === b) return a !== 0 || 1 / a === 1 / b;
  16984. // A strict comparison is necessary because `null == undefined`.
  16985. if (a == null || b == null) return a === b;
  16986. // Unwrap any wrapped objects.
  16987. if (a instanceof _) a = a._wrapped;
  16988. if (b instanceof _) b = b._wrapped;
  16989. // Compare `[[Class]]` names.
  16990. var className = toString.call(a);
  16991. if (className !== toString.call(b)) return false;
  16992. switch (className) {
  16993. // Strings, numbers, regular expressions, dates, and booleans are compared by value.
  16994. case '[object RegExp]':
  16995. // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
  16996. case '[object String]':
  16997. // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
  16998. // equivalent to `new String("5")`.
  16999. return '' + a === '' + b;
  17000. case '[object Number]':
  17001. // `NaN`s are equivalent, but non-reflexive.
  17002. // Object(NaN) is equivalent to NaN
  17003. if (+a !== +a) return +b !== +b;
  17004. // An `egal` comparison is performed for other numeric values.
  17005. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  17006. case '[object Date]':
  17007. case '[object Boolean]':
  17008. // Coerce dates and booleans to numeric primitive values. Dates are compared by their
  17009. // millisecond representations. Note that invalid dates with millisecond representations
  17010. // of `NaN` are not equivalent.
  17011. return +a === +b;
  17012. }
  17013. if (typeof a != 'object' || typeof b != 'object') return false;
  17014. // Assume equality for cyclic structures. The algorithm for detecting cyclic
  17015. // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
  17016. var length = aStack.length;
  17017. while (length--) {
  17018. // Linear search. Performance is inversely proportional to the number of
  17019. // unique nested structures.
  17020. if (aStack[length] === a) return bStack[length] === b;
  17021. }
  17022. // Objects with different constructors are not equivalent, but `Object`s
  17023. // from different frames are.
  17024. var aCtor = a.constructor, bCtor = b.constructor;
  17025. if (
  17026. aCtor !== bCtor &&
  17027. // Handle Object.create(x) cases
  17028. 'constructor' in a && 'constructor' in b &&
  17029. !(_.isFunction(aCtor) && aCtor instanceof aCtor &&
  17030. _.isFunction(bCtor) && bCtor instanceof bCtor)
  17031. ) {
  17032. return false;
  17033. }
  17034. // Add the first object to the stack of traversed objects.
  17035. aStack.push(a);
  17036. bStack.push(b);
  17037. var size, result;
  17038. // Recursively compare objects and arrays.
  17039. if (className === '[object Array]') {
  17040. // Compare array lengths to determine if a deep comparison is necessary.
  17041. size = a.length;
  17042. result = size === b.length;
  17043. if (result) {
  17044. // Deep compare the contents, ignoring non-numeric properties.
  17045. while (size--) {
  17046. if (!(result = eq(a[size], b[size], aStack, bStack))) break;
  17047. }
  17048. }
  17049. } else {
  17050. // Deep compare objects.
  17051. var keys = _.keys(a), key;
  17052. size = keys.length;
  17053. // Ensure that both objects contain the same number of properties before comparing deep equality.
  17054. result = _.keys(b).length === size;
  17055. if (result) {
  17056. while (size--) {
  17057. // Deep compare each member
  17058. key = keys[size];
  17059. if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
  17060. }
  17061. }
  17062. }
  17063. // Remove the first object from the stack of traversed objects.
  17064. aStack.pop();
  17065. bStack.pop();
  17066. return result;
  17067. };
  17068. // Perform a deep comparison to check if two objects are equal.
  17069. _.isEqual = function(a, b) {
  17070. return eq(a, b, [], []);
  17071. };
  17072. // Is a given array, string, or object empty?
  17073. // An "empty" object has no enumerable own-properties.
  17074. _.isEmpty = function(obj) {
  17075. if (obj == null) return true;
  17076. if (_.isArray(obj) || _.isString(obj) || _.isArguments(obj)) return obj.length === 0;
  17077. for (var key in obj) if (_.has(obj, key)) return false;
  17078. return true;
  17079. };
  17080. // Is a given value a DOM element?
  17081. _.isElement = function(obj) {
  17082. return !!(obj && obj.nodeType === 1);
  17083. };
  17084. // Is a given value an array?
  17085. // Delegates to ECMA5's native Array.isArray
  17086. _.isArray = nativeIsArray || function(obj) {
  17087. return toString.call(obj) === '[object Array]';
  17088. };
  17089. // Is a given variable an object?
  17090. _.isObject = function(obj) {
  17091. var type = typeof obj;
  17092. return type === 'function' || type === 'object' && !!obj;
  17093. };
  17094. // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
  17095. _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
  17096. _['is' + name] = function(obj) {
  17097. return toString.call(obj) === '[object ' + name + ']';
  17098. };
  17099. });
  17100. // Define a fallback version of the method in browsers (ahem, IE), where
  17101. // there isn't any inspectable "Arguments" type.
  17102. if (!_.isArguments(arguments)) {
  17103. _.isArguments = function(obj) {
  17104. return _.has(obj, 'callee');
  17105. };
  17106. }
  17107. // Optimize `isFunction` if appropriate. Work around an IE 11 bug.
  17108. if (typeof /./ !== 'function') {
  17109. _.isFunction = function(obj) {
  17110. return typeof obj == 'function' || false;
  17111. };
  17112. }
  17113. // Is a given object a finite number?
  17114. _.isFinite = function(obj) {
  17115. return isFinite(obj) && !isNaN(parseFloat(obj));
  17116. };
  17117. // Is the given value `NaN`? (NaN is the only number which does not equal itself).
  17118. _.isNaN = function(obj) {
  17119. return _.isNumber(obj) && obj !== +obj;
  17120. };
  17121. // Is a given value a boolean?
  17122. _.isBoolean = function(obj) {
  17123. return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
  17124. };
  17125. // Is a given value equal to null?
  17126. _.isNull = function(obj) {
  17127. return obj === null;
  17128. };
  17129. // Is a given variable undefined?
  17130. _.isUndefined = function(obj) {
  17131. return obj === void 0;
  17132. };
  17133. // Shortcut function for checking if an object has a given property directly
  17134. // on itself (in other words, not on a prototype).
  17135. _.has = function(obj, key) {
  17136. return obj != null && hasOwnProperty.call(obj, key);
  17137. };
  17138. // Utility Functions
  17139. // -----------------
  17140. // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
  17141. // previous owner. Returns a reference to the Underscore object.
  17142. _.noConflict = function() {
  17143. root._ = previousUnderscore;
  17144. return this;
  17145. };
  17146. // Keep the identity function around for default iteratees.
  17147. _.identity = function(value) {
  17148. return value;
  17149. };
  17150. _.constant = function(value) {
  17151. return function() {
  17152. return value;
  17153. };
  17154. };
  17155. _.noop = function(){};
  17156. _.property = function(key) {
  17157. return function(obj) {
  17158. return obj[key];
  17159. };
  17160. };
  17161. // Returns a predicate for checking whether an object has a given set of `key:value` pairs.
  17162. _.matches = function(attrs) {
  17163. var pairs = _.pairs(attrs), length = pairs.length;
  17164. return function(obj) {
  17165. if (obj == null) return !length;
  17166. obj = new Object(obj);
  17167. for (var i = 0; i < length; i++) {
  17168. var pair = pairs[i], key = pair[0];
  17169. if (pair[1] !== obj[key] || !(key in obj)) return false;
  17170. }
  17171. return true;
  17172. };
  17173. };
  17174. // Run a function **n** times.
  17175. _.times = function(n, iteratee, context) {
  17176. var accum = Array(Math.max(0, n));
  17177. iteratee = createCallback(iteratee, context, 1);
  17178. for (var i = 0; i < n; i++) accum[i] = iteratee(i);
  17179. return accum;
  17180. };
  17181. // Return a random integer between min and max (inclusive).
  17182. _.random = function(min, max) {
  17183. if (max == null) {
  17184. max = min;
  17185. min = 0;
  17186. }
  17187. return min + Math.floor(Math.random() * (max - min + 1));
  17188. };
  17189. // A (possibly faster) way to get the current timestamp as an integer.
  17190. _.now = Date.now || function() {
  17191. return new Date().getTime();
  17192. };
  17193. // List of HTML entities for escaping.
  17194. var escapeMap = {
  17195. '&': '&amp;',
  17196. '<': '&lt;',
  17197. '>': '&gt;',
  17198. '"': '&quot;',
  17199. "'": '&#x27;',
  17200. '`': '&#x60;'
  17201. };
  17202. var unescapeMap = _.invert(escapeMap);
  17203. // Functions for escaping and unescaping strings to/from HTML interpolation.
  17204. var createEscaper = function(map) {
  17205. var escaper = function(match) {
  17206. return map[match];
  17207. };
  17208. // Regexes for identifying a key that needs to be escaped
  17209. var source = '(?:' + _.keys(map).join('|') + ')';
  17210. var testRegexp = RegExp(source);
  17211. var replaceRegexp = RegExp(source, 'g');
  17212. return function(string) {
  17213. string = string == null ? '' : '' + string;
  17214. return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
  17215. };
  17216. };
  17217. _.escape = createEscaper(escapeMap);
  17218. _.unescape = createEscaper(unescapeMap);
  17219. // If the value of the named `property` is a function then invoke it with the
  17220. // `object` as context; otherwise, return it.
  17221. _.result = function(object, property) {
  17222. if (object == null) return void 0;
  17223. var value = object[property];
  17224. return _.isFunction(value) ? object[property]() : value;
  17225. };
  17226. // Generate a unique integer id (unique within the entire client session).
  17227. // Useful for temporary DOM ids.
  17228. var idCounter = 0;
  17229. _.uniqueId = function(prefix) {
  17230. var id = ++idCounter + '';
  17231. return prefix ? prefix + id : id;
  17232. };
  17233. // By default, Underscore uses ERB-style template delimiters, change the
  17234. // following template settings to use alternative delimiters.
  17235. _.templateSettings = {
  17236. evaluate : /<%([\s\S]+?)%>/g,
  17237. interpolate : /<%=([\s\S]+?)%>/g,
  17238. escape : /<%-([\s\S]+?)%>/g
  17239. };
  17240. // When customizing `templateSettings`, if you don't want to define an
  17241. // interpolation, evaluation or escaping regex, we need one that is
  17242. // guaranteed not to match.
  17243. var noMatch = /(.)^/;
  17244. // Certain characters need to be escaped so that they can be put into a
  17245. // string literal.
  17246. var escapes = {
  17247. "'": "'",
  17248. '\\': '\\',
  17249. '\r': 'r',
  17250. '\n': 'n',
  17251. '\u2028': 'u2028',
  17252. '\u2029': 'u2029'
  17253. };
  17254. var escaper = /\\|'|\r|\n|\u2028|\u2029/g;
  17255. var escapeChar = function(match) {
  17256. return '\\' + escapes[match];
  17257. };
  17258. // JavaScript micro-templating, similar to John Resig's implementation.
  17259. // Underscore templating handles arbitrary delimiters, preserves whitespace,
  17260. // and correctly escapes quotes within interpolated code.
  17261. // NB: `oldSettings` only exists for backwards compatibility.
  17262. _.template = function(text, settings, oldSettings) {
  17263. if (!settings && oldSettings) settings = oldSettings;
  17264. settings = _.defaults({}, settings, _.templateSettings);
  17265. // Combine delimiters into one regular expression via alternation.
  17266. var matcher = RegExp([
  17267. (settings.escape || noMatch).source,
  17268. (settings.interpolate || noMatch).source,
  17269. (settings.evaluate || noMatch).source
  17270. ].join('|') + '|$', 'g');
  17271. // Compile the template source, escaping string literals appropriately.
  17272. var index = 0;
  17273. var source = "__p+='";
  17274. text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
  17275. source += text.slice(index, offset).replace(escaper, escapeChar);
  17276. index = offset + match.length;
  17277. if (escape) {
  17278. source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
  17279. } else if (interpolate) {
  17280. source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
  17281. } else if (evaluate) {
  17282. source += "';\n" + evaluate + "\n__p+='";
  17283. }
  17284. // Adobe VMs need the match returned to produce the correct offest.
  17285. return match;
  17286. });
  17287. source += "';\n";
  17288. // If a variable is not specified, place data values in local scope.
  17289. if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
  17290. source = "var __t,__p='',__j=Array.prototype.join," +
  17291. "print=function(){__p+=__j.call(arguments,'');};\n" +
  17292. source + 'return __p;\n';
  17293. try {
  17294. var render = new Function(settings.variable || 'obj', '_', source);
  17295. } catch (e) {
  17296. e.source = source;
  17297. throw e;
  17298. }
  17299. var template = function(data) {
  17300. return render.call(this, data, _);
  17301. };
  17302. // Provide the compiled source as a convenience for precompilation.
  17303. var argument = settings.variable || 'obj';
  17304. template.source = 'function(' + argument + '){\n' + source + '}';
  17305. return template;
  17306. };
  17307. // Add a "chain" function. Start chaining a wrapped Underscore object.
  17308. _.chain = function(obj) {
  17309. var instance = _(obj);
  17310. instance._chain = true;
  17311. return instance;
  17312. };
  17313. // OOP
  17314. // ---------------
  17315. // If Underscore is called as a function, it returns a wrapped object that
  17316. // can be used OO-style. This wrapper holds altered versions of all the
  17317. // underscore functions. Wrapped objects may be chained.
  17318. // Helper function to continue chaining intermediate results.
  17319. var result = function(obj) {
  17320. return this._chain ? _(obj).chain() : obj;
  17321. };
  17322. // Add your own custom functions to the Underscore object.
  17323. _.mixin = function(obj) {
  17324. _.each(_.functions(obj), function(name) {
  17325. var func = _[name] = obj[name];
  17326. _.prototype[name] = function() {
  17327. var args = [this._wrapped];
  17328. push.apply(args, arguments);
  17329. return result.call(this, func.apply(_, args));
  17330. };
  17331. });
  17332. };
  17333. // Add all of the Underscore functions to the wrapper object.
  17334. _.mixin(_);
  17335. // Add all mutator Array functions to the wrapper.
  17336. _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
  17337. var method = ArrayProto[name];
  17338. _.prototype[name] = function() {
  17339. var obj = this._wrapped;
  17340. method.apply(obj, arguments);
  17341. if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];
  17342. return result.call(this, obj);
  17343. };
  17344. });
  17345. // Add all accessor Array functions to the wrapper.
  17346. _.each(['concat', 'join', 'slice'], function(name) {
  17347. var method = ArrayProto[name];
  17348. _.prototype[name] = function() {
  17349. return result.call(this, method.apply(this._wrapped, arguments));
  17350. };
  17351. });
  17352. // Extracts the result from a wrapped and chained object.
  17353. _.prototype.value = function() {
  17354. return this._wrapped;
  17355. };
  17356. // AMD registration happens at the end for compatibility with AMD loaders
  17357. // that may not enforce next-turn semantics on modules. Even though general
  17358. // practice for AMD registration is to be anonymous, underscore registers
  17359. // as a named module because, like jQuery, it is a base library that is
  17360. // popular enough to be bundled in a third party lib, but not be part of
  17361. // an AMD load request. Those cases could generate an error when an
  17362. // anonymous define() is called outside of a loader request.
  17363. if (typeof define === 'function' && define.amd) {
  17364. define('underscore', [], function() {
  17365. return _;
  17366. });
  17367. }
  17368. }.call(this));
  17369. // Backbone.js 1.1.2
  17370. // (c) 2010-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  17371. // Backbone may be freely distributed under the MIT license.
  17372. // For all details and documentation:
  17373. // http://backbonejs.org
  17374. (function(root, factory) {
  17375. // Set up Backbone appropriately for the environment. Start with AMD.
  17376. if (typeof define === 'function' && define.amd) {
  17377. define(['underscore', 'jquery', 'exports'], function(_, $, exports) {
  17378. // Export global even in AMD case in case this script is loaded with
  17379. // others that may still expect a global Backbone.
  17380. root.Backbone = factory(root, exports, _, $);
  17381. });
  17382. // Next for Node.js or CommonJS. jQuery may not be needed as a module.
  17383. } else if (typeof exports !== 'undefined') {
  17384. var _ = require('underscore');
  17385. factory(root, exports, _);
  17386. // Finally, as a browser global.
  17387. } else {
  17388. root.Backbone = factory(root, {}, root._, (root.jQuery || root.Zepto || root.ender || root.$));
  17389. }
  17390. }(this, function(root, Backbone, _, $) {
  17391. // Initial Setup
  17392. // -------------
  17393. // Save the previous value of the `Backbone` variable, so that it can be
  17394. // restored later on, if `noConflict` is used.
  17395. var previousBackbone = root.Backbone;
  17396. // Create local references to array methods we'll want to use later.
  17397. var array = [];
  17398. var push = array.push;
  17399. var slice = array.slice;
  17400. var splice = array.splice;
  17401. // Current version of the library. Keep in sync with `package.json`.
  17402. Backbone.VERSION = '1.1.2';
  17403. // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
  17404. // the `$` variable.
  17405. Backbone.$ = $;
  17406. // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
  17407. // to its previous owner. Returns a reference to this Backbone object.
  17408. Backbone.noConflict = function() {
  17409. root.Backbone = previousBackbone;
  17410. return this;
  17411. };
  17412. // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
  17413. // will fake `"PATCH"`, `"PUT"` and `"DELETE"` requests via the `_method` parameter and
  17414. // set a `X-Http-Method-Override` header.
  17415. Backbone.emulateHTTP = false;
  17416. // Turn on `emulateJSON` to support legacy servers that can't deal with direct
  17417. // `application/json` requests ... will encode the body as
  17418. // `application/x-www-form-urlencoded` instead and will send the model in a
  17419. // form param named `model`.
  17420. Backbone.emulateJSON = false;
  17421. // Backbone.Events
  17422. // ---------------
  17423. // A module that can be mixed in to *any object* in order to provide it with
  17424. // custom events. You may bind with `on` or remove with `off` callback
  17425. // functions to an event; `trigger`-ing an event fires all callbacks in
  17426. // succession.
  17427. //
  17428. // var object = {};
  17429. // _.extend(object, Backbone.Events);
  17430. // object.on('expand', function(){ alert('expanded'); });
  17431. // object.trigger('expand');
  17432. //
  17433. var Events = Backbone.Events = {
  17434. // Bind an event to a `callback` function. Passing `"all"` will bind
  17435. // the callback to all events fired.
  17436. on: function(name, callback, context) {
  17437. if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;
  17438. this._events || (this._events = {});
  17439. var events = this._events[name] || (this._events[name] = []);
  17440. events.push({callback: callback, context: context, ctx: context || this});
  17441. return this;
  17442. },
  17443. // Bind an event to only be triggered a single time. After the first time
  17444. // the callback is invoked, it will be removed.
  17445. once: function(name, callback, context) {
  17446. if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;
  17447. var self = this;
  17448. var once = _.once(function() {
  17449. self.off(name, once);
  17450. callback.apply(this, arguments);
  17451. });
  17452. once._callback = callback;
  17453. return this.on(name, once, context);
  17454. },
  17455. // Remove one or many callbacks. If `context` is null, removes all
  17456. // callbacks with that function. If `callback` is null, removes all
  17457. // callbacks for the event. If `name` is null, removes all bound
  17458. // callbacks for all events.
  17459. off: function(name, callback, context) {
  17460. var retain, ev, events, names, i, l, j, k;
  17461. if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
  17462. if (!name && !callback && !context) {
  17463. this._events = void 0;
  17464. return this;
  17465. }
  17466. names = name ? [name] : _.keys(this._events);
  17467. for (i = 0, l = names.length; i < l; i++) {
  17468. name = names[i];
  17469. if (events = this._events[name]) {
  17470. this._events[name] = retain = [];
  17471. if (callback || context) {
  17472. for (j = 0, k = events.length; j < k; j++) {
  17473. ev = events[j];
  17474. if ((callback && callback !== ev.callback && callback !== ev.callback._callback) ||
  17475. (context && context !== ev.context)) {
  17476. retain.push(ev);
  17477. }
  17478. }
  17479. }
  17480. if (!retain.length) delete this._events[name];
  17481. }
  17482. }
  17483. return this;
  17484. },
  17485. // Trigger one or many events, firing all bound callbacks. Callbacks are
  17486. // passed the same arguments as `trigger` is, apart from the event name
  17487. // (unless you're listening on `"all"`, which will cause your callback to
  17488. // receive the true name of the event as the first argument).
  17489. trigger: function(name) {
  17490. if (!this._events) return this;
  17491. var args = slice.call(arguments, 1);
  17492. if (!eventsApi(this, 'trigger', name, args)) return this;
  17493. var events = this._events[name];
  17494. var allEvents = this._events.all;
  17495. if (events) triggerEvents(events, args);
  17496. if (allEvents) triggerEvents(allEvents, arguments);
  17497. return this;
  17498. },
  17499. // Tell this object to stop listening to either specific events ... or
  17500. // to every object it's currently listening to.
  17501. stopListening: function(obj, name, callback) {
  17502. var listeningTo = this._listeningTo;
  17503. if (!listeningTo) return this;
  17504. var remove = !name && !callback;
  17505. if (!callback && typeof name === 'object') callback = this;
  17506. if (obj) (listeningTo = {})[obj._listenId] = obj;
  17507. for (var id in listeningTo) {
  17508. obj = listeningTo[id];
  17509. obj.off(name, callback, this);
  17510. if (remove || _.isEmpty(obj._events)) delete this._listeningTo[id];
  17511. }
  17512. return this;
  17513. }
  17514. };
  17515. // Regular expression used to split event strings.
  17516. var eventSplitter = /\s+/;
  17517. // Implement fancy features of the Events API such as multiple event
  17518. // names `"change blur"` and jQuery-style event maps `{change: action}`
  17519. // in terms of the existing API.
  17520. var eventsApi = function(obj, action, name, rest) {
  17521. if (!name) return true;
  17522. // Handle event maps.
  17523. if (typeof name === 'object') {
  17524. for (var key in name) {
  17525. obj[action].apply(obj, [key, name[key]].concat(rest));
  17526. }
  17527. return false;
  17528. }
  17529. // Handle space separated event names.
  17530. if (eventSplitter.test(name)) {
  17531. var names = name.split(eventSplitter);
  17532. for (var i = 0, l = names.length; i < l; i++) {
  17533. obj[action].apply(obj, [names[i]].concat(rest));
  17534. }
  17535. return false;
  17536. }
  17537. return true;
  17538. };
  17539. // A difficult-to-believe, but optimized internal dispatch function for
  17540. // triggering events. Tries to keep the usual cases speedy (most internal
  17541. // Backbone events have 3 arguments).
  17542. var triggerEvents = function(events, args) {
  17543. var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
  17544. switch (args.length) {
  17545. case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;
  17546. case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;
  17547. case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;
  17548. case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;
  17549. default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;
  17550. }
  17551. };
  17552. var listenMethods = {listenTo: 'on', listenToOnce: 'once'};
  17553. // Inversion-of-control versions of `on` and `once`. Tell *this* object to
  17554. // listen to an event in another object ... keeping track of what it's
  17555. // listening to.
  17556. _.each(listenMethods, function(implementation, method) {
  17557. Events[method] = function(obj, name, callback) {
  17558. var listeningTo = this._listeningTo || (this._listeningTo = {});
  17559. var id = obj._listenId || (obj._listenId = _.uniqueId('l'));
  17560. listeningTo[id] = obj;
  17561. if (!callback && typeof name === 'object') callback = this;
  17562. obj[implementation](name, callback, this);
  17563. return this;
  17564. };
  17565. });
  17566. // Aliases for backwards compatibility.
  17567. Events.bind = Events.on;
  17568. Events.unbind = Events.off;
  17569. // Allow the `Backbone` object to serve as a global event bus, for folks who
  17570. // want global "pubsub" in a convenient place.
  17571. _.extend(Backbone, Events);
  17572. // Backbone.Model
  17573. // --------------
  17574. // Backbone **Models** are the basic data object in the framework --
  17575. // frequently representing a row in a table in a database on your server.
  17576. // A discrete chunk of data and a bunch of useful, related methods for
  17577. // performing computations and transformations on that data.
  17578. // Create a new model with the specified attributes. A client id (`cid`)
  17579. // is automatically generated and assigned for you.
  17580. var Model = Backbone.Model = function(attributes, options) {
  17581. var attrs = attributes || {};
  17582. options || (options = {});
  17583. this.cid = _.uniqueId('c');
  17584. this.attributes = {};
  17585. if (options.collection) this.collection = options.collection;
  17586. if (options.parse) attrs = this.parse(attrs, options) || {};
  17587. attrs = _.defaults({}, attrs, _.result(this, 'defaults'));
  17588. this.set(attrs, options);
  17589. this.changed = {};
  17590. this.initialize.apply(this, arguments);
  17591. };
  17592. // Attach all inheritable methods to the Model prototype.
  17593. _.extend(Model.prototype, Events, {
  17594. // A hash of attributes whose current and previous value differ.
  17595. changed: null,
  17596. // The value returned during the last failed validation.
  17597. validationError: null,
  17598. // The default name for the JSON `id` attribute is `"id"`. MongoDB and
  17599. // CouchDB users may want to set this to `"_id"`.
  17600. idAttribute: 'id',
  17601. // Initialize is an empty function by default. Override it with your own
  17602. // initialization logic.
  17603. initialize: function(){},
  17604. // Return a copy of the model's `attributes` object.
  17605. toJSON: function(options) {
  17606. return _.clone(this.attributes);
  17607. },
  17608. // Proxy `Backbone.sync` by default -- but override this if you need
  17609. // custom syncing semantics for *this* particular model.
  17610. sync: function() {
  17611. return Backbone.sync.apply(this, arguments);
  17612. },
  17613. // Get the value of an attribute.
  17614. get: function(attr) {
  17615. return this.attributes[attr];
  17616. },
  17617. // Get the HTML-escaped value of an attribute.
  17618. escape: function(attr) {
  17619. return _.escape(this.get(attr));
  17620. },
  17621. // Returns `true` if the attribute contains a value that is not null
  17622. // or undefined.
  17623. has: function(attr) {
  17624. return this.get(attr) != null;
  17625. },
  17626. // Set a hash of model attributes on the object, firing `"change"`. This is
  17627. // the core primitive operation of a model, updating the data and notifying
  17628. // anyone who needs to know about the change in state. The heart of the beast.
  17629. set: function(key, val, options) {
  17630. var attr, attrs, unset, changes, silent, changing, prev, current;
  17631. if (key == null) return this;
  17632. // Handle both `"key", value` and `{key: value}` -style arguments.
  17633. if (typeof key === 'object') {
  17634. attrs = key;
  17635. options = val;
  17636. } else {
  17637. (attrs = {})[key] = val;
  17638. }
  17639. options || (options = {});
  17640. // Run validation.
  17641. if (!this._validate(attrs, options)) return false;
  17642. // Extract attributes and options.
  17643. unset = options.unset;
  17644. silent = options.silent;
  17645. changes = [];
  17646. changing = this._changing;
  17647. this._changing = true;
  17648. if (!changing) {
  17649. this._previousAttributes = _.clone(this.attributes);
  17650. this.changed = {};
  17651. }
  17652. current = this.attributes, prev = this._previousAttributes;
  17653. // Check for changes of `id`.
  17654. if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
  17655. // For each `set` attribute, update or delete the current value.
  17656. for (attr in attrs) {
  17657. val = attrs[attr];
  17658. if (!_.isEqual(current[attr], val)) changes.push(attr);
  17659. if (!_.isEqual(prev[attr], val)) {
  17660. this.changed[attr] = val;
  17661. } else {
  17662. delete this.changed[attr];
  17663. }
  17664. unset ? delete current[attr] : current[attr] = val;
  17665. }
  17666. // Trigger all relevant attribute changes.
  17667. if (!silent) {
  17668. if (changes.length) this._pending = options;
  17669. for (var i = 0, l = changes.length; i < l; i++) {
  17670. this.trigger('change:' + changes[i], this, current[changes[i]], options);
  17671. }
  17672. }
  17673. // You might be wondering why there's a `while` loop here. Changes can
  17674. // be recursively nested within `"change"` events.
  17675. if (changing) return this;
  17676. if (!silent) {
  17677. while (this._pending) {
  17678. options = this._pending;
  17679. this._pending = false;
  17680. this.trigger('change', this, options);
  17681. }
  17682. }
  17683. this._pending = false;
  17684. this._changing = false;
  17685. return this;
  17686. },
  17687. // Remove an attribute from the model, firing `"change"`. `unset` is a noop
  17688. // if the attribute doesn't exist.
  17689. unset: function(attr, options) {
  17690. return this.set(attr, void 0, _.extend({}, options, {unset: true}));
  17691. },
  17692. // Clear all attributes on the model, firing `"change"`.
  17693. clear: function(options) {
  17694. var attrs = {};
  17695. for (var key in this.attributes) attrs[key] = void 0;
  17696. return this.set(attrs, _.extend({}, options, {unset: true}));
  17697. },
  17698. // Determine if the model has changed since the last `"change"` event.
  17699. // If you specify an attribute name, determine if that attribute has changed.
  17700. hasChanged: function(attr) {
  17701. if (attr == null) return !_.isEmpty(this.changed);
  17702. return _.has(this.changed, attr);
  17703. },
  17704. // Return an object containing all the attributes that have changed, or
  17705. // false if there are no changed attributes. Useful for determining what
  17706. // parts of a view need to be updated and/or what attributes need to be
  17707. // persisted to the server. Unset attributes will be set to undefined.
  17708. // You can also pass an attributes object to diff against the model,
  17709. // determining if there *would be* a change.
  17710. changedAttributes: function(diff) {
  17711. if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
  17712. var val, changed = false;
  17713. var old = this._changing ? this._previousAttributes : this.attributes;
  17714. for (var attr in diff) {
  17715. if (_.isEqual(old[attr], (val = diff[attr]))) continue;
  17716. (changed || (changed = {}))[attr] = val;
  17717. }
  17718. return changed;
  17719. },
  17720. // Get the previous value of an attribute, recorded at the time the last
  17721. // `"change"` event was fired.
  17722. previous: function(attr) {
  17723. if (attr == null || !this._previousAttributes) return null;
  17724. return this._previousAttributes[attr];
  17725. },
  17726. // Get all of the attributes of the model at the time of the previous
  17727. // `"change"` event.
  17728. previousAttributes: function() {
  17729. return _.clone(this._previousAttributes);
  17730. },
  17731. // Fetch the model from the server. If the server's representation of the
  17732. // model differs from its current attributes, they will be overridden,
  17733. // triggering a `"change"` event.
  17734. fetch: function(options) {
  17735. options = options ? _.clone(options) : {};
  17736. if (options.parse === void 0) options.parse = true;
  17737. var model = this;
  17738. var success = options.success;
  17739. options.success = function(resp) {
  17740. if (!model.set(model.parse(resp, options), options)) return false;
  17741. if (success) success(model, resp, options);
  17742. model.trigger('sync', model, resp, options);
  17743. };
  17744. wrapError(this, options);
  17745. return this.sync('read', this, options);
  17746. },
  17747. // Set a hash of model attributes, and sync the model to the server.
  17748. // If the server returns an attributes hash that differs, the model's
  17749. // state will be `set` again.
  17750. save: function(key, val, options) {
  17751. var attrs, method, xhr, attributes = this.attributes;
  17752. // Handle both `"key", value` and `{key: value}` -style arguments.
  17753. if (key == null || typeof key === 'object') {
  17754. attrs = key;
  17755. options = val;
  17756. } else {
  17757. (attrs = {})[key] = val;
  17758. }
  17759. options = _.extend({validate: true}, options);
  17760. // If we're not waiting and attributes exist, save acts as
  17761. // `set(attr).save(null, opts)` with validation. Otherwise, check if
  17762. // the model will be valid when the attributes, if any, are set.
  17763. if (attrs && !options.wait) {
  17764. if (!this.set(attrs, options)) return false;
  17765. } else {
  17766. if (!this._validate(attrs, options)) return false;
  17767. }
  17768. // Set temporary attributes if `{wait: true}`.
  17769. if (attrs && options.wait) {
  17770. this.attributes = _.extend({}, attributes, attrs);
  17771. }
  17772. // After a successful server-side save, the client is (optionally)
  17773. // updated with the server-side state.
  17774. if (options.parse === void 0) options.parse = true;
  17775. var model = this;
  17776. var success = options.success;
  17777. options.success = function(resp) {
  17778. // Ensure attributes are restored during synchronous saves.
  17779. model.attributes = attributes;
  17780. var serverAttrs = model.parse(resp, options);
  17781. if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs);
  17782. if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) {
  17783. return false;
  17784. }
  17785. if (success) success(model, resp, options);
  17786. model.trigger('sync', model, resp, options);
  17787. };
  17788. wrapError(this, options);
  17789. method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
  17790. if (method === 'patch') options.attrs = attrs;
  17791. xhr = this.sync(method, this, options);
  17792. // Restore attributes.
  17793. if (attrs && options.wait) this.attributes = attributes;
  17794. return xhr;
  17795. },
  17796. // Destroy this model on the server if it was already persisted.
  17797. // Optimistically removes the model from its collection, if it has one.
  17798. // If `wait: true` is passed, waits for the server to respond before removal.
  17799. destroy: function(options) {
  17800. options = options ? _.clone(options) : {};
  17801. var model = this;
  17802. var success = options.success;
  17803. var destroy = function() {
  17804. model.trigger('destroy', model, model.collection, options);
  17805. };
  17806. options.success = function(resp) {
  17807. if (options.wait || model.isNew()) destroy();
  17808. if (success) success(model, resp, options);
  17809. if (!model.isNew()) model.trigger('sync', model, resp, options);
  17810. };
  17811. if (this.isNew()) {
  17812. options.success();
  17813. return false;
  17814. }
  17815. wrapError(this, options);
  17816. var xhr = this.sync('delete', this, options);
  17817. if (!options.wait) destroy();
  17818. return xhr;
  17819. },
  17820. // Default URL for the model's representation on the server -- if you're
  17821. // using Backbone's restful methods, override this to change the endpoint
  17822. // that will be called.
  17823. url: function() {
  17824. var base =
  17825. _.result(this, 'urlRoot') ||
  17826. _.result(this.collection, 'url') ||
  17827. urlError();
  17828. if (this.isNew()) return base;
  17829. return base.replace(/([^\/])$/, '$1/') + encodeURIComponent(this.id);
  17830. },
  17831. // **parse** converts a response into the hash of attributes to be `set` on
  17832. // the model. The default implementation is just to pass the response along.
  17833. parse: function(resp, options) {
  17834. return resp;
  17835. },
  17836. // Create a new model with identical attributes to this one.
  17837. clone: function() {
  17838. return new this.constructor(this.attributes);
  17839. },
  17840. // A model is new if it has never been saved to the server, and lacks an id.
  17841. isNew: function() {
  17842. return !this.has(this.idAttribute);
  17843. },
  17844. // Check if the model is currently in a valid state.
  17845. isValid: function(options) {
  17846. return this._validate({}, _.extend(options || {}, { validate: true }));
  17847. },
  17848. // Run validation against the next complete set of model attributes,
  17849. // returning `true` if all is well. Otherwise, fire an `"invalid"` event.
  17850. _validate: function(attrs, options) {
  17851. if (!options.validate || !this.validate) return true;
  17852. attrs = _.extend({}, this.attributes, attrs);
  17853. var error = this.validationError = this.validate(attrs, options) || null;
  17854. if (!error) return true;
  17855. this.trigger('invalid', this, error, _.extend(options, {validationError: error}));
  17856. return false;
  17857. }
  17858. });
  17859. // Underscore methods that we want to implement on the Model.
  17860. var modelMethods = ['keys', 'values', 'pairs', 'invert', 'pick', 'omit'];
  17861. // Mix in each Underscore method as a proxy to `Model#attributes`.
  17862. _.each(modelMethods, function(method) {
  17863. Model.prototype[method] = function() {
  17864. var args = slice.call(arguments);
  17865. args.unshift(this.attributes);
  17866. return _[method].apply(_, args);
  17867. };
  17868. });
  17869. // Backbone.Collection
  17870. // -------------------
  17871. // If models tend to represent a single row of data, a Backbone Collection is
  17872. // more analagous to a table full of data ... or a small slice or page of that
  17873. // table, or a collection of rows that belong together for a particular reason
  17874. // -- all of the messages in this particular folder, all of the documents
  17875. // belonging to this particular author, and so on. Collections maintain
  17876. // indexes of their models, both in order, and for lookup by `id`.
  17877. // Create a new **Collection**, perhaps to contain a specific type of `model`.
  17878. // If a `comparator` is specified, the Collection will maintain
  17879. // its models in sort order, as they're added and removed.
  17880. var Collection = Backbone.Collection = function(models, options) {
  17881. options || (options = {});
  17882. if (options.model) this.model = options.model;
  17883. if (options.comparator !== void 0) this.comparator = options.comparator;
  17884. this._reset();
  17885. this.initialize.apply(this, arguments);
  17886. if (models) this.reset(models, _.extend({silent: true}, options));
  17887. };
  17888. // Default options for `Collection#set`.
  17889. var setOptions = {add: true, remove: true, merge: true};
  17890. var addOptions = {add: true, remove: false};
  17891. // Define the Collection's inheritable methods.
  17892. _.extend(Collection.prototype, Events, {
  17893. // The default model for a collection is just a **Backbone.Model**.
  17894. // This should be overridden in most cases.
  17895. model: Model,
  17896. // Initialize is an empty function by default. Override it with your own
  17897. // initialization logic.
  17898. initialize: function(){},
  17899. // The JSON representation of a Collection is an array of the
  17900. // models' attributes.
  17901. toJSON: function(options) {
  17902. return this.map(function(model){ return model.toJSON(options); });
  17903. },
  17904. // Proxy `Backbone.sync` by default.
  17905. sync: function() {
  17906. return Backbone.sync.apply(this, arguments);
  17907. },
  17908. // Add a model, or list of models to the set.
  17909. add: function(models, options) {
  17910. return this.set(models, _.extend({merge: false}, options, addOptions));
  17911. },
  17912. // Remove a model, or a list of models from the set.
  17913. remove: function(models, options) {
  17914. var singular = !_.isArray(models);
  17915. models = singular ? [models] : _.clone(models);
  17916. options || (options = {});
  17917. var i, l, index, model;
  17918. for (i = 0, l = models.length; i < l; i++) {
  17919. model = models[i] = this.get(models[i]);
  17920. if (!model) continue;
  17921. delete this._byId[model.id];
  17922. delete this._byId[model.cid];
  17923. index = this.indexOf(model);
  17924. this.models.splice(index, 1);
  17925. this.length--;
  17926. if (!options.silent) {
  17927. options.index = index;
  17928. model.trigger('remove', model, this, options);
  17929. }
  17930. this._removeReference(model, options);
  17931. }
  17932. return singular ? models[0] : models;
  17933. },
  17934. // Update a collection by `set`-ing a new list of models, adding new ones,
  17935. // removing models that are no longer present, and merging models that
  17936. // already exist in the collection, as necessary. Similar to **Model#set**,
  17937. // the core operation for updating the data contained by the collection.
  17938. set: function(models, options) {
  17939. options = _.defaults({}, options, setOptions);
  17940. if (options.parse) models = this.parse(models, options);
  17941. var singular = !_.isArray(models);
  17942. models = singular ? (models ? [models] : []) : _.clone(models);
  17943. var i, l, id, model, attrs, existing, sort;
  17944. var at = options.at;
  17945. var targetModel = this.model;
  17946. var sortable = this.comparator && (at == null) && options.sort !== false;
  17947. var sortAttr = _.isString(this.comparator) ? this.comparator : null;
  17948. var toAdd = [], toRemove = [], modelMap = {};
  17949. var add = options.add, merge = options.merge, remove = options.remove;
  17950. var order = !sortable && add && remove ? [] : false;
  17951. // Turn bare objects into model references, and prevent invalid models
  17952. // from being added.
  17953. for (i = 0, l = models.length; i < l; i++) {
  17954. attrs = models[i] || {};
  17955. if (attrs instanceof Model) {
  17956. id = model = attrs;
  17957. } else {
  17958. id = attrs[targetModel.prototype.idAttribute || 'id'];
  17959. }
  17960. // If a duplicate is found, prevent it from being added and
  17961. // optionally merge it into the existing model.
  17962. if (existing = this.get(id)) {
  17963. if (remove) modelMap[existing.cid] = true;
  17964. if (merge) {
  17965. attrs = attrs === model ? model.attributes : attrs;
  17966. if (options.parse) attrs = existing.parse(attrs, options);
  17967. existing.set(attrs, options);
  17968. if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true;
  17969. }
  17970. models[i] = existing;
  17971. // If this is a new, valid model, push it to the `toAdd` list.
  17972. } else if (add) {
  17973. model = models[i] = this._prepareModel(attrs, options);
  17974. if (!model) continue;
  17975. toAdd.push(model);
  17976. this._addReference(model, options);
  17977. }
  17978. // Do not add multiple models with the same `id`.
  17979. model = existing || model;
  17980. if (order && (model.isNew() || !modelMap[model.id])) order.push(model);
  17981. modelMap[model.id] = true;
  17982. }
  17983. // Remove nonexistent models if appropriate.
  17984. if (remove) {
  17985. for (i = 0, l = this.length; i < l; ++i) {
  17986. if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model);
  17987. }
  17988. if (toRemove.length) this.remove(toRemove, options);
  17989. }
  17990. // See if sorting is needed, update `length` and splice in new models.
  17991. if (toAdd.length || (order && order.length)) {
  17992. if (sortable) sort = true;
  17993. this.length += toAdd.length;
  17994. if (at != null) {
  17995. for (i = 0, l = toAdd.length; i < l; i++) {
  17996. this.models.splice(at + i, 0, toAdd[i]);
  17997. }
  17998. } else {
  17999. if (order) this.models.length = 0;
  18000. var orderedModels = order || toAdd;
  18001. for (i = 0, l = orderedModels.length; i < l; i++) {
  18002. this.models.push(orderedModels[i]);
  18003. }
  18004. }
  18005. }
  18006. // Silently sort the collection if appropriate.
  18007. if (sort) this.sort({silent: true});
  18008. // Unless silenced, it's time to fire all appropriate add/sort events.
  18009. if (!options.silent) {
  18010. for (i = 0, l = toAdd.length; i < l; i++) {
  18011. (model = toAdd[i]).trigger('add', model, this, options);
  18012. }
  18013. if (sort || (order && order.length)) this.trigger('sort', this, options);
  18014. }
  18015. // Return the added (or merged) model (or models).
  18016. return singular ? models[0] : models;
  18017. },
  18018. // When you have more items than you want to add or remove individually,
  18019. // you can reset the entire set with a new list of models, without firing
  18020. // any granular `add` or `remove` events. Fires `reset` when finished.
  18021. // Useful for bulk operations and optimizations.
  18022. reset: function(models, options) {
  18023. options || (options = {});
  18024. for (var i = 0, l = this.models.length; i < l; i++) {
  18025. this._removeReference(this.models[i], options);
  18026. }
  18027. options.previousModels = this.models;
  18028. this._reset();
  18029. models = this.add(models, _.extend({silent: true}, options));
  18030. if (!options.silent) this.trigger('reset', this, options);
  18031. return models;
  18032. },
  18033. // Add a model to the end of the collection.
  18034. push: function(model, options) {
  18035. return this.add(model, _.extend({at: this.length}, options));
  18036. },
  18037. // Remove a model from the end of the collection.
  18038. pop: function(options) {
  18039. var model = this.at(this.length - 1);
  18040. this.remove(model, options);
  18041. return model;
  18042. },
  18043. // Add a model to the beginning of the collection.
  18044. unshift: function(model, options) {
  18045. return this.add(model, _.extend({at: 0}, options));
  18046. },
  18047. // Remove a model from the beginning of the collection.
  18048. shift: function(options) {
  18049. var model = this.at(0);
  18050. this.remove(model, options);
  18051. return model;
  18052. },
  18053. // Slice out a sub-array of models from the collection.
  18054. slice: function() {
  18055. return slice.apply(this.models, arguments);
  18056. },
  18057. // Get a model from the set by id.
  18058. get: function(obj) {
  18059. if (obj == null) return void 0;
  18060. return this._byId[obj] || this._byId[obj.id] || this._byId[obj.cid];
  18061. },
  18062. // Get the model at the given index.
  18063. at: function(index) {
  18064. return this.models[index];
  18065. },
  18066. // Return models with matching attributes. Useful for simple cases of
  18067. // `filter`.
  18068. where: function(attrs, first) {
  18069. if (_.isEmpty(attrs)) return first ? void 0 : [];
  18070. return this[first ? 'find' : 'filter'](function(model) {
  18071. for (var key in attrs) {
  18072. if (attrs[key] !== model.get(key)) return false;
  18073. }
  18074. return true;
  18075. });
  18076. },
  18077. // Return the first model with matching attributes. Useful for simple cases
  18078. // of `find`.
  18079. findWhere: function(attrs) {
  18080. return this.where(attrs, true);
  18081. },
  18082. // Force the collection to re-sort itself. You don't need to call this under
  18083. // normal circumstances, as the set will maintain sort order as each item
  18084. // is added.
  18085. sort: function(options) {
  18086. if (!this.comparator) throw new Error('Cannot sort a set without a comparator');
  18087. options || (options = {});
  18088. // Run sort based on type of `comparator`.
  18089. if (_.isString(this.comparator) || this.comparator.length === 1) {
  18090. this.models = this.sortBy(this.comparator, this);
  18091. } else {
  18092. this.models.sort(_.bind(this.comparator, this));
  18093. }
  18094. if (!options.silent) this.trigger('sort', this, options);
  18095. return this;
  18096. },
  18097. // Pluck an attribute from each model in the collection.
  18098. pluck: function(attr) {
  18099. return _.invoke(this.models, 'get', attr);
  18100. },
  18101. // Fetch the default set of models for this collection, resetting the
  18102. // collection when they arrive. If `reset: true` is passed, the response
  18103. // data will be passed through the `reset` method instead of `set`.
  18104. fetch: function(options) {
  18105. options = options ? _.clone(options) : {};
  18106. if (options.parse === void 0) options.parse = true;
  18107. var success = options.success;
  18108. var collection = this;
  18109. options.success = function(resp) {
  18110. var method = options.reset ? 'reset' : 'set';
  18111. collection[method](resp, options);
  18112. if (success) success(collection, resp, options);
  18113. collection.trigger('sync', collection, resp, options);
  18114. };
  18115. wrapError(this, options);
  18116. return this.sync('read', this, options);
  18117. },
  18118. // Create a new instance of a model in this collection. Add the model to the
  18119. // collection immediately, unless `wait: true` is passed, in which case we
  18120. // wait for the server to agree.
  18121. create: function(model, options) {
  18122. options = options ? _.clone(options) : {};
  18123. if (!(model = this._prepareModel(model, options))) return false;
  18124. if (!options.wait) this.add(model, options);
  18125. var collection = this;
  18126. var success = options.success;
  18127. options.success = function(model, resp) {
  18128. if (options.wait) collection.add(model, options);
  18129. if (success) success(model, resp, options);
  18130. };
  18131. model.save(null, options);
  18132. return model;
  18133. },
  18134. // **parse** converts a response into a list of models to be added to the
  18135. // collection. The default implementation is just to pass it through.
  18136. parse: function(resp, options) {
  18137. return resp;
  18138. },
  18139. // Create a new collection with an identical list of models as this one.
  18140. clone: function() {
  18141. return new this.constructor(this.models);
  18142. },
  18143. // Private method to reset all internal state. Called when the collection
  18144. // is first initialized or reset.
  18145. _reset: function() {
  18146. this.length = 0;
  18147. this.models = [];
  18148. this._byId = {};
  18149. },
  18150. // Prepare a hash of attributes (or other model) to be added to this
  18151. // collection.
  18152. _prepareModel: function(attrs, options) {
  18153. if (attrs instanceof Model) return attrs;
  18154. options = options ? _.clone(options) : {};
  18155. options.collection = this;
  18156. var model = new this.model(attrs, options);
  18157. if (!model.validationError) return model;
  18158. this.trigger('invalid', this, model.validationError, options);
  18159. return false;
  18160. },
  18161. // Internal method to create a model's ties to a collection.
  18162. _addReference: function(model, options) {
  18163. this._byId[model.cid] = model;
  18164. if (model.id != null) this._byId[model.id] = model;
  18165. if (!model.collection) model.collection = this;
  18166. model.on('all', this._onModelEvent, this);
  18167. },
  18168. // Internal method to sever a model's ties to a collection.
  18169. _removeReference: function(model, options) {
  18170. if (this === model.collection) delete model.collection;
  18171. model.off('all', this._onModelEvent, this);
  18172. },
  18173. // Internal method called every time a model in the set fires an event.
  18174. // Sets need to update their indexes when models change ids. All other
  18175. // events simply proxy through. "add" and "remove" events that originate
  18176. // in other collections are ignored.
  18177. _onModelEvent: function(event, model, collection, options) {
  18178. if ((event === 'add' || event === 'remove') && collection !== this) return;
  18179. if (event === 'destroy') this.remove(model, options);
  18180. if (model && event === 'change:' + model.idAttribute) {
  18181. delete this._byId[model.previous(model.idAttribute)];
  18182. if (model.id != null) this._byId[model.id] = model;
  18183. }
  18184. this.trigger.apply(this, arguments);
  18185. }
  18186. });
  18187. // Underscore methods that we want to implement on the Collection.
  18188. // 90% of the core usefulness of Backbone Collections is actually implemented
  18189. // right here:
  18190. var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl',
  18191. 'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select',
  18192. 'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke',
  18193. 'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest',
  18194. 'tail', 'drop', 'last', 'without', 'difference', 'indexOf', 'shuffle',
  18195. 'lastIndexOf', 'isEmpty', 'chain', 'sample'];
  18196. // Mix in each Underscore method as a proxy to `Collection#models`.
  18197. _.each(methods, function(method) {
  18198. Collection.prototype[method] = function() {
  18199. var args = slice.call(arguments);
  18200. args.unshift(this.models);
  18201. return _[method].apply(_, args);
  18202. };
  18203. });
  18204. // Underscore methods that take a property name as an argument.
  18205. var attributeMethods = ['groupBy', 'countBy', 'sortBy', 'indexBy'];
  18206. // Use attributes instead of properties.
  18207. _.each(attributeMethods, function(method) {
  18208. Collection.prototype[method] = function(value, context) {
  18209. var iterator = _.isFunction(value) ? value : function(model) {
  18210. return model.get(value);
  18211. };
  18212. return _[method](this.models, iterator, context);
  18213. };
  18214. });
  18215. // Backbone.View
  18216. // -------------
  18217. // Backbone Views are almost more convention than they are actual code. A View
  18218. // is simply a JavaScript object that represents a logical chunk of UI in the
  18219. // DOM. This might be a single item, an entire list, a sidebar or panel, or
  18220. // even the surrounding frame which wraps your whole app. Defining a chunk of
  18221. // UI as a **View** allows you to define your DOM events declaratively, without
  18222. // having to worry about render order ... and makes it easy for the view to
  18223. // react to specific changes in the state of your models.
  18224. // Creating a Backbone.View creates its initial element outside of the DOM,
  18225. // if an existing element is not provided...
  18226. var View = Backbone.View = function(options) {
  18227. this.cid = _.uniqueId('view');
  18228. options || (options = {});
  18229. _.extend(this, _.pick(options, viewOptions));
  18230. this._ensureElement();
  18231. this.initialize.apply(this, arguments);
  18232. this.delegateEvents();
  18233. };
  18234. // Cached regex to split keys for `delegate`.
  18235. var delegateEventSplitter = /^(\S+)\s*(.*)$/;
  18236. // List of view options to be merged as properties.
  18237. var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
  18238. // Set up all inheritable **Backbone.View** properties and methods.
  18239. _.extend(View.prototype, Events, {
  18240. // The default `tagName` of a View's element is `"div"`.
  18241. tagName: 'div',
  18242. // jQuery delegate for element lookup, scoped to DOM elements within the
  18243. // current view. This should be preferred to global lookups where possible.
  18244. $: function(selector) {
  18245. return this.$el.find(selector);
  18246. },
  18247. // Initialize is an empty function by default. Override it with your own
  18248. // initialization logic.
  18249. initialize: function(){},
  18250. // **render** is the core function that your view should override, in order
  18251. // to populate its element (`this.el`), with the appropriate HTML. The
  18252. // convention is for **render** to always return `this`.
  18253. render: function() {
  18254. return this;
  18255. },
  18256. // Remove this view by taking the element out of the DOM, and removing any
  18257. // applicable Backbone.Events listeners.
  18258. remove: function() {
  18259. this.$el.remove();
  18260. this.stopListening();
  18261. return this;
  18262. },
  18263. // Change the view's element (`this.el` property), including event
  18264. // re-delegation.
  18265. setElement: function(element, delegate) {
  18266. if (this.$el) this.undelegateEvents();
  18267. this.$el = element instanceof Backbone.$ ? element : Backbone.$(element);
  18268. this.el = this.$el[0];
  18269. if (delegate !== false) this.delegateEvents();
  18270. return this;
  18271. },
  18272. // Set callbacks, where `this.events` is a hash of
  18273. //
  18274. // *{"event selector": "callback"}*
  18275. //
  18276. // {
  18277. // 'mousedown .title': 'edit',
  18278. // 'click .button': 'save',
  18279. // 'click .open': function(e) { ... }
  18280. // }
  18281. //
  18282. // pairs. Callbacks will be bound to the view, with `this` set properly.
  18283. // Uses event delegation for efficiency.
  18284. // Omitting the selector binds the event to `this.el`.
  18285. // This only works for delegate-able events: not `focus`, `blur`, and
  18286. // not `change`, `submit`, and `reset` in Internet Explorer.
  18287. delegateEvents: function(events) {
  18288. if (!(events || (events = _.result(this, 'events')))) return this;
  18289. this.undelegateEvents();
  18290. for (var key in events) {
  18291. var method = events[key];
  18292. if (!_.isFunction(method)) method = this[events[key]];
  18293. if (!method) continue;
  18294. var match = key.match(delegateEventSplitter);
  18295. var eventName = match[1], selector = match[2];
  18296. method = _.bind(method, this);
  18297. eventName += '.delegateEvents' + this.cid;
  18298. if (selector === '') {
  18299. this.$el.on(eventName, method);
  18300. } else {
  18301. this.$el.on(eventName, selector, method);
  18302. }
  18303. }
  18304. return this;
  18305. },
  18306. // Clears all callbacks previously bound to the view with `delegateEvents`.
  18307. // You usually don't need to use this, but may wish to if you have multiple
  18308. // Backbone views attached to the same DOM element.
  18309. undelegateEvents: function() {
  18310. this.$el.off('.delegateEvents' + this.cid);
  18311. return this;
  18312. },
  18313. // Ensure that the View has a DOM element to render into.
  18314. // If `this.el` is a string, pass it through `$()`, take the first
  18315. // matching element, and re-assign it to `el`. Otherwise, create
  18316. // an element from the `id`, `className` and `tagName` properties.
  18317. _ensureElement: function() {
  18318. if (!this.el) {
  18319. var attrs = _.extend({}, _.result(this, 'attributes'));
  18320. if (this.id) attrs.id = _.result(this, 'id');
  18321. if (this.className) attrs['class'] = _.result(this, 'className');
  18322. var $el = Backbone.$('<' + _.result(this, 'tagName') + '>').attr(attrs);
  18323. this.setElement($el, false);
  18324. } else {
  18325. this.setElement(_.result(this, 'el'), false);
  18326. }
  18327. }
  18328. });
  18329. // Backbone.sync
  18330. // -------------
  18331. // Override this function to change the manner in which Backbone persists
  18332. // models to the server. You will be passed the type of request, and the
  18333. // model in question. By default, makes a RESTful Ajax request
  18334. // to the model's `url()`. Some possible customizations could be:
  18335. //
  18336. // * Use `setTimeout` to batch rapid-fire updates into a single request.
  18337. // * Send up the models as XML instead of JSON.
  18338. // * Persist models via WebSockets instead of Ajax.
  18339. //
  18340. // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
  18341. // as `POST`, with a `_method` parameter containing the true HTTP method,
  18342. // as well as all requests with the body as `application/x-www-form-urlencoded`
  18343. // instead of `application/json` with the model in a param named `model`.
  18344. // Useful when interfacing with server-side languages like **PHP** that make
  18345. // it difficult to read the body of `PUT` requests.
  18346. Backbone.sync = function(method, model, options) {
  18347. var type = methodMap[method];
  18348. // Default options, unless specified.
  18349. _.defaults(options || (options = {}), {
  18350. emulateHTTP: Backbone.emulateHTTP,
  18351. emulateJSON: Backbone.emulateJSON
  18352. });
  18353. // Default JSON-request options.
  18354. var params = {type: type, dataType: 'json'};
  18355. // Ensure that we have a URL.
  18356. if (!options.url) {
  18357. params.url = _.result(model, 'url') || urlError();
  18358. }
  18359. // Ensure that we have the appropriate request data.
  18360. if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
  18361. params.contentType = 'application/json';
  18362. params.data = JSON.stringify(options.attrs || model.toJSON(options));
  18363. }
  18364. // For older servers, emulate JSON by encoding the request into an HTML-form.
  18365. if (options.emulateJSON) {
  18366. params.contentType = 'application/x-www-form-urlencoded';
  18367. params.data = params.data ? {model: params.data} : {};
  18368. }
  18369. // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
  18370. // And an `X-HTTP-Method-Override` header.
  18371. if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
  18372. params.type = 'POST';
  18373. if (options.emulateJSON) params.data._method = type;
  18374. var beforeSend = options.beforeSend;
  18375. options.beforeSend = function(xhr) {
  18376. xhr.setRequestHeader('X-HTTP-Method-Override', type);
  18377. if (beforeSend) return beforeSend.apply(this, arguments);
  18378. };
  18379. }
  18380. // Don't process data on a non-GET request.
  18381. if (params.type !== 'GET' && !options.emulateJSON) {
  18382. params.processData = false;
  18383. }
  18384. // If we're sending a `PATCH` request, and we're in an old Internet Explorer
  18385. // that still has ActiveX enabled by default, override jQuery to use that
  18386. // for XHR instead. Remove this line when jQuery supports `PATCH` on IE8.
  18387. if (params.type === 'PATCH' && noXhrPatch) {
  18388. params.xhr = function() {
  18389. return new ActiveXObject("Microsoft.XMLHTTP");
  18390. };
  18391. }
  18392. // Make the request, allowing the user to override any Ajax options.
  18393. var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
  18394. model.trigger('request', model, xhr, options);
  18395. return xhr;
  18396. };
  18397. var noXhrPatch =
  18398. typeof window !== 'undefined' && !!window.ActiveXObject &&
  18399. !(window.XMLHttpRequest && (new XMLHttpRequest).dispatchEvent);
  18400. // Map from CRUD to HTTP for our default `Backbone.sync` implementation.
  18401. var methodMap = {
  18402. 'create': 'POST',
  18403. 'update': 'PUT',
  18404. 'patch': 'PATCH',
  18405. 'delete': 'DELETE',
  18406. 'read': 'GET'
  18407. };
  18408. // Set the default implementation of `Backbone.ajax` to proxy through to `$`.
  18409. // Override this if you'd like to use a different library.
  18410. Backbone.ajax = function() {
  18411. return Backbone.$.ajax.apply(Backbone.$, arguments);
  18412. };
  18413. // Backbone.Router
  18414. // ---------------
  18415. // Routers map faux-URLs to actions, and fire events when routes are
  18416. // matched. Creating a new one sets its `routes` hash, if not set statically.
  18417. var Router = Backbone.Router = function(options) {
  18418. options || (options = {});
  18419. if (options.routes) this.routes = options.routes;
  18420. this._bindRoutes();
  18421. this.initialize.apply(this, arguments);
  18422. };
  18423. // Cached regular expressions for matching named param parts and splatted
  18424. // parts of route strings.
  18425. var optionalParam = /\((.*?)\)/g;
  18426. var namedParam = /(\(\?)?:\w+/g;
  18427. var splatParam = /\*\w+/g;
  18428. var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
  18429. // Set up all inheritable **Backbone.Router** properties and methods.
  18430. _.extend(Router.prototype, Events, {
  18431. // Initialize is an empty function by default. Override it with your own
  18432. // initialization logic.
  18433. initialize: function(){},
  18434. // Manually bind a single named route to a callback. For example:
  18435. //
  18436. // this.route('search/:query/p:num', 'search', function(query, num) {
  18437. // ...
  18438. // });
  18439. //
  18440. route: function(route, name, callback) {
  18441. if (!_.isRegExp(route)) route = this._routeToRegExp(route);
  18442. if (_.isFunction(name)) {
  18443. callback = name;
  18444. name = '';
  18445. }
  18446. if (!callback) callback = this[name];
  18447. var router = this;
  18448. Backbone.history.route(route, function(fragment) {
  18449. var args = router._extractParameters(route, fragment);
  18450. router.execute(callback, args);
  18451. router.trigger.apply(router, ['route:' + name].concat(args));
  18452. router.trigger('route', name, args);
  18453. Backbone.history.trigger('route', router, name, args);
  18454. });
  18455. return this;
  18456. },
  18457. // Execute a route handler with the provided parameters. This is an
  18458. // excellent place to do pre-route setup or post-route cleanup.
  18459. execute: function(callback, args) {
  18460. if (callback) callback.apply(this, args);
  18461. },
  18462. // Simple proxy to `Backbone.history` to save a fragment into the history.
  18463. navigate: function(fragment, options) {
  18464. Backbone.history.navigate(fragment, options);
  18465. return this;
  18466. },
  18467. // Bind all defined routes to `Backbone.history`. We have to reverse the
  18468. // order of the routes here to support behavior where the most general
  18469. // routes can be defined at the bottom of the route map.
  18470. _bindRoutes: function() {
  18471. if (!this.routes) return;
  18472. this.routes = _.result(this, 'routes');
  18473. var route, routes = _.keys(this.routes);
  18474. while ((route = routes.pop()) != null) {
  18475. this.route(route, this.routes[route]);
  18476. }
  18477. },
  18478. // Convert a route string into a regular expression, suitable for matching
  18479. // against the current location hash.
  18480. _routeToRegExp: function(route) {
  18481. route = route.replace(escapeRegExp, '\\$&')
  18482. .replace(optionalParam, '(?:$1)?')
  18483. .replace(namedParam, function(match, optional) {
  18484. return optional ? match : '([^/?]+)';
  18485. })
  18486. .replace(splatParam, '([^?]*?)');
  18487. return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$');
  18488. },
  18489. // Given a route, and a URL fragment that it matches, return the array of
  18490. // extracted decoded parameters. Empty or unmatched parameters will be
  18491. // treated as `null` to normalize cross-browser behavior.
  18492. _extractParameters: function(route, fragment) {
  18493. var params = route.exec(fragment).slice(1);
  18494. return _.map(params, function(param, i) {
  18495. // Don't decode the search params.
  18496. if (i === params.length - 1) return param || null;
  18497. return param ? decodeURIComponent(param) : null;
  18498. });
  18499. }
  18500. });
  18501. // Backbone.History
  18502. // ----------------
  18503. // Handles cross-browser history management, based on either
  18504. // [pushState](http://diveintohtml5.info/history.html) and real URLs, or
  18505. // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
  18506. // and URL fragments. If the browser supports neither (old IE, natch),
  18507. // falls back to polling.
  18508. var History = Backbone.History = function() {
  18509. this.handlers = [];
  18510. _.bindAll(this, 'checkUrl');
  18511. // Ensure that `History` can be used outside of the browser.
  18512. if (typeof window !== 'undefined') {
  18513. this.location = window.location;
  18514. this.history = window.history;
  18515. }
  18516. };
  18517. // Cached regex for stripping a leading hash/slash and trailing space.
  18518. var routeStripper = /^[#\/]|\s+$/g;
  18519. // Cached regex for stripping leading and trailing slashes.
  18520. var rootStripper = /^\/+|\/+$/g;
  18521. // Cached regex for detecting MSIE.
  18522. var isExplorer = /msie [\w.]+/;
  18523. // Cached regex for removing a trailing slash.
  18524. var trailingSlash = /\/$/;
  18525. // Cached regex for stripping urls of hash.
  18526. var pathStripper = /#.*$/;
  18527. // Has the history handling already been started?
  18528. History.started = false;
  18529. // Set up all inheritable **Backbone.History** properties and methods.
  18530. _.extend(History.prototype, Events, {
  18531. // The default interval to poll for hash changes, if necessary, is
  18532. // twenty times a second.
  18533. interval: 50,
  18534. // Are we at the app root?
  18535. atRoot: function() {
  18536. return this.location.pathname.replace(/[^\/]$/, '$&/') === this.root;
  18537. },
  18538. // Gets the true hash value. Cannot use location.hash directly due to bug
  18539. // in Firefox where location.hash will always be decoded.
  18540. getHash: function(window) {
  18541. var match = (window || this).location.href.match(/#(.*)$/);
  18542. return match ? match[1] : '';
  18543. },
  18544. // Get the cross-browser normalized URL fragment, either from the URL,
  18545. // the hash, or the override.
  18546. getFragment: function(fragment, forcePushState) {
  18547. if (fragment == null) {
  18548. if (this._hasPushState || !this._wantsHashChange || forcePushState) {
  18549. fragment = decodeURI(this.location.pathname + this.location.search);
  18550. var root = this.root.replace(trailingSlash, '');
  18551. if (!fragment.indexOf(root)) fragment = fragment.slice(root.length);
  18552. } else {
  18553. fragment = this.getHash();
  18554. }
  18555. }
  18556. return fragment.replace(routeStripper, '');
  18557. },
  18558. // Start the hash change handling, returning `true` if the current URL matches
  18559. // an existing route, and `false` otherwise.
  18560. start: function(options) {
  18561. if (History.started) throw new Error("Backbone.history has already been started");
  18562. History.started = true;
  18563. // Figure out the initial configuration. Do we need an iframe?
  18564. // Is pushState desired ... is it available?
  18565. this.options = _.extend({root: '/'}, this.options, options);
  18566. this.root = this.options.root;
  18567. this._wantsHashChange = this.options.hashChange !== false;
  18568. this._wantsPushState = !!this.options.pushState;
  18569. this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState);
  18570. var fragment = this.getFragment();
  18571. var docMode = document.documentMode;
  18572. var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
  18573. // Normalize root to always include a leading and trailing slash.
  18574. this.root = ('/' + this.root + '/').replace(rootStripper, '/');
  18575. if (oldIE && this._wantsHashChange) {
  18576. var frame = Backbone.$('<iframe src="javascript:0" tabindex="-1">');
  18577. this.iframe = frame.hide().appendTo('body')[0].contentWindow;
  18578. this.navigate(fragment);
  18579. }
  18580. // Depending on whether we're using pushState or hashes, and whether
  18581. // 'onhashchange' is supported, determine how we check the URL state.
  18582. if (this._hasPushState) {
  18583. Backbone.$(window).on('popstate', this.checkUrl);
  18584. } else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) {
  18585. Backbone.$(window).on('hashchange', this.checkUrl);
  18586. } else if (this._wantsHashChange) {
  18587. this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
  18588. }
  18589. // Determine if we need to change the base url, for a pushState link
  18590. // opened by a non-pushState browser.
  18591. this.fragment = fragment;
  18592. var loc = this.location;
  18593. // Transition from hashChange to pushState or vice versa if both are
  18594. // requested.
  18595. if (this._wantsHashChange && this._wantsPushState) {
  18596. // If we've started off with a route from a `pushState`-enabled
  18597. // browser, but we're currently in a browser that doesn't support it...
  18598. if (!this._hasPushState && !this.atRoot()) {
  18599. this.fragment = this.getFragment(null, true);
  18600. this.location.replace(this.root + '#' + this.fragment);
  18601. // Return immediately as browser will do redirect to new url
  18602. return true;
  18603. // Or if we've started out with a hash-based route, but we're currently
  18604. // in a browser where it could be `pushState`-based instead...
  18605. } else if (this._hasPushState && this.atRoot() && loc.hash) {
  18606. this.fragment = this.getHash().replace(routeStripper, '');
  18607. this.history.replaceState({}, document.title, this.root + this.fragment);
  18608. }
  18609. }
  18610. if (!this.options.silent) return this.loadUrl();
  18611. },
  18612. // Disable Backbone.history, perhaps temporarily. Not useful in a real app,
  18613. // but possibly useful for unit testing Routers.
  18614. stop: function() {
  18615. Backbone.$(window).off('popstate', this.checkUrl).off('hashchange', this.checkUrl);
  18616. if (this._checkUrlInterval) clearInterval(this._checkUrlInterval);
  18617. History.started = false;
  18618. },
  18619. // Add a route to be tested when the fragment changes. Routes added later
  18620. // may override previous routes.
  18621. route: function(route, callback) {
  18622. this.handlers.unshift({route: route, callback: callback});
  18623. },
  18624. // Checks the current URL to see if it has changed, and if it has,
  18625. // calls `loadUrl`, normalizing across the hidden iframe.
  18626. checkUrl: function(e) {
  18627. var current = this.getFragment();
  18628. if (current === this.fragment && this.iframe) {
  18629. current = this.getFragment(this.getHash(this.iframe));
  18630. }
  18631. if (current === this.fragment) return false;
  18632. if (this.iframe) this.navigate(current);
  18633. this.loadUrl();
  18634. },
  18635. // Attempt to load the current URL fragment. If a route succeeds with a
  18636. // match, returns `true`. If no defined routes matches the fragment,
  18637. // returns `false`.
  18638. loadUrl: function(fragment) {
  18639. fragment = this.fragment = this.getFragment(fragment);
  18640. return _.any(this.handlers, function(handler) {
  18641. if (handler.route.test(fragment)) {
  18642. handler.callback(fragment);
  18643. return true;
  18644. }
  18645. });
  18646. },
  18647. // Save a fragment into the hash history, or replace the URL state if the
  18648. // 'replace' option is passed. You are responsible for properly URL-encoding
  18649. // the fragment in advance.
  18650. //
  18651. // The options object can contain `trigger: true` if you wish to have the
  18652. // route callback be fired (not usually desirable), or `replace: true`, if
  18653. // you wish to modify the current URL without adding an entry to the history.
  18654. navigate: function(fragment, options) {
  18655. if (!History.started) return false;
  18656. if (!options || options === true) options = {trigger: !!options};
  18657. var url = this.root + (fragment = this.getFragment(fragment || ''));
  18658. // Strip the hash for matching.
  18659. fragment = fragment.replace(pathStripper, '');
  18660. if (this.fragment === fragment) return;
  18661. this.fragment = fragment;
  18662. // Don't include a trailing slash on the root.
  18663. if (fragment === '' && url !== '/') url = url.slice(0, -1);
  18664. // If pushState is available, we use it to set the fragment as a real URL.
  18665. if (this._hasPushState) {
  18666. this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);
  18667. // If hash changes haven't been explicitly disabled, update the hash
  18668. // fragment to store history.
  18669. } else if (this._wantsHashChange) {
  18670. this._updateHash(this.location, fragment, options.replace);
  18671. if (this.iframe && (fragment !== this.getFragment(this.getHash(this.iframe)))) {
  18672. // Opening and closing the iframe tricks IE7 and earlier to push a
  18673. // history entry on hash-tag change. When replace is true, we don't
  18674. // want this.
  18675. if(!options.replace) this.iframe.document.open().close();
  18676. this._updateHash(this.iframe.location, fragment, options.replace);
  18677. }
  18678. // If you've told us that you explicitly don't want fallback hashchange-
  18679. // based history, then `navigate` becomes a page refresh.
  18680. } else {
  18681. return this.location.assign(url);
  18682. }
  18683. if (options.trigger) return this.loadUrl(fragment);
  18684. },
  18685. // Update the hash location, either replacing the current entry, or adding
  18686. // a new one to the browser history.
  18687. _updateHash: function(location, fragment, replace) {
  18688. if (replace) {
  18689. var href = location.href.replace(/(javascript:|#).*$/, '');
  18690. location.replace(href + '#' + fragment);
  18691. } else {
  18692. // Some browsers require that `hash` contains a leading #.
  18693. location.hash = '#' + fragment;
  18694. }
  18695. }
  18696. });
  18697. // Create the default Backbone.history.
  18698. Backbone.history = new History;
  18699. // Helpers
  18700. // -------
  18701. // Helper function to correctly set up the prototype chain, for subclasses.
  18702. // Similar to `goog.inherits`, but uses a hash of prototype properties and
  18703. // class properties to be extended.
  18704. var extend = function(protoProps, staticProps) {
  18705. var parent = this;
  18706. var child;
  18707. // The constructor function for the new subclass is either defined by you
  18708. // (the "constructor" property in your `extend` definition), or defaulted
  18709. // by us to simply call the parent's constructor.
  18710. if (protoProps && _.has(protoProps, 'constructor')) {
  18711. child = protoProps.constructor;
  18712. } else {
  18713. child = function(){ return parent.apply(this, arguments); };
  18714. }
  18715. // Add static properties to the constructor function, if supplied.
  18716. _.extend(child, parent, staticProps);
  18717. // Set the prototype chain to inherit from `parent`, without calling
  18718. // `parent`'s constructor function.
  18719. var Surrogate = function(){ this.constructor = child; };
  18720. Surrogate.prototype = parent.prototype;
  18721. child.prototype = new Surrogate;
  18722. // Add prototype properties (instance properties) to the subclass,
  18723. // if supplied.
  18724. if (protoProps) _.extend(child.prototype, protoProps);
  18725. // Set a convenience property in case the parent's prototype is needed
  18726. // later.
  18727. child.__super__ = parent.prototype;
  18728. return child;
  18729. };
  18730. // Set up inheritance for the model, collection, router, view and history.
  18731. Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
  18732. // Throw an error when a URL is needed, and none is supplied.
  18733. var urlError = function() {
  18734. throw new Error('A "url" property or function must be specified');
  18735. };
  18736. // Wrap an optional error callback with a fallback error event.
  18737. var wrapError = function(model, options) {
  18738. var error = options.error;
  18739. options.error = function(resp) {
  18740. if (error) error(model, resp, options);
  18741. model.trigger('error', model, resp, options);
  18742. };
  18743. };
  18744. return Backbone;
  18745. }));
  18746. (function (root, factory) {
  18747. if (typeof define === 'function' && define.amd) {
  18748. // AMD. Register as an anonymous module.
  18749. define(['backbone', 'underscore'], factory);
  18750. } else if (typeof exports === 'object') {
  18751. // Node. Does not work with strict CommonJS, but
  18752. // only CommonJS-like environments that support module.exports,
  18753. // like Node.
  18754. module.exports = factory(require('backbone'), require('underscore'));
  18755. } else {
  18756. // Browser globals (root is window)
  18757. root.returnExports = factory(root.Backbone, root._);
  18758. }
  18759. }(this, function (Backbone, _) {
  18760. // Generate four random hex digits.
  18761. function S4() {
  18762. return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
  18763. }
  18764. // Generate a pseudo-GUID by concatenating random hexadecimal.
  18765. function guid() {
  18766. return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
  18767. }
  18768. if ( _(indexedDB).isUndefined() ) { return; }
  18769. // Driver object
  18770. // That's the interesting part.
  18771. // There is a driver for each schema provided. The schema is a te combination of name (for the database), a version as well as migrations to reach that
  18772. // version of the database.
  18773. function Driver(schema, ready, nolog, onerror) {
  18774. this.schema = schema;
  18775. this.ready = ready;
  18776. this.error = null;
  18777. this.transactions = []; // Used to list all transactions and keep track of active ones.
  18778. this.db = null;
  18779. this.nolog = nolog;
  18780. this.onerror = onerror;
  18781. var lastMigrationPathVersion = _.last(this.schema.migrations).version;
  18782. if (!this.nolog) debugLog("opening database " + this.schema.id + " in version #" + lastMigrationPathVersion);
  18783. this.dbRequest = indexedDB.open(this.schema.id,lastMigrationPathVersion); //schema version need to be an unsigned long
  18784. this.launchMigrationPath = function(dbVersion) {
  18785. var transaction = this.dbRequest.transaction;
  18786. var clonedMigrations = _.clone(schema.migrations);
  18787. this.migrate(transaction, clonedMigrations, dbVersion, {
  18788. error: function (event) {
  18789. this.error = "Database not up to date. " + dbVersion + " expected was " + lastMigrationPathVersion;
  18790. }.bind(this)
  18791. });
  18792. };
  18793. this.dbRequest.onblocked = function(event){
  18794. if (!this.nolog) debugLog("connection to database blocked");
  18795. }
  18796. this.dbRequest.onsuccess = function (e) {
  18797. this.db = e.target.result; // Attach the connection ot the queue.
  18798. var currentIntDBVersion = (parseInt(this.db.version) || 0); // we need convert beacuse chrome store in integer and ie10 DP4+ in int;
  18799. var lastMigrationInt = (parseInt(lastMigrationPathVersion) || 0); // And make sure we compare numbers with numbers.
  18800. if (currentIntDBVersion === lastMigrationInt) { //if support new event onupgradeneeded will trigger the ready function
  18801. // No migration to perform!
  18802. this.ready();
  18803. } else if (currentIntDBVersion < lastMigrationInt ) {
  18804. // We need to migrate up to the current migration defined in the database
  18805. this.launchMigrationPath(currentIntDBVersion);
  18806. } else {
  18807. // Looks like the IndexedDB is at a higher version than the current driver schema.
  18808. this.error = "Database version is greater than current code " + currentIntDBVersion + " expected was " + lastMigrationInt;
  18809. }
  18810. }.bind(this);
  18811. this.dbRequest.onerror = function (e) {
  18812. // Failed to open the database
  18813. this.error = "Couldn't not connect to the database"
  18814. if (!this.nolog) debugLog("Couldn't not connect to the database");
  18815. this.onerror();
  18816. }.bind(this);
  18817. this.dbRequest.onabort = function (e) {
  18818. // Failed to open the database
  18819. this.error = "Connection to the database aborted"
  18820. if (!this.nolog) debugLog("Connection to the database aborted");
  18821. this.onerror();
  18822. }.bind(this);
  18823. this.dbRequest.onupgradeneeded = function(iDBVersionChangeEvent){
  18824. this.db =iDBVersionChangeEvent.target.result;
  18825. var newVersion = iDBVersionChangeEvent.newVersion;
  18826. var oldVersion = iDBVersionChangeEvent.oldVersion;
  18827. // Fix Safari 8 and iOS 8 bug
  18828. // at the first connection oldVersion is equal to 9223372036854776000
  18829. // but the real value is 0
  18830. if (oldVersion > 99999999999)
  18831. oldVersion = 0;
  18832. if (!this.nolog) debugLog("onupgradeneeded = " + oldVersion + " => " + newVersion);
  18833. this.launchMigrationPath(oldVersion);
  18834. }.bind(this);
  18835. }
  18836. function debugLog(str) {
  18837. if (typeof window !== "undefined" && typeof window.console !== "undefined" && typeof window.console.log !== "undefined") {
  18838. window.console.log(str);
  18839. }
  18840. else if(console.log !== "undefined") {
  18841. console.log(str)
  18842. }
  18843. }
  18844. // Driver Prototype
  18845. Driver.prototype = {
  18846. // Tracks transactions. Mostly for debugging purposes. TO-IMPROVE
  18847. _track_transaction: function(transaction) {
  18848. this.transactions.push(transaction);
  18849. function removeIt() {
  18850. var idx = this.transactions.indexOf(transaction);
  18851. if (idx !== -1) {this.transactions.splice(idx); }
  18852. };
  18853. transaction.oncomplete = removeIt.bind(this);
  18854. transaction.onabort = removeIt.bind(this);
  18855. transaction.onerror = removeIt.bind(this);
  18856. },
  18857. // Performs all the migrations to reach the right version of the database.
  18858. migrate: function (transaction, migrations, version, options) {
  18859. transaction.onerror = options.error;
  18860. transaction.onabort = options.error;
  18861. if (!this.nolog) debugLog("migrate begin version from #" + version);
  18862. var that = this;
  18863. var migration = migrations.shift();
  18864. if (migration) {
  18865. if (!version || version < migration.version) {
  18866. // We need to apply this migration-
  18867. if (typeof migration.before == "undefined") {
  18868. migration.before = function (next) {
  18869. next();
  18870. };
  18871. }
  18872. if (typeof migration.after == "undefined") {
  18873. migration.after = function (next) {
  18874. next();
  18875. };
  18876. }
  18877. // First, let's run the before script
  18878. if (!this.nolog) debugLog("migrate begin before version #" + migration.version);
  18879. migration.before(function () {
  18880. if (!this.nolog) debugLog("migrate done before version #" + migration.version);
  18881. if (!this.nolog) debugLog("migrate begin migrate version #" + migration.version);
  18882. migration.migrate(transaction, function () {
  18883. if (!this.nolog) debugLog("migrate done migrate version #" + migration.version);
  18884. // Migration successfully appliedn let's go to the next one!
  18885. if (!this.nolog) debugLog("migrate begin after version #" + migration.version);
  18886. migration.after(function () {
  18887. if (!this.nolog) debugLog("migrate done after version #" + migration.version);
  18888. if (!this.nolog) debugLog("Migrated to " + migration.version);
  18889. //last modification occurred, need finish
  18890. if(migrations.length ==0) {
  18891. if (!this.nolog) {
  18892. debugLog("migrate setting transaction.oncomplete to finish version #" + migration.version);
  18893. transaction.oncomplete = function() {
  18894. debugLog("migrate done transaction.oncomplete version #" + migration.version);
  18895. debugLog("Done migrating");
  18896. }
  18897. }
  18898. }
  18899. else
  18900. {
  18901. if (!this.nolog) debugLog("migrate end from version #" + version + " to " + migration.version);
  18902. that.migrate(transaction, migrations, version, options);
  18903. }
  18904. }.bind(this));
  18905. }.bind(this));
  18906. }.bind(this));
  18907. } else {
  18908. // No need to apply this migration
  18909. if (!this.nolog) debugLog("Skipping migration " + migration.version);
  18910. this.migrate(transaction, migrations, version, options);
  18911. }
  18912. }
  18913. },
  18914. // This is the main method, called by the ExecutionQueue when the driver is ready (database open and migration performed)
  18915. execute: function (storeName, method, object, options) {
  18916. if (!this.nolog) debugLog("execute : " + method + " on " + storeName + " for " + object.id);
  18917. switch (method) {
  18918. case "create":
  18919. this.create(storeName, object, options);
  18920. break;
  18921. case "read":
  18922. if (object.id || object.cid) {
  18923. this.read(storeName, object, options); // It's a model
  18924. } else {
  18925. this.query(storeName, object, options); // It's a collection
  18926. }
  18927. break;
  18928. case "update":
  18929. this.update(storeName, object, options); // We may want to check that this is not a collection. TOFIX
  18930. break;
  18931. case "delete":
  18932. if (object.id || object.cid) {
  18933. this.delete(storeName, object, options);
  18934. } else {
  18935. this.clear(storeName, object, options);
  18936. }
  18937. break;
  18938. default:
  18939. // Hum what?
  18940. }
  18941. },
  18942. // Writes the json to the storeName in db. It is a create operations, which means it will fail if the key already exists
  18943. // options are just success and error callbacks.
  18944. create: function (storeName, object, options) {
  18945. var writeTransaction = this.db.transaction([storeName], 'readwrite');
  18946. //this._track_transaction(writeTransaction);
  18947. var store = writeTransaction.objectStore(storeName);
  18948. var json = object.toJSON();
  18949. var idAttribute = _.result(object, 'idAttribute');
  18950. var writeRequest;
  18951. if (json[idAttribute] === undefined && !store.autoIncrement) json[idAttribute] = guid();
  18952. writeTransaction.onerror = function (e) {
  18953. options.error(e);
  18954. };
  18955. writeTransaction.oncomplete = function (e) {
  18956. options.success(json);
  18957. };
  18958. if (!store.keyPath)
  18959. writeRequest = store.add(json, json[idAttribute]);
  18960. else
  18961. writeRequest = store.add(json);
  18962. },
  18963. // Writes the json to the storeName in db. It is an update operation, which means it will overwrite the value if the key already exist
  18964. // options are just success and error callbacks.
  18965. update: function (storeName, object, options) {
  18966. var writeTransaction = this.db.transaction([storeName], 'readwrite');
  18967. //this._track_transaction(writeTransaction);
  18968. var store = writeTransaction.objectStore(storeName);
  18969. var json = object.toJSON();
  18970. var idAttribute = _.result(object, 'idAttribute');
  18971. var writeRequest;
  18972. if (!json[idAttribute]) json[idAttribute] = guid();
  18973. if (!store.keyPath)
  18974. writeRequest = store.put(json, json[idAttribute]);
  18975. else
  18976. writeRequest = store.put(json);
  18977. writeRequest.onerror = function (e) {
  18978. options.error(e);
  18979. };
  18980. writeTransaction.oncomplete = function (e) {
  18981. options.success(json);
  18982. };
  18983. },
  18984. // Reads from storeName in db with json.id if it's there of with any json.xxxx as long as xxx is an index in storeName
  18985. read: function (storeName, object, options) {
  18986. var readTransaction = this.db.transaction([storeName], "readonly");
  18987. this._track_transaction(readTransaction);
  18988. var store = readTransaction.objectStore(storeName);
  18989. var json = object.toJSON();
  18990. var idAttribute = _.result(object, 'idAttribute');
  18991. var getRequest = null;
  18992. if (json[idAttribute]) {
  18993. getRequest = store.get(json[idAttribute]);
  18994. } else if(options.index) {
  18995. var index = store.index(options.index.name);
  18996. getRequest = index.get(options.index.value);
  18997. } else {
  18998. // We need to find which index we have
  18999. var cardinality = 0; // try to fit the index with most matches
  19000. _.each(store.indexNames, function (key, index) {
  19001. index = store.index(key);
  19002. if(typeof index.keyPath === 'string' && 1 > cardinality) {
  19003. // simple index
  19004. if (json[index.keyPath] !== undefined) {
  19005. getRequest = index.get(json[index.keyPath]);
  19006. cardinality = 1;
  19007. }
  19008. } else if(typeof index.keyPath === 'object' && index.keyPath.length > cardinality) {
  19009. // compound index
  19010. var valid = true;
  19011. var keyValue = _.map(index.keyPath, function(keyPart) {
  19012. valid = valid && json[keyPart] !== undefined;
  19013. return json[keyPart];
  19014. });
  19015. if(valid) {
  19016. getRequest = index.get(keyValue);
  19017. cardinality = index.keyPath.length;
  19018. }
  19019. }
  19020. });
  19021. }
  19022. if (getRequest) {
  19023. getRequest.onsuccess = function (event) {
  19024. if (event.target.result) {
  19025. options.success(event.target.result);
  19026. } else {
  19027. options.error("Not Found");
  19028. }
  19029. };
  19030. getRequest.onerror = function () {
  19031. options.error("Not Found"); // We couldn't find the record.
  19032. }
  19033. } else {
  19034. options.error("Not Found"); // We couldn't even look for it, as we don't have enough data.
  19035. }
  19036. },
  19037. // Deletes the json.id key and value in storeName from db.
  19038. delete: function (storeName, object, options) {
  19039. var deleteTransaction = this.db.transaction([storeName], 'readwrite');
  19040. //this._track_transaction(deleteTransaction);
  19041. var store = deleteTransaction.objectStore(storeName);
  19042. var json = object.toJSON();
  19043. var idAttribute = _.result(object, 'idAttribute');
  19044. var deleteRequest = store.delete(json[idAttribute]);
  19045. deleteTransaction.oncomplete = function (event) {
  19046. options.success(null);
  19047. };
  19048. deleteRequest.onerror = function (event) {
  19049. options.error("Not Deleted");
  19050. };
  19051. },
  19052. // Clears all records for storeName from db.
  19053. clear: function (storeName, object, options) {
  19054. var deleteTransaction = this.db.transaction([storeName], "readwrite");
  19055. //this._track_transaction(deleteTransaction);
  19056. var store = deleteTransaction.objectStore(storeName);
  19057. var deleteRequest = store.clear();
  19058. deleteRequest.onsuccess = function (event) {
  19059. options.success(null);
  19060. };
  19061. deleteRequest.onerror = function (event) {
  19062. options.error("Not Cleared");
  19063. };
  19064. },
  19065. // Performs a query on storeName in db.
  19066. // options may include :
  19067. // - conditions : value of an index, or range for an index
  19068. // - range : range for the primary key
  19069. // - limit : max number of elements to be yielded
  19070. // - offset : skipped items.
  19071. query: function (storeName, collection, options) {
  19072. var elements = [];
  19073. var skipped = 0, processed = 0;
  19074. var queryTransaction = this.db.transaction([storeName], "readonly");
  19075. //this._track_transaction(queryTransaction);
  19076. var idAttribute = _.result(collection.model.prototype, 'idAttribute');
  19077. var readCursor = null;
  19078. var store = queryTransaction.objectStore(storeName);
  19079. var index = null,
  19080. lower = null,
  19081. upper = null,
  19082. bounds = null;
  19083. if (options.conditions) {
  19084. // We have a condition, we need to use it for the cursor
  19085. _.each(store.indexNames, function (key) {
  19086. if (!readCursor) {
  19087. index = store.index(key);
  19088. if (options.conditions[index.keyPath] instanceof Array) {
  19089. lower = options.conditions[index.keyPath][0] > options.conditions[index.keyPath][1] ? options.conditions[index.keyPath][1] : options.conditions[index.keyPath][0];
  19090. upper = options.conditions[index.keyPath][0] > options.conditions[index.keyPath][1] ? options.conditions[index.keyPath][0] : options.conditions[index.keyPath][1];
  19091. bounds = IDBKeyRange.bound(lower, upper, true, true);
  19092. if (options.conditions[index.keyPath][0] > options.conditions[index.keyPath][1]) {
  19093. // Looks like we want the DESC order
  19094. readCursor = index.openCursor(bounds, window.IDBCursor.PREV || "prev");
  19095. } else {
  19096. // We want ASC order
  19097. readCursor = index.openCursor(bounds, window.IDBCursor.NEXT || "next");
  19098. }
  19099. } else if (typeof options.conditions[index.keyPath] === 'object' && ('$gt' in options.conditions[index.keyPath] || '$gte' in options.conditions[index.keyPath])) {
  19100. if('$gt' in options.conditions[index.keyPath])
  19101. bounds = IDBKeyRange.lowerBound(options.conditions[index.keyPath]['$gt'], true);
  19102. else
  19103. bounds = IDBKeyRange.lowerBound(options.conditions[index.keyPath]['$gte']);
  19104. readCursor = index.openCursor(bounds, window.IDBCursor.NEXT || "next");
  19105. } else if (typeof options.conditions[index.keyPath] === 'object' && ('$lt' in options.conditions[index.keyPath] || '$lte' in options.conditions[index.keyPath])) {
  19106. if('$lt' in options.conditions[index.keyPath])
  19107. bounds = IDBKeyRange.upperBound(options.conditions[index.keyPath]['$lt'], true);
  19108. else
  19109. bounds = IDBKeyRange.upperBound(options.conditions[index.keyPath]['$lte']);
  19110. readCursor = index.openCursor(bounds, window.IDBCursor.NEXT || "next");
  19111. } else if (options.conditions[index.keyPath] != undefined) {
  19112. bounds = IDBKeyRange.only(options.conditions[index.keyPath]);
  19113. readCursor = index.openCursor(bounds);
  19114. }
  19115. }
  19116. });
  19117. } else if (options.index) {
  19118. index = store.index(options.index.name);
  19119. var excludeLower = !!options.index.excludeLower;
  19120. var excludeUpper = !!options.index.excludeUpper;
  19121. if (index) {
  19122. if (options.index.lower && options.index.upper) {
  19123. bounds = IDBKeyRange.bound(options.index.lower, options.index.upper, excludeLower, excludeUpper);
  19124. } else if (options.index.lower) {
  19125. bounds = IDBKeyRange.lowerBound(options.index.lower, excludeLower);
  19126. } else if (options.index.upper) {
  19127. bounds = IDBKeyRange.upperBound(options.index.upper, excludeUpper);
  19128. } else if (options.index.only) {
  19129. bounds = IDBKeyRange.only(options.index.only);
  19130. }
  19131. if (typeof options.index.order === 'string' && options.index.order.toLowerCase() === 'desc') {
  19132. readCursor = index.openCursor(bounds, window.IDBCursor.PREV || "prev");
  19133. } else {
  19134. readCursor = index.openCursor(bounds, window.IDBCursor.NEXT || "next");
  19135. }
  19136. }
  19137. } else {
  19138. // No conditions, use the index
  19139. if (options.range) {
  19140. lower = options.range[0] > options.range[1] ? options.range[1] : options.range[0];
  19141. upper = options.range[0] > options.range[1] ? options.range[0] : options.range[1];
  19142. bounds = IDBKeyRange.bound(lower, upper);
  19143. if (options.range[0] > options.range[1]) {
  19144. readCursor = store.openCursor(bounds, window.IDBCursor.PREV || "prev");
  19145. } else {
  19146. readCursor = store.openCursor(bounds, window.IDBCursor.NEXT || "next");
  19147. }
  19148. } else {
  19149. readCursor = store.openCursor();
  19150. }
  19151. }
  19152. if (typeof (readCursor) == "undefined" || !readCursor) {
  19153. options.error("No Cursor");
  19154. } else {
  19155. readCursor.onerror = function(e){
  19156. options.error("readCursor error", e);
  19157. };
  19158. // Setup a handler for the cursor’s `success` event:
  19159. readCursor.onsuccess = function (e) {
  19160. var cursor = e.target.result;
  19161. if (!cursor) {
  19162. if (options.addIndividually || options.clear) {
  19163. // nothing!
  19164. // We need to indicate that we're done. But, how?
  19165. collection.trigger("reset");
  19166. } else {
  19167. options.success(elements); // We're done. No more elements.
  19168. }
  19169. }
  19170. else {
  19171. // Cursor is not over yet.
  19172. if (options.limit && processed >= options.limit) {
  19173. // Yet, we have processed enough elements. So, let's just skip.
  19174. if (bounds) {
  19175. if (options.conditions && options.conditions[index.keyPath]) {
  19176. cursor.continue(options.conditions[index.keyPath][1] + 1); /* We need to 'terminate' the cursor cleany, by moving to the end */
  19177. } else if (options.index && (options.index.upper || options.index.lower)) {
  19178. if (typeof options.index.order === 'string' && options.index.order.toLowerCase() === 'desc') {
  19179. cursor.continue(options.index.lower);
  19180. } else {
  19181. cursor.continue(options.index.upper);
  19182. }
  19183. }
  19184. } else {
  19185. cursor.continue(); /* We need to 'terminate' the cursor cleany, by moving to the end */
  19186. }
  19187. }
  19188. else if (options.offset && options.offset > skipped) {
  19189. skipped++;
  19190. cursor.continue(); /* We need to Moving the cursor forward */
  19191. } else {
  19192. // This time, it looks like it's good!
  19193. if (options.addIndividually) {
  19194. collection.add(cursor.value);
  19195. } else if (options.clear) {
  19196. var deleteRequest = store.delete(cursor.value[idAttribute]);
  19197. deleteRequest.onsuccess = function (event) {
  19198. elements.push(cursor.value);
  19199. };
  19200. deleteRequest.onerror = function (event) {
  19201. elements.push(cursor.value);
  19202. };
  19203. } else {
  19204. elements.push(cursor.value);
  19205. }
  19206. processed++;
  19207. cursor.continue();
  19208. }
  19209. }
  19210. };
  19211. }
  19212. },
  19213. close :function(){
  19214. if(this.db){
  19215. this.db.close();
  19216. }
  19217. }
  19218. };
  19219. // ExecutionQueue object
  19220. // The execution queue is an abstraction to buffer up requests to the database.
  19221. // It holds a "driver". When the driver is ready, it just fires up the queue and executes in sync.
  19222. function ExecutionQueue(schema,next,nolog) {
  19223. this.driver = new Driver(schema, this.ready.bind(this), nolog, this.error.bind(this));
  19224. this.started = false;
  19225. this.failed = false;
  19226. this.stack = [];
  19227. this.version = _.last(schema.migrations).version;
  19228. this.next = next;
  19229. }
  19230. // ExecutionQueue Prototype
  19231. ExecutionQueue.prototype = {
  19232. // Called when the driver is ready
  19233. // It just loops over the elements in the queue and executes them.
  19234. ready: function () {
  19235. this.started = true;
  19236. _.each(this.stack, function (message) {
  19237. this.execute(message);
  19238. }.bind(this));
  19239. this.stack = []; // fix memory leak
  19240. this.next();
  19241. },
  19242. error: function() {
  19243. this.failed = true;
  19244. _.each(this.stack, function (message) {
  19245. this.execute(message);
  19246. }.bind(this));
  19247. this.stack = [];
  19248. this.next();
  19249. },
  19250. // Executes a given command on the driver. If not started, just stacks up one more element.
  19251. execute: function (message) {
  19252. if (this.started) {
  19253. try {
  19254. this.driver.execute(message[2].storeName || message[1].storeName, message[0], message[1], message[2]); // Upon messages, we execute the query
  19255. } catch (e) {
  19256. if (e.name === 'InvalidStateError') {
  19257. var f = window.onInvalidStateError;
  19258. if (f) f(e);
  19259. }
  19260. throw e;
  19261. }
  19262. } else if (this.failed) {
  19263. message[2].error();
  19264. } else {
  19265. this.stack.push(message);
  19266. }
  19267. },
  19268. close : function(){
  19269. this.driver.close();
  19270. }
  19271. };
  19272. // Method used by Backbone for sync of data with data store. It was initially designed to work with "server side" APIs, This wrapper makes
  19273. // it work with the local indexedDB stuff. It uses the schema attribute provided by the object.
  19274. // The wrapper keeps an active Executuon Queue for each "schema", and executes querues agains it, based on the object type (collection or
  19275. // single model), but also the method... etc.
  19276. // Keeps track of the connections
  19277. var Databases = {};
  19278. function sync(method, object, options) {
  19279. if(method == "closeall"){
  19280. _.each(Databases,function(database){
  19281. database.close();
  19282. });
  19283. // Clean up active databases object.
  19284. Databases = {};
  19285. return Backbone.$.Deferred().resolve();
  19286. }
  19287. // If a model or a collection does not define a database, fall back on ajaxSync
  19288. if (!object || !_.isObject(object.database)) {
  19289. return Backbone.ajaxSync(method, object, options);
  19290. }
  19291. var schema = object.database;
  19292. if (Databases[schema.id]) {
  19293. if(Databases[schema.id].version != _.last(schema.migrations).version){
  19294. Databases[schema.id].close();
  19295. delete Databases[schema.id];
  19296. }
  19297. }
  19298. var promise;
  19299. if (typeof Backbone.$ === 'undefined' || typeof Backbone.$.Deferred === 'undefined') {
  19300. var noop = function() {};
  19301. var resolve = noop;
  19302. var reject = noop;
  19303. } else {
  19304. var dfd = Backbone.$.Deferred();
  19305. var resolve = dfd.resolve;
  19306. var reject = dfd.reject;
  19307. promise = dfd.promise();
  19308. }
  19309. var success = options.success;
  19310. options.success = function(resp) {
  19311. if (success) success(resp);
  19312. resolve();
  19313. object.trigger('sync', object, resp, options);
  19314. };
  19315. var error = options.error;
  19316. options.error = function(resp) {
  19317. if (error) error(resp);
  19318. reject();
  19319. object.trigger('error', object, resp, options);
  19320. };
  19321. var next = function(){
  19322. Databases[schema.id].execute([method, object, options]);
  19323. };
  19324. if (!Databases[schema.id]) {
  19325. Databases[schema.id] = new ExecutionQueue(schema,next,schema.nolog);
  19326. } else {
  19327. next();
  19328. }
  19329. return promise;
  19330. };
  19331. Backbone.ajaxSync = Backbone.sync;
  19332. Backbone.sync = sync;
  19333. return { sync: sync, debugLog: debugLog};
  19334. }));
  19335. /**
  19336. * @fileoverview
  19337. * - Using the 'QRCode for Javascript library'
  19338. * - Fixed dataset of 'QRCode for Javascript library' for support full-spec.
  19339. * - this library has no dependencies.
  19340. *
  19341. * @author davidshimjs
  19342. * @see <a href="http://www.d-project.com/" target="_blank">http://www.d-project.com/</a>
  19343. * @see <a href="http://jeromeetienne.github.com/jquery-qrcode/" target="_blank">http://jeromeetienne.github.com/jquery-qrcode/</a>
  19344. */
  19345. var QRCode;
  19346. (function () {
  19347. //---------------------------------------------------------------------
  19348. // QRCode for JavaScript
  19349. //
  19350. // Copyright (c) 2009 Kazuhiko Arase
  19351. //
  19352. // URL: http://www.d-project.com/
  19353. //
  19354. // Licensed under the MIT license:
  19355. // http://www.opensource.org/licenses/mit-license.php
  19356. //
  19357. // The word "QR Code" is registered trademark of
  19358. // DENSO WAVE INCORPORATED
  19359. // http://www.denso-wave.com/qrcode/faqpatent-e.html
  19360. //
  19361. //---------------------------------------------------------------------
  19362. function QR8bitByte(data) {
  19363. this.mode = QRMode.MODE_8BIT_BYTE;
  19364. this.data = data;
  19365. this.parsedData = [];
  19366. // Added to support UTF-8 Characters
  19367. for (var i = 0, l = this.data.length; i < l; i++) {
  19368. var byteArray = [];
  19369. var code = this.data.charCodeAt(i);
  19370. if (code > 0x10000) {
  19371. byteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18);
  19372. byteArray[1] = 0x80 | ((code & 0x3F000) >>> 12);
  19373. byteArray[2] = 0x80 | ((code & 0xFC0) >>> 6);
  19374. byteArray[3] = 0x80 | (code & 0x3F);
  19375. } else if (code > 0x800) {
  19376. byteArray[0] = 0xE0 | ((code & 0xF000) >>> 12);
  19377. byteArray[1] = 0x80 | ((code & 0xFC0) >>> 6);
  19378. byteArray[2] = 0x80 | (code & 0x3F);
  19379. } else if (code > 0x80) {
  19380. byteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6);
  19381. byteArray[1] = 0x80 | (code & 0x3F);
  19382. } else {
  19383. byteArray[0] = code;
  19384. }
  19385. this.parsedData.push(byteArray);
  19386. }
  19387. this.parsedData = Array.prototype.concat.apply([], this.parsedData);
  19388. if (this.parsedData.length != this.data.length) {
  19389. this.parsedData.unshift(191);
  19390. this.parsedData.unshift(187);
  19391. this.parsedData.unshift(239);
  19392. }
  19393. }
  19394. QR8bitByte.prototype = {
  19395. getLength: function (buffer) {
  19396. return this.parsedData.length;
  19397. },
  19398. write: function (buffer) {
  19399. for (var i = 0, l = this.parsedData.length; i < l; i++) {
  19400. buffer.put(this.parsedData[i], 8);
  19401. }
  19402. }
  19403. };
  19404. function QRCodeModel(typeNumber, errorCorrectLevel) {
  19405. this.typeNumber = typeNumber;
  19406. this.errorCorrectLevel = errorCorrectLevel;
  19407. this.modules = null;
  19408. this.moduleCount = 0;
  19409. this.dataCache = null;
  19410. this.dataList = [];
  19411. }
  19412. QRCodeModel.prototype={addData:function(data){var newData=new QR8bitByte(data);this.dataList.push(newData);this.dataCache=null;},isDark:function(row,col){if(row<0||this.moduleCount<=row||col<0||this.moduleCount<=col){throw new Error(row+","+col);}
  19413. return this.modules[row][col];},getModuleCount:function(){return this.moduleCount;},make:function(){this.makeImpl(false,this.getBestMaskPattern());},makeImpl:function(test,maskPattern){this.moduleCount=this.typeNumber*4+17;this.modules=new Array(this.moduleCount);for(var row=0;row<this.moduleCount;row++){this.modules[row]=new Array(this.moduleCount);for(var col=0;col<this.moduleCount;col++){this.modules[row][col]=null;}}
  19414. this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(test,maskPattern);if(this.typeNumber>=7){this.setupTypeNumber(test);}
  19415. if(this.dataCache==null){this.dataCache=QRCodeModel.createData(this.typeNumber,this.errorCorrectLevel,this.dataList);}
  19416. this.mapData(this.dataCache,maskPattern);},setupPositionProbePattern:function(row,col){for(var r=-1;r<=7;r++){if(row+r<=-1||this.moduleCount<=row+r)continue;for(var c=-1;c<=7;c++){if(col+c<=-1||this.moduleCount<=col+c)continue;if((0<=r&&r<=6&&(c==0||c==6))||(0<=c&&c<=6&&(r==0||r==6))||(2<=r&&r<=4&&2<=c&&c<=4)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}},getBestMaskPattern:function(){var minLostPoint=0;var pattern=0;for(var i=0;i<8;i++){this.makeImpl(true,i);var lostPoint=QRUtil.getLostPoint(this);if(i==0||minLostPoint>lostPoint){minLostPoint=lostPoint;pattern=i;}}
  19417. return pattern;},createMovieClip:function(target_mc,instance_name,depth){var qr_mc=target_mc.createEmptyMovieClip(instance_name,depth);var cs=1;this.make();for(var row=0;row<this.modules.length;row++){var y=row*cs;for(var col=0;col<this.modules[row].length;col++){var x=col*cs;var dark=this.modules[row][col];if(dark){qr_mc.beginFill(0,100);qr_mc.moveTo(x,y);qr_mc.lineTo(x+cs,y);qr_mc.lineTo(x+cs,y+cs);qr_mc.lineTo(x,y+cs);qr_mc.endFill();}}}
  19418. return qr_mc;},setupTimingPattern:function(){for(var r=8;r<this.moduleCount-8;r++){if(this.modules[r][6]!=null){continue;}
  19419. this.modules[r][6]=(r%2==0);}
  19420. for(var c=8;c<this.moduleCount-8;c++){if(this.modules[6][c]!=null){continue;}
  19421. this.modules[6][c]=(c%2==0);}},setupPositionAdjustPattern:function(){var pos=QRUtil.getPatternPosition(this.typeNumber);for(var i=0;i<pos.length;i++){for(var j=0;j<pos.length;j++){var row=pos[i];var col=pos[j];if(this.modules[row][col]!=null){continue;}
  19422. for(var r=-2;r<=2;r++){for(var c=-2;c<=2;c++){if(r==-2||r==2||c==-2||c==2||(r==0&&c==0)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}}}},setupTypeNumber:function(test){var bits=QRUtil.getBCHTypeNumber(this.typeNumber);for(var i=0;i<18;i++){var mod=(!test&&((bits>>i)&1)==1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=mod;}
  19423. for(var i=0;i<18;i++){var mod=(!test&&((bits>>i)&1)==1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=mod;}},setupTypeInfo:function(test,maskPattern){var data=(this.errorCorrectLevel<<3)|maskPattern;var bits=QRUtil.getBCHTypeInfo(data);for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<6){this.modules[i][8]=mod;}else if(i<8){this.modules[i+1][8]=mod;}else{this.modules[this.moduleCount-15+i][8]=mod;}}
  19424. for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<8){this.modules[8][this.moduleCount-i-1]=mod;}else if(i<9){this.modules[8][15-i-1+1]=mod;}else{this.modules[8][15-i-1]=mod;}}
  19425. this.modules[this.moduleCount-8][8]=(!test);},mapData:function(data,maskPattern){var inc=-1;var row=this.moduleCount-1;var bitIndex=7;var byteIndex=0;for(var col=this.moduleCount-1;col>0;col-=2){if(col==6)col--;while(true){for(var c=0;c<2;c++){if(this.modules[row][col-c]==null){var dark=false;if(byteIndex<data.length){dark=(((data[byteIndex]>>>bitIndex)&1)==1);}
  19426. var mask=QRUtil.getMask(maskPattern,row,col-c);if(mask){dark=!dark;}
  19427. this.modules[row][col-c]=dark;bitIndex--;if(bitIndex==-1){byteIndex++;bitIndex=7;}}}
  19428. row+=inc;if(row<0||this.moduleCount<=row){row-=inc;inc=-inc;break;}}}}};QRCodeModel.PAD0=0xEC;QRCodeModel.PAD1=0x11;QRCodeModel.createData=function(typeNumber,errorCorrectLevel,dataList){var rsBlocks=QRRSBlock.getRSBlocks(typeNumber,errorCorrectLevel);var buffer=new QRBitBuffer();for(var i=0;i<dataList.length;i++){var data=dataList[i];buffer.put(data.mode,4);buffer.put(data.getLength(),QRUtil.getLengthInBits(data.mode,typeNumber));data.write(buffer);}
  19429. var totalDataCount=0;for(var i=0;i<rsBlocks.length;i++){totalDataCount+=rsBlocks[i].dataCount;}
  19430. if(buffer.getLengthInBits()>totalDataCount*8){throw new Error("code length overflow. ("
  19431. +buffer.getLengthInBits()
  19432. +">"
  19433. +totalDataCount*8
  19434. +")");}
  19435. if(buffer.getLengthInBits()+4<=totalDataCount*8){buffer.put(0,4);}
  19436. while(buffer.getLengthInBits()%8!=0){buffer.putBit(false);}
  19437. while(true){if(buffer.getLengthInBits()>=totalDataCount*8){break;}
  19438. buffer.put(QRCodeModel.PAD0,8);if(buffer.getLengthInBits()>=totalDataCount*8){break;}
  19439. buffer.put(QRCodeModel.PAD1,8);}
  19440. return QRCodeModel.createBytes(buffer,rsBlocks);};QRCodeModel.createBytes=function(buffer,rsBlocks){var offset=0;var maxDcCount=0;var maxEcCount=0;var dcdata=new Array(rsBlocks.length);var ecdata=new Array(rsBlocks.length);for(var r=0;r<rsBlocks.length;r++){var dcCount=rsBlocks[r].dataCount;var ecCount=rsBlocks[r].totalCount-dcCount;maxDcCount=Math.max(maxDcCount,dcCount);maxEcCount=Math.max(maxEcCount,ecCount);dcdata[r]=new Array(dcCount);for(var i=0;i<dcdata[r].length;i++){dcdata[r][i]=0xff&buffer.buffer[i+offset];}
  19441. offset+=dcCount;var rsPoly=QRUtil.getErrorCorrectPolynomial(ecCount);var rawPoly=new QRPolynomial(dcdata[r],rsPoly.getLength()-1);var modPoly=rawPoly.mod(rsPoly);ecdata[r]=new Array(rsPoly.getLength()-1);for(var i=0;i<ecdata[r].length;i++){var modIndex=i+modPoly.getLength()-ecdata[r].length;ecdata[r][i]=(modIndex>=0)?modPoly.get(modIndex):0;}}
  19442. var totalCodeCount=0;for(var i=0;i<rsBlocks.length;i++){totalCodeCount+=rsBlocks[i].totalCount;}
  19443. var data=new Array(totalCodeCount);var index=0;for(var i=0;i<maxDcCount;i++){for(var r=0;r<rsBlocks.length;r++){if(i<dcdata[r].length){data[index++]=dcdata[r][i];}}}
  19444. for(var i=0;i<maxEcCount;i++){for(var r=0;r<rsBlocks.length;r++){if(i<ecdata[r].length){data[index++]=ecdata[r][i];}}}
  19445. return data;};var QRMode={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3};var QRErrorCorrectLevel={L:1,M:0,Q:3,H:2};var QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var QRUtil={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:(1<<10)|(1<<8)|(1<<5)|(1<<4)|(1<<2)|(1<<1)|(1<<0),G18:(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8)|(1<<5)|(1<<2)|(1<<0),G15_MASK:(1<<14)|(1<<12)|(1<<10)|(1<<4)|(1<<1),getBCHTypeInfo:function(data){var d=data<<10;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)>=0){d^=(QRUtil.G15<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)));}
  19446. return((data<<10)|d)^QRUtil.G15_MASK;},getBCHTypeNumber:function(data){var d=data<<12;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)>=0){d^=(QRUtil.G18<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)));}
  19447. return(data<<12)|d;},getBCHDigit:function(data){var digit=0;while(data!=0){digit++;data>>>=1;}
  19448. return digit;},getPatternPosition:function(typeNumber){return QRUtil.PATTERN_POSITION_TABLE[typeNumber-1];},getMask:function(maskPattern,i,j){switch(maskPattern){case QRMaskPattern.PATTERN000:return(i+j)%2==0;case QRMaskPattern.PATTERN001:return i%2==0;case QRMaskPattern.PATTERN010:return j%3==0;case QRMaskPattern.PATTERN011:return(i+j)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(i/2)+Math.floor(j/3))%2==0;case QRMaskPattern.PATTERN101:return(i*j)%2+(i*j)%3==0;case QRMaskPattern.PATTERN110:return((i*j)%2+(i*j)%3)%2==0;case QRMaskPattern.PATTERN111:return((i*j)%3+(i+j)%2)%2==0;default:throw new Error("bad maskPattern:"+maskPattern);}},getErrorCorrectPolynomial:function(errorCorrectLength){var a=new QRPolynomial([1],0);for(var i=0;i<errorCorrectLength;i++){a=a.multiply(new QRPolynomial([1,QRMath.gexp(i)],0));}
  19449. return a;},getLengthInBits:function(mode,type){if(1<=type&&type<10){switch(mode){case QRMode.MODE_NUMBER:return 10;case QRMode.MODE_ALPHA_NUM:return 9;case QRMode.MODE_8BIT_BYTE:return 8;case QRMode.MODE_KANJI:return 8;default:throw new Error("mode:"+mode);}}else if(type<27){switch(mode){case QRMode.MODE_NUMBER:return 12;case QRMode.MODE_ALPHA_NUM:return 11;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 10;default:throw new Error("mode:"+mode);}}else if(type<41){switch(mode){case QRMode.MODE_NUMBER:return 14;case QRMode.MODE_ALPHA_NUM:return 13;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 12;default:throw new Error("mode:"+mode);}}else{throw new Error("type:"+type);}},getLostPoint:function(qrCode){var moduleCount=qrCode.getModuleCount();var lostPoint=0;for(var row=0;row<moduleCount;row++){for(var col=0;col<moduleCount;col++){var sameCount=0;var dark=qrCode.isDark(row,col);for(var r=-1;r<=1;r++){if(row+r<0||moduleCount<=row+r){continue;}
  19450. for(var c=-1;c<=1;c++){if(col+c<0||moduleCount<=col+c){continue;}
  19451. if(r==0&&c==0){continue;}
  19452. if(dark==qrCode.isDark(row+r,col+c)){sameCount++;}}}
  19453. if(sameCount>5){lostPoint+=(3+sameCount-5);}}}
  19454. for(var row=0;row<moduleCount-1;row++){for(var col=0;col<moduleCount-1;col++){var count=0;if(qrCode.isDark(row,col))count++;if(qrCode.isDark(row+1,col))count++;if(qrCode.isDark(row,col+1))count++;if(qrCode.isDark(row+1,col+1))count++;if(count==0||count==4){lostPoint+=3;}}}
  19455. for(var row=0;row<moduleCount;row++){for(var col=0;col<moduleCount-6;col++){if(qrCode.isDark(row,col)&&!qrCode.isDark(row,col+1)&&qrCode.isDark(row,col+2)&&qrCode.isDark(row,col+3)&&qrCode.isDark(row,col+4)&&!qrCode.isDark(row,col+5)&&qrCode.isDark(row,col+6)){lostPoint+=40;}}}
  19456. for(var col=0;col<moduleCount;col++){for(var row=0;row<moduleCount-6;row++){if(qrCode.isDark(row,col)&&!qrCode.isDark(row+1,col)&&qrCode.isDark(row+2,col)&&qrCode.isDark(row+3,col)&&qrCode.isDark(row+4,col)&&!qrCode.isDark(row+5,col)&&qrCode.isDark(row+6,col)){lostPoint+=40;}}}
  19457. var darkCount=0;for(var col=0;col<moduleCount;col++){for(var row=0;row<moduleCount;row++){if(qrCode.isDark(row,col)){darkCount++;}}}
  19458. var ratio=Math.abs(100*darkCount/moduleCount/moduleCount-50)/5;lostPoint+=ratio*10;return lostPoint;}};var QRMath={glog:function(n){if(n<1){throw new Error("glog("+n+")");}
  19459. return QRMath.LOG_TABLE[n];},gexp:function(n){while(n<0){n+=255;}
  19460. while(n>=256){n-=255;}
  19461. return QRMath.EXP_TABLE[n];},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var i=0;i<8;i++){QRMath.EXP_TABLE[i]=1<<i;}
  19462. for(var i=8;i<256;i++){QRMath.EXP_TABLE[i]=QRMath.EXP_TABLE[i-4]^QRMath.EXP_TABLE[i-5]^QRMath.EXP_TABLE[i-6]^QRMath.EXP_TABLE[i-8];}
  19463. for(var i=0;i<255;i++){QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]]=i;}
  19464. function QRPolynomial(num,shift){if(num.length==undefined){throw new Error(num.length+"/"+shift);}
  19465. var offset=0;while(offset<num.length&&num[offset]==0){offset++;}
  19466. this.num=new Array(num.length-offset+shift);for(var i=0;i<num.length-offset;i++){this.num[i]=num[i+offset];}}
  19467. QRPolynomial.prototype={get:function(index){return this.num[index];},getLength:function(){return this.num.length;},multiply:function(e){var num=new Array(this.getLength()+e.getLength()-1);for(var i=0;i<this.getLength();i++){for(var j=0;j<e.getLength();j++){num[i+j]^=QRMath.gexp(QRMath.glog(this.get(i))+QRMath.glog(e.get(j)));}}
  19468. return new QRPolynomial(num,0);},mod:function(e){if(this.getLength()-e.getLength()<0){return this;}
  19469. var ratio=QRMath.glog(this.get(0))-QRMath.glog(e.get(0));var num=new Array(this.getLength());for(var i=0;i<this.getLength();i++){num[i]=this.get(i);}
  19470. for(var i=0;i<e.getLength();i++){num[i]^=QRMath.gexp(QRMath.glog(e.get(i))+ratio);}
  19471. return new QRPolynomial(num,0).mod(e);}};function QRRSBlock(totalCount,dataCount){this.totalCount=totalCount;this.dataCount=dataCount;}
  19472. QRRSBlock.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];QRRSBlock.getRSBlocks=function(typeNumber,errorCorrectLevel){var rsBlock=QRRSBlock.getRsBlockTable(typeNumber,errorCorrectLevel);if(rsBlock==undefined){throw new Error("bad rs block @ typeNumber:"+typeNumber+"/errorCorrectLevel:"+errorCorrectLevel);}
  19473. var length=rsBlock.length/3;var list=[];for(var i=0;i<length;i++){var count=rsBlock[i*3+0];var totalCount=rsBlock[i*3+1];var dataCount=rsBlock[i*3+2];for(var j=0;j<count;j++){list.push(new QRRSBlock(totalCount,dataCount));}}
  19474. return list;};QRRSBlock.getRsBlockTable=function(typeNumber,errorCorrectLevel){switch(errorCorrectLevel){case QRErrorCorrectLevel.L:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+0];case QRErrorCorrectLevel.M:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+1];case QRErrorCorrectLevel.Q:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+2];case QRErrorCorrectLevel.H:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+3];default:return undefined;}};function QRBitBuffer(){this.buffer=[];this.length=0;}
  19475. QRBitBuffer.prototype={get:function(index){var bufIndex=Math.floor(index/8);return((this.buffer[bufIndex]>>>(7-index%8))&1)==1;},put:function(num,length){for(var i=0;i<length;i++){this.putBit(((num>>>(length-i-1))&1)==1);}},getLengthInBits:function(){return this.length;},putBit:function(bit){var bufIndex=Math.floor(this.length/8);if(this.buffer.length<=bufIndex){this.buffer.push(0);}
  19476. if(bit){this.buffer[bufIndex]|=(0x80>>>(this.length%8));}
  19477. this.length++;}};var QRCodeLimitLength=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];
  19478. function _isSupportCanvas() {
  19479. return typeof CanvasRenderingContext2D != "undefined";
  19480. }
  19481. // android 2.x doesn't support Data-URI spec
  19482. function _getAndroid() {
  19483. var android = false;
  19484. var sAgent = navigator.userAgent;
  19485. if (/android/i.test(sAgent)) { // android
  19486. android = true;
  19487. aMat = sAgent.toString().match(/android ([0-9]\.[0-9])/i);
  19488. if (aMat && aMat[1]) {
  19489. android = parseFloat(aMat[1]);
  19490. }
  19491. }
  19492. return android;
  19493. }
  19494. var svgDrawer = (function() {
  19495. var Drawing = function (el, htOption) {
  19496. this._el = el;
  19497. this._htOption = htOption;
  19498. };
  19499. Drawing.prototype.draw = function (oQRCode) {
  19500. var _htOption = this._htOption;
  19501. var _el = this._el;
  19502. var nCount = oQRCode.getModuleCount();
  19503. var nWidth = Math.floor(_htOption.width / nCount);
  19504. var nHeight = Math.floor(_htOption.height / nCount);
  19505. this.clear();
  19506. function makeSVG(tag, attrs) {
  19507. var el = document.createElementNS('http://www.w3.org/2000/svg', tag);
  19508. for (var k in attrs)
  19509. if (attrs.hasOwnProperty(k)) el.setAttribute(k, attrs[k]);
  19510. return el;
  19511. }
  19512. var svg = makeSVG("svg" , {'viewBox': '0 0 ' + String(nCount) + " " + String(nCount), 'width': '100%', 'height': '100%', 'fill': _htOption.colorLight});
  19513. svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink");
  19514. _el.appendChild(svg);
  19515. svg.appendChild(makeSVG("rect", {"fill": _htOption.colorDark, "width": "1", "height": "1", "id": "template"}));
  19516. for (var row = 0; row < nCount; row++) {
  19517. for (var col = 0; col < nCount; col++) {
  19518. if (oQRCode.isDark(row, col)) {
  19519. var child = makeSVG("use", {"x": String(row), "y": String(col)});
  19520. child.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#template")
  19521. svg.appendChild(child);
  19522. }
  19523. }
  19524. }
  19525. };
  19526. Drawing.prototype.clear = function () {
  19527. while (this._el.hasChildNodes())
  19528. this._el.removeChild(this._el.lastChild);
  19529. };
  19530. return Drawing;
  19531. })();
  19532. var useSVG = document.documentElement.tagName.toLowerCase() === "svg";
  19533. // Drawing in DOM by using Table tag
  19534. var Drawing = useSVG ? svgDrawer : !_isSupportCanvas() ? (function () {
  19535. var Drawing = function (el, htOption) {
  19536. this._el = el;
  19537. this._htOption = htOption;
  19538. };
  19539. /**
  19540. * Draw the QRCode
  19541. *
  19542. * @param {QRCode} oQRCode
  19543. */
  19544. Drawing.prototype.draw = function (oQRCode) {
  19545. var _htOption = this._htOption;
  19546. var _el = this._el;
  19547. var nCount = oQRCode.getModuleCount();
  19548. var nWidth = Math.floor(_htOption.width / nCount);
  19549. var nHeight = Math.floor(_htOption.height / nCount);
  19550. var aHTML = ['<table style="border:0;border-collapse:collapse;">'];
  19551. for (var row = 0; row < nCount; row++) {
  19552. aHTML.push('<tr>');
  19553. for (var col = 0; col < nCount; col++) {
  19554. aHTML.push('<td style="border:0;border-collapse:collapse;padding:0;margin:0;width:' + nWidth + 'px;height:' + nHeight + 'px;background-color:' + (oQRCode.isDark(row, col) ? _htOption.colorDark : _htOption.colorLight) + ';"></td>');
  19555. }
  19556. aHTML.push('</tr>');
  19557. }
  19558. aHTML.push('</table>');
  19559. _el.innerHTML = aHTML.join('');
  19560. // Fix the margin values as real size.
  19561. var elTable = _el.childNodes[0];
  19562. var nLeftMarginTable = (_htOption.width - elTable.offsetWidth) / 2;
  19563. var nTopMarginTable = (_htOption.height - elTable.offsetHeight) / 2;
  19564. if (nLeftMarginTable > 0 && nTopMarginTable > 0) {
  19565. elTable.style.margin = nTopMarginTable + "px " + nLeftMarginTable + "px";
  19566. }
  19567. };
  19568. /**
  19569. * Clear the QRCode
  19570. */
  19571. Drawing.prototype.clear = function () {
  19572. this._el.innerHTML = '';
  19573. };
  19574. return Drawing;
  19575. })() : (function () { // Drawing in Canvas
  19576. function _onMakeImage() {
  19577. this._elImage.src = this._elCanvas.toDataURL("image/png");
  19578. this._elImage.style.display = "block";
  19579. this._elCanvas.style.display = "none";
  19580. }
  19581. // Android 2.1 bug workaround
  19582. // http://code.google.com/p/android/issues/detail?id=5141
  19583. if (this._android && this._android <= 2.1) {
  19584. var factor = 1 / window.devicePixelRatio;
  19585. var drawImage = CanvasRenderingContext2D.prototype.drawImage;
  19586. CanvasRenderingContext2D.prototype.drawImage = function (image, sx, sy, sw, sh, dx, dy, dw, dh) {
  19587. if (("nodeName" in image) && /img/i.test(image.nodeName)) {
  19588. for (var i = arguments.length - 1; i >= 1; i--) {
  19589. arguments[i] = arguments[i] * factor;
  19590. }
  19591. } else if (typeof dw == "undefined") {
  19592. arguments[1] *= factor;
  19593. arguments[2] *= factor;
  19594. arguments[3] *= factor;
  19595. arguments[4] *= factor;
  19596. }
  19597. drawImage.apply(this, arguments);
  19598. };
  19599. }
  19600. /**
  19601. * Check whether the user's browser supports Data URI or not
  19602. *
  19603. * @private
  19604. * @param {Function} fSuccess Occurs if it supports Data URI
  19605. * @param {Function} fFail Occurs if it doesn't support Data URI
  19606. */
  19607. function _safeSetDataURI(fSuccess, fFail) {
  19608. var self = this;
  19609. self._fFail = fFail;
  19610. self._fSuccess = fSuccess;
  19611. // Check it just once
  19612. if (self._bSupportDataURI === null) {
  19613. var el = document.createElement("img");
  19614. var fOnError = function() {
  19615. self._bSupportDataURI = false;
  19616. if (self._fFail) {
  19617. _fFail.call(self);
  19618. }
  19619. };
  19620. var fOnSuccess = function() {
  19621. self._bSupportDataURI = true;
  19622. if (self._fSuccess) {
  19623. self._fSuccess.call(self);
  19624. }
  19625. };
  19626. el.onabort = fOnError;
  19627. el.onerror = fOnError;
  19628. el.onload = fOnSuccess;
  19629. el.src = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="; // the Image contains 1px data.
  19630. return;
  19631. } else if (self._bSupportDataURI === true && self._fSuccess) {
  19632. self._fSuccess.call(self);
  19633. } else if (self._bSupportDataURI === false && self._fFail) {
  19634. self._fFail.call(self);
  19635. }
  19636. };
  19637. /**
  19638. * Drawing QRCode by using canvas
  19639. *
  19640. * @constructor
  19641. * @param {HTMLElement} el
  19642. * @param {Object} htOption QRCode Options
  19643. */
  19644. var Drawing = function (el, htOption) {
  19645. this._bIsPainted = false;
  19646. this._android = _getAndroid();
  19647. this._htOption = htOption;
  19648. this._elCanvas = document.createElement("canvas");
  19649. this._elCanvas.width = htOption.width;
  19650. this._elCanvas.height = htOption.height;
  19651. el.appendChild(this._elCanvas);
  19652. this._el = el;
  19653. this._oContext = this._elCanvas.getContext("2d");
  19654. this._bIsPainted = false;
  19655. this._elImage = document.createElement("img");
  19656. this._elImage.alt = "Scan me!";
  19657. this._elImage.style.display = "none";
  19658. this._el.appendChild(this._elImage);
  19659. this._bSupportDataURI = null;
  19660. };
  19661. /**
  19662. * Draw the QRCode
  19663. *
  19664. * @param {QRCode} oQRCode
  19665. */
  19666. Drawing.prototype.draw = function (oQRCode) {
  19667. var _elImage = this._elImage;
  19668. var _oContext = this._oContext;
  19669. var _htOption = this._htOption;
  19670. var nCount = oQRCode.getModuleCount();
  19671. var nWidth = _htOption.width / nCount;
  19672. var nHeight = _htOption.height / nCount;
  19673. var nRoundedWidth = Math.round(nWidth);
  19674. var nRoundedHeight = Math.round(nHeight);
  19675. _elImage.style.display = "none";
  19676. this.clear();
  19677. for (var row = 0; row < nCount; row++) {
  19678. for (var col = 0; col < nCount; col++) {
  19679. var bIsDark = oQRCode.isDark(row, col);
  19680. var nLeft = col * nWidth;
  19681. var nTop = row * nHeight;
  19682. _oContext.strokeStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight;
  19683. _oContext.lineWidth = 1;
  19684. _oContext.fillStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight;
  19685. _oContext.fillRect(nLeft, nTop, nWidth, nHeight);
  19686. // 안티 앨리어싱 방지 처리
  19687. _oContext.strokeRect(
  19688. Math.floor(nLeft) + 0.5,
  19689. Math.floor(nTop) + 0.5,
  19690. nRoundedWidth,
  19691. nRoundedHeight
  19692. );
  19693. _oContext.strokeRect(
  19694. Math.ceil(nLeft) - 0.5,
  19695. Math.ceil(nTop) - 0.5,
  19696. nRoundedWidth,
  19697. nRoundedHeight
  19698. );
  19699. }
  19700. }
  19701. this._bIsPainted = true;
  19702. };
  19703. /**
  19704. * Make the image from Canvas if the browser supports Data URI.
  19705. */
  19706. Drawing.prototype.makeImage = function () {
  19707. if (this._bIsPainted) {
  19708. _safeSetDataURI.call(this, _onMakeImage);
  19709. }
  19710. };
  19711. /**
  19712. * Return whether the QRCode is painted or not
  19713. *
  19714. * @return {Boolean}
  19715. */
  19716. Drawing.prototype.isPainted = function () {
  19717. return this._bIsPainted;
  19718. };
  19719. /**
  19720. * Clear the QRCode
  19721. */
  19722. Drawing.prototype.clear = function () {
  19723. this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height);
  19724. this._bIsPainted = false;
  19725. };
  19726. /**
  19727. * @private
  19728. * @param {Number} nNumber
  19729. */
  19730. Drawing.prototype.round = function (nNumber) {
  19731. if (!nNumber) {
  19732. return nNumber;
  19733. }
  19734. return Math.floor(nNumber * 1000) / 1000;
  19735. };
  19736. return Drawing;
  19737. })();
  19738. /**
  19739. * Get the type by string length
  19740. *
  19741. * @private
  19742. * @param {String} sText
  19743. * @param {Number} nCorrectLevel
  19744. * @return {Number} type
  19745. */
  19746. function _getTypeNumber(sText, nCorrectLevel) {
  19747. var nType = 1;
  19748. var length = _getUTF8Length(sText);
  19749. for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) {
  19750. var nLimit = 0;
  19751. switch (nCorrectLevel) {
  19752. case QRErrorCorrectLevel.L :
  19753. nLimit = QRCodeLimitLength[i][0];
  19754. break;
  19755. case QRErrorCorrectLevel.M :
  19756. nLimit = QRCodeLimitLength[i][1];
  19757. break;
  19758. case QRErrorCorrectLevel.Q :
  19759. nLimit = QRCodeLimitLength[i][2];
  19760. break;
  19761. case QRErrorCorrectLevel.H :
  19762. nLimit = QRCodeLimitLength[i][3];
  19763. break;
  19764. }
  19765. if (length <= nLimit) {
  19766. break;
  19767. } else {
  19768. nType++;
  19769. }
  19770. }
  19771. if (nType > QRCodeLimitLength.length) {
  19772. throw new Error("Too long data");
  19773. }
  19774. return nType;
  19775. }
  19776. function _getUTF8Length(sText) {
  19777. var replacedText = encodeURI(sText).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
  19778. return replacedText.length + (replacedText.length != sText ? 3 : 0);
  19779. }
  19780. /**
  19781. * @class QRCode
  19782. * @constructor
  19783. * @example
  19784. * new QRCode(document.getElementById("test"), "http://jindo.dev.naver.com/collie");
  19785. *
  19786. * @example
  19787. * var oQRCode = new QRCode("test", {
  19788. * text : "http://naver.com",
  19789. * width : 128,
  19790. * height : 128
  19791. * });
  19792. *
  19793. * oQRCode.clear(); // Clear the QRCode.
  19794. * oQRCode.makeCode("http://map.naver.com"); // Re-create the QRCode.
  19795. *
  19796. * @param {HTMLElement|String} el target element or 'id' attribute of element.
  19797. * @param {Object|String} vOption
  19798. * @param {String} vOption.text QRCode link data
  19799. * @param {Number} [vOption.width=256]
  19800. * @param {Number} [vOption.height=256]
  19801. * @param {String} [vOption.colorDark="#000000"]
  19802. * @param {String} [vOption.colorLight="#ffffff"]
  19803. * @param {QRCode.CorrectLevel} [vOption.correctLevel=QRCode.CorrectLevel.H] [L|M|Q|H]
  19804. */
  19805. QRCode = function (el, vOption) {
  19806. this._htOption = {
  19807. width : 256,
  19808. height : 256,
  19809. typeNumber : 4,
  19810. colorDark : "#000000",
  19811. colorLight : "#ffffff",
  19812. correctLevel : QRErrorCorrectLevel.H
  19813. };
  19814. if (typeof vOption === 'string') {
  19815. vOption = {
  19816. text : vOption
  19817. };
  19818. }
  19819. // Overwrites options
  19820. if (vOption) {
  19821. for (var i in vOption) {
  19822. this._htOption[i] = vOption[i];
  19823. }
  19824. }
  19825. if (typeof el == "string") {
  19826. el = document.getElementById(el);
  19827. }
  19828. this._android = _getAndroid();
  19829. this._el = el;
  19830. this._oQRCode = null;
  19831. this._oDrawing = new Drawing(this._el, this._htOption);
  19832. if (this._htOption.text) {
  19833. this.makeCode(this._htOption.text);
  19834. }
  19835. };
  19836. /**
  19837. * Make the QRCode
  19838. *
  19839. * @param {String} sText link data
  19840. */
  19841. QRCode.prototype.makeCode = function (sText) {
  19842. this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel);
  19843. this._oQRCode.addData(sText);
  19844. this._oQRCode.make();
  19845. this._el.title = sText;
  19846. this._oDrawing.draw(this._oQRCode);
  19847. this.makeImage();
  19848. };
  19849. /**
  19850. * Make the Image from Canvas element
  19851. * - It occurs automatically
  19852. * - Android below 3 doesn't support Data-URI spec.
  19853. *
  19854. * @private
  19855. */
  19856. QRCode.prototype.makeImage = function () {
  19857. if (typeof this._oDrawing.makeImage == "function" && (!this._android || this._android >= 3)) {
  19858. this._oDrawing.makeImage();
  19859. }
  19860. };
  19861. /**
  19862. * Clear the QRCode
  19863. */
  19864. QRCode.prototype.clear = function () {
  19865. this._oDrawing.clear();
  19866. };
  19867. /**
  19868. * @name QRCode.CorrectLevel
  19869. */
  19870. QRCode.CorrectLevel = QRErrorCorrectLevel;
  19871. })();
  19872. (function(){var $jscomp={scope:{},checkStringArgs:function(a,b,c){if(null==a)throw new TypeError("The 'this' value for String.prototype."+c+" must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype."+c+" must not be a regular expression");return a+""}};
  19873. $jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);
  19874. $jscomp.polyfill=function(a,b,c,d){if(b){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};
  19875. $jscomp.polyfill("String.prototype.repeat",function(a){return a?a:function(a){var b=$jscomp.checkStringArgs(this,null,"repeat");if(0>a||1342177279<a)throw new RangeError("Invalid count value");a|=0;for(var d="";a;)if(a&1&&(d+=b),a>>>=1)b+=b;return d}},"es6-impl","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;
  19876. $jscomp.Symbol=function(a){return $jscomp.SYMBOL_PREFIX+(a||"")+$jscomp.symbolCounter_++};$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};
  19877. $jscomp.arrayIterator=function(a){var b=0;return $jscomp.iteratorPrototype(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})};$jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};$jscomp.array=$jscomp.array||{};
  19878. $jscomp.iteratorFromArray=function(a,b){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var c=0,d={next:function(){if(c<a.length){var e=c++;return{value:b(e,a[e]),done:!1}}d.next=function(){return{done:!0,value:void 0}};return d.next()}};d[Symbol.iterator]=function(){return d};return d};var COMPILED=!0,goog=goog||{};goog.global=this;goog.isDef=function(a){return void 0!==a};
  19879. goog.exportPath_=function(a,b,c){a=a.split(".");c=c||goog.global;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&goog.isDef(b)?c[d]=b:c=c[d]?c[d]:c[d]={}};
  19880. goog.define=function(a,b){var c=b;COMPILED||(goog.global.CLOSURE_UNCOMPILED_DEFINES&&Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_UNCOMPILED_DEFINES,a)?c=goog.global.CLOSURE_UNCOMPILED_DEFINES[a]:goog.global.CLOSURE_DEFINES&&Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_DEFINES,a)&&(c=goog.global.CLOSURE_DEFINES[a]));goog.exportPath_(a,c)};goog.DEBUG=!0;goog.LOCALE="en";goog.TRUSTED_SITE=!0;goog.STRICT_MODE_COMPATIBLE=!1;goog.DISALLOW_TEST_ONLY_CODE=COMPILED&&!goog.DEBUG;
  19881. goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1;goog.provide=function(a){if(goog.isInModuleLoader_())throw Error("goog.provide can not be used within a goog.module.");if(!COMPILED&&goog.isProvided_(a))throw Error('Namespace "'+a+'" already declared.');goog.constructNamespace_(a)};goog.constructNamespace_=function(a,b){if(!COMPILED){delete goog.implicitNamespaces_[a];for(var c=a;(c=c.substring(0,c.lastIndexOf(".")))&&!goog.getObjectByName(c);)goog.implicitNamespaces_[c]=!0}goog.exportPath_(a,b)};
  19882. goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/;
  19883. goog.module=function(a){if(!goog.isString(a)||!a||-1==a.search(goog.VALID_MODULE_RE_))throw Error("Invalid module identifier");if(!goog.isInModuleLoader_())throw Error("Module "+a+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");
  19884. goog.moduleLoaderState_.moduleName=a;if(!COMPILED){if(goog.isProvided_(a))throw Error('Namespace "'+a+'" already declared.');delete goog.implicitNamespaces_[a]}};goog.module.get=function(a){return goog.module.getInternal_(a)};goog.module.getInternal_=function(a){if(!COMPILED)return goog.isProvided_(a)?a in goog.loadedModules_?goog.loadedModules_[a]:goog.getObjectByName(a):null};goog.moduleLoaderState_=null;goog.isInModuleLoader_=function(){return null!=goog.moduleLoaderState_};
  19885. goog.module.declareLegacyNamespace=function(){if(!COMPILED&&!goog.isInModuleLoader_())throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module");if(!COMPILED&&!goog.moduleLoaderState_.moduleName)throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace.");goog.moduleLoaderState_.declareLegacyNamespace=!0};
  19886. goog.setTestOnly=function(a){if(goog.DISALLOW_TEST_ONLY_CODE)throw a=a||"",Error("Importing test-only code into non-debug environment"+(a?": "+a:"."));};goog.forwardDeclare=function(a){};COMPILED||(goog.isProvided_=function(a){return a in goog.loadedModules_||!goog.implicitNamespaces_[a]&&goog.isDefAndNotNull(goog.getObjectByName(a))},goog.implicitNamespaces_={"goog.module":!0});
  19887. goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e;e=c.shift();)if(goog.isDefAndNotNull(d[e]))d=d[e];else return null;return d};goog.globalize=function(a,b){var c=b||goog.global,d;for(d in a)c[d]=a[d]};
  19888. goog.addDependency=function(a,b,c,d){if(goog.DEPENDENCIES_ENABLED){var e;a=a.replace(/\\/g,"/");var f=goog.dependencies_;d&&"boolean"!==typeof d||(d=d?{module:"goog"}:{});for(var g=0;e=b[g];g++)f.nameToPath[e]=a,f.loadFlags[a]=d;for(d=0;b=c[d];d++)a in f.requires||(f.requires[a]={}),f.requires[a][b]=!0}};goog.ENABLE_DEBUG_LOADER=!0;goog.logToConsole_=function(a){goog.global.console&&goog.global.console.error(a)};
  19889. goog.require=function(a){if(!COMPILED){goog.ENABLE_DEBUG_LOADER&&goog.IS_OLD_IE_&&goog.maybeProcessDeferredDep_(a);if(goog.isProvided_(a)){if(goog.isInModuleLoader_())return goog.module.getInternal_(a)}else if(goog.ENABLE_DEBUG_LOADER){var b=goog.getPathFromDeps_(a);if(b)goog.writeScripts_(b);else throw a="goog.require could not find: "+a,goog.logToConsole_(a),Error(a);}return null}};goog.basePath="";goog.nullFunction=function(){};
  19890. goog.abstractMethod=function(){throw Error("unimplemented abstract method");};goog.addSingletonGetter=function(a){a.getInstance=function(){if(a.instance_)return a.instance_;goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=a);return a.instance_=new a}};goog.instantiatedSingletons_=[];goog.LOAD_MODULE_USING_EVAL=!0;goog.SEAL_MODULE_EXPORTS=goog.DEBUG;goog.loadedModules_={};goog.DEPENDENCIES_ENABLED=!COMPILED&&goog.ENABLE_DEBUG_LOADER;goog.TRANSPILE="detect";
  19891. goog.TRANSPILER="transpile.js";
  19892. goog.DEPENDENCIES_ENABLED&&(goog.dependencies_={loadFlags:{},nameToPath:{},requires:{},visited:{},written:{},deferred:{}},goog.inHtmlDocument_=function(){var a=goog.global.document;return null!=a&&"write"in a},goog.findBasePath_=function(){if(goog.isDef(goog.global.CLOSURE_BASE_PATH))goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_())for(var a=goog.global.document.getElementsByTagName("SCRIPT"),b=a.length-1;0<=b;--b){var c=a[b].src,d=c.lastIndexOf("?"),d=-1==d?c.length:d;if("base.js"==
  19893. c.substr(d-7,7)){goog.basePath=c.substr(0,d-7);break}}},goog.importScript_=function(a,b){(goog.global.CLOSURE_IMPORT_SCRIPT||goog.writeScriptTag_)(a,b)&&(goog.dependencies_.written[a]=!0)},goog.IS_OLD_IE_=!(goog.global.atob||!goog.global.document||!goog.global.document.all),goog.importProcessedScript_=function(a,b,c){goog.importScript_("",'goog.retrieveAndExec_("'+a+'", '+b+", "+c+");")},goog.queuedModules_=[],goog.wrapModule_=function(a,b){return goog.LOAD_MODULE_USING_EVAL&&goog.isDef(goog.global.JSON)?
  19894. "goog.loadModule("+goog.global.JSON.stringify(b+"\n//# sourceURL="+a+"\n")+");":'goog.loadModule(function(exports) {"use strict";'+b+"\n;return exports});\n//# sourceURL="+a+"\n"},goog.loadQueuedModules_=function(){var a=goog.queuedModules_.length;if(0<a){var b=goog.queuedModules_;goog.queuedModules_=[];for(var c=0;c<a;c++)goog.maybeProcessDeferredPath_(b[c])}},goog.maybeProcessDeferredDep_=function(a){goog.isDeferredModule_(a)&&goog.allDepsAreAvailable_(a)&&(a=goog.getPathFromDeps_(a),goog.maybeProcessDeferredPath_(goog.basePath+
  19895. a))},goog.isDeferredModule_=function(a){var b=(a=goog.getPathFromDeps_(a))&&goog.dependencies_.loadFlags[a]||{},c=b.lang||"es3";return a&&("goog"==b.module||goog.needsTranspile_(c))?goog.basePath+a in goog.dependencies_.deferred:!1},goog.allDepsAreAvailable_=function(a){if((a=goog.getPathFromDeps_(a))&&a in goog.dependencies_.requires)for(var b in goog.dependencies_.requires[a])if(!goog.isProvided_(b)&&!goog.isDeferredModule_(b))return!1;return!0},goog.maybeProcessDeferredPath_=function(a){if(a in
  19896. goog.dependencies_.deferred){var b=goog.dependencies_.deferred[a];delete goog.dependencies_.deferred[a];goog.globalEval(b)}},goog.loadModuleFromUrl=function(a){goog.retrieveAndExec_(a,!0,!1)},goog.writeScriptSrcNode_=function(a){goog.global.document.write('<script type="text/javascript" src="'+a+'">\x3c/script>')},goog.appendScriptSrcNode_=function(a){var b=goog.global.document,c=b.createElement("script");c.type="text/javascript";c.src=a;c.defer=!1;c.async=!1;b.head.appendChild(c)},goog.writeScriptTag_=
  19897. function(a,b){if(goog.inHtmlDocument_()){var c=goog.global.document;if(!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING&&"complete"==c.readyState){if(/\bdeps.js$/.test(a))return!1;throw Error('Cannot write "'+a+'" after document load');}if(void 0===b)if(goog.IS_OLD_IE_){var d=" onreadystatechange='goog.onScriptLoad_(this, "+ ++goog.lastNonModuleScriptIndex_+")' ";c.write('<script type="text/javascript" src="'+a+'"'+d+">\x3c/script>")}else goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING?goog.appendScriptSrcNode_(a):
  19898. goog.writeScriptSrcNode_(a);else c.write('<script type="text/javascript">'+b+"\x3c/script>");return!0}return!1},goog.needsTranspile_=function(a){if("always"==goog.TRANSPILE)return!0;if("never"==goog.TRANSPILE)return!1;goog.requiresTranspilation_||(goog.requiresTranspilation_=goog.createRequiresTranspilation_());if(a in goog.requiresTranspilation_)return goog.requiresTranspilation_[a];throw Error("Unknown language mode: "+a);},goog.requiresTranspilation_=null,goog.lastNonModuleScriptIndex_=0,goog.onScriptLoad_=
  19899. function(a,b){"complete"==a.readyState&&goog.lastNonModuleScriptIndex_==b&&goog.loadQueuedModules_();return!0},goog.writeScripts_=function(a){function b(a){if(!(a in e.written||a in e.visited)){e.visited[a]=!0;if(a in e.requires)for(var f in e.requires[a])if(!goog.isProvided_(f))if(f in e.nameToPath)b(e.nameToPath[f]);else throw Error("Undefined nameToPath for "+f);a in d||(d[a]=!0,c.push(a))}}var c=[],d={},e=goog.dependencies_;b(a);for(a=0;a<c.length;a++){var f=c[a];goog.dependencies_.written[f]=
  19900. !0}var g=goog.moduleLoaderState_;goog.moduleLoaderState_=null;for(a=0;a<c.length;a++)if(f=c[a]){var h=e.loadFlags[f]||{},k=goog.needsTranspile_(h.lang||"es3");"goog"==h.module||k?goog.importProcessedScript_(goog.basePath+f,"goog"==h.module,k):goog.importScript_(goog.basePath+f)}else throw goog.moduleLoaderState_=g,Error("Undefined script input");goog.moduleLoaderState_=g},goog.getPathFromDeps_=function(a){return a in goog.dependencies_.nameToPath?goog.dependencies_.nameToPath[a]:null},goog.findBasePath_(),
  19901. goog.global.CLOSURE_NO_DEPS||goog.importScript_(goog.basePath+"deps.js"));
  19902. goog.loadModule=function(a){var b=goog.moduleLoaderState_;try{goog.moduleLoaderState_={moduleName:void 0,declareLegacyNamespace:!1};var c;if(goog.isFunction(a))c=a.call(void 0,{});else if(goog.isString(a))c=goog.loadModuleFromSource_.call(void 0,a);else throw Error("Invalid module definition");var d=goog.moduleLoaderState_.moduleName;if(!goog.isString(d)||!d)throw Error('Invalid module name "'+d+'"');goog.moduleLoaderState_.declareLegacyNamespace?goog.constructNamespace_(d,c):goog.SEAL_MODULE_EXPORTS&&
  19903. Object.seal&&goog.isObject(c)&&Object.seal(c);goog.loadedModules_[d]=c}finally{goog.moduleLoaderState_=b}};goog.loadModuleFromSource_=function(a){eval(a);return{}};goog.normalizePath_=function(a){a=a.split("/");for(var b=0;b<a.length;)"."==a[b]?a.splice(b,1):b&&".."==a[b]&&a[b-1]&&".."!=a[b-1]?a.splice(--b,2):b++;return a.join("/")};
  19904. goog.loadFileSync_=function(a){if(goog.global.CLOSURE_LOAD_FILE_SYNC)return goog.global.CLOSURE_LOAD_FILE_SYNC(a);try{var b=new goog.global.XMLHttpRequest;b.open("get",a,!1);b.send();return 0==b.status||200==b.status?b.responseText:null}catch(c){return null}};
  19905. goog.retrieveAndExec_=function(a,b,c){if(!COMPILED){var d=a;a=goog.normalizePath_(a);var e=goog.global.CLOSURE_IMPORT_SCRIPT||goog.writeScriptTag_,f=goog.loadFileSync_(a);if(null==f)throw Error('Load of "'+a+'" failed');c&&(f=goog.transpile_.call(goog.global,f,a));f=b?goog.wrapModule_(a,f):f+("\n//# sourceURL="+a);goog.IS_OLD_IE_?(goog.dependencies_.deferred[d]=f,goog.queuedModules_.push(d)):e(a,f)}};
  19906. goog.transpile_=function(a,b){var c=goog.global.$jscomp;c||(goog.global.$jscomp=c={});var d=c.transpile;if(!d){var e=goog.basePath+goog.TRANSPILER,f=goog.loadFileSync_(e);if(f){eval(f+"\n//# sourceURL="+e);if(goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile;
  19907. c=goog.global.$jscomp;d=c.transpile}}d||(d=c.transpile=function(a,b){goog.logToConsole_(b+" requires transpilation but no transpiler was found.");return a});return d(a,b)};
  19908. goog.typeOf=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
  19909. else if("function"==b&&"undefined"==typeof a.call)return"object";return b};goog.isNull=function(a){return null===a};goog.isDefAndNotNull=function(a){return null!=a};goog.isArray=function(a){return"array"==goog.typeOf(a)};goog.isArrayLike=function(a){var b=goog.typeOf(a);return"array"==b||"object"==b&&"number"==typeof a.length};goog.isDateLike=function(a){return goog.isObject(a)&&"function"==typeof a.getFullYear};goog.isString=function(a){return"string"==typeof a};
  19910. goog.isBoolean=function(a){return"boolean"==typeof a};goog.isNumber=function(a){return"number"==typeof a};goog.isFunction=function(a){return"function"==goog.typeOf(a)};goog.isObject=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b};goog.getUid=function(a){return a[goog.UID_PROPERTY_]||(a[goog.UID_PROPERTY_]=++goog.uidCounter_)};goog.hasUid=function(a){return!!a[goog.UID_PROPERTY_]};
  19911. goog.removeUid=function(a){null!==a&&"removeAttribute"in a&&a.removeAttribute(goog.UID_PROPERTY_);try{delete a[goog.UID_PROPERTY_]}catch(b){}};goog.UID_PROPERTY_="closure_uid_"+(1E9*Math.random()>>>0);goog.uidCounter_=0;goog.getHashCode=goog.getUid;goog.removeHashCode=goog.removeUid;goog.cloneObject=function(a){var b=goog.typeOf(a);if("object"==b||"array"==b){if(a.clone)return a.clone();var b="array"==b?[]:{},c;for(c in a)b[c]=goog.cloneObject(a[c]);return b}return a};
  19912. goog.bindNative_=function(a,b,c){return a.call.apply(a.bind,arguments)};goog.bindJs_=function(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}};
  19913. goog.bind=function(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_;return goog.bind.apply(null,arguments)};goog.partial=function(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}};goog.mixin=function(a,b){for(var c in b)a[c]=b[c]};goog.now=goog.TRUSTED_SITE&&Date.now||function(){return+new Date};
  19914. goog.globalEval=function(a){if(goog.global.execScript)goog.global.execScript(a,"JavaScript");else if(goog.global.eval){if(null==goog.evalWorksForGlobals_)if(goog.global.eval("var _evalTest_ = 1;"),"undefined"!=typeof goog.global._evalTest_){try{delete goog.global._evalTest_}catch(d){}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1;if(goog.evalWorksForGlobals_)goog.global.eval(a);else{var b=goog.global.document,c=b.createElement("SCRIPT");c.type="text/javascript";c.defer=!1;c.appendChild(b.createTextNode(a));
  19915. b.body.appendChild(c);b.body.removeChild(c)}}else throw Error("goog.globalEval not available");};goog.evalWorksForGlobals_=null;
  19916. goog.getCssName=function(a,b){if("."==String(a).charAt(0))throw Error('className passed in goog.getCssName must not start with ".". You passed: '+a);var c=function(a){return goog.cssNameMapping_[a]||a},d=function(a){a=a.split("-");for(var b=[],d=0;d<a.length;d++)b.push(c(a[d]));return b.join("-")},d=goog.cssNameMapping_?"BY_WHOLE"==goog.cssNameMappingStyle_?c:d:function(a){return a},d=b?a+"-"+d(b):d(a);return goog.global.CLOSURE_CSS_NAME_MAP_FN?goog.global.CLOSURE_CSS_NAME_MAP_FN(d):d};
  19917. goog.setCssNameMapping=function(a,b){goog.cssNameMapping_=a;goog.cssNameMappingStyle_=b};!COMPILED&&goog.global.CLOSURE_CSS_NAME_MAPPING&&(goog.cssNameMapping_=goog.global.CLOSURE_CSS_NAME_MAPPING);goog.getMsg=function(a,b){b&&(a=a.replace(/\{\$([^}]+)}/g,function(a,d){return null!=b&&d in b?b[d]:a}));return a};goog.getMsgWithFallback=function(a,b){return a};goog.exportSymbol=function(a,b,c){goog.exportPath_(a,b,c)};goog.exportProperty=function(a,b,c){a[b]=c};
  19918. goog.inherits=function(a,b){function c(){}c.prototype=b.prototype;a.superClass_=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.base=function(a,c,f){for(var d=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];return b.prototype[c].apply(a,d)}};
  19919. goog.base=function(a,b,c){var d=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||goog.DEBUG&&!d)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(d.superClass_){for(var e=Array(arguments.length-1),f=1;f<arguments.length;f++)e[f-1]=arguments[f];return d.superClass_.constructor.apply(a,e)}e=Array(arguments.length-2);for(f=2;f<arguments.length;f++)e[f-2]=arguments[f];for(var f=!1,g=a.constructor;g;g=
  19920. g.superClass_&&g.superClass_.constructor)if(g.prototype[b]===d)f=!0;else if(f)return g.prototype[b].apply(a,e);if(a[b]===d)return a.constructor.prototype[b].apply(a,e);throw Error("goog.base called from a method of one name to a method of a different name");};goog.scope=function(a){if(goog.isInModuleLoader_())throw Error("goog.scope is not supported within a goog.module.");a.call(goog.global)};COMPILED||(goog.global.COMPILED=COMPILED);
  19921. goog.defineClass=function(a,b){var c=b.constructor,d=b.statics;c&&c!=Object.prototype.constructor||(c=function(){throw Error("cannot instantiate an interface (no constructor defined).");});c=goog.defineClass.createSealingConstructor_(c,a);a&&goog.inherits(c,a);delete b.constructor;delete b.statics;goog.defineClass.applyProperties_(c.prototype,b);null!=d&&(d instanceof Function?d(c):goog.defineClass.applyProperties_(c,d));return c};goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG;
  19922. goog.defineClass.createSealingConstructor_=function(a,b){if(!goog.defineClass.SEAL_CLASS_INSTANCES)return a;var c=!goog.defineClass.isUnsealable_(b),d=function(){var b=a.apply(this,arguments)||this;b[goog.UID_PROPERTY_]=b[goog.UID_PROPERTY_];this.constructor===d&&c&&Object.seal instanceof Function&&Object.seal(b);return b};return d};goog.defineClass.isUnsealable_=function(a){return a&&a.prototype&&a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]};goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
  19923. goog.defineClass.applyProperties_=function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c]);for(var d=0;d<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;d++)c=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[d],Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};goog.tagUnsealableClass=function(a){!COMPILED&&goog.defineClass.SEAL_CLASS_INSTANCES&&(a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]=!0)};goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable";
  19924. goog.createRequiresTranspilation_=function(){function a(a,b){d?c[a]=!0:b()?c[a]=!1:d=c[a]=!0}function b(a){try{return!!eval(a)}catch(f){return!1}}var c={es3:!1},d=!1;a("es5",function(){return b("[1,].length==1")});a("es6",function(){return b('(()=>{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()')});
  19925. a("es6-impl",function(){return!0});a("es7",function(){return b("2 ** 2 == 4")});a("es8",function(){return b("async () => 1, true")});return c};goog.debug={};goog.debug.Error=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a));this.reportErrorToServer=!0};goog.inherits(goog.debug.Error,Error);goog.debug.Error.prototype.name="CustomError";goog.dom={};goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};goog.string={};goog.string.DETECT_DOUBLE_ESCAPING=!1;goog.string.FORCE_NON_DOM_HTML_UNESCAPING=!1;goog.string.Unicode={NBSP:"\u00a0"};goog.string.startsWith=function(a,b){return 0==a.lastIndexOf(b,0)};goog.string.endsWith=function(a,b){var c=a.length-b.length;return 0<=c&&a.indexOf(b,c)==c};goog.string.caseInsensitiveStartsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(0,b.length))};
  19926. goog.string.caseInsensitiveEndsWith=function(a,b){return 0==goog.string.caseInsensitiveCompare(b,a.substr(a.length-b.length,b.length))};goog.string.caseInsensitiveEquals=function(a,b){return a.toLowerCase()==b.toLowerCase()};goog.string.subs=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")};goog.string.collapseWhitespace=function(a){return a.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")};
  19927. goog.string.isEmptyOrWhitespace=function(a){return/^[\s\xa0]*$/.test(a)};goog.string.isEmptyString=function(a){return 0==a.length};goog.string.isEmpty=goog.string.isEmptyOrWhitespace;goog.string.isEmptyOrWhitespaceSafe=function(a){return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(a))};goog.string.isEmptySafe=goog.string.isEmptyOrWhitespaceSafe;goog.string.isBreakingWhitespace=function(a){return!/[^\t\n\r ]/.test(a)};goog.string.isAlpha=function(a){return!/[^a-zA-Z]/.test(a)};
  19928. goog.string.isNumeric=function(a){return!/[^0-9]/.test(a)};goog.string.isAlphaNumeric=function(a){return!/[^a-zA-Z0-9]/.test(a)};goog.string.isSpace=function(a){return" "==a};goog.string.isUnicodeChar=function(a){return 1==a.length&&" "<=a&&"~">=a||"\u0080"<=a&&"\ufffd">=a};goog.string.stripNewlines=function(a){return a.replace(/(\r\n|\r|\n)+/g," ")};goog.string.canonicalizeNewlines=function(a){return a.replace(/(\r\n|\r|\n)/g,"\n")};
  19929. goog.string.normalizeWhitespace=function(a){return a.replace(/\xa0|\s/g," ")};goog.string.normalizeSpaces=function(a){return a.replace(/\xa0|[ \t]+/g," ")};goog.string.collapseBreakingSpaces=function(a){return a.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")};goog.string.trim=goog.TRUSTED_SITE&&String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};goog.string.trimLeft=function(a){return a.replace(/^[\s\xa0]+/,"")};
  19930. goog.string.trimRight=function(a){return a.replace(/[\s\xa0]+$/,"")};goog.string.caseInsensitiveCompare=function(a,b){var c=String(a).toLowerCase(),d=String(b).toLowerCase();return c<d?-1:c==d?0:1};
  19931. goog.string.numberAwareCompare_=function(a,b,c){if(a==b)return 0;if(!a)return-1;if(!b)return 1;for(var d=a.toLowerCase().match(c),e=b.toLowerCase().match(c),f=Math.min(d.length,e.length),g=0;g<f;g++){c=d[g];var h=e[g];if(c!=h)return a=parseInt(c,10),!isNaN(a)&&(b=parseInt(h,10),!isNaN(b)&&a-b)?a-b:c<h?-1:1}return d.length!=e.length?d.length-e.length:a<b?-1:1};goog.string.intAwareCompare=function(a,b){return goog.string.numberAwareCompare_(a,b,/\d+|\D+/g)};
  19932. goog.string.floatAwareCompare=function(a,b){return goog.string.numberAwareCompare_(a,b,/\d+|\.\d+|\D+/g)};goog.string.numerateCompare=goog.string.floatAwareCompare;goog.string.urlEncode=function(a){return encodeURIComponent(String(a))};goog.string.urlDecode=function(a){return decodeURIComponent(a.replace(/\+/g," "))};goog.string.newLineToBr=function(a,b){return a.replace(/(\r\n|\r|\n)/g,b?"<br />":"<br>")};
  19933. goog.string.htmlEscape=function(a,b){if(b)a=a.replace(goog.string.AMP_RE_,"&amp;").replace(goog.string.LT_RE_,"&lt;").replace(goog.string.GT_RE_,"&gt;").replace(goog.string.QUOT_RE_,"&quot;").replace(goog.string.SINGLE_QUOTE_RE_,"&#39;").replace(goog.string.NULL_RE_,"&#0;"),goog.string.DETECT_DOUBLE_ESCAPING&&(a=a.replace(goog.string.E_RE_,"&#101;"));else{if(!goog.string.ALL_RE_.test(a))return a;-1!=a.indexOf("&")&&(a=a.replace(goog.string.AMP_RE_,"&amp;"));-1!=a.indexOf("<")&&(a=a.replace(goog.string.LT_RE_,
  19934. "&lt;"));-1!=a.indexOf(">")&&(a=a.replace(goog.string.GT_RE_,"&gt;"));-1!=a.indexOf('"')&&(a=a.replace(goog.string.QUOT_RE_,"&quot;"));-1!=a.indexOf("'")&&(a=a.replace(goog.string.SINGLE_QUOTE_RE_,"&#39;"));-1!=a.indexOf("\x00")&&(a=a.replace(goog.string.NULL_RE_,"&#0;"));goog.string.DETECT_DOUBLE_ESCAPING&&-1!=a.indexOf("e")&&(a=a.replace(goog.string.E_RE_,"&#101;"))}return a};goog.string.AMP_RE_=/&/g;goog.string.LT_RE_=/</g;goog.string.GT_RE_=/>/g;goog.string.QUOT_RE_=/"/g;
  19935. goog.string.SINGLE_QUOTE_RE_=/'/g;goog.string.NULL_RE_=/\x00/g;goog.string.E_RE_=/e/g;goog.string.ALL_RE_=goog.string.DETECT_DOUBLE_ESCAPING?/[\x00&<>"'e]/:/[\x00&<>"']/;goog.string.unescapeEntities=function(a){return goog.string.contains(a,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(a):goog.string.unescapePureXmlEntities_(a):a};
  19936. goog.string.unescapeEntitiesWithDocument=function(a,b){return goog.string.contains(a,"&")?goog.string.unescapeEntitiesUsingDom_(a,b):a};
  19937. goog.string.unescapeEntitiesUsingDom_=function(a,b){var c={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"'},d;d=b?b.createElement("div"):goog.global.document.createElement("div");return a.replace(goog.string.HTML_ENTITY_PATTERN_,function(a,b){var e=c[a];if(e)return e;if("#"==b.charAt(0)){var f=Number("0"+b.substr(1));isNaN(f)||(e=String.fromCharCode(f))}e||(d.innerHTML=a+" ",e=d.firstChild.nodeValue.slice(0,-1));return c[a]=e})};
  19938. goog.string.unescapePureXmlEntities_=function(a){return a.replace(/&([^;]+);/g,function(a,c){switch(c){case "amp":return"&";case "lt":return"<";case "gt":return">";case "quot":return'"';default:if("#"==c.charAt(0)){var b=Number("0"+c.substr(1));if(!isNaN(b))return String.fromCharCode(b)}return a}})};goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g;goog.string.whitespaceEscape=function(a,b){return goog.string.newLineToBr(a.replace(/ /g," &#160;"),b)};
  19939. goog.string.preserveSpaces=function(a){return a.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)};goog.string.stripQuotes=function(a,b){for(var c=b.length,d=0;d<c;d++){var e=1==c?b:b.charAt(d);if(a.charAt(0)==e&&a.charAt(a.length-1)==e)return a.substring(1,a.length-1)}return a};goog.string.truncate=function(a,b,c){c&&(a=goog.string.unescapeEntities(a));a.length>b&&(a=a.substring(0,b-3)+"...");c&&(a=goog.string.htmlEscape(a));return a};
  19940. goog.string.truncateMiddle=function(a,b,c,d){c&&(a=goog.string.unescapeEntities(a));if(d&&a.length>b){d>b&&(d=b);var e=a.length-d;a=a.substring(0,b-d)+"..."+a.substring(e)}else a.length>b&&(d=Math.floor(b/2),e=a.length-d,a=a.substring(0,d+b%2)+"..."+a.substring(e));c&&(a=goog.string.htmlEscape(a));return a};goog.string.specialEscapeChars_={"\x00":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"\\":"\\\\","<":"<"};goog.string.jsEscapeCache_={"'":"\\'"};
  19941. goog.string.quote=function(a){a=String(a);for(var b=['"'],c=0;c<a.length;c++){var d=a.charAt(c),e=d.charCodeAt(0);b[c+1]=goog.string.specialEscapeChars_[d]||(31<e&&127>e?d:goog.string.escapeChar(d))}b.push('"');return b.join("")};goog.string.escapeString=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=goog.string.escapeChar(a.charAt(c));return b.join("")};
  19942. goog.string.escapeChar=function(a){if(a in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[a];if(a in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[a]=goog.string.specialEscapeChars_[a];var b,c=a.charCodeAt(0);if(31<c&&127>c)b=a;else{if(256>c){if(b="\\x",16>c||256<c)b+="0"}else b="\\u",4096>c&&(b+="0");b+=c.toString(16).toUpperCase()}return goog.string.jsEscapeCache_[a]=b};goog.string.contains=function(a,b){return-1!=a.indexOf(b)};
  19943. goog.string.caseInsensitiveContains=function(a,b){return goog.string.contains(a.toLowerCase(),b.toLowerCase())};goog.string.countOf=function(a,b){return a&&b?a.split(b).length-1:0};goog.string.removeAt=function(a,b,c){var d=a;0<=b&&b<a.length&&0<c&&(d=a.substr(0,b)+a.substr(b+c,a.length-b-c));return d};goog.string.remove=function(a,b){return a.replace(b,"")};goog.string.removeAll=function(a,b){var c=new RegExp(goog.string.regExpEscape(b),"g");return a.replace(c,"")};
  19944. goog.string.replaceAll=function(a,b,c){b=new RegExp(goog.string.regExpEscape(b),"g");return a.replace(b,c.replace(/\$/g,"$$$$"))};goog.string.regExpEscape=function(a){return String(a).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")};goog.string.repeat=String.prototype.repeat?function(a,b){return a.repeat(b)}:function(a,b){return Array(b+1).join(a)};
  19945. goog.string.padNumber=function(a,b,c){a=goog.isDef(c)?a.toFixed(c):String(a);c=a.indexOf(".");-1==c&&(c=a.length);return goog.string.repeat("0",Math.max(0,b-c))+a};goog.string.makeSafe=function(a){return null==a?"":String(a)};goog.string.buildString=function(a){return Array.prototype.join.call(arguments,"")};goog.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^goog.now()).toString(36)};
  19946. goog.string.compareVersions=function(a,b){for(var c=0,d=goog.string.trim(String(a)).split("."),e=goog.string.trim(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var h=d[g]||"",k=e[g]||"";do{h=/(\d*)(\D*)(.*)/.exec(h)||["","","",""];k=/(\d*)(\D*)(.*)/.exec(k)||["","","",""];if(0==h[0].length&&0==k[0].length)break;var c=0==h[1].length?0:parseInt(h[1],10),l=0==k[1].length?0:parseInt(k[1],10),c=goog.string.compareElements_(c,l)||goog.string.compareElements_(0==h[2].length,0==k[2].length)||
  19947. goog.string.compareElements_(h[2],k[2]),h=h[3],k=k[3]}while(0==c)}return c};goog.string.compareElements_=function(a,b){return a<b?-1:a>b?1:0};goog.string.hashCode=function(a){for(var b=0,c=0;c<a.length;++c)b=31*b+a.charCodeAt(c)>>>0;return b};goog.string.uniqueStringCounter_=2147483648*Math.random()|0;goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++};goog.string.toNumber=function(a){var b=Number(a);return 0==b&&goog.string.isEmptyOrWhitespace(a)?NaN:b};
  19948. goog.string.isLowerCamelCase=function(a){return/^[a-z]+([A-Z][a-z]*)*$/.test(a)};goog.string.isUpperCamelCase=function(a){return/^([A-Z][a-z]*)+$/.test(a)};goog.string.toCamelCase=function(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};goog.string.toSelectorCase=function(a){return String(a).replace(/([A-Z])/g,"-$1").toLowerCase()};
  19949. goog.string.toTitleCase=function(a,b){var c=goog.isString(b)?goog.string.regExpEscape(b):"\\s";return a.replace(new RegExp("(^"+(c?"|["+c+"]+":"")+")([a-z])","g"),function(a,b,c){return b+c.toUpperCase()})};goog.string.capitalize=function(a){return String(a.charAt(0)).toUpperCase()+String(a.substr(1)).toLowerCase()};goog.string.parseInt=function(a){isFinite(a)&&(a=String(a));return goog.isString(a)?/^\s*-?0x/i.test(a)?parseInt(a,16):parseInt(a,10):NaN};
  19950. goog.string.splitLimit=function(a,b,c){a=a.split(b);for(var d=[];0<c&&a.length;)d.push(a.shift()),c--;a.length&&d.push(a.join(b));return d};goog.string.lastComponent=function(a,b){if(b)"string"==typeof b&&(b=[b]);else return a;for(var c=-1,d=0;d<b.length;d++)if(""!=b[d]){var e=a.lastIndexOf(b[d]);e>c&&(c=e)}return-1==c?a:a.slice(c+1)};
  19951. goog.string.editDistance=function(a,b){var c=[],d=[];if(a==b)return 0;if(!a.length||!b.length)return Math.max(a.length,b.length);for(var e=0;e<b.length+1;e++)c[e]=e;for(e=0;e<a.length;e++){d[0]=e+1;for(var f=0;f<b.length;f++)d[f+1]=Math.min(d[f]+1,c[f+1]+1,c[f]+Number(a[e]!=b[f]));for(f=0;f<c.length;f++)c[f]=d[f]}return d[b.length]};goog.asserts={};goog.asserts.ENABLE_ASSERTS=goog.DEBUG;goog.asserts.AssertionError=function(a,b){b.unshift(a);goog.debug.Error.call(this,goog.string.subs.apply(null,b));b.shift();this.messagePattern=a};goog.inherits(goog.asserts.AssertionError,goog.debug.Error);goog.asserts.AssertionError.prototype.name="AssertionError";goog.asserts.DEFAULT_ERROR_HANDLER=function(a){throw a;};goog.asserts.errorHandler_=goog.asserts.DEFAULT_ERROR_HANDLER;
  19952. goog.asserts.doAssertFailure_=function(a,b,c,d){var e="Assertion failed";if(c)var e=e+(": "+c),f=d;else a&&(e+=": "+a,f=b);a=new goog.asserts.AssertionError(""+e,f||[]);goog.asserts.errorHandler_(a)};goog.asserts.setErrorHandler=function(a){goog.asserts.ENABLE_ASSERTS&&(goog.asserts.errorHandler_=a)};goog.asserts.assert=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!a&&goog.asserts.doAssertFailure_("",null,b,Array.prototype.slice.call(arguments,2));return a};
  19953. goog.asserts.fail=function(a,b){goog.asserts.ENABLE_ASSERTS&&goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1)))};goog.asserts.assertNumber=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isNumber(a)&&goog.asserts.doAssertFailure_("Expected number but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
  19954. goog.asserts.assertString=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isString(a)&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertFunction=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(a)&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
  19955. goog.asserts.assertObject=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isObject(a)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertArray=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isArray(a)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
  19956. goog.asserts.assertBoolean=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(a)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertElement=function(a,b,c){!goog.asserts.ENABLE_ASSERTS||goog.isObject(a)&&a.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
  19957. goog.asserts.assertInstanceof=function(a,b,c,d){!goog.asserts.ENABLE_ASSERTS||a instanceof b||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(b),goog.asserts.getType_(a)],c,Array.prototype.slice.call(arguments,3));return a};goog.asserts.assertObjectPrototypeIsIntact=function(){for(var a in Object.prototype)goog.asserts.fail(a+" should not be enumerable in Object.prototype.")};
  19958. goog.asserts.getType_=function(a){return a instanceof Function?a.displayName||a.name||"unknown type name":a instanceof Object?a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a):null===a?"null":typeof a};goog.array={};goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE;goog.array.ASSUME_NATIVE_FUNCTIONS=!1;goog.array.peek=function(a){return a[a.length-1]};goog.array.last=goog.array.peek;
  19959. goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.indexOf)?function(a,b,c){goog.asserts.assert(null!=a.length);return Array.prototype.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(goog.isString(a))return goog.isString(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1};
  19960. goog.array.lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.lastIndexOf)?function(a,b,c){goog.asserts.assert(null!=a.length);return Array.prototype.lastIndexOf.call(a,b,null==c?a.length-1:c)}:function(a,b,c){c=null==c?a.length-1:c;0>c&&(c=Math.max(0,a.length+c));if(goog.isString(a))return goog.isString(b)&&1==b.length?a.lastIndexOf(b,c):-1;for(;0<=c;c--)if(c in a&&a[c]===b)return c;return-1};
  19961. goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(a,b,c){goog.asserts.assert(null!=a.length);Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)};goog.array.forEachRight=function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,d=d-1;0<=d;--d)d in e&&b.call(c,e[d],d,a)};
  19962. goog.array.filter=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.filter)?function(a,b,c){goog.asserts.assert(null!=a.length);return Array.prototype.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,g=goog.isString(a)?a.split(""):a,h=0;h<d;h++)if(h in g){var k=g[h];b.call(c,k,h,a)&&(e[f++]=k)}return e};
  19963. goog.array.map=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.map)?function(a,b,c){goog.asserts.assert(null!=a.length);return Array.prototype.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),f=goog.isString(a)?a.split(""):a,g=0;g<d;g++)g in f&&(e[g]=b.call(c,f[g],g,a));return e};
  19964. goog.array.reduce=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduce)?function(a,b,c,d){goog.asserts.assert(null!=a.length);d&&(b=goog.bind(b,d));return Array.prototype.reduce.call(a,b,c)}:function(a,b,c,d){var e=c;goog.array.forEach(a,function(c,g){e=b.call(d,e,c,g,a)});return e};
  19965. goog.array.reduceRight=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduceRight)?function(a,b,c,d){goog.asserts.assert(null!=a.length);goog.asserts.assert(null!=b);d&&(b=goog.bind(b,d));return Array.prototype.reduceRight.call(a,b,c)}:function(a,b,c,d){var e=c;goog.array.forEachRight(a,function(c,g){e=b.call(d,e,c,g,a)});return e};
  19966. goog.array.some=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.some)?function(a,b,c){goog.asserts.assert(null!=a.length);return Array.prototype.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return!0;return!1};
  19967. goog.array.every=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.every)?function(a,b,c){goog.asserts.assert(null!=a.length);return Array.prototype.every.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&!b.call(c,e[f],f,a))return!1;return!0};goog.array.count=function(a,b,c){var d=0;goog.array.forEach(a,function(a,f,g){b.call(c,a,f,g)&&++d},c);return d};
  19968. goog.array.find=function(a,b,c){b=goog.array.findIndex(a,b,c);return 0>b?null:goog.isString(a)?a.charAt(b):a[b]};goog.array.findIndex=function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return f;return-1};goog.array.findRight=function(a,b,c){b=goog.array.findIndexRight(a,b,c);return 0>b?null:goog.isString(a)?a.charAt(b):a[b]};
  19969. goog.array.findIndexRight=function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,d=d-1;0<=d;d--)if(d in e&&b.call(c,e[d],d,a))return d;return-1};goog.array.contains=function(a,b){return 0<=goog.array.indexOf(a,b)};goog.array.isEmpty=function(a){return 0==a.length};goog.array.clear=function(a){if(!goog.isArray(a))for(var b=a.length-1;0<=b;b--)delete a[b];a.length=0};goog.array.insert=function(a,b){goog.array.contains(a,b)||a.push(b)};
  19970. goog.array.insertAt=function(a,b,c){goog.array.splice(a,c,0,b)};goog.array.insertArrayAt=function(a,b,c){goog.partial(goog.array.splice,a,c,0).apply(null,b)};goog.array.insertBefore=function(a,b,c){var d;2==arguments.length||0>(d=goog.array.indexOf(a,c))?a.push(b):goog.array.insertAt(a,b,d)};goog.array.remove=function(a,b){var c=goog.array.indexOf(a,b),d;(d=0<=c)&&goog.array.removeAt(a,c);return d};
  19971. goog.array.removeLast=function(a,b){var c=goog.array.lastIndexOf(a,b);return 0<=c?(goog.array.removeAt(a,c),!0):!1};goog.array.removeAt=function(a,b){goog.asserts.assert(null!=a.length);return 1==Array.prototype.splice.call(a,b,1).length};goog.array.removeIf=function(a,b,c){b=goog.array.findIndex(a,b,c);return 0<=b?(goog.array.removeAt(a,b),!0):!1};goog.array.removeAllIf=function(a,b,c){var d=0;goog.array.forEachRight(a,function(e,f){b.call(c,e,f,a)&&goog.array.removeAt(a,f)&&d++});return d};
  19972. goog.array.concat=function(a){return Array.prototype.concat.apply(Array.prototype,arguments)};goog.array.join=function(a){return Array.prototype.concat.apply(Array.prototype,arguments)};goog.array.toArray=function(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]};goog.array.clone=goog.array.toArray;
  19973. goog.array.extend=function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(goog.isArrayLike(d)){var e=a.length||0,f=d.length||0;a.length=e+f;for(var g=0;g<f;g++)a[e+g]=d[g]}else a.push(d)}};goog.array.splice=function(a,b,c,d){goog.asserts.assert(null!=a.length);return Array.prototype.splice.apply(a,goog.array.slice(arguments,1))};
  19974. goog.array.slice=function(a,b,c){goog.asserts.assert(null!=a.length);return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};goog.array.removeDuplicates=function(a,b,c){b=b||a;var d=function(a){return goog.isObject(a)?"o"+goog.getUid(a):(typeof a).charAt(0)+a};c=c||d;for(var d={},e=0,f=0;f<a.length;){var g=a[f++],h=c(g);Object.prototype.hasOwnProperty.call(d,h)||(d[h]=!0,b[e++]=g)}b.length=e};
  19975. goog.array.binarySearch=function(a,b,c){return goog.array.binarySearch_(a,c||goog.array.defaultCompare,!1,b)};goog.array.binarySelect=function(a,b,c){return goog.array.binarySearch_(a,b,!0,void 0,c)};goog.array.binarySearch_=function(a,b,c,d,e){for(var f=0,g=a.length,h;f<g;){var k=f+g>>1,l;l=c?b.call(e,a[k],k,a):b(d,a[k]);0<l?f=k+1:(g=k,h=!l)}return h?f:~f};goog.array.sort=function(a,b){a.sort(b||goog.array.defaultCompare)};
  19976. goog.array.stableSort=function(a,b){for(var c=Array(a.length),d=0;d<a.length;d++)c[d]={index:d,value:a[d]};var e=b||goog.array.defaultCompare;goog.array.sort(c,function(a,b){return e(a.value,b.value)||a.index-b.index});for(d=0;d<a.length;d++)a[d]=c[d].value};goog.array.sortByKey=function(a,b,c){var d=c||goog.array.defaultCompare;goog.array.sort(a,function(a,c){return d(b(a),b(c))})};goog.array.sortObjectsByKey=function(a,b,c){goog.array.sortByKey(a,function(a){return a[b]},c)};
  19977. goog.array.isSorted=function(a,b,c){b=b||goog.array.defaultCompare;for(var d=1;d<a.length;d++){var e=b(a[d-1],a[d]);if(0<e||0==e&&c)return!1}return!0};goog.array.equals=function(a,b,c){if(!goog.isArrayLike(a)||!goog.isArrayLike(b)||a.length!=b.length)return!1;var d=a.length;c=c||goog.array.defaultCompareEquality;for(var e=0;e<d;e++)if(!c(a[e],b[e]))return!1;return!0};
  19978. goog.array.compare3=function(a,b,c){c=c||goog.array.defaultCompare;for(var d=Math.min(a.length,b.length),e=0;e<d;e++){var f=c(a[e],b[e]);if(0!=f)return f}return goog.array.defaultCompare(a.length,b.length)};goog.array.defaultCompare=function(a,b){return a>b?1:a<b?-1:0};goog.array.inverseDefaultCompare=function(a,b){return-goog.array.defaultCompare(a,b)};goog.array.defaultCompareEquality=function(a,b){return a===b};
  19979. goog.array.binaryInsert=function(a,b,c){c=goog.array.binarySearch(a,b,c);return 0>c?(goog.array.insertAt(a,b,-(c+1)),!0):!1};goog.array.binaryRemove=function(a,b,c){b=goog.array.binarySearch(a,b,c);return 0<=b?goog.array.removeAt(a,b):!1};goog.array.bucket=function(a,b,c){for(var d={},e=0;e<a.length;e++){var f=a[e],g=b.call(c,f,e,a);goog.isDef(g)&&(d[g]||(d[g]=[])).push(f)}return d};goog.array.toObject=function(a,b,c){var d={};goog.array.forEach(a,function(e,f){d[b.call(c,e,f,a)]=e});return d};
  19980. goog.array.range=function(a,b,c){var d=[],e=0,f=a;c=c||1;void 0!==b&&(e=a,f=b);if(0>c*(f-e))return[];if(0<c)for(a=e;a<f;a+=c)d.push(a);else for(a=e;a>f;a+=c)d.push(a);return d};goog.array.repeat=function(a,b){for(var c=[],d=0;d<b;d++)c[d]=a;return c};goog.array.flatten=function(a){for(var b=[],c=0;c<arguments.length;c++){var d=arguments[c];if(goog.isArray(d))for(var e=0;e<d.length;e+=8192)for(var f=goog.array.slice(d,e,e+8192),f=goog.array.flatten.apply(null,f),g=0;g<f.length;g++)b.push(f[g]);else b.push(d)}return b};
  19981. goog.array.rotate=function(a,b){goog.asserts.assert(null!=a.length);a.length&&(b%=a.length,0<b?Array.prototype.unshift.apply(a,a.splice(-b,b)):0>b&&Array.prototype.push.apply(a,a.splice(0,-b)));return a};goog.array.moveItem=function(a,b,c){goog.asserts.assert(0<=b&&b<a.length);goog.asserts.assert(0<=c&&c<a.length);b=Array.prototype.splice.call(a,b,1);Array.prototype.splice.call(a,c,0,b[0])};
  19982. goog.array.zip=function(a){if(!arguments.length)return[];for(var b=[],c=arguments[0].length,d=1;d<arguments.length;d++)arguments[d].length<c&&(c=arguments[d].length);for(d=0;d<c;d++){for(var e=[],f=0;f<arguments.length;f++)e.push(arguments[f][d]);b.push(e)}return b};goog.array.shuffle=function(a,b){for(var c=b||Math.random,d=a.length-1;0<d;d--){var e=Math.floor(c()*(d+1)),f=a[d];a[d]=a[e];a[e]=f}};goog.array.copyByIndex=function(a,b){var c=[];goog.array.forEach(b,function(b){c.push(a[b])});return c};
  19983. goog.array.concatMap=function(a,b,c){return goog.array.concat.apply([],goog.array.map(a,b,c))};goog.proto2={};
  19984. goog.proto2.FieldDescriptor=function(a,b,c){this.parent_=a;goog.asserts.assert(goog.string.isNumeric(b));this.tag_=b;this.name_=c.name;this.isPacked_=!!c.packed;this.isRepeated_=!!c.repeated;this.isRequired_=!!c.required;this.fieldType_=c.fieldType;this.nativeType_=c.type;this.deserializationConversionPermitted_=!1;switch(this.fieldType_){case goog.proto2.FieldDescriptor.FieldType.INT64:case goog.proto2.FieldDescriptor.FieldType.UINT64:case goog.proto2.FieldDescriptor.FieldType.FIXED64:case goog.proto2.FieldDescriptor.FieldType.SFIXED64:case goog.proto2.FieldDescriptor.FieldType.SINT64:case goog.proto2.FieldDescriptor.FieldType.FLOAT:case goog.proto2.FieldDescriptor.FieldType.DOUBLE:this.deserializationConversionPermitted_=!0}this.defaultValue_=
  19985. c.defaultValue};goog.proto2.FieldDescriptor.FieldType={DOUBLE:1,FLOAT:2,INT64:3,UINT64:4,INT32:5,FIXED64:6,FIXED32:7,BOOL:8,STRING:9,GROUP:10,MESSAGE:11,BYTES:12,UINT32:13,ENUM:14,SFIXED32:15,SFIXED64:16,SINT32:17,SINT64:18};goog.proto2.FieldDescriptor.prototype.getTag=function(){return this.tag_};goog.proto2.FieldDescriptor.prototype.getContainingType=function(){return this.parent_.prototype.getDescriptor()};goog.proto2.FieldDescriptor.prototype.getName=function(){return this.name_};
  19986. goog.proto2.FieldDescriptor.prototype.getDefaultValue=function(){if(void 0===this.defaultValue_){var a=this.nativeType_;if(a===Boolean)this.defaultValue_=!1;else if(a===Number)this.defaultValue_=0;else if(a===String)this.defaultValue_=this.deserializationConversionPermitted_?"0":"";else return new a}return this.defaultValue_};goog.proto2.FieldDescriptor.prototype.getFieldType=function(){return this.fieldType_};goog.proto2.FieldDescriptor.prototype.getNativeType=function(){return this.nativeType_};
  19987. goog.proto2.FieldDescriptor.prototype.deserializationConversionPermitted=function(){return this.deserializationConversionPermitted_};goog.proto2.FieldDescriptor.prototype.getFieldMessageType=function(){return this.nativeType_.prototype.getDescriptor()};goog.proto2.FieldDescriptor.prototype.isCompositeType=function(){return this.fieldType_==goog.proto2.FieldDescriptor.FieldType.MESSAGE||this.fieldType_==goog.proto2.FieldDescriptor.FieldType.GROUP};goog.proto2.FieldDescriptor.prototype.isPacked=function(){return this.isPacked_};
  19988. goog.proto2.FieldDescriptor.prototype.isRepeated=function(){return this.isRepeated_};goog.proto2.FieldDescriptor.prototype.isRequired=function(){return this.isRequired_};goog.proto2.FieldDescriptor.prototype.isOptional=function(){return!this.isRepeated_&&!this.isRequired_};goog.object={};goog.object.is=function(a,b){return a===b?0!==a||1/a===1/b:a!==a&&b!==b};goog.object.forEach=function(a,b,c){for(var d in a)b.call(c,a[d],d,a)};goog.object.filter=function(a,b,c){var d={},e;for(e in a)b.call(c,a[e],e,a)&&(d[e]=a[e]);return d};goog.object.map=function(a,b,c){var d={},e;for(e in a)d[e]=b.call(c,a[e],e,a);return d};goog.object.some=function(a,b,c){for(var d in a)if(b.call(c,a[d],d,a))return!0;return!1};
  19989. goog.object.every=function(a,b,c){for(var d in a)if(!b.call(c,a[d],d,a))return!1;return!0};goog.object.getCount=function(a){var b=0,c;for(c in a)b++;return b};goog.object.getAnyKey=function(a){for(var b in a)return b};goog.object.getAnyValue=function(a){for(var b in a)return a[b]};goog.object.contains=function(a,b){return goog.object.containsValue(a,b)};goog.object.getValues=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b};
  19990. goog.object.getKeys=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b};goog.object.getValueByKeys=function(a,b){for(var c=goog.isArrayLike(b),d=c?b:arguments,c=c?0:1;c<d.length&&(a=a[d[c]],goog.isDef(a));c++);return a};goog.object.containsKey=function(a,b){return null!==a&&b in a};goog.object.containsValue=function(a,b){for(var c in a)if(a[c]==b)return!0;return!1};goog.object.findKey=function(a,b,c){for(var d in a)if(b.call(c,a[d],d,a))return d};
  19991. goog.object.findValue=function(a,b,c){return(b=goog.object.findKey(a,b,c))&&a[b]};goog.object.isEmpty=function(a){for(var b in a)return!1;return!0};goog.object.clear=function(a){for(var b in a)delete a[b]};goog.object.remove=function(a,b){var c;(c=b in a)&&delete a[b];return c};goog.object.add=function(a,b,c){if(null!==a&&b in a)throw Error('The object already contains the key "'+b+'"');goog.object.set(a,b,c)};goog.object.get=function(a,b,c){return null!==a&&b in a?a[b]:c};
  19992. goog.object.set=function(a,b,c){a[b]=c};goog.object.setIfUndefined=function(a,b,c){return b in a?a[b]:a[b]=c};goog.object.setWithReturnValueIfNotSet=function(a,b,c){if(b in a)return a[b];c=c();return a[b]=c};goog.object.equals=function(a,b){for(var c in a)if(!(c in b)||a[c]!==b[c])return!1;for(c in b)if(!(c in a))return!1;return!0};goog.object.clone=function(a){var b={},c;for(c in a)b[c]=a[c];return b};
  19993. goog.object.unsafeClone=function(a){var b=goog.typeOf(a);if("object"==b||"array"==b){if(goog.isFunction(a.clone))return a.clone();var b="array"==b?[]:{},c;for(c in a)b[c]=goog.object.unsafeClone(a[c]);return b}return a};goog.object.transpose=function(a){var b={},c;for(c in a)b[a[c]]=c;return b};goog.object.PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
  19994. goog.object.extend=function(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<goog.object.PROTOTYPE_FIELDS_.length;f++)c=goog.object.PROTOTYPE_FIELDS_[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};
  19995. goog.object.create=function(a){var b=arguments.length;if(1==b&&goog.isArray(arguments[0]))return goog.object.create.apply(null,arguments[0]);if(b%2)throw Error("Uneven number of arguments");for(var c={},d=0;d<b;d+=2)c[arguments[d]]=arguments[d+1];return c};goog.object.createSet=function(a){var b=arguments.length;if(1==b&&goog.isArray(arguments[0]))return goog.object.createSet.apply(null,arguments[0]);for(var c={},d=0;d<b;d++)c[arguments[d]]=!0;return c};
  19996. goog.object.createImmutableView=function(a){var b=a;Object.isFrozen&&!Object.isFrozen(a)&&(b=Object.create(a),Object.freeze(b));return b};goog.object.isImmutableView=function(a){return!!Object.isFrozen&&Object.isFrozen(a)};goog.proto2.Descriptor=function(a,b,c){this.messageType_=a;this.name_=b.name||null;this.fullName_=b.fullName||null;this.containingType_=b.containingType;this.fields_={};for(a=0;a<c.length;a++)b=c[a],this.fields_[b.getTag()]=b};goog.proto2.Descriptor.prototype.getName=function(){return this.name_};goog.proto2.Descriptor.prototype.getFullName=function(){return this.fullName_};
  19997. goog.proto2.Descriptor.prototype.getContainingType=function(){return this.containingType_?this.containingType_.getDescriptor():null};goog.proto2.Descriptor.prototype.getFields=function(){var a=goog.object.getValues(this.fields_);goog.array.sort(a,function(a,c){return a.getTag()-c.getTag()});return a};goog.proto2.Descriptor.prototype.getFieldsMap=function(){return this.fields_};
  19998. goog.proto2.Descriptor.prototype.findFieldByName=function(a){return goog.object.findValue(this.fields_,function(b,c,d){return b.getName()==a})||null};goog.proto2.Descriptor.prototype.findFieldByTag=function(a){goog.asserts.assert(goog.string.isNumeric(a));return this.fields_[parseInt(a,10)]||null};goog.proto2.Descriptor.prototype.createMessageInstance=function(){return new this.messageType_};goog.proto2.Message=function(){this.values_={};this.fields_=this.getDescriptor().getFieldsMap();this.deserializedFields_=this.lazyDeserializer_=null};goog.proto2.Message.FieldType={DOUBLE:1,FLOAT:2,INT64:3,UINT64:4,INT32:5,FIXED64:6,FIXED32:7,BOOL:8,STRING:9,GROUP:10,MESSAGE:11,BYTES:12,UINT32:13,ENUM:14,SFIXED32:15,SFIXED64:16,SINT32:17,SINT64:18};goog.proto2.Message.prototype.initializeForLazyDeserializer=function(a,b){this.lazyDeserializer_=a;this.values_=b;this.deserializedFields_={}};
  19999. goog.proto2.Message.prototype.setUnknown=function(a,b){goog.asserts.assert(!this.fields_[a],"Field is not unknown in this message");goog.asserts.assert(1<=a,"Tag "+a+' has value "'+b+'" in descriptor '+this.getDescriptor().getName());goog.asserts.assert(null!==b,"Value cannot be null");this.values_[a]=b;this.deserializedFields_&&delete this.deserializedFields_[a]};
  20000. goog.proto2.Message.prototype.forEachUnknown=function(a,b){var c=b||this,d;for(d in this.values_){var e=Number(d);this.fields_[e]||a.call(c,e,this.values_[d])}};goog.proto2.Message.prototype.getDescriptor=goog.abstractMethod;goog.proto2.Message.prototype.has=function(a){goog.asserts.assert(a.getContainingType()==this.getDescriptor(),"The current message does not contain the given field");return this.has$Value(a.getTag())};
  20001. goog.proto2.Message.prototype.arrayOf=function(a){goog.asserts.assert(a.getContainingType()==this.getDescriptor(),"The current message does not contain the given field");return this.array$Values(a.getTag())};goog.proto2.Message.prototype.countOf=function(a){goog.asserts.assert(a.getContainingType()==this.getDescriptor(),"The current message does not contain the given field");return this.count$Values(a.getTag())};
  20002. goog.proto2.Message.prototype.get=function(a,b){goog.asserts.assert(a.getContainingType()==this.getDescriptor(),"The current message does not contain the given field");return this.get$Value(a.getTag(),b)};goog.proto2.Message.prototype.getOrDefault=function(a,b){goog.asserts.assert(a.getContainingType()==this.getDescriptor(),"The current message does not contain the given field");return this.get$ValueOrDefault(a.getTag(),b)};
  20003. goog.proto2.Message.prototype.set=function(a,b){goog.asserts.assert(a.getContainingType()==this.getDescriptor(),"The current message does not contain the given field");this.set$Value(a.getTag(),b)};goog.proto2.Message.prototype.add=function(a,b){goog.asserts.assert(a.getContainingType()==this.getDescriptor(),"The current message does not contain the given field");this.add$Value(a.getTag(),b)};
  20004. goog.proto2.Message.prototype.clear=function(a){goog.asserts.assert(a.getContainingType()==this.getDescriptor(),"The current message does not contain the given field");this.clear$Field(a.getTag())};
  20005. goog.proto2.Message.prototype.equals=function(a){if(!a||this.constructor!=a.constructor)return!1;for(var b=this.getDescriptor().getFields(),c=0;c<b.length;c++){var d=b[c],e=d.getTag();if(this.has$Value(e)!=a.has$Value(e))return!1;if(this.has$Value(e)){var f=d.isCompositeType(),g=this.getValueForTag_(e),e=a.getValueForTag_(e);if(d.isRepeated()){if(g.length!=e.length)return!1;for(d=0;d<g.length;d++){var h=g[d],k=e[d];if(f?!h.equals(k):h!=k)return!1}}else if(f?!g.equals(e):g!=e)return!1}}return!0};
  20006. goog.proto2.Message.prototype.copyFrom=function(a){goog.asserts.assert(this.constructor==a.constructor,"The source message must have the same type.");this!=a&&(this.values_={},this.deserializedFields_&&(this.deserializedFields_={}),this.mergeFrom(a))};
  20007. goog.proto2.Message.prototype.mergeFrom=function(a){goog.asserts.assert(this.constructor==a.constructor,"The source message must have the same type.");for(var b=this.getDescriptor().getFields(),c=0;c<b.length;c++){var d=b[c],e=d.getTag();if(a.has$Value(e)){this.deserializedFields_&&delete this.deserializedFields_[d.getTag()];var f=d.isCompositeType();if(d.isRepeated())for(var d=a.array$Values(e),g=0;g<d.length;g++)this.add$Value(e,f?d[g].clone():d[g]);else d=a.getValueForTag_(e),f?(f=this.getValueForTag_(e))?
  20008. f.mergeFrom(d):this.set$Value(e,d.clone()):this.set$Value(e,d)}}};goog.proto2.Message.prototype.clone=function(){var a=new this.constructor;a.copyFrom(this);return a};
  20009. goog.proto2.Message.prototype.initDefaults=function(a){for(var b=this.getDescriptor().getFields(),c=0;c<b.length;c++){var d=b[c],e=d.getTag(),f=d.isCompositeType();this.has$Value(e)||d.isRepeated()||(f?this.values_[e]=new (d.getNativeType()):a&&(this.values_[e]=d.getDefaultValue()));if(f)if(d.isRepeated())for(d=this.array$Values(e),e=0;e<d.length;e++)d[e].initDefaults(a);else this.get$Value(e).initDefaults(a)}};goog.proto2.Message.prototype.has$Value=function(a){return null!=this.values_[a]};
  20010. goog.proto2.Message.prototype.getValueForTag_=function(a){var b=this.values_[a];return goog.isDefAndNotNull(b)?this.lazyDeserializer_?a in this.deserializedFields_?this.deserializedFields_[a]:(b=this.lazyDeserializer_.deserializeField(this,this.fields_[a],b),this.deserializedFields_[a]=b):b:null};
  20011. goog.proto2.Message.prototype.get$Value=function(a,b){var c=this.getValueForTag_(a);if(this.fields_[a].isRepeated()){var d=b||0;goog.asserts.assert(0<=d&&d<c.length,"Given index %s is out of bounds. Repeated field length: %s",d,c.length);return c[d]}return c};goog.proto2.Message.prototype.get$ValueOrDefault=function(a,b){return this.has$Value(a)?this.get$Value(a,b):this.fields_[a].getDefaultValue()};goog.proto2.Message.prototype.array$Values=function(a){return this.getValueForTag_(a)||[]};
  20012. goog.proto2.Message.prototype.count$Values=function(a){return this.fields_[a].isRepeated()?this.has$Value(a)?this.values_[a].length:0:this.has$Value(a)?1:0};goog.proto2.Message.prototype.set$Value=function(a,b){goog.asserts.ENABLE_ASSERTS&&this.checkFieldType_(this.fields_[a],b);this.values_[a]=b;this.deserializedFields_&&(this.deserializedFields_[a]=b)};
  20013. goog.proto2.Message.prototype.add$Value=function(a,b){goog.asserts.ENABLE_ASSERTS&&this.checkFieldType_(this.fields_[a],b);this.values_[a]||(this.values_[a]=[]);this.values_[a].push(b);this.deserializedFields_&&delete this.deserializedFields_[a]};goog.proto2.Message.prototype.checkFieldType_=function(a,b){a.getFieldType()==goog.proto2.FieldDescriptor.FieldType.ENUM?goog.asserts.assertNumber(b):goog.asserts.assert(Object(b).constructor==a.getNativeType())};
  20014. goog.proto2.Message.prototype.clear$Field=function(a){delete this.values_[a];this.deserializedFields_&&delete this.deserializedFields_[a]};goog.proto2.Message.createDescriptor=function(a,b){var c=[],d=b[0],e;for(e in b)0!=e&&c.push(new goog.proto2.FieldDescriptor(a,e,b[e]));return new goog.proto2.Descriptor(a,d,c)};goog.proto2.Serializer=function(){};goog.proto2.Serializer.DECODE_SYMBOLIC_ENUMS=!1;goog.proto2.Serializer.prototype.serialize=goog.abstractMethod;goog.proto2.Serializer.prototype.getSerializedValue=function(a,b){return a.isCompositeType()?this.serialize(b):goog.isNumber(b)&&!isFinite(b)?b.toString():b};goog.proto2.Serializer.prototype.deserialize=function(a,b){var c=a.createMessageInstance();this.deserializeTo(c,b);goog.asserts.assert(c instanceof goog.proto2.Message);return c};
  20015. goog.proto2.Serializer.prototype.deserializeTo=goog.abstractMethod;
  20016. goog.proto2.Serializer.prototype.getDeserializedValue=function(a,b){if(a.isCompositeType())return b instanceof goog.proto2.Message?b:this.deserialize(a.getFieldMessageType(),b);if(a.getFieldType()==goog.proto2.FieldDescriptor.FieldType.ENUM){if(goog.proto2.Serializer.DECODE_SYMBOLIC_ENUMS&&goog.isString(b)){var c=a.getNativeType();if(c.hasOwnProperty(b))return c[b]}return goog.isString(b)&&goog.proto2.Serializer.INTEGER_REGEX.test(b)&&(c=Number(b),0<c)?c:b}if(!a.deserializationConversionPermitted())return b;
  20017. c=a.getNativeType();if(c===String){if(goog.isNumber(b))return String(b)}else if(c===Number&&goog.isString(b)&&("Infinity"===b||"-Infinity"===b||"NaN"===b||goog.proto2.Serializer.INTEGER_REGEX.test(b)))return Number(b);return b};goog.proto2.Serializer.INTEGER_REGEX=/^-?[0-9]+$/;goog.proto2.LazyDeserializer=function(){};goog.inherits(goog.proto2.LazyDeserializer,goog.proto2.Serializer);goog.proto2.LazyDeserializer.prototype.deserialize=function(a,b){var c=a.createMessageInstance();c.initializeForLazyDeserializer(this,b);goog.asserts.assert(c instanceof goog.proto2.Message);return c};goog.proto2.LazyDeserializer.prototype.deserializeTo=function(a,b){throw Error("Unimplemented");};goog.proto2.LazyDeserializer.prototype.deserializeField=goog.abstractMethod;goog.proto2.PbLiteSerializer=function(){};goog.inherits(goog.proto2.PbLiteSerializer,goog.proto2.LazyDeserializer);goog.proto2.PbLiteSerializer.prototype.zeroIndexing_=!1;goog.proto2.PbLiteSerializer.prototype.setZeroIndexed=function(a){this.zeroIndexing_=a};
  20018. goog.proto2.PbLiteSerializer.prototype.serialize=function(a){for(var b=a.getDescriptor().getFields(),c=[],d=this.zeroIndexing_,e=0;e<b.length;e++){var f=b[e];if(a.has(f)){var g=f.getTag(),g=d?g-1:g;if(f.isRepeated()){c[g]=[];for(var h=0;h<a.countOf(f);h++)c[g][h]=this.getSerializedValue(f,a.get(f,h))}else c[g]=this.getSerializedValue(f,a.get(f))}}a.forEachUnknown(function(a,b){c[d?a-1:a]=b});return c};
  20019. goog.proto2.PbLiteSerializer.prototype.deserializeField=function(a,b,c){if(null==c)return c;if(b.isRepeated()){a=[];goog.asserts.assert(goog.isArray(c),"Value must be array: %s",c);for(var d=0;d<c.length;d++)a[d]=this.getDeserializedValue(b,c[d]);return a}return this.getDeserializedValue(b,c)};
  20020. goog.proto2.PbLiteSerializer.prototype.getSerializedValue=function(a,b){return a.getFieldType()==goog.proto2.FieldDescriptor.FieldType.BOOL?b?1:0:goog.proto2.Serializer.prototype.getSerializedValue.apply(this,arguments)};
  20021. goog.proto2.PbLiteSerializer.prototype.getDeserializedValue=function(a,b){return a.getFieldType()==goog.proto2.FieldDescriptor.FieldType.BOOL?(goog.asserts.assert(goog.isNumber(b)||goog.isBoolean(b),"Value is expected to be a number or boolean"),!!b):goog.proto2.Serializer.prototype.getDeserializedValue.apply(this,arguments)};
  20022. goog.proto2.PbLiteSerializer.prototype.deserialize=function(a,b){var c=b;if(this.zeroIndexing_){var c=[],d;for(d in b)c[parseInt(d,10)+1]=b[d]}return goog.proto2.PbLiteSerializer.superClass_.deserialize.call(this,a,c)};goog.string.StringBuffer=function(a,b){null!=a&&this.append.apply(this,arguments)};goog.string.StringBuffer.prototype.buffer_="";goog.string.StringBuffer.prototype.set=function(a){this.buffer_=""+a};goog.string.StringBuffer.prototype.append=function(a,b,c){this.buffer_+=String(a);if(null!=b)for(var d=1;d<arguments.length;d++)this.buffer_+=arguments[d];return this};goog.string.StringBuffer.prototype.clear=function(){this.buffer_=""};goog.string.StringBuffer.prototype.getLength=function(){return this.buffer_.length};
  20023. goog.string.StringBuffer.prototype.toString=function(){return this.buffer_};/*
  20024. Protocol Buffer 2 Copyright 2008 Google Inc.
  20025. All other code copyright its respective owners.
  20026. Copyright (C) 2010 The Libphonenumber Authors
  20027. Licensed under the Apache License, Version 2.0 (the "License");
  20028. you may not use this file except in compliance with the License.
  20029. You may obtain a copy of the License at
  20030. http://www.apache.org/licenses/LICENSE-2.0
  20031. Unless required by applicable law or agreed to in writing, software
  20032. distributed under the License is distributed on an "AS IS" BASIS,
  20033. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  20034. See the License for the specific language governing permissions and
  20035. limitations under the License.
  20036. */
  20037. var i18n={phonenumbers:{}};i18n.phonenumbers.NumberFormat=function(){goog.proto2.Message.call(this)};goog.inherits(i18n.phonenumbers.NumberFormat,goog.proto2.Message);i18n.phonenumbers.NumberFormat.descriptor_=null;i18n.phonenumbers.NumberFormat.prototype.getPattern=function(){return this.get$Value(1)};i18n.phonenumbers.NumberFormat.prototype.getPatternOrDefault=function(){return this.get$ValueOrDefault(1)};i18n.phonenumbers.NumberFormat.prototype.setPattern=function(a){this.set$Value(1,a)};
  20038. i18n.phonenumbers.NumberFormat.prototype.hasPattern=function(){return this.has$Value(1)};i18n.phonenumbers.NumberFormat.prototype.patternCount=function(){return this.count$Values(1)};i18n.phonenumbers.NumberFormat.prototype.clearPattern=function(){this.clear$Field(1)};i18n.phonenumbers.NumberFormat.prototype.getFormat=function(){return this.get$Value(2)};i18n.phonenumbers.NumberFormat.prototype.getFormatOrDefault=function(){return this.get$ValueOrDefault(2)};
  20039. i18n.phonenumbers.NumberFormat.prototype.setFormat=function(a){this.set$Value(2,a)};i18n.phonenumbers.NumberFormat.prototype.hasFormat=function(){return this.has$Value(2)};i18n.phonenumbers.NumberFormat.prototype.formatCount=function(){return this.count$Values(2)};i18n.phonenumbers.NumberFormat.prototype.clearFormat=function(){this.clear$Field(2)};i18n.phonenumbers.NumberFormat.prototype.getLeadingDigitsPattern=function(a){return this.get$Value(3,a)};
  20040. i18n.phonenumbers.NumberFormat.prototype.getLeadingDigitsPatternOrDefault=function(a){return this.get$ValueOrDefault(3,a)};i18n.phonenumbers.NumberFormat.prototype.addLeadingDigitsPattern=function(a){this.add$Value(3,a)};i18n.phonenumbers.NumberFormat.prototype.leadingDigitsPatternArray=function(){return this.array$Values(3)};i18n.phonenumbers.NumberFormat.prototype.hasLeadingDigitsPattern=function(){return this.has$Value(3)};i18n.phonenumbers.NumberFormat.prototype.leadingDigitsPatternCount=function(){return this.count$Values(3)};
  20041. i18n.phonenumbers.NumberFormat.prototype.clearLeadingDigitsPattern=function(){this.clear$Field(3)};i18n.phonenumbers.NumberFormat.prototype.getNationalPrefixFormattingRule=function(){return this.get$Value(4)};i18n.phonenumbers.NumberFormat.prototype.getNationalPrefixFormattingRuleOrDefault=function(){return this.get$ValueOrDefault(4)};i18n.phonenumbers.NumberFormat.prototype.setNationalPrefixFormattingRule=function(a){this.set$Value(4,a)};
  20042. i18n.phonenumbers.NumberFormat.prototype.hasNationalPrefixFormattingRule=function(){return this.has$Value(4)};i18n.phonenumbers.NumberFormat.prototype.nationalPrefixFormattingRuleCount=function(){return this.count$Values(4)};i18n.phonenumbers.NumberFormat.prototype.clearNationalPrefixFormattingRule=function(){this.clear$Field(4)};i18n.phonenumbers.NumberFormat.prototype.getNationalPrefixOptionalWhenFormatting=function(){return this.get$Value(6)};
  20043. i18n.phonenumbers.NumberFormat.prototype.getNationalPrefixOptionalWhenFormattingOrDefault=function(){return this.get$ValueOrDefault(6)};i18n.phonenumbers.NumberFormat.prototype.setNationalPrefixOptionalWhenFormatting=function(a){this.set$Value(6,a)};i18n.phonenumbers.NumberFormat.prototype.hasNationalPrefixOptionalWhenFormatting=function(){return this.has$Value(6)};i18n.phonenumbers.NumberFormat.prototype.nationalPrefixOptionalWhenFormattingCount=function(){return this.count$Values(6)};
  20044. i18n.phonenumbers.NumberFormat.prototype.clearNationalPrefixOptionalWhenFormatting=function(){this.clear$Field(6)};i18n.phonenumbers.NumberFormat.prototype.getDomesticCarrierCodeFormattingRule=function(){return this.get$Value(5)};i18n.phonenumbers.NumberFormat.prototype.getDomesticCarrierCodeFormattingRuleOrDefault=function(){return this.get$ValueOrDefault(5)};i18n.phonenumbers.NumberFormat.prototype.setDomesticCarrierCodeFormattingRule=function(a){this.set$Value(5,a)};
  20045. i18n.phonenumbers.NumberFormat.prototype.hasDomesticCarrierCodeFormattingRule=function(){return this.has$Value(5)};i18n.phonenumbers.NumberFormat.prototype.domesticCarrierCodeFormattingRuleCount=function(){return this.count$Values(5)};i18n.phonenumbers.NumberFormat.prototype.clearDomesticCarrierCodeFormattingRule=function(){this.clear$Field(5)};i18n.phonenumbers.PhoneNumberDesc=function(){goog.proto2.Message.call(this)};goog.inherits(i18n.phonenumbers.PhoneNumberDesc,goog.proto2.Message);
  20046. i18n.phonenumbers.PhoneNumberDesc.descriptor_=null;i18n.phonenumbers.PhoneNumberDesc.prototype.getNationalNumberPattern=function(){return this.get$Value(2)};i18n.phonenumbers.PhoneNumberDesc.prototype.getNationalNumberPatternOrDefault=function(){return this.get$ValueOrDefault(2)};i18n.phonenumbers.PhoneNumberDesc.prototype.setNationalNumberPattern=function(a){this.set$Value(2,a)};i18n.phonenumbers.PhoneNumberDesc.prototype.hasNationalNumberPattern=function(){return this.has$Value(2)};
  20047. i18n.phonenumbers.PhoneNumberDesc.prototype.nationalNumberPatternCount=function(){return this.count$Values(2)};i18n.phonenumbers.PhoneNumberDesc.prototype.clearNationalNumberPattern=function(){this.clear$Field(2)};i18n.phonenumbers.PhoneNumberDesc.prototype.getPossibleNumberPattern=function(){return this.get$Value(3)};i18n.phonenumbers.PhoneNumberDesc.prototype.getPossibleNumberPatternOrDefault=function(){return this.get$ValueOrDefault(3)};
  20048. i18n.phonenumbers.PhoneNumberDesc.prototype.setPossibleNumberPattern=function(a){this.set$Value(3,a)};i18n.phonenumbers.PhoneNumberDesc.prototype.hasPossibleNumberPattern=function(){return this.has$Value(3)};i18n.phonenumbers.PhoneNumberDesc.prototype.possibleNumberPatternCount=function(){return this.count$Values(3)};i18n.phonenumbers.PhoneNumberDesc.prototype.clearPossibleNumberPattern=function(){this.clear$Field(3)};
  20049. i18n.phonenumbers.PhoneNumberDesc.prototype.getPossibleLength=function(a){return this.get$Value(9,a)};i18n.phonenumbers.PhoneNumberDesc.prototype.getPossibleLengthOrDefault=function(a){return this.get$ValueOrDefault(9,a)};i18n.phonenumbers.PhoneNumberDesc.prototype.addPossibleLength=function(a){this.add$Value(9,a)};i18n.phonenumbers.PhoneNumberDesc.prototype.possibleLengthArray=function(){return this.array$Values(9)};i18n.phonenumbers.PhoneNumberDesc.prototype.hasPossibleLength=function(){return this.has$Value(9)};
  20050. i18n.phonenumbers.PhoneNumberDesc.prototype.possibleLengthCount=function(){return this.count$Values(9)};i18n.phonenumbers.PhoneNumberDesc.prototype.clearPossibleLength=function(){this.clear$Field(9)};i18n.phonenumbers.PhoneNumberDesc.prototype.getPossibleLengthLocalOnly=function(a){return this.get$Value(10,a)};i18n.phonenumbers.PhoneNumberDesc.prototype.getPossibleLengthLocalOnlyOrDefault=function(a){return this.get$ValueOrDefault(10,a)};
  20051. i18n.phonenumbers.PhoneNumberDesc.prototype.addPossibleLengthLocalOnly=function(a){this.add$Value(10,a)};i18n.phonenumbers.PhoneNumberDesc.prototype.possibleLengthLocalOnlyArray=function(){return this.array$Values(10)};i18n.phonenumbers.PhoneNumberDesc.prototype.hasPossibleLengthLocalOnly=function(){return this.has$Value(10)};i18n.phonenumbers.PhoneNumberDesc.prototype.possibleLengthLocalOnlyCount=function(){return this.count$Values(10)};
  20052. i18n.phonenumbers.PhoneNumberDesc.prototype.clearPossibleLengthLocalOnly=function(){this.clear$Field(10)};i18n.phonenumbers.PhoneNumberDesc.prototype.getExampleNumber=function(){return this.get$Value(6)};i18n.phonenumbers.PhoneNumberDesc.prototype.getExampleNumberOrDefault=function(){return this.get$ValueOrDefault(6)};i18n.phonenumbers.PhoneNumberDesc.prototype.setExampleNumber=function(a){this.set$Value(6,a)};i18n.phonenumbers.PhoneNumberDesc.prototype.hasExampleNumber=function(){return this.has$Value(6)};
  20053. i18n.phonenumbers.PhoneNumberDesc.prototype.exampleNumberCount=function(){return this.count$Values(6)};i18n.phonenumbers.PhoneNumberDesc.prototype.clearExampleNumber=function(){this.clear$Field(6)};i18n.phonenumbers.PhoneNumberDesc.prototype.getNationalNumberMatcherData=function(){return this.get$Value(7)};i18n.phonenumbers.PhoneNumberDesc.prototype.getNationalNumberMatcherDataOrDefault=function(){return this.get$ValueOrDefault(7)};
  20054. i18n.phonenumbers.PhoneNumberDesc.prototype.setNationalNumberMatcherData=function(a){this.set$Value(7,a)};i18n.phonenumbers.PhoneNumberDesc.prototype.hasNationalNumberMatcherData=function(){return this.has$Value(7)};i18n.phonenumbers.PhoneNumberDesc.prototype.nationalNumberMatcherDataCount=function(){return this.count$Values(7)};i18n.phonenumbers.PhoneNumberDesc.prototype.clearNationalNumberMatcherData=function(){this.clear$Field(7)};
  20055. i18n.phonenumbers.PhoneNumberDesc.prototype.getPossibleNumberMatcherData=function(){return this.get$Value(8)};i18n.phonenumbers.PhoneNumberDesc.prototype.getPossibleNumberMatcherDataOrDefault=function(){return this.get$ValueOrDefault(8)};i18n.phonenumbers.PhoneNumberDesc.prototype.setPossibleNumberMatcherData=function(a){this.set$Value(8,a)};i18n.phonenumbers.PhoneNumberDesc.prototype.hasPossibleNumberMatcherData=function(){return this.has$Value(8)};
  20056. i18n.phonenumbers.PhoneNumberDesc.prototype.possibleNumberMatcherDataCount=function(){return this.count$Values(8)};i18n.phonenumbers.PhoneNumberDesc.prototype.clearPossibleNumberMatcherData=function(){this.clear$Field(8)};i18n.phonenumbers.PhoneMetadata=function(){goog.proto2.Message.call(this)};goog.inherits(i18n.phonenumbers.PhoneMetadata,goog.proto2.Message);i18n.phonenumbers.PhoneMetadata.descriptor_=null;i18n.phonenumbers.PhoneMetadata.prototype.getGeneralDesc=function(){return this.get$Value(1)};
  20057. i18n.phonenumbers.PhoneMetadata.prototype.getGeneralDescOrDefault=function(){return this.get$ValueOrDefault(1)};i18n.phonenumbers.PhoneMetadata.prototype.setGeneralDesc=function(a){this.set$Value(1,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasGeneralDesc=function(){return this.has$Value(1)};i18n.phonenumbers.PhoneMetadata.prototype.generalDescCount=function(){return this.count$Values(1)};i18n.phonenumbers.PhoneMetadata.prototype.clearGeneralDesc=function(){this.clear$Field(1)};
  20058. i18n.phonenumbers.PhoneMetadata.prototype.getFixedLine=function(){return this.get$Value(2)};i18n.phonenumbers.PhoneMetadata.prototype.getFixedLineOrDefault=function(){return this.get$ValueOrDefault(2)};i18n.phonenumbers.PhoneMetadata.prototype.setFixedLine=function(a){this.set$Value(2,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasFixedLine=function(){return this.has$Value(2)};i18n.phonenumbers.PhoneMetadata.prototype.fixedLineCount=function(){return this.count$Values(2)};
  20059. i18n.phonenumbers.PhoneMetadata.prototype.clearFixedLine=function(){this.clear$Field(2)};i18n.phonenumbers.PhoneMetadata.prototype.getMobile=function(){return this.get$Value(3)};i18n.phonenumbers.PhoneMetadata.prototype.getMobileOrDefault=function(){return this.get$ValueOrDefault(3)};i18n.phonenumbers.PhoneMetadata.prototype.setMobile=function(a){this.set$Value(3,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasMobile=function(){return this.has$Value(3)};
  20060. i18n.phonenumbers.PhoneMetadata.prototype.mobileCount=function(){return this.count$Values(3)};i18n.phonenumbers.PhoneMetadata.prototype.clearMobile=function(){this.clear$Field(3)};i18n.phonenumbers.PhoneMetadata.prototype.getTollFree=function(){return this.get$Value(4)};i18n.phonenumbers.PhoneMetadata.prototype.getTollFreeOrDefault=function(){return this.get$ValueOrDefault(4)};i18n.phonenumbers.PhoneMetadata.prototype.setTollFree=function(a){this.set$Value(4,a)};
  20061. i18n.phonenumbers.PhoneMetadata.prototype.hasTollFree=function(){return this.has$Value(4)};i18n.phonenumbers.PhoneMetadata.prototype.tollFreeCount=function(){return this.count$Values(4)};i18n.phonenumbers.PhoneMetadata.prototype.clearTollFree=function(){this.clear$Field(4)};i18n.phonenumbers.PhoneMetadata.prototype.getPremiumRate=function(){return this.get$Value(5)};i18n.phonenumbers.PhoneMetadata.prototype.getPremiumRateOrDefault=function(){return this.get$ValueOrDefault(5)};
  20062. i18n.phonenumbers.PhoneMetadata.prototype.setPremiumRate=function(a){this.set$Value(5,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasPremiumRate=function(){return this.has$Value(5)};i18n.phonenumbers.PhoneMetadata.prototype.premiumRateCount=function(){return this.count$Values(5)};i18n.phonenumbers.PhoneMetadata.prototype.clearPremiumRate=function(){this.clear$Field(5)};i18n.phonenumbers.PhoneMetadata.prototype.getSharedCost=function(){return this.get$Value(6)};
  20063. i18n.phonenumbers.PhoneMetadata.prototype.getSharedCostOrDefault=function(){return this.get$ValueOrDefault(6)};i18n.phonenumbers.PhoneMetadata.prototype.setSharedCost=function(a){this.set$Value(6,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasSharedCost=function(){return this.has$Value(6)};i18n.phonenumbers.PhoneMetadata.prototype.sharedCostCount=function(){return this.count$Values(6)};i18n.phonenumbers.PhoneMetadata.prototype.clearSharedCost=function(){this.clear$Field(6)};
  20064. i18n.phonenumbers.PhoneMetadata.prototype.getPersonalNumber=function(){return this.get$Value(7)};i18n.phonenumbers.PhoneMetadata.prototype.getPersonalNumberOrDefault=function(){return this.get$ValueOrDefault(7)};i18n.phonenumbers.PhoneMetadata.prototype.setPersonalNumber=function(a){this.set$Value(7,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasPersonalNumber=function(){return this.has$Value(7)};i18n.phonenumbers.PhoneMetadata.prototype.personalNumberCount=function(){return this.count$Values(7)};
  20065. i18n.phonenumbers.PhoneMetadata.prototype.clearPersonalNumber=function(){this.clear$Field(7)};i18n.phonenumbers.PhoneMetadata.prototype.getVoip=function(){return this.get$Value(8)};i18n.phonenumbers.PhoneMetadata.prototype.getVoipOrDefault=function(){return this.get$ValueOrDefault(8)};i18n.phonenumbers.PhoneMetadata.prototype.setVoip=function(a){this.set$Value(8,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasVoip=function(){return this.has$Value(8)};
  20066. i18n.phonenumbers.PhoneMetadata.prototype.voipCount=function(){return this.count$Values(8)};i18n.phonenumbers.PhoneMetadata.prototype.clearVoip=function(){this.clear$Field(8)};i18n.phonenumbers.PhoneMetadata.prototype.getPager=function(){return this.get$Value(21)};i18n.phonenumbers.PhoneMetadata.prototype.getPagerOrDefault=function(){return this.get$ValueOrDefault(21)};i18n.phonenumbers.PhoneMetadata.prototype.setPager=function(a){this.set$Value(21,a)};
  20067. i18n.phonenumbers.PhoneMetadata.prototype.hasPager=function(){return this.has$Value(21)};i18n.phonenumbers.PhoneMetadata.prototype.pagerCount=function(){return this.count$Values(21)};i18n.phonenumbers.PhoneMetadata.prototype.clearPager=function(){this.clear$Field(21)};i18n.phonenumbers.PhoneMetadata.prototype.getUan=function(){return this.get$Value(25)};i18n.phonenumbers.PhoneMetadata.prototype.getUanOrDefault=function(){return this.get$ValueOrDefault(25)};
  20068. i18n.phonenumbers.PhoneMetadata.prototype.setUan=function(a){this.set$Value(25,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasUan=function(){return this.has$Value(25)};i18n.phonenumbers.PhoneMetadata.prototype.uanCount=function(){return this.count$Values(25)};i18n.phonenumbers.PhoneMetadata.prototype.clearUan=function(){this.clear$Field(25)};i18n.phonenumbers.PhoneMetadata.prototype.getEmergency=function(){return this.get$Value(27)};
  20069. i18n.phonenumbers.PhoneMetadata.prototype.getEmergencyOrDefault=function(){return this.get$ValueOrDefault(27)};i18n.phonenumbers.PhoneMetadata.prototype.setEmergency=function(a){this.set$Value(27,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasEmergency=function(){return this.has$Value(27)};i18n.phonenumbers.PhoneMetadata.prototype.emergencyCount=function(){return this.count$Values(27)};i18n.phonenumbers.PhoneMetadata.prototype.clearEmergency=function(){this.clear$Field(27)};
  20070. i18n.phonenumbers.PhoneMetadata.prototype.getVoicemail=function(){return this.get$Value(28)};i18n.phonenumbers.PhoneMetadata.prototype.getVoicemailOrDefault=function(){return this.get$ValueOrDefault(28)};i18n.phonenumbers.PhoneMetadata.prototype.setVoicemail=function(a){this.set$Value(28,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasVoicemail=function(){return this.has$Value(28)};i18n.phonenumbers.PhoneMetadata.prototype.voicemailCount=function(){return this.count$Values(28)};
  20071. i18n.phonenumbers.PhoneMetadata.prototype.clearVoicemail=function(){this.clear$Field(28)};i18n.phonenumbers.PhoneMetadata.prototype.getNoInternationalDialling=function(){return this.get$Value(24)};i18n.phonenumbers.PhoneMetadata.prototype.getNoInternationalDiallingOrDefault=function(){return this.get$ValueOrDefault(24)};i18n.phonenumbers.PhoneMetadata.prototype.setNoInternationalDialling=function(a){this.set$Value(24,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasNoInternationalDialling=function(){return this.has$Value(24)};
  20072. i18n.phonenumbers.PhoneMetadata.prototype.noInternationalDiallingCount=function(){return this.count$Values(24)};i18n.phonenumbers.PhoneMetadata.prototype.clearNoInternationalDialling=function(){this.clear$Field(24)};i18n.phonenumbers.PhoneMetadata.prototype.getId=function(){return this.get$Value(9)};i18n.phonenumbers.PhoneMetadata.prototype.getIdOrDefault=function(){return this.get$ValueOrDefault(9)};i18n.phonenumbers.PhoneMetadata.prototype.setId=function(a){this.set$Value(9,a)};
  20073. i18n.phonenumbers.PhoneMetadata.prototype.hasId=function(){return this.has$Value(9)};i18n.phonenumbers.PhoneMetadata.prototype.idCount=function(){return this.count$Values(9)};i18n.phonenumbers.PhoneMetadata.prototype.clearId=function(){this.clear$Field(9)};i18n.phonenumbers.PhoneMetadata.prototype.getCountryCode=function(){return this.get$Value(10)};i18n.phonenumbers.PhoneMetadata.prototype.getCountryCodeOrDefault=function(){return this.get$ValueOrDefault(10)};
  20074. i18n.phonenumbers.PhoneMetadata.prototype.setCountryCode=function(a){this.set$Value(10,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasCountryCode=function(){return this.has$Value(10)};i18n.phonenumbers.PhoneMetadata.prototype.countryCodeCount=function(){return this.count$Values(10)};i18n.phonenumbers.PhoneMetadata.prototype.clearCountryCode=function(){this.clear$Field(10)};i18n.phonenumbers.PhoneMetadata.prototype.getInternationalPrefix=function(){return this.get$Value(11)};
  20075. i18n.phonenumbers.PhoneMetadata.prototype.getInternationalPrefixOrDefault=function(){return this.get$ValueOrDefault(11)};i18n.phonenumbers.PhoneMetadata.prototype.setInternationalPrefix=function(a){this.set$Value(11,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasInternationalPrefix=function(){return this.has$Value(11)};i18n.phonenumbers.PhoneMetadata.prototype.internationalPrefixCount=function(){return this.count$Values(11)};i18n.phonenumbers.PhoneMetadata.prototype.clearInternationalPrefix=function(){this.clear$Field(11)};
  20076. i18n.phonenumbers.PhoneMetadata.prototype.getPreferredInternationalPrefix=function(){return this.get$Value(17)};i18n.phonenumbers.PhoneMetadata.prototype.getPreferredInternationalPrefixOrDefault=function(){return this.get$ValueOrDefault(17)};i18n.phonenumbers.PhoneMetadata.prototype.setPreferredInternationalPrefix=function(a){this.set$Value(17,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasPreferredInternationalPrefix=function(){return this.has$Value(17)};
  20077. i18n.phonenumbers.PhoneMetadata.prototype.preferredInternationalPrefixCount=function(){return this.count$Values(17)};i18n.phonenumbers.PhoneMetadata.prototype.clearPreferredInternationalPrefix=function(){this.clear$Field(17)};i18n.phonenumbers.PhoneMetadata.prototype.getNationalPrefix=function(){return this.get$Value(12)};i18n.phonenumbers.PhoneMetadata.prototype.getNationalPrefixOrDefault=function(){return this.get$ValueOrDefault(12)};
  20078. i18n.phonenumbers.PhoneMetadata.prototype.setNationalPrefix=function(a){this.set$Value(12,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasNationalPrefix=function(){return this.has$Value(12)};i18n.phonenumbers.PhoneMetadata.prototype.nationalPrefixCount=function(){return this.count$Values(12)};i18n.phonenumbers.PhoneMetadata.prototype.clearNationalPrefix=function(){this.clear$Field(12)};i18n.phonenumbers.PhoneMetadata.prototype.getPreferredExtnPrefix=function(){return this.get$Value(13)};
  20079. i18n.phonenumbers.PhoneMetadata.prototype.getPreferredExtnPrefixOrDefault=function(){return this.get$ValueOrDefault(13)};i18n.phonenumbers.PhoneMetadata.prototype.setPreferredExtnPrefix=function(a){this.set$Value(13,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasPreferredExtnPrefix=function(){return this.has$Value(13)};i18n.phonenumbers.PhoneMetadata.prototype.preferredExtnPrefixCount=function(){return this.count$Values(13)};i18n.phonenumbers.PhoneMetadata.prototype.clearPreferredExtnPrefix=function(){this.clear$Field(13)};
  20080. i18n.phonenumbers.PhoneMetadata.prototype.getNationalPrefixForParsing=function(){return this.get$Value(15)};i18n.phonenumbers.PhoneMetadata.prototype.getNationalPrefixForParsingOrDefault=function(){return this.get$ValueOrDefault(15)};i18n.phonenumbers.PhoneMetadata.prototype.setNationalPrefixForParsing=function(a){this.set$Value(15,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasNationalPrefixForParsing=function(){return this.has$Value(15)};
  20081. i18n.phonenumbers.PhoneMetadata.prototype.nationalPrefixForParsingCount=function(){return this.count$Values(15)};i18n.phonenumbers.PhoneMetadata.prototype.clearNationalPrefixForParsing=function(){this.clear$Field(15)};i18n.phonenumbers.PhoneMetadata.prototype.getNationalPrefixTransformRule=function(){return this.get$Value(16)};i18n.phonenumbers.PhoneMetadata.prototype.getNationalPrefixTransformRuleOrDefault=function(){return this.get$ValueOrDefault(16)};
  20082. i18n.phonenumbers.PhoneMetadata.prototype.setNationalPrefixTransformRule=function(a){this.set$Value(16,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasNationalPrefixTransformRule=function(){return this.has$Value(16)};i18n.phonenumbers.PhoneMetadata.prototype.nationalPrefixTransformRuleCount=function(){return this.count$Values(16)};i18n.phonenumbers.PhoneMetadata.prototype.clearNationalPrefixTransformRule=function(){this.clear$Field(16)};
  20083. i18n.phonenumbers.PhoneMetadata.prototype.getSameMobileAndFixedLinePattern=function(){return this.get$Value(18)};i18n.phonenumbers.PhoneMetadata.prototype.getSameMobileAndFixedLinePatternOrDefault=function(){return this.get$ValueOrDefault(18)};i18n.phonenumbers.PhoneMetadata.prototype.setSameMobileAndFixedLinePattern=function(a){this.set$Value(18,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasSameMobileAndFixedLinePattern=function(){return this.has$Value(18)};
  20084. i18n.phonenumbers.PhoneMetadata.prototype.sameMobileAndFixedLinePatternCount=function(){return this.count$Values(18)};i18n.phonenumbers.PhoneMetadata.prototype.clearSameMobileAndFixedLinePattern=function(){this.clear$Field(18)};i18n.phonenumbers.PhoneMetadata.prototype.getNumberFormat=function(a){return this.get$Value(19,a)};i18n.phonenumbers.PhoneMetadata.prototype.getNumberFormatOrDefault=function(a){return this.get$ValueOrDefault(19,a)};
  20085. i18n.phonenumbers.PhoneMetadata.prototype.addNumberFormat=function(a){this.add$Value(19,a)};i18n.phonenumbers.PhoneMetadata.prototype.numberFormatArray=function(){return this.array$Values(19)};i18n.phonenumbers.PhoneMetadata.prototype.hasNumberFormat=function(){return this.has$Value(19)};i18n.phonenumbers.PhoneMetadata.prototype.numberFormatCount=function(){return this.count$Values(19)};i18n.phonenumbers.PhoneMetadata.prototype.clearNumberFormat=function(){this.clear$Field(19)};
  20086. i18n.phonenumbers.PhoneMetadata.prototype.getIntlNumberFormat=function(a){return this.get$Value(20,a)};i18n.phonenumbers.PhoneMetadata.prototype.getIntlNumberFormatOrDefault=function(a){return this.get$ValueOrDefault(20,a)};i18n.phonenumbers.PhoneMetadata.prototype.addIntlNumberFormat=function(a){this.add$Value(20,a)};i18n.phonenumbers.PhoneMetadata.prototype.intlNumberFormatArray=function(){return this.array$Values(20)};i18n.phonenumbers.PhoneMetadata.prototype.hasIntlNumberFormat=function(){return this.has$Value(20)};
  20087. i18n.phonenumbers.PhoneMetadata.prototype.intlNumberFormatCount=function(){return this.count$Values(20)};i18n.phonenumbers.PhoneMetadata.prototype.clearIntlNumberFormat=function(){this.clear$Field(20)};i18n.phonenumbers.PhoneMetadata.prototype.getMainCountryForCode=function(){return this.get$Value(22)};i18n.phonenumbers.PhoneMetadata.prototype.getMainCountryForCodeOrDefault=function(){return this.get$ValueOrDefault(22)};
  20088. i18n.phonenumbers.PhoneMetadata.prototype.setMainCountryForCode=function(a){this.set$Value(22,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasMainCountryForCode=function(){return this.has$Value(22)};i18n.phonenumbers.PhoneMetadata.prototype.mainCountryForCodeCount=function(){return this.count$Values(22)};i18n.phonenumbers.PhoneMetadata.prototype.clearMainCountryForCode=function(){this.clear$Field(22)};i18n.phonenumbers.PhoneMetadata.prototype.getLeadingDigits=function(){return this.get$Value(23)};
  20089. i18n.phonenumbers.PhoneMetadata.prototype.getLeadingDigitsOrDefault=function(){return this.get$ValueOrDefault(23)};i18n.phonenumbers.PhoneMetadata.prototype.setLeadingDigits=function(a){this.set$Value(23,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasLeadingDigits=function(){return this.has$Value(23)};i18n.phonenumbers.PhoneMetadata.prototype.leadingDigitsCount=function(){return this.count$Values(23)};i18n.phonenumbers.PhoneMetadata.prototype.clearLeadingDigits=function(){this.clear$Field(23)};
  20090. i18n.phonenumbers.PhoneMetadata.prototype.getLeadingZeroPossible=function(){return this.get$Value(26)};i18n.phonenumbers.PhoneMetadata.prototype.getLeadingZeroPossibleOrDefault=function(){return this.get$ValueOrDefault(26)};i18n.phonenumbers.PhoneMetadata.prototype.setLeadingZeroPossible=function(a){this.set$Value(26,a)};i18n.phonenumbers.PhoneMetadata.prototype.hasLeadingZeroPossible=function(){return this.has$Value(26)};i18n.phonenumbers.PhoneMetadata.prototype.leadingZeroPossibleCount=function(){return this.count$Values(26)};
  20091. i18n.phonenumbers.PhoneMetadata.prototype.clearLeadingZeroPossible=function(){this.clear$Field(26)};i18n.phonenumbers.PhoneMetadataCollection=function(){goog.proto2.Message.call(this)};goog.inherits(i18n.phonenumbers.PhoneMetadataCollection,goog.proto2.Message);i18n.phonenumbers.PhoneMetadataCollection.descriptor_=null;i18n.phonenumbers.PhoneMetadataCollection.prototype.getMetadata=function(a){return this.get$Value(1,a)};
  20092. i18n.phonenumbers.PhoneMetadataCollection.prototype.getMetadataOrDefault=function(a){return this.get$ValueOrDefault(1,a)};i18n.phonenumbers.PhoneMetadataCollection.prototype.addMetadata=function(a){this.add$Value(1,a)};i18n.phonenumbers.PhoneMetadataCollection.prototype.metadataArray=function(){return this.array$Values(1)};i18n.phonenumbers.PhoneMetadataCollection.prototype.hasMetadata=function(){return this.has$Value(1)};i18n.phonenumbers.PhoneMetadataCollection.prototype.metadataCount=function(){return this.count$Values(1)};
  20093. i18n.phonenumbers.PhoneMetadataCollection.prototype.clearMetadata=function(){this.clear$Field(1)};
  20094. i18n.phonenumbers.NumberFormat.prototype.getDescriptor=function(){var a=i18n.phonenumbers.NumberFormat.descriptor_;a||(i18n.phonenumbers.NumberFormat.descriptor_=a=goog.proto2.Message.createDescriptor(i18n.phonenumbers.NumberFormat,{0:{name:"NumberFormat",fullName:"i18n.phonenumbers.NumberFormat"},1:{name:"pattern",required:!0,fieldType:goog.proto2.Message.FieldType.STRING,type:String},2:{name:"format",required:!0,fieldType:goog.proto2.Message.FieldType.STRING,type:String},3:{name:"leading_digits_pattern",
  20095. repeated:!0,fieldType:goog.proto2.Message.FieldType.STRING,type:String},4:{name:"national_prefix_formatting_rule",fieldType:goog.proto2.Message.FieldType.STRING,type:String},6:{name:"national_prefix_optional_when_formatting",fieldType:goog.proto2.Message.FieldType.BOOL,type:Boolean},5:{name:"domestic_carrier_code_formatting_rule",fieldType:goog.proto2.Message.FieldType.STRING,type:String}}));return a};i18n.phonenumbers.NumberFormat.getDescriptor=i18n.phonenumbers.NumberFormat.prototype.getDescriptor;
  20096. i18n.phonenumbers.PhoneNumberDesc.prototype.getDescriptor=function(){var a=i18n.phonenumbers.PhoneNumberDesc.descriptor_;a||(i18n.phonenumbers.PhoneNumberDesc.descriptor_=a=goog.proto2.Message.createDescriptor(i18n.phonenumbers.PhoneNumberDesc,{0:{name:"PhoneNumberDesc",fullName:"i18n.phonenumbers.PhoneNumberDesc"},2:{name:"national_number_pattern",fieldType:goog.proto2.Message.FieldType.STRING,type:String},3:{name:"possible_number_pattern",fieldType:goog.proto2.Message.FieldType.STRING,type:String},
  20097. 9:{name:"possible_length",repeated:!0,fieldType:goog.proto2.Message.FieldType.INT32,type:Number},10:{name:"possible_length_local_only",repeated:!0,fieldType:goog.proto2.Message.FieldType.INT32,type:Number},6:{name:"example_number",fieldType:goog.proto2.Message.FieldType.STRING,type:String},7:{name:"national_number_matcher_data",fieldType:goog.proto2.Message.FieldType.BYTES,type:String},8:{name:"possible_number_matcher_data",fieldType:goog.proto2.Message.FieldType.BYTES,type:String}}));return a};
  20098. i18n.phonenumbers.PhoneNumberDesc.getDescriptor=i18n.phonenumbers.PhoneNumberDesc.prototype.getDescriptor;
  20099. i18n.phonenumbers.PhoneMetadata.prototype.getDescriptor=function(){var a=i18n.phonenumbers.PhoneMetadata.descriptor_;a||(i18n.phonenumbers.PhoneMetadata.descriptor_=a=goog.proto2.Message.createDescriptor(i18n.phonenumbers.PhoneMetadata,{0:{name:"PhoneMetadata",fullName:"i18n.phonenumbers.PhoneMetadata"},1:{name:"general_desc",fieldType:goog.proto2.Message.FieldType.MESSAGE,type:i18n.phonenumbers.PhoneNumberDesc},2:{name:"fixed_line",fieldType:goog.proto2.Message.FieldType.MESSAGE,type:i18n.phonenumbers.PhoneNumberDesc},
  20100. 3:{name:"mobile",fieldType:goog.proto2.Message.FieldType.MESSAGE,type:i18n.phonenumbers.PhoneNumberDesc},4:{name:"toll_free",fieldType:goog.proto2.Message.FieldType.MESSAGE,type:i18n.phonenumbers.PhoneNumberDesc},5:{name:"premium_rate",fieldType:goog.proto2.Message.FieldType.MESSAGE,type:i18n.phonenumbers.PhoneNumberDesc},6:{name:"shared_cost",fieldType:goog.proto2.Message.FieldType.MESSAGE,type:i18n.phonenumbers.PhoneNumberDesc},7:{name:"personal_number",fieldType:goog.proto2.Message.FieldType.MESSAGE,
  20101. type:i18n.phonenumbers.PhoneNumberDesc},8:{name:"voip",fieldType:goog.proto2.Message.FieldType.MESSAGE,type:i18n.phonenumbers.PhoneNumberDesc},21:{name:"pager",fieldType:goog.proto2.Message.FieldType.MESSAGE,type:i18n.phonenumbers.PhoneNumberDesc},25:{name:"uan",fieldType:goog.proto2.Message.FieldType.MESSAGE,type:i18n.phonenumbers.PhoneNumberDesc},27:{name:"emergency",fieldType:goog.proto2.Message.FieldType.MESSAGE,type:i18n.phonenumbers.PhoneNumberDesc},28:{name:"voicemail",fieldType:goog.proto2.Message.FieldType.MESSAGE,
  20102. type:i18n.phonenumbers.PhoneNumberDesc},24:{name:"no_international_dialling",fieldType:goog.proto2.Message.FieldType.MESSAGE,type:i18n.phonenumbers.PhoneNumberDesc},9:{name:"id",required:!0,fieldType:goog.proto2.Message.FieldType.STRING,type:String},10:{name:"country_code",fieldType:goog.proto2.Message.FieldType.INT32,type:Number},11:{name:"international_prefix",fieldType:goog.proto2.Message.FieldType.STRING,type:String},17:{name:"preferred_international_prefix",fieldType:goog.proto2.Message.FieldType.STRING,
  20103. type:String},12:{name:"national_prefix",fieldType:goog.proto2.Message.FieldType.STRING,type:String},13:{name:"preferred_extn_prefix",fieldType:goog.proto2.Message.FieldType.STRING,type:String},15:{name:"national_prefix_for_parsing",fieldType:goog.proto2.Message.FieldType.STRING,type:String},16:{name:"national_prefix_transform_rule",fieldType:goog.proto2.Message.FieldType.STRING,type:String},18:{name:"same_mobile_and_fixed_line_pattern",fieldType:goog.proto2.Message.FieldType.BOOL,defaultValue:!1,
  20104. type:Boolean},19:{name:"number_format",repeated:!0,fieldType:goog.proto2.Message.FieldType.MESSAGE,type:i18n.phonenumbers.NumberFormat},20:{name:"intl_number_format",repeated:!0,fieldType:goog.proto2.Message.FieldType.MESSAGE,type:i18n.phonenumbers.NumberFormat},22:{name:"main_country_for_code",fieldType:goog.proto2.Message.FieldType.BOOL,defaultValue:!1,type:Boolean},23:{name:"leading_digits",fieldType:goog.proto2.Message.FieldType.STRING,type:String},26:{name:"leading_zero_possible",fieldType:goog.proto2.Message.FieldType.BOOL,
  20105. defaultValue:!1,type:Boolean}}));return a};i18n.phonenumbers.PhoneMetadata.getDescriptor=i18n.phonenumbers.PhoneMetadata.prototype.getDescriptor;
  20106. i18n.phonenumbers.PhoneMetadataCollection.prototype.getDescriptor=function(){var a=i18n.phonenumbers.PhoneMetadataCollection.descriptor_;a||(i18n.phonenumbers.PhoneMetadataCollection.descriptor_=a=goog.proto2.Message.createDescriptor(i18n.phonenumbers.PhoneMetadataCollection,{0:{name:"PhoneMetadataCollection",fullName:"i18n.phonenumbers.PhoneMetadataCollection"},1:{name:"metadata",repeated:!0,fieldType:goog.proto2.Message.FieldType.MESSAGE,type:i18n.phonenumbers.PhoneMetadata}}));return a};
  20107. i18n.phonenumbers.PhoneMetadataCollection.getDescriptor=i18n.phonenumbers.PhoneMetadataCollection.prototype.getDescriptor;i18n.phonenumbers.PhoneNumber=function(){goog.proto2.Message.call(this)};goog.inherits(i18n.phonenumbers.PhoneNumber,goog.proto2.Message);i18n.phonenumbers.PhoneNumber.prototype.getCountryCode=function(){return this.get$Value(1)};i18n.phonenumbers.PhoneNumber.prototype.getCountryCodeOrDefault=function(){return this.get$ValueOrDefault(1)};i18n.phonenumbers.PhoneNumber.prototype.setCountryCode=function(a){this.set$Value(1,a)};i18n.phonenumbers.PhoneNumber.prototype.hasCountryCode=function(){return this.has$Value(1)};
  20108. i18n.phonenumbers.PhoneNumber.prototype.countryCodeCount=function(){return this.count$Values(1)};i18n.phonenumbers.PhoneNumber.prototype.clearCountryCode=function(){this.clear$Field(1)};i18n.phonenumbers.PhoneNumber.prototype.getNationalNumber=function(){return this.get$Value(2)};i18n.phonenumbers.PhoneNumber.prototype.getNationalNumberOrDefault=function(){return this.get$ValueOrDefault(2)};i18n.phonenumbers.PhoneNumber.prototype.setNationalNumber=function(a){this.set$Value(2,a)};
  20109. i18n.phonenumbers.PhoneNumber.prototype.hasNationalNumber=function(){return this.has$Value(2)};i18n.phonenumbers.PhoneNumber.prototype.nationalNumberCount=function(){return this.count$Values(2)};i18n.phonenumbers.PhoneNumber.prototype.clearNationalNumber=function(){this.clear$Field(2)};i18n.phonenumbers.PhoneNumber.prototype.getExtension=function(){return this.get$Value(3)};i18n.phonenumbers.PhoneNumber.prototype.getExtensionOrDefault=function(){return this.get$ValueOrDefault(3)};
  20110. i18n.phonenumbers.PhoneNumber.prototype.setExtension=function(a){this.set$Value(3,a)};i18n.phonenumbers.PhoneNumber.prototype.hasExtension=function(){return this.has$Value(3)};i18n.phonenumbers.PhoneNumber.prototype.extensionCount=function(){return this.count$Values(3)};i18n.phonenumbers.PhoneNumber.prototype.clearExtension=function(){this.clear$Field(3)};i18n.phonenumbers.PhoneNumber.prototype.getItalianLeadingZero=function(){return this.get$Value(4)};
  20111. i18n.phonenumbers.PhoneNumber.prototype.getItalianLeadingZeroOrDefault=function(){return this.get$ValueOrDefault(4)};i18n.phonenumbers.PhoneNumber.prototype.setItalianLeadingZero=function(a){this.set$Value(4,a)};i18n.phonenumbers.PhoneNumber.prototype.hasItalianLeadingZero=function(){return this.has$Value(4)};i18n.phonenumbers.PhoneNumber.prototype.italianLeadingZeroCount=function(){return this.count$Values(4)};i18n.phonenumbers.PhoneNumber.prototype.clearItalianLeadingZero=function(){this.clear$Field(4)};
  20112. i18n.phonenumbers.PhoneNumber.prototype.getNumberOfLeadingZeros=function(){return this.get$Value(8)};i18n.phonenumbers.PhoneNumber.prototype.getNumberOfLeadingZerosOrDefault=function(){return this.get$ValueOrDefault(8)};i18n.phonenumbers.PhoneNumber.prototype.setNumberOfLeadingZeros=function(a){this.set$Value(8,a)};i18n.phonenumbers.PhoneNumber.prototype.hasNumberOfLeadingZeros=function(){return this.has$Value(8)};i18n.phonenumbers.PhoneNumber.prototype.numberOfLeadingZerosCount=function(){return this.count$Values(8)};
  20113. i18n.phonenumbers.PhoneNumber.prototype.clearNumberOfLeadingZeros=function(){this.clear$Field(8)};i18n.phonenumbers.PhoneNumber.prototype.getRawInput=function(){return this.get$Value(5)};i18n.phonenumbers.PhoneNumber.prototype.getRawInputOrDefault=function(){return this.get$ValueOrDefault(5)};i18n.phonenumbers.PhoneNumber.prototype.setRawInput=function(a){this.set$Value(5,a)};i18n.phonenumbers.PhoneNumber.prototype.hasRawInput=function(){return this.has$Value(5)};
  20114. i18n.phonenumbers.PhoneNumber.prototype.rawInputCount=function(){return this.count$Values(5)};i18n.phonenumbers.PhoneNumber.prototype.clearRawInput=function(){this.clear$Field(5)};i18n.phonenumbers.PhoneNumber.prototype.getCountryCodeSource=function(){return this.get$Value(6)};i18n.phonenumbers.PhoneNumber.prototype.getCountryCodeSourceOrDefault=function(){return this.get$ValueOrDefault(6)};i18n.phonenumbers.PhoneNumber.prototype.setCountryCodeSource=function(a){this.set$Value(6,a)};
  20115. i18n.phonenumbers.PhoneNumber.prototype.hasCountryCodeSource=function(){return this.has$Value(6)};i18n.phonenumbers.PhoneNumber.prototype.countryCodeSourceCount=function(){return this.count$Values(6)};i18n.phonenumbers.PhoneNumber.prototype.clearCountryCodeSource=function(){this.clear$Field(6)};i18n.phonenumbers.PhoneNumber.prototype.getPreferredDomesticCarrierCode=function(){return this.get$Value(7)};i18n.phonenumbers.PhoneNumber.prototype.getPreferredDomesticCarrierCodeOrDefault=function(){return this.get$ValueOrDefault(7)};
  20116. i18n.phonenumbers.PhoneNumber.prototype.setPreferredDomesticCarrierCode=function(a){this.set$Value(7,a)};i18n.phonenumbers.PhoneNumber.prototype.hasPreferredDomesticCarrierCode=function(){return this.has$Value(7)};i18n.phonenumbers.PhoneNumber.prototype.preferredDomesticCarrierCodeCount=function(){return this.count$Values(7)};i18n.phonenumbers.PhoneNumber.prototype.clearPreferredDomesticCarrierCode=function(){this.clear$Field(7)};
  20117. i18n.phonenumbers.PhoneNumber.CountryCodeSource={FROM_NUMBER_WITH_PLUS_SIGN:1,FROM_NUMBER_WITH_IDD:5,FROM_NUMBER_WITHOUT_PLUS_SIGN:10,FROM_DEFAULT_COUNTRY:20};
  20118. i18n.phonenumbers.PhoneNumber.prototype.getDescriptor=function(){i18n.phonenumbers.PhoneNumber.descriptor_||(i18n.phonenumbers.PhoneNumber.descriptor_=goog.proto2.Message.createDescriptor(i18n.phonenumbers.PhoneNumber,{0:{name:"PhoneNumber",fullName:"i18n.phonenumbers.PhoneNumber"},1:{name:"country_code",required:!0,fieldType:goog.proto2.Message.FieldType.INT32,type:Number},2:{name:"national_number",required:!0,fieldType:goog.proto2.Message.FieldType.UINT64,type:Number},3:{name:"extension",fieldType:goog.proto2.Message.FieldType.STRING,
  20119. type:String},4:{name:"italian_leading_zero",fieldType:goog.proto2.Message.FieldType.BOOL,type:Boolean},8:{name:"number_of_leading_zeros",fieldType:goog.proto2.Message.FieldType.INT32,defaultValue:1,type:Number},5:{name:"raw_input",fieldType:goog.proto2.Message.FieldType.STRING,type:String},6:{name:"country_code_source",fieldType:goog.proto2.Message.FieldType.ENUM,defaultValue:i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN,type:i18n.phonenumbers.PhoneNumber.CountryCodeSource},
  20120. 7:{name:"preferred_domestic_carrier_code",fieldType:goog.proto2.Message.FieldType.STRING,type:String}}));return i18n.phonenumbers.PhoneNumber.descriptor_};i18n.phonenumbers.PhoneNumber.ctor=i18n.phonenumbers.PhoneNumber;i18n.phonenumbers.PhoneNumber.ctor.getDescriptor=i18n.phonenumbers.PhoneNumber.prototype.getDescriptor;/*
  20121. Copyright (C) 2010 The Libphonenumber Authors
  20122. Licensed under the Apache License, Version 2.0 (the "License");
  20123. you may not use this file except in compliance with the License.
  20124. You may obtain a copy of the License at
  20125. http://www.apache.org/licenses/LICENSE-2.0
  20126. Unless required by applicable law or agreed to in writing, software
  20127. distributed under the License is distributed on an "AS IS" BASIS,
  20128. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  20129. See the License for the specific language governing permissions and
  20130. limitations under the License.
  20131. */
  20132. i18n.phonenumbers.metadata={};
  20133. i18n.phonenumbers.metadata.countryCodeToRegionCodeMap={1:"US AG AI AS BB BM BS CA DM DO GD GU JM KN KY LC MP MS PR SX TC TT VC VG VI".split(" "),7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],
  20134. 65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],
  20135. 249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],
  20136. 381:["RS"],382:["ME"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],
  20137. 688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],800:["001"],808:["001"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],870:["001"],878:["001"],880:["BD"],881:["001"],882:["001"],883:["001"],886:["TW"],888:["001"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],979:["001"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]};
  20138. i18n.phonenumbers.metadata.countryToMetadata={AC:[,[,,"[46]\\d{4}|[01589]\\d{5}","\\d{5,6}",,,,,,[5,6]],[,,"6[2-467]\\d{3}","\\d{5}",,,"62889",,,[5]],[,,"4\\d{4}","\\d{5}",,,"40123",,,[5]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"AC",247,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"[01589]\\d{5}","\\d{6}",,,"542011",,,[6]],,,[,,"NA","NA",,,,,,[-1]]],AD:[,[,,"(?:[346-9]|180)\\d{5}","\\d{6,8}",,,,
  20139. ,,[6,8]],[,,"[78]\\d{5}","\\d{6}",,,"712345",,,[6]],[,,"[346]\\d{5}","\\d{6}",,,"312345",,,[6]],[,,"180[02]\\d{4}","\\d{8}",,,"18001234",,,[8]],[,,"9\\d{5}","\\d{6}",,,"912345",,,[6]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"AD",376,"00",,,,,,,,[[,"(\\d{3})(\\d{3})","$1 $2",["[346-9]"]],[,"(180[02])(\\d{4})","$1 $2",["1"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AE:[,[,,"[2-79]\\d{7,8}|800\\d{2,9}","\\d{5,12}",
  20140. ,,,,,[5,6,7,8,9,10,11,12]],[,,"[2-4679][2-8]\\d{6}","\\d{7,8}",,,"22345678",,,[8]],[,,"5[024-6]\\d{7}","\\d{9}",,,"501234567",,,[9]],[,,"400\\d{6}|800\\d{2,9}","\\d{5,12}",,,"800123456"],[,,"900[02]\\d{5}","\\d{9}",,,"900234567",,,[9]],[,,"700[05]\\d{5}","\\d{9}",,,"700012345",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"AE",971,"00","0",,,"0",,,,[[,"([2-4679])(\\d{3})(\\d{4})","$1 $2 $3",["[2-4679][2-8]"],"0$1"],[,"(5\\d)(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],[,"([479]00)(\\d)(\\d{5})",
  20141. "$1 $2 $3",["[479]0"],"$1"],[,"([68]00)(\\d{2,9})","$1 $2",["60|8"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"600[25]\\d{5}","\\d{9}",,,"600212345",,,[9]],,,[,,"NA","NA",,,,,,[-1]]],AF:[,[,,"[2-7]\\d{8}","\\d{7,9}",,,,,,[9],[7]],[,,"(?:[25][0-8]|[34][0-4]|6[0-5])[2-9]\\d{6}","\\d{7,9}",,,"234567890"],[,,"7(?:[014-9]\\d{7}|2[89]\\d{6})","\\d{9}",,,"701234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],
  20142. "AF",93,"00","0",,,"0",,,,[[,"([2-7]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AG:[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}","\\d{7}(?:\\d{3})?",,,"2684601234"],[,,"268(?:464|7(?:2\\d|3[246]|64|7[0-689]|8[02-68]))\\d{4}","\\d{7}(?:\\d{3})?",,,"2684641234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}",
  20143. "\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"26848[01]\\d{4}","\\d{7}(?:\\d{3})?",,,"2684801234"],"AG",1,"011","1",,,"1",,,,,,[,,"26840[69]\\d{4}","\\d{7}(?:\\d{3})?",,,"2684061234"],,"268",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AI:[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"2644(?:6[12]|9[78])\\d{4}","\\d{7}(?:\\d{3})?",,,"2644612345"],[,,"264(?:235|476|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}",
  20144. "\\d{7}(?:\\d{3})?",,,"2642351234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"AI",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"264",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AL:[,[,,"[2-57]\\d{7}|6\\d{8}|8\\d{5,7}|9\\d{5}","\\d{5,9}",,,,,,[6,7,8,9],[5]],[,,"(?:2(?:[168][1-9]|[247]\\d|9[1-7])|3(?:1[1-3]|[2-6]\\d|[79][1-8]|8[1-9])|4\\d{2}|5(?:1[1-4]|[2-578]\\d|6[1-5]|9[1-7])|8(?:[19][1-5]|[2-6]\\d|[78][1-7]))\\d{5}",
  20145. "\\d{5,8}",,,"22345678",,,[8]],[,,"6[6-9]\\d{7}","\\d{9}",,,"661234567",,,[9]],[,,"800\\d{4}","\\d{7}",,,"8001234",,,[7]],[,,"900\\d{3}","\\d{6}",,,"900123",,,[6]],[,,"808\\d{3}","\\d{6}",,,"808123",,,[6]],[,,"700\\d{5}","\\d{8}",,,"70012345",,,[8]],[,,"NA","NA",,,,,,[-1]],"AL",355,"00","0",,,"0",,,,[[,"(4)(\\d{3})(\\d{4})","$1 $2 $3",["4[0-6]"],"0$1"],[,"(6[6-9])(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4[7-9]"],"0$1"],[,"(\\d{3})(\\d{3,5})",
  20146. "$1 $2",["[235][16-9]|8[016-9]|[79]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AM:[,[,,"[1-9]\\d{7}","\\d{5,8}",,,,,,[8],[5,6]],[,,"(?:1[0-2]\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2|47\\d)\\d{5}","\\d{5,8}",,,"10123456"],[,,"(?:4[139]|55|77|9[1-9])\\d{6}","\\d{8}",,,"77123456"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"90[016]\\d{5}","\\d{8}",,,"90012345"],[,,"80[1-4]\\d{5}","\\d{8}",,,"80112345"],[,,"NA","NA",
  20147. ,,,,,[-1]],[,,"60(?:2[078]|[3-7]\\d|8[0-5])\\d{4}","\\d{8}",,,"60271234"],"AM",374,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],[,"(\\d{2})(\\d{6})","$1 $2",["4[139]|[5-7]|9[1-9]"],"0$1"],[,"(\\d{3})(\\d{5})","$1 $2",["[23]"],"(0$1)"],[,"(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8|90"],"0 $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AO:[,[,,"[29]\\d{8}","\\d{9}",,,,,,[9]],[,,"2\\d(?:[26-9]\\d|\\d[26-9])\\d{5}","\\d{9}",
  20148. ,,"222123456"],[,,"9[1-49]\\d{7}","\\d{9}",,,"923123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"AO",244,"00",,,,,,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AR:[,[,,"11\\d{8}|[2368]\\d{9}|9\\d{10}","\\d{6,11}",,,,,,[10,11],[6,7,8]],[,,"11\\d{8}|(?:2(?:2(?:[013]\\d|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[067]\\d)|4(?:7[3-8]|9\\d)|6(?:[01346]\\d|2[24-6]|5[15-8])|80\\d|9(?:[0124789]\\d|3[1-6]|5[234]|6[2-46]))|3(?:3(?:2[79]|6\\d|8[2578])|4(?:[78]\\d|0[0124-9]|[1-35]\\d|4[24-7]|6[02-9]|9[123678])|5(?:[138]\\d|2[1245]|4[1-9]|6[2-4]|7[1-6])|6[24]\\d|7(?:[0469]\\d|1[1568]|2[013-9]|3[145]|5[14-8]|7[2-57]|8[0-24-9])|8(?:[013578]\\d|2[15-7]|4[13-6]|6[1-357-9]|9[124]))|670\\d)\\d{6}",
  20149. "\\d{6,10}",,,"1123456789",,,[10]],[,,"675\\d{7}|9(?:11[2-9]\\d{7}|(?:2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[12358]|5[138]|6[24]|7[069]|8[013578]))[2-9]\\d{6}|\\d{4}[2-9]\\d{5})","\\d{6,11}",,,"91123456789",,,[11]],[,,"800\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,,"60[04579]\\d{7}","\\d{10}",,,"6001234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"AR",54,"00","0",,,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))?15)?",
  20150. "9$1",,,[[,"([68]\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],[,"(\\d{2})(\\d{4})","$1-$2",["[2-9]"],"$1"],[,"(\\d{3})(\\d{4})","$1-$2",["[2-9]"],"$1"],[,"(\\d{4})(\\d{4})","$1-$2",["[2-9]"],"$1"],[,"(9)(11)(\\d{4})(\\d{4})","$2 15-$3-$4",["911"],"0$1"],[,"(9)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9(?:2[234689]|3[3-8])","9(?:2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[1-358]|5[138]|6[24]|7[069]|8[013578]))","9(?:2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3[456]|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45])))",
  20151. "9(?:2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3(?:4|5[014]|6[1239])|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45])))"],"0$1"],[,"(9)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9[23]"],"0$1"],[,"(11)(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[1-358]|5[138]|6[24]|7[069]|8[013578])","2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3[456]|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45]))",
  20152. "2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3(?:4|5[014]|6[1239])|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45]))"],"0$1",,1],[,"(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["[23]"],"0$1",,1],[,"(\\d{3})","$1",["1[012]|911"],"$1"]],[[,"([68]\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],[,"(9)(11)(\\d{4})(\\d{4})","$1 $2 $3-$4",["911"]],[,"(9)(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3-$4",["9(?:2[234689]|3[3-8])","9(?:2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[1-358]|5[138]|6[24]|7[069]|8[013578]))",
  20153. "9(?:2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3[456]|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45])))","9(?:2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3(?:4|5[014]|6[1239])|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45])))"]],[,"(9)(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3-$4",["9[23]"]],[,"(11)(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",
  20154. ,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[1-358]|5[138]|6[24]|7[069]|8[013578])","2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3[456]|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45]))","2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3(?:4|5[014]|6[1239])|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45]))"],
  20155. "0$1",,1],[,"(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["[23]"],"0$1",,1]],[,,"NA","NA",,,,,,[-1]],,,[,,"810\\d{7}","\\d{10}",,,"8101234567",,,[10]],[,,"810\\d{7}","\\d{10}",,,"8101234567",,,[10]],,,[,,"NA","NA",,,,,,[-1]]],AS:[,[,,"[5689]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"6846(?:22|33|44|55|77|88|9[19])\\d{4}","\\d{7}(?:\\d{3})?",,,"6846221234"],[,,"684(?:2(?:5[2468]|72)|7(?:3[13]|70))\\d{4}","\\d{7}(?:\\d{3})?",,,"6847331234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],
  20156. [,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"AS",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"684",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AT:[,[,,"[1-9]\\d{3,12}","\\d{3,13}",,,,,,[4,5,6,7,8,9,10,11,12,13],[3]],[,,"1\\d{3,12}|(?:2(?:1[467]|2[13-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|9[1458])|3(?:1[1-8]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|63|7[1368]|8[2457])|5(?:12|2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[1-35-8]|5[468]|62)|7(?:2[1-8]|3[25]|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{3,10}",
  20157. "\\d{3,13}",,,"1234567890"],[,,"6(?:5[0-3579]|6[013-9]|[7-9]\\d)\\d{4,10}","\\d{7,13}",,,"664123456",,,[7,8,9,10,11,12,13]],[,,"800\\d{6,10}","\\d{9,13}",,,"800123456",,,[9,10,11,12,13]],[,,"9(?:0[01]|3[019])\\d{6,10}","\\d{9,13}",,,"900123456",,,[9,10,11,12,13]],[,,"8(?:10\\d|2(?:[01]\\d|8\\d?))\\d{5,9}","\\d{8,13}",,,"810123456",,,[8,9,10,11,12,13]],[,,"NA","NA",,,,,,[-1]],[,,"780\\d{6,10}","\\d{9,13}",,,"780123456",,,[9,10,11,12,13]],"AT",43,"00","0",,,"0",,,,[[,"(116\\d{3})","$1",["116"],"$1"],
  20158. [,"(1)(\\d{3,12})","$1 $2",["1"],"0$1"],[,"(5\\d)(\\d{3,5})","$1 $2",["5[079]"],"0$1"],[,"(5\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["5[079]"],"0$1"],[,"(5\\d)(\\d{4})(\\d{4,7})","$1 $2 $3",["5[079]"],"0$1"],[,"(\\d{3})(\\d{3,10})","$1 $2",["316|46|51|732|6(?:5[0-3579]|[6-9])|7(?:[28]0)|[89]"],"0$1"],[,"(\\d{4})(\\d{3,9})","$1 $2",["2|3(?:1[1-578]|[3-8])|4[2378]|5[2-6]|6(?:[12]|4[1-9]|5[468])|7(?:2[1-8]|35|4[1-8]|[5-79])"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"5(?:(?:0[1-9]|17)\\d{2,10}|[79]\\d{3,11})|720\\d{6,10}",
  20159. "\\d{5,13}",,,"50123",,,[5,6,7,8,9,10,11,12,13]],,,[,,"NA","NA",,,,,,[-1]]],AU:[,[,,"[1-578]\\d{5,9}","\\d{6,10}",,,,,,[5,6,7,8,9,10]],[,,"[237]\\d{8}|8(?:[6-8]\\d{3}|9(?:[02-9]\\d{2}|1(?:[0-57-9]\\d|6[0135-9])))\\d{4}","\\d{8,9}",,,"212345678",,,[9]],[,,"14(?:5\\d|71)\\d{5}|4(?:[0-3]\\d|4[47-9]|5[0-25-9]|6[6-9]|7[02-9]|8[147-9]|9[017-9])\\d{6}","\\d{9}",,,"412345678",,,[9]],[,,"180(?:0\\d{3}|2)\\d{3}","\\d{7,10}",,,"1800123456",,,[7,10]],[,,"19(?:0[0126]\\d|[679])\\d{5}","\\d{8,10}",,,"1900123456",
  20160. ,,[8,10]],[,,"13(?:00\\d{3}|45[0-4]|\\d)\\d{3}","\\d{6,10}",,,"1300123456",,,[6,8,10]],[,,"500\\d{6}","\\d{9}",,,"500123456",,,[9]],[,,"550\\d{6}","\\d{9}",,,"550123456",,,[9]],"AU",61,"(?:14(?:1[14]|34|4[17]|[56]6|7[47]|88))?001[14-689]","0",,,"0",,"0011",,[[,"([2378])(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[45]|14"],"0$1"],[,"(16)(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],[,"(1[389]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[38]0|90)","1(?:[38]00|90)"],
  20161. "$1"],[,"(180)(2\\d{3})","$1 $2",["180","1802"],"$1"],[,"(19\\d)(\\d{3})","$1 $2",["19[13]"],"$1"],[,"(19\\d{2})(\\d{4})","$1 $2",["19[679]"],"$1"],[,"(13)(\\d{2})(\\d{2})","$1 $2 $3",["13[1-9]"],"$1"]],,[,,"16\\d{3,7}","\\d{5,9}",,,"1612345",,,[5,6,7,8,9]],1,,[,,"1(?:3(?:00\\d{3}|45[0-4]|\\d)\\d{3}|80(?:0\\d{6}|2\\d{3}))","\\d{6,10}",,,"1300123456",,,[6,7,8,10]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AW:[,[,,"[25-9]\\d{6}","\\d{7}",,,,,,[7]],[,,"5(?:2\\d|8[1-9])\\d{4}","\\d{7}",,,"5212345"],
  20162. [,,"(?:5(?:6\\d|9[2-478])|6(?:[039]0|22|4[01]|6[0-2])|7[34]\\d|9(?:6[45]|9[4-8]))\\d{4}","\\d{7}",,,"5601234"],[,,"800\\d{4}","\\d{7}",,,"8001234"],[,,"900\\d{4}","\\d{7}",,,"9001234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"28\\d{5}|501\\d{4}","\\d{7}",,,"5011234"],"AW",297,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AX:[,[,,"[135]\\d{5,9}|[27]\\d{4,9}|4\\d{5,10}|6\\d{7,8}|8\\d{6,9}",
  20163. "\\d{5,12}",,,,,,[5,6,7,8,9,10,11,12]],[,,"18[1-8]\\d{3,9}","\\d{6,12}",,,"1812345678",,,[6,7,8,9,10,11,12]],[,,"4\\d{5,10}|50\\d{4,8}","\\d{6,11}",,,"412345678",,,[6,7,8,9,10,11]],[,,"800\\d{4,7}","\\d{7,10}",,,"8001234567",,,[7,8,9,10]],[,,"[67]00\\d{5,6}","\\d{8,9}",,,"600123456",,,[8,9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"AX",358,"00|99(?:[02469]|5(?:11|33|5[59]|88|9[09]))","0",,,"0",,"00",,,,[,,"NA","NA",,,,,,[-1]],,,[,,"[13]00\\d{3,7}|2(?:0(?:0\\d{3,7}|2[023]\\d{1,6}|9[89]\\d{1,6}))|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})",
  20164. "\\d{5,10}",,,"100123",,,[5,6,7,8,9,10]],[,,"[13]0\\d{4,8}|2(?:0(?:[016-8]\\d{3,7}|[2-59]\\d{2,7})|9\\d{4,8})|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"10112345",,,[5,6,7,8,9,10]],,,[,,"NA","NA",,,,,,[-1]]],AZ:[,[,,"[1-9]\\d{8}","\\d{7,9}",,,,,,[9],[7]],[,,"(?:1[28]\\d{3}|2(?:02|1[24]|2[2-4]|33|[45]2|6[23])\\d{2}|365(?:[0-46-9]\\d|5[0-35-9]))\\d{4}","\\d{7,9}",,,"123123456"],[,,"(?:36554|(?:4[04]|5[015]|60|7[07])\\d{3})\\d{4}","\\d{9}",,,"401234567"],[,,"88\\d{7}",
  20165. "\\d{9}",,,"881234567"],[,,"900200\\d{3}","\\d{9}",,,"900200123"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"AZ",994,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["(?:1[28]|2(?:[45]2|[0-36])|365)"],"(0$1)"],[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[4-8]"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BA:[,
  20166. [,,"[3-9]\\d{7,8}","\\d{6,9}",,,,,,[8,9],[6]],[,,"(?:[35]\\d|49)\\d{6}","\\d{6,8}",,,"30123456",,,[8]],[,,"6(?:03|44|71|[1-356])\\d{6}","\\d{8,9}",,,"61123456"],[,,"8[08]\\d{6}","\\d{8}",,,"80123456",,,[8]],[,,"9[0246]\\d{6}","\\d{8}",,,"90123456",,,[8]],[,,"8[12]\\d{6}","\\d{8}",,,"82123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BA",387,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-356]|[7-9]"],"0$1"],[,
  20167. "(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6[047]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"70[23]\\d{5}","\\d{8}",,,"70223456",,,[8]],,,[,,"NA","NA",,,,,,[-1]]],BB:[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"246(?:2(?:2[78]|7[0-4])|4(?:1[024-6]|2\\d|3[2-9])|5(?:20|[34]\\d|54|7[1-3])|6(?:2\\d|38)|7(?:37|57)|9(?:1[89]|63))\\d{4}","\\d{7}(?:\\d{3})?",,,"2464123456"],[,,"246(?:2(?:[356]\\d|4[0-57-9]|8[0-79])|45\\d|8(?:[2-5]\\d|83))\\d{4}","\\d{7}(?:\\d{3})?",
  20168. ,,"2462501234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900\\d{7}|246976\\d{4}","\\d{7}(?:\\d{3})?",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"24631\\d{5}","\\d{7}(?:\\d{3})?",,,"2463101234"],"BB",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"246",[,,"NA","NA",,,,,,[-1]],[,,"246(?:292|41[7-9]|43[01])\\d{4}","\\d{7}(?:\\d{3})?",,,"2464301234"],,,[,,"NA","NA",,,,,,[-1]]],BD:[,[,,"[2-79]\\d{5,9}|1\\d{9}|8[0-7]\\d{4,8}",
  20169. "\\d{6,10}",,,,,,[6,7,8,9,10]],[,,"2(?:550\\d|7(?:1[0-267]|2[0-289]|3[0-29]|4[01]|5[1-3]|6[013]|7[017]|91)|8(?:0[125]|[139][1-6]|2[0157-9]|6[1-35]|7[1-5]|8[1-8]|90)|9(?:0[0-2]|1[0-4]|2[568]|3[3-6]|5[5-7]|6[0167]|7[15]|8[0146-8]))\\d{4}|3(?:12?[5-7]\\d{2}|0(?:2(?:[025-79]\\d|[348]\\d{1,2})|3(?:[2-4]\\d|[56]\\d?))|2(?:1\\d{2}|2(?:[12]\\d|[35]\\d{1,2}|4\\d?))|3(?:1\\d{2}|2(?:[2356]\\d|4\\d{1,2}))|4(?:1\\d{2}|2(?:2\\d{1,2}|[47]|5\\d{2}))|5(?:1\\d{2}|29)|[67]1\\d{2}|8(?:1\\d{2}|2(?:2\\d{2}|3|4\\d)))\\d{3}|4(?:0(?:2(?:[09]\\d|7)|33\\d{2})|1\\d{3}|2(?:1\\d{2}|2(?:[25]\\d?|[348]\\d|[67]\\d{1,2}))|3(?:1\\d{2}(?:\\d{2})?|2(?:[045]\\d|[236-9]\\d{1,2})|32\\d{2})|4(?:[18]\\d{2}|2(?:[2-46]\\d{2}|3)|5[25]\\d{2})|5(?:1\\d{2}|2(?:3\\d|5))|6(?:[18]\\d{2}|2(?:3(?:\\d{2})?|[46]\\d{1,2}|5\\d{2}|7\\d)|5(?:3\\d?|4\\d|[57]\\d{1,2}|6\\d{2}|8))|71\\d{2}|8(?:[18]\\d{2}|23\\d{2}|54\\d{2})|9(?:[18]\\d{2}|2[2-5]\\d{2}|53\\d{1,2}))\\d{3}|5(?:02[03489]\\d{2}|1\\d{2}|2(?:1\\d{2}|2(?:2(?:\\d{2})?|[457]\\d{2}))|3(?:1\\d{2}|2(?:[37](?:\\d{2})?|[569]\\d{2}))|4(?:1\\d{2}|2[46]\\d{2})|5(?:1\\d{2}|26\\d{1,2})|6(?:[18]\\d{2}|2|53\\d{2})|7(?:1|24)\\d{2}|8(?:1|26)\\d{2}|91\\d{2})\\d{3}|6(?:0(?:1\\d{2}|2(?:3\\d{2}|4\\d{1,2}))|2(?:2[2-5]\\d{2}|5(?:[3-5]\\d{2}|7)|8\\d{2})|3(?:1|2[3478])\\d{2}|4(?:1|2[34])\\d{2}|5(?:1|2[47])\\d{2}|6(?:[18]\\d{2}|6(?:2(?:2\\d|[34]\\d{2})|5(?:[24]\\d{2}|3\\d|5\\d{1,2})))|72[2-5]\\d{2}|8(?:1\\d{2}|2[2-5]\\d{2})|9(?:1\\d{2}|2[2-6]\\d{2}))\\d{3}|7(?:(?:02|[3-589]1|6[12]|72[24])\\d{2}|21\\d{3}|32)\\d{3}|8(?:(?:4[12]|[5-7]2|1\\d?)|(?:0|3[12]|[5-7]1|217)\\d)\\d{4}|9(?:[35]1|(?:[024]2|81)\\d|(?:1|[24]1)\\d{2})\\d{3}",
  20170. "\\d{6,9}",,,"27111234",,,[6,7,8,9]],[,,"(?:1[13-9]\\d|(?:3[78]|44)[02-9]|6(?:44|6[02-9]))\\d{7}","\\d{10}",,,"1812345678",,,[10]],[,,"80[03]\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"96(?:0[49]|1[0-4]|6[69])\\d{6}","\\d{10}",,,"9604123456",,,[10]],"BD",880,"00","0",,,"0",,,,[[,"(2)(\\d{7,8})","$1-$2",["2"],"0$1"],[,"(\\d{2})(\\d{4,6})","$1-$2",["[3-79]1"],"0$1"],[,"(\\d{4})(\\d{3,6})","$1-$2",["1|3(?:0|[2-58]2)|4(?:0|[25]2|3[23]|[4689][25])|5(?:[02-578]2|6[25])|6(?:[0347-9]2|[26][25])|7[02-9]2|8(?:[023][23]|[4-7]2)|9(?:[02][23]|[458]2|6[016])"],
  20171. "0$1"],[,"(\\d{3})(\\d{3,7})","$1-$2",["[3-79][2-9]|8"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BE:[,[,,"[1-9]\\d{7,8}","\\d{8,9}",,,,,,[8,9]],[,,"(?:1[0-69]|[23][2-8]|4[23]|5\\d|6[013-57-9]|71|8[1-79]|9[2-4])\\d{6}|80[2-8]\\d{5}","\\d{8}",,,"12345678",,,[8]],[,,"4(?:6[0135-8]|[79]\\d|8[3-9])\\d{6}","\\d{9}",,,"470123456",,,[9]],[,,"800\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"(?:70[2-467]|90[0-79])\\d{5}","\\d{8}",,,"90123456",
  20172. ,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BE",32,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4[6-9]"],"0$1"],[,"(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[23]|4[23]|9[2-4]"],"0$1"],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[156]|7[018]|8(?:0[1-9]|[1-79])"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"78\\d{6}","\\d{8}",,,"78123456",,,[8]],
  20173. ,,[,,"NA","NA",,,,,,[-1]]],BF:[,[,,"[25-7]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:0(?:49|5[23]|9[016-9])|4(?:4[569]|5[4-6]|7[0179])|5(?:[34]\\d|50))\\d{4}","\\d{8}",,,"20491234"],[,,"(?:55[0-5]|6(?:[0-689]\\d|7[0-5]))\\d{5}|7\\d{7}","\\d{8}",,,"70123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BF",226,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA",
  20174. "NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BG:[,[,,"[23567]\\d{5,7}|[489]\\d{6,8}","\\d{5,9}",,,,,,[6,7,8,9],[4,5]],[,,"2\\d{5,7}|(?:[36]\\d|5[1-9]|8[1-6]|9[1-7])\\d{5,6}|(?:4(?:[124-7]\\d|3[1-6])|7(?:0[1-9]|[1-9]\\d))\\d{4,5}","\\d{5,8}",,,"2123456",,,[6,7,8]],[,,"(?:8[7-9]\\d|9(?:8\\d|99))\\d{6}|4(?:3[0789]|8\\d)\\d{5}","\\d{8,9}",,,"48123456",,,[8,9]],[,,"800\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"90\\d{6}","\\d{8}",,,"90123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"700\\d{5}","\\d{5,9}",,,"70012345",
  20175. ,,[8]],[,,"NA","NA",,,,,,[-1]],"BG",359,"00","0",,,"0",,,,[[,"(2)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],[,"(2)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],[,"(\\d{3})(\\d{4})","$1 $2",["43[124-7]|70[1-9]"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[124-7]|70[1-9]"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[78]00"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["999"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{3,4})",
  20176. "$1 $2 $3",["48|8[7-9]|9[08]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BH:[,[,,"[136-9]\\d{7}","\\d{8}",,,,,,[8]],[,,"(?:1(?:3[1356]|6[0156]|7\\d)\\d|6(?:1[16]\\d|500|6(?:0\\d|3[12]|44|7[7-9])|9[69][69])|7(?:1(?:11|78)|7\\d{2}))\\d{4}","\\d{8}",,,"17001234"],[,,"(?:3(?:[1-4679]\\d|5[013-69]|8[0-47-9])\\d|6(?:3(?:00|33|6[16])|6(?:[69]\\d|3[03-9]|7[0-6])))\\d{4}","\\d{8}",,,"36001234"],[,,"80\\d{6}","\\d{8}",,,"80123456"],[,,"(?:87|9[014578])\\d{6}",
  20177. "\\d{8}",,,"90123456"],[,,"84\\d{6}","\\d{8}",,,"84123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BH",973,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BI:[,[,,"[267]\\d{7}","\\d{8}",,,,,,[8]],[,,"22\\d{6}","\\d{8}",,,"22201234"],[,,"(?:29|6[189]|7[124-9])\\d{6}","\\d{8}",,,"79561234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA",
  20178. "NA",,,,,,[-1]],"BI",257,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BJ:[,[,,"[2689]\\d{7}|7\\d{3}","\\d{4,8}",,,,,,[4,8]],[,,"2(?:02|1[037]|2[45]|3[68])\\d{5}","\\d{8}",,,"20211234",,,[8]],[,,"(?:6[1-8]|9[03-9])\\d{6}","\\d{8}",,,"90011234",,,[8]],[,,"7[3-5]\\d{2}","\\d{4}",,,"7312",,,[4]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"857[58]\\d{4}",
  20179. "\\d{8}",,,"85751234",,,[8]],"BJ",229,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"81\\d{6}","\\d{8}",,,"81123456",,,[8]],,,[,,"NA","NA",,,,,,[-1]]],BL:[,[,,"[56]\\d{8}","\\d{9}",,,,,,[9]],[,,"590(?:2[7-9]|5[12]|87)\\d{4}","\\d{9}",,,"590271234"],[,,"690(?:0[0-7]|[1-9]\\d)\\d{4}","\\d{9}",,,"690301234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],
  20180. "BL",590,"00","0",,,"0",,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BM:[,[,,"[4589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"441(?:2(?:02|23|61|[3479]\\d)|[46]\\d{2}|5(?:4\\d|60|89)|824)\\d{4}","\\d{7}(?:\\d{3})?",,,"4412345678"],[,,"441(?:[37]\\d|5[0-39])\\d{5}","\\d{7}(?:\\d{3})?",,,"4413701234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],
  20181. [,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"BM",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"441",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BN:[,[,,"[2-578]\\d{6}","\\d{7}",,,,,,[7]],[,,"2(?:[013-9]\\d|2[0-7])\\d{4}|[3-5]\\d{6}","\\d{7}",,,"2345678"],[,,"22[89]\\d{4}|[78]\\d{6}","\\d{7}",,,"7123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,
  20182. ,[-1]],"BN",673,"00",,,,,,,,[[,"([2-578]\\d{2})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BO:[,[,,"[23467]\\d{7}","\\d{7,8}",,,,,,[8],[7]],[,,"(?:2(?:2\\d{2}|5(?:11|[258]\\d|9[67])|6(?:12|2\\d|9[34])|8(?:2[34]|39|62))|3(?:3\\d{2}|4(?:6\\d|8[24])|8(?:25|42|5[257]|86|9[25])|9(?:2\\d|3[234]|4[248]|5[24]|6[2-6]|7\\d))|4(?:4\\d{2}|6(?:11|[24689]\\d|72)))\\d{4}","\\d{7,8}",,,"22123456"],[,,"[67]\\d{7}","\\d{8}",,,"71234567"],
  20183. [,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BO",591,"00(1\\d)?","0",,,"0(1\\d)?",,,,[[,"([234])(\\d{7})","$1 $2",["[234]"],,"0$CC $1"],[,"([67]\\d{7})","$1",["[67]"],,"0$CC $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BQ:[,[,,"[347]\\d{6}","\\d{7}",,,,,,[7]],[,,"(?:318[023]|416[023]|7(?:1[578]|50)\\d)\\d{3}","\\d{7}",,,"7151234"],[,,"(?:318[14-68]|416[15-9]|7(?:0[01]|7[07]|[89]\\d)\\d)\\d{3}",
  20184. "\\d{7}",,,"3181234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BQ",599,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BR:[,[,,"[1-46-9]\\d{7,10}|5(?:[0-4]\\d{7,9}|5(?:[2-8]\\d{7}|9\\d{7,8}))","\\d{8,11}",,,,,,[8,9,10,11]],[,,"(?:[14689][1-9]|2[12478]|3[1-578]|5[1-5]|7[13-579])[2-5]\\d{7}","\\d{8,11}",,,"1123456789",,,[10]],[,,"1[1-9](?:7|9\\d)\\d{7}|(?:2[12478]|3[1-578]|[4689][1-9]|5[1-5]|7[13-579])(?:[6-8]|9\\d?)\\d{7}",
  20185. "\\d{8,11}",,,"11961234567",,,[10,11]],[,,"800\\d{6,7}","\\d{8,11}",,,"800123456",,,[9,10]],[,,"(?:300|[59]00\\d?)\\d{6}","\\d{8,11}",,,"300123456",,,[9,10]],[,,"(?:300\\d(?:\\d{2})?|40(?:0\\d|20))\\d{4}","\\d{8,10}",,,"40041234",,,[8,10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BR",55,"00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","0",,,"0(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2",,,[[,"(\\d{4})(\\d{4})","$1-$2",["[2-9](?:[1-9]|0[1-9])"],"$1"],[,"(\\d{5})(\\d{4})","$1-$2",["9(?:[1-9]|0[1-9])"],
  20186. "$1"],[,"(\\d{3,5})","$1",["1[125689]"],"$1"],[,"(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[1-5]|7[13-579])9"],"($1)","0 $CC ($1)"],[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["[1-9][1-9]"],"($1)","0 $CC ($1)"],[,"(\\d{4})(\\d{4})","$1-$2",["(?:300|40(?:0|20))"]],[,"([3589]00)(\\d{2,3})(\\d{4})","$1 $2 $3",["[3589]00"],"0$1"]],[[,"(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[1-5]|7[13-579])9"],"($1)","0 $CC ($1)"],[,"(\\d{2})(\\d{4})(\\d{4})",
  20187. "$1 $2-$3",["[1-9][1-9]"],"($1)","0 $CC ($1)"],[,"(\\d{4})(\\d{4})","$1-$2",["(?:300|40(?:0|20))"]],[,"([3589]00)(\\d{2,3})(\\d{4})","$1 $2 $3",["[3589]00"],"0$1"]],[,,"NA","NA",,,,,,[-1]],,,[,,"(?:300\\d|40(?:0\\d|20))\\d{4}","\\d{8}",,,"40041234",,,[8]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BS:[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[3467]|8[0-4]|9[2-467])|461|502|6(?:0[1-3]|12|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}","\\d{7}(?:\\d{3})?",
  20188. ,,"2423456789"],[,,"242(?:3(?:5[79]|[79]5)|4(?:[2-4][1-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-9]|65|77)|6[34]6|727)\\d{4}","\\d{7}(?:\\d{3})?",,,"2423591234"],[,,"242300\\d{4}|8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"BS",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"242",[,,"NA","NA",,,,,,[-1]],
  20189. [,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BT:[,[,,"[1-8]\\d{6,7}","\\d{6,8}",,,,,,[7,8],[6]],[,,"(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\d{5}","\\d{6,7}",,,"2345678",,,[7]],[,,"(?:1[67]|77)\\d{6}","\\d{8}",,,"17123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BT",975,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1|77"]],[,"([2-8])(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]]],
  20190. ,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BW:[,[,,"[2-79]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0235-9]|55|[69]\\d|7[01])|4(?:6[03]|7[1267]|9[0-5])|5(?:3[0389]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[067]))\\d{4}","\\d{7}",,,"2401234",,,[7]],[,,"7(?:[1-6]\\d|7[014-8])\\d{5}","\\d{8}",,,"71123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"90\\d{5}","\\d{7}",,,"9012345",,,[7]],[,,"NA","NA",,,,,,[-1]],[,
  20191. ,"NA","NA",,,,,,[-1]],[,,"79[12][01]\\d{4}","\\d{8}",,,"79101234",,,[8]],"BW",267,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[2-6]"]],[,"(7\\d)(\\d{3})(\\d{3})","$1 $2 $3",["7"]],[,"(90)(\\d{5})","$1 $2",["9"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BY:[,[,,"[1-4]\\d{8}|800\\d{3,7}|[89]\\d{9,10}","\\d{5,11}",,,,,,[6,7,8,9,10,11],[5]],[,,"(?:1(?:5(?:1[1-5]|[24]\\d|6[2-4]|9[1-7])|6(?:[235]\\d|4[1-7])|7\\d{2})|2(?:1(?:[246]\\d|3[0-35-9]|5[1-9])|2(?:[235]\\d|4[0-8])|3(?:[26]\\d|3[02-79]|4[024-7]|5[03-7])))\\d{5}",
  20192. "\\d{5,9}",,,"152450911",,,[9]],[,,"(?:2(?:5[5679]|9[1-9])|33\\d|44\\d)\\d{6}","\\d{9}",,,"294911911",,,[9]],[,,"8(?:0[13]|20\\d)\\d{7}|800\\d{3,7}","\\d{5,11}",,,"8011234567"],[,,"(?:810|902)\\d{7}","\\d{10}",,,"9021234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"249\\d{6}","\\d{9}",,,"249123456",,,[9]],"BY",375,"810","8",,,"8?0?",,"8~10",,[[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["17[0-3589]|2[4-9]|[34]","17(?:[02358]|1[0-2]|9[0189])|2[4-9]|[34]"],"8 0$1"],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})",
  20193. "$1 $2-$3-$4",["1(?:5[24]|6[235]|7[467])|2(?:1[246]|2[25]|3[26])","1(?:5[24]|6(?:2|3[04-9]|5[0346-9])|7(?:[46]|7[37-9]))|2(?:1[246]|2[25]|3[26])"],"8 0$1"],[,"(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],[,"([89]\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8[01]|9"],"8 $1"],[,"(82\\d)(\\d{4})(\\d{4})","$1 $2 $3",["82"],"8 $1"],[,"(800)(\\d{3})","$1 $2",["800"],"8 $1"],
  20194. [,"(800)(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"8(?:[013]|[12]0)\\d{8}|800\\d{3,7}|902\\d{7}","\\d{5,11}",,,"82012345678"],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BZ:[,[,,"[2-8]\\d{6}|0\\d{10}","\\d{7}(?:\\d{4})?",,,,,,[7,11]],[,,"(?:[23458][02]\\d|7(?:[02]\\d|32))\\d{4}","\\d{7}",,,"2221234",,,[7]],[,,"6[0-35-7]\\d{5}","\\d{7}",,,"6221234",,,[7]],[,,"0800\\d{7}","\\d{11}",,,"08001234123",,,[11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,
  20195. "NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BZ",501,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],[,"(0)(800)(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],CA:[,[,,"[2-9]\\d{9}|3\\d{6}","\\d{7}(?:\\d{3})?",,,,,,[7,10]],[,,"(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:0[04]|13|22|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}|310\\d{4}",
  20196. "\\d{7}(?:\\d{3})?",,,"2042345678",,,[10]],[,,"(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:0[04]|13|22|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"2042345678",,,[10]],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}|310\\d{4}","\\d{7}(?:\\d{3})?",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678",,,[10]],[,
  20197. ,"NA","NA",,,,,,[-1]],"CA",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CC:[,[,,"[1458]\\d{5,9}","\\d{6,10}",,,,,,[6,7,9,10],[8]],[,,"89162\\d{4}","\\d{8,9}",,,"891621234",,,[9]],[,,"14(?:5\\d|71)\\d{5}|4(?:[0-2]\\d|3[0-57-9]|4[47-9]|5[0-25-9]|6[6-9]|7[02-9]|8[147-9]|9[017-9])\\d{6}","\\d{9}",,,"412345678",,,[9]],[,,"180(?:0\\d{3}|2)\\d{3}","\\d{7,10}",,,"1800123456",,,[7,10]],[,,"190[0126]\\d{6}","\\d{10}",,,"1900123456",
  20198. ,,[10]],[,,"13(?:00\\d{2})?\\d{4}","\\d{6,10}",,,"1300123456",,,[6,10]],[,,"500\\d{6}","\\d{9}",,,"500123456",,,[9]],[,,"550\\d{6}","\\d{9}",,,"550123456",,,[9]],"CC",61,"(?:14(?:1[14]|34|4[17]|[56]6|7[47]|88))?001[14-689]","0",,,"0",,"0011",,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CD:[,[,,"[2-6]\\d{6}|[18]\\d{6,8}|9\\d{8}","\\d{7,9}",,,,,,[7,9]],[,,"1(?:2\\d{7}|\\d{6})|[2-6]\\d{6}","\\d{7,9}",,,"1234567"],[,,"8(?:[0-2459]\\d{2}|8)\\d{5}|9[017-9]\\d{7}",
  20199. "\\d{7,9}",,,"991234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CD",243,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["12"],"0$1"],[,"([89]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8[0-2459]|9"],"0$1"],[,"(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],[,"(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CF:[,
  20200. [,,"[278]\\d{7}","\\d{8}",,,,,,[8]],[,,"2[12]\\d{6}","\\d{8}",,,"21612345"],[,,"7[0257]\\d{6}","\\d{8}",,,"70012345"],[,,"NA","NA",,,,,,[-1]],[,,"8776\\d{4}","\\d{8}",,,"87761234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CF",236,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CG:[,[,,"[028]\\d{8}","\\d{9}",,,,,,[9]],[,,"222[1-589]\\d{5}","\\d{9}",
  20201. ,,"222123456"],[,,"0[14-6]\\d{7}","\\d{9}",,,"061234567"],[,,"NA","NA",,,,,,[-1]],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CG",242,"00",,,,,,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]],[,"(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],CH:[,[,,"[2-9]\\d{8}|860\\d{9}","\\d{9}(?:\\d{3})?",,,,,,[9,12]],[,,"(?:2[12467]|3[1-4]|4[134]|5[256]|6[12]|[7-9]1)\\d{7}",
  20202. "\\d{9}",,,"212345678",,,[9]],[,,"7[5-9]\\d{7}","\\d{9}",,,"781234567",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"90[016]\\d{6}","\\d{9}",,,"900123456",,,[9]],[,,"84[0248]\\d{6}","\\d{9}",,,"840123456",,,[9]],[,,"878\\d{6}","\\d{9}",,,"878123456",,,[9]],[,,"NA","NA",,,,,,[-1]],"CH",41,"00","0",,,"0",,,,[[,"([2-9]\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]|[89]1"],"0$1"],[,"([89]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})",
  20203. "$1 $2 $3 $4 $5",["860"],"0$1"]],,[,,"74[0248]\\d{6}","\\d{9}",,,"740123456",,,[9]],,,[,,"NA","NA",,,,,,[-1]],[,,"5[18]\\d{7}","\\d{9}",,,"581234567",,,[9]],,,[,,"860\\d{9}","\\d{12}",,,"860123456789",,,[12]]],CI:[,[,,"[02-8]\\d{7}","\\d{8}",,,,,,[8]],[,,"(?:2(?:0[023]|1[02357]|[23][045]|4[03-5])|3(?:0[06]|1[069]|[2-4][07]|5[09]|6[08]))\\d{5}","\\d{8}",,,"21234567"],[,,"(?:0[1-9]|4\\d|5[14-9]|6[015-79]|7[578]|8[79])\\d{6}","\\d{8}",,,"01234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,
  20204. "NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CI",225,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],CK:[,[,,"[2-8]\\d{4}","\\d{5}",,,,,,[5]],[,,"(?:2\\d|3[13-7]|4[1-5])\\d{3}","\\d{5}",,,"21234"],[,,"[5-8]\\d{4}","\\d{5}",,,"71234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CK",
  20205. 682,"00",,,,,,,,[[,"(\\d{2})(\\d{3})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CL:[,[,,"(?:[2-9]|600|123)\\d{7,8}","\\d{7,11}",,,,,,[9,10,11],[7,8]],[,,"2(?:1962\\d{4}|2\\d{7}|32[0-267]\\d{5})|(?:3[2-5]|[47][1-35]|5[1-3578]|6[13-57])\\d{7}","\\d{7,9}",,,"221234567",,,[9]],[,,"9[3-9]\\d{7}","\\d{8,9}",,,"961234567",,,[9]],[,,"800\\d{6}|1230\\d{7}","\\d{9,11}",,,"800123456",,,[9,11]],[,,"NA","NA",,,,,,[-1]],[,,"600\\d{7,8}","\\d{10,11}",
  20206. ,,"6001234567",,,[10,11]],[,,"NA","NA",,,,,,[-1]],[,,"44\\d{7}","\\d{9}",,,"441234567",,,[9]],"CL",56,"(?:0|1(?:1[0-69]|2[0-57]|5[13-58]|69|7[0167]|8[018]))0","0",,,"0|(1(?:1[0-69]|2[0-57]|5[13-58]|69|7[0167]|8[018]))",,,,[[,"(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[23]"],"($1)","$CC ($1)"],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[357]|4[1-35]|6[13-57]"],"($1)","$CC ($1)"],[,"(9)(\\d{4})(\\d{4})","$1 $2 $3",["9"],"0$1"],[,"(44)(\\d{3})(\\d{4})","$1 $2 $3",["44"],"0$1"],[,"([68]00)(\\d{3})(\\d{3,4})",
  20207. "$1 $2 $3",["60|8"],"$1"],[,"(600)(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"],"$1"],[,"(1230)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"$1"],[,"(\\d{5})(\\d{4})","$1 $2",["219"],"($1)","$CC ($1)"],[,"(\\d{4,5})","$1",["[1-9]"],"$1"]],[[,"(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[23]"],"($1)","$CC ($1)"],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[357]|4[1-35]|6[13-57]"],"($1)","$CC ($1)"],[,"(9)(\\d{4})(\\d{4})","$1 $2 $3",["9"],"0$1"],[,"(44)(\\d{3})(\\d{4})","$1 $2 $3",["44"],"0$1"],[,"([68]00)(\\d{3})(\\d{3,4})",
  20208. "$1 $2 $3",["60|8"],"$1"],[,"(600)(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"],"$1"],[,"(1230)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"$1"],[,"(\\d{5})(\\d{4})","$1 $2",["219"],"($1)","$CC ($1)"]],[,,"NA","NA",,,,,,[-1]],,,[,,"600\\d{7,8}","\\d{10,11}",,,"6001234567",,,[10,11]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CM:[,[,,"[2368]\\d{7,8}","\\d{8,9}",,,,,,[8,9]],[,,"2(?:22|33|4[23])\\d{6}","\\d{9}",,,"222123456",,,[9]],[,,"6[5-9]\\d{7}","\\d{9}",,,"671234567",,,[9]],[,,"800\\d{5}","\\d{8}",
  20209. ,,"80012345",,,[8]],[,,"88\\d{6}","\\d{8}",,,"88012345",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CM",237,"00",,,,,,,,[[,"([26])(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]"]],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[23]|88"]],[,"(800)(\\d{2})(\\d{3})","$1 $2 $3",["80"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CN:[,[,,"[1-7]\\d{6,11}|8[0-357-9]\\d{6,9}|9\\d{7,10}","\\d{4,12}",
  20210. ,,,,,[7,8,9,10,11,12],[5,6]],[,,"21(?:100\\d{2}|95\\d{3,4}|\\d{8,10})|(?:10|2[02-57-9]|3(?:11|7[179])|4(?:[15]1|3[1-35])|5(?:1\\d|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|8(?:[57]1|98))(?:100\\d{2}|95\\d{3,4}|\\d{8})|(?:3(?:1[02-9]|35|49|5\\d|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|3[3-9]|5[2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[17]\\d|2[248]|3[04-9]|4[3-6]|5[0-4689]|6[2368]|9[02-9])|8(?:078|1[236-8]|2[5-7]|3\\d|5[1-9]|7[02-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100\\d{2}|95\\d{3,4}|\\d{7})|80(?:29|6[03578]|7[018]|81)\\d{4}",
  20211. "\\d{4,12}",,,"1012345678"],[,,"1(?:[38]\\d|4[57]|5[0-35-9]|7[0136-8])\\d{8}","\\d{11}",,,"13123456789",,,[11]],[,,"(?:10)?800\\d{7}","\\d{10,12}",,,"8001234567",,,[10,12]],[,,"16[08]\\d{5}","\\d{8}",,,"16812345",,,[8]],[,,"400\\d{7}|950\\d{7,8}|(?:10|2[0-57-9]|3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[4789]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[3678]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))96\\d{3,4}",
  20212. "\\d{7,11}",,,"4001234567",,,[7,8,9,10,11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CN",86,"(1(?:[129]\\d{3}|79\\d{2}))?00","0",,,"(1(?:[129]\\d{3}|79\\d{2}))|0",,"00",,[[,"(80\\d{2})(\\d{4})","$1 $2",["80[2678]"],"0$1","$CC $1",1],[,"([48]00)(\\d{3})(\\d{4})","$1 $2 $3",["[48]00"]],[,"(\\d{5,6})","$1",["100|95"]],[,"(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2\\d)[19]","(?:10|2\\d)(?:10|9[56])","(?:10|2\\d)(?:100|9[56])"],"0$1","$CC $1"],[,"(\\d{3})(\\d{5,6})","$1 $2",["[3-9]","[3-9]\\d{2}[19]",
  20213. "[3-9]\\d{2}(?:10|9[56])"],"0$1","$CC $1"],[,"(\\d{3,4})(\\d{4})","$1 $2",["[2-9]"]],[,"(21)(\\d{4})(\\d{4,6})","$1 $2 $3",["21"],"0$1","$CC $1",1],[,"([12]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["10[1-9]|2[02-9]","10[1-9]|2[02-9]","10(?:[1-79]|8(?:[1-9]|0[1-9]))|2[02-9]"],"0$1","$CC $1",1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|3|5[1-9]|7[02-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])"],
  20214. "0$1","$CC $1",1],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3(?:11|7[179])|4(?:[15]1|3[1-35])|5(?:1|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|8(?:[57]1|98)"],"0$1","$CC $1",1],[,"(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["807","8078"],"0$1","$CC $1",1],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-578]"],,"$CC $1"],[,"(10800)(\\d{3})(\\d{4})","$1 $2 $3",["108","1080","10800"]],[,"(\\d{3})(\\d{7,8})","$1 $2",["950"]]],[[,"(80\\d{2})(\\d{4})","$1 $2",["80[2678]"],"0$1","$CC $1",1],[,"([48]00)(\\d{3})(\\d{4})",
  20215. "$1 $2 $3",["[48]00"]],[,"(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2\\d)[19]","(?:10|2\\d)(?:10|9[56])","(?:10|2\\d)(?:100|9[56])"],"0$1","$CC $1"],[,"(\\d{3})(\\d{5,6})","$1 $2",["[3-9]","[3-9]\\d{2}[19]","[3-9]\\d{2}(?:10|9[56])"],"0$1","$CC $1"],[,"(21)(\\d{4})(\\d{4,6})","$1 $2 $3",["21"],"0$1","$CC $1",1],[,"([12]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["10[1-9]|2[02-9]","10[1-9]|2[02-9]","10(?:[1-79]|8(?:[1-9]|0[1-9]))|2[02-9]"],"0$1","$CC $1",1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|3|5[1-9]|7[02-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])"],
  20216. "0$1","$CC $1",1],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3(?:11|7[179])|4(?:[15]1|3[1-35])|5(?:1|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|8(?:[57]1|98)"],"0$1","$CC $1",1],[,"(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["807","8078"],"0$1","$CC $1",1],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-578]"],,"$CC $1"],[,"(10800)(\\d{3})(\\d{4})","$1 $2 $3",["108","1080","10800"]],[,"(\\d{3})(\\d{7,8})","$1 $2",["950"]]],[,,"NA","NA",,,,,,[-1]],,,[,,"(?:4|(?:10)?8)00\\d{7}|950\\d{7,8}","\\d{10,12}",
  20217. ,,"4001234567",,,[10,11,12]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CO:[,[,,"(?:[13]\\d{0,3}|[24-8])\\d{7}","\\d{7,11}",,,,,,[8,10,11],[7]],[,,"[124-8][2-9]\\d{6}","\\d{8}",,,"12345678",,,[8]],[,,"3(?:0[0-5]|1\\d|2[0-3]|5[01])\\d{7}","\\d{10}",,,"3211234567",,,[10]],[,,"1800\\d{7}","\\d{11}",,,"18001234567",,,[11]],[,,"19(?:0[01]|4[78])\\d{7}","\\d{11}",,,"19001234567",,,[11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CO",57,"00(?:4(?:[14]4|56)|[579])","0",
  20218. ,,"0([3579]|4(?:44|56))?",,,,[[,"(\\d)(\\d{7})","$1 $2",["1(?:8[2-9]|9[0-3]|[2-7])|[24-8]","1(?:8[2-9]|9(?:09|[1-3])|[2-7])|[24-8]"],"($1)","0$CC $1"],[,"(\\d{3})(\\d{7})","$1 $2",["3"],,"0$CC $1"],[,"(1)(\\d{3})(\\d{7})","$1-$2-$3",["1(?:80|9[04])","1(?:800|9(?:0[01]|4[78]))"],"0$1"]],[[,"(\\d)(\\d{7})","$1 $2",["1(?:8[2-9]|9[0-3]|[2-7])|[24-8]","1(?:8[2-9]|9(?:09|[1-3])|[2-7])|[24-8]"],"($1)","0$CC $1"],[,"(\\d{3})(\\d{7})","$1 $2",["3"],,"0$CC $1"],[,"(1)(\\d{3})(\\d{7})","$1 $2 $3",["1(?:80|9[04])",
  20219. "1(?:800|9(?:0[01]|4[78]))"]]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CR:[,[,,"[24-9]\\d{7,9}","\\d{8,10}",,,,,,[8,10]],[,,"2[0-24-7]\\d{6}","\\d{8}",,,"22123456",,,[8]],[,,"5(?:0[01]|7[0-3])\\d{5}|(?:[67][0-3]|8[3-9])\\d{6}","\\d{8}",,,"83123456",,,[8]],[,,"800\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,,"90[059]\\d{7}","\\d{10}",,,"9001234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"210[0-6]\\d{4}|4\\d{7}|5100\\d{4}",
  20220. "\\d{8}",,,"40001234",,,[8]],"CR",506,"00",,,,"(19(?:0[012468]|1[09]|20|66|77|99))",,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[24-7]|8[3-9]"],,"$CC $1"],[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]0"],,"$CC $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CU:[,[,,"[2-57]\\d{5,7}","\\d{4,8}",,,,,,[6,7,8],[4,5]],[,,"2[1-4]\\d{5,6}|3(?:1\\d{6}|[23]\\d{4,6})|4(?:[125]\\d{5,6}|[36]\\d{6}|[78]\\d{4,6})|7\\d{6,7}","\\d{4,8}",,,"71234567"],[,,"5\\d{7}",
  20221. "\\d{8}",,,"51234567",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CU",53,"119","0",,,"0",,,,[[,"(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],[,"(\\d{2})(\\d{4,6})","$1 $2",["[2-4]"],"(0$1)"],[,"(\\d)(\\d{7})","$1 $2",["5"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CV:[,[,,"[259]\\d{6}","\\d{7}",,,,,,[7]],[,,"2(?:2[1-7]|3[0-8]|4[12]|5[1256]|6\\d|7[1-3]|8[1-5])\\d{4}",
  20222. "\\d{7}",,,"2211234"],[,,"(?:9\\d|59)\\d{5}","\\d{7}",,,"9911234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CV",238,"0",,,,,,,,[[,"(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CW:[,[,,"[169]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"9(?:[48]\\d{2}|50\\d|7(?:2[0-24]|[34]\\d|6[35-7]|77|8[7-9]))\\d{4}","\\d{7,8}",,,"94151234",,,[8]],
  20223. [,,"9(?:5(?:[12467]\\d|3[01])|6(?:[15-9]\\d|3[01]))\\d{4}","\\d{7,8}",,,"95181234",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"60[0-2]\\d{4}","\\d{7}",,,"6001234",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CW",599,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[13-7]"]],[,"(9)(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],,[,,"955\\d{5}","\\d{7,8}",,,"95581234",,,[8]],1,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CX:[,[,,"[1458]\\d{5,9}","\\d{6,10}",
  20224. ,,,,,[6,7,8,9,10]],[,,"89164\\d{4}","\\d{8,9}",,,"891641234",,,[9]],[,,"14(?:5\\d|71)\\d{5}|4(?:[0-2]\\d|3[0-57-9]|4[47-9]|5[0-25-9]|6[6-9]|7[02-9]|8[147-9]|9[017-9])\\d{6}","\\d{9}",,,"412345678",,,[9]],[,,"180(?:0\\d{3}|2)\\d{3}","\\d{7,10}",,,"1800123456",,,[7,10]],[,,"190[0126]\\d{6}","\\d{10}",,,"1900123456",,,[10]],[,,"13(?:00\\d{2})?\\d{4}","\\d{6,10}",,,"1300123456",,,[6,8,10]],[,,"500\\d{6}","\\d{9}",,,"500123456",,,[9]],[,,"550\\d{6}","\\d{9}",,,"550123456",,,[9]],"CX",61,"(?:14(?:1[14]|34|4[17]|[56]6|7[47]|88))?001[14-689]",
  20225. "0",,,"0",,"0011",,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CY:[,[,,"[257-9]\\d{7}","\\d{8}",,,,,,[8]],[,,"2[2-6]\\d{6}","\\d{8}",,,"22345678"],[,,"9[4-79]\\d{6}","\\d{8}",,,"96123456"],[,,"800\\d{5}","\\d{8}",,,"80001234"],[,,"90[09]\\d{5}","\\d{8}",,,"90012345"],[,,"80[1-9]\\d{5}","\\d{8}",,,"80112345"],[,,"700\\d{5}","\\d{8}",,,"70012345"],[,,"NA","NA",,,,,,[-1]],"CY",357,"00",,,,,,,,[[,"(\\d{2})(\\d{6})","$1 $2"]],,[,,"NA","NA",,,,
  20226. ,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"(?:50|77)\\d{6}","\\d{8}",,,"77123456"],,,[,,"NA","NA",,,,,,[-1]]],CZ:[,[,,"[2-8]\\d{8}|9\\d{8,11}","\\d{9,12}",,,,,,[9,10,11,12]],[,,"2\\d{8}|(?:3[1257-9]|4[16-9]|5[13-9])\\d{7}","\\d{9,12}",,,"212345678",,,[9]],[,,"(?:60[1-8]|7(?:0[2-5]|[2379]\\d))\\d{6}","\\d{9,12}",,,"601123456",,,[9]],[,,"800\\d{6}","\\d{9,12}",,,"800123456",,,[9]],[,,"9(?:0[05689]|76)\\d{6}","\\d{9,12}",,,"900123456",,,[9]],[,,"8[134]\\d{7}","\\d{9,12}",,,"811234567",,,[9]],[,,"70[01]\\d{6}",
  20227. "\\d{9,12}",,,"700123456",,,[9]],[,,"9[17]0\\d{6}","\\d{9,12}",,,"910123456",,,[9]],"CZ",420,"00",,,,,,,,[[,"([2-9]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],[,"(96\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["96"]],[,"(9\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9[36]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"9(?:5\\d|7[234])\\d{6}","\\d{9,12}",,,"972123456",,,[9]],,,[,,"9(?:3\\d{9}|6\\d{7,10})","\\d{9,12}",,,"93123456789"]],DE:[,[,,"[1-35-9]\\d{3,14}|4(?:[0-8]\\d{4,12}|9(?:[0-37]\\d|4(?:[1-35-8]|4\\d?)|5\\d{1,2}|6[1-8]\\d?)\\d{2,8})",
  20228. "\\d{2,15}",,,,,,[4,5,6,7,8,9,10,11,12,13,14,15],[3]],[,,"[246]\\d{5,13}|3(?:0\\d{3,13}|2\\d{9}|[3-9]\\d{4,13})|5(?:0[2-8]|[1256]\\d|[38][0-8]|4\\d{0,2}|[79][0-7])\\d{3,11}|7(?:0[2-8]|[1-9]\\d)\\d{3,10}|8(?:0[2-9]|[1-9]\\d)\\d{3,10}|9(?:0[6-9]\\d{3,10}|1\\d{4,12}|[2-9]\\d{4,11})","\\d{2,15}",,,"30123456",,,[5,6,7,8,9,10,11,12,13,14,15]],[,,"1(?:5[0-25-9]\\d{8}|6[023]\\d{7,8}|7(?:[0-57-9]\\d?|6\\d)\\d{7})","\\d{10,11}",,,"15123456789",,,[10,11]],[,,"800\\d{7,12}","\\d{10,15}",,,"8001234567890",,,[10,
  20229. 11,12,13,14,15]],[,,"137[7-9]\\d{6}|900(?:[135]\\d{6}|9\\d{7})","\\d{10,11}",,,"9001234567",,,[10,11]],[,,"1(?:3(?:7[1-6]\\d{6}|8\\d{4})|80\\d{5,11})","\\d{7,14}",,,"18012345",,,[7,8,9,10,11,12,13,14]],[,,"700\\d{8}","\\d{11}",,,"70012345678",,,[11]],[,,"NA","NA",,,,,,[-1]],"DE",49,"00","0",,,"0",,,,[[,"(1\\d{2})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],[,"(15\\d{3})(\\d{6})","$1 $2",["15[0568]"],"0$1"],[,"(1\\d{3})(\\d{7})","$1 $2",["15"],"0$1"],[,"(\\d{2})(\\d{3,11})","$1 $2",["3[02]|40|[68]9"],"0$1"],
  20230. [,"(\\d{3})(\\d{3,11})","$1 $2",["2(?:\\d1|0[2389]|1[24]|28|34)|3(?:[3-9][15]|40)|[4-8][1-9]1|9(?:06|[1-9]1)"],"0$1"],[,"(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|[7-9](?:\\d[1-9]|[1-9]\\d)|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])","[24-6]|[7-9](?:\\d[1-9]|[1-9]\\d)|3(?:3(?:0[1-467]|2[127-9]|3[124578]|[46][1246]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|3[1357]|4[13578]|6[1246]|7[1356]|9[1346])|5(?:0[14]|2[1-3589]|3[1357]|4[1246]|6[1-4]|7[1346]|8[13568]|9[1246])|6(?:0[356]|2[1-489]|3[124-6]|4[1347]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|3[1357]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|4[1347]|6[0135-9]|7[1467]|8[136])|9(?:0[12479]|2[1358]|3[1357]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))"],
  20231. "0$1"],[,"(3\\d{4})(\\d{1,10})","$1 $2",["3"],"0$1"],[,"(800)(\\d{7,12})","$1 $2",["800"],"0$1"],[,"(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["(?:18|90)0|137","1(?:37|80)|900[1359]"],"0$1"],[,"(1\\d{2})(\\d{5,11})","$1 $2",["181"],"0$1"],[,"(18\\d{3})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],[,"(18\\d{2})(\\d{7})","$1 $2",["18[68]"],"0$1"],[,"(18\\d)(\\d{8})","$1 $2",["18[2-579]"],"0$1"],[,"(700)(\\d{4})(\\d{4})","$1 $2 $3",["700"],"0$1"],[,"(138)(\\d{4})","$1 $2",["138"],"0$1"],[,"(15[013-68])(\\d{2})(\\d{8})",
  20232. "$1 $2 $3",["15[013-68]"],"0$1"],[,"(15[279]\\d)(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],[,"(1[67]\\d)(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"]],,[,,"16(?:4\\d{1,10}|[89]\\d{1,11})","\\d{4,14}",,,"16412345",,,[4,5,6,7,8,9,10,11,12,13,14]],,,[,,"NA","NA",,,,,,[-1]],[,,"18(?:1\\d{5,11}|[2-9]\\d{8})","\\d{8,14}",,,"18500123456",,,[8,9,10,11,12,13,14]],,,[,,"1(?:5(?:(?:2\\d55|7\\d99|9\\d33)\\d{7}|(?:[034568]00|113)\\d{8})|6(?:013|255|399)\\d{7,8}|7(?:[015]13|[234]55|[69]33|[78]99)\\d{7,8})",
  20233. "\\d{12,13}",,,"177991234567",,,[12,13]]],DJ:[,[,,"[27]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:1[2-5]|7[45])\\d{5}","\\d{8}",,,"21360003"],[,,"77[0-26-8]\\d{5}","\\d{8}",,,"77831001"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"DJ",253,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],DK:[,[,,"[2-9]\\d{7}","\\d{8}",
  20234. ,,,,,[8]],[,,"(?:[2-7]\\d|8[126-9]|9[1-36-9])\\d{6}","\\d{8}",,,"32123456"],[,,"(?:[2-7]\\d|8[126-9]|9[1-36-9])\\d{6}","\\d{8}",,,"20123456"],[,,"80\\d{6}","\\d{8}",,,"80123456"],[,,"90\\d{6}","\\d{8}",,,"90123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"DK",45,"00",,,,,,,1,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],DM:[,[,,"[57-9]\\d{9}","\\d{7}(?:\\d{3})?",
  20235. ,,,,,[10],[7]],[,,"767(?:2(?:55|66)|4(?:2[01]|4[0-25-9])|50[0-4]|70[1-3])\\d{4}","\\d{7}(?:\\d{3})?",,,"7674201234"],[,,"767(?:2(?:[234689]5|7[5-7])|31[5-7]|61[2-7])\\d{4}","\\d{7}(?:\\d{3})?",,,"7672251234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"DM",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"767",[,,"NA",
  20236. "NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],DO:[,[,,"[589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"8(?:[04]9[2-9]\\d{6}|29(?:2(?:[0-59]\\d|6[04-9]|7[0-27]|8[0237-9])|3(?:[0-35-9]\\d|4[7-9])|[45]\\d{2}|6(?:[0-27-9]\\d|[3-5][1-9]|6[0135-8])|7(?:0[013-9]|[1-37]\\d|4[1-35689]|5[1-4689]|6[1-57-9]|8[1-79]|9[1-8])|8(?:0[146-9]|1[0-48]|[248]\\d|3[1-79]|5[01589]|6[013-68]|7[124-8]|9[0-8])|9(?:[0-24]\\d|3[02-46-9]|5[0-79]|60|7[0169]|8[57-9]|9[02-9]))\\d{4})","\\d{7}(?:\\d{3})?",
  20237. ,,"8092345678"],[,,"8[024]9[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"8092345678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"DO",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"8[024]9",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],DZ:[,[,,"(?:[1-4]|[5-9]\\d)\\d{7}","\\d{8,9}",,,,,,[8,9]],[,
  20238. ,"(?:1\\d|2[013-79]|3[0-8]|4[0135689])\\d{6}|9619\\d{5}","\\d{8,9}",,,"12345678"],[,,"(?:5[4-6]|7[7-9])\\d{7}|6(?:[569]\\d|7[0-6])\\d{6}","\\d{9}",,,"551234567",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"80[3-689]1\\d{5}","\\d{9}",,,"808123456",,,[9]],[,,"80[12]1\\d{5}","\\d{9}",,,"801123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"98[23]\\d{6}","\\d{9}",,,"983123456",,,[9]],"DZ",213,"00","0",,,"0",,,,[[,"([1-4]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],[,"([5-8]\\d{2})(\\d{2})(\\d{2})(\\d{2})",
  20239. "$1 $2 $3 $4",["[5-8]"],"0$1"],[,"(9\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],EC:[,[,,"1\\d{9,10}|[2-8]\\d{7}|9\\d{8}","\\d{7,11}",,,,,,[8,9,10,11],[7]],[,,"[2-7][2-7]\\d{6}","\\d{7,8}",,,"22123456",,,[8]],[,,"9(?:(?:39|[45][89]|7[7-9]|[89]\\d)\\d|6(?:[017-9]\\d|2[0-4]))\\d{5}","\\d{9}",,,"991234567",,,[9]],[,,"1800\\d{6,7}","\\d{10,11}",,,"18001234567",,,[10,11]],[,,"NA","NA",,,,
  20240. ,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"[2-7]890\\d{4}","\\d{8}",,,"28901234",,,[8]],"EC",593,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[247]|[356][2-8]"],"(0$1)"],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],[,"(1800)(\\d{3})(\\d{3,4})","$1 $2 $3",["1"],"$1"]],[[,"(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[247]|[356][2-8]"]],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],[,"(1800)(\\d{3})(\\d{3,4})","$1 $2 $3",["1"],"$1"]],[,,"NA","NA",,,,,,[-1]],,,[,,
  20241. "NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],EE:[,[,,"1\\d{3,4}|[3-9]\\d{6,7}|800\\d{6,7}","\\d{4,10}",,,,,,[4,5,7,8,10]],[,,"(?:3[23589]|4[3-8]|6\\d|7[1-9]|88)\\d{5}","\\d{7}",,,"3212345",,,[7]],[,,"(?:5\\d|8[1-5])\\d{6}|5(?:[02]\\d{2}|1(?:[0-8]\\d|95)|5[0-478]\\d|64[0-4]|65[1-589])\\d{3}","\\d{7,8}",,,"51234567",,,[7,8]],[,,"800(?:0\\d{3}|1\\d|[2-9])\\d{3}","\\d{7,10}",,,"80012345",,,[7,8,10]],[,,"(?:40\\d{2}|900)\\d{4}","\\d{7,8}",,,"9001234",,,[7,8]],[,,"NA","NA",,,
  20242. ,,,[-1]],[,,"70[0-2]\\d{5}","\\d{8}",,,"70012345",,,[8]],[,,"NA","NA",,,,,,[-1]],"EE",372,"00",,,,,,,,[[,"([3-79]\\d{2})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]"]],[,"(70)(\\d{2})(\\d{4})","$1 $2 $3",["70"]],[,"(8000)(\\d{3})(\\d{3})","$1 $2 $3",["800","8000"]],[,"([458]\\d{3})(\\d{3,4})","$1 $2",["40|5|8(?:00|[1-5])","40|5|8(?:00[1-9]|[1-5])"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"1\\d{3,4}|800[2-9]\\d{3}",
  20243. "\\d{4,7}",,,"8002123",,,[4,5,7]],[,,"1(?:2[01245]|3[0-6]|4[1-489]|5[0-59]|6[1-46-9]|7[0-27-9]|8[189]|9[012])\\d{1,2}","\\d{4,5}",,,"12123",,,[4,5]],,,[,,"NA","NA",,,,,,[-1]]],EG:[,[,,"1\\d{4,9}|[2456]\\d{8}|3\\d{7}|[89]\\d{8,9}","\\d{5,10}",,,,,,[5,8,9,10],[7]],[,,"(?:1(?:3[23]\\d|5(?:[23]|9\\d))|2[2-4]\\d{2}|3\\d{2}|4(?:0[2-5]|[578][23]|64)\\d|5(?:0[2-7]|[57][23])\\d|6[24-689]3\\d|8(?:2[2-57]|4[26]|6[237]|8[2-4])\\d|9(?:2[27]|3[24]|52|6[2356]|7[2-4])\\d)\\d{5}|1[69]\\d{3}","\\d{5,9}",,,"234567890",
  20244. ,,[5,8,9]],[,,"1(?:0[0-269]|1[0-245]|2[0-278])\\d{7}","\\d{10}",,,"1001234567",,,[10]],[,,"800\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,,"900\\d{7}","\\d{10}",,,"9001234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"EG",20,"00","0",,,"0",,,,[[,"(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1[012]|[89]00"],"0$1"],[,"(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|[89][2-9]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,
  20245. [-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],EH:[,[,,"[5-9]\\d{8}","\\d{9}",,,,,,[9]],[,,"528[89]\\d{5}","\\d{9}",,,"528812345"],[,,"(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[07][07]|6[12]))\\d{6}","\\d{9}",,,"650123456"],[,,"80\\d{7}","\\d{9}",,,"801234567"],[,,"89\\d{7}","\\d{9}",,,"891234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"5924[01]\\d{4}","\\d{9}",,,"592401234"],"EH",212,"00","0",,,"0",,,,,,[,,"NA","NA",,,,,,[-1]],,"528[89]",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],
  20246. ,,[,,"NA","NA",,,,,,[-1]]],ER:[,[,,"[178]\\d{6}","\\d{6,7}",,,,,,[7],[6]],[,,"1(?:1[12568]|20|40|55|6[146])\\d{4}|8\\d{6}","\\d{6,7}",,,"8370362"],[,,"17[1-3]\\d{4}|7\\d{6}","\\d{7}",,,"7123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"ER",291,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],ES:[,[,,"[5-9]\\d{8}",
  20247. "\\d{9}",,,,,,[9]],[,,"8(?:[13]0|[28][0-8]|[47][1-9]|5[01346-9]|6[0457-9])\\d{6}|9(?:[1238][0-8]\\d{6}|4[1-9]\\d{6}|5\\d{7}|6(?:[0-8]\\d{6}|9(?:0(?:[0-57-9]\\d{4}|6(?:0[0-8]|1[1-9]|[2-9]\\d)\\d{2})|[1-9]\\d{5}))|7(?:[124-9]\\d{2}|3(?:[0-8]\\d|9[1-9]))\\d{4})","\\d{9}",,,"810123456"],[,,"(?:6\\d{6}|7[1-4]\\d{5}|9(?:6906(?:09|10)|7390\\d{2}))\\d{2}","\\d{9}",,,"612345678"],[,,"[89]00\\d{6}","\\d{9}",,,"800123456"],[,,"80[367]\\d{6}","\\d{9}",,,"803123456"],[,,"90[12]\\d{6}","\\d{9}",,,"901123456"],
  20248. [,,"70\\d{7}","\\d{9}",,,"701234567"],[,,"NA","NA",,,,,,[-1]],"ES",34,"00",,,,,,,,[[,"([89]00)(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],[,"([5-9]\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[568]|[79][0-8]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"51\\d{7}","\\d{9}",,,"511234567"],,,[,,"NA","NA",,,,,,[-1]]],ET:[,[,,"[1-59]\\d{8}","\\d{7,9}",,,,,,[9],[7]],[,,"(?:11(?:1(?:1[124]|2[2-57]|3[1-5]|5[5-8]|8[6-8])|2(?:13|3[6-8]|5[89]|7[05-9]|8[2-6])|3(?:2[01]|3[0-289]|4[1289]|7[1-4]|87)|4(?:1[69]|3[2-49]|4[0-3]|6[5-8])|5(?:1[578]|44|5[0-4])|6(?:18|2[69]|39|4[5-7]|5[1-5]|6[0-59]|8[015-8]))|2(?:2(?:11[1-9]|22[0-7]|33\\d|44[1467]|66[1-68])|5(?:11[124-6]|33[2-8]|44[1467]|55[14]|66[1-3679]|77[124-79]|880))|3(?:3(?:11[0-46-8]|22[0-6]|33[0134689]|44[04]|55[0-6]|66[01467])|4(?:44[0-8]|55[0-69]|66[0-3]|77[1-5]))|4(?:6(?:22[0-24-7]|33[1-5]|44[13-69]|55[14-689]|660|88[1-4])|7(?:11[1-9]|22[1-9]|33[13-7]|44[13-6]|55[1-689]))|5(?:7(?:227|55[05]|(?:66|77)[14-8])|8(?:11[149]|22[013-79]|33[0-68]|44[013-8]|550|66[1-5]|77\\d)))\\d{4}",
  20249. "\\d{7,9}",,,"111112345"],[,,"9(?:[1-468]\\d|5[89])\\d{6}","\\d{9}",,,"911234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"ET",251,"00","0",,,"0",,,,[[,"([1-59]\\d)(\\d{3})(\\d{4})","$1 $2 $3",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],FI:[,[,,"1\\d{4,11}|[2-9]\\d{4,10}","\\d{5,12}",,,,,,[5,6,7,8,9,10,11,12]],[,,"1(?:[3569][1-8]\\d{3,9}|[47]\\d{5,10})|2[1-8]\\d{3,9}|3(?:[1-8]\\d{3,9}|9\\d{4,8})|[5689][1-8]\\d{3,9}",
  20250. "\\d{5,12}",,,"1312345678"],[,,"4\\d{5,10}|50\\d{4,8}","\\d{6,11}",,,"412345678",,,[6,7,8,9,10,11]],[,,"800\\d{4,7}","\\d{7,10}",,,"8001234567",,,[7,8,9,10]],[,,"[67]00\\d{5,6}","\\d{8,9}",,,"600123456",,,[8,9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"FI",358,"00|99(?:[02469]|5(?:11|33|5[59]|88|9[09]))","0",,,"0",,"00",,[[,"(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]00|[6-8]0)"],"0$1"],[,"(116\\d{3})","$1",["116"],"$1"],[,"(\\d{2})(\\d{4,10})","$1 $2",["[14]|2[09]|50|7[135]"],
  20251. "0$1"],[,"(\\d)(\\d{4,11})","$1 $2",["[25689][1-8]|3"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],1,,[,,"[13]00\\d{3,7}|2(?:0(?:0\\d{3,7}|2[023]\\d{1,6}|9[89]\\d{1,6}))|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"100123",,,[5,6,7,8,9,10]],[,,"[13]0\\d{4,8}|2(?:0(?:[016-8]\\d{3,7}|[2-59]\\d{2,7})|9\\d{4,8})|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"10112345",,,[5,6,7,8,9,10]],,,[,,"NA","NA",,,,,,[-1]]],FJ:[,[,,"[36-9]\\d{6}|0\\d{10}",
  20252. "\\d{7}(?:\\d{4})?",,,,,,[7,11]],[,,"(?:3[0-5]|6[25-7]|8[58])\\d{5}","\\d{7}",,,"3212345",,,[7]],[,,"(?:7[0-8]|8[034679]|9\\d)\\d{5}","\\d{7}",,,"7012345",,,[7]],[,,"0800\\d{7}","\\d{11}",,,"08001234567",,,[11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"FJ",679,"0(?:0|52)",,,,,,"00",,[[,"(\\d{3})(\\d{4})","$1 $2",["[36-9]"]],[,"(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],
  20253. 1,,[,,"NA","NA",,,,,,[-1]]],FK:[,[,,"[2-7]\\d{4}","\\d{5}",,,,,,[5]],[,,"[2-47]\\d{4}","\\d{5}",,,"31234"],[,,"[56]\\d{4}","\\d{5}",,,"51234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"FK",500,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],FM:[,[,,"[39]\\d{6}","\\d{7}",,,,,,[7]],[,,"3[2357]0[1-9]\\d{3}|9[2-6]\\d{5}","\\d{7}",,,"3201234"],[,,"3[2357]0[1-9]\\d{3}|9[2-7]\\d{5}",
  20254. "\\d{7}",,,"3501234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"FM",691,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],FO:[,[,,"[2-9]\\d{5}","\\d{6}",,,,,,[6]],[,,"(?:20|[3-4]\\d|8[19])\\d{4}","\\d{6}",,,"201234"],[,,"(?:[27][1-9]|5\\d)\\d{4}","\\d{6}",,,"211234"],[,,"80[257-9]\\d{3}","\\d{6}",,,"802123"],[,,"90(?:[1345][15-7]|2[125-7]|99)\\d{2}",
  20255. "\\d{6}",,,"901123"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"(?:6[0-36]|88)\\d{4}","\\d{6}",,,"601234"],"FO",298,"00",,,,"(10(?:01|[12]0|88))",,,,[[,"(\\d{6})","$1",,,"$CC $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],FR:[,[,,"[1-9]\\d{8}","\\d{9}",,,,,,[9]],[,,"[1-5]\\d{8}","\\d{9}",,,"123456789"],[,,"(?:6\\d|7[3-9])\\d{7}","\\d{9}",,,"612345678"],[,,"80[0-5]\\d{6}","\\d{9}",,,"801234567"],[,,"89[1-37-9]\\d{6}","\\d{9}",,,
  20256. "891123456"],[,,"8(?:1[019]|2[0156]|84|90)\\d{6}","\\d{9}",,,"810123456"],[,,"NA","NA",,,,,,[-1]],[,,"9\\d{8}","\\d{9}",,,"912345678"],"FR",33,"00","0",,,"0",,,,[[,"([1-79])(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"],[,"(1\\d{2})(\\d{3})","$1 $2",["11"],"$1"],[,"(8\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"]],[[,"([1-79])(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"],[,"(8\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"]],[,
  20257. ,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"80[6-9]\\d{6}","\\d{9}",,,"806123456"],,,[,,"NA","NA",,,,,,[-1]]],GA:[,[,,"0?\\d{7}","\\d{7,8}",,,,,,[7,8]],[,,"01\\d{6}","\\d{8}",,,"01441234",,,[8]],[,,"0?[2-7]\\d{6}","\\d{7,8}",,,"06031234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GA",241,"00",,,,,,,,[[,"(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",
  20258. ["0"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],GB:[,[,,"\\d{7,10}","\\d{4,10}",,,,,,[7,9,10],[4,5,6,8]],[,,"2(?:0[01378]|3[0189]|4[017]|8[0-46-9]|9[012])\\d{7}|1(?:(?:1(?:3[0-48]|[46][0-4]|5[012789]|7[0-49]|8[01349])|21[0-7]|31[0-8]|[459]1\\d|61[0-46-9]))\\d{6}|1(?:2(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-4789]|7[013-9]|9\\d)|3(?:0\\d|[25][02-9]|3[02-579]|[468][0-46-9]|7[1235679]|9[24578])|4(?:0[03-9]|[28][02-5789]|[37]\\d|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1235-9]|2[024-9]|3[015689]|4[02-9]|5[03-9]|6\\d|7[0-35-9]|8[0-468]|9[0-5789])|6(?:0[034689]|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0124578])|7(?:0[0246-9]|2\\d|3[023678]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-5789]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|2[02-689]|3[1-5789]|4[2-9]|5[0-579]|6[234789]|7[0124578]|8\\d|9[2-57]))\\d{6}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-4789]|8[345])))|3(?:638[2-5]|647[23]|8(?:47[04-9]|64[015789]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[123]))|5(?:24(?:3[2-79]|6\\d)|276\\d|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[567]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|955[0-4])|7(?:26(?:6[13-9]|7[0-7])|442\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|84(?:3[2-58]))|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}|176888[234678]\\d{2}|16977[23]\\d{3}",
  20259. "\\d{4,10}",,,"1212345678",,,[9,10]],[,,"7(?:[1-4]\\d\\d|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[04-9]\\d|1[02-9]|2[0-35-9]|3[0-689]))\\d{6}","\\d{10}",,,"7400123456",,,[10]],[,,"80(?:0(?:1111|\\d{6,7})|8\\d{7})|500\\d{6}","\\d{7}(?:\\d{2,3})?",,,"8001234567"],[,,"(?:87[123]|9(?:[01]\\d|8[2349]))\\d{7}","\\d{10}",,,"9012345678",,,[10]],[,,"8(?:4(?:5464\\d|[2-5]\\d{7})|70\\d{7})","\\d{7}(?:\\d{3})?",,,"8431234567",,,[7,10]],[,,"70\\d{8}",
  20260. "\\d{10}",,,"7012345678",,,[10]],[,,"56\\d{8}","\\d{10}",,,"5612345678",,,[10]],"GB",44,"00","0"," x",,"0",,,,[[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2|5[56]|7(?:0|6[013-9])","2|5[56]|7(?:0|6(?:[013-9]|2[0-35-9]))"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:1|\\d1)|3|9[018]"],"0$1"],[,"(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:387|5(?:24|39)|697|768|946)","1(?:3873|5(?:242|39[456])|697[347]|768[347]|9467)"],"0$1"],[,"(1\\d{3})(\\d{5,6})","$1 $2",["1"],"0$1"],[,"(7\\d{3})(\\d{6})",
  20261. "$1 $2",["7(?:[1-5789]|62)","7(?:[1-5789]|624)"],"0$1"],[,"(800)(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],[,"(845)(46)(4\\d)","$1 $2 $3",["845","8454","84546","845464"],"0$1"],[,"(8\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8(?:4[2-5]|7[0-3])"],"0$1"],[,"(80\\d)(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1"],[,"([58]00)(\\d{6})","$1 $2",["[58]00"],"0$1"]],,[,,"76(?:0[012]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\d{6}","\\d{10}",,,"7640123456",,,[10]],1,,[,,"NA","NA",,,,,,[-1]],[,
  20262. ,"(?:3[0347]|55)\\d{8}","\\d{10}",,,"5512345678",,,[10]],,,[,,"NA","NA",,,,,,[-1]]],GD:[,[,,"[4589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"473(?:2(?:3[0-2]|69)|3(?:2[89]|86)|4(?:[06]8|3[5-9]|4[0-49]|5[5-79]|68|73|90)|63[68]|7(?:58|84)|800|938)\\d{4}","\\d{7}(?:\\d{3})?",,,"4732691234"],[,,"473(?:4(?:0[2-79]|1[04-9]|20|58)|5(?:2[01]|3[3-8])|901)\\d{4}","\\d{7}(?:\\d{3})?",,,"4734031234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],
  20263. [,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"GD",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"473",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GE:[,[,,"[34578]\\d{8}","\\d{6,9}",,,,,,[9],[6]],[,,"(?:3(?:[256]\\d|4[124-9]|7[0-4])|4(?:1\\d|2[2-7]|3[1-79]|4[2-8]|7[239]|9[1-7]))\\d{6}","\\d{6,9}",,,"322123456"],[,,"5(?:14|5[01578]|68|7[0147-9]|9[0-35-9])\\d{6}","\\d{9}",,,"555123456"],[,,"800\\d{6}",
  20264. "\\d{9}",,,"800123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"706\\d{6}","\\d{9}",,,"706123456"],"GE",995,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"706\\d{6}","\\d{9}",,,"706123456"],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GF:[,[,,"[56]\\d{8}","\\d{9}",,,,,,[9]],
  20265. [,,"594(?:10|2[012457-9]|3[0-57-9]|4[3-9]|5[7-9]|6[0-3]|9[014])\\d{4}","\\d{9}",,,"594101234"],[,,"694(?:[04][0-7]|1[0-5]|3[018]|[29]\\d)\\d{4}","\\d{9}",,,"694201234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GF",594,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GG:[,[,,"[135789]\\d{6,9}",
  20266. "\\d{6,10}",,,,,,[7,9,10],[6]],[,,"1481\\d{6}","\\d{6,10}",,,"1481456789",,,[10]],[,,"7(?:781|839|911)\\d{6}","\\d{10}",,,"7781123456",,,[10]],[,,"80(?:0(?:1111|\\d{6,7})|8\\d{7})|500\\d{6}","\\d{7}(?:\\d{2,3})?",,,"8001234567"],[,,"(?:87[123]|9(?:[01]\\d|8[0-3]))\\d{7}","\\d{10}",,,"9012345678",,,[10]],[,,"8(?:4(?:5464\\d|[2-5]\\d{7})|70\\d{7})","\\d{7}(?:\\d{3})?",,,"8431234567",,,[7,10]],[,,"70\\d{8}","\\d{10}",,,"7012345678",,,[10]],[,,"56\\d{8}","\\d{10}",,,"5612345678",,,[10]],"GG",44,"00",
  20267. "0"," x",,"0",,,,,,[,,"76(?:0[012]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\d{6}","\\d{10}",,,"7640123456",,,[10]],,,[,,"NA","NA",,,,,,[-1]],[,,"(?:3[0347]|55)\\d{8}","\\d{10}",,,"5512345678",,,[10]],,,[,,"NA","NA",,,,,,[-1]]],GH:[,[,,"[235]\\d{8}|8\\d{7}","\\d{7,9}",,,,,,[8,9],[7]],[,,"3(?:0[237]\\d|[167](?:2[0-6]|7\\d)|2(?:2[0-5]|7\\d)|3(?:2[0-3]|7\\d)|4(?:2[013-9]|3[01]|7\\d)|5(?:2[0-7]|7\\d)|8(?:2[0-2]|7\\d)|9(?:20|7\\d))\\d{5}","\\d{7,9}",,,"302345678",,,[9]],[,,"(?:2[034678]\\d|5(?:[047]\\d|5[3-6]|6[01]))\\d{6}",
  20268. "\\d{9}",,,"231234567",,,[9]],[,,"800\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GH",233,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"],[,"(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"800\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GI:[,[,,"[2568]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:00\\d|1(?:6[24-7]|9\\d)|2(?:00|2[2457]))\\d{4}",
  20269. "\\d{8}",,,"20012345"],[,,"(?:5[46-8]|62)\\d{6}","\\d{8}",,,"57123456"],[,,"80\\d{6}","\\d{8}",,,"80123456"],[,,"8[1-689]\\d{6}","\\d{8}",,,"88123456"],[,,"87\\d{6}","\\d{8}",,,"87123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GI",350,"00",,,,,,,,[[,"(\\d{3})(\\d{5})","$1 $2",["2"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GL:[,[,,"[1-689]\\d{5}","\\d{6}",,,,,,[6]],[,,"(?:19|3[1-6]|6[14689]|8[14-79]|9\\d)\\d{4}","\\d{6}",,,"321000"],
  20270. [,,"[245][2-9]\\d{4}","\\d{6}",,,"221234"],[,,"80\\d{4}","\\d{6}",,,"801234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"3[89]\\d{4}","\\d{6}",,,"381234"],"GL",299,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GM:[,[,,"[2-9]\\d{6}","\\d{7}",,,,,,[7]],[,,"(?:4(?:[23]\\d{2}|4(?:1[024679]|[6-9]\\d))|5(?:54[0-7]|6(?:[67]\\d)|7(?:1[04]|2[035]|3[58]|48))|8\\d{3})\\d{3}",
  20271. "\\d{7}",,,"5661234"],[,,"[23679]\\d{6}","\\d{7}",,,"3012345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GM",220,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GN:[,[,,"[367]\\d{7,8}","\\d{8,9}",,,,,,[8,9]],[,,"30(?:24|3[12]|4[1-35-7]|5[13]|6[189]|[78]1|9[1478])\\d{4}","\\d{8}",,,"30241234",,,[8]],[,,"6[02356]\\d{7}","\\d{9}",
  20272. ,,"601123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"722\\d{6}","\\d{9}",,,"722123456",,,[9]],"GN",224,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GP:[,[,,"[56]\\d{8}","\\d{9}",,,,,,[9]],[,,"590(?:0[13468]|1[012]|2[0-68]|3[28]|4[0-8]|5[579]|6[0189]|70|8[0-689]|9\\d)\\d{4}",
  20273. "\\d{9}",,,"590201234"],[,,"690(?:0[0-7]|[1-9]\\d)\\d{4}","\\d{9}",,,"690301234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GP",590,"00","0",,,"0",,,,[[,"([56]90)(\\d{2})(\\d{4})","$1 $2-$3",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GQ:[,[,,"[23589]\\d{8}","\\d{9}",,,,,,[9]],[,,"3(?:3(?:3\\d[7-9]|[0-24-9]\\d[46])|5\\d{2}[7-9])\\d{4}","\\d{9}",,,"333091234"],
  20274. [,,"(?:222|55[15])\\d{6}","\\d{9}",,,"222123456"],[,,"80\\d[1-9]\\d{5}","\\d{9}",,,"800123456"],[,,"90\\d[1-9]\\d{5}","\\d{9}",,,"900123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GQ",240,"00",,,,,,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],[,"(\\d{3})(\\d{6})","$1 $2",["[89]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GR:[,[,,"[26-9]\\d{9}","\\d{10}",,,,,,[10]],[,,"2(?:1\\d{2}|2(?:2[1-46-9]|3[1-8]|4[1-7]|5[1-4]|6[1-8]|7[1-5]|[89][1-9])|3(?:1\\d|2[1-57]|[35][1-3]|4[13]|7[1-7]|8[124-6]|9[1-79])|4(?:1\\d|2[1-8]|3[1-4]|4[13-5]|6[1-578]|9[1-5])|5(?:1\\d|[29][1-4]|3[1-5]|4[124]|5[1-6])|6(?:1\\d|3[1245]|4[1-7]|5[13-9]|[269][1-6]|7[14]|8[1-5])|7(?:1\\d|2[1-5]|3[1-6]|4[1-7]|5[1-57]|6[135]|9[125-7])|8(?:1\\d|2[1-5]|[34][1-4]|9[1-57]))\\d{6}",
  20275. "\\d{10}",,,"2123456789"],[,,"69\\d{8}","\\d{10}",,,"6912345678"],[,,"800\\d{7}","\\d{10}",,,"8001234567"],[,,"90[19]\\d{7}","\\d{10}",,,"9091234567"],[,,"8(?:0[16]|12|25)\\d{7}","\\d{10}",,,"8011234567"],[,,"70\\d{8}","\\d{10}",,,"7012345678"],[,,"NA","NA",,,,,,[-1]],"GR",30,"00",,,,,,,,[[,"([27]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["2[2-9]1|[689]"]],[,"(2\\d{3})(\\d{6})","$1 $2",["2[2-9][02-9]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,
  20276. ,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GT:[,[,,"[2-7]\\d{7}|1[89]\\d{9}","\\d{8}(?:\\d{3})?",,,,,,[8,11]],[,,"[267][2-9]\\d{6}","\\d{8}",,,"22456789",,,[8]],[,,"[345]\\d{7}","\\d{8}",,,"51234567",,,[8]],[,,"18[01]\\d{8}","\\d{11}",,,"18001112222",,,[11]],[,,"19\\d{9}","\\d{11}",,,"19001112222",,,[11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GT",502,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[2-7]"]],[,"(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]],,[,,"NA",
  20277. "NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GU:[,[,,"[5689]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:56|7[1-9]|8[236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[5-9])|7(?:[079]7|2[0167]|3[45]|47|8[789])|8(?:[2-5789]8|6[48])|9(?:2[29]|6[79]|7[179]|8[789]|9[78]))\\d{4}","\\d{7}(?:\\d{3})?",,,"6713001234"],[,,"671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:56|7[1-9]|8[236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[5-9])|7(?:[079]7|2[0167]|3[45]|47|8[789])|8(?:[2-5789]8|6[48])|9(?:2[29]|6[79]|7[179]|8[789]|9[78]))\\d{4}",
  20278. "\\d{7}(?:\\d{3})?",,,"6713001234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"GU",1,"011","1",,,"1",,,1,,,[,,"NA","NA",,,,,,[-1]],,"671",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GW:[,[,,"(?:4(?:0\\d{5}|4\\d{7})|9\\d{8})","\\d{7,9}",,,,,,[7,9]],[,,"443(?:2[0125]|3[1245]|4[12]|5[1-4]|70|9[1-467])\\d{4}",
  20279. "\\d{9}",,,"443201234",,,[9]],[,,"9(?:55\\d|6(?:6\\d|9[012])|77\\d)\\d{5}","\\d{9}",,,"955012345",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"40\\d{5}","\\d{7}",,,"4012345",,,[7]],"GW",245,"00",,,,,,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["44|9[567]"]],[,"(\\d{3})(\\d{4})","$1 $2",["40"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GY:[,[,,"[2-4679]\\d{6}","\\d{7}",,,,,,[7]],
  20280. [,,"(?:2(?:1[6-9]|2[0-35-9]|3[1-4]|5[3-9]|6\\d|7[0-24-79])|3(?:2[25-9]|3\\d)|4(?:4[0-24]|5[56])|77[1-57])\\d{4}","\\d{7}",,,"2201234"],[,,"6\\d{6}","\\d{7}",,,"6091234"],[,,"(?:289|862)\\d{4}","\\d{7}",,,"2891234"],[,,"9008\\d{3}","\\d{7}",,,"9008123"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GY",592,"001",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],HK:[,[,,"[235-7]\\d{7}|8\\d{7,8}|9\\d{4,10}",
  20281. "\\d{5,11}",,,,,,[5,6,7,8,9,11]],[,,"(?:[23]\\d|58)\\d{6}","\\d{8}",,,"21234567",,,[8]],[,,"(?:5[1-79]\\d|6\\d{2}|8[4-79]\\d|9(?:0[1-9]|[1-8]\\d))\\d{5}","\\d{8}",,,"51234567",,,[8]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"900(?:[0-24-9]\\d{7}|3\\d{1,4})","\\d{5,11}",,,"90012345678",,,[5,6,7,8,11]],[,,"NA","NA",,,,,,[-1]],[,,"8[1-3]\\d{6}","\\d{8}",,,"81123456",,,[8]],[,,"NA","NA",,,,,,[-1]],"HK",852,"00(?:[126-9]|30|5[09])?",,,,,,"00",,[[,"(\\d{4})(\\d{4})","$1 $2",["[235-7]|[89](?:0[1-9]|[1-9])"]],
  20282. [,"(800)(\\d{3})(\\d{3})","$1 $2 $3",["800"]],[,"(900)(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["900"]],[,"(900)(\\d{2,5})","$1 $2",["900"]]],,[,,"7\\d{7}","\\d{8}",,,"71234567",,,[8]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],HN:[,[,,"[237-9]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:2(?:0[019]|1[1-36]|[23]\\d|4[056]|5[57]|7[01389]|8[0146-9]|9[012])|4(?:07|2[3-59]|3[13-689]|4[0-68]|5[1-35])|5(?:16|4[3-5]|5\\d|6[4-6]|74)|6(?:[056]\\d|17|3[04]|4[0-378]|[78][0-8]|9[01])|7(?:6[46-9]|7[02-9]|8[034])|8(?:79|8[0-35789]|9[1-57-9]))\\d{4}",
  20283. "\\d{8}",,,"22123456"],[,,"[37-9]\\d{7}","\\d{8}",,,"91234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"HN",504,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1-$2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],HR:[,[,,"[1-7]\\d{5,8}|[89]\\d{6,11}","\\d{6,12}",,,,,,[6,7,8,9,10,11,12]],[,,"1\\d{7}|(?:2[0-3]|3[1-5]|4[02-47-9]|5[1-3])\\d{6,7}","\\d{6,9}",,,"12345678",,,[8,9]],
  20284. [,,"9(?:[1-9]\\d{6,10}|01\\d{6,9})","\\d{8,12}",,,"912345678",,,[8,9,10,11,12]],[,,"80[01]\\d{4,7}","\\d{7,10}",,,"8001234567",,,[7,8,9,10]],[,,"6(?:[01459]\\d{4,7})","\\d{6,9}",,,"611234",,,[6,7,8,9]],[,,"NA","NA",,,,,,[-1]],[,,"7[45]\\d{4,7}","\\d{6,9}",,,"741234567",,,[6,7,8,9]],[,,"NA","NA",,,,,,[-1]],"HR",385,"00","0",,,"0",,,,[[,"(1)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],[,"(6[09])(\\d{4})(\\d{3})","$1 $2 $3",["6[09]"],"0$1"],[,"([67]2)(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]2"],"0$1"],[,"([2-5]\\d)(\\d{3})(\\d{3,4})",
  20285. "$1 $2 $3",["[2-5]"],"0$1"],[,"(9\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],[,"(9\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9"],"0$1"],[,"(9\\d)(\\d{3,4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"],"0$1"],[,"(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[0145]|7"],"0$1"],[,"(\\d{2})(\\d{3,4})(\\d{3})","$1 $2 $3",["6[0145]|7"],"0$1"],[,"(80[01])(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],[,"(80[01])(\\d{3,4})(\\d{3})","$1 $2 $3",["8"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"[76]2\\d{6,7}",
  20286. "\\d{8,9}",,,"62123456",,,[8,9]],,,[,,"NA","NA",,,,,,[-1]]],HT:[,[,,"[2-489]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:[248]\\d|5[1-5]|94)\\d{5}","\\d{8}",,,"22453300"],[,,"(?:3[1-9]\\d|4\\d{2}|9(?:8[0-35]|9[5-9]))\\d{5}","\\d{8}",,,"34101234"],[,,"8\\d{7}","\\d{8}",,,"80012345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"98[89]\\d{5}","\\d{8}",,,"98901234"],"HT",509,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],
  20287. [,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],HU:[,[,,"[1-9]\\d{7,8}","\\d{6,9}",,,,,,[8,9],[6]],[,,"(?:1\\d|2[2-9]|3[2-7]|4[24-9]|5[2-79]|6[23689]|7[2-9]|8[2-57-9]|9[2-69])\\d{6}","\\d{6,8}",,,"12345678",,,[8]],[,,"(?:[257]0|3[01])\\d{7}","\\d{9}",,,"201234567",,,[9]],[,,"[48]0\\d{6}","\\d{8}",,,"80123456",,,[8]],[,,"9[01]\\d{6}","\\d{8}",,,"90123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"21\\d{7}","\\d{9}",,,"211234567",,,[9]],"HU",36,"00","06",,,"06",,,,[[,"(1)(\\d{3})(\\d{4})",
  20288. "$1 $2 $3",["1"],"($1)"],[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"($1)"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"[48]0\\d{6}","\\d{8}",,,"80123456",,,[8]],[,,"38\\d{7}","\\d{6,9}",,,"381234567",,,[9]],,,[,,"NA","NA",,,,,,[-1]]],ID:[,[,,"(?:[1-79]\\d{6,10}|8\\d{7,11})","\\d{5,12}",,,,,,[7,8,9,10,11,12],[5,6]],[,,"2(?:1(?:14\\d{3}|[0-8]\\d{6,7}|500\\d{3}|9\\d{6})|2\\d{6,8}|4\\d{7,8})|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\d|9[1-8])|3(?:1|[25][1-8]|3[1-68]|4[1-3]|6[1-3568]|7[0-469]|8\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|43|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[124-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:19?|[25]\\d|3[1-69]|4[1-6])|7(?:02|[125][1-9]|[36]\\d|4[1-8]|7[0-36-9])|9(?:0[12]|1[013-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\d{5,8}",
  20289. "\\d{5,11}",,,"612345678",,,[7,8,9,10,11]],[,,"(?:2(?:1(?:3[145]|4[01]|5[1-469]|60|8[0359]|9\\d)|2(?:88|9[1256])|3[1-4]9|4(?:36|91)|5(?:1[349]|[2-4]9)|6[0-7]9|7(?:[1-36]9|4[39])|8[1-5]9|9[1-48]9)|3(?:19[1-3]|2[12]9|3[13]9|4(?:1[69]|39)|5[14]9|6(?:1[69]|2[89])|709)|4[13]19|5(?:1(?:19|8[39])|4[129]9|6[12]9)|6(?:19[12]|2(?:[23]9|77))|7(?:1[13]9|2[15]9|419|5(?:1[89]|29)|6[15]9|7[178]9))\\d{5,6}|8[1-35-9]\\d{7,10}","\\d{9,12}",,,"812345678",,,[9,10,11,12]],[,,"177\\d{6,8}|800\\d{5,7}","\\d{8,11}",,,"8001234567",
  20290. ,,[8,9,10,11]],[,,"809\\d{7}","\\d{10}",,,"8091234567",,,[10]],[,,"804\\d{7}","\\d{10}",,,"8041234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"ID",62,"0(?:0[1789]|10(?:00|1[67]))","0",,,"0",,,,[[,"(\\d{2})(\\d{5,8})","$1 $2",["2[124]|[36]1"],"(0$1)"],[,"(\\d{3})(\\d{5,8})","$1 $2",["[4579]|2[035-9]|[36][02-9]"],"(0$1)"],[,"(8\\d{2})(\\d{3,4})(\\d{3,5})","$1-$2-$3",["8[1-35-9]"],"0$1"],[,"(1)(500)(\\d{3})","$1 $2 $3",["15"],"$1"],[,"(177)(\\d{6,8})","$1 $2",["17"],"0$1"],[,"(800)(\\d{5,7})",
  20291. "$1 $2",["800"],"0$1"],[,"(804)(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],[,"(80\\d)(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80[79]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"8071\\d{6}","\\d{10}",,,"8071123456",,,[10]],[,,"1500\\d{3}|8071\\d{6}","\\d{7,10}",,,"8071123456",,,[7,10]],,,[,,"NA","NA",,,,,,[-1]]],IE:[,[,,"[124-9]\\d{6,9}","\\d{5,10}",,,,,,[7,8,9,10],[5,6]],[,,"1\\d{7,8}|2(?:1\\d{6,7}|3\\d{7}|[24-9]\\d{5})|4(?:0[24]\\d{5}|[1-469]\\d{7}|5\\d{6}|7\\d{5}|8[0-46-9]\\d{7})|5(?:0[45]\\d{5}|1\\d{6}|[23679]\\d{7}|8\\d{5})|6(?:1\\d{6}|[237-9]\\d{5}|[4-6]\\d{7})|7[14]\\d{7}|9(?:1\\d{6}|[04]\\d{7}|[35-9]\\d{5})",
  20292. "\\d{5,10}",,,"2212345"],[,,"8(?:22\\d{6}|[35-9]\\d{7})","\\d{9}",,,"850123456",,,[9]],[,,"1800\\d{6}","\\d{10}",,,"1800123456",,,[10]],[,,"15(?:1[2-8]|[2-8]0|9[089])\\d{6}","\\d{10}",,,"1520123456",,,[10]],[,,"18[59]0\\d{6}","\\d{10}",,,"1850123456",,,[10]],[,,"700\\d{6}","\\d{9}",,,"700123456",,,[9]],[,,"76\\d{7}","\\d{9}",,,"761234567",,,[9]],"IE",353,"00","0",,,"0",,,,[[,"(1)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],[,"(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],
  20293. [,"(\\d{3})(\\d{5})","$1 $2",["40[24]|50[45]"],"(0$1)"],[,"(48)(\\d{4})(\\d{4})","$1 $2 $3",["48"],"(0$1)"],[,"(818)(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[24-69]|7[14]"],"(0$1)"],[,"([78]\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["76|8[35-9]"],"0$1"],[,"(700)(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],[,"(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:8[059]|5)","1(?:8[059]0|5)"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"18[59]0\\d{6}","\\d{10}",,,"1850123456",,,
  20294. [10]],[,,"818\\d{6}","\\d{9}",,,"818123456",,,[9]],,,[,,"8[35-9]\\d{8}","\\d{10}",,,"8501234567",,,[10]]],IL:[,[,,"[17]\\d{6,9}|[2-589]\\d{3}(?:\\d{3,6})?|6\\d{3}","\\d{4,10}",,,,,,[4,7,8,9,10]],[,,"[2-489]\\d{7}","\\d{7,8}",,,"21234567",,,[8]],[,,"5(?:[02-47-9]\\d{2}|5(?:01|2[23]|3[2-4]|4[45]|5[5689]|6[67]|7[0178]|8[6-9]|9[4-9])|6[2-9]\\d)\\d{5}","\\d{9}",,,"501234567",,,[9]],[,,"1(?:80[019]\\d{3}|255)\\d{3}","\\d{7,10}",,,"1800123456",,,[7,10]],[,,"1(?:212|(?:9(?:0[01]|19)|200)\\d{2})\\d{4}","\\d{8,10}",
  20295. ,,"1919123456",,,[8,9,10]],[,,"1700\\d{6}","\\d{10}",,,"1700123456",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"7(?:18\\d|2[23]\\d|3[237]\\d|47\\d|6(?:5\\d|8[0168])|7\\d{2}|8(?:2\\d|33|55|77|81)|9[29]\\d)\\d{5}","\\d{9}",,,"771234567",,,[9]],"IL",972,"0(?:0|1[2-9])","0",,,"0",,,,[[,"([2-489])(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],[,"([57]\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],[,"(1)([7-9]\\d{2})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"],"$1"],[,"(1255)(\\d{3})","$1-$2",["125"],"$1"],[,
  20296. "(1200)(\\d{3})(\\d{3})","$1-$2-$3",["120"],"$1"],[,"(1212)(\\d{2})(\\d{2})","$1-$2-$3",["121"],"$1"],[,"(1599)(\\d{6})","$1-$2",["15"],"$1"],[,"(\\d{4})","*$1",["[2-689]"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"1700\\d{6}|[2-689]\\d{3}","\\d{4,10}",,,"1700123456",,,[4,10]],[,,"[2-689]\\d{3}|1599\\d{6}","\\d{4}(?:\\d{6})?",,,"1599123456",,,[4,10]],,,[,,"NA","NA",,,,,,[-1]]],IM:[,[,,"[135789]\\d{6,9}","\\d{6,10}",,,,,,[10],[6]],[,,"1624\\d{6}","\\d{6,10}",,,"1624456789"],[,,"7[569]24\\d{6}","\\d{10}",
  20297. ,,"7924123456"],[,,"808162\\d{4}","\\d{10}",,,"8081624567"],[,,"(?:872299|90[0167]624)\\d{4}","\\d{10}",,,"9016247890"],[,,"8(?:4(?:40[49]06|5624\\d)|70624\\d)\\d{3}","\\d{10}",,,"8456247890"],[,,"70\\d{8}","\\d{10}",,,"7012345678"],[,,"56\\d{8}","\\d{10}",,,"5612345678"],"IM",44,"00","0"," x",,"0",,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"3(?:08162\\d|3\\d{5}|4(?:40[49]06|5624\\d)|7(?:0624\\d|2299\\d))\\d{3}|55\\d{8}","\\d{10}",,,"5512345678"],,,[,,"NA","NA",,,,,,[-1]]],IN:[,[,,
  20298. "008\\d{9}|1\\d{7,12}|[2-9]\\d{9,10}","\\d{6,13}",,,,,,[8,9,10,11,12,13],[6,7]],[,,"(?:11|2[02]|33|4[04]|79)[2-7]\\d{7}|80[2-467]\\d{7}|(?:1(?:2[0-249]|3[0-25]|4[145]|[59][14]|6[014]|7[1257]|8[01346])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|[36][25]|22|4[28]|5[12]|[78]1|9[15])|6(?:12|[2345]1|57|6[13]|7[14]|80)|7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91))[2-7]\\d{6}|(?:(?:1(?:2[35-8]|3[346-9]|4[236-9]|[59][0235-9]|6[235-9]|7[34689]|8[257-9])|2(?:1[134689]|3[24-8]|4[2-8]|5[25689]|6[2-4679]|7[13-79]|8[2-479]|9[235-9])|3(?:01|1[79]|2[1-5]|4[25-8]|5[125689]|6[235-7]|7[157-9]|8[2-467])|4(?:1[14578]|2[5689]|3[2-467]|5[4-7]|6[35]|73|8[2689]|9[2389])|5(?:[16][146-9]|2[14-8]|3[1346]|4[14-69]|5[46]|7[2-4]|8[2-8]|9[246])|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|[57][2-689]|6[24-578]|8[1-6])|8(?:1[1357-9]|2[235-8]|3[03-57-9]|4[0-24-9]|5\\d|6[2457-9]|7[1-6]|8[1256]|9[2-4]))\\d|7(?:(?:1[013-9]|2[0235-9]|3[2679]|4[1-35689]|5[2-46-9]|[67][02-9]|9\\d)\\d|8(?:2[0-6]|[013-8]\\d)))[2-7]\\d{5}",
  20299. "\\d{6,10}",,,"1123456789",,,[10]],[,,"(?:7(?:0\\d{3}|2(?:[0235679]\\d{2}|[14][017-9]\\d|8(?:[0-59]\\d|6[089]|78)|9[389]\\d)|3(?:[05-8]\\d{2}|1(?:[089]\\d|7[5-8])|2(?:[5-8]\\d|[01][089])|3(?:07|[17-9]\\d)|4(?:[07-9]\\d|11)|9(?:[01689]\\d|59|70))|4(?:0[1-9]\\d|1(?:[015-9]\\d|2[089]|4[08])|2(?:09|[1-7][089]|[89]\\d)|3(?:[0-8][089]|9\\d)|4(?:[089]\\d|11|7[02-8])|5(?:0[089]|[59]9)|7(?:0[3-9]|11|7[02-8]|[89]\\d)|8(?:[0-24-7][089]|[389]\\d)|9(?:[0-6][089]|7[08]|[89]\\d))|5(?:[034678]\\d|2[03-9]|5[017-9]|9[7-9])\\d|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589]|[6-9]\\d)\\d|7(?:0[2-9]|[1-79]\\d|8[1-9])\\d|8(?:[0-79]\\d{2}|88[01])|99[4-9]\\d)|8(?:0(?:[01589]\\d|6[67])|1(?:[02-57-9]\\d|1[0135-9])|2(?:[236-9]\\d|5[1-9])|3(?:[0357-9]\\d|4[1-9])|[45]\\d{2}|6[02457-9]\\d|7(?:07|[1-69]\\d)|8(?:[0-26-9]\\d|44|5[2-9])|9(?:[035-9]\\d|2[2-9]|4[0-8]))\\d|9\\d{4})\\d{5}",
  20300. "\\d{10}",,,"9987654321",,,[10]],[,,"00800\\d{7}|1(?:600\\d{6}|80(?:0\\d{4,9}|3\\d{9}))","\\d{8,13}",,,"1800123456"],[,,"186[12]\\d{9}","\\d{13}",,,"1861123456789",,,[13]],[,,"1860\\d{7}","\\d{11}",,,"18603451234",,,[11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"IN",91,"00","0",,,"0",,,,[[,"(\\d{5})(\\d{5})","$1 $2",["7(?:[023578]|4[0-57-9]|6[0-35-9]|99)|8(?:0[015689]|1[0-57-9]|2[2356-9]|3[0-57-9]|[45]|6[02457-9]|7[01-69]|8[0-24-9]|9[02-9])|9","7(?:[08]|2(?:[0235679]|[14][017-9]|8[0-79]|9[389])|3(?:[05-8]|1[07-9]|2[015-8]|[34][017-9]|9[015-9])|4(?:0[1-9]|1[0-24-9]|[2389]|[47][017-9]|5[059])|5(?:[034678]|2[03-9]|5[017-9]|9[7-9])|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589]|[6-9])|7(?:0[2-9]|[1-79]|8[1-9])|99[4-9])|8(?:0(?:[01589]|6[67])|1(?:[02-57-9]|1[0135-9])|2(?:[236-9]|5[1-9])|3(?:[0357-9]|4[1-9])|[45]|6[02457-9]|7(?:07|[1-69])|8(?:[0-26-9]|44|5[2-9])|9(?:[035-9]|2[2-9]|4[0-8]))|9",
  20301. "7(?:0|2(?:[0235679]|[14][017-9]|8(?:[0-569]|78)|9[389])|3(?:[05-8]|1(?:[089]|7[5-9])|2(?:[5-8]|[01][089])|3[017-9]|4(?:[07-9]|11)|9(?:[01689]|59|70))|4(?:0[1-9]|1(?:[015-9]|2[089]|4[08])|2(?:09|[1-7][089]|[89])|3(?:[0-8][089]|9)|4(?:[089]|11|7[02-8])|5(?:0[089]|[59]9)|7(?:0[3-9]|11|7[02-8]|[89])|8(?:[0-24-7][089]|[389])|9(?:[0-6][089]|7[08]|[89]))|5(?:[034678]|2[03-9]|5[017-9]|9[7-9])|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589]|[6-9])|7(?:0[2-9]|[1-79]|8[1-9])|8(?:[0-79]|88[01])|99[4-9])|8(?:0(?:[01589]|6[67])|1(?:[02-57-9]|1[0135-9])|2(?:[236-9]|5[1-9])|3(?:[0357-9]|4[1-9])|[45]|6[02457-9]|7(?:07|[1-69])|8(?:[0-26-9]|44|5[2-9])|9(?:[035-9]|2[2-9]|4[0-8]))|9"],
  20302. "0$1",,1],[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79|80[2-46]"],"0$1",,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[569][14]|7[1257]|8[1346]|[68][1-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|[36][25]|22|4[28]|5[12]|[78]1|9[15])|6(?:12|[2345]1|57|6[13]|7[14]|80)"],"0$1",,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",
  20303. ["7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1|88)","7(?:12|2[14]|3[134]|4[47]|5(?:1|5[2-6])|[67]1|88)"],"0$1",,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)"],"0$1",,1],[,"(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[23579]|[468][1-9])|[2-8]"],"0$1",,1],[,"(\\d{2})(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3 $4",["008"],"0$1",,1],[,"(1600)(\\d{2})(\\d{4})","$1 $2 $3",["160","1600"],"$1",,1],[,"(1800)(\\d{4,5})","$1 $2",["180","1800"],"$1",,1],[,"(18[06]0)(\\d{2,4})(\\d{4})",
  20304. "$1 $2 $3",["18[06]","18[06]0"],"$1",,1],[,"(140)(\\d{3})(\\d{4})","$1 $2 $3",["140"],"$1",,1],[,"(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18[06]","18(?:0[03]|6[12])"],"$1",,1]],,[,,"NA","NA",,,,,,[-1]],,,[,,"00800\\d{7}|1(?:600\\d{6}|8(?:0(?:0\\d{4,9}|3\\d{9})|6(?:0\\d{7}|[12]\\d{9})))","\\d{8,13}",,,"1800123456"],[,,"140\\d{7}","\\d{10}",,,"1409305260",,,[10]],1,,[,,"NA","NA",,,,,,[-1]]],IO:[,[,,"3\\d{6}","\\d{7}",,,,,,[7]],[,,"37\\d{5}","\\d{7}",,,"3709100"],[,,"38\\d{5}","\\d{7}",,,"3801234"],
  20305. [,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"IO",246,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],IQ:[,[,,"[1-7]\\d{7,9}","\\d{6,10}",,,,,,[8,9,10],[6,7]],[,,"1\\d{7}|(?:2[13-5]|3[02367]|4[023]|5[03]|6[026])\\d{6,7}","\\d{6,9}",,,"12345678",,,[8,9]],[,,"7[3-9]\\d{8}","\\d{10}",,,"7912345678",,,[10]],[,,"NA","NA",,,,,,[-1]],
  20306. [,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"IQ",964,"00","0",,,"0",,,,[[,"(1)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],[,"([2-6]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],[,"(7\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],IR:[,[,,"[1-8]\\d{9}|9(?:[0-4]\\d{8}|9\\d{2,8})","\\d{4,10}",,,,,,[4,5,6,7,8,9,10]],[,,"(?:1[137]|2[13-68]|3[1458]|4[145]|5[146-8]|6[146]|7[1467]|8[13467])\\d{8}",
  20307. "\\d{10}",,,"2123456789",,,[10]],[,,"9(?:0[1-3]|[13]\\d|2[0-2]|90)\\d{7}","\\d{10}",,,"9123456789",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"(?:[2-6]0\\d|993)\\d{7}","\\d{10}",,,"9932123456",,,[10]],"IR",98,"00","0",,,"0",,,,[[,"(21)(\\d{3,5})","$1 $2",["21"],"0$1"],[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["9"],"0$1"],[,
  20308. "(\\d{3})(\\d{3})","$1 $2",["9"],"0$1"]],,[,,"943\\d{7}","\\d{10}",,,"9432123456",,,[10]],,,[,,"NA","NA",,,,,,[-1]],[,,"9990\\d{0,6}","\\d{4,10}",,,"9990123456"],,,[,,"NA","NA",,,,,,[-1]]],IS:[,[,,"[4-9]\\d{6}|38\\d{7}","\\d{7,9}",,,,,,[7,9]],[,,"(?:4(?:1[0-24-6]|2[0-7]|[37][0-8]|4[0-245]|5[0-68]|6\\d|8[0-36-8])|5(?:05|[156]\\d|2[02578]|3[013-79]|4[03-7]|7[0-2578]|8[0-35-9]|9[013-689])|87[23])\\d{4}","\\d{7}",,,"4101234",,,[7]],[,,"38[589]\\d{6}|(?:6(?:1[1-8]|2[056]|3[089]|4[0167]|5[0159]|[67][0-69]|9\\d)|7(?:5[057]|6[0-2]|[78]\\d)|8(?:2[0-59]|3[0-4]|[469]\\d|5[1-9]))\\d{4}",
  20309. "\\d{7,9}",,,"6111234"],[,,"800\\d{4}","\\d{7}",,,"8001234",,,[7]],[,,"90\\d{5}","\\d{7}",,,"9011234",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"49\\d{5}","\\d{7}",,,"4921234",,,[7]],"IS",354,"1(?:0(?:01|10|20)|100)|00",,,,,,"00",,[[,"(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],[,"(3\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"809\\d{4}","\\d{7}",,,"8091234",,,[7]],,,[,,"(?:6(?:2[1-478]|49|8\\d)|8(?:7[0189]|80)|95[48])\\d{4}","\\d{7}",
  20310. ,,"6211234",,,[7]]],IT:[,[,,"[01589]\\d{5,10}|3(?:[12457-9]\\d{8}|[36]\\d{7,9})","\\d{6,11}",,,,,,[6,7,8,9,10,11]],[,,"0(?:[26]\\d{4,9}|(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2346]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[34578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7})",
  20311. "\\d{6,11}",,,"0212345678"],[,,"3(?:[12457-9]\\d{8}|6\\d{7,8}|3\\d{7,9})","\\d{9,11}",,,"3123456789",,,[9,10,11]],[,,"80(?:0\\d{6}|3\\d{3})","\\d{6,9}",,,"800123456",,,[6,9]],[,,"0878\\d{5}|1(?:44|6[346])\\d{6}|89(?:2\\d{3}|4(?:[0-4]\\d{2}|[5-9]\\d{4})|5(?:[0-4]\\d{2}|[5-9]\\d{6})|9\\d{6})","\\d{6,10}",,,"899123456",,,[6,8,9,10]],[,,"84(?:[08]\\d{6}|[17]\\d{3})","\\d{6,9}",,,"848123456",,,[6,9]],[,,"1(?:78\\d|99)\\d{6}","\\d{9,10}",,,"1781234567",,,[9,10]],[,,"55\\d{8}","\\d{10}",,,"5512345678",,
  20312. ,[10]],"IT",39,"00",,,,,,,,[[,"(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|55"]],[,"(0[26])(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],[,"(0[26])(\\d{4,6})","$1 $2",["0[26]"]],[,"(0\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]"]],[,"(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[245])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|[45][0-4]))"]],[,"(0\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["0[13-57-9][2-46-8]"]],[,"(0\\d{3})(\\d{2,6})","$1 $2",["0[13-57-9][2-46-8]"]],[,"(\\d{3})(\\d{3})(\\d{3,4})",
  20313. "$1 $2 $3",["[13]|8(?:00|4[08]|9[59])","[13]|8(?:00|4[08]|9(?:5[5-9]|9))"]],[,"(\\d{4})(\\d{4})","$1 $2",["894","894[5-9]"]],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3"]]],,[,,"NA","NA",,,,,,[-1]],1,,[,,"848\\d{6}","\\d{9}",,,"848123456",,,[9]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],JE:[,[,,"[135789]\\d{6,9}","\\d{6,10}",,,,,,[10],[6]],[,,"1534\\d{6}","\\d{6,10}",,,"1534456789"],[,,"7(?:509|7(?:00|97)|829|937)\\d{6}","\\d{10}",,,"7797123456"],[,,"80(?:07(?:35|81)|8901)\\d{4}","\\d{10}",
  20314. ,,"8007354567"],[,,"(?:871206|90(?:066[59]|1810|71(?:07|55)))\\d{4}","\\d{10}",,,"9018105678"],[,,"8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|70002)\\d{4}","\\d{10}",,,"8447034567"],[,,"701511\\d{4}","\\d{10}",,,"7015115678"],[,,"56\\d{8}","\\d{10}",,,"5612345678"],"JE",44,"00","0"," x",,"0",,,,,,[,,"76(?:0[012]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\d{6}","\\d{10}",,,"7640123456"],,,[,,"NA","NA",,,,,,[-1]],[,,"3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))\\d{4}|55\\d{8}",
  20315. "\\d{10}",,,"5512345678"],,,[,,"NA","NA",,,,,,[-1]]],JM:[,[,,"[589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"876(?:5(?:0[12]|1[0-468]|2[35]|63)|6(?:0[1-3579]|1[027-9]|[23]\\d|40|5[06]|6[2-589]|7[05]|8[04]|9[4-9])|7(?:0[2-689]|[1-6]\\d|8[056]|9[45])|9(?:0[1-8]|1[02378]|[2-8]\\d|9[2-468]))\\d{4}","\\d{7}(?:\\d{3})?",,,"8765123456"],[,,"876(?:2(?:[16-9]\\d|58)|[348]\\d{2}|5(?:0[3-9]|2[0-246-9]|6[0-24-9]|[3-578]\\d)|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579]))\\d{4}","\\d{7}(?:\\d{3})?",
  20316. ,,"8762101234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"JM",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"876",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],JO:[,[,,"[235-9]\\d{7,8}","\\d{8,9}",,,,,,[8,9]],[,,"(?:2(?:6(?:2[0-35-9]|3[0-57-8]|4[24-7]|5[0-24-8]|[6-8][023]|9[0-3])|7(?:0[1-79]|10|2[014-7]|3[0-689]|4[019]|5[0-3578]))|32(?:0[1-69]|1[1-35-7]|2[024-7]|3\\d|4[0-3]|[57][023]|6[03])|53(?:0[0-3]|[13][023]|2[0-59]|49|5[0-35-9]|6[15]|7[45]|8[1-6]|9[0-36-9])|6(?:2[50]0|3(?:00|33)|4(?:0[0125]|1[2-7]|2[0569]|[38][07-9]|4[025689]|6[0-589]|7\\d|9[0-2])|5(?:[01][056]|2[034]|3[0-57-9]|4[17-8]|5[0-69]|6[0-35-9]|7[1-379]|8[0-68]|9[02-39]))|87(?:[02]0|7[08]|90))\\d{4}",
  20317. "\\d{8}",,,"62001234",,,[8]],[,,"7(?:55|7[025-9]|8[015-9]|9[0-25-9])\\d{6}","\\d{9}",,,"790123456",,,[9]],[,,"80\\d{6}","\\d{8}",,,"80012345",,,[8]],[,,"900\\d{5}","\\d{8}",,,"90012345",,,[8]],[,,"85\\d{6}","\\d{8}",,,"85012345",,,[8]],[,,"70\\d{7}","\\d{9}",,,"700123456",,,[9]],[,,"NA","NA",,,,,,[-1]],"JO",962,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],[,"(7)(\\d{4})(\\d{4})","$1 $2 $3",["7[457-9]"],"0$1"],[,"(\\d{3})(\\d{5,6})","$1 $2",["70|8[0158]|9"],"0$1"]],
  20318. ,[,,"74(?:66|77)\\d{5}","\\d{9}",,,"746612345",,,[9]],,,[,,"NA","NA",,,,,,[-1]],[,,"8(?:10|8\\d)\\d{5}","\\d{8}",,,"88101234",,,[8]],,,[,,"NA","NA",,,,,,[-1]]],JP:[,[,,"[1-9]\\d{8,9}|00(?:[36]\\d{7,14}|7\\d{5,7}|8\\d{7})","\\d{8,17}",,,,,,[8,9,10,11,12,13,14,15,16,17]],[,,"(?:1(?:1[235-8]|2[3-6]|3[3-9]|4[2-6]|[58][2-8]|6[2-7]|7[2-9]|9[1-9])|2[2-9]\\d|[36][1-9]\\d|4(?:6[02-8]|[2-578]\\d|9[2-59])|5(?:6[1-9]|7[2-8]|[2-589]\\d)|7(?:3[4-9]|4[02-9]|[25-9]\\d)|8(?:3[2-9]|4[5-9]|5[1-9]|8[03-9]|[2679]\\d)|9(?:[679][1-9]|[2-58]\\d))\\d{6}",
  20319. "\\d{9}",,,"312345678",,,[9]],[,,"[7-9]0[1-9]\\d{7}","\\d{10}",,,"9012345678",,,[10]],[,,"120\\d{6}|800\\d{7}|00(?:37\\d{6,13}|66\\d{6,13}|777(?:[01]\\d{2}|5\\d{3}|8\\d{4})|882[1245]\\d{4})","\\d{8,17}",,,"120123456"],[,,"990\\d{6}","\\d{9}",,,"990123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"60\\d{7}","\\d{9}",,,"601234567",,,[9]],[,,"50[1-9]\\d{7}","\\d{10}",,,"5012345678",,,[10]],"JP",81,"010","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{4})",
  20320. "$1-$2-$3",["800"],"0$1"],[,"(\\d{4})(\\d{4})","$1-$2",["0077"],"$1"],[,"(\\d{4})(\\d{2})(\\d{3,4})","$1-$2-$3",["0077"],"$1"],[,"(\\d{4})(\\d{2})(\\d{4})","$1-$2-$3",["0088"],"$1"],[,"(\\d{4})(\\d{3})(\\d{3,4})","$1-$2-$3",["00(?:37|66)"],"$1"],[,"(\\d{4})(\\d{4})(\\d{4,5})","$1-$2-$3",["00(?:37|66)"],"$1"],[,"(\\d{4})(\\d{5})(\\d{5,6})","$1-$2-$3",["00(?:37|66)"],"$1"],[,"(\\d{4})(\\d{6})(\\d{6,7})","$1-$2-$3",["00(?:37|66)"],"$1"],[,"(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[2579]0|80[1-9]"],"0$1"],
  20321. [,"(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|5(?:76|97)|499|746|8(?:3[89]|63|47|51)|9(?:49|80|9[16])","1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:76|97)9|499[2468]|7468|8(?:3(?:8[78]|96)|636|477|51[24])|9(?:496|802|9(?:1[23]|69))","1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:769|979[2-69])|499[2468]|7468|8(?:3(?:8[78]|96[2457-9])|636[2-57-9]|477|51[24])|9(?:496|802|9(?:1[23]|69))"],
  20322. "0$1"],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["1(?:2[3-6]|3[3-9]|4[2-6]|5[2-8]|[68][2-7]|7[2-689]|9[1-578])|2(?:2[03-689]|3[3-58]|4[0-468]|5[04-8]|6[013-8]|7[06-9]|8[02-57-9]|9[13])|4(?:2[28]|3[689]|6[035-7]|7[05689]|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9[4-9])|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9[014-9])|8(?:2[49]|3[3-8]|4[5-8]|5[2-9]|6[35-9]|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9[3-7])","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9[2-8])|3(?:7[2-6]|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5[4-7]|6[2-9]|8[2-8]|9[236-9])|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3[34]|[4-7]))",
  20323. "1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6[56]))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))",
  20324. "1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6(?:5[25]|60)))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))"],
  20325. "0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1|2(?:2[37]|5[5-9]|64|78|8[39]|91)|4(?:2[2689]|64|7[347])|5(?:[2-589]|39)|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93)","1|2(?:2[37]|5(?:[57]|[68]0|9[19])|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93[34])","1|2(?:2[37]|5(?:[57]|[68]0|9(?:17|99))|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93(?:31|4))"],
  20326. "0$1"],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["2(?:9[14-79]|74|[34]7|[56]9)|82|993"],"0$1"],[,"(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[2479][1-9]"],"0$1"]],[[,"(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],[,"(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[2579]0|80[1-9]"],"0$1"],[,"(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|5(?:76|97)|499|746|8(?:3[89]|63|47|51)|9(?:49|80|9[16])",
  20327. "1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:76|97)9|499[2468]|7468|8(?:3(?:8[78]|96)|636|477|51[24])|9(?:496|802|9(?:1[23]|69))","1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:769|979[2-69])|499[2468]|7468|8(?:3(?:8[78]|96[2457-9])|636[2-57-9]|477|51[24])|9(?:496|802|9(?:1[23]|69))"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["1(?:2[3-6]|3[3-9]|4[2-6]|5[2-8]|[68][2-7]|7[2-689]|9[1-578])|2(?:2[03-689]|3[3-58]|4[0-468]|5[04-8]|6[013-8]|7[06-9]|8[02-57-9]|9[13])|4(?:2[28]|3[689]|6[035-7]|7[05689]|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9[4-9])|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9[014-9])|8(?:2[49]|3[3-8]|4[5-8]|5[2-9]|6[35-9]|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9[3-7])",
  20328. "1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9[2-8])|3(?:7[2-6]|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5[4-7]|6[2-9]|8[2-8]|9[236-9])|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3[34]|[4-7]))",
  20329. "1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6[56]))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))",
  20330. "1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6(?:5[25]|60)))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))"],
  20331. "0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1|2(?:2[37]|5[5-9]|64|78|8[39]|91)|4(?:2[2689]|64|7[347])|5(?:[2-589]|39)|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93)","1|2(?:2[37]|5(?:[57]|[68]0|9[19])|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93[34])","1|2(?:2[37]|5(?:[57]|[68]0|9(?:17|99))|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93(?:31|4))"],
  20332. "0$1"],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["2(?:9[14-79]|74|[34]7|[56]9)|82|993"],"0$1"],[,"(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[2479][1-9]"],"0$1"]],[,,"20\\d{8}","\\d{10}",,,"2012345678",,,[10]],,,[,,"00(?:37\\d{6,13}|66\\d{6,13}|777(?:[01]\\d{2}|5\\d{3}|8\\d{4})|882[1245]\\d{4})","\\d{8,17}",,,"00777012"],[,,"570\\d{6}","\\d{9}",,,"570123456",,,[9]],1,,[,,"NA","NA",,,,,,[-1]]],KE:[,[,,"20\\d{6,7}|[4-9]\\d{6,9}","\\d{7,10}",
  20333. ,,,,,[7,8,9,10]],[,,"20\\d{6,7}|4(?:[0136]\\d{7}|[245]\\d{5,7})|5(?:[08]\\d{7}|[1-79]\\d{5,7})|6(?:[01457-9]\\d{5,7}|[26]\\d{7})","\\d{7,9}",,,"202012345",,,[7,8,9]],[,,"7(?:[0-369]\\d|4[0-2]|5[0-6]|7[0-7]|8[0-25-9])\\d{6}","\\d{9}",,,"712123456",,,[9]],[,,"800[24-8]\\d{5,6}","\\d{9,10}",,,"800223456",,,[9,10]],[,,"900[02-9]\\d{5}","\\d{9}",,,"900223456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"KE",254,"000","0",,,"005|0",,,,[[,"(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],
  20334. "0$1"],[,"(\\d{3})(\\d{6})","$1 $2",["7"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],KG:[,[,,"[235-8]\\d{8,9}","\\d{5,10}",,,,,,[9,10],[5,6]],[,,"(?:3(?:1(?:[256]\\d|3[1-9]|47)|2(?:22|3[0-479]|6[0-7])|4(?:22|5[6-9]|6\\d)|5(?:22|3[4-7]|59|6\\d)|6(?:22|5[35-7]|6\\d)|7(?:22|3[468]|4[1-9]|59|[67]\\d)|9(?:22|4[1-8]|6\\d))|6(?:09|12|2[2-4])\\d)\\d{5}","\\d{5,10}",,,"312123456",,,
  20335. [9]],[,,"(?:20[0-35]|5[124-7]\\d|7[07]\\d)\\d{6}","\\d{9}",,,"700123456",,,[9]],[,,"800\\d{6,7}","\\d{9,10}",,,"800123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"KG",996,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[25-7]|31[25]"],"0$1"],[,"(\\d{4})(\\d{5})","$1 $2",["3(?:1[36]|[2-9])"],"0$1"],[,"(\\d{3})(\\d{3})(\\d)(\\d{3})","$1 $2 $3 $4",["8"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,
  20336. [-1]],,,[,,"NA","NA",,,,,,[-1]]],KH:[,[,,"[1-9]\\d{7,9}","\\d{6,10}",,,,,,[8,9,10],[6,7]],[,,"(?:2[3-6]|3[2-6]|4[2-4]|[5-7][2-5])(?:[237-9]|4[56]|5\\d|6\\d?)\\d{5}|23(?:4[234]|8\\d{2})\\d{4}","\\d{6,9}",,,"23756789",,,[8,9]],[,,"(?:1(?:[013-79]\\d|[28]\\d{1,2})|2[3-6]48|3(?:[18]\\d{2}|[2-6]48)|4[2-4]48|5[2-5]48|6(?:[016-9]\\d|[2-5]48)|7(?:[07-9]\\d|[16]\\d{2}|[2-5]48)|8(?:[013-79]\\d|8\\d{2})|9(?:6\\d{2}|7\\d{1,2}|[0-589]\\d))\\d{5}","\\d{8,9}",,,"91234567",,,[8,9]],[,,"1800(?:1\\d|2[019])\\d{4}",
  20337. "\\d{10}",,,"1800123456",,,[10]],[,,"1900(?:1\\d|2[09])\\d{4}","\\d{10}",,,"1900123456",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"KH",855,"00[14-9]","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["1\\d[1-9]|[2-9]"],"0$1"],[,"(1[89]00)(\\d{3})(\\d{3})","$1 $2 $3",["1[89]0"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],KI:[,[,,"[2458]\\d{4}|3\\d{4,7}|7\\d{7}","\\d{5,8}",,,,,,[5,8]],[,,"(?:[24]\\d|3[1-9]|50|8[0-5])\\d{3}",
  20338. "\\d{5}",,,"31234",,,[5]],[,,"7\\d{7}","\\d{8}",,,"72012345",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"3001\\d{4}","\\d{5,8}",,,"30010000",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"KI",686,"00",,,,"0",,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],KM:[,[,,"[379]\\d{6}","\\d{7}",,,,,,[7]],[,,"7(?:6[0-37-9]|7[0-57-9])\\d{4}","\\d{7}",,,"7712345"],[,,"3[234]\\d{5}","\\d{7}",,,"3212345"],[,,"NA","NA",,,,,,[-1]],
  20339. [,,"(?:39[01]|9[01]0)\\d{4}","\\d{7}",,,"9001234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"KM",269,"00",,,,,,,,[[,"(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],KN:[,[,,"[589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"869(?:2(?:29|36)|302|4(?:6[015-9]|70))\\d{4}","\\d{7}(?:\\d{3})?",,,"8692361234"],[,,"869(?:5(?:5[6-8]|6[5-7])|66\\d|76[02-7])\\d{4}","\\d{7}(?:\\d{3})?",
  20340. ,,"8697652917"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"KN",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"869",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],KP:[,[,,"1\\d{9}|[28]\\d{7}","\\d{6,8}|\\d{10}",,,,,,[8,10],[6,7]],[,,"2\\d{7}|85\\d{6}","\\d{6,8}",,,"21234567",,,[8]],[,,"19[123]\\d{7}",
  20341. "\\d{10}",,,"1921234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"KP",850,"00|99","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],[,"(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"2(?:[0-24-9]\\d{2}|3(?:[0-79]\\d|8[02-9]))\\d{4}","\\d{8}",,,"23821234",,,[8]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],
  20342. KR:[,[,,"007\\d{9,11}|[1-7]\\d{3,9}|8\\d{8}","\\d{3,14}",,,,,,[4,5,6,8,9,10,12,13,14],[3,7]],[,,"(?:2|3[1-3]|[46][1-4]|5[1-5])(?:1\\d{2,3}|[1-9]\\d{6,7})","\\d{3,10}",,,"22123456",,,[4,5,6,8,9,10]],[,,"1[0-26-9]\\d{7,8}","\\d{9,10}",,,"1000000000",,,[9,10]],[,,"(?:00798\\d{0,2}|80)\\d{7}","\\d{9,14}",,,"801234567",,,[9,12,13,14]],[,,"60[2-9]\\d{6}","\\d{9}",,,"602345678",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"50\\d{8}","\\d{10}",,,"5012345678",,,[10]],[,,"70\\d{8}","\\d{10}",,,"7012345678",,,[10]],"KR",
  20343. 82,"00(?:[124-68]|3\\d{2}|7(?:[0-8]\\d|9[0-79]))","0",,,"0(8[1-46-8]|85\\d{2})?",,,,[[,"(\\d{5})(\\d{3,4})(\\d{4})","$1 $2 $3",["00798"],"$1","0$CC-$1"],[,"(\\d{5})(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["00798"],"$1","0$CC-$1"],[,"(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["1(?:0|1[19]|[69]9|5[458])|[57]0","1(?:0|1[19]|[69]9|5(?:44|59|8))|[57]0"],"0$1","0$CC-$1"],[,"(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["1(?:[01]|5[1-4]|6[2-8]|[7-9])|[68]0|[3-6][1-9][1-9]","1(?:[01]|5(?:[1-3]|4[56])|6[2-8]|[7-9])|[68]0|[3-6][1-9][1-9]"],
  20344. "0$1","0$CC-$1"],[,"(\\d{3})(\\d)(\\d{4})","$1-$2-$3",["131","1312"],"0$1","0$CC-$1"],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["131","131[13-9]"],"0$1","0$CC-$1"],[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["13[2-9]"],"0$1","0$CC-$1"],[,"(\\d{2})(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3-$4",["30"],"0$1","0$CC-$1"],[,"(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2[1-9]"],"0$1","0$CC-$1"],[,"(\\d)(\\d{3,4})","$1-$2",["21[0-46-9]"],"0$1","0$CC-$1"],[,"(\\d{2})(\\d{3,4})","$1-$2",["[3-6][1-9]1","[3-6][1-9]1(?:[0-46-9])"],
  20345. "0$1","0$CC-$1"],[,"(\\d{4})(\\d{4})","$1-$2",["1(?:5[46-9]|6[04678]|8[03579])","1(?:5(?:44|66|77|88|99)|6(?:00|44|6[16]|70|88)|8(?:00|33|55|77|99))"],"$1","0$CC-$1"]],[[,"(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["1(?:0|1[19]|[69]9|5[458])|[57]0","1(?:0|1[19]|[69]9|5(?:44|59|8))|[57]0"],"0$1","0$CC-$1"],[,"(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["1(?:[01]|5[1-4]|6[2-8]|[7-9])|[68]0|[3-6][1-9][1-9]","1(?:[01]|5(?:[1-3]|4[56])|6[2-8]|[7-9])|[68]0|[3-6][1-9][1-9]"],"0$1","0$CC-$1"],[,"(\\d{3})(\\d)(\\d{4})",
  20346. "$1-$2-$3",["131","1312"],"0$1","0$CC-$1"],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["131","131[13-9]"],"0$1","0$CC-$1"],[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["13[2-9]"],"0$1","0$CC-$1"],[,"(\\d{2})(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3-$4",["30"],"0$1","0$CC-$1"],[,"(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2[1-9]"],"0$1","0$CC-$1"],[,"(\\d)(\\d{3,4})","$1-$2",["21[0-46-9]"],"0$1","0$CC-$1"],[,"(\\d{2})(\\d{3,4})","$1-$2",["[3-6][1-9]1","[3-6][1-9]1(?:[0-46-9])"],"0$1","0$CC-$1"],[,"(\\d{4})(\\d{4})",
  20347. "$1-$2",["1(?:5[46-9]|6[04678]|8[03579])","1(?:5(?:44|66|77|88|99)|6(?:00|44|6[16]|70|88)|8(?:00|33|55|77|99))"],"$1","0$CC-$1"]],[,,"15\\d{7,8}","\\d{9,10}",,,"1523456789",,,[9,10]],,,[,,"00798\\d{7,9}","\\d{12,14}",,,"007981234567",,,[12,13,14]],[,,"1(?:5(?:44|66|77|88|99)|6(?:00|44|6[16]|70|88)|8(?:00|33|55|77|99))\\d{4}","\\d{8}",,,"15441234",,,[8]],,,[,,"NA","NA",,,,,,[-1]]],KW:[,[,,"[12569]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"(?:18\\d|2(?:[23]\\d{2}|4(?:[1-35-9]\\d|44)|5(?:0[034]|[2-46]\\d|5[1-3]|7[1-7])))\\d{4}",
  20348. "\\d{7,8}",,,"22345678"],[,,"(?:5(?:[05]\\d{2}|1[0-7]\\d|2(?:22|5[25])|66\\d)|6(?:0[034679]\\d|222|5[015-9]\\d|6\\d{2}|7[067]\\d|9[0369]\\d)|9(?:0[09]\\d|22\\d|4[01479]\\d|55\\d|6[0679]\\d|[79]\\d{2}|8[057-9]\\d))\\d{4}","\\d{8}",,,"50012345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"KW",965,"00",,,,,,,,[[,"(\\d{4})(\\d{3,4})","$1 $2",["[16]|2(?:[0-35-9]|4[0-35-9])|9[024-9]|52[25]"]],[,"(\\d{3})(\\d{5})","$1 $2",["244|5(?:[015]|66)"]]],
  20349. ,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],KY:[,[,,"[3589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"345(?:2(?:22|44)|444|6(?:23|38|40)|7(?:4[35-79]|6[6-9]|77)|8(?:00|1[45]|25|[48]8)|9(?:14|4[035-9]))\\d{4}","\\d{7}(?:\\d{3})?",,,"3452221234"],[,,"345(?:32[1-9]|5(?:1[67]|2[5-7]|4[6-8]|76)|9(?:1[67]|2[2-9]|3[689]))\\d{4}","\\d{7}(?:\\d{3})?",,,"3453231234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}|345976\\d{4}",
  20350. "\\d{10}",,,"9002345678"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"KY",1,"011","1",,,"1",,,,,,[,,"345849\\d{4}","\\d{10}",,,"3458491234"],,"345",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],KZ:[,[,,"(?:33\\d|7\\d{2}|80[09])\\d{7}","\\d{10}",,,,,,[10]],[,,"33622\\d{5}|7(?:1(?:0(?:[23]\\d|4[023]|59|63)|1(?:[23]\\d|4[0-79]|59)|2(?:[23]\\d|59)|3(?:2\\d|3[1-79]|4[0-35-9]|59)|4(?:2\\d|3[013-79]|4[0-8]|5[1-79])|5(?:2\\d|3[1-8]|4[1-7]|59)|6(?:[234]\\d|5[19]|61)|72\\d|8(?:[27]\\d|3[1-46-9]|4[0-5]))|2(?:1(?:[23]\\d|4[46-9]|5[3469])|2(?:2\\d|3[0679]|46|5[12679])|3(?:[234]\\d|5[139])|4(?:2\\d|3[1235-9]|59)|5(?:[23]\\d|4[01246-8]|59|61)|6(?:2\\d|3[1-9]|4[0-4]|59)|7(?:[2379]\\d|40|5[279])|8(?:[23]\\d|4[0-3]|59)|9(?:2\\d|3[124578]|59)))\\d{5}",
  20351. "\\d{10}",,,"7123456789"],[,,"7(?:0[012578]|47|6[02-4]|7[15-8]|85)\\d{7}","\\d{10}",,,"7710009998"],[,,"800\\d{7}","\\d{10}",,,"8001234567"],[,,"809\\d{7}","\\d{10}",,,"8091234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"751\\d{7}","\\d{10}",,,"7511234567"],"KZ",7,"810","8",,,"8",,"8~10",,,,[,,"NA","NA",,,,,,[-1]],,,[,,"751\\d{7}","\\d{10}",,,"7511234567"],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LA:[,[,,"[2-8]\\d{7,9}","\\d{6,10}",,,,,,[8,9,10],[6]],[,,"(?:2[13]|3(?:0\\d|[14])|[5-7][14]|41|8[1468])\\d{6}",
  20352. "\\d{6,9}",,,"21212862",,,[8,9]],[,,"20(?:2[2389]|5[4-689]|7[6-8]|9[15-9])\\d{6}","\\d{10}",,,"2023123456",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"LA",856,"00","0",,,"0",,,,[[,"(20)(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["20"],"0$1"],[,"([2-8]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],[,"(30)(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,
  20353. ,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LB:[,[,,"[13-9]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"(?:[14-6]\\d{2}|7(?:[2-57]\\d|62|8[0-7]|9[04-9])|8[02-9]\\d|9\\d{2})\\d{4}","\\d{7}",,,"1123456",,,[7]],[,,"(?:3\\d|7(?:[01]\\d|6[013-9]|8[89]|9[1-3])|81\\d)\\d{5}","\\d{7,8}",,,"71123456"],[,,"NA","NA",,,,,,[-1]],[,,"9[01]\\d{6}","\\d{8}",,,"90123456",,,[8]],[,,"80\\d{6}","\\d{8}",,,"80123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"LB",961,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3})",
  20354. "$1 $2 $3",["[13-6]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]|9"],"0$1"],[,"([7-9]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[89][01]|7(?:[01]|6[013-9]|8[89]|9[1-3])"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LC:[,[,,"[5789]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"758(?:4(?:30|5[0-9]|6[2-9]|8[0-2])|57[0-2]|638)\\d{4}","\\d{7}(?:\\d{3})?",,,"7584305678"],[,,"758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2[0-8]))\\d{4}","\\d{7}(?:\\d{3})?",
  20355. ,,"7582845678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"LC",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"758",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LI:[,[,,"6\\d{8}|[23789]\\d{6}","\\d{7,9}",,,,,,[7,9]],[,,"(?:2(?:01|1[27]|3\\d|6[02-578]|96)|3(?:7[0135-7]|8[048]|9[0269]))\\d{4}",
  20356. "\\d{7}",,,"2345678",,,[7]],[,,"6(?:51[01]|6(?:0[0-6]|2[016-9]|39))\\d{5}|7(?:[37-9]\\d|42|56)\\d{4}","\\d{7,9}",,,"660234567"],[,,"80(?:02[28]|9\\d{2})\\d{2}","\\d{7}",,,"8002222",,,[7]],[,,"90(?:02[258]|1(?:23|3[14])|66[136])\\d{2}","\\d{7}",,,"9002222",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"LI",423,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[23789]"]],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[56]"]],[,"(69)(7\\d{2})(\\d{4})","$1 $2 $3",
  20357. ["697"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"870(?:28|87)\\d{2}","\\d{7}",,,"8702812",,,[7]],,,[,,"697(?:42|56|[7-9]\\d)\\d{4}","\\d{9}",,,"697861234",,,[9]]],LK:[,[,,"[1-9]\\d{8}","\\d{7,9}",,,,,,[9],[7]],[,,"(?:[189]1|2[13-7]|3[1-8]|4[157]|5[12457]|6[35-7])[2-57]\\d{6}","\\d{7,9}",,,"112345678"],[,,"7[0125-8]\\d{7}","\\d{9}",,,"712345678"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"LK",94,"00","0",
  20358. ,,"0",,,,[[,"(\\d{2})(\\d{1})(\\d{6})","$1 $2 $3",["[1-689]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LR:[,[,,"2\\d{7,8}|[378]\\d{8}|4\\d{6}|5\\d{6,8}","\\d{7,9}",,,,,,[7,8,9]],[,,"2\\d{7}","\\d{8}",,,"21234567",,,[8]],[,,"(?:20\\d{3}|330\\d{2}|4[67]\\d|5(?:55)?\\d{2}|77\\d{3}|88\\d{3})\\d{4}","\\d{7,9}",,,"770123456",,,[7,9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,
  20359. ,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"332(?:02|[25]\\d)\\d{4}","\\d{9}",,,"332021234",,,[9]],"LR",231,"00","0",,,"0",,,,[[,"(2\\d)(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],[,"([4-5])(\\d{3})(\\d{3})","$1 $2 $3",["[45]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23578]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LS:[,[,,"[2568]\\d{7}","\\d{8}",,,,,,[8]],[,,"2\\d{7}","\\d{8}",,,"22123456"],[,,"[56]\\d{7}","\\d{8}",
  20360. ,,"50123456"],[,,"800[256]\\d{4}","\\d{8}",,,"80021234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"LS",266,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LT:[,[,,"[3-9]\\d{7}","\\d{8}",,,,,,[8]],[,,"(?:3[1478]|4[124-6]|52)\\d{6}","\\d{8}",,,"31234567"],[,,"6\\d{7}","\\d{8}",,,"61234567"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"9(?:0[0239]|10)\\d{5}",
  20361. "\\d{8}",,,"90012345"],[,,"808\\d{5}","\\d{8}",,,"80812345"],[,,"700\\d{5}","\\d{8}",,,"70012345"],[,,"NA","NA",,,,,,[-1]],"LT",370,"00","8",,,"[08]",,,,[[,"([34]\\d)(\\d{6})","$1 $2",["37|4(?:1|5[45]|6[2-4])"],"(8-$1)",,1],[,"([3-6]\\d{2})(\\d{5})","$1 $2",["3[148]|4(?:[24]|6[09])|528|6"],"(8-$1)",,1],[,"([7-9]\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",,1],[,"(5)(2\\d{2})(\\d{4})","$1 $2 $3",["52[0-79]"],"(8-$1)",,1]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"70[67]\\d{5}",
  20362. "\\d{8}",,,"70712345"],,,[,,"NA","NA",,,,,,[-1]]],LU:[,[,,"[24-9]\\d{3,10}|3(?:[0-46-9]\\d{2,9}|5[013-9]\\d{1,8})","\\d{4,11}",,,,,,[4,5,6,7,8,9,10,11]],[,,"(?:2[2-9]\\d{2,9}|(?:[3457]\\d{2}|8(?:0[2-9]|[13-9]\\d)|9(?:0[89]|[2-579]\\d))\\d{1,8})","\\d{4,11}",,,"27123456"],[,,"6[2679][18]\\d{6}","\\d{9}",,,"628123456",,,[9]],[,,"800\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"90[015]\\d{5}","\\d{8}",,,"90012345",,,[8]],[,,"801\\d{5}","\\d{8}",,,"80112345",,,[8]],[,,"70\\d{6}","\\d{8}",,,"70123456",,,[8]],
  20363. [,,"20(?:1\\d{5}|[2-689]\\d{1,7})","\\d{4,10}",,,"20201234",,,[4,5,6,7,8,9,10]],"LU",352,"00",,,,"(15(?:0[06]|1[12]|35|4[04]|55|6[26]|77|88|99)\\d)",,,,[[,"(\\d{2})(\\d{3})","$1 $2",["[2-5]|7[1-9]|[89](?:[1-9]|0[2-9])"],,"$CC $1"],[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-5]|7[1-9]|[89](?:[1-9]|0[2-9])"],,"$CC $1"],[,"(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20"],,"$CC $1"],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"],,"$CC $1"],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{3})",
  20364. "$1 $2 $3 $4",["20"],,"$CC $1"],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"],,"$CC $1"],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{1,4})","$1 $2 $3 $4",["2(?:[12589]|4[12])|[3-5]|7[1-9]|8(?:[1-9]|0[2-9])|9(?:[1-9]|0[2-46-9])"],,"$CC $1"],[,"(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["70|80[01]|90[015]"],,"$CC $1"],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"],,"$CC $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],
  20365. LV:[,[,,"[2689]\\d{7}","\\d{8}",,,,,,[8]],[,,"6\\d{7}","\\d{8}",,,"63123456"],[,,"2\\d{7}","\\d{8}",,,"21234567"],[,,"80\\d{6}","\\d{8}",,,"80123456"],[,,"90\\d{6}","\\d{8}",,,"90123456"],[,,"81\\d{6}","\\d{8}",,,"81123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"LV",371,"00",,,,,,,,[[,"([2689]\\d)(\\d{3})(\\d{3})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LY:[,[,,"[25679]\\d{8}","\\d{7,9}",,,,,,[9],[7]],[,,"(?:2[1345]|5[1347]|6[123479]|71)\\d{7}",
  20366. "\\d{7,9}",,,"212345678"],[,,"9[1-6]\\d{7}","\\d{9}",,,"912345678"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"LY",218,"00","0",,,"0",,,,[[,"([25679]\\d)(\\d{7})","$1-$2",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MA:[,[,,"[5-9]\\d{8}","\\d{9}",,,,,,[9]],[,,"5(?:2(?:(?:[015-7]\\d|2[02-9]|3[2-57]|4[2-8]|8[235-7])\\d|9(?:0\\d|[89]0))|3(?:(?:[0-4]\\d|[57][2-9]|6[2-8]|9[3-9])\\d|8(?:0\\d|[89]0))|(?:4[067]|5[03])\\d{2})\\d{4}",
  20367. "\\d{9}",,,"520123456"],[,,"(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[07][07]|6[12]))\\d{6}","\\d{9}",,,"650123456"],[,,"80\\d{7}","\\d{9}",,,"801234567"],[,,"89\\d{7}","\\d{9}",,,"891234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"5924[01]\\d{4}","\\d{9}",,,"592401234"],"MA",212,"00","0",,,"0",,,,[[,"([5-7]\\d{2})(\\d{6})","$1-$2",["5(?:2[015-7]|3[0-4])|[67]"],"0$1"],[,"([58]\\d{3})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9]|92)|892","5(?:2(?:[2-48]|90)|3(?:[5-79]|80)|924)|892"],"0$1"],[,"(5\\d{4})(\\d{4})",
  20368. "$1-$2",["5(?:29|38)","5(?:29|38)[89]"],"0$1"],[,"([5]\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:4[067]|5[03])"],"0$1"],[,"(8[09])(\\d{7})","$1-$2",["8(?:0|9[013-9])"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MC:[,[,,"[4689]\\d{7,8}","\\d{8,9}",,,,,,[8,9]],[,,"870\\d{5}|9[2-47-9]\\d{6}","\\d{8}",,,"99123456",,,[8]],[,,"6\\d{8}|4(?:4\\d|5[1-9])\\d{5}","\\d{8,9}",,,"612345678"],[,,"90\\d{6}","\\d{8}",,,"90123456",,,[8]],
  20369. [,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MC",377,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"$1"],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],[,"(6)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["8"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"8\\d{7}","\\d{8}",,,,,,[8]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MD:[,[,,"[235-9]\\d{7}","\\d{8}",
  20370. ,,,,,[8]],[,,"(?:2[1-9]\\d|3[1-79]\\d|5(?:33|5[257]))\\d{5}","\\d{8}",,,"22212345"],[,,"(?:562|6\\d{2}|7(?:[189]\\d|6[07]|7[457-9]))\\d{5}","\\d{8}",,,"62112345"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"90[056]\\d{5}","\\d{8}",,,"90012345"],[,,"808\\d{5}","\\d{8}",,,"80812345"],[,,"NA","NA",,,,,,[-1]],[,,"3[08]\\d{6}","\\d{8}",,,"30123456"],"MD",373,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],[,"([25-7]\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["2[13-9]|[5-7]"],"0$1"],[,
  20371. "([89]\\d{2})(\\d{5})","$1 $2",["[89]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"803\\d{5}","\\d{8}",,,"80312345"],,,[,,"NA","NA",,,,,,[-1]]],ME:[,[,,"[2-9]\\d{7,8}","\\d{6,9}",,,,,,[8,9],[6]],[,,"(?:20[2-8]|3(?:0[2-7]|[12][35-7]|3[4-7])|4(?:0[2367]|1[267])|5(?:0[467]|1[267]|2[367]))\\d{5}","\\d{6,8}",,,"30234567",,,[8]],[,,"6(?:00\\d|3[24]\\d|61\\d|7(?:[0-8]\\d|9(?:[3-9]|[0-2]\\d))|[89]\\d{2})\\d{4}","\\d{8,9}",,,"67622901"],[,,"80\\d{6}","\\d{8}",,,"80080002",,,[8]],[,,"(?:9(?:4[1568]|5[178]))\\d{5}",
  20372. "\\d{8}",,,"94515151",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"78[1-9]\\d{5}","\\d{8}",,,"78108780",,,[8]],"ME",382,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]|6[036-9]","[2-57-9]|6(?:[03689]|7(?:[0-8]|9[3-9]))"],"0$1"],[,"(67)(9)(\\d{3})(\\d{3})","$1 $2 $3 $4",["679","679[0-2]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"77\\d{6}","\\d{8}",,,"77273012",,,[8]],,,[,,"NA","NA",,,,,,[-1]]],MF:[,[,,"[56]\\d{8}","\\d{9}",,,,,,[9]],[,,"590(?:[02][79]|13|5[0-268]|[78]7)\\d{4}",
  20373. "\\d{9}",,,"590271234"],[,,"690(?:0[0-7]|[1-9]\\d)\\d{4}","\\d{9}",,,"690301234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MF",590,"00","0",,,"0",,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MG:[,[,,"[23]\\d{8}","\\d{7,9}",,,,,,[9],[7]],[,,"20(?:2\\d{2}|4[47]\\d|5[3467]\\d|6[279]\\d|7(?:2[29]|[35]\\d)|8[268]\\d|9[245]\\d)\\d{4}","\\d{7,9}",,,"202123456"],[,,
  20374. "3[2-49]\\d{7}","\\d{9}",,,"321234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"22\\d{7}","\\d{9}",,,"221234567"],"MG",261,"00","0",,,"0",,,,[[,"([23]\\d)(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MH:[,[,,"[2-6]\\d{6}","\\d{7}",,,,,,[7]],[,,"(?:247|528|625)\\d{4}","\\d{7}",,,"2471234"],[,,"(?:235|329|45[56]|545)\\d{4}","\\d{7}",,,"2351234"],
  20375. [,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"635\\d{4}","\\d{7}",,,"6351234"],"MH",692,"011","1",,,"1",,,,[[,"(\\d{3})(\\d{4})","$1-$2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MK:[,[,,"[2-578]\\d{7}","\\d{6,8}",,,,,,[8],[6,7]],[,,"(?:2(?:[23]\\d|5[124578]|6[01])|3(?:1[3-6]|[23][2-6]|4[2356])|4(?:[23][2-6]|4[3-6]|5[256]|6[25-8]|7[24-6]|8[4-6]))\\d{5}","\\d{6,8}",,,"22212345"],[,,"7(?:[0-25-8]\\d{2}|32\\d|421)\\d{4}",
  20376. "\\d{6,8}",,,"72345678"],[,,"800\\d{5}","\\d{6,8}",,,"80012345"],[,,"5[02-9]\\d{6}","\\d{6,8}",,,"50012345"],[,,"8(?:0[1-9]|[1-9]\\d)\\d{5}","\\d{6,8}",,,"80123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MK",389,"00","0",,,"0",,,,[[,"(2)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],[,"([347]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],[,"([58]\\d{2})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA",
  20377. "NA",,,,,,[-1]]],ML:[,[,,"[246-9]\\d{7}","\\d{8}",,,,,,[8]],[,,"(?:2(?:0(?:2\\d|7[0-8])|1(?:2[5-7]|[3-689]\\d))|44[1239]\\d)\\d{4}","\\d{8}",,,"20212345"],[,,"(?:2(?:079|17\\d)|[679]\\d{3}|8[239]\\d{2})\\d{4}","\\d{8}",,,"65012345"],[,,"80\\d{6}","\\d{8}",,,"80012345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"ML",223,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[246-9]"]],[,"(\\d{4})","$1",["67|74"]]],[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})",
  20378. "$1 $2 $3 $4",["[246-9]"]]],[,,"NA","NA",,,,,,[-1]],,,[,,"80\\d{6}","\\d{8}",,,"80012345"],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MM:[,[,,"[14578]\\d{5,7}|[26]\\d{5,8}|9(?:2\\d{0,2}|[58]|3\\d|4\\d{1,2}|6\\d?|[79]\\d{0,2})\\d{6}","\\d{5,10}",,,,,,[6,7,8,9,10],[5]],[,,"1(?:2\\d{1,2}|[3-5]\\d|6\\d?|[89][0-6]\\d)\\d{4}|2(?:2(?:000\\d{3}|\\d{4})|3\\d{4}|4(?:0\\d{5}|\\d{4})|5(?:1\\d{3,6}|[02-9]\\d{3,5})|[6-9]\\d{4})|4(?:2[245-8]|[346][2-6]|5[3-5])\\d{4}|5(?:2(?:20?|[3-8])|3[2-68]|4(?:21?|[4-8])|5[23]|6[2-4]|7[2-8]|8[24-7]|9[2-7])\\d{4}|6(?:0[23]|1[2356]|[24][2-6]|3[24-6]|5[2-4]|6[2-8]|7(?:[2367]|4\\d|5\\d?|8[145]\\d)|8[245]|9[24])\\d{4}|7(?:[04][24-8]|[15][2-7]|22|3[2-4])\\d{4}|8(?:1(?:2\\d{1,2}|[3-689]\\d)|2(?:2\\d|3(?:\\d|20)|[4-8]\\d)|3[24]\\d|4[24-7]\\d|5[245]\\d|6[23]\\d)\\d{3}",
  20379. "\\d{5,9}",,,"1234567",,,[6,7,8,9]],[,,"17[01]\\d{4}|9(?:2(?:[0-4]|5\\d{2}|6[0-5]\\d)|3[0-36]\\d|4(?:0[0-4]\\d|[1379]\\d|2\\d{2}|4[0-589]\\d|5\\d{2}|88)|5[0-6]|61?\\d|7(?:3\\d|[789]\\d{2})|8\\d|9(?:1\\d|[67]\\d{2}|[089]))\\d{5}","\\d{7,10}",,,"92123456",,,[7,8,9,10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"1333\\d{4}","\\d{8}",,,"13331234",,,[8]],"MM",95,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["1|2[245]"],"0$1"],[,"(2)(\\d{4})(\\d{4})",
  20380. "$1 $2 $3",["251"],"0$1"],[,"(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["67|81"],"0$1"],[,"(\\d{2})(\\d{2})(\\d{3,4})","$1 $2 $3",["[4-8]"],"0$1"],[,"(9)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],[,"(9)([34]\\d{4})(\\d{4})","$1 $2 $3",["9(?:3[0-36]|4[0-57-9])"],"0$1"],[,"(9)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92[56]"],"0$1"],[,"(9)(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["93"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,
  20381. "NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MN:[,[,,"[12]\\d{7,9}|[57-9]\\d{7}","\\d{6,10}",,,,,,[8,9,10],[6,7]],[,,"[12](?:1\\d|2(?:[1-3]\\d?|7\\d)|3[2-8]\\d{1,2}|4[2-68]\\d{1,2}|5[1-4689]\\d{1,2})\\d{5}|5[0568]\\d{6}","\\d{6,10}",,,"50123456"],[,,"(?:8(?:[05689]\\d|3[01])|9[013-9]\\d)\\d{5}","\\d{8}",,,"88123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"7[05-8]\\d{6}","\\d{8}",,,"75123456",,,[8]],"MN",
  20382. 976,"001","0",,,"0",,,,[[,"([12]\\d)(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],[,"([12]2\\d)(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],[,"([12]\\d{3})(\\d{5})","$1 $2",["[12](?:27|[3-5])","[12](?:27|[3-5]\\d)2"],"0$1"],[,"(\\d{4})(\\d{4})","$1 $2",["[57-9]"],"$1"],[,"([12]\\d{4})(\\d{4,5})","$1 $2",["[12](?:27|[3-5])","[12](?:27|[3-5]\\d)[4-9]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MO:[,[,,"[268]\\d{7}","\\d{8}",,,,,,[8]],
  20383. [,,"(?:28[2-57-9]|8[2-57-9]\\d)\\d{5}","\\d{8}",,,"28212345"],[,,"6(?:[2356]\\d|8[158])\\d{5}","\\d{8}",,,"66123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MO",853,"00",,,,,,,,[[,"([268]\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MP:[,[,,"[5689]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"670(?:2(?:3[3-7]|56|8[5-8])|32[1238]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[589]|8[3-9]8|989)\\d{4}",
  20384. "\\d{7}(?:\\d{3})?",,,"6702345678"],[,,"670(?:2(?:3[3-7]|56|8[5-8])|32[1238]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[589]|8[3-9]8|989)\\d{4}","\\d{7}(?:\\d{3})?",,,"6702345678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"MP",1,"011","1",,,"1",,,1,,,[,,"NA","NA",,,,,,[-1]],,"670",[,,"NA","NA",,,,,,[-1]],[,,"NA",
  20385. "NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MQ:[,[,,"[56]\\d{8}","\\d{9}",,,,,,[9]],[,,"596(?:0[2-5]|[12]0|3[05-9]|4[024-8]|[5-7]\\d|89|9[4-8])\\d{4}","\\d{9}",,,"596301234"],[,,"696(?:[0-479]\\d|5[013]|8[0-689])\\d{4}","\\d{9}",,,"696201234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MQ",596,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],
  20386. [,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MR:[,[,,"[2-48]\\d{7}","\\d{8}",,,,,,[8]],[,,"25[08]\\d{5}|35\\d{6}|45[1-7]\\d{5}","\\d{8}",,,"35123456"],[,,"[234][0-46-9]\\d{6}","\\d{8}",,,"22123456"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MR",222,"00",,,,,,,,[[,"([2-48]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA",
  20387. "NA",,,,,,[-1]]],MS:[,[,,"[5689]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"664491\\d{4}","\\d{7}(?:\\d{3})?",,,"6644912345"],[,,"66449[2-6]\\d{4}","\\d{10}",,,"6644923456"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"MS",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"664",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,
  20388. ,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MT:[,[,,"[2357-9]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:0(?:1[0-6]|3[1-4]|[69]\\d)|[1-357]\\d{2})\\d{4}","\\d{8}",,,"21001234"],[,,"(?:7(?:210|[79]\\d{2})|9(?:2(?:1[01]|31)|696|8(?:1[1-3]|89|97)|9\\d{2}))\\d{4}","\\d{8}",,,"96961234"],[,,"800[3467]\\d{4}","\\d{8}",,,"80071234"],[,,"5(?:0(?:0(?:37|43)|6\\d{2}|70\\d|9[0168]\\d)|[12]\\d0[1-5])\\d{3}","\\d{8}",,,"50037123"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"3550\\d{4}","\\d{8}",,,"35501234"],"MT",356,
  20389. "00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2"]],,[,,"7117\\d{4}","\\d{8}",,,"71171234"],,,[,,"NA","NA",,,,,,[-1]],[,,"501\\d{5}","\\d{8}",,,"50112345"],,,[,,"NA","NA",,,,,,[-1]]],MU:[,[,,"[2-9]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"(?:2(?:[03478]\\d|1[0-7]|6[1-69])|4(?:[013568]\\d|2[4-7])|5(?:44\\d|471)|6\\d{2}|8(?:14|3[129]))\\d{4}","\\d{7,8}",,,"2012345"],[,,"5(?:2[59]\\d|4(?:2[1-389]|4\\d|7[1-9]|9\\d)|7\\d{2}|8(?:[0-25689]\\d|7[15-8])|9[0-8]\\d)\\d{4}","\\d{8}",,,"52512345",,,[8]],[,,"80[012]\\d{4}",
  20390. "\\d{7}",,,"8001234",,,[7]],[,,"30\\d{5}","\\d{7}",,,"3012345",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"3(?:20|9\\d)\\d{4}","\\d{7}",,,"3201234",,,[7]],"MU",230,"0(?:0|[2-7]0|33)",,,,,,"020",,[[,"([2-46-9]\\d{2})(\\d{4})","$1 $2",["[2-46-9]"]],[,"(5\\d{3})(\\d{4})","$1 $2",["5"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MV:[,[,,"[3467]\\d{6}|9(?:00\\d{7}|\\d{6})","\\d{7,10}",,,,,,[7,10]],[,,"(?:3(?:0[01]|3[0-59])|6(?:[567][02468]|8[024689]|90))\\d{4}",
  20391. "\\d{7}",,,"6701234",,,[7]],[,,"(?:46[46]|7[3-9]\\d|9[15-9]\\d)\\d{4}","\\d{7}",,,"7712345",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"900\\d{7}","\\d{10}",,,"9001234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MV",960,"0(?:0|19)",,,,,,"00",,[[,"(\\d{3})(\\d{4})","$1-$2",["[3467]|9(?:[1-9]|0[1-9])"]],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["900"]]],,[,,"781\\d{4}","\\d{7}",,,"7812345",,,[7]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],
  20392. MW:[,[,,"(?:1(?:\\d{2})?|[2789]\\d{2})\\d{6}","\\d{7,9}",,,,,,[7,9]],[,,"(?:1[2-9]|21\\d{2})\\d{5}","\\d{7,9}",,,"1234567"],[,,"(?:111|77\\d|88\\d|99\\d)\\d{6}","\\d{9}",,,"991234567",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MW",265,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1"],"0$1"],[,"(2\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1789]"],
  20393. "0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MX:[,[,,"[1-9]\\d{9,10}","\\d{7,11}",,,,,,[10,11],[7,8]],[,,"(?:33|55|81)\\d{8}|(?:2(?:0[01]|2[2-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-6][1-9]|[37][1-8]|8[1-35-9]|9[2-689])|5(?:88|9[1-79])|6(?:1[2-68]|[234][1-9]|5[1-3689]|6[12457-9]|7[1-7]|8[67]|9[4-8])|7(?:[13467][1-9]|2[1-8]|5[13-9]|8[1-69]|9[17])|8(?:2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))\\d{7}",
  20394. "\\d{7,10}",,,"2221234567",,,[10]],[,,"1(?:(?:33|55|81)\\d{8}|(?:2(?:2[2-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-6][1-9]|[37][1-8]|8[1-35-9]|9[2-689])|5(?:88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[12457-9]|7[1-7]|8[67]|9[4-8])|7(?:[13467][1-9]|2[1-8]|5[13-9]|8[1-69]|9[17])|8(?:2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))\\d{7})","\\d{11}",,,"12221234567",,,
  20395. [11]],[,,"8(?:00|88)\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,,"900\\d{7}","\\d{10}",,,"9001234567",,,[10]],[,,"300\\d{7}","\\d{10}",,,"3001234567",,,[10]],[,,"500\\d{7}","\\d{10}",,,"5001234567",,,[10]],[,,"NA","NA",,,,,,[-1]],"MX",52,"0[09]","01",,,"0[12]|04[45](\\d{10})","1$1",,,[[,"([358]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["33|55|81"],"01 $1",,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2467]|3[0-2457-9]|5[089]|8[02-9]|9[0-35-9]"],"01 $1",,1],[,"(1)([358]\\d)(\\d{4})(\\d{4})","044 $2 $3 $4",
  20396. ["1(?:33|55|81)"],"$1",,1],[,"(1)(\\d{3})(\\d{3})(\\d{4})","044 $2 $3 $4",["1(?:[2467]|3[0-2457-9]|5[089]|8[2-9]|9[1-35-9])"],"$1",,1]],[[,"([358]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["33|55|81"],"01 $1",,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2467]|3[0-2457-9]|5[089]|8[02-9]|9[0-35-9]"],"01 $1",,1],[,"(1)([358]\\d)(\\d{4})(\\d{4})","$1 $2 $3 $4",["1(?:33|55|81)"]],[,"(1)(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1(?:[2467]|3[0-2457-9]|5[089]|8[2-9]|9[1-35-9])"]]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA",
  20397. "NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],MY:[,[,,"[13-9]\\d{7,9}","\\d{6,10}",,,,,,[8,9,10],[6,7]],[,,"(?:3[2-9]\\d|[4-9][2-9])\\d{6}","\\d{6,9}",,,"323456789",,,[8,9]],[,,"1(?:1[1-5]\\d{2}|[02-4679][2-9]\\d|59\\d{2}|8(?:1[23]|[2-9]\\d))\\d{5}","\\d{9,10}",,,"123456789",,,[9,10]],[,,"1[378]00\\d{6}","\\d{10}",,,"1300123456",,,[10]],[,,"1600\\d{6}","\\d{10}",,,"1600123456",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"154\\d{7}","\\d{10}",,,"1541234567",,,[10]],
  20398. "MY",60,"00","0",,,"0",,,,[[,"([4-79])(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],[,"(3)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],[,"([18]\\d)(\\d{3})(\\d{3,4})","$1-$2 $3",["1[02-46-9][1-9]|8"],"0$1"],[,"(1)([36-8]00)(\\d{2})(\\d{4})","$1-$2-$3-$4",["1[36-8]0"]],[,"(11)(\\d{4})(\\d{4})","$1-$2 $3",["11"],"0$1"],[,"(15[49])(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MZ:[,[,,"[28]\\d{7,8}","\\d{8,9}",
  20399. ,,,,,[8,9]],[,,"2(?:[1346]\\d|5[0-2]|[78][12]|93)\\d{5}","\\d{8}",,,"21123456",,,[8]],[,,"8[23467]\\d{7}","\\d{9}",,,"821234567",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MZ",258,"00",,,,,,,,[[,"([28]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-7]"]],[,"(80\\d)(\\d{3})(\\d{3})","$1 $2 $3",["80"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],
  20400. NA:[,[,,"[68]\\d{7,8}","\\d{8,9}",,,,,,[8,9]],[,,"6(?:1(?:17|2(?:[0189]\\d|[2-6]|7\\d?)|3(?:[01378]|2\\d)|4(?:[024]|10?|3[15]?)|69|7[014])|2(?:17|5(?:[0-36-8]|4\\d?)|69|70)|3(?:17|2(?:[0237]\\d?|[14-689])|34|6[289]|7[01]|81)|4(?:17|2(?:[012]|7\\d?)|4(?:[06]|1\\d?)|5(?:[01357]|[25]\\d?)|69|7[01])|5(?:17|2(?:[0459]|[23678]\\d?)|69|7[01])|6(?:17|2(?:5|6\\d?)|38|42|69|7[01])|7(?:17|2(?:[569]|[234]\\d?)|3(?:0\\d?|[13])|69|7[01]))\\d{4}","\\d{8,9}",,,"61221234"],[,,"(?:60|8[125])\\d{7}","\\d{9}",,,"811234567",
  20401. ,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"8701\\d{5}","\\d{9}",,,"870123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"8(?:3\\d{2}|86)\\d{5}","\\d{8,9}",,,"88612345"],"NA",264,"00","0",,,"0",,,,[[,"(8\\d)(\\d{3})(\\d{4})","$1 $2 $3",["8[1235]"],"0$1"],[,"(6\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],[,"(88)(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],[,"(870)(\\d{3})(\\d{3})","$1 $2 $3",["870"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA",
  20402. "NA",,,,,,[-1]]],NC:[,[,,"[2-57-9]\\d{5}","\\d{6}",,,,,,[6]],[,,"(?:2[03-9]|3[0-5]|4[1-7]|88)\\d{4}","\\d{6}",,,"201234"],[,,"(?:5[0-4]|[79]\\d|8[0-79])\\d{4}","\\d{6}",,,"751234"],[,,"NA","NA",,,,,,[-1]],[,,"36\\d{4}","\\d{6}",,,"366711"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NC",687,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[2-46-9]|5[0-4]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],NE:[,
  20403. [,,"[0289]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:0(?:20|3[1-7]|4[134]|5[14]|6[14578]|7[1-578])|1(?:4[145]|5[14]|6[14-68]|7[169]|88))\\d{4}","\\d{8}",,,"20201234"],[,,"(?:8[089]|9\\d)\\d{6}","\\d{8}",,,"93123456"],[,,"08\\d{6}","\\d{8}",,,"08123456"],[,,"09\\d{6}","\\d{8}",,,"09123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NE",227,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[289]|09"]],[,"(08)(\\d{3})(\\d{3})","$1 $2 $3",["08"]]],,[,,"NA","NA",
  20404. ,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],NF:[,[,,"[13]\\d{5}","\\d{5,6}",,,,,,[6],[5]],[,,"(?:1(?:06|17|28|39)|3[012]\\d)\\d{3}","\\d{5,6}",,,"106609"],[,,"3[58]\\d{4}","\\d{5,6}",,,"381234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NF",672,"00",,,,,,,,[[,"(\\d{2})(\\d{4})","$1 $2",["1"]],[,"(\\d)(\\d{5})","$1 $2",["3"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],
  20405. [,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],NG:[,[,,"[1-6]\\d{5,8}|9\\d{5,9}|[78]\\d{5,13}","\\d{5,14}",,,,,,[7,8,10,11,12,13,14],[5,6]],[,,"[12]\\d{6,7}|9(?:0[3-9]|[1-9]\\d)\\d{5}|(?:3\\d|4[023568]|5[02368]|6[02-469]|7[4-69]|8[2-9])\\d{6}|(?:4[47]|5[14579]|6[1578]|7[0-357])\\d{5,6}|(?:78|41)\\d{5}","\\d{5,8}",,,"12345678",,,[7,8]],[,,"(?:1(?:7[34]\\d|8(?:04|[124579]\\d|8[0-3])|95\\d)|287[0-7]|3(?:18[1-8]|88[0-7]|9(?:8[5-9]|6[1-5]))|4(?:28[0-2]|6(?:7[1-9]|8[02-47])|88[0-2])|5(?:2(?:7[7-9]|8\\d)|38[1-79]|48[0-7]|68[4-7])|6(?:2(?:7[7-9]|8\\d)|4(?:3[7-9]|[68][129]|7[04-69]|9[1-8])|58[0-2]|98[7-9])|7(?:38[0-7]|69[1-8]|78[2-4])|8(?:28[3-9]|38[0-2]|4(?:2[12]|3[147-9]|5[346]|7[4-9]|8[014-689]|90)|58[1-8]|78[2-9]|88[5-7])|98[07]\\d)\\d{4}|(?:70[1-689]\\d|8(?:0(?:1[01]|[2-9]\\d)|1(?:[0-8]\\d|9[01]))|90[2357-9]\\d)\\d{6}",
  20406. "\\d{8,10}",,,"8021234567",,,[8,10]],[,,"800\\d{7,11}","\\d{10,14}",,,"80017591759",,,[10,11,12,13,14]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NG",234,"009","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["70|8[01]|90[2357-9]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-6]|7(?:[1-79]|0[1-9])|8[2-9]"],"0$1"],[,"([78]00)(\\d{4})(\\d{4,5})","$1 $2 $3",
  20407. ["[78]00"],"0$1"],[,"([78]00)(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]00"],"0$1"],[,"(78)(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"700\\d{7,11}","\\d{10,14}",,,"7001234567",,,[10,11,12,13,14]],,,[,,"NA","NA",,,,,,[-1]]],NI:[,[,,"[12578]\\d{7}","\\d{8}",,,,,,[8]],[,,"2\\d{7}","\\d{8}",,,"21234567"],[,,"5(?:5[0-7]\\d{5}|[78]\\d{6})|7[5-8]\\d{6}|8\\d{7}","\\d{8}",,,"81234567"],[,,"1800\\d{4}","\\d{8}",,,"18001234"],[,,"NA","NA",,,,,,[-1]],[,,"NA",
  20408. "NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NI",505,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],NL:[,[,,"1\\d{4,8}|[2-7]\\d{8}|[89]\\d{6,9}","\\d{5,10}",,,,,,[5,6,7,8,9,10]],[,,"(?:1[0135-8]|2[02-69]|3[0-68]|4[0135-9]|[57]\\d|8[478])\\d{7}","\\d{9}",,,"101234567",,,[9]],[,,"6[1-58]\\d{7}","\\d{9}",,,"612345678",,,[9]],[,,"800\\d{4,7}","\\d{7,10}",,,"8001234",,,[7,8,9,10]],[,,
  20409. "90[069]\\d{4,7}","\\d{7,10}",,,"9061234",,,[7,8,9,10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"(?:6760|85\\d{2})\\d{5}","\\d{9}",,,"851234567",,,[9]],"NL",31,"00","0",,,"0",,,,[[,"([1-578]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1[035]|2[0346]|3[03568]|4[0356]|5[0358]|7|8[4578]"],"0$1"],[,"([1-5]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],[,"(6)(\\d{8})","$1 $2",["6[0-57-9]"],"0$1"],[,"(66)(\\d{7})","$1 $2",["66"],"0$1"],[,"(14)(\\d{3,4})","$1 $2",
  20410. ["14"],"$1"],[,"([89]0\\d)(\\d{4,7})","$1 $2",["80|9"],"0$1"]],,[,,"66\\d{7}","\\d{9}",,,"662345678",,,[9]],,,[,,"14\\d{3,4}","\\d{5,6}",,,,,,[5,6]],[,,"140(?:1(?:[035]|[16-8]\\d)|2(?:[0346]|[259]\\d)|3(?:[03568]|[124]\\d)|4(?:[0356]|[17-9]\\d)|5(?:[0358]|[124679]\\d)|7\\d|8[458])","\\d{5,6}",,,"14020",,,[5,6]],,,[,,"NA","NA",,,,,,[-1]]],NO:[,[,,"0\\d{4}|[2-9]\\d{7}","\\d{5}(?:\\d{3})?",,,,,,[5,8]],[,,"(?:2[1-4]|3[1-3578]|5[1-35-7]|6[1-4679]|7[0-8])\\d{6}","\\d{8}",,,"21234567",,,[8]],[,,"(?:4[015-8]|5[89]|87|9\\d)\\d{6}",
  20411. "\\d{8}",,,"40612345",,,[8]],[,,"80[01]\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"82[09]\\d{5}","\\d{8}",,,"82012345",,,[8]],[,,"810(?:0[0-6]|[2-8]\\d)\\d{3}","\\d{8}",,,"81021234",,,[8]],[,,"880\\d{5}","\\d{8}",,,"88012345",,,[8]],[,,"85[0-5]\\d{5}","\\d{8}",,,"85012345",,,[8]],"NO",47,"00",,,,,,,,[[,"([489]\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[489]"]],[,"([235-7]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-7]"]]],,[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]],[,,"0\\d{4}|81(?:0(?:0[7-9]|1\\d)|5\\d{2})\\d{3}",
  20412. "\\d{5}(?:\\d{3})?",,,"01234"],1,,[,,"81[23]\\d{5}","\\d{8}",,,"81212345",,,[8]]],NP:[,[,,"[1-8]\\d{7}|9(?:[1-69]\\d{6,8}|7[2-6]\\d{5,7}|8\\d{8})","\\d{6,10}",,,,,,[8,10],[6,7]],[,,"(?:1[0-6]\\d|2[13-79][2-6]|3[135-8][2-6]|4[146-9][2-6]|5[135-7][2-6]|6[13-9][2-6]|7[15-9][2-6]|8[1-46-9][2-6]|9[1-79][2-6])\\d{5}","\\d{6,8}",,,"14567890",,,[8]],[,,"9(?:6[013]|7[245]|8[0-24-6])\\d{7}","\\d{10}",,,"9841234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",
  20413. ,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NP",977,"00","0",,,"0",,,,[[,"(1)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],[,"(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-69]|7[15-9])"],"0$1"],[,"(9\\d{2})(\\d{7})","$1-$2",["9(?:6[013]|7[245]|8)"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],NR:[,[,,"[458]\\d{6}","\\d{7}",,,,,,[7]],[,,"(?:444|888)\\d{4}","\\d{7}",,,"4441234"],[,,"55[5-9]\\d{4}","\\d{7}",,,"5551234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",
  20414. ,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NR",674,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],NU:[,[,,"[1-5]\\d{3}","\\d{4}",,,,,,[4]],[,,"[34]\\d{3}","\\d{4}",,,"4002"],[,,"[125]\\d{3}","\\d{4}",,,"1234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NU",683,"00",,,,,,,,,,[,,"NA",
  20415. "NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],NZ:[,[,,"6[235-9]\\d{6}|[2-57-9]\\d{7,10}","\\d{7,11}",,,,,,[8,9,10,11],[7]],[,,"(?:3[2-79]|[49][2-9]|6[235-9]|7[2-57-9])\\d{6}|24099\\d{3}","\\d{7,8}",,,"32345678",,,[8]],[,,"2(?:[028]\\d{7,8}|1(?:[03]\\d{5,7}|[12457]\\d{5,6}|[689]\\d{5})|[79]\\d{7})","\\d{8,10}",,,"211234567",,,[8,9,10]],[,,"508\\d{6,7}|80\\d{6,8}","\\d{8,10}",,,"800123456",,,[8,9,10]],[,,"90\\d{7,9}","\\d{9,11}",,,"900123456",,,[9,10,11]],
  20416. [,,"NA","NA",,,,,,[-1]],[,,"70\\d{7}","\\d{9}",,,"701234567",,,[9]],[,,"NA","NA",,,,,,[-1]],"NZ",64,"0(?:0|161)","0",,,"0",,"00",,[[,"([34679])(\\d{3})(\\d{4})","$1-$2 $3",["[346]|7[2-57-9]|9[1-9]"],"0$1"],[,"(24099)(\\d{3})","$1 $2",["240","2409","24099"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["21"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:1[1-9]|[69]|7[0-35-9])|70|86"],"0$1"],[,"(2\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["2[028]"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",
  20417. ["2(?:10|74)|5|[89]0"],"0$1"]],,[,,"[28]6\\d{6,7}","\\d{8,9}",,,"26123456",,,[8,9]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],OM:[,[,,"(?:5|[279]\\d)\\d{6}|800\\d{5,6}","\\d{7,9}",,,,,,[7,8,9]],[,,"2[2-6]\\d{6}","\\d{8}",,,"23123456",,,[8]],[,,"7[19]\\d{6}|9(?:0[1-9]|[1-9]\\d)\\d{5}","\\d{8}",,,"92123456",,,[8]],[,,"8007\\d{4,5}|500\\d{4}","\\d{7,9}",,,"80071234"],[,,"900\\d{5}","\\d{8}",,,"90012345",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA",
  20418. "NA",,,,,,[-1]],"OM",968,"00",,,,,,,,[[,"(2\\d)(\\d{6})","$1 $2",["2"]],[,"([79]\\d{3})(\\d{4})","$1 $2",["[79]"]],[,"([58]00)(\\d{4,6})","$1 $2",["[58]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PA:[,[,,"[1-9]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"(?:1(?:0[0-8]|1[49]|2[37]|3[0137]|4[147]|5[05]|6[58]|7[0167]|8[58]|9[139])|2(?:[0235679]\\d|1[0-7]|4[04-9]|8[028])|3(?:[09]\\d|1[014-7]|2[0-3]|3[03]|4[03-57]|55|6[068]|7[06-8]|8[06-9])|4(?:3[013-69]|4\\d|7[0-589])|5(?:[01]\\d|2[0-7]|[56]0|79)|7(?:0[09]|2[0-267]|3[06]|[469]0|5[06-9]|7[0-24-79]|8[7-9])|8(?:09|[34]\\d|5[0134]|8[02])|9(?:0[6-9]|1[016-8]|2[036-8]|3[3679]|40|5[0489]|6[06-9]|7[046-9]|8[36-8]|9[1-9]))\\d{4}",
  20419. "\\d{7}",,,"2001234",,,[7]],[,,"(?:1[16]1|21[89]|8(?:1[01]|7[23]))\\d{4}|6(?:[024-9]\\d|1[0-5]|3[0-24-9])\\d{5}","\\d{7,8}",,,"60012345"],[,,"80[09]\\d{4}","\\d{7}",,,"8001234",,,[7]],[,,"(?:779|8(?:55|60|7[78])|9(?:00|81))\\d{4}","\\d{7}",,,"8601234",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"PA",507,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],[,"(\\d{4})(\\d{4})","$1-$2",["6"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,
  20420. ,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PE:[,[,,"[14-9]\\d{7,8}","\\d{6,9}",,,,,,[8,9],[6,7]],[,,"(?:1\\d|4[1-4]|5[1-46]|6[1-7]|7[2-46]|8[2-4])\\d{6}","\\d{6,8}",,,"11234567",,,[8]],[,,"9\\d{8}","\\d{9}",,,"912345678",,,[9]],[,,"800\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"805\\d{5}","\\d{8}",,,"80512345",,,[8]],[,,"801\\d{5}","\\d{8}",,,"80112345",,,[8]],[,,"80[24]\\d{5}","\\d{8}",,,"80212345",,,[8]],[,,"NA","NA",,,,,,[-1]],"PE",51,"19(?:1[124]|77|90)00","0"," Anexo ",,"0",,,,[[,"(1)(\\d{7})","$1 $2",["1"],
  20421. "(0$1)"],[,"([4-8]\\d)(\\d{6})","$1 $2",["[4-7]|8[2-4]"],"(0$1)"],[,"(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],[,"(9\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PF:[,[,,"4\\d{5,7}|8\\d{7}","\\d{6}(?:\\d{2})?",,,,,,[6,8]],[,,"4(?:[09][45689]\\d|4)\\d{4}","\\d{6}(?:\\d{2})?",,,"40412345"],[,,"8[79]\\d{6}","\\d{8}",,,"87123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",
  20422. ,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"PF",689,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4[09]|8[79]"]],[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"44\\d{4}","\\d{6}",,,"441234",,,[6]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PG:[,[,,"[1-9]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"(?:3[0-2]\\d|4[25]\\d|5[34]\\d|64[1-9]|77(?:[0-24]\\d|30)|85[02-46-9]|9[78]\\d)\\d{4}","\\d{7}",,,"3123456",,,[7]],[,,"(?:20150|68\\d{2}|7(?:[0-689]\\d|75)\\d{2})\\d{3}",
  20423. "\\d{7,8}",,,"6812345"],[,,"180\\d{4}","\\d{7}",,,"1801234",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"275\\d{4}","\\d{7}",,,"2751234",,,[7]],"PG",675,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[13-689]|27"]],[,"(\\d{4})(\\d{4})","$1 $2",["20|7"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PH:[,[,,"2\\d{5,7}|[3-9]\\d{7,9}|1800\\d{7,9}","\\d{5,13}",,,,,,[6,8,9,10,11,12,13],[5,7]],[,,"2\\d{5}(?:\\d{2})?|(?:3[2-68]|4[2-9]|5[2-6]|6[2-58]|7[24578]|8[2-8])\\d{7}|88(?:22\\d{6}|42\\d{4})",
  20424. "\\d{5,10}",,,"21234567",,,[6,8,9,10]],[,,"(?:81[37]|9(?:0[5-9]|1[024-9]|2[0-35-9]|3[02-9]|4[236-9]|50|7[34-79]|89|9[4-9]))\\d{7}","\\d{10}",,,"9051234567",,,[10]],[,,"1800\\d{7,9}","\\d{11,13}",,,"180012345678",,,[11,12,13]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"PH",63,"00","0",,,"0",,,,[[,"(2)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],[,"(2)(\\d{5})","$1 $2",["2"],"(0$1)"],[,"(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|5(?:22|44)|642|8(?:62|8[245])",
  20425. "3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],[,"(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],[,"([3-8]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[3-8]"],"(0$1)"],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["81|9"],"0$1"],[,"(1800)(\\d{3})(\\d{4})","$1 $2 $3",["1"]],[,"(1800)(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA",
  20426. "NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PK:[,[,,"1\\d{8}|[2-8]\\d{5,11}|9(?:[013-9]\\d{4,9}|2\\d(?:111\\d{6}|\\d{3,7}))","\\d{6,12}",,,,,,[8,9,10,11,12],[6,7]],[,,"(?:21|42)[2-9]\\d{7}|(?:2[25]|4[0146-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]\\d{6}|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8]))[2-9]\\d{5,6}|58[126]\\d{7}","\\d{6,10}",,,"2123456789",,,[9,10]],[,,"3(?:0\\d|1[0-6]|2[0-5]|3[0-7]|4[0-8]|55|64)\\d{7}",
  20427. "\\d{10}",,,"3012345678",,,[10]],[,,"800\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"900\\d{5}","\\d{8}",,,"90012345",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"122\\d{6}","\\d{9}",,,"122044444",,,[9]],[,,"NA","NA",,,,,,[-1]],"PK",92,"00","0",,,"0",,,,[[,"(\\d{2})(111)(\\d{3})(\\d{3})","$1 $2 $3 $4",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)1","(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)11","(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)111"],"(0$1)"],[,"(\\d{3})(111)(\\d{3})(\\d{3})",
  20428. "$1 $2 $3 $4",["2[349]|45|54|60|72|8[2-5]|9[2-9]","(?:2[349]|45|54|60|72|8[2-5]|9[2-9])\\d1","(?:2[349]|45|54|60|72|8[2-5]|9[2-9])\\d11","(?:2[349]|45|54|60|72|8[2-5]|9[2-9])\\d111"],"(0$1)"],[,"(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],[,"(\\d{3})(\\d{6,7})","$1 $2",["2[349]|45|54|60|72|8[2-5]|9[2-9]","(?:2[349]|45|54|60|72|8[2-5]|9[2-9])\\d[2-9]"],"(0$1)"],[,"(3\\d{2})(\\d{7})","$1 $2",["3"],"0$1"],[,"([15]\\d{3})(\\d{5,6})","$1 $2",["58[12]|1"],
  20429. "(0$1)"],[,"(586\\d{2})(\\d{5})","$1 $2",["586"],"(0$1)"],[,"([89]00)(\\d{3})(\\d{2})","$1 $2 $3",["[89]00"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"(?:2(?:[125]|3[2358]|4[2-4]|9[2-8])|4(?:[0-246-9]|5[3479])|5(?:[1-35-7]|4[2-467])|6(?:[1-8]|0[468])|7(?:[14]|2[236])|8(?:[16]|2[2-689]|3[23578]|4[3478]|5[2356])|9(?:1|22|3[27-9]|4[2-6]|6[3569]|9[2-7]))111\\d{6}","\\d{11,12}",,,"21111825888",,,[11,12]],,,[,,"NA","NA",,,,,,[-1]]],PL:[,[,,"[12]\\d{6,8}|[3-57-9]\\d{8}|6\\d{5,8}","\\d{6,9}",
  20430. ,,,,,[6,7,8,9]],[,,"(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])\\d{7}|[12]2\\d{5}","\\d{6,9}",,,"123456789",,,[7,9]],[,,"(?:5[0137]|6[069]|7[2389]|88)\\d{7}","\\d{9}",,,"512345678",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"70\\d{7}","\\d{9}",,,"701234567",,,[9]],[,,"801\\d{6}","\\d{9}",,,"801234567",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"39\\d{7}","\\d{9}",,,"391234567",,,[9]],"PL",48,"00",,,,,,,,[[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[14]|2[0-57-9]|3[2-4]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145]"]],
  20431. [,"(\\d{2})(\\d{1})(\\d{4})","$1 $2 $3",["[12]2"]],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["26|39|5[0137]|6[0469]|7[02389]|8[08]"]],[,"(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],[,"(\\d{3})(\\d{3})","$1 $2",["64"]]],,[,,"64\\d{4,7}","\\d{6,9}",,,"641234567"],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PM:[,[,,"[45]\\d{5}","\\d{6}",,,,,,[6]],[,,"41\\d{4}","\\d{6}",,,"411234"],[,,"55\\d{4}","\\d{6}",,,"551234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,
  20432. ,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"PM",508,"00","0",,,"0",,,,[[,"([45]\\d)(\\d{2})(\\d{2})","$1 $2 $3",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PR:[,[,,"[5789]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"(?:787|939)[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"7872345678"],[,,"(?:787|939)[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"7872345678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],
  20433. [,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"PR",1,"011","1",,,"1",,,1,,,[,,"NA","NA",,,,,,[-1]],,"787|939",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PS:[,[,,"[24589]\\d{7,8}|1(?:[78]\\d{8}|[49]\\d{2,3})","\\d{4,10}",,,,,,[4,5,8,9,10],[7]],[,,"(?:22[234789]|42[45]|82[01458]|92[369])\\d{5}","\\d{7,8}",,,"22234567",,,[8]],[,,"5[69]\\d{7}","\\d{9}",,,
  20434. "599123456",,,[9]],[,,"1800\\d{6}","\\d{10}",,,"1800123456",,,[10]],[,,"1(?:4|9\\d)\\d{2}","\\d{4,5}",,,"19123",,,[4,5]],[,,"1700\\d{6}","\\d{10}",,,"1700123456",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"PS",970,"00","0",,,"0",,,,[[,"([2489])(2\\d{2})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],[,"(5[69]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],[,"(1[78]00)(\\d{3})(\\d{3})","$1 $2 $3",["1[78]"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA",
  20435. "NA",,,,,,[-1]]],PT:[,[,,"[2-46-9]\\d{8}","\\d{9}",,,,,,[9]],[,,"2(?:[12]\\d|[35][1-689]|4[1-59]|6[1-35689]|7[1-9]|8[1-69]|9[1256])\\d{6}","\\d{9}",,,"212345678"],[,,"9(?:[1236]\\d{2}|480)\\d{5}","\\d{9}",,,"912345678"],[,,"80[02]\\d{6}","\\d{9}",,,"800123456"],[,,"6(?:0[178]|4[68])\\d{6}|76(?:0[1-57]|1[2-47]|2[237])\\d{5}","\\d{9}",,,"760123456"],[,,"80(?:8\\d|9[1579])\\d{5}","\\d{9}",,,"808123456"],[,,"884[0-4689]\\d{5}","\\d{9}",,,"884123456"],[,,"30\\d{7}","\\d{9}",,,"301234567"],"PT",351,"00",
  20436. ,,,,,,,[[,"(2\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],[,"([2-46-9]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[3-9]|[346-9]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"7(?:0(?:7\\d|8[17]))\\d{5}","\\d{9}",,,"707123456"],,,[,,"600\\d{6}","\\d{9}",,,"600110000"]],PW:[,[,,"[2-8]\\d{6}","\\d{7}",,,,,,[7]],[,,"2552255|(?:277|345|488|5(?:35|44|87)|6(?:22|54|79)|7(?:33|47)|8(?:24|55|76))\\d{4}","\\d{7}",,,"2771234"],[,,"(?:6[234689]0|77[45789])\\d{4}","\\d{7}",,,"6201234"],[,,"NA","NA",,,,,
  20437. ,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"PW",680,"01[12]",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PY:[,[,,"5[0-5]\\d{4,7}|[2-46-9]\\d{5,8}","\\d{5,9}",,,,,,[6,7,8,9],[5]],[,,"(?:[26]1|3[289]|4[124678]|7[123]|8[1236])\\d{5,7}|(?:2(?:2[4568]|7[15]|9[1-5])|3(?:18|3[167]|4[2357]|51)|4(?:18|2[45]|3[12]|5[13]|64|71|9[1-47])|5(?:[1-4]\\d|5[0234])|6(?:3[1-3]|44|7[1-4678])|7(?:17|4[0-4]|6[1-578]|75|8[0-8])|858)\\d{5,6}",
  20438. "\\d{5,9}",,,"212345678",,,[7,8,9]],[,,"9(?:6[12]|[78][1-6]|9[1-5])\\d{6}","\\d{9}",,,"961456789",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"8700[0-4]\\d{4}","\\d{9}",,,"870012345",,,[9]],"PY",595,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{5})","$1 $2",["(?:[26]1|3[289]|4[124678]|7[123]|8[1236])"],"(0$1)"],[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["(?:[26]1|3[289]|4[124678]|7[123]|8[1236])"],"(0$1)"],[,"(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],
  20439. "0$1"],[,"(\\d{3})(\\d{6})","$1 $2",["9[1-9]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8700"]],[,"(\\d{3})(\\d{4,5})","$1 $2",["[2-8][1-9]"],"(0$1)"],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8][1-9]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"[2-9]0\\d{4,7}","\\d{6,9}",,,"201234567"],,,[,,"NA","NA",,,,,,[-1]]],QA:[,[,,"[2-8]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"4[04]\\d{6}","\\d{8}",,,"44123456",,,[8]],[,,"[3567]\\d{7}","\\d{8}",,,"33123456",,,[8]],[,,"800\\d{4}",
  20440. "\\d{7}",,,"8001234",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"QA",974,"00",,,,,,,,[[,"([28]\\d{2})(\\d{4})","$1 $2",["[28]"]],[,"([3-7]\\d{3})(\\d{4})","$1 $2",["[3-7]"]]],,[,,"2(?:[12]\\d|61)\\d{4}","\\d{7}",,,"2123456",,,[7]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],RE:[,[,,"[268]\\d{8}","\\d{9}",,,,,,[9]],[,,"262\\d{6}","\\d{9}",,,"262161234"],[,,"6(?:9[23]|47)\\d{6}","\\d{9}",,,"692123456"],[,,"80\\d{7}",
  20441. "\\d{9}",,,"801234567"],[,,"89[1-37-9]\\d{6}","\\d{9}",,,"891123456"],[,,"8(?:1[019]|2[0156]|84|90)\\d{6}","\\d{9}",,,"810123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"RE",262,"00","0",,,"0",,,,[[,"([268]\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],1,"262|6[49]|8",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],RO:[,[,,"2\\d{5,8}|[37-9]\\d{8}","\\d{6,9}",,,,,,[6,9]],[,,"2(?:1(?:\\d{7}|9\\d{3})|[3-6](?:\\d{7}|\\d9\\d{2}))|3[13-6]\\d{7}",
  20442. "\\d{6,9}",,,"211234567"],[,,"7(?:[0-8]\\d{2}|99\\d)\\d{5}","\\d{9}",,,"712345678",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"90[036]\\d{6}","\\d{9}",,,"900123456",,,[9]],[,,"801\\d{6}","\\d{9}",,,"801123456",,,[9]],[,,"802\\d{6}","\\d{9}",,,"802123456",,,[9]],[,,"NA","NA",,,,,,[-1]],"RO",40,"00","0"," int ",,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],[,"(21)(\\d{4})","$1 $2",["21"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23][3-7]|[7-9]"],"0$1"],[,"(2\\d{2})(\\d{3})",
  20443. "$1 $2",["2[3-6]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"37\\d{7}","\\d{9}",,,"372123456",,,[9]],,,[,,"NA","NA",,,,,,[-1]]],RS:[,[,,"[126-9]\\d{4,11}|3(?:[0-79]\\d{3,10}|8[2-9]\\d{2,9})","\\d{5,12}",,,,,,[6,7,8,9,10,11,12],[5]],[,,"(?:1(?:[02-9][2-9]|1[1-9])\\d|2(?:[0-24-7][2-9]\\d|[389](?:0[2-9]|[2-9]\\d))|3(?:[0-8][2-9]\\d|9(?:[2-9]\\d|0[2-9])))\\d{3,8}","\\d{5,12}",,,"10234567",,,[7,8,9,10,11,12]],[,,"6(?:[0-689]|7\\d)\\d{6,7}","\\d{8,10}",,,"601234567",,,[8,9,10]],[,,
  20444. "800\\d{3,9}","\\d{6,12}",,,"80012345"],[,,"(?:90[0169]|78\\d)\\d{3,7}","\\d{6,12}",,,"90012345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"RS",381,"00","0",,,"0",,,,[[,"([23]\\d{2})(\\d{4,9})","$1 $2",["(?:2[389]|39)0"],"0$1"],[,"([1-3]\\d)(\\d{5,10})","$1 $2",["1|2(?:[0-24-7]|[389][1-9])|3(?:[0-8]|9[1-9])"],"0$1"],[,"(6\\d)(\\d{6,8})","$1 $2",["6"],"0$1"],[,"([89]\\d{2})(\\d{3,9})","$1 $2",["[89]"],"0$1"],[,"(7[26])(\\d{4,9})","$1 $2",["7[26]"],"0$1"],[,"(7[08]\\d)(\\d{4,9})",
  20445. "$1 $2",["7[08]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"7[06]\\d{4,10}","\\d{6,12}",,,"700123456"],,,[,,"NA","NA",,,,,,[-1]]],RU:[,[,,"[3489]\\d{9}","\\d{10}",,,,,,[10]],[,,"(?:3(?:0[12]|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15]|6[1-35-79]|7[1-37-9]))\\d{7}","\\d{10}",,,"3011234567"],[,,"9\\d{9}","\\d{10}",,,"9123456789"],[,,"80[04]\\d{7}","\\d{10}",,,"8001234567"],[,,"80[39]\\d{7}","\\d{10}",
  20446. ,,"8091234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"RU",7,"810","8",,,"8",,"8~10",,[[,"(\\d{3})(\\d{2})(\\d{2})","$1-$2-$3",["[1-79]"],"$1",,1],[,"([3489]\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[34689]"],"8 ($1)",,1],[,"(7\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",,1]],[[,"([3489]\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[34689]"],"8 ($1)",,1],[,"(7\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",,1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA",
  20447. "NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],RW:[,[,,"[027-9]\\d{7,8}","\\d{8,9}",,,,,,[8,9]],[,,"2[258]\\d{7}|06\\d{6}","\\d{8,9}",,,"250123456"],[,,"7[238]\\d{7}","\\d{9}",,,"720123456",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"900\\d{6}","\\d{9}",,,"900123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"RW",250,"00","0",,,"0",,,,[[,"(2\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"$1"],[,"([7-9]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",
  20448. ["[7-9]"],"0$1"],[,"(0\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],SA:[,[,,"1\\d{7,8}|(?:[2-467]|92)\\d{7}|5\\d{8}|8\\d{9}","\\d{7,10}",,,,,,[8,9,10],[7]],[,,"11\\d{7}|1?(?:2[24-8]|3[35-8]|4[3-68]|6[2-5]|7[235-7])\\d{6}","\\d{7,9}",,,"112345678",,,[8,9]],[,,"(?:5(?:[013-689]\\d|7[0-26-8])|811\\d)\\d{6}","\\d{9,10}",,,"512345678",,,[9,10]],[,,"800\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,
  20449. ,"NA","NA",,,,,,[-1]],[,,"92[05]\\d{6}","\\d{9}",,,"920012345",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SA",966,"00","0",,,"0",,,,[[,"([1-467])(\\d{3})(\\d{4})","$1 $2 $3",["[1-467]"],"0$1"],[,"(1\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1[1-467]"],"0$1"],[,"(5\\d)(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],[,"(92\\d{2})(\\d{5})","$1 $2",["92"],"$1"],[,"(800)(\\d{3})(\\d{4})","$1 $2 $3",["80"],"$1"],[,"(811)(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",
  20450. ,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SB:[,[,,"[1-9]\\d{4,6}","\\d{5,7}",,,,,,[5,7]],[,,"(?:1[4-79]|[23]\\d|4[0-2]|5[03]|6[0-37])\\d{3}","\\d{5}",,,"40123",,,[5]],[,,"48\\d{3}|7(?:30|[46-8]\\d|5[025-9]|9[0-5])\\d{4}|8[4-9]\\d{5}|9(?:1[2-9]|2[013-9]|3[0-2]|[46]\\d|5[0-46-9]|7[0-689]|8[0-79]|9[0-8])\\d{4}","\\d{5,7}",,,"7421234"],[,,"1[38]\\d{3}","\\d{5}",,,"18123",,,[5]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"5[12]\\d{3}","\\d{5}",,,"51123",
  20451. ,,[5]],"SB",677,"0[01]",,,,,,,,[[,"(\\d{2})(\\d{5})","$1 $2",["[7-9]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SC:[,[,,"[2468]\\d{5,6}","\\d{6,7}",,,,,,[6,7]],[,,"4[2-46]\\d{5}","\\d{7}",,,"4217123",,,[7]],[,,"2[5-8]\\d{5}","\\d{7}",,,"2510123",,,[7]],[,,"8000\\d{2}","\\d{6}",,,"800000",,,[6]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"64\\d{5}","\\d{7}",,,"6412345",,,[7]],"SC",248,"0[0-2]",,,,,,"00",
  20452. ,[[,"(\\d{3})(\\d{3})","$1 $2",["8"]],[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SD:[,[,,"[19]\\d{8}","\\d{9}",,,,,,[9]],[,,"1(?:[125]\\d|8[3567])\\d{6}","\\d{9}",,,"121231234"],[,,"9[0-3569]\\d{7}","\\d{9}",,,"911231234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SD",249,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{4})",
  20453. "$1 $2 $3",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SE:[,[,,"[1-35-9]\\d{5,11}|4\\d{6,8}","\\d{6,12}",,,,,,[6,7,8,9,10,12]],[,,"1(?:0[1-8]\\d{6}|[136]\\d{5,7}|(?:2[0-35]|4[0-4]|5[0-25-9]|7[13-6]|[89]\\d)\\d{5,6})|2(?:[136]\\d{5,7}|(?:2[0-7]|4[0136-8]|5[0138]|7[018]|8[01]|9[0-57])\\d{5,6})|3(?:[356]\\d{5,7}|(?:0[0-4]|1\\d|2[0-25]|4[056]|7[0-2]|8[0-3]|9[023])\\d{5,6})|4(?:[0246]\\d{5,7}|(?:1[013-8]|3[0135]|5[14-79]|7[0-246-9]|8[0156]|9[0-689])\\d{5,6})|5(?:0[0-6]|[15][0-5]|2[0-68]|3[0-4]|4\\d|6[03-5]|7[013]|8[0-79]|9[01])\\d{5,6}|6(?:[03]\\d{5,7}|(?:1[1-3]|2[0-4]|4[02-57]|5[0-37]|6[0-3]|7[0-2]|8[0247]|9[0-356])\\d{5,6})|8\\d{6,8}|9(?:0[1-9]\\d{4,6}|(?:1[0-68]|2\\d|3[02-5]|4[0-3]|5[0-4]|[68][01]|7[0135-8])\\d{5,6})",
  20454. "\\d{7,9}",,,"8123456",,,[7,8,9]],[,,"7[02369]\\d{7}","\\d{9}",,,"701234567",,,[9]],[,,"20\\d{4,7}","\\d{6,9}",,,"20123456",,,[6,7,8,9]],[,,"649\\d{6}|9(?:00|39|44)[1-8]\\d{3,6}","\\d{7,10}",,,"9001234567",,,[7,8,9,10]],[,,"77(?:0\\d{3}(?:\\d{3})?|[1-7]\\d{6})","\\d{6}(?:\\d{3})?",,,"771234567",,,[6,9]],[,,"75[1-8]\\d{6}","\\d{9}",,,"751234567",,,[9]],[,,"NA","NA",,,,,,[-1]],"SE",46,"00","0",,,"0",,,,[[,"(8)(\\d{2,3})(\\d{2,3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1"],[,"([1-69]\\d)(\\d{2,3})(\\d{2})(\\d{2})",
  20455. "$1-$2 $3 $4",["1[013689]|2[0136]|3[1356]|4[0246]|54|6[03]|90"],"0$1"],[,"([1-469]\\d)(\\d{3})(\\d{2})","$1-$2 $3",["1[136]|2[136]|3[356]|4[0246]|6[03]|90"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[0-5]|4[0-3])"],"0$1"],[,"(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[0-5]|4[0-3])"],"0$1"],[,"(7\\d)(\\d{3})(\\d{2})(\\d{2})",
  20456. "$1-$2 $3 $4",["7"],"0$1"],[,"(77)(\\d{2})(\\d{2})","$1-$2$3",["7"],"0$1"],[,"(20)(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1"],[,"(9[034]\\d)(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9[034]"],"0$1"],[,"(9[034]\\d)(\\d{4})","$1-$2",["9[034]"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["25[245]|67[3-6]"],"0$1"]],[[,"(8)(\\d{2,3})(\\d{2,3})(\\d{2})","$1 $2 $3 $4",["8"]],[,"([1-69]\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[013689]|2[0136]|3[1356]|4[0246]|54|6[03]|90"]],
  20457. [,"([1-469]\\d)(\\d{3})(\\d{2})","$1 $2 $3",["1[136]|2[136]|3[356]|4[0246]|6[03]|90"]],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[0-5]|4[0-3])"]],[,"(\\d{3})(\\d{2,3})(\\d{2})","$1 $2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[0-5]|4[0-3])"]],[,"(7\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7"]],[,"(77)(\\d{2})(\\d{2})","$1 $2 $3",["7"]],
  20458. [,"(20)(\\d{2,3})(\\d{2})","$1 $2 $3",["20"]],[,"(9[034]\\d)(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["9[034]"]],[,"(9[034]\\d)(\\d{4})","$1 $2",["9[034]"]],[,"(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["25[245]|67[3-6]"]]],[,,"74[02-9]\\d{6}","\\d{9}",,,"740123456",,,[9]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"(?:25[245]|67[3-6])\\d{9}","\\d{12}",,,"254123456789",,,[12]]],SG:[,[,,"[36]\\d{7}|[17-9]\\d{7,10}","\\d{8,11}",,,,,,[8,10,11]],[,,"6[1-9]\\d{6}","\\d{8}",
  20459. ,,"61234567",,,[8]],[,,"(?:8[1-8]|9[0-8])\\d{6}","\\d{8}",,,"81234567",,,[8]],[,,"1?800\\d{7}","\\d{10,11}",,,"18001234567",,,[10,11]],[,,"1900\\d{7}","\\d{11}",,,"19001234567",,,[11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"3[12]\\d{6}","\\d{8}",,,"31234567",,,[8]],"SG",65,"0[0-3]\\d",,,,,,,,[[,"([3689]\\d{3})(\\d{4})","$1 $2",["[369]|8[1-9]"]],[,"(1[89]00)(\\d{3})(\\d{4})","$1 $2 $3",["1[89]"]],[,"(7000)(\\d{4})(\\d{3})","$1 $2 $3",["70"]],[,"(800)(\\d{3})(\\d{4})","$1 $2 $3",["80"]]],
  20460. ,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"7000\\d{7}","\\d{11}",,,"70001234567",,,[11]],,,[,,"NA","NA",,,,,,[-1]]],SH:[,[,,"[256]\\d{4}","\\d{4,5}",,,,,,[4,5]],[,,"2(?:[0-57-9]\\d|6[4-9])\\d{2}","\\d{5}",,,"22158"],[,,"[56]\\d{4}","\\d{5}",,,,,,[5]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"262\\d{2}","\\d{5}",,,,,,[5]],"SH",290,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA",
  20461. "NA",,,,,,[-1]]],SI:[,[,,"[1-7]\\d{6,7}|[89]\\d{4,7}","\\d{5,8}",,,,,,[5,6,7,8]],[,,"(?:1\\d|[25][2-8]|3[24-8]|4[24-8]|7[3-8])\\d{6}","\\d{7,8}",,,"11234567",,,[8]],[,,"(?:[37][01]|4[0139]|51|6[48])\\d{6}","\\d{8}",,,"31234567",,,[8]],[,,"80\\d{4,6}","\\d{6,8}",,,"80123456",,,[6,7,8]],[,,"90\\d{4,6}|89[1-3]\\d{2,5}","\\d{5,8}",,,"90123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"(?:59|8[1-3])\\d{6}","\\d{8}",,,"59012345",,,[8]],"SI",386,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{2})(\\d{2})",
  20462. "$1 $2 $3 $4",["[12]|3[24-8]|4[24-8]|5[2-8]|7[3-8]"],"(0$1)"],[,"([3-7]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],[,"([89][09])(\\d{3,6})","$1 $2",["[89][09]"],"0$1"],[,"([58]\\d{2})(\\d{5})","$1 $2",["59|8[1-3]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SJ:[,[,,"0\\d{4}|[4789]\\d{7}","\\d{5}(?:\\d{3})?",,,,,,[5,8]],[,,"79\\d{6}","\\d{8}",,,"79123456",,,[8]],[,,"(?:4[015-8]|5[89]|9\\d)\\d{6}","\\d{8}",,,"41234567",
  20463. ,,[8]],[,,"80[01]\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"82[09]\\d{5}","\\d{8}",,,"82012345",,,[8]],[,,"810(?:0[0-6]|[2-8]\\d)\\d{3}","\\d{8}",,,"81021234",,,[8]],[,,"880\\d{5}","\\d{8}",,,"88012345",,,[8]],[,,"85[0-5]\\d{5}","\\d{8}",,,"85012345",,,[8]],"SJ",47,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"0\\d{4}|81(?:0(?:0[7-9]|1\\d)|5\\d{2})\\d{3}","\\d{5}(?:\\d{3})?",,,"01234"],1,,[,,"81[23]\\d{5}","\\d{8}",,,"81212345",,,[8]]],SK:[,[,,"(?:[2-68]\\d{5,8}|9\\d{6,8})","\\d{6,9}",
  20464. ,,,,,[6,7,9]],[,,"2(?:16\\d{3,4}|\\d{8})|[3-5](?:[1-8]16\\d{2,3}|\\d{8})","\\d{6,9}",,,"212345678"],[,,"9(?:0(?:[1-8]\\d|9[1-9])|(?:1[0-24-9]|4[04589]|50)\\d)\\d{5}","\\d{9}",,,"912123456",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"9(?:[78]\\d{7}|00\\d{6})","\\d{9}",,,"900123456",,,[9]],[,,"8[5-9]\\d{7}","\\d{9}",,,"850123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"6(?:02|5[0-4]|9[0-6])\\d{6}","\\d{9}",,,"690123456",,,[9]],"SK",421,"00","0",,,"0",,,,[[,"(2)(16)(\\d{3,4})","$1 $2 $3",["216"],
  20465. "0$1"],[,"([3-5]\\d)(16)(\\d{2,3})","$1 $2 $3",["[3-5]"],"0$1"],[,"(2)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],[,"([3-5]\\d)(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"],[,"([689]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],[,"(9090)(\\d{3})","$1 $2",["9090"],"0$1"]],,[,,"9090\\d{3}","\\d{7}",,,"9090123",,,[7]],,,[,,"(?:602|8(?:00|[5-9]\\d)|9(?:00|[78]\\d))\\d{6}|9090\\d{3}","\\d{7,9}",,,"800123456",,,[7,9]],[,,"96\\d{7}","\\d{9}",,,"961234567",,,[9]],,,[,,"NA","NA",
  20466. ,,,,,[-1]]],SL:[,[,,"[2-9]\\d{7}","\\d{6,8}",,,,,,[8],[6]],[,,"[235]2[2-4][2-9]\\d{4}","\\d{6,8}",,,"22221234"],[,,"(?:2[15]|3[03-5]|4[04]|5[05]|66|7[6-9]|88|99)\\d{6}","\\d{6,8}",,,"25123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SL",232,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{6})","$1 $2",,"(0$1)"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SM:[,[,,"[05-7]\\d{7,9}",
  20467. "\\d{6,10}",,,,,,[8,10],[6]],[,,"0549(?:8[0157-9]|9\\d)\\d{4}","\\d{6,10}",,,"0549886377",,,[10]],[,,"6[16]\\d{6}","\\d{8}",,,"66661212",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"7[178]\\d{6}","\\d{8}",,,"71123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"5[158]\\d{6}","\\d{8}",,,"58001110",,,[8]],"SM",378,"00",,,,"(?:0549)?([89]\\d{5})","0549$1",,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],[,"(0549)(\\d{6})","$1 $2",["0"]],[,"(\\d{6})","0549 $1",["[89]"]]],[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})",
  20468. "$1 $2 $3 $4",["[5-7]"]],[,"(0549)(\\d{6})","($1) $2",["0"]],[,"(\\d{6})","(0549) $1",["[89]"]]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],SN:[,[,,"[3789]\\d{8}","\\d{9}",,,,,,[9]],[,,"3(?:0(?:1[0-2]|80)|282|3(?:8[1-9]|9[3-9])|611)\\d{5}","\\d{9}",,,"301012345"],[,,"7(?:[06-8]\\d|21|90)\\d{6}","\\d{9}",,,"701234567"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"88[4689]\\d{6}","\\d{9}",,,"884123456"],[,,"81[02468]\\d{6}","\\d{9}",,,"810123456"],
  20469. [,,"NA","NA",,,,,,[-1]],[,,"39[01]\\d{6}|3392\\d{5}|93330\\d{4}","\\d{9}",,,"933301234"],"SN",221,"00",,,,,,,,[[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SO:[,[,,"[1-79]\\d{6,8}","\\d{7,9}",,,,,,[7,8,9]],[,,"(?:1\\d|2[0-79]|3[0-46-8]|4[0-7]|59)\\d{5}","\\d{7}",,,"4012345",,,[7]],[,,"(?:15\\d|2(?:4\\d|8)|6[1-35-9]?\\d{2}|7(?:[1-8]\\d|99?\\d)|9(?:0[67]|[2-9])\\d)\\d{5}",
  20470. "\\d{7,9}",,,"71123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SO",252,"00","0",,,"0",,,,[[,"(\\d)(\\d{6})","$1 $2",["2[0-79]|[13-5]"]],[,"(\\d)(\\d{7})","$1 $2",["24|[67]"]],[,"(\\d{2})(\\d{5,7})","$1 $2",["15|28|6[1-35-9]|799|9[2-9]"]],[,"(90\\d)(\\d{3})(\\d{3})","$1 $2 $3",["90"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SR:[,[,,"[2-8]\\d{5,6}","\\d{6,7}",
  20471. ,,,,,[6,7]],[,,"(?:2[1-3]|3[0-7]|4\\d|5[2-58]|68\\d)\\d{4}","\\d{6,7}",,,"211234"],[,,"(?:7[124-7]|8[1-9])\\d{5}","\\d{7}",,,"7412345",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"5(?:6\\d{4}|90[0-4]\\d{3})","\\d{6,7}",,,"561234"],"SR",597,"00",,,,,,,,[[,"(\\d{3})(\\d{3})","$1-$2",["[2-4]|5[2-58]"]],[,"(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],[,"(\\d{3})(\\d{4})","$1-$2",["59|[6-8]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],
  20472. [,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SS:[,[,,"[19]\\d{8}","\\d{9}",,,,,,[9]],[,,"18\\d{7}","\\d{9}",,,"181234567"],[,,"(?:12|9[1257])\\d{7}","\\d{9}",,,"977123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SS",211,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],ST:[,[,,"[29]\\d{6}","\\d{7}",
  20473. ,,,,,[7]],[,,"22\\d{5}","\\d{7}",,,"2221234"],[,,"9(?:0(?:0[5-9]|[1-9]\\d)|[89]\\d{2})\\d{3}","\\d{7}",,,"9812345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"ST",239,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SV:[,[,,"[267]\\d{7}|[89]\\d{6}(?:\\d{4})?","\\d{7,8}|\\d{11}",,,,,,[7,8,11]],[,,"2[1-6]\\d{6}","\\d{8}",,,"21234567",
  20474. ,,[8]],[,,"[67]\\d{7}","\\d{8}",,,"70123456",,,[8]],[,,"800\\d{4}(?:\\d{4})?","\\d{7}(?:\\d{4})?",,,"8001234",,,[7,11]],[,,"900\\d{4}(?:\\d{4})?","\\d{7}(?:\\d{4})?",,,"9001234",,,[7,11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SV",503,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[267]"]],[,"(\\d{3})(\\d{4})","$1 $2",["[89]"]],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",
  20475. ,,,,,[-1]]],SX:[,[,,"[5789]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"7215(?:4[2-8]|8[239]|9[056])\\d{4}","\\d{7}(?:\\d{3})?",,,"7215425678"],[,,"7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}","\\d{7}(?:\\d{3})?",,,"7215205678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"SX",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,
  20476. ,,,[-1]],,"721",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SY:[,[,,"[1-59]\\d{7,8}","\\d{6,9}",,,,,,[8,9],[6,7]],[,,"(?:1(?:1\\d?|4\\d|[2356])|2(?:1\\d?|[235])|3(?:[13]\\d|4)|4[13]|5[1-3])\\d{6}","\\d{6,9}",,,"112345678"],[,,"9(?:22|[3-589]\\d|6[024-9])\\d{6}","\\d{9}",,,"944567890",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SY",963,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{3,4})",
  20477. "$1 $2 $3",["[1-5]"],"0$1",,1],[,"(9\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",,1]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SZ:[,[,,"[027]\\d{7}","\\d{8}",,,,,,[8]],[,,"2[2-5]\\d{6}","\\d{8}",,,"22171234"],[,,"7[6-8]\\d{6}","\\d{8}",,,"76123456"],[,,"0800\\d{4}","\\d{8}",,,"08001234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SZ",268,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[027]"]]],
  20478. ,[,,"NA","NA",,,,,,[-1]],,,[,,"0800\\d{4}","\\d{8}",,,"08001234"],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],TA:[,[,,"8\\d{3}","\\d{4}",,,,,,[-1,4]],[,,"8\\d{3}","\\d{4}",,,"8999",,,[4]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TA",290,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TC:[,[,,"[5689]\\d{9}","\\d{7}(?:\\d{3})?",
  20479. ,,,,,[10],[7]],[,,"649(?:712|9(?:4\\d|50))\\d{4}","\\d{7}(?:\\d{3})?",,,"6497121234"],[,,"649(?:2(?:3[129]|4[1-7])|3(?:3[1-389]|4[1-8])|4[34][1-3])\\d{4}","\\d{7}(?:\\d{3})?",,,"6492311234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"64971[01]\\d{4}","\\d{10}",,,"6497101234"],"TC",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"649",[,
  20480. ,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TD:[,[,,"[2679]\\d{7}","\\d{8}",,,,,,[8]],[,,"22(?:[3789]0|5[0-5]|6[89])\\d{4}","\\d{8}",,,"22501234"],[,,"(?:6[023568]\\d|77\\d|9\\d{2})\\d{5}","\\d{8}",,,"63012345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TD",235,"00|16",,,,,,"00",,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA",
  20481. "NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TG:[,[,,"[29]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:2[2-7]|3[23]|44|55|66|77)\\d{5}","\\d{8}",,,"22212345"],[,,"9[0-389]\\d{6}","\\d{8}",,,"90112345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TG",228,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TH:[,[,,"[2-9]\\d{7,8}|1\\d{3}(?:\\d{5,6})?",
  20482. "\\d{4}|\\d{8,10}",,,,,,[4,8,9,10]],[,,"(?:2\\d|3[2-9]|4[2-5]|5[2-6]|7[3-7])\\d{6}","\\d{8}",,,"21234567",,,[8]],[,,"(?:14|6[1-5]|[89]\\d)\\d{7}","\\d{9}",,,"812345678",,,[9]],[,,"1800\\d{6}","\\d{10}",,,"1800123456",,,[10]],[,,"1900\\d{6}","\\d{10}",,,"1900123456",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"6[08]\\d{7}","\\d{9}",,,"601234567",,,[9]],"TH",66,"00","0",,,"0",,,,[[,"(2)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],[,"([13-9]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["14|[3-9]"],
  20483. "0$1"],[,"(1[89]00)(\\d{3})(\\d{3})","$1 $2 $3",["1"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"1\\d{3}","\\d{4}",,,"1100",,,[4]],[,,"1\\d{3}","\\d{4}",,,"1100",,,[4]],,,[,,"NA","NA",,,,,,[-1]]],TJ:[,[,,"[3-589]\\d{8}","\\d{3,9}",,,,,,[9],[3,5,7]],[,,"(?:3(?:1[3-5]|2[245]|3[12]|4[24-7]|5[25]|72)|4(?:46|74|87))\\d{6}","\\d{3,9}",,,"372123456"],[,,"(?:41[18]|5(?:0[125]|5\\d)|88\\d|9[0-35-9]\\d)\\d{6}","\\d{9}",,,"917123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA",
  20484. "NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TJ",992,"810","8",,,"8",,"8~10",,[[,"([349]\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[34]7|91[78]"],"(8) $1",,1],[,"([4589]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[148]|[58]|9(?:1[59]|[0235-9])"],"(8) $1",,1],[,"(331700)(\\d)(\\d{2})","$1 $2 $3",["331","3317","33170","331700"],"(8) $1",,1],[,"(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]","3(?:[1245]|3(?:[02-9]|1[0-589]))"],"(8) $1",,1]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,
  20485. "NA","NA",,,,,,[-1]]],TK:[,[,,"[2-47]\\d{3,6}","\\d{4,7}",,,,,,[4,5,6,7]],[,,"(?:2[2-4]|[34]\\d)\\d{2,5}","\\d{4,7}",,,"3101"],[,,"7[2-4]\\d{2,5}","\\d{4,7}",,,"7290"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TK",690,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TL:[,[,,"[2-489]\\d{6}|7\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"(?:2[1-5]|3[1-9]|4[1-4])\\d{5}",
  20486. "\\d{7}",,,"2112345",,,[7]],[,,"7[3-8]\\d{6}","\\d{8}",,,"77212345",,,[8]],[,,"80\\d{5}","\\d{7}",,,"8012345",,,[7]],[,,"90\\d{5}","\\d{7}",,,"9012345",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"70\\d{5}","\\d{7}",,,"7012345",,,[7]],[,,"NA","NA",,,,,,[-1]],"TL",670,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[2-489]"]],[,"(\\d{4})(\\d{4})","$1 $2",["7"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TM:[,[,,"[1-6]\\d{7}","\\d{8}",,,,,,[8]],[,,"(?:1(?:2\\d|3[1-9])|2(?:22|4[0-35-8])|3(?:22|4[03-9])|4(?:22|3[128]|4\\d|6[15])|5(?:22|5[7-9]|6[014-689]))\\d{5}",
  20487. "\\d{8}",,,"12345678"],[,,"6[1-9]\\d{6}","\\d{8}",,,"66123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TM",993,"810","8",,,"8",,"8~10",,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],[,"(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"],[,"(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["13|[2-5]"],"(8 $1)"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],
  20488. TN:[,[,,"[2-57-9]\\d{7}","\\d{8}",,,,,,[8]],[,,"3(?:[012]\\d|6[0-4]|91)\\d{5}|7\\d{7}|81200\\d{3}","\\d{8}",,,"71234567"],[,,"(?:[259]\\d|4[0-6])\\d{6}","\\d{8}",,,"20123456"],[,,"8010\\d{4}","\\d{8}",,,"80101234"],[,,"88\\d{6}","\\d{8}",,,"88123456"],[,,"8[12]10\\d{4}","\\d{8}",,,"81101234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TN",216,"00",,,,,,,,[[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,
  20489. [-1]]],TO:[,[,,"[02-8]\\d{4,6}","\\d{5,7}",,,,,,[5,7]],[,,"(?:2\\d|3[1-8]|4[1-4]|[56]0|7[0149]|8[05])\\d{3}","\\d{5}",,,"20123",,,[5]],[,,"(?:7[578]|8[47-9])\\d{5}","\\d{7}",,,"7715123",,,[7]],[,,"0800\\d{3}","\\d{7}",,,"0800222",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TO",676,"00",,,,,,,,[[,"(\\d{2})(\\d{3})","$1-$2",["[1-6]|7[0-4]|8[05]"]],[,"(\\d{3})(\\d{4})","$1 $2",["7[5-9]|8[47-9]"]],[,"(\\d{4})(\\d{3})","$1 $2",["0"]]],,[,,"NA",
  20490. "NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],TR:[,[,,"[2-589]\\d{9}|444\\d{4}","\\d{7,10}",,,,,,[7,10]],[,,"(?:2(?:[13][26]|[28][2468]|[45][268]|[67][246])|3(?:[13][28]|[24-6][2468]|[78][02468]|92)|4(?:[16][246]|[23578][2468]|4[26]))\\d{7}","\\d{10}",,,"2123456789",,,[10]],[,,"5(?:(?:0[1-7]|22|[34]\\d|5[1-59]|9[246])\\d{2}|6161)\\d{5}","\\d{10}",,,"5012345678",,,[10]],[,,"800\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,,"900\\d{7}","\\d{10}",,,"9001234567",
  20491. ,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TR",90,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[23]|4(?:[0-35-9]|4[0-35-9])"],"(0$1)",,1],[,"(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[02-69]"],"0$1",,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["51|[89]"],"0$1",,1],[,"(444)(\\d{1})(\\d{3})","$1 $2 $3",["444"]]],,[,,"512\\d{7}","\\d{10}",,,"5123456789",,,[10]],,,[,,"444\\d{4}","\\d{7}",,,"4441444",,,[7]],[,,"444\\d{4}|850\\d{7}",
  20492. "\\d{7,10}",,,"4441444"],,,[,,"NA","NA",,,,,,[-1]]],TT:[,[,,"[589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"868(?:2(?:01|2[1-6]|3[1-5])|6(?:0[79]|1[02-8]|2[1-9]|[3-69]\\d|7[0-79])|82[124])\\d{4}","\\d{7}(?:\\d{3})?",,,"8682211234"],[,,"868(?:2(?:[789]\\d)|3(?:0[1-9]|1[02-9]|[2-9]\\d)|4[6-9]\\d|6(?:20|78|8\\d)|7(?:0[1-9]|1[02-9]|[2-9]\\d))\\d{4}","\\d{7}(?:\\d{3})?",,,"8682911234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,
  20493. ,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"TT",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"868",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"868619\\d{4}","\\d{10}",,,"8686191234"]],TV:[,[,,"[279]\\d{4,6}","\\d{5,7}",,,,,,[5,6,7]],[,,"2[02-9]\\d{3}","\\d{5}",,,"20123",,,[5]],[,,"(?:70\\d|90)\\d{4}","\\d{6,7}",,,"901234",,,[6,7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",
  20494. ,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TV",688,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TW:[,[,,"[2-689]\\d{7,8}|7\\d{7,9}","\\d{8,10}",,,,,,[8,9,10]],[,,"[2-8]\\d{7,8}","\\d{8,9}",,,"21234567",,,[8,9]],[,,"9\\d{8}","\\d{9}",,,"912345678",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"900\\d{6}","\\d{9}",,,"900123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"70\\d{8}","\\d{10}",,,"7012345678",,,[10]],
  20495. "TW",886,"0(?:0[25679]|19)","0","#",,"0",,,,[[,"([2-8])(\\d{3,4})(\\d{4})","$1 $2 $3",["[2-6]|[78][1-9]"],"0$1"],[,"([89]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["80|9"],"0$1"],[,"(70)(\\d{4})(\\d{4})","$1 $2 $3",["70"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TZ:[,[,,"\\d{9}","\\d{7,9}",,,,,,[7,9]],[,,"2[2-8]\\d{7}","\\d{7,9}",,,"222345678"],[,,"(?:6[125-9]|7[1-9])\\d{7}","\\d{9}",,,"621234567",,,[9]],[,,"80[08]\\d{6}","\\d{9}",,,"800123456",
  20496. ,,[9]],[,,"90\\d{7}","\\d{9}",,,"900123456",,,[9]],[,,"8(?:40|6[01])\\d{6}","\\d{9}",,,"840123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"41\\d{7}","\\d{9}",,,"412345678",,,[9]],"TZ",255,"00[056]","0",,,"0",,,,[[,"([24]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],[,"([67]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"],[,"([89]\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],UA:[,[,,"[3-9]\\d{8}",
  20497. "\\d{5,9}",,,,,,[9],[5,6,7]],[,,"(?:3[1-8]|4[13-8]|5[1-7]|6[12459])\\d{7}","\\d{5,9}",,,"311234567"],[,,"(?:39|50|6[36-8]|73|9[1-9])\\d{7}","\\d{9}",,,"391234567"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"900\\d{6}","\\d{9}",,,"900123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"89\\d{7}","\\d{9}",,,"891234567"],"UA",380,"00","0",,,"0",,"0~0",,[[,"([3-9]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[38]9|4(?:[45][0-5]|87)|5(?:0|6[37]|7[37])|6[36-8]|73|9[1-9]","[38]9|4(?:[45][0-5]|87)|5(?:0|6(?:3[14-7]|7)|7[37])|6[36-8]|73|9[1-9]"],
  20498. "0$1"],[,"([3-689]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["3[1-8]2|4[13678]2|5(?:[12457]2|6[24])|6(?:[49]2|[12][29]|5[24])|8[0-8]|90","3(?:[1-46-8]2[013-9]|52)|4(?:[1378]2|62[013-9])|5(?:[12457]2|6[24])|6(?:[49]2|[12][29]|5[24])|8[0-8]|90"],"0$1"],[,"([3-6]\\d{3})(\\d{5})","$1 $2",["3(?:5[013-9]|[1-46-8])|4(?:[137][013-9]|6|[45][6-9]|8[4-6])|5(?:[1245][013-9]|6[0135-9]|3|7[4-6])|6(?:[49][013-9]|5[0135-9]|[12][13-8])","3(?:5[013-9]|[1-46-8](?:22|[013-9]))|4(?:[137][013-9]|6(?:[013-9]|22)|[45][6-9]|8[4-6])|5(?:[1245][013-9]|6(?:3[02389]|[015689])|3|7[4-6])|6(?:[49][013-9]|5[0135-9]|[12][13-8])"],
  20499. "0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],UG:[,[,,"\\d{9}","\\d{5,9}",,,,,,[9],[5,6,7]],[,,"20(?:[0147]\\d{2}|2(?:40|[5-9]\\d)|3(?:0[0-4]|[23]\\d)|5[0-4]\\d|6[035-9]\\d|8[0-2]\\d)\\d{4}|[34]\\d{8}","\\d{5,9}",,,"312345678"],[,,"7(?:(?:0[0-7]|[15789]\\d|30|4[0-4])\\d|2(?:[03]\\d|60))\\d{5}","\\d{9}",,,"712345678"],[,,"800[123]\\d{5}","\\d{9}",,,"800123456"],[,,"90[123]\\d{6}","\\d{9}",,,"901123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA",
  20500. "NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"UG",256,"00[057]","0",,,"0",,,,[[,"(\\d{3})(\\d{6})","$1 $2",["[7-9]|20(?:[013-8]|2[5-9])|4(?:6[45]|[7-9])"],"0$1"],[,"(\\d{2})(\\d{7})","$1 $2",["3|4(?:[1-5]|6[0-36-9])"],"0$1"],[,"(2024)(\\d{5})","$1 $2",["2024"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],US:[,[,,"[2-9]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"(?:2(?:0[1-35-9]|1[02-9]|2[04589]|3[149]|4[08]|5[1-46]|6[0279]|7[026]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[014679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-37]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[16]|5[017]|6[0-279]|78|8[12])|7(?:0[1-46-8]|1[02-9]|2[0457]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|28|3[0-25]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[014678]|4[0179]|5[12469]|7[0-3589]|8[0459]))[2-9]\\d{6}",
  20501. "\\d{7}(?:\\d{3})?",,,"2015550123"],[,,"(?:2(?:0[1-35-9]|1[02-9]|2[04589]|3[149]|4[08]|5[1-46]|6[0279]|7[026]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[014679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-37]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[16]|5[017]|6[0-279]|78|8[12])|7(?:0[1-46-8]|1[02-9]|2[0457]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|28|3[0-25]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[014678]|4[0179]|5[12469]|7[0-3589]|8[0459]))[2-9]\\d{6}",
  20502. "\\d{7}(?:\\d{3})?",,,"2015550123"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"US",1,"011","1",,,"1",,,1,[[,"(\\d{3})(\\d{4})","$1-$2",,,,1],[,"(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",,,,1]],[[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3"]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA",
  20503. "NA",,,,,,[-1]]],UY:[,[,,"[2489]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"2\\d{7}|4[2-7]\\d{6}","\\d{7,8}",,,"21231234",,,[8]],[,,"9[1-9]\\d{6}","\\d{8}",,,"94231234",,,[8]],[,,"80[05]\\d{4}","\\d{7}",,,"8001234",,,[7]],[,,"90[0-8]\\d{4}","\\d{7}",,,"9001234",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"UY",598,"0(?:1[3-9]\\d|0)","0"," int. ",,"0",,"00",,[[,"(\\d{4})(\\d{4})","$1 $2",["[24]"]],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9[1-9]"],"0$1"],[,"(\\d{3})(\\d{4})",
  20504. "$1 $2",["[89]0"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],UZ:[,[,,"[679]\\d{8}","\\d{7,9}",,,,,,[9],[7]],[,,"(?:6(?:1(?:22|3[124]|4[1-4]|5[123578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|6\\d{2}|7(?:[23]\\d|7[69])|9(?:22|4[1-8]|6[135]))|7(?:0(?:5[4-9]|6[0146]|7[12456]|9[135-8])|1[12]\\d|2(?:22|3[1345789]|4[123579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|6(?:22|3[12457]|4[13-8])|9(?:22|5[1-9])))\\d{5}",
  20505. "\\d{7,9}",,,"662345678"],[,,"6(?:1(?:2(?:98|2[01])|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:11\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4])|7\\d{2})|5(?:19[01]|2(?:27|9[26])|30\\d|59\\d|7\\d{2})|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|3[79]\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79])|9[0-3]\\d)|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079]))|9(?:2(?:1[1267]|5\\d|3[01]|7[0-4])|5[67]\\d|6(?:2[0-26]|8\\d)|7\\d{2}))\\d{4}|7(?:0\\d{3}|1(?:13[01]|6(?:0[47]|1[67]|66)|71[3-69]|98\\d)|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|33\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078])|9[4-6]\\d)|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0127]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|6(?:2(?:2[1245]|4[2-4])|39\\d|41[179]|5(?:[349]\\d|5[0-2])|7(?:0[017]|[13]\\d|22|44|55|67|88))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[05629]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07])))\\d{4}|9[0-57-9]\\d{7}",
  20506. "\\d{9}",,,"912345678"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"UZ",998,"810","8",,,"8",,"8~10",,[[,"([679]\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"8 $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],VA:[,[,,"(?:0(?:878\\d{5}|6698\\d{5})|[1589]\\d{5,10}|3(?:[12457-9]\\d{8}|[36]\\d{7,9}))","\\d{6,11}",,,,,,[6,8,9,10,11]],[,,"06698\\d{5}","\\d{10}",,,"0669812345",
  20507. ,,[10]],[,,"3(?:[12457-9]\\d{8}|6\\d{7,8}|3\\d{7,9})","\\d{9,11}",,,"3123456789",,,[9,10,11]],[,,"80(?:0\\d{6}|3\\d{3})","\\d{6,9}",,,"800123456",,,[6,9]],[,,"0878\\d{5}|1(?:44|6[346])\\d{6}|89(?:2\\d{3}|4(?:[0-4]\\d{2}|[5-9]\\d{4})|5(?:[0-4]\\d{2}|[5-9]\\d{6})|9\\d{6})","\\d{6,10}",,,"899123456",,,[6,8,9,10]],[,,"84(?:[08]\\d{6}|[17]\\d{3})","\\d{6,9}",,,"848123456",,,[6,9]],[,,"1(?:78\\d|99)\\d{6}","\\d{9,10}",,,"1781234567",,,[9,10]],[,,"55\\d{8}","\\d{10}",,,"5512345678",,,[10]],"VA",39,"00",
  20508. ,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"848\\d{6}","\\d{9}",,,"848123456",,,[9]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],VC:[,[,,"[5789]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"784(?:266|3(?:6[6-9]|7\\d|8[0-24-6])|4(?:38|5[0-36-8]|8[0-8])|5(?:55|7[0-2]|93)|638|784)\\d{4}","\\d{7}(?:\\d{3})?",,,"7842661234"],[,,"784(?:4(?:3[0-4]|5[45]|89|9[0-58])|5(?:2[6-9]|3[0-4]))\\d{4}","\\d{7}(?:\\d{3})?",,,"7844301234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}",
  20509. "\\d{10}",,,"9002345678"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"VC",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"784",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],VE:[,[,,"[24589]\\d{9}","\\d{7,10}",,,,,,[10],[7]],[,,"(?:2(?:12|3[457-9]|[58][1-9]|[467]\\d|9[1-6])|50[01])\\d{7}","\\d{7,10}",,,"2121234567"],[,,"4(?:1[24-8]|2[46])\\d{7}","\\d{10}",,,"4121234567"],[,,"800\\d{7}","\\d{10}",
  20510. ,,"8001234567"],[,,"900\\d{7}","\\d{10}",,,"9001234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"VE",58,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{7})","$1-$2",,"0$1","$CC $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],VG:[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"284(?:(?:229|4(?:22|9[45])|774|8(?:52|6[459]))\\d{4}|496[0-5]\\d{3})","\\d{7}(?:\\d{3})?",,,"2842291234"],[,,"284(?:(?:3(?:0[0-3]|4[0-367]|94)|4(?:4[0-6]|68|99)|54[0-57])\\d{4}|496[6-9]\\d{3})",
  20511. "\\d{7}(?:\\d{3})?",,,"2843001234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"VG",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"284",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],VI:[,[,,"[3589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"340(?:2(?:01|2[0678]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-589]|27|7\\d)|884|998)\\d{4}",
  20512. "\\d{7}(?:\\d{3})?",,,"3406421234"],[,,"340(?:2(?:01|2[0678]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-589]|27|7\\d)|884|998)\\d{4}","\\d{7}(?:\\d{3})?",,,"3406421234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"VI",1,"011","1",,,"1",,,1,,,[,,"NA","NA",,,,,,[-1]],,"340",[,,"NA","NA",
  20513. ,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],VN:[,[,,"[17]\\d{6,9}|[2-69]\\d{7,9}|8\\d{6,8}","\\d{7,10}",,,,,,[7,8,9,10]],[,,"(?:2(?:[025-79]|1[0189]|[348][01])|3(?:[0136-9]|[25][01])|4\\d|5(?:[01][01]|[2-9])|6(?:[0-46-8]|5[01])|7(?:[02-79]|[18][01]))\\d{7}|8(?:[1-57]\\d|[689][0-79])\\d{6}","\\d{9,10}",,,"2101234567",,,[9,10]],[,,"(?:9\\d|1(?:2\\d|6[2-9]|8[68]|99))\\d{7}|8[689]8\\d{6}","\\d{9,10}",,,"912345678",,,[9,10]],[,,"1800\\d{4,6}","\\d{8,10}",,,"1800123456",,,[8,9,10]],[,
  20514. ,"1900\\d{4,6}","\\d{8,10}",,,"1900123456",,,[8,9,10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"VN",84,"00","0",,,"0",,,,[[,"([17]99)(\\d{4})","$1 $2",["[17]99"],"0$1",,1],[,"([48])(\\d{4})(\\d{4})","$1 $2 $3",["4|8(?:[1-57]|[689][0-79])"],"0$1",,1],[,"([235-7]\\d)(\\d{4})(\\d{3})","$1 $2 $3",["2[025-79]|3[0136-9]|5[2-9]|6[0-46-8]|7[02-79]"],"0$1",,1],[,"(80)(\\d{5})","$1 $2",["80"],"0$1",,1],[,"(69\\d)(\\d{4,5})","$1 $2",["69"],"0$1",,1],[,"([235-7]\\d{2})(\\d{4})(\\d{3})",
  20515. "$1 $2 $3",["2[1348]|3[25]|5[01]|65|7[18]"],"0$1",,1],[,"([89]\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8[689]8|9"],"0$1",,1],[,"(1[2689]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1(?:[26]|8[68]|99)"],"0$1",,1],[,"(1[89]00)(\\d{4,6})","$1 $2",["1[89]0"],"$1",,1]],,[,,"NA","NA",,,,,,[-1]],,,[,,"[17]99\\d{4}|69\\d{5,6}","\\d{7,8}",,,"1992000",,,[7,8]],[,,"[17]99\\d{4}|69\\d{5,6}|80\\d{5}","\\d{7,8}",,,"1992000",,,[7,8]],,,[,,"NA","NA",,,,,,[-1]]],VU:[,[,,"[2-57-9]\\d{4,6}","\\d{5,7}",,,,,,[5,7]],[,,"(?:2[02-9]\\d|3(?:[5-7]\\d|8[0-8])|48[4-9]|88\\d)\\d{2}",
  20516. "\\d{5}",,,"22123",,,[5]],[,,"(?:5(?:7[2-5]|[0-689]\\d)|7[013-7]\\d)\\d{4}","\\d{7}",,,"5912345",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"VU",678,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[579]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"3[03]\\d{3}|900\\d{4}","\\d{5,7}",,,"30123"],,,[,,"NA","NA",,,,,,[-1]]],WF:[,[,,"[4-8]\\d{5}","\\d{6}",,,,,,[6]],[,,"(?:50|68|72)\\d{4}","\\d{6}",,,"501234"],[,
  20517. ,"(?:50|68|72|8[23])\\d{4}","\\d{6}",,,"501234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"WF",681,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"[48]0\\d{4}","\\d{6}",,,"401234"]],WS:[,[,,"[2-8]\\d{4,6}","\\d{5,7}",,,,,,[5,6,7]],[,,"(?:[2-5]\\d|6[1-9]|84\\d{2})\\d{3}","\\d{5,7}",,,"22123",,,[5,7]],[,,"(?:60|7[25-7]\\d)\\d{4}","\\d{6,7}",
  20518. ,,"601234",,,[6,7]],[,,"800\\d{3}","\\d{6}",,,"800123",,,[6]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"WS",685,"0",,,,,,,,[[,"(8\\d{2})(\\d{3,4})","$1 $2",["8"]],[,"(7\\d)(\\d{5})","$1 $2",["7"]],[,"(\\d{5})","$1",["[2-6]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],YE:[,[,,"[1-7]\\d{6,8}","\\d{6,9}",,,,,,[7,8,9],[6]],[,,"(?:1(?:7\\d|[2-68])|2[2-68]|3[2358]|4[2-58]|5[2-6]|6[3-58]|7[24-68])\\d{5}",
  20519. "\\d{6,8}",,,"1234567",,,[7,8]],[,,"7[0137]\\d{7}","\\d{9}",,,"712345678",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"YE",967,"00","0",,,"0",,,,[[,"([1-7])(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7[24-68]"],"0$1"],[,"(7\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["7[0137]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],YT:[,[,,"[268]\\d{8}","\\d{9}",,,,,,[9]],[,
  20520. ,"269(?:6[0-4]|50)\\d{4}","\\d{9}",,,"269601234"],[,,"639\\d{6}","\\d{9}",,,"639123456"],[,,"80\\d{7}","\\d{9}",,,"801234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"YT",262,"00","0",,,"0",,,,,,[,,"NA","NA",,,,,,[-1]],,"269|63",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],ZA:[,[,,"[1-79]\\d{8}|8(?:[067]\\d{7}|[1-4]\\d{3,7})","\\d{5,9}",,,,,,[5,6,7,8,9]],[,,"(?:1[0-8]|2[0-378]|3[1-69]|4\\d|5[1346-8])\\d{7}","\\d{9}",
  20521. ,,"101234567",,,[9]],[,,"(?:6[0-5]|7[0-46-9])\\d{7}|8[1-4]\\d{3,7}","\\d{5,9}",,,"711234567"],[,,"80\\d{7}","\\d{9}",,,"801234567",,,[9]],[,,"86[2-9]\\d{6}|90\\d{7}","\\d{9}",,,"862345678",,,[9]],[,,"860\\d{6}","\\d{9}",,,"860123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"87\\d{7}","\\d{9}",,,"871234567",,,[9]],"ZA",27,"00","0",,,"0",,,,[[,"(860)(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-79]|8(?:[0-47]|6[1-9])"],"0$1"],[,"(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],
  20522. "0$1"],[,"(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"861\\d{6}","\\d{9}",,,"861123456",,,[9]],,,[,,"NA","NA",,,,,,[-1]]],ZM:[,[,,"[289]\\d{8}","\\d{9}",,,,,,[9]],[,,"21[1-8]\\d{6}","\\d{9}",,,"211234567"],[,,"9(?:5[034589]|[67]\\d)\\d{6}","\\d{9}",,,"955123456"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"ZM",260,"00","0",,,"0",,,,[[,"([29]\\d)(\\d{7})",
  20523. "$1 $2",["[29]"],"0$1"],[,"(800)(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],ZW:[,[,,"2(?:[012457-9]\\d{3,8}|6(?:[14]\\d{7}|\\d{4}))|[13-79]\\d{4,9}|8[06]\\d{8}","\\d{3,10}",,,,,,[5,6,7,8,9,10],[3,4]],[,,"(?:2(?:0(?:4\\d|5\\d{2})|2[278]\\d|48\\d|7(?:[1-7]\\d|[089]\\d{2})|8(?:[2-57-9]|[146]\\d{2})|98)|3(?:08|17|3[78]|7(?:[19]|[56]\\d)|8[37]|98)|5[15][78]|6(?:28\\d{2}|[36]7|75\\d|[69]8|8(?:7\\d|8)))\\d{3}|(?:2(?:1[39]|2[0157]|6[14]|7[35]|84)|329)\\d{7}|(?:1(?:3\\d{2}|9\\d|[4-8])|2(?:0\\d{2}|[569]\\d)|3(?:[26]|[013459]\\d)|5(?:0|5\\d{2}|[689]\\d)|6(?:[39]|[01246]\\d|[78]\\d{2}))\\d{3}|(?:29\\d|39|54)\\d{6}|(?:(?:25|54)83|2582\\d)\\d{3}|(?:4\\d{6,7}|9[2-9]\\d{4,5})",
  20524. "\\d{3,10}",,,"1312345"],[,,"7[1378]\\d{7}","\\d{9}",,,"711234567"],[,,"800\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"86(?:1[12]|30|44|55|77|8[367]|99)\\d{6}","\\d{10}",,,"8686123456",,,[10]],"ZW",263,"00","0",,,"0",,,,[[,"([49])(\\d{3})(\\d{2,4})","$1 $2 $3",["4|9[2-9]"],"0$1"],[,"(7\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["7"],"0$1"],[,"(86\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["86[24]"],"0$1"],[,"([2356]\\d{2})(\\d{3,5})","$1 $2",
  20525. ["2(?:0[45]|2[278]|[49]8|[78])|3(?:08|17|3[78]|7[1569]|8[37]|98)|5[15][78]|6(?:[29]8|[38]7|6[78]|75|[89]8)"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|6[14]|7[35]|84)|329"],"0$1"],[,"([1-356]\\d)(\\d{3,5})","$1 $2",["1[3-9]|2[0569]|3[0-69]|5[05689]|6[0-46-9]"],"0$1"],[,"([235]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[23]9|54"],"0$1"],[,"([25]\\d{3})(\\d{3,5})","$1 $2",["(?:25|54)8","258[23]|5483"],"0$1"],[,"(8\\d{3})(\\d{6})","$1 $2",["86"],"0$1"],[,"(80\\d)(\\d{3})(\\d{4})",
  20526. "$1 $2 $3",["80"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],800:[,[,,"\\d{8}","\\d{8}",,,"12345678",,,[-1,8]],[,,"NA","NA",,,"12345678",,,[-1]],[,,"NA","NA",,,"12345678",,,[-1]],[,,"\\d{8}","\\d{8}",,,"12345678",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"001",800,,,,,,,,1,[[,"(\\d{4})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,
  20527. ,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],808:[,[,,"\\d{8}","\\d{8}",,,"12345678",,,[-1,8]],[,,"NA","NA",,,"12345678",,,[-1]],[,,"NA","NA",,,"12345678",,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"\\d{8}","\\d{8}",,,"12345678",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"001",808,,,,,,,,1,[[,"(\\d{4})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],870:[,[,,"[35-7]\\d{8}","\\d{9}",,,"301234567",,,[-1,9]],
  20528. [,,"NA","NA",,,"301234567",,,[-1]],[,,"(?:[356]\\d|7[6-8])\\d{7}","\\d{9}",,,"301234567",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"001",870,,,,,,,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],878:[,[,,"1\\d{11}","\\d{12}",,,"101234567890",,,[-1,12]],[,,"NA","NA",,,"101234567890",,,[-1]],[,,"NA","NA",,,"101234567890",
  20529. ,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"10\\d{10}","\\d{12}",,,"101234567890",,,[12]],"001",878,,,,,,,,1,[[,"(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],881:[,[,,"[67]\\d{8}","\\d{9}",,,"612345678",,,[-1,9]],[,,"NA","NA",,,"612345678",,,[-1]],[,,"[67]\\d{8}","\\d{9}",,,"612345678",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],
  20530. [,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"001",881,,,,,,,,,[[,"(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[67]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],882:[,[,,"[13]\\d{6,11}","\\d{7,12}",,,"3451234567",,,[-1,7,8,9,10,11,12]],[,,"NA","NA",,,"3451234567",,,[-1]],[,,"3(?:2\\d{3}|37\\d{2}|4(?:2|7\\d{3}))\\d{4}","\\d{7,10}",,,"3451234567",,,[7,9,10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,
  20531. ,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15678]|9[0689])\\d{4}|6\\d{5,10})|3(?:45|9\\d{3})\\d{7}","\\d{7,12}",,,"390123456789",,,[7,8,9,10,11,12]],"001",882,,,,,,,,,[[,"(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],[,"(\\d{2})(\\d{5})","$1 $2",["16|342"]],[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["34[57]"]],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["348"]],[,"(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1"]],[,"(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",
  20532. ["16"]],[,"(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["16|39"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"348[57]\\d{7}","\\d{11}",,,"3451234567",,,[11]]],883:[,[,,"51\\d{7}(?:\\d{3})?","\\d{9}(?:\\d{3})?",,,"510012345",,,[-1,9,12]],[,,"NA","NA",,,"510012345",,,[-1]],[,,"NA","NA",,,"510012345",,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"51(?:00\\d{5}(?:\\d{3})?|[13]0\\d{8})","\\d{9}(?:\\d{3})?",,,
  20533. "510012345",,,[9,12]],"001",883,,,,,,,,1,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],[,"(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["510"]],[,"(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],888:[,[,,"\\d{11}","\\d{11}",,,"12345678901",,,[-1,11]],[,,"NA","NA",,,"12345678901",,,[-1]],[,,"NA","NA",,,"12345678901",,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,
  20534. ,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"001",888,,,,,,,,1,[[,"(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"\\d{11}","\\d{11}",,,"12345678901",,,[11]],1,,[,,"NA","NA",,,,,,[-1]]],979:[,[,,"\\d{9}","\\d{9}",,,"123456789",,,[-1,9]],[,,"NA","NA",,,"123456789",,,[-1]],[,,"NA","NA",,,"123456789",,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"\\d{9}","\\d{9}",,,"123456789",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],
  20535. "001",979,,,,,,,,1,[[,"(\\d)(\\d{4})(\\d{4})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]]};/*
  20536. Copyright (C) 2010 The Libphonenumber Authors.
  20537. Licensed under the Apache License, Version 2.0 (the "License");
  20538. you may not use this file except in compliance with the License.
  20539. You may obtain a copy of the License at
  20540. http://www.apache.org/licenses/LICENSE-2.0
  20541. Unless required by applicable law or agreed to in writing, software
  20542. distributed under the License is distributed on an "AS IS" BASIS,
  20543. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  20544. See the License for the specific language governing permissions and
  20545. limitations under the License.
  20546. */
  20547. i18n.phonenumbers.PhoneNumberUtil=function(){this.regionToMetadataMap={}};goog.addSingletonGetter(i18n.phonenumbers.PhoneNumberUtil);i18n.phonenumbers.Error={INVALID_COUNTRY_CODE:"Invalid country calling code",NOT_A_NUMBER:"The string supplied did not seem to be a phone number",TOO_SHORT_AFTER_IDD:"Phone number too short after IDD",TOO_SHORT_NSN:"The string supplied is too short to be a phone number",TOO_LONG:"The string supplied is too long to be a phone number"};
  20548. i18n.phonenumbers.PhoneNumberUtil.NANPA_COUNTRY_CODE_=1;i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_FOR_NSN_=2;i18n.phonenumbers.PhoneNumberUtil.MAX_LENGTH_FOR_NSN_=17;i18n.phonenumbers.PhoneNumberUtil.MAX_LENGTH_COUNTRY_CODE_=3;i18n.phonenumbers.PhoneNumberUtil.MAX_INPUT_STRING_LENGTH_=250;i18n.phonenumbers.PhoneNumberUtil.UNKNOWN_REGION_="ZZ";i18n.phonenumbers.PhoneNumberUtil.COLOMBIA_MOBILE_TO_FIXED_LINE_PREFIX_="3";i18n.phonenumbers.PhoneNumberUtil.MOBILE_TOKEN_MAPPINGS_={52:"1",54:"9"};
  20549. i18n.phonenumbers.PhoneNumberUtil.GEO_MOBILE_COUNTRIES_=[52,54,55];i18n.phonenumbers.PhoneNumberUtil.PLUS_SIGN="+";i18n.phonenumbers.PhoneNumberUtil.STAR_SIGN_="*";i18n.phonenumbers.PhoneNumberUtil.RFC3966_EXTN_PREFIX_=";ext=";i18n.phonenumbers.PhoneNumberUtil.RFC3966_PREFIX_="tel:";i18n.phonenumbers.PhoneNumberUtil.RFC3966_PHONE_CONTEXT_=";phone-context=";i18n.phonenumbers.PhoneNumberUtil.RFC3966_ISDN_SUBADDRESS_=";isub=";
  20550. i18n.phonenumbers.PhoneNumberUtil.DIGIT_MAPPINGS={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","\uff10":"0","\uff11":"1","\uff12":"2","\uff13":"3","\uff14":"4","\uff15":"5","\uff16":"6","\uff17":"7","\uff18":"8","\uff19":"9","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u06f0":"0","\u06f1":"1","\u06f2":"2","\u06f3":"3","\u06f4":"4","\u06f5":"5","\u06f6":"6","\u06f7":"7","\u06f8":"8","\u06f9":"9"};
  20551. i18n.phonenumbers.PhoneNumberUtil.DIALLABLE_CHAR_MAPPINGS_={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","+":i18n.phonenumbers.PhoneNumberUtil.PLUS_SIGN,"*":"*"};i18n.phonenumbers.PhoneNumberUtil.ALPHA_MAPPINGS_={A:"2",B:"2",C:"2",D:"3",E:"3",F:"3",G:"4",H:"4",I:"4",J:"5",K:"5",L:"5",M:"6",N:"6",O:"6",P:"7",Q:"7",R:"7",S:"7",T:"8",U:"8",V:"8",W:"9",X:"9",Y:"9",Z:"9"};
  20552. i18n.phonenumbers.PhoneNumberUtil.ALL_NORMALIZATION_MAPPINGS_={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","\uff10":"0","\uff11":"1","\uff12":"2","\uff13":"3","\uff14":"4","\uff15":"5","\uff16":"6","\uff17":"7","\uff18":"8","\uff19":"9","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u06f0":"0","\u06f1":"1","\u06f2":"2","\u06f3":"3","\u06f4":"4","\u06f5":"5","\u06f6":"6","\u06f7":"7","\u06f8":"8","\u06f9":"9",
  20553. A:"2",B:"2",C:"2",D:"3",E:"3",F:"3",G:"4",H:"4",I:"4",J:"5",K:"5",L:"5",M:"6",N:"6",O:"6",P:"7",Q:"7",R:"7",S:"7",T:"8",U:"8",V:"8",W:"9",X:"9",Y:"9",Z:"9"};
  20554. i18n.phonenumbers.PhoneNumberUtil.ALL_PLUS_NUMBER_GROUPING_SYMBOLS_={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",A:"A",B:"B",C:"C",D:"D",E:"E",F:"F",G:"G",H:"H",I:"I",J:"J",K:"K",L:"L",M:"M",N:"N",O:"O",P:"P",Q:"Q",R:"R",S:"S",T:"T",U:"U",V:"V",W:"W",X:"X",Y:"Y",Z:"Z",a:"A",b:"B",c:"C",d:"D",e:"E",f:"F",g:"G",h:"H",i:"I",j:"J",k:"K",l:"L",m:"M",n:"N",o:"O",p:"P",q:"Q",r:"R",s:"S",t:"T",u:"U",v:"V",w:"W",x:"X",y:"Y",z:"Z","-":"-","\uff0d":"-","\u2010":"-","\u2011":"-","\u2012":"-",
  20555. "\u2013":"-","\u2014":"-","\u2015":"-","\u2212":"-","/":"/","\uff0f":"/"," ":" ","\u3000":" ","\u2060":" ",".":".","\uff0e":"."};i18n.phonenumbers.PhoneNumberUtil.UNIQUE_INTERNATIONAL_PREFIX_=/[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?/;i18n.phonenumbers.PhoneNumberUtil.VALID_PUNCTUATION="-x\u2010-\u2015\u2212\u30fc\uff0d-\uff0f \u00a0\u00ad\u200b\u2060\u3000()\uff08\uff09\uff3b\uff3d.\\[\\]/~\u2053\u223c\uff5e";i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_="0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9";
  20556. i18n.phonenumbers.PhoneNumberUtil.VALID_ALPHA_="A-Za-z";i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_="+\uff0b";i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_PATTERN=new RegExp("["+i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_+"]+");i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN_=new RegExp("^["+i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_+"]+");i18n.phonenumbers.PhoneNumberUtil.SEPARATOR_PATTERN_="["+i18n.phonenumbers.PhoneNumberUtil.VALID_PUNCTUATION+"]+";
  20557. i18n.phonenumbers.PhoneNumberUtil.CAPTURING_DIGIT_PATTERN=new RegExp("(["+i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_+"])");i18n.phonenumbers.PhoneNumberUtil.VALID_START_CHAR_PATTERN_=new RegExp("["+i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_+i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_+"]");i18n.phonenumbers.PhoneNumberUtil.SECOND_NUMBER_START_PATTERN_=/[\\\/] *x/;
  20558. i18n.phonenumbers.PhoneNumberUtil.UNWANTED_END_CHAR_PATTERN_=new RegExp("[^"+i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_+i18n.phonenumbers.PhoneNumberUtil.VALID_ALPHA_+"#]+$");i18n.phonenumbers.PhoneNumberUtil.VALID_ALPHA_PHONE_PATTERN_=/(?:.*?[A-Za-z]){3}.*/;i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_PHONE_NUMBER_PATTERN_="["+i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_+"]{"+i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_FOR_NSN_+"}";
  20559. i18n.phonenumbers.PhoneNumberUtil.VALID_PHONE_NUMBER_="["+i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_+"]*(?:["+i18n.phonenumbers.PhoneNumberUtil.VALID_PUNCTUATION+i18n.phonenumbers.PhoneNumberUtil.STAR_SIGN_+"]*["+i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_+"]){3,}["+i18n.phonenumbers.PhoneNumberUtil.VALID_PUNCTUATION+i18n.phonenumbers.PhoneNumberUtil.STAR_SIGN_+i18n.phonenumbers.PhoneNumberUtil.VALID_ALPHA_+i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_+"]*";
  20560. i18n.phonenumbers.PhoneNumberUtil.DEFAULT_EXTN_PREFIX_=" ext. ";i18n.phonenumbers.PhoneNumberUtil.CAPTURING_EXTN_DIGITS_="(["+i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_+"]{1,7})";
  20561. i18n.phonenumbers.PhoneNumberUtil.EXTN_PATTERNS_FOR_PARSING_=i18n.phonenumbers.PhoneNumberUtil.RFC3966_EXTN_PREFIX_+i18n.phonenumbers.PhoneNumberUtil.CAPTURING_EXTN_DIGITS_+"|[ \u00a0\\t,]*(?:e?xt(?:ensi(?:o\u0301?|\u00f3))?n?|\uff45?\uff58\uff54\uff4e?|[,x\uff58#\uff03~\uff5e]|int|anexo|\uff49\uff4e\uff54)[:\\.\uff0e]?[ \u00a0\\t,-]*"+i18n.phonenumbers.PhoneNumberUtil.CAPTURING_EXTN_DIGITS_+"#?|[- ]+(["+i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_+"]{1,5})#";
  20562. i18n.phonenumbers.PhoneNumberUtil.EXTN_PATTERN_=new RegExp("(?:"+i18n.phonenumbers.PhoneNumberUtil.EXTN_PATTERNS_FOR_PARSING_+")$","i");i18n.phonenumbers.PhoneNumberUtil.VALID_PHONE_NUMBER_PATTERN_=new RegExp("^"+i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_PHONE_NUMBER_PATTERN_+"$|^"+i18n.phonenumbers.PhoneNumberUtil.VALID_PHONE_NUMBER_+"(?:"+i18n.phonenumbers.PhoneNumberUtil.EXTN_PATTERNS_FOR_PARSING_+")?$","i");i18n.phonenumbers.PhoneNumberUtil.NON_DIGITS_PATTERN_=/\D+/;
  20563. i18n.phonenumbers.PhoneNumberUtil.FIRST_GROUP_PATTERN_=/(\$\d)/;i18n.phonenumbers.PhoneNumberUtil.NP_PATTERN_=/\$NP/;i18n.phonenumbers.PhoneNumberUtil.FG_PATTERN_=/\$FG/;i18n.phonenumbers.PhoneNumberUtil.CC_PATTERN_=/\$CC/;i18n.phonenumbers.PhoneNumberUtil.FIRST_GROUP_ONLY_PREFIX_PATTERN_=/^\(?\$1\)?$/;i18n.phonenumbers.PhoneNumberUtil.REGION_CODE_FOR_NON_GEO_ENTITY="001";i18n.phonenumbers.PhoneNumberFormat={E164:0,INTERNATIONAL:1,NATIONAL:2,RFC3966:3};
  20564. i18n.phonenumbers.PhoneNumberType={FIXED_LINE:0,MOBILE:1,FIXED_LINE_OR_MOBILE:2,TOLL_FREE:3,PREMIUM_RATE:4,SHARED_COST:5,VOIP:6,PERSONAL_NUMBER:7,PAGER:8,UAN:9,VOICEMAIL:10,UNKNOWN:-1};i18n.phonenumbers.PhoneNumberUtil.MatchType={NOT_A_NUMBER:0,NO_MATCH:1,SHORT_NSN_MATCH:2,NSN_MATCH:3,EXACT_MATCH:4};i18n.phonenumbers.PhoneNumberUtil.ValidationResult={IS_POSSIBLE:0,INVALID_COUNTRY_CODE:1,TOO_SHORT:2,TOO_LONG:3};
  20565. i18n.phonenumbers.PhoneNumberUtil.extractPossibleNumber=function(a){var b=a.search(i18n.phonenumbers.PhoneNumberUtil.VALID_START_CHAR_PATTERN_);0<=b?(a=a.substring(b),a=a.replace(i18n.phonenumbers.PhoneNumberUtil.UNWANTED_END_CHAR_PATTERN_,""),b=a.search(i18n.phonenumbers.PhoneNumberUtil.SECOND_NUMBER_START_PATTERN_),0<=b&&(a=a.substring(0,b))):a="";return a};
  20566. i18n.phonenumbers.PhoneNumberUtil.isViablePhoneNumber=function(a){return a.length<i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_FOR_NSN_?!1:i18n.phonenumbers.PhoneNumberUtil.matchesEntirely_(i18n.phonenumbers.PhoneNumberUtil.VALID_PHONE_NUMBER_PATTERN_,a)};
  20567. i18n.phonenumbers.PhoneNumberUtil.normalize=function(a){return i18n.phonenumbers.PhoneNumberUtil.matchesEntirely_(i18n.phonenumbers.PhoneNumberUtil.VALID_ALPHA_PHONE_PATTERN_,a)?i18n.phonenumbers.PhoneNumberUtil.normalizeHelper_(a,i18n.phonenumbers.PhoneNumberUtil.ALL_NORMALIZATION_MAPPINGS_,!0):i18n.phonenumbers.PhoneNumberUtil.normalizeDigitsOnly(a)};i18n.phonenumbers.PhoneNumberUtil.normalizeSB_=function(a){var b=i18n.phonenumbers.PhoneNumberUtil.normalize(a.toString());a.clear();a.append(b)};
  20568. i18n.phonenumbers.PhoneNumberUtil.normalizeDigitsOnly=function(a){return i18n.phonenumbers.PhoneNumberUtil.normalizeHelper_(a,i18n.phonenumbers.PhoneNumberUtil.DIGIT_MAPPINGS,!0)};i18n.phonenumbers.PhoneNumberUtil.convertAlphaCharactersInNumber=function(a){return i18n.phonenumbers.PhoneNumberUtil.normalizeHelper_(a,i18n.phonenumbers.PhoneNumberUtil.ALL_NORMALIZATION_MAPPINGS_,!1)};
  20569. i18n.phonenumbers.PhoneNumberUtil.prototype.getLengthOfGeographicalAreaCode=function(a){var b=this.getMetadataForRegion(this.getRegionCodeForNumber(a));return null!=b&&(b.hasNationalPrefix()||a.hasItalianLeadingZero())&&this.isNumberGeographical(a)?this.getLengthOfNationalDestinationCode(a):0};
  20570. i18n.phonenumbers.PhoneNumberUtil.prototype.getLengthOfNationalDestinationCode=function(a){var b;a.hasExtension()?(b=a.clone(),b.clearExtension()):b=a;b=this.format(b,i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL).split(i18n.phonenumbers.PhoneNumberUtil.NON_DIGITS_PATTERN_);0==b[0].length&&b.shift();return 2>=b.length?0:this.getNumberType(a)==i18n.phonenumbers.PhoneNumberType.MOBILE&&(a=i18n.phonenumbers.PhoneNumberUtil.getCountryMobileToken(a.getCountryCodeOrDefault()),""!=a)?b[2].length+a.length:
  20571. b[1].length};i18n.phonenumbers.PhoneNumberUtil.getCountryMobileToken=function(a){return i18n.phonenumbers.PhoneNumberUtil.MOBILE_TOKEN_MAPPINGS_[a]||""};i18n.phonenumbers.PhoneNumberUtil.prototype.getSupportedRegions=function(){return goog.array.filter(Object.keys(i18n.phonenumbers.metadata.countryToMetadata),function(a){return isNaN(a)})};
  20572. i18n.phonenumbers.PhoneNumberUtil.prototype.getSupportedGlobalNetworkCallingCodes=function(){var a=goog.array.filter(Object.keys(i18n.phonenumbers.metadata.countryToMetadata),function(a){return!isNaN(a)});return goog.array.map(a,function(a){return parseInt(a,10)})};i18n.phonenumbers.PhoneNumberUtil.normalizeHelper_=function(a,b,c){for(var d=new goog.string.StringBuffer,e,f,g=a.length,h=0;h<g;++h)e=a.charAt(h),f=b[e.toUpperCase()],null!=f?d.append(f):c||d.append(e);return d.toString()};
  20573. i18n.phonenumbers.PhoneNumberUtil.prototype.formattingRuleHasFirstGroupOnly=function(a){return 0==a.length||i18n.phonenumbers.PhoneNumberUtil.FIRST_GROUP_ONLY_PREFIX_PATTERN_.test(a)};
  20574. i18n.phonenumbers.PhoneNumberUtil.prototype.isNumberGeographical=function(a){var b=this.getNumberType(a);return b==i18n.phonenumbers.PhoneNumberType.FIXED_LINE||b==i18n.phonenumbers.PhoneNumberType.FIXED_LINE_OR_MOBILE||goog.array.contains(i18n.phonenumbers.PhoneNumberUtil.GEO_MOBILE_COUNTRIES_,a.getCountryCodeOrDefault())&&b==i18n.phonenumbers.PhoneNumberType.MOBILE};i18n.phonenumbers.PhoneNumberUtil.prototype.isValidRegionCode_=function(a){return null!=a&&isNaN(a)&&a.toUpperCase()in i18n.phonenumbers.metadata.countryToMetadata};
  20575. i18n.phonenumbers.PhoneNumberUtil.prototype.hasValidCountryCallingCode_=function(a){return a in i18n.phonenumbers.metadata.countryCodeToRegionCodeMap};
  20576. i18n.phonenumbers.PhoneNumberUtil.prototype.format=function(a,b){if(0==a.getNationalNumber()&&a.hasRawInput()){var c=a.getRawInputOrDefault();if(0<c.length)return c}var c=a.getCountryCodeOrDefault(),d=this.getNationalSignificantNumber(a);if(b==i18n.phonenumbers.PhoneNumberFormat.E164)return this.prefixNumberWithCountryCallingCode_(c,i18n.phonenumbers.PhoneNumberFormat.E164,d,"");if(!this.hasValidCountryCallingCode_(c))return d;var e=this.getRegionCodeForCountryCode(c),f=this.getMetadataForRegionOrCallingCode_(c,
  20577. e),e=this.maybeGetFormattedExtension_(a,f,b),d=this.formatNsn_(d,f,b);return this.prefixNumberWithCountryCallingCode_(c,b,d,e)};
  20578. i18n.phonenumbers.PhoneNumberUtil.prototype.formatByPattern=function(a,b,c){var d=a.getCountryCodeOrDefault(),e=this.getNationalSignificantNumber(a);if(!this.hasValidCountryCallingCode_(d))return e;var f=this.getRegionCodeForCountryCode(d),f=this.getMetadataForRegionOrCallingCode_(d,f),g=this.chooseFormattingPatternForNumber_(c,e);if(null!=g){c=g.clone();g=g.getNationalPrefixFormattingRuleOrDefault();if(0<g.length){var h=f.getNationalPrefixOrDefault();0<h.length?(g=g.replace(i18n.phonenumbers.PhoneNumberUtil.NP_PATTERN_,
  20579. h).replace(i18n.phonenumbers.PhoneNumberUtil.FG_PATTERN_,"$1"),c.setNationalPrefixFormattingRule(g)):c.clearNationalPrefixFormattingRule()}e=this.formatNsnUsingPattern_(e,c,b)}a=this.maybeGetFormattedExtension_(a,f,b);return this.prefixNumberWithCountryCallingCode_(d,b,e,a)};
  20580. i18n.phonenumbers.PhoneNumberUtil.prototype.formatNationalNumberWithCarrierCode=function(a,b){var c=a.getCountryCodeOrDefault(),d=this.getNationalSignificantNumber(a);if(!this.hasValidCountryCallingCode_(c))return d;var e=this.getRegionCodeForCountryCode(c),f=this.getMetadataForRegionOrCallingCode_(c,e),e=this.maybeGetFormattedExtension_(a,f,i18n.phonenumbers.PhoneNumberFormat.NATIONAL),d=this.formatNsn_(d,f,i18n.phonenumbers.PhoneNumberFormat.NATIONAL,b);return this.prefixNumberWithCountryCallingCode_(c,
  20581. i18n.phonenumbers.PhoneNumberFormat.NATIONAL,d,e)};i18n.phonenumbers.PhoneNumberUtil.prototype.getMetadataForRegionOrCallingCode_=function(a,b){return i18n.phonenumbers.PhoneNumberUtil.REGION_CODE_FOR_NON_GEO_ENTITY==b?this.getMetadataForNonGeographicalRegion(a):this.getMetadataForRegion(b)};
  20582. i18n.phonenumbers.PhoneNumberUtil.prototype.formatNationalNumberWithPreferredCarrierCode=function(a,b){return this.formatNationalNumberWithCarrierCode(a,0<a.getPreferredDomesticCarrierCodeOrDefault().length?a.getPreferredDomesticCarrierCodeOrDefault():b)};
  20583. i18n.phonenumbers.PhoneNumberUtil.prototype.formatNumberForMobileDialing=function(a,b,c){var d=a.getCountryCodeOrDefault();if(!this.hasValidCountryCallingCode_(d))return a.hasRawInput()?a.getRawInputOrDefault():"";var e="";a=a.clone();a.clearExtension();var f=this.getRegionCodeForCountryCode(d),g=this.getNumberType(a),h=g!=i18n.phonenumbers.PhoneNumberType.UNKNOWN;if(b==f)e=g==i18n.phonenumbers.PhoneNumberType.FIXED_LINE||g==i18n.phonenumbers.PhoneNumberType.MOBILE||g==i18n.phonenumbers.PhoneNumberType.FIXED_LINE_OR_MOBILE,
  20584. "CO"==f&&g==i18n.phonenumbers.PhoneNumberType.FIXED_LINE?e=this.formatNationalNumberWithCarrierCode(a,i18n.phonenumbers.PhoneNumberUtil.COLOMBIA_MOBILE_TO_FIXED_LINE_PREFIX_):"BR"==f&&e?e=0<a.getPreferredDomesticCarrierCodeOrDefault().length?this.formatNationalNumberWithPreferredCarrierCode(a,""):"":h&&"HU"==f?e=this.getNddPrefixForRegion(f,!0)+" "+this.format(a,i18n.phonenumbers.PhoneNumberFormat.NATIONAL):d==i18n.phonenumbers.PhoneNumberUtil.NANPA_COUNTRY_CODE_?(b=this.getMetadataForRegion(b),e=
  20585. this.canBeInternationallyDialled(a)&&this.testNumberLength_(this.getNationalSignificantNumber(a),b.getGeneralDesc())!=i18n.phonenumbers.PhoneNumberUtil.ValidationResult.TOO_SHORT?this.format(a,i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL):this.format(a,i18n.phonenumbers.PhoneNumberFormat.NATIONAL)):e=(f==i18n.phonenumbers.PhoneNumberUtil.REGION_CODE_FOR_NON_GEO_ENTITY||("MX"==f||"CL"==f)&&e)&&this.canBeInternationallyDialled(a)?this.format(a,i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL):
  20586. this.format(a,i18n.phonenumbers.PhoneNumberFormat.NATIONAL);else if(h&&this.canBeInternationallyDialled(a))return c?this.format(a,i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL):this.format(a,i18n.phonenumbers.PhoneNumberFormat.E164);return c?e:i18n.phonenumbers.PhoneNumberUtil.normalizeHelper_(e,i18n.phonenumbers.PhoneNumberUtil.DIALLABLE_CHAR_MAPPINGS_,!0)};
  20587. i18n.phonenumbers.PhoneNumberUtil.prototype.formatOutOfCountryCallingNumber=function(a,b){if(!this.isValidRegionCode_(b))return this.format(a,i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);var c=a.getCountryCodeOrDefault(),d=this.getNationalSignificantNumber(a);if(!this.hasValidCountryCallingCode_(c))return d;if(c==i18n.phonenumbers.PhoneNumberUtil.NANPA_COUNTRY_CODE_){if(this.isNANPACountry(b))return c+" "+this.format(a,i18n.phonenumbers.PhoneNumberFormat.NATIONAL)}else if(c==this.getCountryCodeForValidRegion_(b))return this.format(a,
  20588. i18n.phonenumbers.PhoneNumberFormat.NATIONAL);var e=this.getMetadataForRegion(b),f=e.getInternationalPrefixOrDefault(),g="";i18n.phonenumbers.PhoneNumberUtil.matchesEntirely_(i18n.phonenumbers.PhoneNumberUtil.UNIQUE_INTERNATIONAL_PREFIX_,f)?g=f:e.hasPreferredInternationalPrefix()&&(g=e.getPreferredInternationalPrefixOrDefault());e=this.getRegionCodeForCountryCode(c);e=this.getMetadataForRegionOrCallingCode_(c,e);d=this.formatNsn_(d,e,i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);e=this.maybeGetFormattedExtension_(a,
  20589. e,i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);return 0<g.length?g+" "+c+" "+d+e:this.prefixNumberWithCountryCallingCode_(c,i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL,d,e)};
  20590. i18n.phonenumbers.PhoneNumberUtil.prototype.formatInOriginalFormat=function(a,b){if(a.hasRawInput()&&(this.hasUnexpectedItalianLeadingZero_(a)||!this.hasFormattingPatternForNumber_(a)))return a.getRawInputOrDefault();if(!a.hasCountryCodeSource())return this.format(a,i18n.phonenumbers.PhoneNumberFormat.NATIONAL);var c;switch(a.getCountryCodeSource()){case i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN:c=this.format(a,i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);break;
  20591. case i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_NUMBER_WITH_IDD:c=this.formatOutOfCountryCallingNumber(a,b);break;case i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_NUMBER_WITHOUT_PLUS_SIGN:c=this.format(a,i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL).substring(1);break;default:var d=this.getRegionCodeForCountryCode(a.getCountryCodeOrDefault()),e=this.getNddPrefixForRegion(d,!0);c=this.format(a,i18n.phonenumbers.PhoneNumberFormat.NATIONAL);if(null!=e&&0!=e.length&&!this.rawInputContainsNationalPrefix_(a.getRawInputOrDefault(),
  20592. e,d)&&(d=this.getMetadataForRegion(d),e=this.getNationalSignificantNumber(a),d=this.chooseFormattingPatternForNumber_(d.numberFormatArray(),e),null!=d)){var e=d.getNationalPrefixFormattingRuleOrDefault(),f=e.indexOf("$1");0>=f||(e=e.substring(0,f),e=i18n.phonenumbers.PhoneNumberUtil.normalizeDigitsOnly(e),0!=e.length&&(c=d.clone(),c.clearNationalPrefixFormattingRule(),c=this.formatByPattern(a,i18n.phonenumbers.PhoneNumberFormat.NATIONAL,[c])))}}d=a.getRawInputOrDefault();null!=c&&0<d.length&&(e=i18n.phonenumbers.PhoneNumberUtil.normalizeHelper_(c,
  20593. i18n.phonenumbers.PhoneNumberUtil.DIALLABLE_CHAR_MAPPINGS_,!0),f=i18n.phonenumbers.PhoneNumberUtil.normalizeHelper_(d,i18n.phonenumbers.PhoneNumberUtil.DIALLABLE_CHAR_MAPPINGS_,!0),e!=f&&(c=d));return c};i18n.phonenumbers.PhoneNumberUtil.prototype.rawInputContainsNationalPrefix_=function(a,b,c){a=i18n.phonenumbers.PhoneNumberUtil.normalizeDigitsOnly(a);if(goog.string.startsWith(a,b))try{return this.isValidNumber(this.parse(a.substring(b.length),c))}catch(d){}return!1};
  20594. i18n.phonenumbers.PhoneNumberUtil.prototype.hasUnexpectedItalianLeadingZero_=function(a){return a.hasItalianLeadingZero()&&!this.isLeadingZeroPossible(a.getCountryCodeOrDefault())};
  20595. i18n.phonenumbers.PhoneNumberUtil.prototype.hasFormattingPatternForNumber_=function(a){var b=a.getCountryCodeOrDefault(),c=this.getRegionCodeForCountryCode(b),b=this.getMetadataForRegionOrCallingCode_(b,c);if(null==b)return!1;a=this.getNationalSignificantNumber(a);return null!=this.chooseFormattingPatternForNumber_(b.numberFormatArray(),a)};
  20596. i18n.phonenumbers.PhoneNumberUtil.prototype.formatOutOfCountryKeepingAlphaChars=function(a,b){var c=a.getRawInputOrDefault();if(0==c.length)return this.formatOutOfCountryCallingNumber(a,b);var d=a.getCountryCodeOrDefault();if(!this.hasValidCountryCallingCode_(d))return c;var c=i18n.phonenumbers.PhoneNumberUtil.normalizeHelper_(c,i18n.phonenumbers.PhoneNumberUtil.ALL_PLUS_NUMBER_GROUPING_SYMBOLS_,!0),e=this.getNationalSignificantNumber(a);if(3<e.length){var f=c.indexOf(e.substring(0,3));-1!=f&&(c=
  20597. c.substring(f))}f=this.getMetadataForRegion(b);if(d==i18n.phonenumbers.PhoneNumberUtil.NANPA_COUNTRY_CODE_){if(this.isNANPACountry(b))return d+" "+c}else if(null!=f&&d==this.getCountryCodeForValidRegion_(b)){d=this.chooseFormattingPatternForNumber_(f.numberFormatArray(),e);if(null==d)return c;d=d.clone();d.setPattern("(\\d+)(.*)");d.setFormat("$1$2");return this.formatNsnUsingPattern_(c,d,i18n.phonenumbers.PhoneNumberFormat.NATIONAL)}e="";null!=f&&(e=f.getInternationalPrefixOrDefault(),e=i18n.phonenumbers.PhoneNumberUtil.matchesEntirely_(i18n.phonenumbers.PhoneNumberUtil.UNIQUE_INTERNATIONAL_PREFIX_,
  20598. e)?e:f.getPreferredInternationalPrefixOrDefault());f=this.getRegionCodeForCountryCode(d);f=this.getMetadataForRegionOrCallingCode_(d,f);f=this.maybeGetFormattedExtension_(a,f,i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);return 0<e.length?e+" "+d+" "+c+f:this.prefixNumberWithCountryCallingCode_(d,i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL,c,f)};
  20599. i18n.phonenumbers.PhoneNumberUtil.prototype.getNationalSignificantNumber=function(a){var b=""+a.getNationalNumber();return a.hasItalianLeadingZero()&&a.getItalianLeadingZero()?Array(a.getNumberOfLeadingZerosOrDefault()+1).join("0")+b:b};
  20600. i18n.phonenumbers.PhoneNumberUtil.prototype.prefixNumberWithCountryCallingCode_=function(a,b,c,d){switch(b){case i18n.phonenumbers.PhoneNumberFormat.E164:return i18n.phonenumbers.PhoneNumberUtil.PLUS_SIGN+a+c+d;case i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL:return i18n.phonenumbers.PhoneNumberUtil.PLUS_SIGN+a+" "+c+d;case i18n.phonenumbers.PhoneNumberFormat.RFC3966:return i18n.phonenumbers.PhoneNumberUtil.RFC3966_PREFIX_+i18n.phonenumbers.PhoneNumberUtil.PLUS_SIGN+a+"-"+c+d;default:return c+
  20601. d}};i18n.phonenumbers.PhoneNumberUtil.prototype.formatNsn_=function(a,b,c,d){b=0==b.intlNumberFormatArray().length||c==i18n.phonenumbers.PhoneNumberFormat.NATIONAL?b.numberFormatArray():b.intlNumberFormatArray();b=this.chooseFormattingPatternForNumber_(b,a);return null==b?a:this.formatNsnUsingPattern_(a,b,c,d)};
  20602. i18n.phonenumbers.PhoneNumberUtil.prototype.chooseFormattingPatternForNumber_=function(a,b){for(var c,d=a.length,e=0;e<d;++e){c=a[e];var f=c.leadingDigitsPatternCount();if(0==f||0==b.search(c.getLeadingDigitsPattern(f-1)))if(f=new RegExp(c.getPattern()),i18n.phonenumbers.PhoneNumberUtil.matchesEntirely_(f,b))return c}return null};
  20603. i18n.phonenumbers.PhoneNumberUtil.prototype.formatNsnUsingPattern_=function(a,b,c,d){var e=b.getFormatOrDefault(),f=new RegExp(b.getPattern()),g=b.getDomesticCarrierCodeFormattingRuleOrDefault();c==i18n.phonenumbers.PhoneNumberFormat.NATIONAL&&null!=d&&0<d.length&&0<g.length?(b=g.replace(i18n.phonenumbers.PhoneNumberUtil.CC_PATTERN_,d),e=e.replace(i18n.phonenumbers.PhoneNumberUtil.FIRST_GROUP_PATTERN_,b),a=a.replace(f,e)):(b=b.getNationalPrefixFormattingRuleOrDefault(),a=c==i18n.phonenumbers.PhoneNumberFormat.NATIONAL&&
  20604. null!=b&&0<b.length?a.replace(f,e.replace(i18n.phonenumbers.PhoneNumberUtil.FIRST_GROUP_PATTERN_,b)):a.replace(f,e));c==i18n.phonenumbers.PhoneNumberFormat.RFC3966&&(a=a.replace(new RegExp("^"+i18n.phonenumbers.PhoneNumberUtil.SEPARATOR_PATTERN_),""),a=a.replace(new RegExp(i18n.phonenumbers.PhoneNumberUtil.SEPARATOR_PATTERN_,"g"),"-"));return a};i18n.phonenumbers.PhoneNumberUtil.prototype.getExampleNumber=function(a){return this.getExampleNumberForType(a,i18n.phonenumbers.PhoneNumberType.FIXED_LINE)};
  20605. i18n.phonenumbers.PhoneNumberUtil.prototype.getExampleNumberForType=function(a,b){if(!this.isValidRegionCode_(a))return null;var c=this.getNumberDescByType_(this.getMetadataForRegion(a),b);try{if(c.hasExampleNumber())return this.parse(c.getExampleNumberOrDefault(),a)}catch(d){}return null};
  20606. i18n.phonenumbers.PhoneNumberUtil.prototype.getExampleNumberForNonGeoEntity=function(a){var b=this.getMetadataForNonGeographicalRegion(a);if(null!=b){b=b.getGeneralDesc();try{if(b.hasExampleNumber())return this.parse("+"+a+b.getExampleNumber(),"ZZ")}catch(c){}}return null};
  20607. i18n.phonenumbers.PhoneNumberUtil.prototype.maybeGetFormattedExtension_=function(a,b,c){return a.hasExtension()&&0!=a.getExtension().length?c==i18n.phonenumbers.PhoneNumberFormat.RFC3966?i18n.phonenumbers.PhoneNumberUtil.RFC3966_EXTN_PREFIX_+a.getExtension():b.hasPreferredExtnPrefix()?b.getPreferredExtnPrefix()+a.getExtensionOrDefault():i18n.phonenumbers.PhoneNumberUtil.DEFAULT_EXTN_PREFIX_+a.getExtensionOrDefault():""};
  20608. i18n.phonenumbers.PhoneNumberUtil.prototype.getNumberDescByType_=function(a,b){switch(b){case i18n.phonenumbers.PhoneNumberType.PREMIUM_RATE:return a.getPremiumRate();case i18n.phonenumbers.PhoneNumberType.TOLL_FREE:return a.getTollFree();case i18n.phonenumbers.PhoneNumberType.MOBILE:return a.getMobile();case i18n.phonenumbers.PhoneNumberType.FIXED_LINE:case i18n.phonenumbers.PhoneNumberType.FIXED_LINE_OR_MOBILE:return a.getFixedLine();case i18n.phonenumbers.PhoneNumberType.SHARED_COST:return a.getSharedCost();
  20609. case i18n.phonenumbers.PhoneNumberType.VOIP:return a.getVoip();case i18n.phonenumbers.PhoneNumberType.PERSONAL_NUMBER:return a.getPersonalNumber();case i18n.phonenumbers.PhoneNumberType.PAGER:return a.getPager();case i18n.phonenumbers.PhoneNumberType.UAN:return a.getUan();case i18n.phonenumbers.PhoneNumberType.VOICEMAIL:return a.getVoicemail();default:return a.getGeneralDesc()}};
  20610. i18n.phonenumbers.PhoneNumberUtil.prototype.getNumberType=function(a){var b=this.getRegionCodeForNumber(a),b=this.getMetadataForRegionOrCallingCode_(a.getCountryCodeOrDefault(),b);if(null==b)return i18n.phonenumbers.PhoneNumberType.UNKNOWN;a=this.getNationalSignificantNumber(a);return this.getNumberTypeHelper_(a,b)};
  20611. i18n.phonenumbers.PhoneNumberUtil.prototype.getNumberTypeHelper_=function(a,b){return this.isNumberMatchingDesc_(a,b.getGeneralDesc())?this.isNumberMatchingDesc_(a,b.getPremiumRate())?i18n.phonenumbers.PhoneNumberType.PREMIUM_RATE:this.isNumberMatchingDesc_(a,b.getTollFree())?i18n.phonenumbers.PhoneNumberType.TOLL_FREE:this.isNumberMatchingDesc_(a,b.getSharedCost())?i18n.phonenumbers.PhoneNumberType.SHARED_COST:this.isNumberMatchingDesc_(a,b.getVoip())?i18n.phonenumbers.PhoneNumberType.VOIP:this.isNumberMatchingDesc_(a,
  20612. b.getPersonalNumber())?i18n.phonenumbers.PhoneNumberType.PERSONAL_NUMBER:this.isNumberMatchingDesc_(a,b.getPager())?i18n.phonenumbers.PhoneNumberType.PAGER:this.isNumberMatchingDesc_(a,b.getUan())?i18n.phonenumbers.PhoneNumberType.UAN:this.isNumberMatchingDesc_(a,b.getVoicemail())?i18n.phonenumbers.PhoneNumberType.VOICEMAIL:this.isNumberMatchingDesc_(a,b.getFixedLine())?b.getSameMobileAndFixedLinePattern()||this.isNumberMatchingDesc_(a,b.getMobile())?i18n.phonenumbers.PhoneNumberType.FIXED_LINE_OR_MOBILE:
  20613. i18n.phonenumbers.PhoneNumberType.FIXED_LINE:!b.getSameMobileAndFixedLinePattern()&&this.isNumberMatchingDesc_(a,b.getMobile())?i18n.phonenumbers.PhoneNumberType.MOBILE:i18n.phonenumbers.PhoneNumberType.UNKNOWN:i18n.phonenumbers.PhoneNumberType.UNKNOWN};
  20614. i18n.phonenumbers.PhoneNumberUtil.prototype.getMetadataForRegion=function(a){if(null==a)return null;a=a.toUpperCase();var b=this.regionToMetadataMap[a];if(null==b){var b=new goog.proto2.PbLiteSerializer,c=i18n.phonenumbers.metadata.countryToMetadata[a];if(null==c)return null;b=b.deserialize(i18n.phonenumbers.PhoneMetadata.getDescriptor(),c);this.regionToMetadataMap[a]=b}return b};
  20615. i18n.phonenumbers.PhoneNumberUtil.prototype.getMetadataForNonGeographicalRegion=function(a){return this.getMetadataForRegion(""+a)};i18n.phonenumbers.PhoneNumberUtil.prototype.isNumberMatchingDesc_=function(a,b){var c=a.length;return 0<b.possibleLengthCount()&&-1==goog.array.indexOf(b.possibleLengthArray(),c)?!1:i18n.phonenumbers.PhoneNumberUtil.matchesEntirely_(b.getNationalNumberPatternOrDefault(),a)};
  20616. i18n.phonenumbers.PhoneNumberUtil.prototype.isValidNumber=function(a){var b=this.getRegionCodeForNumber(a);return this.isValidNumberForRegion(a,b)};
  20617. i18n.phonenumbers.PhoneNumberUtil.prototype.isValidNumberForRegion=function(a,b){var c=a.getCountryCodeOrDefault(),d=this.getMetadataForRegionOrCallingCode_(c,b);if(null==d||i18n.phonenumbers.PhoneNumberUtil.REGION_CODE_FOR_NON_GEO_ENTITY!=b&&c!=this.getCountryCodeForValidRegion_(b))return!1;c=this.getNationalSignificantNumber(a);return this.getNumberTypeHelper_(c,d)!=i18n.phonenumbers.PhoneNumberType.UNKNOWN};
  20618. i18n.phonenumbers.PhoneNumberUtil.prototype.getRegionCodeForNumber=function(a){if(null==a)return null;var b=a.getCountryCodeOrDefault(),b=i18n.phonenumbers.metadata.countryCodeToRegionCodeMap[b];return null==b?null:1==b.length?b[0]:this.getRegionCodeForNumberFromRegionList_(a,b)};
  20619. i18n.phonenumbers.PhoneNumberUtil.prototype.getRegionCodeForNumberFromRegionList_=function(a,b){for(var c=this.getNationalSignificantNumber(a),d,e=b.length,f=0;f<e;f++){d=b[f];var g=this.getMetadataForRegion(d);if(g.hasLeadingDigits()){if(0==c.search(g.getLeadingDigits()))return d}else if(this.getNumberTypeHelper_(c,g)!=i18n.phonenumbers.PhoneNumberType.UNKNOWN)return d}return null};
  20620. i18n.phonenumbers.PhoneNumberUtil.prototype.getRegionCodeForCountryCode=function(a){a=i18n.phonenumbers.metadata.countryCodeToRegionCodeMap[a];return null==a?i18n.phonenumbers.PhoneNumberUtil.UNKNOWN_REGION_:a[0]};i18n.phonenumbers.PhoneNumberUtil.prototype.getRegionCodesForCountryCode=function(a){a=i18n.phonenumbers.metadata.countryCodeToRegionCodeMap[a];return null==a?[]:a};
  20621. i18n.phonenumbers.PhoneNumberUtil.prototype.getCountryCodeForRegion=function(a){return this.isValidRegionCode_(a)?this.getCountryCodeForValidRegion_(a):0};i18n.phonenumbers.PhoneNumberUtil.prototype.getCountryCodeForValidRegion_=function(a){var b=this.getMetadataForRegion(a);if(null==b)throw"Invalid region code: "+a;return b.getCountryCodeOrDefault()};
  20622. i18n.phonenumbers.PhoneNumberUtil.prototype.getNddPrefixForRegion=function(a,b){var c=this.getMetadataForRegion(a);if(null==c)return null;c=c.getNationalPrefixOrDefault();if(0==c.length)return null;b&&(c=c.replace("~",""));return c};i18n.phonenumbers.PhoneNumberUtil.prototype.isNANPACountry=function(a){return null!=a&&goog.array.contains(i18n.phonenumbers.metadata.countryCodeToRegionCodeMap[i18n.phonenumbers.PhoneNumberUtil.NANPA_COUNTRY_CODE_],a.toUpperCase())};
  20623. i18n.phonenumbers.PhoneNumberUtil.prototype.isLeadingZeroPossible=function(a){a=this.getMetadataForRegionOrCallingCode_(a,this.getRegionCodeForCountryCode(a));return null!=a&&a.getLeadingZeroPossibleOrDefault()};
  20624. i18n.phonenumbers.PhoneNumberUtil.prototype.isAlphaNumber=function(a){if(!i18n.phonenumbers.PhoneNumberUtil.isViablePhoneNumber(a))return!1;a=new goog.string.StringBuffer(a);this.maybeStripExtension(a);return i18n.phonenumbers.PhoneNumberUtil.matchesEntirely_(i18n.phonenumbers.PhoneNumberUtil.VALID_ALPHA_PHONE_PATTERN_,a.toString())};i18n.phonenumbers.PhoneNumberUtil.prototype.isPossibleNumber=function(a){return this.isPossibleNumberWithReason(a)==i18n.phonenumbers.PhoneNumberUtil.ValidationResult.IS_POSSIBLE};
  20625. i18n.phonenumbers.PhoneNumberUtil.prototype.testNumberLength_=function(a,b){var c=b.possibleLengthArray(),d=b.possibleLengthLocalOnlyArray(),e=a.length;if(-1<goog.array.indexOf(d,e))return i18n.phonenumbers.PhoneNumberUtil.ValidationResult.IS_POSSIBLE;d=c[0];return d==e?i18n.phonenumbers.PhoneNumberUtil.ValidationResult.IS_POSSIBLE:d>e?i18n.phonenumbers.PhoneNumberUtil.ValidationResult.TOO_SHORT:c[c.length-1]<e?i18n.phonenumbers.PhoneNumberUtil.ValidationResult.TOO_LONG:-1<goog.array.indexOf(c,e,
  20626. 1)?i18n.phonenumbers.PhoneNumberUtil.ValidationResult.IS_POSSIBLE:i18n.phonenumbers.PhoneNumberUtil.ValidationResult.TOO_LONG};
  20627. i18n.phonenumbers.PhoneNumberUtil.prototype.isPossibleNumberWithReason=function(a){var b=this.getNationalSignificantNumber(a);a=a.getCountryCodeOrDefault();if(!this.hasValidCountryCallingCode_(a))return i18n.phonenumbers.PhoneNumberUtil.ValidationResult.INVALID_COUNTRY_CODE;var c=this.getRegionCodeForCountryCode(a);a=this.getMetadataForRegionOrCallingCode_(a,c);return this.testNumberLength_(b,a.getGeneralDesc())};
  20628. i18n.phonenumbers.PhoneNumberUtil.prototype.isPossibleNumberString=function(a,b){try{return this.isPossibleNumber(this.parse(a,b))}catch(c){return!1}};
  20629. i18n.phonenumbers.PhoneNumberUtil.prototype.truncateTooLongNumber=function(a){if(this.isValidNumber(a))return!0;var b=a.clone(),c=a.getNationalNumberOrDefault();do if(c=Math.floor(c/10),b.setNationalNumber(c),0==c||this.isPossibleNumberWithReason(b)==i18n.phonenumbers.PhoneNumberUtil.ValidationResult.TOO_SHORT)return!1;while(!this.isValidNumber(b));a.setNationalNumber(c);return!0};
  20630. i18n.phonenumbers.PhoneNumberUtil.prototype.extractCountryCode=function(a,b){var c=a.toString();if(0==c.length||"0"==c.charAt(0))return 0;for(var d,e=c.length,f=1;f<=i18n.phonenumbers.PhoneNumberUtil.MAX_LENGTH_COUNTRY_CODE_&&f<=e;++f)if(d=parseInt(c.substring(0,f),10),d in i18n.phonenumbers.metadata.countryCodeToRegionCodeMap)return b.append(c.substring(f)),d;return 0};
  20631. i18n.phonenumbers.PhoneNumberUtil.prototype.maybeExtractCountryCode=function(a,b,c,d,e){if(0==a.length)return 0;a=new goog.string.StringBuffer(a);var f;null!=b&&(f=b.getInternationalPrefix());null==f&&(f="NonMatch");f=this.maybeStripInternationalPrefixAndNormalize(a,f);d&&e.setCountryCodeSource(f);if(f!=i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_DEFAULT_COUNTRY){if(a.getLength()<=i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_FOR_NSN_)throw i18n.phonenumbers.Error.TOO_SHORT_AFTER_IDD;c=this.extractCountryCode(a,
  20632. c);if(0!=c)return e.setCountryCode(c),c;throw i18n.phonenumbers.Error.INVALID_COUNTRY_CODE;}if(null!=b){f=b.getCountryCodeOrDefault();var g=""+f,h=a.toString();if(goog.string.startsWith(h,g)){var k=new goog.string.StringBuffer(h.substring(g.length)),g=b.getGeneralDesc(),h=new RegExp(g.getNationalNumberPatternOrDefault());this.maybeStripNationalPrefixAndCarrierCode(k,b,null);b=k.toString();if(!i18n.phonenumbers.PhoneNumberUtil.matchesEntirely_(h,a.toString())&&i18n.phonenumbers.PhoneNumberUtil.matchesEntirely_(h,
  20633. b)||this.testNumberLength_(a.toString(),g)==i18n.phonenumbers.PhoneNumberUtil.ValidationResult.TOO_LONG)return c.append(b),d&&e.setCountryCodeSource(i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_NUMBER_WITHOUT_PLUS_SIGN),e.setCountryCode(f),f}}e.setCountryCode(0);return 0};
  20634. i18n.phonenumbers.PhoneNumberUtil.prototype.parsePrefixAsIdd_=function(a,b){var c=b.toString();if(0==c.search(a)){var d=c.match(a)[0].length,e=c.substring(d).match(i18n.phonenumbers.PhoneNumberUtil.CAPTURING_DIGIT_PATTERN);if(e&&null!=e[1]&&0<e[1].length&&"0"==i18n.phonenumbers.PhoneNumberUtil.normalizeDigitsOnly(e[1]))return!1;b.clear();b.append(c.substring(d));return!0}return!1};
  20635. i18n.phonenumbers.PhoneNumberUtil.prototype.maybeStripInternationalPrefixAndNormalize=function(a,b){var c=a.toString();if(0==c.length)return i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_DEFAULT_COUNTRY;if(i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN_.test(c))return c=c.replace(i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN_,""),a.clear(),a.append(i18n.phonenumbers.PhoneNumberUtil.normalize(c)),i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN;
  20636. c=new RegExp(b);i18n.phonenumbers.PhoneNumberUtil.normalizeSB_(a);return this.parsePrefixAsIdd_(c,a)?i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_NUMBER_WITH_IDD:i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_DEFAULT_COUNTRY};
  20637. i18n.phonenumbers.PhoneNumberUtil.prototype.maybeStripNationalPrefixAndCarrierCode=function(a,b,c){var d=a.toString(),e=d.length,f=b.getNationalPrefixForParsing();if(0==e||null==f||0==f.length)return!1;var g=new RegExp("^(?:"+f+")");if(e=g.exec(d)){var f=new RegExp(b.getGeneralDesc().getNationalNumberPatternOrDefault()),h=i18n.phonenumbers.PhoneNumberUtil.matchesEntirely_(f,d),k=e.length-1;b=b.getNationalPrefixTransformRule();if(null==b||0==b.length||null==e[k]||0==e[k].length){if(h&&!i18n.phonenumbers.PhoneNumberUtil.matchesEntirely_(f,
  20638. d.substring(e[0].length)))return!1;null!=c&&0<k&&null!=e[k]&&c.append(e[1]);a.set(d.substring(e[0].length))}else{d=d.replace(g,b);if(h&&!i18n.phonenumbers.PhoneNumberUtil.matchesEntirely_(f,d))return!1;null!=c&&0<k&&c.append(e[1]);a.set(d)}return!0}return!1};
  20639. i18n.phonenumbers.PhoneNumberUtil.prototype.maybeStripExtension=function(a){var b=a.toString(),c=b.search(i18n.phonenumbers.PhoneNumberUtil.EXTN_PATTERN_);if(0<=c&&i18n.phonenumbers.PhoneNumberUtil.isViablePhoneNumber(b.substring(0,c)))for(var d=b.match(i18n.phonenumbers.PhoneNumberUtil.EXTN_PATTERN_),e=d.length,f=1;f<e;++f)if(null!=d[f]&&0<d[f].length)return a.clear(),a.append(b.substring(0,c)),d[f];return""};
  20640. i18n.phonenumbers.PhoneNumberUtil.prototype.checkRegionForParsing_=function(a,b){return this.isValidRegionCode_(b)||null!=a&&0<a.length&&i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN_.test(a)};i18n.phonenumbers.PhoneNumberUtil.prototype.parse=function(a,b){return this.parseHelper_(a,b,!1,!0)};
  20641. i18n.phonenumbers.PhoneNumberUtil.prototype.parseAndKeepRawInput=function(a,b){if(!this.isValidRegionCode_(b)&&0<a.length&&a.charAt(0)!=i18n.phonenumbers.PhoneNumberUtil.PLUS_SIGN)throw i18n.phonenumbers.Error.INVALID_COUNTRY_CODE;return this.parseHelper_(a,b,!0,!0)};i18n.phonenumbers.PhoneNumberUtil.prototype.setItalianLeadingZerosForPhoneNumber_=function(a,b){if(1<a.length&&"0"==a.charAt(0)){b.setItalianLeadingZero(!0);for(var c=1;c<a.length-1&&"0"==a.charAt(c);)c++;1!=c&&b.setNumberOfLeadingZeros(c)}};
  20642. i18n.phonenumbers.PhoneNumberUtil.prototype.parseHelper_=function(a,b,c,d){if(null==a)throw i18n.phonenumbers.Error.NOT_A_NUMBER;if(a.length>i18n.phonenumbers.PhoneNumberUtil.MAX_INPUT_STRING_LENGTH_)throw i18n.phonenumbers.Error.TOO_LONG;var e=new goog.string.StringBuffer;this.buildNationalNumberForParsing_(a,e);if(!i18n.phonenumbers.PhoneNumberUtil.isViablePhoneNumber(e.toString()))throw i18n.phonenumbers.Error.NOT_A_NUMBER;if(d&&!this.checkRegionForParsing_(e.toString(),b))throw i18n.phonenumbers.Error.INVALID_COUNTRY_CODE;
  20643. d=new i18n.phonenumbers.PhoneNumber;c&&d.setRawInput(a);a=this.maybeStripExtension(e);0<a.length&&d.setExtension(a);a=this.getMetadataForRegion(b);var f=new goog.string.StringBuffer,g=0,h=e.toString();try{g=this.maybeExtractCountryCode(h,a,f,c,d)}catch(k){if(k==i18n.phonenumbers.Error.INVALID_COUNTRY_CODE&&i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN_.test(h)){if(h=h.replace(i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN_,""),g=this.maybeExtractCountryCode(h,a,f,c,d),
  20644. 0==g)throw k;}else throw k;}0!=g?(e=this.getRegionCodeForCountryCode(g),e!=b&&(a=this.getMetadataForRegionOrCallingCode_(g,e))):(i18n.phonenumbers.PhoneNumberUtil.normalizeSB_(e),f.append(e.toString()),null!=b?(g=a.getCountryCodeOrDefault(),d.setCountryCode(g)):c&&d.clearCountryCodeSource());if(f.getLength()<i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_FOR_NSN_)throw i18n.phonenumbers.Error.TOO_SHORT_NSN;null!=a&&(b=new goog.string.StringBuffer,e=new goog.string.StringBuffer(f.toString()),this.maybeStripNationalPrefixAndCarrierCode(e,
  20645. a,b),this.testNumberLength_(e.toString(),a.getGeneralDesc())!=i18n.phonenumbers.PhoneNumberUtil.ValidationResult.TOO_SHORT&&(f=e,c&&0<b.toString().length&&d.setPreferredDomesticCarrierCode(b.toString())));c=f.toString();b=c.length;if(b<i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_FOR_NSN_)throw i18n.phonenumbers.Error.TOO_SHORT_NSN;if(b>i18n.phonenumbers.PhoneNumberUtil.MAX_LENGTH_FOR_NSN_)throw i18n.phonenumbers.Error.TOO_LONG;this.setItalianLeadingZerosForPhoneNumber_(c,d);d.setNationalNumber(parseInt(c,
  20646. 10));return d};
  20647. i18n.phonenumbers.PhoneNumberUtil.prototype.buildNationalNumberForParsing_=function(a,b){var c=a.indexOf(i18n.phonenumbers.PhoneNumberUtil.RFC3966_PHONE_CONTEXT_);if(0<c){var d=c+i18n.phonenumbers.PhoneNumberUtil.RFC3966_PHONE_CONTEXT_.length;if(a.charAt(d)==i18n.phonenumbers.PhoneNumberUtil.PLUS_SIGN){var e=a.indexOf(";",d);0<e?b.append(a.substring(d,e)):b.append(a.substring(d))}d=a.indexOf(i18n.phonenumbers.PhoneNumberUtil.RFC3966_PREFIX_);b.append(a.substring(0<=d?d+i18n.phonenumbers.PhoneNumberUtil.RFC3966_PREFIX_.length:0,
  20648. c))}else b.append(i18n.phonenumbers.PhoneNumberUtil.extractPossibleNumber(a));c=b.toString();d=c.indexOf(i18n.phonenumbers.PhoneNumberUtil.RFC3966_ISDN_SUBADDRESS_);0<d&&(b.clear(),b.append(c.substring(0,d)))};
  20649. i18n.phonenumbers.PhoneNumberUtil.prototype.isNumberMatch=function(a,b){var c,d;if("string"==typeof a)try{c=this.parse(a,i18n.phonenumbers.PhoneNumberUtil.UNKNOWN_REGION_)}catch(g){if(g!=i18n.phonenumbers.Error.INVALID_COUNTRY_CODE)return i18n.phonenumbers.PhoneNumberUtil.MatchType.NOT_A_NUMBER;if("string"!=typeof b){var e=this.getRegionCodeForCountryCode(b.getCountryCodeOrDefault());if(e!=i18n.phonenumbers.PhoneNumberUtil.UNKNOWN_REGION_){try{c=this.parse(a,e)}catch(h){return i18n.phonenumbers.PhoneNumberUtil.MatchType.NOT_A_NUMBER}c=
  20650. this.isNumberMatch(c,b);return c==i18n.phonenumbers.PhoneNumberUtil.MatchType.EXACT_MATCH?i18n.phonenumbers.PhoneNumberUtil.MatchType.NSN_MATCH:c}}try{c=this.parseHelper_(a,null,!1,!1)}catch(h){return i18n.phonenumbers.PhoneNumberUtil.MatchType.NOT_A_NUMBER}}else c=a.clone();if("string"==typeof b)try{return d=this.parse(b,i18n.phonenumbers.PhoneNumberUtil.UNKNOWN_REGION_),this.isNumberMatch(a,d)}catch(g){return g!=i18n.phonenumbers.Error.INVALID_COUNTRY_CODE?i18n.phonenumbers.PhoneNumberUtil.MatchType.NOT_A_NUMBER:
  20651. this.isNumberMatch(b,c)}else d=b.clone();c.clearRawInput();c.clearCountryCodeSource();c.clearPreferredDomesticCarrierCode();d.clearRawInput();d.clearCountryCodeSource();d.clearPreferredDomesticCarrierCode();c.hasExtension()&&0==c.getExtension().length&&c.clearExtension();d.hasExtension()&&0==d.getExtension().length&&d.clearExtension();if(c.hasExtension()&&d.hasExtension()&&c.getExtension()!=d.getExtension())return i18n.phonenumbers.PhoneNumberUtil.MatchType.NO_MATCH;var e=c.getCountryCodeOrDefault(),
  20652. f=d.getCountryCodeOrDefault();if(0!=e&&0!=f)return c.equals(d)?i18n.phonenumbers.PhoneNumberUtil.MatchType.EXACT_MATCH:e==f&&this.isNationalNumberSuffixOfTheOther_(c,d)?i18n.phonenumbers.PhoneNumberUtil.MatchType.SHORT_NSN_MATCH:i18n.phonenumbers.PhoneNumberUtil.MatchType.NO_MATCH;c.setCountryCode(0);d.setCountryCode(0);return c.equals(d)?i18n.phonenumbers.PhoneNumberUtil.MatchType.NSN_MATCH:this.isNationalNumberSuffixOfTheOther_(c,d)?i18n.phonenumbers.PhoneNumberUtil.MatchType.SHORT_NSN_MATCH:i18n.phonenumbers.PhoneNumberUtil.MatchType.NO_MATCH};
  20653. i18n.phonenumbers.PhoneNumberUtil.prototype.isNationalNumberSuffixOfTheOther_=function(a,b){var c=""+a.getNationalNumber(),d=""+b.getNationalNumber();return goog.string.endsWith(c,d)||goog.string.endsWith(d,c)};i18n.phonenumbers.PhoneNumberUtil.prototype.canBeInternationallyDialled=function(a){var b=this.getMetadataForRegion(this.getRegionCodeForNumber(a));if(null==b)return!0;a=this.getNationalSignificantNumber(a);return!this.isNumberMatchingDesc_(a,b.getNoInternationalDialling())};
  20654. i18n.phonenumbers.PhoneNumberUtil.matchesEntirely_=function(a,b){var c="string"==typeof a?b.match("^(?:"+a+")$"):b.match(a);return c&&c[0].length==b.length?!0:!1};/*
  20655. Copyright (C) 2014 codedust.
  20656. Licensed under the Apache License, Version 2.0 (the "License");
  20657. you may not use this file except in compliance with the License.
  20658. You may obtain a copy of the License at
  20659. http://www.apache.org/licenses/LICENSE-2.0
  20660. Unless required by applicable law or agreed to in writing, software
  20661. distributed under the License is distributed on an "AS IS" BASIS,
  20662. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  20663. See the License for the specific language governing permissions and
  20664. limitations under the License.
  20665. */
  20666. var libphonenumber=function(){var a={},b=i18n.phonenumbers.PhoneNumberUtil.getInstance();a.parse=function(a,d){try{return b.parse(a,d)}catch(e){throw e;}};a.getCountryCodeForRegion=function(a){return b.getCountryCodeForRegion(a)};a.getRegionCodeForCountryCode=function(a){return b.getRegionCodeForCountryCode(a)};a.getRegionCodeForNumber=function(a){return b.getRegionCodeForNumber(a)};a.isValidNumber=function(a){return b.isValidNumber(a)};a.isValidNumberForRegion=function(a,d){return b.isValidNumberForRegion(a,
  20667. d)};a.PhoneNumberFormat=i18n.phonenumbers.PhoneNumberFormat;a.format=function(a,d){return b.format(a,d)};return a}();goog.exportSymbol("libphonenumber.parse",libphonenumber.parse);goog.exportSymbol("libphonenumber.getCountryCodeForRegion",libphonenumber.getCountryCodeForRegion);goog.exportSymbol("libphonenumber.getRegionCodeForCountryCode",libphonenumber.getRegionCodeForCountryCode);goog.exportSymbol("libphonenumber.getRegionCodeForNumber",libphonenumber.getRegionCodeForNumber);
  20668. goog.exportSymbol("libphonenumber.isValidNumber",libphonenumber.isValidNumber);goog.exportSymbol("libphonenumber.isValidNumberForRegion",libphonenumber.isValidNumberForRegion);goog.exportSymbol("libphonenumber.PhoneNumberFormat",libphonenumber.PhoneNumberFormat);goog.exportSymbol("libphonenumber.PhoneNumberFormat.E164",libphonenumber.PhoneNumberFormat.E164);goog.exportSymbol("libphonenumber.PhoneNumberFormat.INTERNATIONAL",libphonenumber.PhoneNumberFormat.INTERNATIONAL);
  20669. goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.PhoneNumberFormat.NATIONAL);goog.exportSymbol("libphonenumber.PhoneNumberFormat.RFC3966",libphonenumber.PhoneNumberFormat.RFC3966);goog.exportSymbol("libphonenumber.format",libphonenumber.format);})();
  20670. //! moment.js
  20671. //! version : 2.14.1
  20672. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  20673. //! license : MIT
  20674. //! momentjs.com
  20675. ;(function (global, factory) {
  20676. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  20677. typeof define === 'function' && define.amd ? define(factory) :
  20678. global.moment = factory()
  20679. }(this, function () { 'use strict';
  20680. var hookCallback;
  20681. function utils_hooks__hooks () {
  20682. return hookCallback.apply(null, arguments);
  20683. }
  20684. // This is done to register the method called with moment()
  20685. // without creating circular dependencies.
  20686. function setHookCallback (callback) {
  20687. hookCallback = callback;
  20688. }
  20689. function isArray(input) {
  20690. return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
  20691. }
  20692. function isObject(input) {
  20693. return Object.prototype.toString.call(input) === '[object Object]';
  20694. }
  20695. function isObjectEmpty(obj) {
  20696. var k;
  20697. for (k in obj) {
  20698. // even if its not own property I'd still call it non-empty
  20699. return false;
  20700. }
  20701. return true;
  20702. }
  20703. function isDate(input) {
  20704. return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
  20705. }
  20706. function map(arr, fn) {
  20707. var res = [], i;
  20708. for (i = 0; i < arr.length; ++i) {
  20709. res.push(fn(arr[i], i));
  20710. }
  20711. return res;
  20712. }
  20713. function hasOwnProp(a, b) {
  20714. return Object.prototype.hasOwnProperty.call(a, b);
  20715. }
  20716. function extend(a, b) {
  20717. for (var i in b) {
  20718. if (hasOwnProp(b, i)) {
  20719. a[i] = b[i];
  20720. }
  20721. }
  20722. if (hasOwnProp(b, 'toString')) {
  20723. a.toString = b.toString;
  20724. }
  20725. if (hasOwnProp(b, 'valueOf')) {
  20726. a.valueOf = b.valueOf;
  20727. }
  20728. return a;
  20729. }
  20730. function create_utc__createUTC (input, format, locale, strict) {
  20731. return createLocalOrUTC(input, format, locale, strict, true).utc();
  20732. }
  20733. function defaultParsingFlags() {
  20734. // We need to deep clone this object.
  20735. return {
  20736. empty : false,
  20737. unusedTokens : [],
  20738. unusedInput : [],
  20739. overflow : -2,
  20740. charsLeftOver : 0,
  20741. nullInput : false,
  20742. invalidMonth : null,
  20743. invalidFormat : false,
  20744. userInvalidated : false,
  20745. iso : false,
  20746. parsedDateParts : [],
  20747. meridiem : null
  20748. };
  20749. }
  20750. function getParsingFlags(m) {
  20751. if (m._pf == null) {
  20752. m._pf = defaultParsingFlags();
  20753. }
  20754. return m._pf;
  20755. }
  20756. var some;
  20757. if (Array.prototype.some) {
  20758. some = Array.prototype.some;
  20759. } else {
  20760. some = function (fun) {
  20761. var t = Object(this);
  20762. var len = t.length >>> 0;
  20763. for (var i = 0; i < len; i++) {
  20764. if (i in t && fun.call(this, t[i], i, t)) {
  20765. return true;
  20766. }
  20767. }
  20768. return false;
  20769. };
  20770. }
  20771. function valid__isValid(m) {
  20772. if (m._isValid == null) {
  20773. var flags = getParsingFlags(m);
  20774. var parsedParts = some.call(flags.parsedDateParts, function (i) {
  20775. return i != null;
  20776. });
  20777. m._isValid = !isNaN(m._d.getTime()) &&
  20778. flags.overflow < 0 &&
  20779. !flags.empty &&
  20780. !flags.invalidMonth &&
  20781. !flags.invalidWeekday &&
  20782. !flags.nullInput &&
  20783. !flags.invalidFormat &&
  20784. !flags.userInvalidated &&
  20785. (!flags.meridiem || (flags.meridiem && parsedParts));
  20786. if (m._strict) {
  20787. m._isValid = m._isValid &&
  20788. flags.charsLeftOver === 0 &&
  20789. flags.unusedTokens.length === 0 &&
  20790. flags.bigHour === undefined;
  20791. }
  20792. }
  20793. return m._isValid;
  20794. }
  20795. function valid__createInvalid (flags) {
  20796. var m = create_utc__createUTC(NaN);
  20797. if (flags != null) {
  20798. extend(getParsingFlags(m), flags);
  20799. }
  20800. else {
  20801. getParsingFlags(m).userInvalidated = true;
  20802. }
  20803. return m;
  20804. }
  20805. function isUndefined(input) {
  20806. return input === void 0;
  20807. }
  20808. // Plugins that add properties should also add the key here (null value),
  20809. // so we can properly clone ourselves.
  20810. var momentProperties = utils_hooks__hooks.momentProperties = [];
  20811. function copyConfig(to, from) {
  20812. var i, prop, val;
  20813. if (!isUndefined(from._isAMomentObject)) {
  20814. to._isAMomentObject = from._isAMomentObject;
  20815. }
  20816. if (!isUndefined(from._i)) {
  20817. to._i = from._i;
  20818. }
  20819. if (!isUndefined(from._f)) {
  20820. to._f = from._f;
  20821. }
  20822. if (!isUndefined(from._l)) {
  20823. to._l = from._l;
  20824. }
  20825. if (!isUndefined(from._strict)) {
  20826. to._strict = from._strict;
  20827. }
  20828. if (!isUndefined(from._tzm)) {
  20829. to._tzm = from._tzm;
  20830. }
  20831. if (!isUndefined(from._isUTC)) {
  20832. to._isUTC = from._isUTC;
  20833. }
  20834. if (!isUndefined(from._offset)) {
  20835. to._offset = from._offset;
  20836. }
  20837. if (!isUndefined(from._pf)) {
  20838. to._pf = getParsingFlags(from);
  20839. }
  20840. if (!isUndefined(from._locale)) {
  20841. to._locale = from._locale;
  20842. }
  20843. if (momentProperties.length > 0) {
  20844. for (i in momentProperties) {
  20845. prop = momentProperties[i];
  20846. val = from[prop];
  20847. if (!isUndefined(val)) {
  20848. to[prop] = val;
  20849. }
  20850. }
  20851. }
  20852. return to;
  20853. }
  20854. var updateInProgress = false;
  20855. // Moment prototype object
  20856. function Moment(config) {
  20857. copyConfig(this, config);
  20858. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  20859. // Prevent infinite loop in case updateOffset creates new moment
  20860. // objects.
  20861. if (updateInProgress === false) {
  20862. updateInProgress = true;
  20863. utils_hooks__hooks.updateOffset(this);
  20864. updateInProgress = false;
  20865. }
  20866. }
  20867. function isMoment (obj) {
  20868. return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
  20869. }
  20870. function absFloor (number) {
  20871. if (number < 0) {
  20872. // -0 -> 0
  20873. return Math.ceil(number) || 0;
  20874. } else {
  20875. return Math.floor(number);
  20876. }
  20877. }
  20878. function toInt(argumentForCoercion) {
  20879. var coercedNumber = +argumentForCoercion,
  20880. value = 0;
  20881. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  20882. value = absFloor(coercedNumber);
  20883. }
  20884. return value;
  20885. }
  20886. // compare two arrays, return the number of differences
  20887. function compareArrays(array1, array2, dontConvert) {
  20888. var len = Math.min(array1.length, array2.length),
  20889. lengthDiff = Math.abs(array1.length - array2.length),
  20890. diffs = 0,
  20891. i;
  20892. for (i = 0; i < len; i++) {
  20893. if ((dontConvert && array1[i] !== array2[i]) ||
  20894. (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
  20895. diffs++;
  20896. }
  20897. }
  20898. return diffs + lengthDiff;
  20899. }
  20900. function warn(msg) {
  20901. if (utils_hooks__hooks.suppressDeprecationWarnings === false &&
  20902. (typeof console !== 'undefined') && console.warn) {
  20903. console.warn('Deprecation warning: ' + msg);
  20904. }
  20905. }
  20906. function deprecate(msg, fn) {
  20907. var firstTime = true;
  20908. return extend(function () {
  20909. if (utils_hooks__hooks.deprecationHandler != null) {
  20910. utils_hooks__hooks.deprecationHandler(null, msg);
  20911. }
  20912. if (firstTime) {
  20913. warn(msg + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\n' + (new Error()).stack);
  20914. firstTime = false;
  20915. }
  20916. return fn.apply(this, arguments);
  20917. }, fn);
  20918. }
  20919. var deprecations = {};
  20920. function deprecateSimple(name, msg) {
  20921. if (utils_hooks__hooks.deprecationHandler != null) {
  20922. utils_hooks__hooks.deprecationHandler(name, msg);
  20923. }
  20924. if (!deprecations[name]) {
  20925. warn(msg);
  20926. deprecations[name] = true;
  20927. }
  20928. }
  20929. utils_hooks__hooks.suppressDeprecationWarnings = false;
  20930. utils_hooks__hooks.deprecationHandler = null;
  20931. function isFunction(input) {
  20932. return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
  20933. }
  20934. function locale_set__set (config) {
  20935. var prop, i;
  20936. for (i in config) {
  20937. prop = config[i];
  20938. if (isFunction(prop)) {
  20939. this[i] = prop;
  20940. } else {
  20941. this['_' + i] = prop;
  20942. }
  20943. }
  20944. this._config = config;
  20945. // Lenient ordinal parsing accepts just a number in addition to
  20946. // number + (possibly) stuff coming from _ordinalParseLenient.
  20947. this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
  20948. }
  20949. function mergeConfigs(parentConfig, childConfig) {
  20950. var res = extend({}, parentConfig), prop;
  20951. for (prop in childConfig) {
  20952. if (hasOwnProp(childConfig, prop)) {
  20953. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  20954. res[prop] = {};
  20955. extend(res[prop], parentConfig[prop]);
  20956. extend(res[prop], childConfig[prop]);
  20957. } else if (childConfig[prop] != null) {
  20958. res[prop] = childConfig[prop];
  20959. } else {
  20960. delete res[prop];
  20961. }
  20962. }
  20963. }
  20964. for (prop in parentConfig) {
  20965. if (hasOwnProp(parentConfig, prop) &&
  20966. !hasOwnProp(childConfig, prop) &&
  20967. isObject(parentConfig[prop])) {
  20968. // make sure changes to properties don't modify parent config
  20969. res[prop] = extend({}, res[prop]);
  20970. }
  20971. }
  20972. return res;
  20973. }
  20974. function Locale(config) {
  20975. if (config != null) {
  20976. this.set(config);
  20977. }
  20978. }
  20979. var keys;
  20980. if (Object.keys) {
  20981. keys = Object.keys;
  20982. } else {
  20983. keys = function (obj) {
  20984. var i, res = [];
  20985. for (i in obj) {
  20986. if (hasOwnProp(obj, i)) {
  20987. res.push(i);
  20988. }
  20989. }
  20990. return res;
  20991. };
  20992. }
  20993. var defaultCalendar = {
  20994. sameDay : '[Today at] LT',
  20995. nextDay : '[Tomorrow at] LT',
  20996. nextWeek : 'dddd [at] LT',
  20997. lastDay : '[Yesterday at] LT',
  20998. lastWeek : '[Last] dddd [at] LT',
  20999. sameElse : 'L'
  21000. };
  21001. function locale_calendar__calendar (key, mom, now) {
  21002. var output = this._calendar[key] || this._calendar['sameElse'];
  21003. return isFunction(output) ? output.call(mom, now) : output;
  21004. }
  21005. var defaultLongDateFormat = {
  21006. LTS : 'h:mm:ss A',
  21007. LT : 'h:mm A',
  21008. L : 'MM/DD/YYYY',
  21009. LL : 'MMMM D, YYYY',
  21010. LLL : 'MMMM D, YYYY h:mm A',
  21011. LLLL : 'dddd, MMMM D, YYYY h:mm A'
  21012. };
  21013. function longDateFormat (key) {
  21014. var format = this._longDateFormat[key],
  21015. formatUpper = this._longDateFormat[key.toUpperCase()];
  21016. if (format || !formatUpper) {
  21017. return format;
  21018. }
  21019. this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
  21020. return val.slice(1);
  21021. });
  21022. return this._longDateFormat[key];
  21023. }
  21024. var defaultInvalidDate = 'Invalid date';
  21025. function invalidDate () {
  21026. return this._invalidDate;
  21027. }
  21028. var defaultOrdinal = '%d';
  21029. var defaultOrdinalParse = /\d{1,2}/;
  21030. function ordinal (number) {
  21031. return this._ordinal.replace('%d', number);
  21032. }
  21033. var defaultRelativeTime = {
  21034. future : 'in %s',
  21035. past : '%s ago',
  21036. s : 'a few seconds',
  21037. m : 'a minute',
  21038. mm : '%d minutes',
  21039. h : 'an hour',
  21040. hh : '%d hours',
  21041. d : 'a day',
  21042. dd : '%d days',
  21043. M : 'a month',
  21044. MM : '%d months',
  21045. y : 'a year',
  21046. yy : '%d years'
  21047. };
  21048. function relative__relativeTime (number, withoutSuffix, string, isFuture) {
  21049. var output = this._relativeTime[string];
  21050. return (isFunction(output)) ?
  21051. output(number, withoutSuffix, string, isFuture) :
  21052. output.replace(/%d/i, number);
  21053. }
  21054. function pastFuture (diff, output) {
  21055. var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  21056. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  21057. }
  21058. var aliases = {};
  21059. function addUnitAlias (unit, shorthand) {
  21060. var lowerCase = unit.toLowerCase();
  21061. aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
  21062. }
  21063. function normalizeUnits(units) {
  21064. return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
  21065. }
  21066. function normalizeObjectUnits(inputObject) {
  21067. var normalizedInput = {},
  21068. normalizedProp,
  21069. prop;
  21070. for (prop in inputObject) {
  21071. if (hasOwnProp(inputObject, prop)) {
  21072. normalizedProp = normalizeUnits(prop);
  21073. if (normalizedProp) {
  21074. normalizedInput[normalizedProp] = inputObject[prop];
  21075. }
  21076. }
  21077. }
  21078. return normalizedInput;
  21079. }
  21080. var priorities = {};
  21081. function addUnitPriority(unit, priority) {
  21082. priorities[unit] = priority;
  21083. }
  21084. function getPrioritizedUnits(unitsObj) {
  21085. var units = [];
  21086. for (var u in unitsObj) {
  21087. units.push({unit: u, priority: priorities[u]});
  21088. }
  21089. units.sort(function (a, b) {
  21090. return a.priority - b.priority;
  21091. });
  21092. return units;
  21093. }
  21094. function makeGetSet (unit, keepTime) {
  21095. return function (value) {
  21096. if (value != null) {
  21097. get_set__set(this, unit, value);
  21098. utils_hooks__hooks.updateOffset(this, keepTime);
  21099. return this;
  21100. } else {
  21101. return get_set__get(this, unit);
  21102. }
  21103. };
  21104. }
  21105. function get_set__get (mom, unit) {
  21106. return mom.isValid() ?
  21107. mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
  21108. }
  21109. function get_set__set (mom, unit, value) {
  21110. if (mom.isValid()) {
  21111. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
  21112. }
  21113. }
  21114. // MOMENTS
  21115. function stringGet (units) {
  21116. units = normalizeUnits(units);
  21117. if (isFunction(this[units])) {
  21118. return this[units]();
  21119. }
  21120. return this;
  21121. }
  21122. function stringSet (units, value) {
  21123. if (typeof units === 'object') {
  21124. units = normalizeObjectUnits(units);
  21125. var prioritized = getPrioritizedUnits(units);
  21126. for (var i = 0; i < prioritized.length; i++) {
  21127. this[prioritized[i].unit](units[prioritized[i].unit]);
  21128. }
  21129. } else {
  21130. units = normalizeUnits(units);
  21131. if (isFunction(this[units])) {
  21132. return this[units](value);
  21133. }
  21134. }
  21135. return this;
  21136. }
  21137. function zeroFill(number, targetLength, forceSign) {
  21138. var absNumber = '' + Math.abs(number),
  21139. zerosToFill = targetLength - absNumber.length,
  21140. sign = number >= 0;
  21141. return (sign ? (forceSign ? '+' : '') : '-') +
  21142. Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
  21143. }
  21144. var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
  21145. var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
  21146. var formatFunctions = {};
  21147. var formatTokenFunctions = {};
  21148. // token: 'M'
  21149. // padded: ['MM', 2]
  21150. // ordinal: 'Mo'
  21151. // callback: function () { this.month() + 1 }
  21152. function addFormatToken (token, padded, ordinal, callback) {
  21153. var func = callback;
  21154. if (typeof callback === 'string') {
  21155. func = function () {
  21156. return this[callback]();
  21157. };
  21158. }
  21159. if (token) {
  21160. formatTokenFunctions[token] = func;
  21161. }
  21162. if (padded) {
  21163. formatTokenFunctions[padded[0]] = function () {
  21164. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  21165. };
  21166. }
  21167. if (ordinal) {
  21168. formatTokenFunctions[ordinal] = function () {
  21169. return this.localeData().ordinal(func.apply(this, arguments), token);
  21170. };
  21171. }
  21172. }
  21173. function removeFormattingTokens(input) {
  21174. if (input.match(/\[[\s\S]/)) {
  21175. return input.replace(/^\[|\]$/g, '');
  21176. }
  21177. return input.replace(/\\/g, '');
  21178. }
  21179. function makeFormatFunction(format) {
  21180. var array = format.match(formattingTokens), i, length;
  21181. for (i = 0, length = array.length; i < length; i++) {
  21182. if (formatTokenFunctions[array[i]]) {
  21183. array[i] = formatTokenFunctions[array[i]];
  21184. } else {
  21185. array[i] = removeFormattingTokens(array[i]);
  21186. }
  21187. }
  21188. return function (mom) {
  21189. var output = '', i;
  21190. for (i = 0; i < length; i++) {
  21191. output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
  21192. }
  21193. return output;
  21194. };
  21195. }
  21196. // format date using native date object
  21197. function formatMoment(m, format) {
  21198. if (!m.isValid()) {
  21199. return m.localeData().invalidDate();
  21200. }
  21201. format = expandFormat(format, m.localeData());
  21202. formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
  21203. return formatFunctions[format](m);
  21204. }
  21205. function expandFormat(format, locale) {
  21206. var i = 5;
  21207. function replaceLongDateFormatTokens(input) {
  21208. return locale.longDateFormat(input) || input;
  21209. }
  21210. localFormattingTokens.lastIndex = 0;
  21211. while (i >= 0 && localFormattingTokens.test(format)) {
  21212. format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
  21213. localFormattingTokens.lastIndex = 0;
  21214. i -= 1;
  21215. }
  21216. return format;
  21217. }
  21218. var match1 = /\d/; // 0 - 9
  21219. var match2 = /\d\d/; // 00 - 99
  21220. var match3 = /\d{3}/; // 000 - 999
  21221. var match4 = /\d{4}/; // 0000 - 9999
  21222. var match6 = /[+-]?\d{6}/; // -999999 - 999999
  21223. var match1to2 = /\d\d?/; // 0 - 99
  21224. var match3to4 = /\d\d\d\d?/; // 999 - 9999
  21225. var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
  21226. var match1to3 = /\d{1,3}/; // 0 - 999
  21227. var match1to4 = /\d{1,4}/; // 0 - 9999
  21228. var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
  21229. var matchUnsigned = /\d+/; // 0 - inf
  21230. var matchSigned = /[+-]?\d+/; // -inf - inf
  21231. var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
  21232. var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  21233. var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
  21234. // any word (or two) characters or numbers including two/three word month in arabic.
  21235. // includes scottish gaelic two word and hyphenated months
  21236. var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
  21237. var regexes = {};
  21238. function addRegexToken (token, regex, strictRegex) {
  21239. regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
  21240. return (isStrict && strictRegex) ? strictRegex : regex;
  21241. };
  21242. }
  21243. function getParseRegexForToken (token, config) {
  21244. if (!hasOwnProp(regexes, token)) {
  21245. return new RegExp(unescapeFormat(token));
  21246. }
  21247. return regexes[token](config._strict, config._locale);
  21248. }
  21249. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  21250. function unescapeFormat(s) {
  21251. return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
  21252. return p1 || p2 || p3 || p4;
  21253. }));
  21254. }
  21255. function regexEscape(s) {
  21256. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  21257. }
  21258. var tokens = {};
  21259. function addParseToken (token, callback) {
  21260. var i, func = callback;
  21261. if (typeof token === 'string') {
  21262. token = [token];
  21263. }
  21264. if (typeof callback === 'number') {
  21265. func = function (input, array) {
  21266. array[callback] = toInt(input);
  21267. };
  21268. }
  21269. for (i = 0; i < token.length; i++) {
  21270. tokens[token[i]] = func;
  21271. }
  21272. }
  21273. function addWeekParseToken (token, callback) {
  21274. addParseToken(token, function (input, array, config, token) {
  21275. config._w = config._w || {};
  21276. callback(input, config._w, config, token);
  21277. });
  21278. }
  21279. function addTimeToArrayFromToken(token, input, config) {
  21280. if (input != null && hasOwnProp(tokens, token)) {
  21281. tokens[token](input, config._a, config, token);
  21282. }
  21283. }
  21284. var YEAR = 0;
  21285. var MONTH = 1;
  21286. var DATE = 2;
  21287. var HOUR = 3;
  21288. var MINUTE = 4;
  21289. var SECOND = 5;
  21290. var MILLISECOND = 6;
  21291. var WEEK = 7;
  21292. var WEEKDAY = 8;
  21293. var indexOf;
  21294. if (Array.prototype.indexOf) {
  21295. indexOf = Array.prototype.indexOf;
  21296. } else {
  21297. indexOf = function (o) {
  21298. // I know
  21299. var i;
  21300. for (i = 0; i < this.length; ++i) {
  21301. if (this[i] === o) {
  21302. return i;
  21303. }
  21304. }
  21305. return -1;
  21306. };
  21307. }
  21308. function daysInMonth(year, month) {
  21309. return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
  21310. }
  21311. // FORMATTING
  21312. addFormatToken('M', ['MM', 2], 'Mo', function () {
  21313. return this.month() + 1;
  21314. });
  21315. addFormatToken('MMM', 0, 0, function (format) {
  21316. return this.localeData().monthsShort(this, format);
  21317. });
  21318. addFormatToken('MMMM', 0, 0, function (format) {
  21319. return this.localeData().months(this, format);
  21320. });
  21321. // ALIASES
  21322. addUnitAlias('month', 'M');
  21323. // PRIORITY
  21324. addUnitPriority('month', 8);
  21325. // PARSING
  21326. addRegexToken('M', match1to2);
  21327. addRegexToken('MM', match1to2, match2);
  21328. addRegexToken('MMM', function (isStrict, locale) {
  21329. return locale.monthsShortRegex(isStrict);
  21330. });
  21331. addRegexToken('MMMM', function (isStrict, locale) {
  21332. return locale.monthsRegex(isStrict);
  21333. });
  21334. addParseToken(['M', 'MM'], function (input, array) {
  21335. array[MONTH] = toInt(input) - 1;
  21336. });
  21337. addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
  21338. var month = config._locale.monthsParse(input, token, config._strict);
  21339. // if we didn't find a month name, mark the date as invalid.
  21340. if (month != null) {
  21341. array[MONTH] = month;
  21342. } else {
  21343. getParsingFlags(config).invalidMonth = input;
  21344. }
  21345. });
  21346. // LOCALES
  21347. var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/;
  21348. var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
  21349. function localeMonths (m, format) {
  21350. return isArray(this._months) ? this._months[m.month()] :
  21351. this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
  21352. }
  21353. var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
  21354. function localeMonthsShort (m, format) {
  21355. return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
  21356. this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
  21357. }
  21358. function units_month__handleStrictParse(monthName, format, strict) {
  21359. var i, ii, mom, llc = monthName.toLocaleLowerCase();
  21360. if (!this._monthsParse) {
  21361. // this is not used
  21362. this._monthsParse = [];
  21363. this._longMonthsParse = [];
  21364. this._shortMonthsParse = [];
  21365. for (i = 0; i < 12; ++i) {
  21366. mom = create_utc__createUTC([2000, i]);
  21367. this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
  21368. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  21369. }
  21370. }
  21371. if (strict) {
  21372. if (format === 'MMM') {
  21373. ii = indexOf.call(this._shortMonthsParse, llc);
  21374. return ii !== -1 ? ii : null;
  21375. } else {
  21376. ii = indexOf.call(this._longMonthsParse, llc);
  21377. return ii !== -1 ? ii : null;
  21378. }
  21379. } else {
  21380. if (format === 'MMM') {
  21381. ii = indexOf.call(this._shortMonthsParse, llc);
  21382. if (ii !== -1) {
  21383. return ii;
  21384. }
  21385. ii = indexOf.call(this._longMonthsParse, llc);
  21386. return ii !== -1 ? ii : null;
  21387. } else {
  21388. ii = indexOf.call(this._longMonthsParse, llc);
  21389. if (ii !== -1) {
  21390. return ii;
  21391. }
  21392. ii = indexOf.call(this._shortMonthsParse, llc);
  21393. return ii !== -1 ? ii : null;
  21394. }
  21395. }
  21396. }
  21397. function localeMonthsParse (monthName, format, strict) {
  21398. var i, mom, regex;
  21399. if (this._monthsParseExact) {
  21400. return units_month__handleStrictParse.call(this, monthName, format, strict);
  21401. }
  21402. if (!this._monthsParse) {
  21403. this._monthsParse = [];
  21404. this._longMonthsParse = [];
  21405. this._shortMonthsParse = [];
  21406. }
  21407. // TODO: add sorting
  21408. // Sorting makes sure if one month (or abbr) is a prefix of another
  21409. // see sorting in computeMonthsParse
  21410. for (i = 0; i < 12; i++) {
  21411. // make the regex if we don't have it already
  21412. mom = create_utc__createUTC([2000, i]);
  21413. if (strict && !this._longMonthsParse[i]) {
  21414. this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
  21415. this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
  21416. }
  21417. if (!strict && !this._monthsParse[i]) {
  21418. regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
  21419. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  21420. }
  21421. // test the regex
  21422. if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
  21423. return i;
  21424. } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
  21425. return i;
  21426. } else if (!strict && this._monthsParse[i].test(monthName)) {
  21427. return i;
  21428. }
  21429. }
  21430. }
  21431. // MOMENTS
  21432. function setMonth (mom, value) {
  21433. var dayOfMonth;
  21434. if (!mom.isValid()) {
  21435. // No op
  21436. return mom;
  21437. }
  21438. if (typeof value === 'string') {
  21439. if (/^\d+$/.test(value)) {
  21440. value = toInt(value);
  21441. } else {
  21442. value = mom.localeData().monthsParse(value);
  21443. // TODO: Another silent failure?
  21444. if (typeof value !== 'number') {
  21445. return mom;
  21446. }
  21447. }
  21448. }
  21449. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  21450. mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  21451. return mom;
  21452. }
  21453. function getSetMonth (value) {
  21454. if (value != null) {
  21455. setMonth(this, value);
  21456. utils_hooks__hooks.updateOffset(this, true);
  21457. return this;
  21458. } else {
  21459. return get_set__get(this, 'Month');
  21460. }
  21461. }
  21462. function getDaysInMonth () {
  21463. return daysInMonth(this.year(), this.month());
  21464. }
  21465. var defaultMonthsShortRegex = matchWord;
  21466. function monthsShortRegex (isStrict) {
  21467. if (this._monthsParseExact) {
  21468. if (!hasOwnProp(this, '_monthsRegex')) {
  21469. computeMonthsParse.call(this);
  21470. }
  21471. if (isStrict) {
  21472. return this._monthsShortStrictRegex;
  21473. } else {
  21474. return this._monthsShortRegex;
  21475. }
  21476. } else {
  21477. if (!hasOwnProp(this, '_monthsShortRegex')) {
  21478. this._monthsShortRegex = defaultMonthsShortRegex;
  21479. }
  21480. return this._monthsShortStrictRegex && isStrict ?
  21481. this._monthsShortStrictRegex : this._monthsShortRegex;
  21482. }
  21483. }
  21484. var defaultMonthsRegex = matchWord;
  21485. function monthsRegex (isStrict) {
  21486. if (this._monthsParseExact) {
  21487. if (!hasOwnProp(this, '_monthsRegex')) {
  21488. computeMonthsParse.call(this);
  21489. }
  21490. if (isStrict) {
  21491. return this._monthsStrictRegex;
  21492. } else {
  21493. return this._monthsRegex;
  21494. }
  21495. } else {
  21496. if (!hasOwnProp(this, '_monthsRegex')) {
  21497. this._monthsRegex = defaultMonthsRegex;
  21498. }
  21499. return this._monthsStrictRegex && isStrict ?
  21500. this._monthsStrictRegex : this._monthsRegex;
  21501. }
  21502. }
  21503. function computeMonthsParse () {
  21504. function cmpLenRev(a, b) {
  21505. return b.length - a.length;
  21506. }
  21507. var shortPieces = [], longPieces = [], mixedPieces = [],
  21508. i, mom;
  21509. for (i = 0; i < 12; i++) {
  21510. // make the regex if we don't have it already
  21511. mom = create_utc__createUTC([2000, i]);
  21512. shortPieces.push(this.monthsShort(mom, ''));
  21513. longPieces.push(this.months(mom, ''));
  21514. mixedPieces.push(this.months(mom, ''));
  21515. mixedPieces.push(this.monthsShort(mom, ''));
  21516. }
  21517. // Sorting makes sure if one month (or abbr) is a prefix of another it
  21518. // will match the longer piece.
  21519. shortPieces.sort(cmpLenRev);
  21520. longPieces.sort(cmpLenRev);
  21521. mixedPieces.sort(cmpLenRev);
  21522. for (i = 0; i < 12; i++) {
  21523. shortPieces[i] = regexEscape(shortPieces[i]);
  21524. longPieces[i] = regexEscape(longPieces[i]);
  21525. }
  21526. for (i = 0; i < 24; i++) {
  21527. mixedPieces[i] = regexEscape(mixedPieces[i]);
  21528. }
  21529. this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  21530. this._monthsShortRegex = this._monthsRegex;
  21531. this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  21532. this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  21533. }
  21534. // FORMATTING
  21535. addFormatToken('Y', 0, 0, function () {
  21536. var y = this.year();
  21537. return y <= 9999 ? '' + y : '+' + y;
  21538. });
  21539. addFormatToken(0, ['YY', 2], 0, function () {
  21540. return this.year() % 100;
  21541. });
  21542. addFormatToken(0, ['YYYY', 4], 0, 'year');
  21543. addFormatToken(0, ['YYYYY', 5], 0, 'year');
  21544. addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  21545. // ALIASES
  21546. addUnitAlias('year', 'y');
  21547. // PRIORITIES
  21548. addUnitPriority('year', 1);
  21549. // PARSING
  21550. addRegexToken('Y', matchSigned);
  21551. addRegexToken('YY', match1to2, match2);
  21552. addRegexToken('YYYY', match1to4, match4);
  21553. addRegexToken('YYYYY', match1to6, match6);
  21554. addRegexToken('YYYYYY', match1to6, match6);
  21555. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  21556. addParseToken('YYYY', function (input, array) {
  21557. array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input);
  21558. });
  21559. addParseToken('YY', function (input, array) {
  21560. array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input);
  21561. });
  21562. addParseToken('Y', function (input, array) {
  21563. array[YEAR] = parseInt(input, 10);
  21564. });
  21565. // HELPERS
  21566. function daysInYear(year) {
  21567. return isLeapYear(year) ? 366 : 365;
  21568. }
  21569. function isLeapYear(year) {
  21570. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  21571. }
  21572. // HOOKS
  21573. utils_hooks__hooks.parseTwoDigitYear = function (input) {
  21574. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  21575. };
  21576. // MOMENTS
  21577. var getSetYear = makeGetSet('FullYear', true);
  21578. function getIsLeapYear () {
  21579. return isLeapYear(this.year());
  21580. }
  21581. function createDate (y, m, d, h, M, s, ms) {
  21582. //can't just apply() to create a date:
  21583. //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
  21584. var date = new Date(y, m, d, h, M, s, ms);
  21585. //the date constructor remaps years 0-99 to 1900-1999
  21586. if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
  21587. date.setFullYear(y);
  21588. }
  21589. return date;
  21590. }
  21591. function createUTCDate (y) {
  21592. var date = new Date(Date.UTC.apply(null, arguments));
  21593. //the Date.UTC function remaps years 0-99 to 1900-1999
  21594. if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
  21595. date.setUTCFullYear(y);
  21596. }
  21597. return date;
  21598. }
  21599. // start-of-first-week - start-of-year
  21600. function firstWeekOffset(year, dow, doy) {
  21601. var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  21602. fwd = 7 + dow - doy,
  21603. // first-week day local weekday -- which local weekday is fwd
  21604. fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  21605. return -fwdlw + fwd - 1;
  21606. }
  21607. //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  21608. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  21609. var localWeekday = (7 + weekday - dow) % 7,
  21610. weekOffset = firstWeekOffset(year, dow, doy),
  21611. dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
  21612. resYear, resDayOfYear;
  21613. if (dayOfYear <= 0) {
  21614. resYear = year - 1;
  21615. resDayOfYear = daysInYear(resYear) + dayOfYear;
  21616. } else if (dayOfYear > daysInYear(year)) {
  21617. resYear = year + 1;
  21618. resDayOfYear = dayOfYear - daysInYear(year);
  21619. } else {
  21620. resYear = year;
  21621. resDayOfYear = dayOfYear;
  21622. }
  21623. return {
  21624. year: resYear,
  21625. dayOfYear: resDayOfYear
  21626. };
  21627. }
  21628. function weekOfYear(mom, dow, doy) {
  21629. var weekOffset = firstWeekOffset(mom.year(), dow, doy),
  21630. week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
  21631. resWeek, resYear;
  21632. if (week < 1) {
  21633. resYear = mom.year() - 1;
  21634. resWeek = week + weeksInYear(resYear, dow, doy);
  21635. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  21636. resWeek = week - weeksInYear(mom.year(), dow, doy);
  21637. resYear = mom.year() + 1;
  21638. } else {
  21639. resYear = mom.year();
  21640. resWeek = week;
  21641. }
  21642. return {
  21643. week: resWeek,
  21644. year: resYear
  21645. };
  21646. }
  21647. function weeksInYear(year, dow, doy) {
  21648. var weekOffset = firstWeekOffset(year, dow, doy),
  21649. weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  21650. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  21651. }
  21652. // FORMATTING
  21653. addFormatToken('w', ['ww', 2], 'wo', 'week');
  21654. addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  21655. // ALIASES
  21656. addUnitAlias('week', 'w');
  21657. addUnitAlias('isoWeek', 'W');
  21658. // PRIORITIES
  21659. addUnitPriority('week', 5);
  21660. addUnitPriority('isoWeek', 5);
  21661. // PARSING
  21662. addRegexToken('w', match1to2);
  21663. addRegexToken('ww', match1to2, match2);
  21664. addRegexToken('W', match1to2);
  21665. addRegexToken('WW', match1to2, match2);
  21666. addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
  21667. week[token.substr(0, 1)] = toInt(input);
  21668. });
  21669. // HELPERS
  21670. // LOCALES
  21671. function localeWeek (mom) {
  21672. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  21673. }
  21674. var defaultLocaleWeek = {
  21675. dow : 0, // Sunday is the first day of the week.
  21676. doy : 6 // The week that contains Jan 1st is the first week of the year.
  21677. };
  21678. function localeFirstDayOfWeek () {
  21679. return this._week.dow;
  21680. }
  21681. function localeFirstDayOfYear () {
  21682. return this._week.doy;
  21683. }
  21684. // MOMENTS
  21685. function getSetWeek (input) {
  21686. var week = this.localeData().week(this);
  21687. return input == null ? week : this.add((input - week) * 7, 'd');
  21688. }
  21689. function getSetISOWeek (input) {
  21690. var week = weekOfYear(this, 1, 4).week;
  21691. return input == null ? week : this.add((input - week) * 7, 'd');
  21692. }
  21693. // FORMATTING
  21694. addFormatToken('d', 0, 'do', 'day');
  21695. addFormatToken('dd', 0, 0, function (format) {
  21696. return this.localeData().weekdaysMin(this, format);
  21697. });
  21698. addFormatToken('ddd', 0, 0, function (format) {
  21699. return this.localeData().weekdaysShort(this, format);
  21700. });
  21701. addFormatToken('dddd', 0, 0, function (format) {
  21702. return this.localeData().weekdays(this, format);
  21703. });
  21704. addFormatToken('e', 0, 0, 'weekday');
  21705. addFormatToken('E', 0, 0, 'isoWeekday');
  21706. // ALIASES
  21707. addUnitAlias('day', 'd');
  21708. addUnitAlias('weekday', 'e');
  21709. addUnitAlias('isoWeekday', 'E');
  21710. // PRIORITY
  21711. addUnitPriority('day', 11);
  21712. addUnitPriority('weekday', 11);
  21713. addUnitPriority('isoWeekday', 11);
  21714. // PARSING
  21715. addRegexToken('d', match1to2);
  21716. addRegexToken('e', match1to2);
  21717. addRegexToken('E', match1to2);
  21718. addRegexToken('dd', function (isStrict, locale) {
  21719. return locale.weekdaysMinRegex(isStrict);
  21720. });
  21721. addRegexToken('ddd', function (isStrict, locale) {
  21722. return locale.weekdaysShortRegex(isStrict);
  21723. });
  21724. addRegexToken('dddd', function (isStrict, locale) {
  21725. return locale.weekdaysRegex(isStrict);
  21726. });
  21727. addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
  21728. var weekday = config._locale.weekdaysParse(input, token, config._strict);
  21729. // if we didn't get a weekday name, mark the date as invalid
  21730. if (weekday != null) {
  21731. week.d = weekday;
  21732. } else {
  21733. getParsingFlags(config).invalidWeekday = input;
  21734. }
  21735. });
  21736. addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
  21737. week[token] = toInt(input);
  21738. });
  21739. // HELPERS
  21740. function parseWeekday(input, locale) {
  21741. if (typeof input !== 'string') {
  21742. return input;
  21743. }
  21744. if (!isNaN(input)) {
  21745. return parseInt(input, 10);
  21746. }
  21747. input = locale.weekdaysParse(input);
  21748. if (typeof input === 'number') {
  21749. return input;
  21750. }
  21751. return null;
  21752. }
  21753. function parseIsoWeekday(input, locale) {
  21754. if (typeof input === 'string') {
  21755. return locale.weekdaysParse(input) % 7 || 7;
  21756. }
  21757. return isNaN(input) ? null : input;
  21758. }
  21759. // LOCALES
  21760. var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
  21761. function localeWeekdays (m, format) {
  21762. return isArray(this._weekdays) ? this._weekdays[m.day()] :
  21763. this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
  21764. }
  21765. var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
  21766. function localeWeekdaysShort (m) {
  21767. return this._weekdaysShort[m.day()];
  21768. }
  21769. var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
  21770. function localeWeekdaysMin (m) {
  21771. return this._weekdaysMin[m.day()];
  21772. }
  21773. function day_of_week__handleStrictParse(weekdayName, format, strict) {
  21774. var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
  21775. if (!this._weekdaysParse) {
  21776. this._weekdaysParse = [];
  21777. this._shortWeekdaysParse = [];
  21778. this._minWeekdaysParse = [];
  21779. for (i = 0; i < 7; ++i) {
  21780. mom = create_utc__createUTC([2000, 1]).day(i);
  21781. this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
  21782. this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
  21783. this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
  21784. }
  21785. }
  21786. if (strict) {
  21787. if (format === 'dddd') {
  21788. ii = indexOf.call(this._weekdaysParse, llc);
  21789. return ii !== -1 ? ii : null;
  21790. } else if (format === 'ddd') {
  21791. ii = indexOf.call(this._shortWeekdaysParse, llc);
  21792. return ii !== -1 ? ii : null;
  21793. } else {
  21794. ii = indexOf.call(this._minWeekdaysParse, llc);
  21795. return ii !== -1 ? ii : null;
  21796. }
  21797. } else {
  21798. if (format === 'dddd') {
  21799. ii = indexOf.call(this._weekdaysParse, llc);
  21800. if (ii !== -1) {
  21801. return ii;
  21802. }
  21803. ii = indexOf.call(this._shortWeekdaysParse, llc);
  21804. if (ii !== -1) {
  21805. return ii;
  21806. }
  21807. ii = indexOf.call(this._minWeekdaysParse, llc);
  21808. return ii !== -1 ? ii : null;
  21809. } else if (format === 'ddd') {
  21810. ii = indexOf.call(this._shortWeekdaysParse, llc);
  21811. if (ii !== -1) {
  21812. return ii;
  21813. }
  21814. ii = indexOf.call(this._weekdaysParse, llc);
  21815. if (ii !== -1) {
  21816. return ii;
  21817. }
  21818. ii = indexOf.call(this._minWeekdaysParse, llc);
  21819. return ii !== -1 ? ii : null;
  21820. } else {
  21821. ii = indexOf.call(this._minWeekdaysParse, llc);
  21822. if (ii !== -1) {
  21823. return ii;
  21824. }
  21825. ii = indexOf.call(this._weekdaysParse, llc);
  21826. if (ii !== -1) {
  21827. return ii;
  21828. }
  21829. ii = indexOf.call(this._shortWeekdaysParse, llc);
  21830. return ii !== -1 ? ii : null;
  21831. }
  21832. }
  21833. }
  21834. function localeWeekdaysParse (weekdayName, format, strict) {
  21835. var i, mom, regex;
  21836. if (this._weekdaysParseExact) {
  21837. return day_of_week__handleStrictParse.call(this, weekdayName, format, strict);
  21838. }
  21839. if (!this._weekdaysParse) {
  21840. this._weekdaysParse = [];
  21841. this._minWeekdaysParse = [];
  21842. this._shortWeekdaysParse = [];
  21843. this._fullWeekdaysParse = [];
  21844. }
  21845. for (i = 0; i < 7; i++) {
  21846. // make the regex if we don't have it already
  21847. mom = create_utc__createUTC([2000, 1]).day(i);
  21848. if (strict && !this._fullWeekdaysParse[i]) {
  21849. this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
  21850. this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
  21851. this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
  21852. }
  21853. if (!this._weekdaysParse[i]) {
  21854. regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
  21855. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  21856. }
  21857. // test the regex
  21858. if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
  21859. return i;
  21860. } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
  21861. return i;
  21862. } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
  21863. return i;
  21864. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  21865. return i;
  21866. }
  21867. }
  21868. }
  21869. // MOMENTS
  21870. function getSetDayOfWeek (input) {
  21871. if (!this.isValid()) {
  21872. return input != null ? this : NaN;
  21873. }
  21874. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  21875. if (input != null) {
  21876. input = parseWeekday(input, this.localeData());
  21877. return this.add(input - day, 'd');
  21878. } else {
  21879. return day;
  21880. }
  21881. }
  21882. function getSetLocaleDayOfWeek (input) {
  21883. if (!this.isValid()) {
  21884. return input != null ? this : NaN;
  21885. }
  21886. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  21887. return input == null ? weekday : this.add(input - weekday, 'd');
  21888. }
  21889. function getSetISODayOfWeek (input) {
  21890. if (!this.isValid()) {
  21891. return input != null ? this : NaN;
  21892. }
  21893. // behaves the same as moment#day except
  21894. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  21895. // as a setter, sunday should belong to the previous week.
  21896. if (input != null) {
  21897. var weekday = parseIsoWeekday(input, this.localeData());
  21898. return this.day(this.day() % 7 ? weekday : weekday - 7);
  21899. } else {
  21900. return this.day() || 7;
  21901. }
  21902. }
  21903. var defaultWeekdaysRegex = matchWord;
  21904. function weekdaysRegex (isStrict) {
  21905. if (this._weekdaysParseExact) {
  21906. if (!hasOwnProp(this, '_weekdaysRegex')) {
  21907. computeWeekdaysParse.call(this);
  21908. }
  21909. if (isStrict) {
  21910. return this._weekdaysStrictRegex;
  21911. } else {
  21912. return this._weekdaysRegex;
  21913. }
  21914. } else {
  21915. if (!hasOwnProp(this, '_weekdaysRegex')) {
  21916. this._weekdaysRegex = defaultWeekdaysRegex;
  21917. }
  21918. return this._weekdaysStrictRegex && isStrict ?
  21919. this._weekdaysStrictRegex : this._weekdaysRegex;
  21920. }
  21921. }
  21922. var defaultWeekdaysShortRegex = matchWord;
  21923. function weekdaysShortRegex (isStrict) {
  21924. if (this._weekdaysParseExact) {
  21925. if (!hasOwnProp(this, '_weekdaysRegex')) {
  21926. computeWeekdaysParse.call(this);
  21927. }
  21928. if (isStrict) {
  21929. return this._weekdaysShortStrictRegex;
  21930. } else {
  21931. return this._weekdaysShortRegex;
  21932. }
  21933. } else {
  21934. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  21935. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  21936. }
  21937. return this._weekdaysShortStrictRegex && isStrict ?
  21938. this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
  21939. }
  21940. }
  21941. var defaultWeekdaysMinRegex = matchWord;
  21942. function weekdaysMinRegex (isStrict) {
  21943. if (this._weekdaysParseExact) {
  21944. if (!hasOwnProp(this, '_weekdaysRegex')) {
  21945. computeWeekdaysParse.call(this);
  21946. }
  21947. if (isStrict) {
  21948. return this._weekdaysMinStrictRegex;
  21949. } else {
  21950. return this._weekdaysMinRegex;
  21951. }
  21952. } else {
  21953. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  21954. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  21955. }
  21956. return this._weekdaysMinStrictRegex && isStrict ?
  21957. this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
  21958. }
  21959. }
  21960. function computeWeekdaysParse () {
  21961. function cmpLenRev(a, b) {
  21962. return b.length - a.length;
  21963. }
  21964. var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
  21965. i, mom, minp, shortp, longp;
  21966. for (i = 0; i < 7; i++) {
  21967. // make the regex if we don't have it already
  21968. mom = create_utc__createUTC([2000, 1]).day(i);
  21969. minp = this.weekdaysMin(mom, '');
  21970. shortp = this.weekdaysShort(mom, '');
  21971. longp = this.weekdays(mom, '');
  21972. minPieces.push(minp);
  21973. shortPieces.push(shortp);
  21974. longPieces.push(longp);
  21975. mixedPieces.push(minp);
  21976. mixedPieces.push(shortp);
  21977. mixedPieces.push(longp);
  21978. }
  21979. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  21980. // will match the longer piece.
  21981. minPieces.sort(cmpLenRev);
  21982. shortPieces.sort(cmpLenRev);
  21983. longPieces.sort(cmpLenRev);
  21984. mixedPieces.sort(cmpLenRev);
  21985. for (i = 0; i < 7; i++) {
  21986. shortPieces[i] = regexEscape(shortPieces[i]);
  21987. longPieces[i] = regexEscape(longPieces[i]);
  21988. mixedPieces[i] = regexEscape(mixedPieces[i]);
  21989. }
  21990. this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  21991. this._weekdaysShortRegex = this._weekdaysRegex;
  21992. this._weekdaysMinRegex = this._weekdaysRegex;
  21993. this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  21994. this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  21995. this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
  21996. }
  21997. // FORMATTING
  21998. function hFormat() {
  21999. return this.hours() % 12 || 12;
  22000. }
  22001. function kFormat() {
  22002. return this.hours() || 24;
  22003. }
  22004. addFormatToken('H', ['HH', 2], 0, 'hour');
  22005. addFormatToken('h', ['hh', 2], 0, hFormat);
  22006. addFormatToken('k', ['kk', 2], 0, kFormat);
  22007. addFormatToken('hmm', 0, 0, function () {
  22008. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  22009. });
  22010. addFormatToken('hmmss', 0, 0, function () {
  22011. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
  22012. zeroFill(this.seconds(), 2);
  22013. });
  22014. addFormatToken('Hmm', 0, 0, function () {
  22015. return '' + this.hours() + zeroFill(this.minutes(), 2);
  22016. });
  22017. addFormatToken('Hmmss', 0, 0, function () {
  22018. return '' + this.hours() + zeroFill(this.minutes(), 2) +
  22019. zeroFill(this.seconds(), 2);
  22020. });
  22021. function meridiem (token, lowercase) {
  22022. addFormatToken(token, 0, 0, function () {
  22023. return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
  22024. });
  22025. }
  22026. meridiem('a', true);
  22027. meridiem('A', false);
  22028. // ALIASES
  22029. addUnitAlias('hour', 'h');
  22030. // PRIORITY
  22031. addUnitPriority('hour', 13);
  22032. // PARSING
  22033. function matchMeridiem (isStrict, locale) {
  22034. return locale._meridiemParse;
  22035. }
  22036. addRegexToken('a', matchMeridiem);
  22037. addRegexToken('A', matchMeridiem);
  22038. addRegexToken('H', match1to2);
  22039. addRegexToken('h', match1to2);
  22040. addRegexToken('HH', match1to2, match2);
  22041. addRegexToken('hh', match1to2, match2);
  22042. addRegexToken('hmm', match3to4);
  22043. addRegexToken('hmmss', match5to6);
  22044. addRegexToken('Hmm', match3to4);
  22045. addRegexToken('Hmmss', match5to6);
  22046. addParseToken(['H', 'HH'], HOUR);
  22047. addParseToken(['a', 'A'], function (input, array, config) {
  22048. config._isPm = config._locale.isPM(input);
  22049. config._meridiem = input;
  22050. });
  22051. addParseToken(['h', 'hh'], function (input, array, config) {
  22052. array[HOUR] = toInt(input);
  22053. getParsingFlags(config).bigHour = true;
  22054. });
  22055. addParseToken('hmm', function (input, array, config) {
  22056. var pos = input.length - 2;
  22057. array[HOUR] = toInt(input.substr(0, pos));
  22058. array[MINUTE] = toInt(input.substr(pos));
  22059. getParsingFlags(config).bigHour = true;
  22060. });
  22061. addParseToken('hmmss', function (input, array, config) {
  22062. var pos1 = input.length - 4;
  22063. var pos2 = input.length - 2;
  22064. array[HOUR] = toInt(input.substr(0, pos1));
  22065. array[MINUTE] = toInt(input.substr(pos1, 2));
  22066. array[SECOND] = toInt(input.substr(pos2));
  22067. getParsingFlags(config).bigHour = true;
  22068. });
  22069. addParseToken('Hmm', function (input, array, config) {
  22070. var pos = input.length - 2;
  22071. array[HOUR] = toInt(input.substr(0, pos));
  22072. array[MINUTE] = toInt(input.substr(pos));
  22073. });
  22074. addParseToken('Hmmss', function (input, array, config) {
  22075. var pos1 = input.length - 4;
  22076. var pos2 = input.length - 2;
  22077. array[HOUR] = toInt(input.substr(0, pos1));
  22078. array[MINUTE] = toInt(input.substr(pos1, 2));
  22079. array[SECOND] = toInt(input.substr(pos2));
  22080. });
  22081. // LOCALES
  22082. function localeIsPM (input) {
  22083. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  22084. // Using charAt should be more compatible.
  22085. return ((input + '').toLowerCase().charAt(0) === 'p');
  22086. }
  22087. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
  22088. function localeMeridiem (hours, minutes, isLower) {
  22089. if (hours > 11) {
  22090. return isLower ? 'pm' : 'PM';
  22091. } else {
  22092. return isLower ? 'am' : 'AM';
  22093. }
  22094. }
  22095. // MOMENTS
  22096. // Setting the hour should keep the time, because the user explicitly
  22097. // specified which hour he wants. So trying to maintain the same hour (in
  22098. // a new timezone) makes sense. Adding/subtracting hours does not follow
  22099. // this rule.
  22100. var getSetHour = makeGetSet('Hours', true);
  22101. var baseConfig = {
  22102. calendar: defaultCalendar,
  22103. longDateFormat: defaultLongDateFormat,
  22104. invalidDate: defaultInvalidDate,
  22105. ordinal: defaultOrdinal,
  22106. ordinalParse: defaultOrdinalParse,
  22107. relativeTime: defaultRelativeTime,
  22108. months: defaultLocaleMonths,
  22109. monthsShort: defaultLocaleMonthsShort,
  22110. week: defaultLocaleWeek,
  22111. weekdays: defaultLocaleWeekdays,
  22112. weekdaysMin: defaultLocaleWeekdaysMin,
  22113. weekdaysShort: defaultLocaleWeekdaysShort,
  22114. meridiemParse: defaultLocaleMeridiemParse
  22115. };
  22116. // internal storage for locale config files
  22117. var locales = {};
  22118. var globalLocale;
  22119. function normalizeLocale(key) {
  22120. return key ? key.toLowerCase().replace('_', '-') : key;
  22121. }
  22122. // pick the locale from the array
  22123. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  22124. // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
  22125. function chooseLocale(names) {
  22126. var i = 0, j, next, locale, split;
  22127. while (i < names.length) {
  22128. split = normalizeLocale(names[i]).split('-');
  22129. j = split.length;
  22130. next = normalizeLocale(names[i + 1]);
  22131. next = next ? next.split('-') : null;
  22132. while (j > 0) {
  22133. locale = loadLocale(split.slice(0, j).join('-'));
  22134. if (locale) {
  22135. return locale;
  22136. }
  22137. if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
  22138. //the next array item is better than a shallower substring of this one
  22139. break;
  22140. }
  22141. j--;
  22142. }
  22143. i++;
  22144. }
  22145. return null;
  22146. }
  22147. function loadLocale(name) {
  22148. var oldLocale = null;
  22149. // TODO: Find a better way to register and load all the locales in Node
  22150. if (!locales[name] && (typeof module !== 'undefined') &&
  22151. module && module.exports) {
  22152. try {
  22153. oldLocale = globalLocale._abbr;
  22154. require('./locale/' + name);
  22155. // because defineLocale currently also sets the global locale, we
  22156. // want to undo that for lazy loaded locales
  22157. locale_locales__getSetGlobalLocale(oldLocale);
  22158. } catch (e) { }
  22159. }
  22160. return locales[name];
  22161. }
  22162. // This function will load locale and then set the global locale. If
  22163. // no arguments are passed in, it will simply return the current global
  22164. // locale key.
  22165. function locale_locales__getSetGlobalLocale (key, values) {
  22166. var data;
  22167. if (key) {
  22168. if (isUndefined(values)) {
  22169. data = locale_locales__getLocale(key);
  22170. }
  22171. else {
  22172. data = defineLocale(key, values);
  22173. }
  22174. if (data) {
  22175. // moment.duration._locale = moment._locale = data;
  22176. globalLocale = data;
  22177. }
  22178. }
  22179. return globalLocale._abbr;
  22180. }
  22181. function defineLocale (name, config) {
  22182. if (config !== null) {
  22183. var parentConfig = baseConfig;
  22184. config.abbr = name;
  22185. if (locales[name] != null) {
  22186. deprecateSimple('defineLocaleOverride',
  22187. 'use moment.updateLocale(localeName, config) to change ' +
  22188. 'an existing locale. moment.defineLocale(localeName, ' +
  22189. 'config) should only be used for creating a new locale ' +
  22190. 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
  22191. parentConfig = locales[name]._config;
  22192. } else if (config.parentLocale != null) {
  22193. if (locales[config.parentLocale] != null) {
  22194. parentConfig = locales[config.parentLocale]._config;
  22195. } else {
  22196. // treat as if there is no base config
  22197. deprecateSimple('parentLocaleUndefined',
  22198. 'specified parentLocale is not defined yet. See http://momentjs.com/guides/#/warnings/parent-locale/');
  22199. }
  22200. }
  22201. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  22202. // backwards compat for now: also set the locale
  22203. locale_locales__getSetGlobalLocale(name);
  22204. return locales[name];
  22205. } else {
  22206. // useful for testing
  22207. delete locales[name];
  22208. return null;
  22209. }
  22210. }
  22211. function updateLocale(name, config) {
  22212. if (config != null) {
  22213. var locale, parentConfig = baseConfig;
  22214. // MERGE
  22215. if (locales[name] != null) {
  22216. parentConfig = locales[name]._config;
  22217. }
  22218. config = mergeConfigs(parentConfig, config);
  22219. locale = new Locale(config);
  22220. locale.parentLocale = locales[name];
  22221. locales[name] = locale;
  22222. // backwards compat for now: also set the locale
  22223. locale_locales__getSetGlobalLocale(name);
  22224. } else {
  22225. // pass null for config to unupdate, useful for tests
  22226. if (locales[name] != null) {
  22227. if (locales[name].parentLocale != null) {
  22228. locales[name] = locales[name].parentLocale;
  22229. } else if (locales[name] != null) {
  22230. delete locales[name];
  22231. }
  22232. }
  22233. }
  22234. return locales[name];
  22235. }
  22236. // returns locale data
  22237. function locale_locales__getLocale (key) {
  22238. var locale;
  22239. if (key && key._locale && key._locale._abbr) {
  22240. key = key._locale._abbr;
  22241. }
  22242. if (!key) {
  22243. return globalLocale;
  22244. }
  22245. if (!isArray(key)) {
  22246. //short-circuit everything else
  22247. locale = loadLocale(key);
  22248. if (locale) {
  22249. return locale;
  22250. }
  22251. key = [key];
  22252. }
  22253. return chooseLocale(key);
  22254. }
  22255. function locale_locales__listLocales() {
  22256. return keys(locales);
  22257. }
  22258. function checkOverflow (m) {
  22259. var overflow;
  22260. var a = m._a;
  22261. if (a && getParsingFlags(m).overflow === -2) {
  22262. overflow =
  22263. a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
  22264. a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
  22265. a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
  22266. a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
  22267. a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
  22268. a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
  22269. -1;
  22270. if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
  22271. overflow = DATE;
  22272. }
  22273. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  22274. overflow = WEEK;
  22275. }
  22276. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  22277. overflow = WEEKDAY;
  22278. }
  22279. getParsingFlags(m).overflow = overflow;
  22280. }
  22281. return m;
  22282. }
  22283. // iso 8601 regex
  22284. // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
  22285. var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/;
  22286. var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/;
  22287. var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
  22288. var isoDates = [
  22289. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  22290. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  22291. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  22292. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  22293. ['YYYY-DDD', /\d{4}-\d{3}/],
  22294. ['YYYY-MM', /\d{4}-\d\d/, false],
  22295. ['YYYYYYMMDD', /[+-]\d{10}/],
  22296. ['YYYYMMDD', /\d{8}/],
  22297. // YYYYMM is NOT allowed by the standard
  22298. ['GGGG[W]WWE', /\d{4}W\d{3}/],
  22299. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  22300. ['YYYYDDD', /\d{7}/]
  22301. ];
  22302. // iso time formats and regexes
  22303. var isoTimes = [
  22304. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  22305. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  22306. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  22307. ['HH:mm', /\d\d:\d\d/],
  22308. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  22309. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  22310. ['HHmmss', /\d\d\d\d\d\d/],
  22311. ['HHmm', /\d\d\d\d/],
  22312. ['HH', /\d\d/]
  22313. ];
  22314. var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
  22315. // date from iso format
  22316. function configFromISO(config) {
  22317. var i, l,
  22318. string = config._i,
  22319. match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  22320. allowTime, dateFormat, timeFormat, tzFormat;
  22321. if (match) {
  22322. getParsingFlags(config).iso = true;
  22323. for (i = 0, l = isoDates.length; i < l; i++) {
  22324. if (isoDates[i][1].exec(match[1])) {
  22325. dateFormat = isoDates[i][0];
  22326. allowTime = isoDates[i][2] !== false;
  22327. break;
  22328. }
  22329. }
  22330. if (dateFormat == null) {
  22331. config._isValid = false;
  22332. return;
  22333. }
  22334. if (match[3]) {
  22335. for (i = 0, l = isoTimes.length; i < l; i++) {
  22336. if (isoTimes[i][1].exec(match[3])) {
  22337. // match[2] should be 'T' or space
  22338. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  22339. break;
  22340. }
  22341. }
  22342. if (timeFormat == null) {
  22343. config._isValid = false;
  22344. return;
  22345. }
  22346. }
  22347. if (!allowTime && timeFormat != null) {
  22348. config._isValid = false;
  22349. return;
  22350. }
  22351. if (match[4]) {
  22352. if (tzRegex.exec(match[4])) {
  22353. tzFormat = 'Z';
  22354. } else {
  22355. config._isValid = false;
  22356. return;
  22357. }
  22358. }
  22359. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  22360. configFromStringAndFormat(config);
  22361. } else {
  22362. config._isValid = false;
  22363. }
  22364. }
  22365. // date from iso format or fallback
  22366. function configFromString(config) {
  22367. var matched = aspNetJsonRegex.exec(config._i);
  22368. if (matched !== null) {
  22369. config._d = new Date(+matched[1]);
  22370. return;
  22371. }
  22372. configFromISO(config);
  22373. if (config._isValid === false) {
  22374. delete config._isValid;
  22375. utils_hooks__hooks.createFromInputFallback(config);
  22376. }
  22377. }
  22378. utils_hooks__hooks.createFromInputFallback = deprecate(
  22379. 'moment construction falls back to js Date. This is ' +
  22380. 'discouraged and will be removed in upcoming major ' +
  22381. 'release. Please refer to ' +
  22382. 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  22383. function (config) {
  22384. config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  22385. }
  22386. );
  22387. // Pick the first defined of two or three arguments.
  22388. function defaults(a, b, c) {
  22389. if (a != null) {
  22390. return a;
  22391. }
  22392. if (b != null) {
  22393. return b;
  22394. }
  22395. return c;
  22396. }
  22397. function currentDateArray(config) {
  22398. // hooks is actually the exported moment object
  22399. var nowValue = new Date(utils_hooks__hooks.now());
  22400. if (config._useUTC) {
  22401. return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
  22402. }
  22403. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  22404. }
  22405. // convert an array to a date.
  22406. // the array should mirror the parameters below
  22407. // note: all values past the year are optional and will default to the lowest possible value.
  22408. // [year, month, day , hour, minute, second, millisecond]
  22409. function configFromArray (config) {
  22410. var i, date, input = [], currentDate, yearToUse;
  22411. if (config._d) {
  22412. return;
  22413. }
  22414. currentDate = currentDateArray(config);
  22415. //compute day of the year from weeks and weekdays
  22416. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  22417. dayOfYearFromWeekInfo(config);
  22418. }
  22419. //if the day of the year is set, figure out what it is
  22420. if (config._dayOfYear) {
  22421. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  22422. if (config._dayOfYear > daysInYear(yearToUse)) {
  22423. getParsingFlags(config)._overflowDayOfYear = true;
  22424. }
  22425. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  22426. config._a[MONTH] = date.getUTCMonth();
  22427. config._a[DATE] = date.getUTCDate();
  22428. }
  22429. // Default to current date.
  22430. // * if no year, month, day of month are given, default to today
  22431. // * if day of month is given, default month and year
  22432. // * if month is given, default only year
  22433. // * if year is given, don't default anything
  22434. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  22435. config._a[i] = input[i] = currentDate[i];
  22436. }
  22437. // Zero out whatever was not defaulted, including time
  22438. for (; i < 7; i++) {
  22439. config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
  22440. }
  22441. // Check for 24:00:00.000
  22442. if (config._a[HOUR] === 24 &&
  22443. config._a[MINUTE] === 0 &&
  22444. config._a[SECOND] === 0 &&
  22445. config._a[MILLISECOND] === 0) {
  22446. config._nextDay = true;
  22447. config._a[HOUR] = 0;
  22448. }
  22449. config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
  22450. // Apply timezone offset from input. The actual utcOffset can be changed
  22451. // with parseZone.
  22452. if (config._tzm != null) {
  22453. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  22454. }
  22455. if (config._nextDay) {
  22456. config._a[HOUR] = 24;
  22457. }
  22458. }
  22459. function dayOfYearFromWeekInfo(config) {
  22460. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
  22461. w = config._w;
  22462. if (w.GG != null || w.W != null || w.E != null) {
  22463. dow = 1;
  22464. doy = 4;
  22465. // TODO: We need to take the current isoWeekYear, but that depends on
  22466. // how we interpret now (local, utc, fixed offset). So create
  22467. // a now version of current config (take local/utc/offset flags, and
  22468. // create now).
  22469. weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year);
  22470. week = defaults(w.W, 1);
  22471. weekday = defaults(w.E, 1);
  22472. if (weekday < 1 || weekday > 7) {
  22473. weekdayOverflow = true;
  22474. }
  22475. } else {
  22476. dow = config._locale._week.dow;
  22477. doy = config._locale._week.doy;
  22478. weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year);
  22479. week = defaults(w.w, 1);
  22480. if (w.d != null) {
  22481. // weekday -- low day numbers are considered next week
  22482. weekday = w.d;
  22483. if (weekday < 0 || weekday > 6) {
  22484. weekdayOverflow = true;
  22485. }
  22486. } else if (w.e != null) {
  22487. // local weekday -- counting starts from begining of week
  22488. weekday = w.e + dow;
  22489. if (w.e < 0 || w.e > 6) {
  22490. weekdayOverflow = true;
  22491. }
  22492. } else {
  22493. // default to begining of week
  22494. weekday = dow;
  22495. }
  22496. }
  22497. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  22498. getParsingFlags(config)._overflowWeeks = true;
  22499. } else if (weekdayOverflow != null) {
  22500. getParsingFlags(config)._overflowWeekday = true;
  22501. } else {
  22502. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  22503. config._a[YEAR] = temp.year;
  22504. config._dayOfYear = temp.dayOfYear;
  22505. }
  22506. }
  22507. // constant that refers to the ISO standard
  22508. utils_hooks__hooks.ISO_8601 = function () {};
  22509. // date from string and format string
  22510. function configFromStringAndFormat(config) {
  22511. // TODO: Move this to another part of the creation flow to prevent circular deps
  22512. if (config._f === utils_hooks__hooks.ISO_8601) {
  22513. configFromISO(config);
  22514. return;
  22515. }
  22516. config._a = [];
  22517. getParsingFlags(config).empty = true;
  22518. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  22519. var string = '' + config._i,
  22520. i, parsedInput, tokens, token, skipped,
  22521. stringLength = string.length,
  22522. totalParsedInputLength = 0;
  22523. tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
  22524. for (i = 0; i < tokens.length; i++) {
  22525. token = tokens[i];
  22526. parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
  22527. // console.log('token', token, 'parsedInput', parsedInput,
  22528. // 'regex', getParseRegexForToken(token, config));
  22529. if (parsedInput) {
  22530. skipped = string.substr(0, string.indexOf(parsedInput));
  22531. if (skipped.length > 0) {
  22532. getParsingFlags(config).unusedInput.push(skipped);
  22533. }
  22534. string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
  22535. totalParsedInputLength += parsedInput.length;
  22536. }
  22537. // don't parse if it's not a known token
  22538. if (formatTokenFunctions[token]) {
  22539. if (parsedInput) {
  22540. getParsingFlags(config).empty = false;
  22541. }
  22542. else {
  22543. getParsingFlags(config).unusedTokens.push(token);
  22544. }
  22545. addTimeToArrayFromToken(token, parsedInput, config);
  22546. }
  22547. else if (config._strict && !parsedInput) {
  22548. getParsingFlags(config).unusedTokens.push(token);
  22549. }
  22550. }
  22551. // add remaining unparsed input length to the string
  22552. getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
  22553. if (string.length > 0) {
  22554. getParsingFlags(config).unusedInput.push(string);
  22555. }
  22556. // clear _12h flag if hour is <= 12
  22557. if (config._a[HOUR] <= 12 &&
  22558. getParsingFlags(config).bigHour === true &&
  22559. config._a[HOUR] > 0) {
  22560. getParsingFlags(config).bigHour = undefined;
  22561. }
  22562. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  22563. getParsingFlags(config).meridiem = config._meridiem;
  22564. // handle meridiem
  22565. config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
  22566. configFromArray(config);
  22567. checkOverflow(config);
  22568. }
  22569. function meridiemFixWrap (locale, hour, meridiem) {
  22570. var isPm;
  22571. if (meridiem == null) {
  22572. // nothing to do
  22573. return hour;
  22574. }
  22575. if (locale.meridiemHour != null) {
  22576. return locale.meridiemHour(hour, meridiem);
  22577. } else if (locale.isPM != null) {
  22578. // Fallback
  22579. isPm = locale.isPM(meridiem);
  22580. if (isPm && hour < 12) {
  22581. hour += 12;
  22582. }
  22583. if (!isPm && hour === 12) {
  22584. hour = 0;
  22585. }
  22586. return hour;
  22587. } else {
  22588. // this is not supposed to happen
  22589. return hour;
  22590. }
  22591. }
  22592. // date from string and array of format strings
  22593. function configFromStringAndArray(config) {
  22594. var tempConfig,
  22595. bestMoment,
  22596. scoreToBeat,
  22597. i,
  22598. currentScore;
  22599. if (config._f.length === 0) {
  22600. getParsingFlags(config).invalidFormat = true;
  22601. config._d = new Date(NaN);
  22602. return;
  22603. }
  22604. for (i = 0; i < config._f.length; i++) {
  22605. currentScore = 0;
  22606. tempConfig = copyConfig({}, config);
  22607. if (config._useUTC != null) {
  22608. tempConfig._useUTC = config._useUTC;
  22609. }
  22610. tempConfig._f = config._f[i];
  22611. configFromStringAndFormat(tempConfig);
  22612. if (!valid__isValid(tempConfig)) {
  22613. continue;
  22614. }
  22615. // if there is any input that was not parsed add a penalty for that format
  22616. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  22617. //or tokens
  22618. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  22619. getParsingFlags(tempConfig).score = currentScore;
  22620. if (scoreToBeat == null || currentScore < scoreToBeat) {
  22621. scoreToBeat = currentScore;
  22622. bestMoment = tempConfig;
  22623. }
  22624. }
  22625. extend(config, bestMoment || tempConfig);
  22626. }
  22627. function configFromObject(config) {
  22628. if (config._d) {
  22629. return;
  22630. }
  22631. var i = normalizeObjectUnits(config._i);
  22632. config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
  22633. return obj && parseInt(obj, 10);
  22634. });
  22635. configFromArray(config);
  22636. }
  22637. function createFromConfig (config) {
  22638. var res = new Moment(checkOverflow(prepareConfig(config)));
  22639. if (res._nextDay) {
  22640. // Adding is smart enough around DST
  22641. res.add(1, 'd');
  22642. res._nextDay = undefined;
  22643. }
  22644. return res;
  22645. }
  22646. function prepareConfig (config) {
  22647. var input = config._i,
  22648. format = config._f;
  22649. config._locale = config._locale || locale_locales__getLocale(config._l);
  22650. if (input === null || (format === undefined && input === '')) {
  22651. return valid__createInvalid({nullInput: true});
  22652. }
  22653. if (typeof input === 'string') {
  22654. config._i = input = config._locale.preparse(input);
  22655. }
  22656. if (isMoment(input)) {
  22657. return new Moment(checkOverflow(input));
  22658. } else if (isArray(format)) {
  22659. configFromStringAndArray(config);
  22660. } else if (isDate(input)) {
  22661. config._d = input;
  22662. } else if (format) {
  22663. configFromStringAndFormat(config);
  22664. } else {
  22665. configFromInput(config);
  22666. }
  22667. if (!valid__isValid(config)) {
  22668. config._d = null;
  22669. }
  22670. return config;
  22671. }
  22672. function configFromInput(config) {
  22673. var input = config._i;
  22674. if (input === undefined) {
  22675. config._d = new Date(utils_hooks__hooks.now());
  22676. } else if (isDate(input)) {
  22677. config._d = new Date(input.valueOf());
  22678. } else if (typeof input === 'string') {
  22679. configFromString(config);
  22680. } else if (isArray(input)) {
  22681. config._a = map(input.slice(0), function (obj) {
  22682. return parseInt(obj, 10);
  22683. });
  22684. configFromArray(config);
  22685. } else if (typeof(input) === 'object') {
  22686. configFromObject(config);
  22687. } else if (typeof(input) === 'number') {
  22688. // from milliseconds
  22689. config._d = new Date(input);
  22690. } else {
  22691. utils_hooks__hooks.createFromInputFallback(config);
  22692. }
  22693. }
  22694. function createLocalOrUTC (input, format, locale, strict, isUTC) {
  22695. var c = {};
  22696. if (typeof(locale) === 'boolean') {
  22697. strict = locale;
  22698. locale = undefined;
  22699. }
  22700. if ((isObject(input) && isObjectEmpty(input)) ||
  22701. (isArray(input) && input.length === 0)) {
  22702. input = undefined;
  22703. }
  22704. // object construction must be done this way.
  22705. // https://github.com/moment/moment/issues/1423
  22706. c._isAMomentObject = true;
  22707. c._useUTC = c._isUTC = isUTC;
  22708. c._l = locale;
  22709. c._i = input;
  22710. c._f = format;
  22711. c._strict = strict;
  22712. return createFromConfig(c);
  22713. }
  22714. function local__createLocal (input, format, locale, strict) {
  22715. return createLocalOrUTC(input, format, locale, strict, false);
  22716. }
  22717. var prototypeMin = deprecate(
  22718. 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
  22719. function () {
  22720. var other = local__createLocal.apply(null, arguments);
  22721. if (this.isValid() && other.isValid()) {
  22722. return other < this ? this : other;
  22723. } else {
  22724. return valid__createInvalid();
  22725. }
  22726. }
  22727. );
  22728. var prototypeMax = deprecate(
  22729. 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
  22730. function () {
  22731. var other = local__createLocal.apply(null, arguments);
  22732. if (this.isValid() && other.isValid()) {
  22733. return other > this ? this : other;
  22734. } else {
  22735. return valid__createInvalid();
  22736. }
  22737. }
  22738. );
  22739. // Pick a moment m from moments so that m[fn](other) is true for all
  22740. // other. This relies on the function fn to be transitive.
  22741. //
  22742. // moments should either be an array of moment objects or an array, whose
  22743. // first element is an array of moment objects.
  22744. function pickBy(fn, moments) {
  22745. var res, i;
  22746. if (moments.length === 1 && isArray(moments[0])) {
  22747. moments = moments[0];
  22748. }
  22749. if (!moments.length) {
  22750. return local__createLocal();
  22751. }
  22752. res = moments[0];
  22753. for (i = 1; i < moments.length; ++i) {
  22754. if (!moments[i].isValid() || moments[i][fn](res)) {
  22755. res = moments[i];
  22756. }
  22757. }
  22758. return res;
  22759. }
  22760. // TODO: Use [].sort instead?
  22761. function min () {
  22762. var args = [].slice.call(arguments, 0);
  22763. return pickBy('isBefore', args);
  22764. }
  22765. function max () {
  22766. var args = [].slice.call(arguments, 0);
  22767. return pickBy('isAfter', args);
  22768. }
  22769. var now = function () {
  22770. return Date.now ? Date.now() : +(new Date());
  22771. };
  22772. function Duration (duration) {
  22773. var normalizedInput = normalizeObjectUnits(duration),
  22774. years = normalizedInput.year || 0,
  22775. quarters = normalizedInput.quarter || 0,
  22776. months = normalizedInput.month || 0,
  22777. weeks = normalizedInput.week || 0,
  22778. days = normalizedInput.day || 0,
  22779. hours = normalizedInput.hour || 0,
  22780. minutes = normalizedInput.minute || 0,
  22781. seconds = normalizedInput.second || 0,
  22782. milliseconds = normalizedInput.millisecond || 0;
  22783. // representation for dateAddRemove
  22784. this._milliseconds = +milliseconds +
  22785. seconds * 1e3 + // 1000
  22786. minutes * 6e4 + // 1000 * 60
  22787. hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  22788. // Because of dateAddRemove treats 24 hours as different from a
  22789. // day when working around DST, we need to store them separately
  22790. this._days = +days +
  22791. weeks * 7;
  22792. // It is impossible translate months into days without knowing
  22793. // which months you are are talking about, so we have to store
  22794. // it separately.
  22795. this._months = +months +
  22796. quarters * 3 +
  22797. years * 12;
  22798. this._data = {};
  22799. this._locale = locale_locales__getLocale();
  22800. this._bubble();
  22801. }
  22802. function isDuration (obj) {
  22803. return obj instanceof Duration;
  22804. }
  22805. // FORMATTING
  22806. function offset (token, separator) {
  22807. addFormatToken(token, 0, 0, function () {
  22808. var offset = this.utcOffset();
  22809. var sign = '+';
  22810. if (offset < 0) {
  22811. offset = -offset;
  22812. sign = '-';
  22813. }
  22814. return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
  22815. });
  22816. }
  22817. offset('Z', ':');
  22818. offset('ZZ', '');
  22819. // PARSING
  22820. addRegexToken('Z', matchShortOffset);
  22821. addRegexToken('ZZ', matchShortOffset);
  22822. addParseToken(['Z', 'ZZ'], function (input, array, config) {
  22823. config._useUTC = true;
  22824. config._tzm = offsetFromString(matchShortOffset, input);
  22825. });
  22826. // HELPERS
  22827. // timezone chunker
  22828. // '+10:00' > ['10', '00']
  22829. // '-1530' > ['-15', '30']
  22830. var chunkOffset = /([\+\-]|\d\d)/gi;
  22831. function offsetFromString(matcher, string) {
  22832. var matches = ((string || '').match(matcher) || []);
  22833. var chunk = matches[matches.length - 1] || [];
  22834. var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
  22835. var minutes = +(parts[1] * 60) + toInt(parts[2]);
  22836. return parts[0] === '+' ? minutes : -minutes;
  22837. }
  22838. // Return a moment from input, that is local/utc/zone equivalent to model.
  22839. function cloneWithOffset(input, model) {
  22840. var res, diff;
  22841. if (model._isUTC) {
  22842. res = model.clone();
  22843. diff = (isMoment(input) || isDate(input) ? input.valueOf() : local__createLocal(input).valueOf()) - res.valueOf();
  22844. // Use low-level api, because this fn is low-level api.
  22845. res._d.setTime(res._d.valueOf() + diff);
  22846. utils_hooks__hooks.updateOffset(res, false);
  22847. return res;
  22848. } else {
  22849. return local__createLocal(input).local();
  22850. }
  22851. }
  22852. function getDateOffset (m) {
  22853. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  22854. // https://github.com/moment/moment/pull/1871
  22855. return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
  22856. }
  22857. // HOOKS
  22858. // This function will be called whenever a moment is mutated.
  22859. // It is intended to keep the offset in sync with the timezone.
  22860. utils_hooks__hooks.updateOffset = function () {};
  22861. // MOMENTS
  22862. // keepLocalTime = true means only change the timezone, without
  22863. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  22864. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  22865. // +0200, so we adjust the time as needed, to be valid.
  22866. //
  22867. // Keeping the time actually adds/subtracts (one hour)
  22868. // from the actual represented time. That is why we call updateOffset
  22869. // a second time. In case it wants us to change the offset again
  22870. // _changeInProgress == true case, then we have to adjust, because
  22871. // there is no such time in the given timezone.
  22872. function getSetOffset (input, keepLocalTime) {
  22873. var offset = this._offset || 0,
  22874. localAdjust;
  22875. if (!this.isValid()) {
  22876. return input != null ? this : NaN;
  22877. }
  22878. if (input != null) {
  22879. if (typeof input === 'string') {
  22880. input = offsetFromString(matchShortOffset, input);
  22881. } else if (Math.abs(input) < 16) {
  22882. input = input * 60;
  22883. }
  22884. if (!this._isUTC && keepLocalTime) {
  22885. localAdjust = getDateOffset(this);
  22886. }
  22887. this._offset = input;
  22888. this._isUTC = true;
  22889. if (localAdjust != null) {
  22890. this.add(localAdjust, 'm');
  22891. }
  22892. if (offset !== input) {
  22893. if (!keepLocalTime || this._changeInProgress) {
  22894. add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);
  22895. } else if (!this._changeInProgress) {
  22896. this._changeInProgress = true;
  22897. utils_hooks__hooks.updateOffset(this, true);
  22898. this._changeInProgress = null;
  22899. }
  22900. }
  22901. return this;
  22902. } else {
  22903. return this._isUTC ? offset : getDateOffset(this);
  22904. }
  22905. }
  22906. function getSetZone (input, keepLocalTime) {
  22907. if (input != null) {
  22908. if (typeof input !== 'string') {
  22909. input = -input;
  22910. }
  22911. this.utcOffset(input, keepLocalTime);
  22912. return this;
  22913. } else {
  22914. return -this.utcOffset();
  22915. }
  22916. }
  22917. function setOffsetToUTC (keepLocalTime) {
  22918. return this.utcOffset(0, keepLocalTime);
  22919. }
  22920. function setOffsetToLocal (keepLocalTime) {
  22921. if (this._isUTC) {
  22922. this.utcOffset(0, keepLocalTime);
  22923. this._isUTC = false;
  22924. if (keepLocalTime) {
  22925. this.subtract(getDateOffset(this), 'm');
  22926. }
  22927. }
  22928. return this;
  22929. }
  22930. function setOffsetToParsedOffset () {
  22931. if (this._tzm) {
  22932. this.utcOffset(this._tzm);
  22933. } else if (typeof this._i === 'string') {
  22934. this.utcOffset(offsetFromString(matchOffset, this._i));
  22935. }
  22936. return this;
  22937. }
  22938. function hasAlignedHourOffset (input) {
  22939. if (!this.isValid()) {
  22940. return false;
  22941. }
  22942. input = input ? local__createLocal(input).utcOffset() : 0;
  22943. return (this.utcOffset() - input) % 60 === 0;
  22944. }
  22945. function isDaylightSavingTime () {
  22946. return (
  22947. this.utcOffset() > this.clone().month(0).utcOffset() ||
  22948. this.utcOffset() > this.clone().month(5).utcOffset()
  22949. );
  22950. }
  22951. function isDaylightSavingTimeShifted () {
  22952. if (!isUndefined(this._isDSTShifted)) {
  22953. return this._isDSTShifted;
  22954. }
  22955. var c = {};
  22956. copyConfig(c, this);
  22957. c = prepareConfig(c);
  22958. if (c._a) {
  22959. var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a);
  22960. this._isDSTShifted = this.isValid() &&
  22961. compareArrays(c._a, other.toArray()) > 0;
  22962. } else {
  22963. this._isDSTShifted = false;
  22964. }
  22965. return this._isDSTShifted;
  22966. }
  22967. function isLocal () {
  22968. return this.isValid() ? !this._isUTC : false;
  22969. }
  22970. function isUtcOffset () {
  22971. return this.isValid() ? this._isUTC : false;
  22972. }
  22973. function isUtc () {
  22974. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  22975. }
  22976. // ASP.NET json date format regex
  22977. var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/;
  22978. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  22979. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  22980. // and further modified to allow for strings containing both week and day
  22981. var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;
  22982. function create__createDuration (input, key) {
  22983. var duration = input,
  22984. // matching against regexp is expensive, do it on demand
  22985. match = null,
  22986. sign,
  22987. ret,
  22988. diffRes;
  22989. if (isDuration(input)) {
  22990. duration = {
  22991. ms : input._milliseconds,
  22992. d : input._days,
  22993. M : input._months
  22994. };
  22995. } else if (typeof input === 'number') {
  22996. duration = {};
  22997. if (key) {
  22998. duration[key] = input;
  22999. } else {
  23000. duration.milliseconds = input;
  23001. }
  23002. } else if (!!(match = aspNetRegex.exec(input))) {
  23003. sign = (match[1] === '-') ? -1 : 1;
  23004. duration = {
  23005. y : 0,
  23006. d : toInt(match[DATE]) * sign,
  23007. h : toInt(match[HOUR]) * sign,
  23008. m : toInt(match[MINUTE]) * sign,
  23009. s : toInt(match[SECOND]) * sign,
  23010. ms : toInt(match[MILLISECOND]) * sign
  23011. };
  23012. } else if (!!(match = isoRegex.exec(input))) {
  23013. sign = (match[1] === '-') ? -1 : 1;
  23014. duration = {
  23015. y : parseIso(match[2], sign),
  23016. M : parseIso(match[3], sign),
  23017. w : parseIso(match[4], sign),
  23018. d : parseIso(match[5], sign),
  23019. h : parseIso(match[6], sign),
  23020. m : parseIso(match[7], sign),
  23021. s : parseIso(match[8], sign)
  23022. };
  23023. } else if (duration == null) {// checks for null or undefined
  23024. duration = {};
  23025. } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
  23026. diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to));
  23027. duration = {};
  23028. duration.ms = diffRes.milliseconds;
  23029. duration.M = diffRes.months;
  23030. }
  23031. ret = new Duration(duration);
  23032. if (isDuration(input) && hasOwnProp(input, '_locale')) {
  23033. ret._locale = input._locale;
  23034. }
  23035. return ret;
  23036. }
  23037. create__createDuration.fn = Duration.prototype;
  23038. function parseIso (inp, sign) {
  23039. // We'd normally use ~~inp for this, but unfortunately it also
  23040. // converts floats to ints.
  23041. // inp may be undefined, so careful calling replace on it.
  23042. var res = inp && parseFloat(inp.replace(',', '.'));
  23043. // apply sign while we're at it
  23044. return (isNaN(res) ? 0 : res) * sign;
  23045. }
  23046. function positiveMomentsDifference(base, other) {
  23047. var res = {milliseconds: 0, months: 0};
  23048. res.months = other.month() - base.month() +
  23049. (other.year() - base.year()) * 12;
  23050. if (base.clone().add(res.months, 'M').isAfter(other)) {
  23051. --res.months;
  23052. }
  23053. res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
  23054. return res;
  23055. }
  23056. function momentsDifference(base, other) {
  23057. var res;
  23058. if (!(base.isValid() && other.isValid())) {
  23059. return {milliseconds: 0, months: 0};
  23060. }
  23061. other = cloneWithOffset(other, base);
  23062. if (base.isBefore(other)) {
  23063. res = positiveMomentsDifference(base, other);
  23064. } else {
  23065. res = positiveMomentsDifference(other, base);
  23066. res.milliseconds = -res.milliseconds;
  23067. res.months = -res.months;
  23068. }
  23069. return res;
  23070. }
  23071. function absRound (number) {
  23072. if (number < 0) {
  23073. return Math.round(-1 * number) * -1;
  23074. } else {
  23075. return Math.round(number);
  23076. }
  23077. }
  23078. // TODO: remove 'name' arg after deprecation is removed
  23079. function createAdder(direction, name) {
  23080. return function (val, period) {
  23081. var dur, tmp;
  23082. //invert the arguments, but complain about it
  23083. if (period !== null && !isNaN(+period)) {
  23084. deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
  23085. 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
  23086. tmp = val; val = period; period = tmp;
  23087. }
  23088. val = typeof val === 'string' ? +val : val;
  23089. dur = create__createDuration(val, period);
  23090. add_subtract__addSubtract(this, dur, direction);
  23091. return this;
  23092. };
  23093. }
  23094. function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) {
  23095. var milliseconds = duration._milliseconds,
  23096. days = absRound(duration._days),
  23097. months = absRound(duration._months);
  23098. if (!mom.isValid()) {
  23099. // No op
  23100. return;
  23101. }
  23102. updateOffset = updateOffset == null ? true : updateOffset;
  23103. if (milliseconds) {
  23104. mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
  23105. }
  23106. if (days) {
  23107. get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding);
  23108. }
  23109. if (months) {
  23110. setMonth(mom, get_set__get(mom, 'Month') + months * isAdding);
  23111. }
  23112. if (updateOffset) {
  23113. utils_hooks__hooks.updateOffset(mom, days || months);
  23114. }
  23115. }
  23116. var add_subtract__add = createAdder(1, 'add');
  23117. var add_subtract__subtract = createAdder(-1, 'subtract');
  23118. function getCalendarFormat(myMoment, now) {
  23119. var diff = myMoment.diff(now, 'days', true);
  23120. return diff < -6 ? 'sameElse' :
  23121. diff < -1 ? 'lastWeek' :
  23122. diff < 0 ? 'lastDay' :
  23123. diff < 1 ? 'sameDay' :
  23124. diff < 2 ? 'nextDay' :
  23125. diff < 7 ? 'nextWeek' : 'sameElse';
  23126. }
  23127. function moment_calendar__calendar (time, formats) {
  23128. // We want to compare the start of today, vs this.
  23129. // Getting start-of-today depends on whether we're local/utc/offset or not.
  23130. var now = time || local__createLocal(),
  23131. sod = cloneWithOffset(now, this).startOf('day'),
  23132. format = utils_hooks__hooks.calendarFormat(this, sod) || 'sameElse';
  23133. var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
  23134. return this.format(output || this.localeData().calendar(format, this, local__createLocal(now)));
  23135. }
  23136. function clone () {
  23137. return new Moment(this);
  23138. }
  23139. function isAfter (input, units) {
  23140. var localInput = isMoment(input) ? input : local__createLocal(input);
  23141. if (!(this.isValid() && localInput.isValid())) {
  23142. return false;
  23143. }
  23144. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  23145. if (units === 'millisecond') {
  23146. return this.valueOf() > localInput.valueOf();
  23147. } else {
  23148. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  23149. }
  23150. }
  23151. function isBefore (input, units) {
  23152. var localInput = isMoment(input) ? input : local__createLocal(input);
  23153. if (!(this.isValid() && localInput.isValid())) {
  23154. return false;
  23155. }
  23156. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  23157. if (units === 'millisecond') {
  23158. return this.valueOf() < localInput.valueOf();
  23159. } else {
  23160. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  23161. }
  23162. }
  23163. function isBetween (from, to, units, inclusivity) {
  23164. inclusivity = inclusivity || '()';
  23165. return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&
  23166. (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
  23167. }
  23168. function isSame (input, units) {
  23169. var localInput = isMoment(input) ? input : local__createLocal(input),
  23170. inputMs;
  23171. if (!(this.isValid() && localInput.isValid())) {
  23172. return false;
  23173. }
  23174. units = normalizeUnits(units || 'millisecond');
  23175. if (units === 'millisecond') {
  23176. return this.valueOf() === localInput.valueOf();
  23177. } else {
  23178. inputMs = localInput.valueOf();
  23179. return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
  23180. }
  23181. }
  23182. function isSameOrAfter (input, units) {
  23183. return this.isSame(input, units) || this.isAfter(input,units);
  23184. }
  23185. function isSameOrBefore (input, units) {
  23186. return this.isSame(input, units) || this.isBefore(input,units);
  23187. }
  23188. function diff (input, units, asFloat) {
  23189. var that,
  23190. zoneDelta,
  23191. delta, output;
  23192. if (!this.isValid()) {
  23193. return NaN;
  23194. }
  23195. that = cloneWithOffset(input, this);
  23196. if (!that.isValid()) {
  23197. return NaN;
  23198. }
  23199. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  23200. units = normalizeUnits(units);
  23201. if (units === 'year' || units === 'month' || units === 'quarter') {
  23202. output = monthDiff(this, that);
  23203. if (units === 'quarter') {
  23204. output = output / 3;
  23205. } else if (units === 'year') {
  23206. output = output / 12;
  23207. }
  23208. } else {
  23209. delta = this - that;
  23210. output = units === 'second' ? delta / 1e3 : // 1000
  23211. units === 'minute' ? delta / 6e4 : // 1000 * 60
  23212. units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
  23213. units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
  23214. units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
  23215. delta;
  23216. }
  23217. return asFloat ? output : absFloor(output);
  23218. }
  23219. function monthDiff (a, b) {
  23220. // difference in months
  23221. var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
  23222. // b is in (anchor - 1 month, anchor + 1 month)
  23223. anchor = a.clone().add(wholeMonthDiff, 'months'),
  23224. anchor2, adjust;
  23225. if (b - anchor < 0) {
  23226. anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
  23227. // linear across the month
  23228. adjust = (b - anchor) / (anchor - anchor2);
  23229. } else {
  23230. anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
  23231. // linear across the month
  23232. adjust = (b - anchor) / (anchor2 - anchor);
  23233. }
  23234. //check for negative zero, return zero if negative zero
  23235. return -(wholeMonthDiff + adjust) || 0;
  23236. }
  23237. utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  23238. utils_hooks__hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  23239. function toString () {
  23240. return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  23241. }
  23242. function moment_format__toISOString () {
  23243. var m = this.clone().utc();
  23244. if (0 < m.year() && m.year() <= 9999) {
  23245. if (isFunction(Date.prototype.toISOString)) {
  23246. // native implementation is ~50x faster, use it when we can
  23247. return this.toDate().toISOString();
  23248. } else {
  23249. return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  23250. }
  23251. } else {
  23252. return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  23253. }
  23254. }
  23255. function moment_format__format (inputString) {
  23256. if (!inputString) {
  23257. inputString = this.isUtc() ? utils_hooks__hooks.defaultFormatUtc : utils_hooks__hooks.defaultFormat;
  23258. }
  23259. var output = formatMoment(this, inputString);
  23260. return this.localeData().postformat(output);
  23261. }
  23262. function from (time, withoutSuffix) {
  23263. if (this.isValid() &&
  23264. ((isMoment(time) && time.isValid()) ||
  23265. local__createLocal(time).isValid())) {
  23266. return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
  23267. } else {
  23268. return this.localeData().invalidDate();
  23269. }
  23270. }
  23271. function fromNow (withoutSuffix) {
  23272. return this.from(local__createLocal(), withoutSuffix);
  23273. }
  23274. function to (time, withoutSuffix) {
  23275. if (this.isValid() &&
  23276. ((isMoment(time) && time.isValid()) ||
  23277. local__createLocal(time).isValid())) {
  23278. return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
  23279. } else {
  23280. return this.localeData().invalidDate();
  23281. }
  23282. }
  23283. function toNow (withoutSuffix) {
  23284. return this.to(local__createLocal(), withoutSuffix);
  23285. }
  23286. // If passed a locale key, it will set the locale for this
  23287. // instance. Otherwise, it will return the locale configuration
  23288. // variables for this instance.
  23289. function locale (key) {
  23290. var newLocaleData;
  23291. if (key === undefined) {
  23292. return this._locale._abbr;
  23293. } else {
  23294. newLocaleData = locale_locales__getLocale(key);
  23295. if (newLocaleData != null) {
  23296. this._locale = newLocaleData;
  23297. }
  23298. return this;
  23299. }
  23300. }
  23301. var lang = deprecate(
  23302. 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
  23303. function (key) {
  23304. if (key === undefined) {
  23305. return this.localeData();
  23306. } else {
  23307. return this.locale(key);
  23308. }
  23309. }
  23310. );
  23311. function localeData () {
  23312. return this._locale;
  23313. }
  23314. function startOf (units) {
  23315. units = normalizeUnits(units);
  23316. // the following switch intentionally omits break keywords
  23317. // to utilize falling through the cases.
  23318. switch (units) {
  23319. case 'year':
  23320. this.month(0);
  23321. /* falls through */
  23322. case 'quarter':
  23323. case 'month':
  23324. this.date(1);
  23325. /* falls through */
  23326. case 'week':
  23327. case 'isoWeek':
  23328. case 'day':
  23329. case 'date':
  23330. this.hours(0);
  23331. /* falls through */
  23332. case 'hour':
  23333. this.minutes(0);
  23334. /* falls through */
  23335. case 'minute':
  23336. this.seconds(0);
  23337. /* falls through */
  23338. case 'second':
  23339. this.milliseconds(0);
  23340. }
  23341. // weeks are a special case
  23342. if (units === 'week') {
  23343. this.weekday(0);
  23344. }
  23345. if (units === 'isoWeek') {
  23346. this.isoWeekday(1);
  23347. }
  23348. // quarters are also special
  23349. if (units === 'quarter') {
  23350. this.month(Math.floor(this.month() / 3) * 3);
  23351. }
  23352. return this;
  23353. }
  23354. function endOf (units) {
  23355. units = normalizeUnits(units);
  23356. if (units === undefined || units === 'millisecond') {
  23357. return this;
  23358. }
  23359. // 'date' is an alias for 'day', so it should be considered as such.
  23360. if (units === 'date') {
  23361. units = 'day';
  23362. }
  23363. return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
  23364. }
  23365. function to_type__valueOf () {
  23366. return this._d.valueOf() - ((this._offset || 0) * 60000);
  23367. }
  23368. function unix () {
  23369. return Math.floor(this.valueOf() / 1000);
  23370. }
  23371. function toDate () {
  23372. return new Date(this.valueOf());
  23373. }
  23374. function toArray () {
  23375. var m = this;
  23376. return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
  23377. }
  23378. function toObject () {
  23379. var m = this;
  23380. return {
  23381. years: m.year(),
  23382. months: m.month(),
  23383. date: m.date(),
  23384. hours: m.hours(),
  23385. minutes: m.minutes(),
  23386. seconds: m.seconds(),
  23387. milliseconds: m.milliseconds()
  23388. };
  23389. }
  23390. function toJSON () {
  23391. // new Date(NaN).toJSON() === null
  23392. return this.isValid() ? this.toISOString() : null;
  23393. }
  23394. function moment_valid__isValid () {
  23395. return valid__isValid(this);
  23396. }
  23397. function parsingFlags () {
  23398. return extend({}, getParsingFlags(this));
  23399. }
  23400. function invalidAt () {
  23401. return getParsingFlags(this).overflow;
  23402. }
  23403. function creationData() {
  23404. return {
  23405. input: this._i,
  23406. format: this._f,
  23407. locale: this._locale,
  23408. isUTC: this._isUTC,
  23409. strict: this._strict
  23410. };
  23411. }
  23412. // FORMATTING
  23413. addFormatToken(0, ['gg', 2], 0, function () {
  23414. return this.weekYear() % 100;
  23415. });
  23416. addFormatToken(0, ['GG', 2], 0, function () {
  23417. return this.isoWeekYear() % 100;
  23418. });
  23419. function addWeekYearFormatToken (token, getter) {
  23420. addFormatToken(0, [token, token.length], 0, getter);
  23421. }
  23422. addWeekYearFormatToken('gggg', 'weekYear');
  23423. addWeekYearFormatToken('ggggg', 'weekYear');
  23424. addWeekYearFormatToken('GGGG', 'isoWeekYear');
  23425. addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  23426. // ALIASES
  23427. addUnitAlias('weekYear', 'gg');
  23428. addUnitAlias('isoWeekYear', 'GG');
  23429. // PRIORITY
  23430. addUnitPriority('weekYear', 1);
  23431. addUnitPriority('isoWeekYear', 1);
  23432. // PARSING
  23433. addRegexToken('G', matchSigned);
  23434. addRegexToken('g', matchSigned);
  23435. addRegexToken('GG', match1to2, match2);
  23436. addRegexToken('gg', match1to2, match2);
  23437. addRegexToken('GGGG', match1to4, match4);
  23438. addRegexToken('gggg', match1to4, match4);
  23439. addRegexToken('GGGGG', match1to6, match6);
  23440. addRegexToken('ggggg', match1to6, match6);
  23441. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
  23442. week[token.substr(0, 2)] = toInt(input);
  23443. });
  23444. addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  23445. week[token] = utils_hooks__hooks.parseTwoDigitYear(input);
  23446. });
  23447. // MOMENTS
  23448. function getSetWeekYear (input) {
  23449. return getSetWeekYearHelper.call(this,
  23450. input,
  23451. this.week(),
  23452. this.weekday(),
  23453. this.localeData()._week.dow,
  23454. this.localeData()._week.doy);
  23455. }
  23456. function getSetISOWeekYear (input) {
  23457. return getSetWeekYearHelper.call(this,
  23458. input, this.isoWeek(), this.isoWeekday(), 1, 4);
  23459. }
  23460. function getISOWeeksInYear () {
  23461. return weeksInYear(this.year(), 1, 4);
  23462. }
  23463. function getWeeksInYear () {
  23464. var weekInfo = this.localeData()._week;
  23465. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  23466. }
  23467. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  23468. var weeksTarget;
  23469. if (input == null) {
  23470. return weekOfYear(this, dow, doy).year;
  23471. } else {
  23472. weeksTarget = weeksInYear(input, dow, doy);
  23473. if (week > weeksTarget) {
  23474. week = weeksTarget;
  23475. }
  23476. return setWeekAll.call(this, input, week, weekday, dow, doy);
  23477. }
  23478. }
  23479. function setWeekAll(weekYear, week, weekday, dow, doy) {
  23480. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
  23481. date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  23482. this.year(date.getUTCFullYear());
  23483. this.month(date.getUTCMonth());
  23484. this.date(date.getUTCDate());
  23485. return this;
  23486. }
  23487. // FORMATTING
  23488. addFormatToken('Q', 0, 'Qo', 'quarter');
  23489. // ALIASES
  23490. addUnitAlias('quarter', 'Q');
  23491. // PRIORITY
  23492. addUnitPriority('quarter', 7);
  23493. // PARSING
  23494. addRegexToken('Q', match1);
  23495. addParseToken('Q', function (input, array) {
  23496. array[MONTH] = (toInt(input) - 1) * 3;
  23497. });
  23498. // MOMENTS
  23499. function getSetQuarter (input) {
  23500. return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
  23501. }
  23502. // FORMATTING
  23503. addFormatToken('D', ['DD', 2], 'Do', 'date');
  23504. // ALIASES
  23505. addUnitAlias('date', 'D');
  23506. // PRIOROITY
  23507. addUnitPriority('date', 9);
  23508. // PARSING
  23509. addRegexToken('D', match1to2);
  23510. addRegexToken('DD', match1to2, match2);
  23511. addRegexToken('Do', function (isStrict, locale) {
  23512. return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
  23513. });
  23514. addParseToken(['D', 'DD'], DATE);
  23515. addParseToken('Do', function (input, array) {
  23516. array[DATE] = toInt(input.match(match1to2)[0], 10);
  23517. });
  23518. // MOMENTS
  23519. var getSetDayOfMonth = makeGetSet('Date', true);
  23520. // FORMATTING
  23521. addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  23522. // ALIASES
  23523. addUnitAlias('dayOfYear', 'DDD');
  23524. // PRIORITY
  23525. addUnitPriority('dayOfYear', 4);
  23526. // PARSING
  23527. addRegexToken('DDD', match1to3);
  23528. addRegexToken('DDDD', match3);
  23529. addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  23530. config._dayOfYear = toInt(input);
  23531. });
  23532. // HELPERS
  23533. // MOMENTS
  23534. function getSetDayOfYear (input) {
  23535. var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
  23536. return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
  23537. }
  23538. // FORMATTING
  23539. addFormatToken('m', ['mm', 2], 0, 'minute');
  23540. // ALIASES
  23541. addUnitAlias('minute', 'm');
  23542. // PRIORITY
  23543. addUnitPriority('minute', 14);
  23544. // PARSING
  23545. addRegexToken('m', match1to2);
  23546. addRegexToken('mm', match1to2, match2);
  23547. addParseToken(['m', 'mm'], MINUTE);
  23548. // MOMENTS
  23549. var getSetMinute = makeGetSet('Minutes', false);
  23550. // FORMATTING
  23551. addFormatToken('s', ['ss', 2], 0, 'second');
  23552. // ALIASES
  23553. addUnitAlias('second', 's');
  23554. // PRIORITY
  23555. addUnitPriority('second', 15);
  23556. // PARSING
  23557. addRegexToken('s', match1to2);
  23558. addRegexToken('ss', match1to2, match2);
  23559. addParseToken(['s', 'ss'], SECOND);
  23560. // MOMENTS
  23561. var getSetSecond = makeGetSet('Seconds', false);
  23562. // FORMATTING
  23563. addFormatToken('S', 0, 0, function () {
  23564. return ~~(this.millisecond() / 100);
  23565. });
  23566. addFormatToken(0, ['SS', 2], 0, function () {
  23567. return ~~(this.millisecond() / 10);
  23568. });
  23569. addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  23570. addFormatToken(0, ['SSSS', 4], 0, function () {
  23571. return this.millisecond() * 10;
  23572. });
  23573. addFormatToken(0, ['SSSSS', 5], 0, function () {
  23574. return this.millisecond() * 100;
  23575. });
  23576. addFormatToken(0, ['SSSSSS', 6], 0, function () {
  23577. return this.millisecond() * 1000;
  23578. });
  23579. addFormatToken(0, ['SSSSSSS', 7], 0, function () {
  23580. return this.millisecond() * 10000;
  23581. });
  23582. addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
  23583. return this.millisecond() * 100000;
  23584. });
  23585. addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  23586. return this.millisecond() * 1000000;
  23587. });
  23588. // ALIASES
  23589. addUnitAlias('millisecond', 'ms');
  23590. // PRIORITY
  23591. addUnitPriority('millisecond', 16);
  23592. // PARSING
  23593. addRegexToken('S', match1to3, match1);
  23594. addRegexToken('SS', match1to3, match2);
  23595. addRegexToken('SSS', match1to3, match3);
  23596. var token;
  23597. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  23598. addRegexToken(token, matchUnsigned);
  23599. }
  23600. function parseMs(input, array) {
  23601. array[MILLISECOND] = toInt(('0.' + input) * 1000);
  23602. }
  23603. for (token = 'S'; token.length <= 9; token += 'S') {
  23604. addParseToken(token, parseMs);
  23605. }
  23606. // MOMENTS
  23607. var getSetMillisecond = makeGetSet('Milliseconds', false);
  23608. // FORMATTING
  23609. addFormatToken('z', 0, 0, 'zoneAbbr');
  23610. addFormatToken('zz', 0, 0, 'zoneName');
  23611. // MOMENTS
  23612. function getZoneAbbr () {
  23613. return this._isUTC ? 'UTC' : '';
  23614. }
  23615. function getZoneName () {
  23616. return this._isUTC ? 'Coordinated Universal Time' : '';
  23617. }
  23618. var momentPrototype__proto = Moment.prototype;
  23619. momentPrototype__proto.add = add_subtract__add;
  23620. momentPrototype__proto.calendar = moment_calendar__calendar;
  23621. momentPrototype__proto.clone = clone;
  23622. momentPrototype__proto.diff = diff;
  23623. momentPrototype__proto.endOf = endOf;
  23624. momentPrototype__proto.format = moment_format__format;
  23625. momentPrototype__proto.from = from;
  23626. momentPrototype__proto.fromNow = fromNow;
  23627. momentPrototype__proto.to = to;
  23628. momentPrototype__proto.toNow = toNow;
  23629. momentPrototype__proto.get = stringGet;
  23630. momentPrototype__proto.invalidAt = invalidAt;
  23631. momentPrototype__proto.isAfter = isAfter;
  23632. momentPrototype__proto.isBefore = isBefore;
  23633. momentPrototype__proto.isBetween = isBetween;
  23634. momentPrototype__proto.isSame = isSame;
  23635. momentPrototype__proto.isSameOrAfter = isSameOrAfter;
  23636. momentPrototype__proto.isSameOrBefore = isSameOrBefore;
  23637. momentPrototype__proto.isValid = moment_valid__isValid;
  23638. momentPrototype__proto.lang = lang;
  23639. momentPrototype__proto.locale = locale;
  23640. momentPrototype__proto.localeData = localeData;
  23641. momentPrototype__proto.max = prototypeMax;
  23642. momentPrototype__proto.min = prototypeMin;
  23643. momentPrototype__proto.parsingFlags = parsingFlags;
  23644. momentPrototype__proto.set = stringSet;
  23645. momentPrototype__proto.startOf = startOf;
  23646. momentPrototype__proto.subtract = add_subtract__subtract;
  23647. momentPrototype__proto.toArray = toArray;
  23648. momentPrototype__proto.toObject = toObject;
  23649. momentPrototype__proto.toDate = toDate;
  23650. momentPrototype__proto.toISOString = moment_format__toISOString;
  23651. momentPrototype__proto.toJSON = toJSON;
  23652. momentPrototype__proto.toString = toString;
  23653. momentPrototype__proto.unix = unix;
  23654. momentPrototype__proto.valueOf = to_type__valueOf;
  23655. momentPrototype__proto.creationData = creationData;
  23656. // Year
  23657. momentPrototype__proto.year = getSetYear;
  23658. momentPrototype__proto.isLeapYear = getIsLeapYear;
  23659. // Week Year
  23660. momentPrototype__proto.weekYear = getSetWeekYear;
  23661. momentPrototype__proto.isoWeekYear = getSetISOWeekYear;
  23662. // Quarter
  23663. momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter;
  23664. // Month
  23665. momentPrototype__proto.month = getSetMonth;
  23666. momentPrototype__proto.daysInMonth = getDaysInMonth;
  23667. // Week
  23668. momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek;
  23669. momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek;
  23670. momentPrototype__proto.weeksInYear = getWeeksInYear;
  23671. momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear;
  23672. // Day
  23673. momentPrototype__proto.date = getSetDayOfMonth;
  23674. momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek;
  23675. momentPrototype__proto.weekday = getSetLocaleDayOfWeek;
  23676. momentPrototype__proto.isoWeekday = getSetISODayOfWeek;
  23677. momentPrototype__proto.dayOfYear = getSetDayOfYear;
  23678. // Hour
  23679. momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour;
  23680. // Minute
  23681. momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute;
  23682. // Second
  23683. momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond;
  23684. // Millisecond
  23685. momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond;
  23686. // Offset
  23687. momentPrototype__proto.utcOffset = getSetOffset;
  23688. momentPrototype__proto.utc = setOffsetToUTC;
  23689. momentPrototype__proto.local = setOffsetToLocal;
  23690. momentPrototype__proto.parseZone = setOffsetToParsedOffset;
  23691. momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset;
  23692. momentPrototype__proto.isDST = isDaylightSavingTime;
  23693. momentPrototype__proto.isLocal = isLocal;
  23694. momentPrototype__proto.isUtcOffset = isUtcOffset;
  23695. momentPrototype__proto.isUtc = isUtc;
  23696. momentPrototype__proto.isUTC = isUtc;
  23697. // Timezone
  23698. momentPrototype__proto.zoneAbbr = getZoneAbbr;
  23699. momentPrototype__proto.zoneName = getZoneName;
  23700. // Deprecations
  23701. momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
  23702. momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
  23703. momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
  23704. momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
  23705. momentPrototype__proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
  23706. var momentPrototype = momentPrototype__proto;
  23707. function moment_moment__createUnix (input) {
  23708. return local__createLocal(input * 1000);
  23709. }
  23710. function moment_moment__createInZone () {
  23711. return local__createLocal.apply(null, arguments).parseZone();
  23712. }
  23713. function preParsePostFormat (string) {
  23714. return string;
  23715. }
  23716. var prototype__proto = Locale.prototype;
  23717. prototype__proto.calendar = locale_calendar__calendar;
  23718. prototype__proto.longDateFormat = longDateFormat;
  23719. prototype__proto.invalidDate = invalidDate;
  23720. prototype__proto.ordinal = ordinal;
  23721. prototype__proto.preparse = preParsePostFormat;
  23722. prototype__proto.postformat = preParsePostFormat;
  23723. prototype__proto.relativeTime = relative__relativeTime;
  23724. prototype__proto.pastFuture = pastFuture;
  23725. prototype__proto.set = locale_set__set;
  23726. // Month
  23727. prototype__proto.months = localeMonths;
  23728. prototype__proto.monthsShort = localeMonthsShort;
  23729. prototype__proto.monthsParse = localeMonthsParse;
  23730. prototype__proto.monthsRegex = monthsRegex;
  23731. prototype__proto.monthsShortRegex = monthsShortRegex;
  23732. // Week
  23733. prototype__proto.week = localeWeek;
  23734. prototype__proto.firstDayOfYear = localeFirstDayOfYear;
  23735. prototype__proto.firstDayOfWeek = localeFirstDayOfWeek;
  23736. // Day of Week
  23737. prototype__proto.weekdays = localeWeekdays;
  23738. prototype__proto.weekdaysMin = localeWeekdaysMin;
  23739. prototype__proto.weekdaysShort = localeWeekdaysShort;
  23740. prototype__proto.weekdaysParse = localeWeekdaysParse;
  23741. prototype__proto.weekdaysRegex = weekdaysRegex;
  23742. prototype__proto.weekdaysShortRegex = weekdaysShortRegex;
  23743. prototype__proto.weekdaysMinRegex = weekdaysMinRegex;
  23744. // Hours
  23745. prototype__proto.isPM = localeIsPM;
  23746. prototype__proto.meridiem = localeMeridiem;
  23747. function lists__get (format, index, field, setter) {
  23748. var locale = locale_locales__getLocale();
  23749. var utc = create_utc__createUTC().set(setter, index);
  23750. return locale[field](utc, format);
  23751. }
  23752. function listMonthsImpl (format, index, field) {
  23753. if (typeof format === 'number') {
  23754. index = format;
  23755. format = undefined;
  23756. }
  23757. format = format || '';
  23758. if (index != null) {
  23759. return lists__get(format, index, field, 'month');
  23760. }
  23761. var i;
  23762. var out = [];
  23763. for (i = 0; i < 12; i++) {
  23764. out[i] = lists__get(format, i, field, 'month');
  23765. }
  23766. return out;
  23767. }
  23768. // ()
  23769. // (5)
  23770. // (fmt, 5)
  23771. // (fmt)
  23772. // (true)
  23773. // (true, 5)
  23774. // (true, fmt, 5)
  23775. // (true, fmt)
  23776. function listWeekdaysImpl (localeSorted, format, index, field) {
  23777. if (typeof localeSorted === 'boolean') {
  23778. if (typeof format === 'number') {
  23779. index = format;
  23780. format = undefined;
  23781. }
  23782. format = format || '';
  23783. } else {
  23784. format = localeSorted;
  23785. index = format;
  23786. localeSorted = false;
  23787. if (typeof format === 'number') {
  23788. index = format;
  23789. format = undefined;
  23790. }
  23791. format = format || '';
  23792. }
  23793. var locale = locale_locales__getLocale(),
  23794. shift = localeSorted ? locale._week.dow : 0;
  23795. if (index != null) {
  23796. return lists__get(format, (index + shift) % 7, field, 'day');
  23797. }
  23798. var i;
  23799. var out = [];
  23800. for (i = 0; i < 7; i++) {
  23801. out[i] = lists__get(format, (i + shift) % 7, field, 'day');
  23802. }
  23803. return out;
  23804. }
  23805. function lists__listMonths (format, index) {
  23806. return listMonthsImpl(format, index, 'months');
  23807. }
  23808. function lists__listMonthsShort (format, index) {
  23809. return listMonthsImpl(format, index, 'monthsShort');
  23810. }
  23811. function lists__listWeekdays (localeSorted, format, index) {
  23812. return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  23813. }
  23814. function lists__listWeekdaysShort (localeSorted, format, index) {
  23815. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  23816. }
  23817. function lists__listWeekdaysMin (localeSorted, format, index) {
  23818. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  23819. }
  23820. locale_locales__getSetGlobalLocale('en', {
  23821. ordinalParse: /\d{1,2}(th|st|nd|rd)/,
  23822. ordinal : function (number) {
  23823. var b = number % 10,
  23824. output = (toInt(number % 100 / 10) === 1) ? 'th' :
  23825. (b === 1) ? 'st' :
  23826. (b === 2) ? 'nd' :
  23827. (b === 3) ? 'rd' : 'th';
  23828. return number + output;
  23829. }
  23830. });
  23831. // Side effect imports
  23832. utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale);
  23833. utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale);
  23834. var mathAbs = Math.abs;
  23835. function duration_abs__abs () {
  23836. var data = this._data;
  23837. this._milliseconds = mathAbs(this._milliseconds);
  23838. this._days = mathAbs(this._days);
  23839. this._months = mathAbs(this._months);
  23840. data.milliseconds = mathAbs(data.milliseconds);
  23841. data.seconds = mathAbs(data.seconds);
  23842. data.minutes = mathAbs(data.minutes);
  23843. data.hours = mathAbs(data.hours);
  23844. data.months = mathAbs(data.months);
  23845. data.years = mathAbs(data.years);
  23846. return this;
  23847. }
  23848. function duration_add_subtract__addSubtract (duration, input, value, direction) {
  23849. var other = create__createDuration(input, value);
  23850. duration._milliseconds += direction * other._milliseconds;
  23851. duration._days += direction * other._days;
  23852. duration._months += direction * other._months;
  23853. return duration._bubble();
  23854. }
  23855. // supports only 2.0-style add(1, 's') or add(duration)
  23856. function duration_add_subtract__add (input, value) {
  23857. return duration_add_subtract__addSubtract(this, input, value, 1);
  23858. }
  23859. // supports only 2.0-style subtract(1, 's') or subtract(duration)
  23860. function duration_add_subtract__subtract (input, value) {
  23861. return duration_add_subtract__addSubtract(this, input, value, -1);
  23862. }
  23863. function absCeil (number) {
  23864. if (number < 0) {
  23865. return Math.floor(number);
  23866. } else {
  23867. return Math.ceil(number);
  23868. }
  23869. }
  23870. function bubble () {
  23871. var milliseconds = this._milliseconds;
  23872. var days = this._days;
  23873. var months = this._months;
  23874. var data = this._data;
  23875. var seconds, minutes, hours, years, monthsFromDays;
  23876. // if we have a mix of positive and negative values, bubble down first
  23877. // check: https://github.com/moment/moment/issues/2166
  23878. if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
  23879. (milliseconds <= 0 && days <= 0 && months <= 0))) {
  23880. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  23881. days = 0;
  23882. months = 0;
  23883. }
  23884. // The following code bubbles up values, see the tests for
  23885. // examples of what that means.
  23886. data.milliseconds = milliseconds % 1000;
  23887. seconds = absFloor(milliseconds / 1000);
  23888. data.seconds = seconds % 60;
  23889. minutes = absFloor(seconds / 60);
  23890. data.minutes = minutes % 60;
  23891. hours = absFloor(minutes / 60);
  23892. data.hours = hours % 24;
  23893. days += absFloor(hours / 24);
  23894. // convert days to months
  23895. monthsFromDays = absFloor(daysToMonths(days));
  23896. months += monthsFromDays;
  23897. days -= absCeil(monthsToDays(monthsFromDays));
  23898. // 12 months -> 1 year
  23899. years = absFloor(months / 12);
  23900. months %= 12;
  23901. data.days = days;
  23902. data.months = months;
  23903. data.years = years;
  23904. return this;
  23905. }
  23906. function daysToMonths (days) {
  23907. // 400 years have 146097 days (taking into account leap year rules)
  23908. // 400 years have 12 months === 4800
  23909. return days * 4800 / 146097;
  23910. }
  23911. function monthsToDays (months) {
  23912. // the reverse of daysToMonths
  23913. return months * 146097 / 4800;
  23914. }
  23915. function as (units) {
  23916. var days;
  23917. var months;
  23918. var milliseconds = this._milliseconds;
  23919. units = normalizeUnits(units);
  23920. if (units === 'month' || units === 'year') {
  23921. days = this._days + milliseconds / 864e5;
  23922. months = this._months + daysToMonths(days);
  23923. return units === 'month' ? months : months / 12;
  23924. } else {
  23925. // handle milliseconds separately because of floating point math errors (issue #1867)
  23926. days = this._days + Math.round(monthsToDays(this._months));
  23927. switch (units) {
  23928. case 'week' : return days / 7 + milliseconds / 6048e5;
  23929. case 'day' : return days + milliseconds / 864e5;
  23930. case 'hour' : return days * 24 + milliseconds / 36e5;
  23931. case 'minute' : return days * 1440 + milliseconds / 6e4;
  23932. case 'second' : return days * 86400 + milliseconds / 1000;
  23933. // Math.floor prevents floating point math errors here
  23934. case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
  23935. default: throw new Error('Unknown unit ' + units);
  23936. }
  23937. }
  23938. }
  23939. // TODO: Use this.as('ms')?
  23940. function duration_as__valueOf () {
  23941. return (
  23942. this._milliseconds +
  23943. this._days * 864e5 +
  23944. (this._months % 12) * 2592e6 +
  23945. toInt(this._months / 12) * 31536e6
  23946. );
  23947. }
  23948. function makeAs (alias) {
  23949. return function () {
  23950. return this.as(alias);
  23951. };
  23952. }
  23953. var asMilliseconds = makeAs('ms');
  23954. var asSeconds = makeAs('s');
  23955. var asMinutes = makeAs('m');
  23956. var asHours = makeAs('h');
  23957. var asDays = makeAs('d');
  23958. var asWeeks = makeAs('w');
  23959. var asMonths = makeAs('M');
  23960. var asYears = makeAs('y');
  23961. function duration_get__get (units) {
  23962. units = normalizeUnits(units);
  23963. return this[units + 's']();
  23964. }
  23965. function makeGetter(name) {
  23966. return function () {
  23967. return this._data[name];
  23968. };
  23969. }
  23970. var milliseconds = makeGetter('milliseconds');
  23971. var seconds = makeGetter('seconds');
  23972. var minutes = makeGetter('minutes');
  23973. var hours = makeGetter('hours');
  23974. var days = makeGetter('days');
  23975. var duration_get__months = makeGetter('months');
  23976. var years = makeGetter('years');
  23977. function weeks () {
  23978. return absFloor(this.days() / 7);
  23979. }
  23980. var round = Math.round;
  23981. var thresholds = {
  23982. s: 45, // seconds to minute
  23983. m: 45, // minutes to hour
  23984. h: 22, // hours to day
  23985. d: 26, // days to month
  23986. M: 11 // months to year
  23987. };
  23988. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  23989. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
  23990. return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  23991. }
  23992. function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) {
  23993. var duration = create__createDuration(posNegDuration).abs();
  23994. var seconds = round(duration.as('s'));
  23995. var minutes = round(duration.as('m'));
  23996. var hours = round(duration.as('h'));
  23997. var days = round(duration.as('d'));
  23998. var months = round(duration.as('M'));
  23999. var years = round(duration.as('y'));
  24000. var a = seconds < thresholds.s && ['s', seconds] ||
  24001. minutes <= 1 && ['m'] ||
  24002. minutes < thresholds.m && ['mm', minutes] ||
  24003. hours <= 1 && ['h'] ||
  24004. hours < thresholds.h && ['hh', hours] ||
  24005. days <= 1 && ['d'] ||
  24006. days < thresholds.d && ['dd', days] ||
  24007. months <= 1 && ['M'] ||
  24008. months < thresholds.M && ['MM', months] ||
  24009. years <= 1 && ['y'] || ['yy', years];
  24010. a[2] = withoutSuffix;
  24011. a[3] = +posNegDuration > 0;
  24012. a[4] = locale;
  24013. return substituteTimeAgo.apply(null, a);
  24014. }
  24015. // This function allows you to set the rounding function for relative time strings
  24016. function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {
  24017. if (roundingFunction === undefined) {
  24018. return round;
  24019. }
  24020. if (typeof(roundingFunction) === 'function') {
  24021. round = roundingFunction;
  24022. return true;
  24023. }
  24024. return false;
  24025. }
  24026. // This function allows you to set a threshold for relative time strings
  24027. function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {
  24028. if (thresholds[threshold] === undefined) {
  24029. return false;
  24030. }
  24031. if (limit === undefined) {
  24032. return thresholds[threshold];
  24033. }
  24034. thresholds[threshold] = limit;
  24035. return true;
  24036. }
  24037. function humanize (withSuffix) {
  24038. var locale = this.localeData();
  24039. var output = duration_humanize__relativeTime(this, !withSuffix, locale);
  24040. if (withSuffix) {
  24041. output = locale.pastFuture(+this, output);
  24042. }
  24043. return locale.postformat(output);
  24044. }
  24045. var iso_string__abs = Math.abs;
  24046. function iso_string__toISOString() {
  24047. // for ISO strings we do not use the normal bubbling rules:
  24048. // * milliseconds bubble up until they become hours
  24049. // * days do not bubble at all
  24050. // * months bubble up until they become years
  24051. // This is because there is no context-free conversion between hours and days
  24052. // (think of clock changes)
  24053. // and also not between days and months (28-31 days per month)
  24054. var seconds = iso_string__abs(this._milliseconds) / 1000;
  24055. var days = iso_string__abs(this._days);
  24056. var months = iso_string__abs(this._months);
  24057. var minutes, hours, years;
  24058. // 3600 seconds -> 60 minutes -> 1 hour
  24059. minutes = absFloor(seconds / 60);
  24060. hours = absFloor(minutes / 60);
  24061. seconds %= 60;
  24062. minutes %= 60;
  24063. // 12 months -> 1 year
  24064. years = absFloor(months / 12);
  24065. months %= 12;
  24066. // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
  24067. var Y = years;
  24068. var M = months;
  24069. var D = days;
  24070. var h = hours;
  24071. var m = minutes;
  24072. var s = seconds;
  24073. var total = this.asSeconds();
  24074. if (!total) {
  24075. // this is the same as C#'s (Noda) and python (isodate)...
  24076. // but not other JS (goog.date)
  24077. return 'P0D';
  24078. }
  24079. return (total < 0 ? '-' : '') +
  24080. 'P' +
  24081. (Y ? Y + 'Y' : '') +
  24082. (M ? M + 'M' : '') +
  24083. (D ? D + 'D' : '') +
  24084. ((h || m || s) ? 'T' : '') +
  24085. (h ? h + 'H' : '') +
  24086. (m ? m + 'M' : '') +
  24087. (s ? s + 'S' : '');
  24088. }
  24089. var duration_prototype__proto = Duration.prototype;
  24090. duration_prototype__proto.abs = duration_abs__abs;
  24091. duration_prototype__proto.add = duration_add_subtract__add;
  24092. duration_prototype__proto.subtract = duration_add_subtract__subtract;
  24093. duration_prototype__proto.as = as;
  24094. duration_prototype__proto.asMilliseconds = asMilliseconds;
  24095. duration_prototype__proto.asSeconds = asSeconds;
  24096. duration_prototype__proto.asMinutes = asMinutes;
  24097. duration_prototype__proto.asHours = asHours;
  24098. duration_prototype__proto.asDays = asDays;
  24099. duration_prototype__proto.asWeeks = asWeeks;
  24100. duration_prototype__proto.asMonths = asMonths;
  24101. duration_prototype__proto.asYears = asYears;
  24102. duration_prototype__proto.valueOf = duration_as__valueOf;
  24103. duration_prototype__proto._bubble = bubble;
  24104. duration_prototype__proto.get = duration_get__get;
  24105. duration_prototype__proto.milliseconds = milliseconds;
  24106. duration_prototype__proto.seconds = seconds;
  24107. duration_prototype__proto.minutes = minutes;
  24108. duration_prototype__proto.hours = hours;
  24109. duration_prototype__proto.days = days;
  24110. duration_prototype__proto.weeks = weeks;
  24111. duration_prototype__proto.months = duration_get__months;
  24112. duration_prototype__proto.years = years;
  24113. duration_prototype__proto.humanize = humanize;
  24114. duration_prototype__proto.toISOString = iso_string__toISOString;
  24115. duration_prototype__proto.toString = iso_string__toISOString;
  24116. duration_prototype__proto.toJSON = iso_string__toISOString;
  24117. duration_prototype__proto.locale = locale;
  24118. duration_prototype__proto.localeData = localeData;
  24119. // Deprecations
  24120. duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString);
  24121. duration_prototype__proto.lang = lang;
  24122. // Side effect imports
  24123. // FORMATTING
  24124. addFormatToken('X', 0, 0, 'unix');
  24125. addFormatToken('x', 0, 0, 'valueOf');
  24126. // PARSING
  24127. addRegexToken('x', matchSigned);
  24128. addRegexToken('X', matchTimestamp);
  24129. addParseToken('X', function (input, array, config) {
  24130. config._d = new Date(parseFloat(input, 10) * 1000);
  24131. });
  24132. addParseToken('x', function (input, array, config) {
  24133. config._d = new Date(toInt(input));
  24134. });
  24135. // Side effect imports
  24136. ;
  24137. utils_hooks__hooks.version = '2.14.1';
  24138. setHookCallback(local__createLocal);
  24139. utils_hooks__hooks.fn = momentPrototype;
  24140. utils_hooks__hooks.min = min;
  24141. utils_hooks__hooks.max = max;
  24142. utils_hooks__hooks.now = now;
  24143. utils_hooks__hooks.utc = create_utc__createUTC;
  24144. utils_hooks__hooks.unix = moment_moment__createUnix;
  24145. utils_hooks__hooks.months = lists__listMonths;
  24146. utils_hooks__hooks.isDate = isDate;
  24147. utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale;
  24148. utils_hooks__hooks.invalid = valid__createInvalid;
  24149. utils_hooks__hooks.duration = create__createDuration;
  24150. utils_hooks__hooks.isMoment = isMoment;
  24151. utils_hooks__hooks.weekdays = lists__listWeekdays;
  24152. utils_hooks__hooks.parseZone = moment_moment__createInZone;
  24153. utils_hooks__hooks.localeData = locale_locales__getLocale;
  24154. utils_hooks__hooks.isDuration = isDuration;
  24155. utils_hooks__hooks.monthsShort = lists__listMonthsShort;
  24156. utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin;
  24157. utils_hooks__hooks.defineLocale = defineLocale;
  24158. utils_hooks__hooks.updateLocale = updateLocale;
  24159. utils_hooks__hooks.locales = locale_locales__listLocales;
  24160. utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort;
  24161. utils_hooks__hooks.normalizeUnits = normalizeUnits;
  24162. utils_hooks__hooks.relativeTimeRounding = duration_humanize__getSetRelativeTimeRounding;
  24163. utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold;
  24164. utils_hooks__hooks.calendarFormat = getCalendarFormat;
  24165. utils_hooks__hooks.prototype = momentPrototype;
  24166. var moment__default = utils_hooks__hooks;
  24167. var af = moment__default.defineLocale('af', {
  24168. months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),
  24169. monthsShort : 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
  24170. weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),
  24171. weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
  24172. weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
  24173. meridiemParse: /vm|nm/i,
  24174. isPM : function (input) {
  24175. return /^nm$/i.test(input);
  24176. },
  24177. meridiem : function (hours, minutes, isLower) {
  24178. if (hours < 12) {
  24179. return isLower ? 'vm' : 'VM';
  24180. } else {
  24181. return isLower ? 'nm' : 'NM';
  24182. }
  24183. },
  24184. longDateFormat : {
  24185. LT : 'HH:mm',
  24186. LTS : 'HH:mm:ss',
  24187. L : 'DD/MM/YYYY',
  24188. LL : 'D MMMM YYYY',
  24189. LLL : 'D MMMM YYYY HH:mm',
  24190. LLLL : 'dddd, D MMMM YYYY HH:mm'
  24191. },
  24192. calendar : {
  24193. sameDay : '[Vandag om] LT',
  24194. nextDay : '[Môre om] LT',
  24195. nextWeek : 'dddd [om] LT',
  24196. lastDay : '[Gister om] LT',
  24197. lastWeek : '[Laas] dddd [om] LT',
  24198. sameElse : 'L'
  24199. },
  24200. relativeTime : {
  24201. future : 'oor %s',
  24202. past : '%s gelede',
  24203. s : '\'n paar sekondes',
  24204. m : '\'n minuut',
  24205. mm : '%d minute',
  24206. h : '\'n uur',
  24207. hh : '%d ure',
  24208. d : '\'n dag',
  24209. dd : '%d dae',
  24210. M : '\'n maand',
  24211. MM : '%d maande',
  24212. y : '\'n jaar',
  24213. yy : '%d jaar'
  24214. },
  24215. ordinalParse: /\d{1,2}(ste|de)/,
  24216. ordinal : function (number) {
  24217. return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter
  24218. },
  24219. week : {
  24220. dow : 1, // Maandag is die eerste dag van die week.
  24221. doy : 4 // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
  24222. }
  24223. });
  24224. var ar_ma = moment__default.defineLocale('ar-ma', {
  24225. months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
  24226. monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
  24227. weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  24228. weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
  24229. weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  24230. weekdaysParseExact : true,
  24231. longDateFormat : {
  24232. LT : 'HH:mm',
  24233. LTS : 'HH:mm:ss',
  24234. L : 'DD/MM/YYYY',
  24235. LL : 'D MMMM YYYY',
  24236. LLL : 'D MMMM YYYY HH:mm',
  24237. LLLL : 'dddd D MMMM YYYY HH:mm'
  24238. },
  24239. calendar : {
  24240. sameDay: '[اليوم على الساعة] LT',
  24241. nextDay: '[غدا على الساعة] LT',
  24242. nextWeek: 'dddd [على الساعة] LT',
  24243. lastDay: '[أمس على الساعة] LT',
  24244. lastWeek: 'dddd [على الساعة] LT',
  24245. sameElse: 'L'
  24246. },
  24247. relativeTime : {
  24248. future : 'في %s',
  24249. past : 'منذ %s',
  24250. s : 'ثوان',
  24251. m : 'دقيقة',
  24252. mm : '%d دقائق',
  24253. h : 'ساعة',
  24254. hh : '%d ساعات',
  24255. d : 'يوم',
  24256. dd : '%d أيام',
  24257. M : 'شهر',
  24258. MM : '%d أشهر',
  24259. y : 'سنة',
  24260. yy : '%d سنوات'
  24261. },
  24262. week : {
  24263. dow : 6, // Saturday is the first day of the week.
  24264. doy : 12 // The week that contains Jan 1st is the first week of the year.
  24265. }
  24266. });
  24267. var ar_sa__symbolMap = {
  24268. '1': '١',
  24269. '2': '٢',
  24270. '3': '٣',
  24271. '4': '٤',
  24272. '5': '٥',
  24273. '6': '٦',
  24274. '7': '٧',
  24275. '8': '٨',
  24276. '9': '٩',
  24277. '0': '٠'
  24278. }, ar_sa__numberMap = {
  24279. '١': '1',
  24280. '٢': '2',
  24281. '٣': '3',
  24282. '٤': '4',
  24283. '٥': '5',
  24284. '٦': '6',
  24285. '٧': '7',
  24286. '٨': '8',
  24287. '٩': '9',
  24288. '٠': '0'
  24289. };
  24290. var ar_sa = moment__default.defineLocale('ar-sa', {
  24291. months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  24292. monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  24293. weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  24294. weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  24295. weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  24296. weekdaysParseExact : true,
  24297. longDateFormat : {
  24298. LT : 'HH:mm',
  24299. LTS : 'HH:mm:ss',
  24300. L : 'DD/MM/YYYY',
  24301. LL : 'D MMMM YYYY',
  24302. LLL : 'D MMMM YYYY HH:mm',
  24303. LLLL : 'dddd D MMMM YYYY HH:mm'
  24304. },
  24305. meridiemParse: /ص|م/,
  24306. isPM : function (input) {
  24307. return 'م' === input;
  24308. },
  24309. meridiem : function (hour, minute, isLower) {
  24310. if (hour < 12) {
  24311. return 'ص';
  24312. } else {
  24313. return 'م';
  24314. }
  24315. },
  24316. calendar : {
  24317. sameDay: '[اليوم على الساعة] LT',
  24318. nextDay: '[غدا على الساعة] LT',
  24319. nextWeek: 'dddd [على الساعة] LT',
  24320. lastDay: '[أمس على الساعة] LT',
  24321. lastWeek: 'dddd [على الساعة] LT',
  24322. sameElse: 'L'
  24323. },
  24324. relativeTime : {
  24325. future : 'في %s',
  24326. past : 'منذ %s',
  24327. s : 'ثوان',
  24328. m : 'دقيقة',
  24329. mm : '%d دقائق',
  24330. h : 'ساعة',
  24331. hh : '%d ساعات',
  24332. d : 'يوم',
  24333. dd : '%d أيام',
  24334. M : 'شهر',
  24335. MM : '%d أشهر',
  24336. y : 'سنة',
  24337. yy : '%d سنوات'
  24338. },
  24339. preparse: function (string) {
  24340. return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  24341. return ar_sa__numberMap[match];
  24342. }).replace(/،/g, ',');
  24343. },
  24344. postformat: function (string) {
  24345. return string.replace(/\d/g, function (match) {
  24346. return ar_sa__symbolMap[match];
  24347. }).replace(/,/g, '،');
  24348. },
  24349. week : {
  24350. dow : 6, // Saturday is the first day of the week.
  24351. doy : 12 // The week that contains Jan 1st is the first week of the year.
  24352. }
  24353. });
  24354. var ar_tn = moment__default.defineLocale('ar-tn', {
  24355. months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  24356. monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  24357. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  24358. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  24359. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  24360. weekdaysParseExact : true,
  24361. longDateFormat: {
  24362. LT: 'HH:mm',
  24363. LTS: 'HH:mm:ss',
  24364. L: 'DD/MM/YYYY',
  24365. LL: 'D MMMM YYYY',
  24366. LLL: 'D MMMM YYYY HH:mm',
  24367. LLLL: 'dddd D MMMM YYYY HH:mm'
  24368. },
  24369. calendar: {
  24370. sameDay: '[اليوم على الساعة] LT',
  24371. nextDay: '[غدا على الساعة] LT',
  24372. nextWeek: 'dddd [على الساعة] LT',
  24373. lastDay: '[أمس على الساعة] LT',
  24374. lastWeek: 'dddd [على الساعة] LT',
  24375. sameElse: 'L'
  24376. },
  24377. relativeTime: {
  24378. future: 'في %s',
  24379. past: 'منذ %s',
  24380. s: 'ثوان',
  24381. m: 'دقيقة',
  24382. mm: '%d دقائق',
  24383. h: 'ساعة',
  24384. hh: '%d ساعات',
  24385. d: 'يوم',
  24386. dd: '%d أيام',
  24387. M: 'شهر',
  24388. MM: '%d أشهر',
  24389. y: 'سنة',
  24390. yy: '%d سنوات'
  24391. },
  24392. week: {
  24393. dow: 1, // Monday is the first day of the week.
  24394. doy: 4 // The week that contains Jan 4th is the first week of the year.
  24395. }
  24396. });
  24397. var ar__symbolMap = {
  24398. '1': '١',
  24399. '2': '٢',
  24400. '3': '٣',
  24401. '4': '٤',
  24402. '5': '٥',
  24403. '6': '٦',
  24404. '7': '٧',
  24405. '8': '٨',
  24406. '9': '٩',
  24407. '0': '٠'
  24408. }, ar__numberMap = {
  24409. '١': '1',
  24410. '٢': '2',
  24411. '٣': '3',
  24412. '٤': '4',
  24413. '٥': '5',
  24414. '٦': '6',
  24415. '٧': '7',
  24416. '٨': '8',
  24417. '٩': '9',
  24418. '٠': '0'
  24419. }, pluralForm = function (n) {
  24420. return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
  24421. }, plurals = {
  24422. s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
  24423. m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
  24424. h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
  24425. d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
  24426. M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
  24427. y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
  24428. }, pluralize = function (u) {
  24429. return function (number, withoutSuffix, string, isFuture) {
  24430. var f = pluralForm(number),
  24431. str = plurals[u][pluralForm(number)];
  24432. if (f === 2) {
  24433. str = str[withoutSuffix ? 0 : 1];
  24434. }
  24435. return str.replace(/%d/i, number);
  24436. };
  24437. }, ar__months = [
  24438. 'كانون الثاني يناير',
  24439. 'شباط فبراير',
  24440. 'آذار مارس',
  24441. 'نيسان أبريل',
  24442. 'أيار مايو',
  24443. 'حزيران يونيو',
  24444. 'تموز يوليو',
  24445. 'آب أغسطس',
  24446. 'أيلول سبتمبر',
  24447. 'تشرين الأول أكتوبر',
  24448. 'تشرين الثاني نوفمبر',
  24449. 'كانون الأول ديسمبر'
  24450. ];
  24451. var ar = moment__default.defineLocale('ar', {
  24452. months : ar__months,
  24453. monthsShort : ar__months,
  24454. weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  24455. weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  24456. weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  24457. weekdaysParseExact : true,
  24458. longDateFormat : {
  24459. LT : 'HH:mm',
  24460. LTS : 'HH:mm:ss',
  24461. L : 'D/\u200FM/\u200FYYYY',
  24462. LL : 'D MMMM YYYY',
  24463. LLL : 'D MMMM YYYY HH:mm',
  24464. LLLL : 'dddd D MMMM YYYY HH:mm'
  24465. },
  24466. meridiemParse: /ص|م/,
  24467. isPM : function (input) {
  24468. return 'م' === input;
  24469. },
  24470. meridiem : function (hour, minute, isLower) {
  24471. if (hour < 12) {
  24472. return 'ص';
  24473. } else {
  24474. return 'م';
  24475. }
  24476. },
  24477. calendar : {
  24478. sameDay: '[اليوم عند الساعة] LT',
  24479. nextDay: '[غدًا عند الساعة] LT',
  24480. nextWeek: 'dddd [عند الساعة] LT',
  24481. lastDay: '[أمس عند الساعة] LT',
  24482. lastWeek: 'dddd [عند الساعة] LT',
  24483. sameElse: 'L'
  24484. },
  24485. relativeTime : {
  24486. future : 'بعد %s',
  24487. past : 'منذ %s',
  24488. s : pluralize('s'),
  24489. m : pluralize('m'),
  24490. mm : pluralize('m'),
  24491. h : pluralize('h'),
  24492. hh : pluralize('h'),
  24493. d : pluralize('d'),
  24494. dd : pluralize('d'),
  24495. M : pluralize('M'),
  24496. MM : pluralize('M'),
  24497. y : pluralize('y'),
  24498. yy : pluralize('y')
  24499. },
  24500. preparse: function (string) {
  24501. return string.replace(/\u200f/g, '').replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  24502. return ar__numberMap[match];
  24503. }).replace(/،/g, ',');
  24504. },
  24505. postformat: function (string) {
  24506. return string.replace(/\d/g, function (match) {
  24507. return ar__symbolMap[match];
  24508. }).replace(/,/g, '،');
  24509. },
  24510. week : {
  24511. dow : 6, // Saturday is the first day of the week.
  24512. doy : 12 // The week that contains Jan 1st is the first week of the year.
  24513. }
  24514. });
  24515. var az__suffixes = {
  24516. 1: '-inci',
  24517. 5: '-inci',
  24518. 8: '-inci',
  24519. 70: '-inci',
  24520. 80: '-inci',
  24521. 2: '-nci',
  24522. 7: '-nci',
  24523. 20: '-nci',
  24524. 50: '-nci',
  24525. 3: '-üncü',
  24526. 4: '-üncü',
  24527. 100: '-üncü',
  24528. 6: '-ncı',
  24529. 9: '-uncu',
  24530. 10: '-uncu',
  24531. 30: '-uncu',
  24532. 60: '-ıncı',
  24533. 90: '-ıncı'
  24534. };
  24535. var az = moment__default.defineLocale('az', {
  24536. months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),
  24537. monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
  24538. weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),
  24539. weekdaysShort : 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
  24540. weekdaysMin : 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
  24541. weekdaysParseExact : true,
  24542. longDateFormat : {
  24543. LT : 'HH:mm',
  24544. LTS : 'HH:mm:ss',
  24545. L : 'DD.MM.YYYY',
  24546. LL : 'D MMMM YYYY',
  24547. LLL : 'D MMMM YYYY HH:mm',
  24548. LLLL : 'dddd, D MMMM YYYY HH:mm'
  24549. },
  24550. calendar : {
  24551. sameDay : '[bugün saat] LT',
  24552. nextDay : '[sabah saat] LT',
  24553. nextWeek : '[gələn həftə] dddd [saat] LT',
  24554. lastDay : '[dünən] LT',
  24555. lastWeek : '[keçən həftə] dddd [saat] LT',
  24556. sameElse : 'L'
  24557. },
  24558. relativeTime : {
  24559. future : '%s sonra',
  24560. past : '%s əvvəl',
  24561. s : 'birneçə saniyyə',
  24562. m : 'bir dəqiqə',
  24563. mm : '%d dəqiqə',
  24564. h : 'bir saat',
  24565. hh : '%d saat',
  24566. d : 'bir gün',
  24567. dd : '%d gün',
  24568. M : 'bir ay',
  24569. MM : '%d ay',
  24570. y : 'bir il',
  24571. yy : '%d il'
  24572. },
  24573. meridiemParse: /gecə|səhər|gündüz|axşam/,
  24574. isPM : function (input) {
  24575. return /^(gündüz|axşam)$/.test(input);
  24576. },
  24577. meridiem : function (hour, minute, isLower) {
  24578. if (hour < 4) {
  24579. return 'gecə';
  24580. } else if (hour < 12) {
  24581. return 'səhər';
  24582. } else if (hour < 17) {
  24583. return 'gündüz';
  24584. } else {
  24585. return 'axşam';
  24586. }
  24587. },
  24588. ordinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,
  24589. ordinal : function (number) {
  24590. if (number === 0) { // special case for zero
  24591. return number + '-ıncı';
  24592. }
  24593. var a = number % 10,
  24594. b = number % 100 - a,
  24595. c = number >= 100 ? 100 : null;
  24596. return number + (az__suffixes[a] || az__suffixes[b] || az__suffixes[c]);
  24597. },
  24598. week : {
  24599. dow : 1, // Monday is the first day of the week.
  24600. doy : 7 // The week that contains Jan 1st is the first week of the year.
  24601. }
  24602. });
  24603. function be__plural(word, num) {
  24604. var forms = word.split('_');
  24605. return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
  24606. }
  24607. function be__relativeTimeWithPlural(number, withoutSuffix, key) {
  24608. var format = {
  24609. 'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
  24610. 'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
  24611. 'dd': 'дзень_дні_дзён',
  24612. 'MM': 'месяц_месяцы_месяцаў',
  24613. 'yy': 'год_гады_гадоў'
  24614. };
  24615. if (key === 'm') {
  24616. return withoutSuffix ? 'хвіліна' : 'хвіліну';
  24617. }
  24618. else if (key === 'h') {
  24619. return withoutSuffix ? 'гадзіна' : 'гадзіну';
  24620. }
  24621. else {
  24622. return number + ' ' + be__plural(format[key], +number);
  24623. }
  24624. }
  24625. var be = moment__default.defineLocale('be', {
  24626. months : {
  24627. format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'),
  24628. standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_')
  24629. },
  24630. monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),
  24631. weekdays : {
  24632. format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'),
  24633. standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),
  24634. isFormat: /\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/
  24635. },
  24636. weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
  24637. weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
  24638. longDateFormat : {
  24639. LT : 'HH:mm',
  24640. LTS : 'HH:mm:ss',
  24641. L : 'DD.MM.YYYY',
  24642. LL : 'D MMMM YYYY г.',
  24643. LLL : 'D MMMM YYYY г., HH:mm',
  24644. LLLL : 'dddd, D MMMM YYYY г., HH:mm'
  24645. },
  24646. calendar : {
  24647. sameDay: '[Сёння ў] LT',
  24648. nextDay: '[Заўтра ў] LT',
  24649. lastDay: '[Учора ў] LT',
  24650. nextWeek: function () {
  24651. return '[У] dddd [ў] LT';
  24652. },
  24653. lastWeek: function () {
  24654. switch (this.day()) {
  24655. case 0:
  24656. case 3:
  24657. case 5:
  24658. case 6:
  24659. return '[У мінулую] dddd [ў] LT';
  24660. case 1:
  24661. case 2:
  24662. case 4:
  24663. return '[У мінулы] dddd [ў] LT';
  24664. }
  24665. },
  24666. sameElse: 'L'
  24667. },
  24668. relativeTime : {
  24669. future : 'праз %s',
  24670. past : '%s таму',
  24671. s : 'некалькі секунд',
  24672. m : be__relativeTimeWithPlural,
  24673. mm : be__relativeTimeWithPlural,
  24674. h : be__relativeTimeWithPlural,
  24675. hh : be__relativeTimeWithPlural,
  24676. d : 'дзень',
  24677. dd : be__relativeTimeWithPlural,
  24678. M : 'месяц',
  24679. MM : be__relativeTimeWithPlural,
  24680. y : 'год',
  24681. yy : be__relativeTimeWithPlural
  24682. },
  24683. meridiemParse: /ночы|раніцы|дня|вечара/,
  24684. isPM : function (input) {
  24685. return /^(дня|вечара)$/.test(input);
  24686. },
  24687. meridiem : function (hour, minute, isLower) {
  24688. if (hour < 4) {
  24689. return 'ночы';
  24690. } else if (hour < 12) {
  24691. return 'раніцы';
  24692. } else if (hour < 17) {
  24693. return 'дня';
  24694. } else {
  24695. return 'вечара';
  24696. }
  24697. },
  24698. ordinalParse: /\d{1,2}-(і|ы|га)/,
  24699. ordinal: function (number, period) {
  24700. switch (period) {
  24701. case 'M':
  24702. case 'd':
  24703. case 'DDD':
  24704. case 'w':
  24705. case 'W':
  24706. return (number % 10 === 2 || number % 10 === 3) && (number % 100 !== 12 && number % 100 !== 13) ? number + '-і' : number + '-ы';
  24707. case 'D':
  24708. return number + '-га';
  24709. default:
  24710. return number;
  24711. }
  24712. },
  24713. week : {
  24714. dow : 1, // Monday is the first day of the week.
  24715. doy : 7 // The week that contains Jan 1st is the first week of the year.
  24716. }
  24717. });
  24718. var bg = moment__default.defineLocale('bg', {
  24719. months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),
  24720. monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
  24721. weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),
  24722. weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
  24723. weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  24724. longDateFormat : {
  24725. LT : 'H:mm',
  24726. LTS : 'H:mm:ss',
  24727. L : 'D.MM.YYYY',
  24728. LL : 'D MMMM YYYY',
  24729. LLL : 'D MMMM YYYY H:mm',
  24730. LLLL : 'dddd, D MMMM YYYY H:mm'
  24731. },
  24732. calendar : {
  24733. sameDay : '[Днес в] LT',
  24734. nextDay : '[Утре в] LT',
  24735. nextWeek : 'dddd [в] LT',
  24736. lastDay : '[Вчера в] LT',
  24737. lastWeek : function () {
  24738. switch (this.day()) {
  24739. case 0:
  24740. case 3:
  24741. case 6:
  24742. return '[В изминалата] dddd [в] LT';
  24743. case 1:
  24744. case 2:
  24745. case 4:
  24746. case 5:
  24747. return '[В изминалия] dddd [в] LT';
  24748. }
  24749. },
  24750. sameElse : 'L'
  24751. },
  24752. relativeTime : {
  24753. future : 'след %s',
  24754. past : 'преди %s',
  24755. s : 'няколко секунди',
  24756. m : 'минута',
  24757. mm : '%d минути',
  24758. h : 'час',
  24759. hh : '%d часа',
  24760. d : 'ден',
  24761. dd : '%d дни',
  24762. M : 'месец',
  24763. MM : '%d месеца',
  24764. y : 'година',
  24765. yy : '%d години'
  24766. },
  24767. ordinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
  24768. ordinal : function (number) {
  24769. var lastDigit = number % 10,
  24770. last2Digits = number % 100;
  24771. if (number === 0) {
  24772. return number + '-ев';
  24773. } else if (last2Digits === 0) {
  24774. return number + '-ен';
  24775. } else if (last2Digits > 10 && last2Digits < 20) {
  24776. return number + '-ти';
  24777. } else if (lastDigit === 1) {
  24778. return number + '-ви';
  24779. } else if (lastDigit === 2) {
  24780. return number + '-ри';
  24781. } else if (lastDigit === 7 || lastDigit === 8) {
  24782. return number + '-ми';
  24783. } else {
  24784. return number + '-ти';
  24785. }
  24786. },
  24787. week : {
  24788. dow : 1, // Monday is the first day of the week.
  24789. doy : 7 // The week that contains Jan 1st is the first week of the year.
  24790. }
  24791. });
  24792. var bn__symbolMap = {
  24793. '1': '১',
  24794. '2': '২',
  24795. '3': '৩',
  24796. '4': '৪',
  24797. '5': '৫',
  24798. '6': '৬',
  24799. '7': '৭',
  24800. '8': '৮',
  24801. '9': '৯',
  24802. '0': '০'
  24803. },
  24804. bn__numberMap = {
  24805. '১': '1',
  24806. '২': '2',
  24807. '৩': '3',
  24808. '৪': '4',
  24809. '৫': '5',
  24810. '৬': '6',
  24811. '৭': '7',
  24812. '৮': '8',
  24813. '৯': '9',
  24814. '০': '0'
  24815. };
  24816. var bn = moment__default.defineLocale('bn', {
  24817. months : 'জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'),
  24818. monthsShort : 'জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্'.split('_'),
  24819. weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রবার_শনিবার'.split('_'),
  24820. weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্র_শনি'.split('_'),
  24821. weekdaysMin : 'রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি'.split('_'),
  24822. longDateFormat : {
  24823. LT : 'A h:mm সময়',
  24824. LTS : 'A h:mm:ss সময়',
  24825. L : 'DD/MM/YYYY',
  24826. LL : 'D MMMM YYYY',
  24827. LLL : 'D MMMM YYYY, A h:mm সময়',
  24828. LLLL : 'dddd, D MMMM YYYY, A h:mm সময়'
  24829. },
  24830. calendar : {
  24831. sameDay : '[আজ] LT',
  24832. nextDay : '[আগামীকাল] LT',
  24833. nextWeek : 'dddd, LT',
  24834. lastDay : '[গতকাল] LT',
  24835. lastWeek : '[গত] dddd, LT',
  24836. sameElse : 'L'
  24837. },
  24838. relativeTime : {
  24839. future : '%s পরে',
  24840. past : '%s আগে',
  24841. s : 'কয়েক সেকেন্ড',
  24842. m : 'এক মিনিট',
  24843. mm : '%d মিনিট',
  24844. h : 'এক ঘন্টা',
  24845. hh : '%d ঘন্টা',
  24846. d : 'এক দিন',
  24847. dd : '%d দিন',
  24848. M : 'এক মাস',
  24849. MM : '%d মাস',
  24850. y : 'এক বছর',
  24851. yy : '%d বছর'
  24852. },
  24853. preparse: function (string) {
  24854. return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
  24855. return bn__numberMap[match];
  24856. });
  24857. },
  24858. postformat: function (string) {
  24859. return string.replace(/\d/g, function (match) {
  24860. return bn__symbolMap[match];
  24861. });
  24862. },
  24863. meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,
  24864. meridiemHour : function (hour, meridiem) {
  24865. if (hour === 12) {
  24866. hour = 0;
  24867. }
  24868. if ((meridiem === 'রাত' && hour >= 4) ||
  24869. (meridiem === 'দুপুর' && hour < 5) ||
  24870. meridiem === 'বিকাল') {
  24871. return hour + 12;
  24872. } else {
  24873. return hour;
  24874. }
  24875. },
  24876. meridiem : function (hour, minute, isLower) {
  24877. if (hour < 4) {
  24878. return 'রাত';
  24879. } else if (hour < 10) {
  24880. return 'সকাল';
  24881. } else if (hour < 17) {
  24882. return 'দুপুর';
  24883. } else if (hour < 20) {
  24884. return 'বিকাল';
  24885. } else {
  24886. return 'রাত';
  24887. }
  24888. },
  24889. week : {
  24890. dow : 0, // Sunday is the first day of the week.
  24891. doy : 6 // The week that contains Jan 1st is the first week of the year.
  24892. }
  24893. });
  24894. var bo__symbolMap = {
  24895. '1': '༡',
  24896. '2': '༢',
  24897. '3': '༣',
  24898. '4': '༤',
  24899. '5': '༥',
  24900. '6': '༦',
  24901. '7': '༧',
  24902. '8': '༨',
  24903. '9': '༩',
  24904. '0': '༠'
  24905. },
  24906. bo__numberMap = {
  24907. '༡': '1',
  24908. '༢': '2',
  24909. '༣': '3',
  24910. '༤': '4',
  24911. '༥': '5',
  24912. '༦': '6',
  24913. '༧': '7',
  24914. '༨': '8',
  24915. '༩': '9',
  24916. '༠': '0'
  24917. };
  24918. var bo = moment__default.defineLocale('bo', {
  24919. months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
  24920. monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
  24921. weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'),
  24922. weekdaysShort : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
  24923. weekdaysMin : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
  24924. longDateFormat : {
  24925. LT : 'A h:mm',
  24926. LTS : 'A h:mm:ss',
  24927. L : 'DD/MM/YYYY',
  24928. LL : 'D MMMM YYYY',
  24929. LLL : 'D MMMM YYYY, A h:mm',
  24930. LLLL : 'dddd, D MMMM YYYY, A h:mm'
  24931. },
  24932. calendar : {
  24933. sameDay : '[དི་རིང] LT',
  24934. nextDay : '[སང་ཉིན] LT',
  24935. nextWeek : '[བདུན་ཕྲག་རྗེས་མ], LT',
  24936. lastDay : '[ཁ་སང] LT',
  24937. lastWeek : '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',
  24938. sameElse : 'L'
  24939. },
  24940. relativeTime : {
  24941. future : '%s ལ་',
  24942. past : '%s སྔན་ལ',
  24943. s : 'ལམ་སང',
  24944. m : 'སྐར་མ་གཅིག',
  24945. mm : '%d སྐར་མ',
  24946. h : 'ཆུ་ཚོད་གཅིག',
  24947. hh : '%d ཆུ་ཚོད',
  24948. d : 'ཉིན་གཅིག',
  24949. dd : '%d ཉིན་',
  24950. M : 'ཟླ་བ་གཅིག',
  24951. MM : '%d ཟླ་བ',
  24952. y : 'ལོ་གཅིག',
  24953. yy : '%d ལོ'
  24954. },
  24955. preparse: function (string) {
  24956. return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {
  24957. return bo__numberMap[match];
  24958. });
  24959. },
  24960. postformat: function (string) {
  24961. return string.replace(/\d/g, function (match) {
  24962. return bo__symbolMap[match];
  24963. });
  24964. },
  24965. meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,
  24966. meridiemHour : function (hour, meridiem) {
  24967. if (hour === 12) {
  24968. hour = 0;
  24969. }
  24970. if ((meridiem === 'མཚན་མོ' && hour >= 4) ||
  24971. (meridiem === 'ཉིན་གུང' && hour < 5) ||
  24972. meridiem === 'དགོང་དག') {
  24973. return hour + 12;
  24974. } else {
  24975. return hour;
  24976. }
  24977. },
  24978. meridiem : function (hour, minute, isLower) {
  24979. if (hour < 4) {
  24980. return 'མཚན་མོ';
  24981. } else if (hour < 10) {
  24982. return 'ཞོགས་ཀས';
  24983. } else if (hour < 17) {
  24984. return 'ཉིན་གུང';
  24985. } else if (hour < 20) {
  24986. return 'དགོང་དག';
  24987. } else {
  24988. return 'མཚན་མོ';
  24989. }
  24990. },
  24991. week : {
  24992. dow : 0, // Sunday is the first day of the week.
  24993. doy : 6 // The week that contains Jan 1st is the first week of the year.
  24994. }
  24995. });
  24996. function relativeTimeWithMutation(number, withoutSuffix, key) {
  24997. var format = {
  24998. 'mm': 'munutenn',
  24999. 'MM': 'miz',
  25000. 'dd': 'devezh'
  25001. };
  25002. return number + ' ' + mutation(format[key], number);
  25003. }
  25004. function specialMutationForYears(number) {
  25005. switch (lastNumber(number)) {
  25006. case 1:
  25007. case 3:
  25008. case 4:
  25009. case 5:
  25010. case 9:
  25011. return number + ' bloaz';
  25012. default:
  25013. return number + ' vloaz';
  25014. }
  25015. }
  25016. function lastNumber(number) {
  25017. if (number > 9) {
  25018. return lastNumber(number % 10);
  25019. }
  25020. return number;
  25021. }
  25022. function mutation(text, number) {
  25023. if (number === 2) {
  25024. return softMutation(text);
  25025. }
  25026. return text;
  25027. }
  25028. function softMutation(text) {
  25029. var mutationTable = {
  25030. 'm': 'v',
  25031. 'b': 'v',
  25032. 'd': 'z'
  25033. };
  25034. if (mutationTable[text.charAt(0)] === undefined) {
  25035. return text;
  25036. }
  25037. return mutationTable[text.charAt(0)] + text.substring(1);
  25038. }
  25039. var br = moment__default.defineLocale('br', {
  25040. months : 'Genver_C\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),
  25041. monthsShort : 'Gen_C\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
  25042. weekdays : 'Sul_Lun_Meurzh_Merc\'her_Yaou_Gwener_Sadorn'.split('_'),
  25043. weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
  25044. weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
  25045. weekdaysParseExact : true,
  25046. longDateFormat : {
  25047. LT : 'h[e]mm A',
  25048. LTS : 'h[e]mm:ss A',
  25049. L : 'DD/MM/YYYY',
  25050. LL : 'D [a viz] MMMM YYYY',
  25051. LLL : 'D [a viz] MMMM YYYY h[e]mm A',
  25052. LLLL : 'dddd, D [a viz] MMMM YYYY h[e]mm A'
  25053. },
  25054. calendar : {
  25055. sameDay : '[Hiziv da] LT',
  25056. nextDay : '[Warc\'hoazh da] LT',
  25057. nextWeek : 'dddd [da] LT',
  25058. lastDay : '[Dec\'h da] LT',
  25059. lastWeek : 'dddd [paset da] LT',
  25060. sameElse : 'L'
  25061. },
  25062. relativeTime : {
  25063. future : 'a-benn %s',
  25064. past : '%s \'zo',
  25065. s : 'un nebeud segondennoù',
  25066. m : 'ur vunutenn',
  25067. mm : relativeTimeWithMutation,
  25068. h : 'un eur',
  25069. hh : '%d eur',
  25070. d : 'un devezh',
  25071. dd : relativeTimeWithMutation,
  25072. M : 'ur miz',
  25073. MM : relativeTimeWithMutation,
  25074. y : 'ur bloaz',
  25075. yy : specialMutationForYears
  25076. },
  25077. ordinalParse: /\d{1,2}(añ|vet)/,
  25078. ordinal : function (number) {
  25079. var output = (number === 1) ? 'añ' : 'vet';
  25080. return number + output;
  25081. },
  25082. week : {
  25083. dow : 1, // Monday is the first day of the week.
  25084. doy : 4 // The week that contains Jan 4th is the first week of the year.
  25085. }
  25086. });
  25087. function bs__translate(number, withoutSuffix, key) {
  25088. var result = number + ' ';
  25089. switch (key) {
  25090. case 'm':
  25091. return withoutSuffix ? 'jedna minuta' : 'jedne minute';
  25092. case 'mm':
  25093. if (number === 1) {
  25094. result += 'minuta';
  25095. } else if (number === 2 || number === 3 || number === 4) {
  25096. result += 'minute';
  25097. } else {
  25098. result += 'minuta';
  25099. }
  25100. return result;
  25101. case 'h':
  25102. return withoutSuffix ? 'jedan sat' : 'jednog sata';
  25103. case 'hh':
  25104. if (number === 1) {
  25105. result += 'sat';
  25106. } else if (number === 2 || number === 3 || number === 4) {
  25107. result += 'sata';
  25108. } else {
  25109. result += 'sati';
  25110. }
  25111. return result;
  25112. case 'dd':
  25113. if (number === 1) {
  25114. result += 'dan';
  25115. } else {
  25116. result += 'dana';
  25117. }
  25118. return result;
  25119. case 'MM':
  25120. if (number === 1) {
  25121. result += 'mjesec';
  25122. } else if (number === 2 || number === 3 || number === 4) {
  25123. result += 'mjeseca';
  25124. } else {
  25125. result += 'mjeseci';
  25126. }
  25127. return result;
  25128. case 'yy':
  25129. if (number === 1) {
  25130. result += 'godina';
  25131. } else if (number === 2 || number === 3 || number === 4) {
  25132. result += 'godine';
  25133. } else {
  25134. result += 'godina';
  25135. }
  25136. return result;
  25137. }
  25138. }
  25139. var bs = moment__default.defineLocale('bs', {
  25140. months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'),
  25141. monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),
  25142. monthsParseExact: true,
  25143. weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
  25144. weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  25145. weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),
  25146. weekdaysParseExact : true,
  25147. longDateFormat : {
  25148. LT : 'H:mm',
  25149. LTS : 'H:mm:ss',
  25150. L : 'DD. MM. YYYY',
  25151. LL : 'D. MMMM YYYY',
  25152. LLL : 'D. MMMM YYYY H:mm',
  25153. LLLL : 'dddd, D. MMMM YYYY H:mm'
  25154. },
  25155. calendar : {
  25156. sameDay : '[danas u] LT',
  25157. nextDay : '[sutra u] LT',
  25158. nextWeek : function () {
  25159. switch (this.day()) {
  25160. case 0:
  25161. return '[u] [nedjelju] [u] LT';
  25162. case 3:
  25163. return '[u] [srijedu] [u] LT';
  25164. case 6:
  25165. return '[u] [subotu] [u] LT';
  25166. case 1:
  25167. case 2:
  25168. case 4:
  25169. case 5:
  25170. return '[u] dddd [u] LT';
  25171. }
  25172. },
  25173. lastDay : '[jučer u] LT',
  25174. lastWeek : function () {
  25175. switch (this.day()) {
  25176. case 0:
  25177. case 3:
  25178. return '[prošlu] dddd [u] LT';
  25179. case 6:
  25180. return '[prošle] [subote] [u] LT';
  25181. case 1:
  25182. case 2:
  25183. case 4:
  25184. case 5:
  25185. return '[prošli] dddd [u] LT';
  25186. }
  25187. },
  25188. sameElse : 'L'
  25189. },
  25190. relativeTime : {
  25191. future : 'za %s',
  25192. past : 'prije %s',
  25193. s : 'par sekundi',
  25194. m : bs__translate,
  25195. mm : bs__translate,
  25196. h : bs__translate,
  25197. hh : bs__translate,
  25198. d : 'dan',
  25199. dd : bs__translate,
  25200. M : 'mjesec',
  25201. MM : bs__translate,
  25202. y : 'godinu',
  25203. yy : bs__translate
  25204. },
  25205. ordinalParse: /\d{1,2}\./,
  25206. ordinal : '%d.',
  25207. week : {
  25208. dow : 1, // Monday is the first day of the week.
  25209. doy : 7 // The week that contains Jan 1st is the first week of the year.
  25210. }
  25211. });
  25212. var ca = moment__default.defineLocale('ca', {
  25213. months : 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),
  25214. monthsShort : 'gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.'.split('_'),
  25215. monthsParseExact : true,
  25216. weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),
  25217. weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),
  25218. weekdaysMin : 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'),
  25219. weekdaysParseExact : true,
  25220. longDateFormat : {
  25221. LT : 'H:mm',
  25222. LTS : 'H:mm:ss',
  25223. L : 'DD/MM/YYYY',
  25224. LL : 'D MMMM YYYY',
  25225. LLL : 'D MMMM YYYY H:mm',
  25226. LLLL : 'dddd D MMMM YYYY H:mm'
  25227. },
  25228. calendar : {
  25229. sameDay : function () {
  25230. return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  25231. },
  25232. nextDay : function () {
  25233. return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  25234. },
  25235. nextWeek : function () {
  25236. return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  25237. },
  25238. lastDay : function () {
  25239. return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  25240. },
  25241. lastWeek : function () {
  25242. return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  25243. },
  25244. sameElse : 'L'
  25245. },
  25246. relativeTime : {
  25247. future : 'en %s',
  25248. past : 'fa %s',
  25249. s : 'uns segons',
  25250. m : 'un minut',
  25251. mm : '%d minuts',
  25252. h : 'una hora',
  25253. hh : '%d hores',
  25254. d : 'un dia',
  25255. dd : '%d dies',
  25256. M : 'un mes',
  25257. MM : '%d mesos',
  25258. y : 'un any',
  25259. yy : '%d anys'
  25260. },
  25261. ordinalParse: /\d{1,2}(r|n|t|è|a)/,
  25262. ordinal : function (number, period) {
  25263. var output = (number === 1) ? 'r' :
  25264. (number === 2) ? 'n' :
  25265. (number === 3) ? 'r' :
  25266. (number === 4) ? 't' : 'è';
  25267. if (period === 'w' || period === 'W') {
  25268. output = 'a';
  25269. }
  25270. return number + output;
  25271. },
  25272. week : {
  25273. dow : 1, // Monday is the first day of the week.
  25274. doy : 4 // The week that contains Jan 4th is the first week of the year.
  25275. }
  25276. });
  25277. var cs__months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'),
  25278. cs__monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');
  25279. function cs__plural(n) {
  25280. return (n > 1) && (n < 5) && (~~(n / 10) !== 1);
  25281. }
  25282. function cs__translate(number, withoutSuffix, key, isFuture) {
  25283. var result = number + ' ';
  25284. switch (key) {
  25285. case 's': // a few seconds / in a few seconds / a few seconds ago
  25286. return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';
  25287. case 'm': // a minute / in a minute / a minute ago
  25288. return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');
  25289. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  25290. if (withoutSuffix || isFuture) {
  25291. return result + (cs__plural(number) ? 'minuty' : 'minut');
  25292. } else {
  25293. return result + 'minutami';
  25294. }
  25295. break;
  25296. case 'h': // an hour / in an hour / an hour ago
  25297. return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
  25298. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  25299. if (withoutSuffix || isFuture) {
  25300. return result + (cs__plural(number) ? 'hodiny' : 'hodin');
  25301. } else {
  25302. return result + 'hodinami';
  25303. }
  25304. break;
  25305. case 'd': // a day / in a day / a day ago
  25306. return (withoutSuffix || isFuture) ? 'den' : 'dnem';
  25307. case 'dd': // 9 days / in 9 days / 9 days ago
  25308. if (withoutSuffix || isFuture) {
  25309. return result + (cs__plural(number) ? 'dny' : 'dní');
  25310. } else {
  25311. return result + 'dny';
  25312. }
  25313. break;
  25314. case 'M': // a month / in a month / a month ago
  25315. return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';
  25316. case 'MM': // 9 months / in 9 months / 9 months ago
  25317. if (withoutSuffix || isFuture) {
  25318. return result + (cs__plural(number) ? 'měsíce' : 'měsíců');
  25319. } else {
  25320. return result + 'měsíci';
  25321. }
  25322. break;
  25323. case 'y': // a year / in a year / a year ago
  25324. return (withoutSuffix || isFuture) ? 'rok' : 'rokem';
  25325. case 'yy': // 9 years / in 9 years / 9 years ago
  25326. if (withoutSuffix || isFuture) {
  25327. return result + (cs__plural(number) ? 'roky' : 'let');
  25328. } else {
  25329. return result + 'lety';
  25330. }
  25331. break;
  25332. }
  25333. }
  25334. var cs = moment__default.defineLocale('cs', {
  25335. months : cs__months,
  25336. monthsShort : cs__monthsShort,
  25337. monthsParse : (function (months, monthsShort) {
  25338. var i, _monthsParse = [];
  25339. for (i = 0; i < 12; i++) {
  25340. // use custom parser to solve problem with July (červenec)
  25341. _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
  25342. }
  25343. return _monthsParse;
  25344. }(cs__months, cs__monthsShort)),
  25345. shortMonthsParse : (function (monthsShort) {
  25346. var i, _shortMonthsParse = [];
  25347. for (i = 0; i < 12; i++) {
  25348. _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i');
  25349. }
  25350. return _shortMonthsParse;
  25351. }(cs__monthsShort)),
  25352. longMonthsParse : (function (months) {
  25353. var i, _longMonthsParse = [];
  25354. for (i = 0; i < 12; i++) {
  25355. _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i');
  25356. }
  25357. return _longMonthsParse;
  25358. }(cs__months)),
  25359. weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
  25360. weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'),
  25361. weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'),
  25362. longDateFormat : {
  25363. LT: 'H:mm',
  25364. LTS : 'H:mm:ss',
  25365. L : 'DD.MM.YYYY',
  25366. LL : 'D. MMMM YYYY',
  25367. LLL : 'D. MMMM YYYY H:mm',
  25368. LLLL : 'dddd D. MMMM YYYY H:mm',
  25369. l : 'D. M. YYYY'
  25370. },
  25371. calendar : {
  25372. sameDay: '[dnes v] LT',
  25373. nextDay: '[zítra v] LT',
  25374. nextWeek: function () {
  25375. switch (this.day()) {
  25376. case 0:
  25377. return '[v neděli v] LT';
  25378. case 1:
  25379. case 2:
  25380. return '[v] dddd [v] LT';
  25381. case 3:
  25382. return '[ve středu v] LT';
  25383. case 4:
  25384. return '[ve čtvrtek v] LT';
  25385. case 5:
  25386. return '[v pátek v] LT';
  25387. case 6:
  25388. return '[v sobotu v] LT';
  25389. }
  25390. },
  25391. lastDay: '[včera v] LT',
  25392. lastWeek: function () {
  25393. switch (this.day()) {
  25394. case 0:
  25395. return '[minulou neděli v] LT';
  25396. case 1:
  25397. case 2:
  25398. return '[minulé] dddd [v] LT';
  25399. case 3:
  25400. return '[minulou středu v] LT';
  25401. case 4:
  25402. case 5:
  25403. return '[minulý] dddd [v] LT';
  25404. case 6:
  25405. return '[minulou sobotu v] LT';
  25406. }
  25407. },
  25408. sameElse: 'L'
  25409. },
  25410. relativeTime : {
  25411. future : 'za %s',
  25412. past : 'před %s',
  25413. s : cs__translate,
  25414. m : cs__translate,
  25415. mm : cs__translate,
  25416. h : cs__translate,
  25417. hh : cs__translate,
  25418. d : cs__translate,
  25419. dd : cs__translate,
  25420. M : cs__translate,
  25421. MM : cs__translate,
  25422. y : cs__translate,
  25423. yy : cs__translate
  25424. },
  25425. ordinalParse : /\d{1,2}\./,
  25426. ordinal : '%d.',
  25427. week : {
  25428. dow : 1, // Monday is the first day of the week.
  25429. doy : 4 // The week that contains Jan 4th is the first week of the year.
  25430. }
  25431. });
  25432. var cv = moment__default.defineLocale('cv', {
  25433. months : 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split('_'),
  25434. monthsShort : 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),
  25435. weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split('_'),
  25436. weekdaysShort : 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),
  25437. weekdaysMin : 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),
  25438. longDateFormat : {
  25439. LT : 'HH:mm',
  25440. LTS : 'HH:mm:ss',
  25441. L : 'DD-MM-YYYY',
  25442. LL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
  25443. LLL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
  25444. LLLL : 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm'
  25445. },
  25446. calendar : {
  25447. sameDay: '[Паян] LT [сехетре]',
  25448. nextDay: '[Ыран] LT [сехетре]',
  25449. lastDay: '[Ӗнер] LT [сехетре]',
  25450. nextWeek: '[Ҫитес] dddd LT [сехетре]',
  25451. lastWeek: '[Иртнӗ] dddd LT [сехетре]',
  25452. sameElse: 'L'
  25453. },
  25454. relativeTime : {
  25455. future : function (output) {
  25456. var affix = /сехет$/i.exec(output) ? 'рен' : /ҫул$/i.exec(output) ? 'тан' : 'ран';
  25457. return output + affix;
  25458. },
  25459. past : '%s каялла',
  25460. s : 'пӗр-ик ҫеккунт',
  25461. m : 'пӗр минут',
  25462. mm : '%d минут',
  25463. h : 'пӗр сехет',
  25464. hh : '%d сехет',
  25465. d : 'пӗр кун',
  25466. dd : '%d кун',
  25467. M : 'пӗр уйӑх',
  25468. MM : '%d уйӑх',
  25469. y : 'пӗр ҫул',
  25470. yy : '%d ҫул'
  25471. },
  25472. ordinalParse: /\d{1,2}-мӗш/,
  25473. ordinal : '%d-мӗш',
  25474. week : {
  25475. dow : 1, // Monday is the first day of the week.
  25476. doy : 7 // The week that contains Jan 1st is the first week of the year.
  25477. }
  25478. });
  25479. var cy = moment__default.defineLocale('cy', {
  25480. months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),
  25481. monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),
  25482. weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'),
  25483. weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
  25484. weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
  25485. weekdaysParseExact : true,
  25486. // time formats are the same as en-gb
  25487. longDateFormat: {
  25488. LT: 'HH:mm',
  25489. LTS : 'HH:mm:ss',
  25490. L: 'DD/MM/YYYY',
  25491. LL: 'D MMMM YYYY',
  25492. LLL: 'D MMMM YYYY HH:mm',
  25493. LLLL: 'dddd, D MMMM YYYY HH:mm'
  25494. },
  25495. calendar: {
  25496. sameDay: '[Heddiw am] LT',
  25497. nextDay: '[Yfory am] LT',
  25498. nextWeek: 'dddd [am] LT',
  25499. lastDay: '[Ddoe am] LT',
  25500. lastWeek: 'dddd [diwethaf am] LT',
  25501. sameElse: 'L'
  25502. },
  25503. relativeTime: {
  25504. future: 'mewn %s',
  25505. past: '%s yn ôl',
  25506. s: 'ychydig eiliadau',
  25507. m: 'munud',
  25508. mm: '%d munud',
  25509. h: 'awr',
  25510. hh: '%d awr',
  25511. d: 'diwrnod',
  25512. dd: '%d diwrnod',
  25513. M: 'mis',
  25514. MM: '%d mis',
  25515. y: 'blwyddyn',
  25516. yy: '%d flynedd'
  25517. },
  25518. ordinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,
  25519. // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh
  25520. ordinal: function (number) {
  25521. var b = number,
  25522. output = '',
  25523. lookup = [
  25524. '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed
  25525. 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed
  25526. ];
  25527. if (b > 20) {
  25528. if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {
  25529. output = 'fed'; // not 30ain, 70ain or 90ain
  25530. } else {
  25531. output = 'ain';
  25532. }
  25533. } else if (b > 0) {
  25534. output = lookup[b];
  25535. }
  25536. return number + output;
  25537. },
  25538. week : {
  25539. dow : 1, // Monday is the first day of the week.
  25540. doy : 4 // The week that contains Jan 4th is the first week of the year.
  25541. }
  25542. });
  25543. var da = moment__default.defineLocale('da', {
  25544. months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'),
  25545. monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
  25546. weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
  25547. weekdaysShort : 'søn_man_tir_ons_tor_fre_lør'.split('_'),
  25548. weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),
  25549. longDateFormat : {
  25550. LT : 'HH:mm',
  25551. LTS : 'HH:mm:ss',
  25552. L : 'DD/MM/YYYY',
  25553. LL : 'D. MMMM YYYY',
  25554. LLL : 'D. MMMM YYYY HH:mm',
  25555. LLLL : 'dddd [d.] D. MMMM YYYY HH:mm'
  25556. },
  25557. calendar : {
  25558. sameDay : '[I dag kl.] LT',
  25559. nextDay : '[I morgen kl.] LT',
  25560. nextWeek : 'dddd [kl.] LT',
  25561. lastDay : '[I går kl.] LT',
  25562. lastWeek : '[sidste] dddd [kl] LT',
  25563. sameElse : 'L'
  25564. },
  25565. relativeTime : {
  25566. future : 'om %s',
  25567. past : '%s siden',
  25568. s : 'få sekunder',
  25569. m : 'et minut',
  25570. mm : '%d minutter',
  25571. h : 'en time',
  25572. hh : '%d timer',
  25573. d : 'en dag',
  25574. dd : '%d dage',
  25575. M : 'en måned',
  25576. MM : '%d måneder',
  25577. y : 'et år',
  25578. yy : '%d år'
  25579. },
  25580. ordinalParse: /\d{1,2}\./,
  25581. ordinal : '%d.',
  25582. week : {
  25583. dow : 1, // Monday is the first day of the week.
  25584. doy : 4 // The week that contains Jan 4th is the first week of the year.
  25585. }
  25586. });
  25587. function de_at__processRelativeTime(number, withoutSuffix, key, isFuture) {
  25588. var format = {
  25589. 'm': ['eine Minute', 'einer Minute'],
  25590. 'h': ['eine Stunde', 'einer Stunde'],
  25591. 'd': ['ein Tag', 'einem Tag'],
  25592. 'dd': [number + ' Tage', number + ' Tagen'],
  25593. 'M': ['ein Monat', 'einem Monat'],
  25594. 'MM': [number + ' Monate', number + ' Monaten'],
  25595. 'y': ['ein Jahr', 'einem Jahr'],
  25596. 'yy': [number + ' Jahre', number + ' Jahren']
  25597. };
  25598. return withoutSuffix ? format[key][0] : format[key][1];
  25599. }
  25600. var de_at = moment__default.defineLocale('de-at', {
  25601. months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
  25602. monthsShort : 'Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
  25603. monthsParseExact : true,
  25604. weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
  25605. weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
  25606. weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  25607. weekdaysParseExact : true,
  25608. longDateFormat : {
  25609. LT: 'HH:mm',
  25610. LTS: 'HH:mm:ss',
  25611. L : 'DD.MM.YYYY',
  25612. LL : 'D. MMMM YYYY',
  25613. LLL : 'D. MMMM YYYY HH:mm',
  25614. LLLL : 'dddd, D. MMMM YYYY HH:mm'
  25615. },
  25616. calendar : {
  25617. sameDay: '[heute um] LT [Uhr]',
  25618. sameElse: 'L',
  25619. nextDay: '[morgen um] LT [Uhr]',
  25620. nextWeek: 'dddd [um] LT [Uhr]',
  25621. lastDay: '[gestern um] LT [Uhr]',
  25622. lastWeek: '[letzten] dddd [um] LT [Uhr]'
  25623. },
  25624. relativeTime : {
  25625. future : 'in %s',
  25626. past : 'vor %s',
  25627. s : 'ein paar Sekunden',
  25628. m : de_at__processRelativeTime,
  25629. mm : '%d Minuten',
  25630. h : de_at__processRelativeTime,
  25631. hh : '%d Stunden',
  25632. d : de_at__processRelativeTime,
  25633. dd : de_at__processRelativeTime,
  25634. M : de_at__processRelativeTime,
  25635. MM : de_at__processRelativeTime,
  25636. y : de_at__processRelativeTime,
  25637. yy : de_at__processRelativeTime
  25638. },
  25639. ordinalParse: /\d{1,2}\./,
  25640. ordinal : '%d.',
  25641. week : {
  25642. dow : 1, // Monday is the first day of the week.
  25643. doy : 4 // The week that contains Jan 4th is the first week of the year.
  25644. }
  25645. });
  25646. function de__processRelativeTime(number, withoutSuffix, key, isFuture) {
  25647. var format = {
  25648. 'm': ['eine Minute', 'einer Minute'],
  25649. 'h': ['eine Stunde', 'einer Stunde'],
  25650. 'd': ['ein Tag', 'einem Tag'],
  25651. 'dd': [number + ' Tage', number + ' Tagen'],
  25652. 'M': ['ein Monat', 'einem Monat'],
  25653. 'MM': [number + ' Monate', number + ' Monaten'],
  25654. 'y': ['ein Jahr', 'einem Jahr'],
  25655. 'yy': [number + ' Jahre', number + ' Jahren']
  25656. };
  25657. return withoutSuffix ? format[key][0] : format[key][1];
  25658. }
  25659. var de = moment__default.defineLocale('de', {
  25660. months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
  25661. monthsShort : 'Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
  25662. monthsParseExact : true,
  25663. weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
  25664. weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
  25665. weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  25666. weekdaysParseExact : true,
  25667. longDateFormat : {
  25668. LT: 'HH:mm',
  25669. LTS: 'HH:mm:ss',
  25670. L : 'DD.MM.YYYY',
  25671. LL : 'D. MMMM YYYY',
  25672. LLL : 'D. MMMM YYYY HH:mm',
  25673. LLLL : 'dddd, D. MMMM YYYY HH:mm'
  25674. },
  25675. calendar : {
  25676. sameDay: '[heute um] LT [Uhr]',
  25677. sameElse: 'L',
  25678. nextDay: '[morgen um] LT [Uhr]',
  25679. nextWeek: 'dddd [um] LT [Uhr]',
  25680. lastDay: '[gestern um] LT [Uhr]',
  25681. lastWeek: '[letzten] dddd [um] LT [Uhr]'
  25682. },
  25683. relativeTime : {
  25684. future : 'in %s',
  25685. past : 'vor %s',
  25686. s : 'ein paar Sekunden',
  25687. m : de__processRelativeTime,
  25688. mm : '%d Minuten',
  25689. h : de__processRelativeTime,
  25690. hh : '%d Stunden',
  25691. d : de__processRelativeTime,
  25692. dd : de__processRelativeTime,
  25693. M : de__processRelativeTime,
  25694. MM : de__processRelativeTime,
  25695. y : de__processRelativeTime,
  25696. yy : de__processRelativeTime
  25697. },
  25698. ordinalParse: /\d{1,2}\./,
  25699. ordinal : '%d.',
  25700. week : {
  25701. dow : 1, // Monday is the first day of the week.
  25702. doy : 4 // The week that contains Jan 4th is the first week of the year.
  25703. }
  25704. });
  25705. var dv__months = [
  25706. 'ޖެނުއަރީ',
  25707. 'ފެބްރުއަރީ',
  25708. 'މާރިޗު',
  25709. 'އޭޕްރީލު',
  25710. 'މޭ',
  25711. 'ޖޫން',
  25712. 'ޖުލައި',
  25713. 'އޯގަސްޓު',
  25714. 'ސެޕްޓެމްބަރު',
  25715. 'އޮކްޓޯބަރު',
  25716. 'ނޮވެމްބަރު',
  25717. 'ޑިސެމްބަރު'
  25718. ], dv__weekdays = [
  25719. 'އާދިއްތަ',
  25720. 'ހޯމަ',
  25721. 'އަންގާރަ',
  25722. 'ބުދަ',
  25723. 'ބުރާސްފަތި',
  25724. 'ހުކުރު',
  25725. 'ހޮނިހިރު'
  25726. ];
  25727. var dv = moment__default.defineLocale('dv', {
  25728. months : dv__months,
  25729. monthsShort : dv__months,
  25730. weekdays : dv__weekdays,
  25731. weekdaysShort : dv__weekdays,
  25732. weekdaysMin : 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),
  25733. longDateFormat : {
  25734. LT : 'HH:mm',
  25735. LTS : 'HH:mm:ss',
  25736. L : 'D/M/YYYY',
  25737. LL : 'D MMMM YYYY',
  25738. LLL : 'D MMMM YYYY HH:mm',
  25739. LLLL : 'dddd D MMMM YYYY HH:mm'
  25740. },
  25741. meridiemParse: /މކ|މފ/,
  25742. isPM : function (input) {
  25743. return 'މފ' === input;
  25744. },
  25745. meridiem : function (hour, minute, isLower) {
  25746. if (hour < 12) {
  25747. return 'މކ';
  25748. } else {
  25749. return 'މފ';
  25750. }
  25751. },
  25752. calendar : {
  25753. sameDay : '[މިއަދު] LT',
  25754. nextDay : '[މާދަމާ] LT',
  25755. nextWeek : 'dddd LT',
  25756. lastDay : '[އިއްޔެ] LT',
  25757. lastWeek : '[ފާއިތުވި] dddd LT',
  25758. sameElse : 'L'
  25759. },
  25760. relativeTime : {
  25761. future : 'ތެރޭގައި %s',
  25762. past : 'ކުރިން %s',
  25763. s : 'ސިކުންތުކޮޅެއް',
  25764. m : 'މިނިޓެއް',
  25765. mm : 'މިނިޓު %d',
  25766. h : 'ގަޑިއިރެއް',
  25767. hh : 'ގަޑިއިރު %d',
  25768. d : 'ދުވަހެއް',
  25769. dd : 'ދުވަސް %d',
  25770. M : 'މަހެއް',
  25771. MM : 'މަސް %d',
  25772. y : 'އަހަރެއް',
  25773. yy : 'އަހަރު %d'
  25774. },
  25775. preparse: function (string) {
  25776. return string.replace(/،/g, ',');
  25777. },
  25778. postformat: function (string) {
  25779. return string.replace(/,/g, '،');
  25780. },
  25781. week : {
  25782. dow : 7, // Sunday is the first day of the week.
  25783. doy : 12 // The week that contains Jan 1st is the first week of the year.
  25784. }
  25785. });
  25786. var el = moment__default.defineLocale('el', {
  25787. monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),
  25788. monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'),
  25789. months : function (momentToFormat, format) {
  25790. if (/D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM'
  25791. return this._monthsGenitiveEl[momentToFormat.month()];
  25792. } else {
  25793. return this._monthsNominativeEl[momentToFormat.month()];
  25794. }
  25795. },
  25796. monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),
  25797. weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'),
  25798. weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),
  25799. weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),
  25800. meridiem : function (hours, minutes, isLower) {
  25801. if (hours > 11) {
  25802. return isLower ? 'μμ' : 'ΜΜ';
  25803. } else {
  25804. return isLower ? 'πμ' : 'ΠΜ';
  25805. }
  25806. },
  25807. isPM : function (input) {
  25808. return ((input + '').toLowerCase()[0] === 'μ');
  25809. },
  25810. meridiemParse : /[ΠΜ]\.?Μ?\.?/i,
  25811. longDateFormat : {
  25812. LT : 'h:mm A',
  25813. LTS : 'h:mm:ss A',
  25814. L : 'DD/MM/YYYY',
  25815. LL : 'D MMMM YYYY',
  25816. LLL : 'D MMMM YYYY h:mm A',
  25817. LLLL : 'dddd, D MMMM YYYY h:mm A'
  25818. },
  25819. calendarEl : {
  25820. sameDay : '[Σήμερα {}] LT',
  25821. nextDay : '[Αύριο {}] LT',
  25822. nextWeek : 'dddd [{}] LT',
  25823. lastDay : '[Χθες {}] LT',
  25824. lastWeek : function () {
  25825. switch (this.day()) {
  25826. case 6:
  25827. return '[το προηγούμενο] dddd [{}] LT';
  25828. default:
  25829. return '[την προηγούμενη] dddd [{}] LT';
  25830. }
  25831. },
  25832. sameElse : 'L'
  25833. },
  25834. calendar : function (key, mom) {
  25835. var output = this._calendarEl[key],
  25836. hours = mom && mom.hours();
  25837. if (isFunction(output)) {
  25838. output = output.apply(mom);
  25839. }
  25840. return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις'));
  25841. },
  25842. relativeTime : {
  25843. future : 'σε %s',
  25844. past : '%s πριν',
  25845. s : 'λίγα δευτερόλεπτα',
  25846. m : 'ένα λεπτό',
  25847. mm : '%d λεπτά',
  25848. h : 'μία ώρα',
  25849. hh : '%d ώρες',
  25850. d : 'μία μέρα',
  25851. dd : '%d μέρες',
  25852. M : 'ένας μήνας',
  25853. MM : '%d μήνες',
  25854. y : 'ένας χρόνος',
  25855. yy : '%d χρόνια'
  25856. },
  25857. ordinalParse: /\d{1,2}η/,
  25858. ordinal: '%dη',
  25859. week : {
  25860. dow : 1, // Monday is the first day of the week.
  25861. doy : 4 // The week that contains Jan 4st is the first week of the year.
  25862. }
  25863. });
  25864. var en_au = moment__default.defineLocale('en-au', {
  25865. months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  25866. monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  25867. weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  25868. weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  25869. weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  25870. longDateFormat : {
  25871. LT : 'h:mm A',
  25872. LTS : 'h:mm:ss A',
  25873. L : 'DD/MM/YYYY',
  25874. LL : 'D MMMM YYYY',
  25875. LLL : 'D MMMM YYYY h:mm A',
  25876. LLLL : 'dddd, D MMMM YYYY h:mm A'
  25877. },
  25878. calendar : {
  25879. sameDay : '[Today at] LT',
  25880. nextDay : '[Tomorrow at] LT',
  25881. nextWeek : 'dddd [at] LT',
  25882. lastDay : '[Yesterday at] LT',
  25883. lastWeek : '[Last] dddd [at] LT',
  25884. sameElse : 'L'
  25885. },
  25886. relativeTime : {
  25887. future : 'in %s',
  25888. past : '%s ago',
  25889. s : 'a few seconds',
  25890. m : 'a minute',
  25891. mm : '%d minutes',
  25892. h : 'an hour',
  25893. hh : '%d hours',
  25894. d : 'a day',
  25895. dd : '%d days',
  25896. M : 'a month',
  25897. MM : '%d months',
  25898. y : 'a year',
  25899. yy : '%d years'
  25900. },
  25901. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  25902. ordinal : function (number) {
  25903. var b = number % 10,
  25904. output = (~~(number % 100 / 10) === 1) ? 'th' :
  25905. (b === 1) ? 'st' :
  25906. (b === 2) ? 'nd' :
  25907. (b === 3) ? 'rd' : 'th';
  25908. return number + output;
  25909. },
  25910. week : {
  25911. dow : 1, // Monday is the first day of the week.
  25912. doy : 4 // The week that contains Jan 4th is the first week of the year.
  25913. }
  25914. });
  25915. var en_ca = moment__default.defineLocale('en-ca', {
  25916. months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  25917. monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  25918. weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  25919. weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  25920. weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  25921. longDateFormat : {
  25922. LT : 'h:mm A',
  25923. LTS : 'h:mm:ss A',
  25924. L : 'YYYY-MM-DD',
  25925. LL : 'MMMM D, YYYY',
  25926. LLL : 'MMMM D, YYYY h:mm A',
  25927. LLLL : 'dddd, MMMM D, YYYY h:mm A'
  25928. },
  25929. calendar : {
  25930. sameDay : '[Today at] LT',
  25931. nextDay : '[Tomorrow at] LT',
  25932. nextWeek : 'dddd [at] LT',
  25933. lastDay : '[Yesterday at] LT',
  25934. lastWeek : '[Last] dddd [at] LT',
  25935. sameElse : 'L'
  25936. },
  25937. relativeTime : {
  25938. future : 'in %s',
  25939. past : '%s ago',
  25940. s : 'a few seconds',
  25941. m : 'a minute',
  25942. mm : '%d minutes',
  25943. h : 'an hour',
  25944. hh : '%d hours',
  25945. d : 'a day',
  25946. dd : '%d days',
  25947. M : 'a month',
  25948. MM : '%d months',
  25949. y : 'a year',
  25950. yy : '%d years'
  25951. },
  25952. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  25953. ordinal : function (number) {
  25954. var b = number % 10,
  25955. output = (~~(number % 100 / 10) === 1) ? 'th' :
  25956. (b === 1) ? 'st' :
  25957. (b === 2) ? 'nd' :
  25958. (b === 3) ? 'rd' : 'th';
  25959. return number + output;
  25960. }
  25961. });
  25962. var en_gb = moment__default.defineLocale('en-gb', {
  25963. months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  25964. monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  25965. weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  25966. weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  25967. weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  25968. longDateFormat : {
  25969. LT : 'HH:mm',
  25970. LTS : 'HH:mm:ss',
  25971. L : 'DD/MM/YYYY',
  25972. LL : 'D MMMM YYYY',
  25973. LLL : 'D MMMM YYYY HH:mm',
  25974. LLLL : 'dddd, D MMMM YYYY HH:mm'
  25975. },
  25976. calendar : {
  25977. sameDay : '[Today at] LT',
  25978. nextDay : '[Tomorrow at] LT',
  25979. nextWeek : 'dddd [at] LT',
  25980. lastDay : '[Yesterday at] LT',
  25981. lastWeek : '[Last] dddd [at] LT',
  25982. sameElse : 'L'
  25983. },
  25984. relativeTime : {
  25985. future : 'in %s',
  25986. past : '%s ago',
  25987. s : 'a few seconds',
  25988. m : 'a minute',
  25989. mm : '%d minutes',
  25990. h : 'an hour',
  25991. hh : '%d hours',
  25992. d : 'a day',
  25993. dd : '%d days',
  25994. M : 'a month',
  25995. MM : '%d months',
  25996. y : 'a year',
  25997. yy : '%d years'
  25998. },
  25999. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  26000. ordinal : function (number) {
  26001. var b = number % 10,
  26002. output = (~~(number % 100 / 10) === 1) ? 'th' :
  26003. (b === 1) ? 'st' :
  26004. (b === 2) ? 'nd' :
  26005. (b === 3) ? 'rd' : 'th';
  26006. return number + output;
  26007. },
  26008. week : {
  26009. dow : 1, // Monday is the first day of the week.
  26010. doy : 4 // The week that contains Jan 4th is the first week of the year.
  26011. }
  26012. });
  26013. var en_ie = moment__default.defineLocale('en-ie', {
  26014. months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  26015. monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  26016. weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  26017. weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  26018. weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  26019. longDateFormat : {
  26020. LT : 'HH:mm',
  26021. LTS : 'HH:mm:ss',
  26022. L : 'DD-MM-YYYY',
  26023. LL : 'D MMMM YYYY',
  26024. LLL : 'D MMMM YYYY HH:mm',
  26025. LLLL : 'dddd D MMMM YYYY HH:mm'
  26026. },
  26027. calendar : {
  26028. sameDay : '[Today at] LT',
  26029. nextDay : '[Tomorrow at] LT',
  26030. nextWeek : 'dddd [at] LT',
  26031. lastDay : '[Yesterday at] LT',
  26032. lastWeek : '[Last] dddd [at] LT',
  26033. sameElse : 'L'
  26034. },
  26035. relativeTime : {
  26036. future : 'in %s',
  26037. past : '%s ago',
  26038. s : 'a few seconds',
  26039. m : 'a minute',
  26040. mm : '%d minutes',
  26041. h : 'an hour',
  26042. hh : '%d hours',
  26043. d : 'a day',
  26044. dd : '%d days',
  26045. M : 'a month',
  26046. MM : '%d months',
  26047. y : 'a year',
  26048. yy : '%d years'
  26049. },
  26050. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  26051. ordinal : function (number) {
  26052. var b = number % 10,
  26053. output = (~~(number % 100 / 10) === 1) ? 'th' :
  26054. (b === 1) ? 'st' :
  26055. (b === 2) ? 'nd' :
  26056. (b === 3) ? 'rd' : 'th';
  26057. return number + output;
  26058. },
  26059. week : {
  26060. dow : 1, // Monday is the first day of the week.
  26061. doy : 4 // The week that contains Jan 4th is the first week of the year.
  26062. }
  26063. });
  26064. var en_nz = moment__default.defineLocale('en-nz', {
  26065. months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  26066. monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  26067. weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  26068. weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  26069. weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  26070. longDateFormat : {
  26071. LT : 'h:mm A',
  26072. LTS : 'h:mm:ss A',
  26073. L : 'DD/MM/YYYY',
  26074. LL : 'D MMMM YYYY',
  26075. LLL : 'D MMMM YYYY h:mm A',
  26076. LLLL : 'dddd, D MMMM YYYY h:mm A'
  26077. },
  26078. calendar : {
  26079. sameDay : '[Today at] LT',
  26080. nextDay : '[Tomorrow at] LT',
  26081. nextWeek : 'dddd [at] LT',
  26082. lastDay : '[Yesterday at] LT',
  26083. lastWeek : '[Last] dddd [at] LT',
  26084. sameElse : 'L'
  26085. },
  26086. relativeTime : {
  26087. future : 'in %s',
  26088. past : '%s ago',
  26089. s : 'a few seconds',
  26090. m : 'a minute',
  26091. mm : '%d minutes',
  26092. h : 'an hour',
  26093. hh : '%d hours',
  26094. d : 'a day',
  26095. dd : '%d days',
  26096. M : 'a month',
  26097. MM : '%d months',
  26098. y : 'a year',
  26099. yy : '%d years'
  26100. },
  26101. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  26102. ordinal : function (number) {
  26103. var b = number % 10,
  26104. output = (~~(number % 100 / 10) === 1) ? 'th' :
  26105. (b === 1) ? 'st' :
  26106. (b === 2) ? 'nd' :
  26107. (b === 3) ? 'rd' : 'th';
  26108. return number + output;
  26109. },
  26110. week : {
  26111. dow : 1, // Monday is the first day of the week.
  26112. doy : 4 // The week that contains Jan 4th is the first week of the year.
  26113. }
  26114. });
  26115. var eo = moment__default.defineLocale('eo', {
  26116. months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'),
  26117. monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'),
  26118. weekdays : 'Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato'.split('_'),
  26119. weekdaysShort : 'Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab'.split('_'),
  26120. weekdaysMin : 'Di_Lu_Ma_Me_Ĵa_Ve_Sa'.split('_'),
  26121. longDateFormat : {
  26122. LT : 'HH:mm',
  26123. LTS : 'HH:mm:ss',
  26124. L : 'YYYY-MM-DD',
  26125. LL : 'D[-an de] MMMM, YYYY',
  26126. LLL : 'D[-an de] MMMM, YYYY HH:mm',
  26127. LLLL : 'dddd, [la] D[-an de] MMMM, YYYY HH:mm'
  26128. },
  26129. meridiemParse: /[ap]\.t\.m/i,
  26130. isPM: function (input) {
  26131. return input.charAt(0).toLowerCase() === 'p';
  26132. },
  26133. meridiem : function (hours, minutes, isLower) {
  26134. if (hours > 11) {
  26135. return isLower ? 'p.t.m.' : 'P.T.M.';
  26136. } else {
  26137. return isLower ? 'a.t.m.' : 'A.T.M.';
  26138. }
  26139. },
  26140. calendar : {
  26141. sameDay : '[Hodiaŭ je] LT',
  26142. nextDay : '[Morgaŭ je] LT',
  26143. nextWeek : 'dddd [je] LT',
  26144. lastDay : '[Hieraŭ je] LT',
  26145. lastWeek : '[pasinta] dddd [je] LT',
  26146. sameElse : 'L'
  26147. },
  26148. relativeTime : {
  26149. future : 'je %s',
  26150. past : 'antaŭ %s',
  26151. s : 'sekundoj',
  26152. m : 'minuto',
  26153. mm : '%d minutoj',
  26154. h : 'horo',
  26155. hh : '%d horoj',
  26156. d : 'tago',//ne 'diurno', ĉar estas uzita por proksimumo
  26157. dd : '%d tagoj',
  26158. M : 'monato',
  26159. MM : '%d monatoj',
  26160. y : 'jaro',
  26161. yy : '%d jaroj'
  26162. },
  26163. ordinalParse: /\d{1,2}a/,
  26164. ordinal : '%da',
  26165. week : {
  26166. dow : 1, // Monday is the first day of the week.
  26167. doy : 7 // The week that contains Jan 1st is the first week of the year.
  26168. }
  26169. });
  26170. var es_do__monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),
  26171. es_do__monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
  26172. var es_do = moment__default.defineLocale('es-do', {
  26173. months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
  26174. monthsShort : function (m, format) {
  26175. if (/-MMM-/.test(format)) {
  26176. return es_do__monthsShort[m.month()];
  26177. } else {
  26178. return es_do__monthsShortDot[m.month()];
  26179. }
  26180. },
  26181. monthsParseExact : true,
  26182. weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  26183. weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  26184. weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  26185. weekdaysParseExact : true,
  26186. longDateFormat : {
  26187. LT : 'h:mm A',
  26188. LTS : 'h:mm:ss A',
  26189. L : 'DD/MM/YYYY',
  26190. LL : 'D [de] MMMM [de] YYYY',
  26191. LLL : 'D [de] MMMM [de] YYYY h:mm A',
  26192. LLLL : 'dddd, D [de] MMMM [de] YYYY h:mm A'
  26193. },
  26194. calendar : {
  26195. sameDay : function () {
  26196. return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  26197. },
  26198. nextDay : function () {
  26199. return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  26200. },
  26201. nextWeek : function () {
  26202. return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  26203. },
  26204. lastDay : function () {
  26205. return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  26206. },
  26207. lastWeek : function () {
  26208. return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  26209. },
  26210. sameElse : 'L'
  26211. },
  26212. relativeTime : {
  26213. future : 'en %s',
  26214. past : 'hace %s',
  26215. s : 'unos segundos',
  26216. m : 'un minuto',
  26217. mm : '%d minutos',
  26218. h : 'una hora',
  26219. hh : '%d horas',
  26220. d : 'un día',
  26221. dd : '%d días',
  26222. M : 'un mes',
  26223. MM : '%d meses',
  26224. y : 'un año',
  26225. yy : '%d años'
  26226. },
  26227. ordinalParse : /\d{1,2}º/,
  26228. ordinal : '%dº',
  26229. week : {
  26230. dow : 1, // Monday is the first day of the week.
  26231. doy : 4 // The week that contains Jan 4th is the first week of the year.
  26232. }
  26233. });
  26234. var es__monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),
  26235. es__monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
  26236. var es = moment__default.defineLocale('es', {
  26237. months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
  26238. monthsShort : function (m, format) {
  26239. if (/-MMM-/.test(format)) {
  26240. return es__monthsShort[m.month()];
  26241. } else {
  26242. return es__monthsShortDot[m.month()];
  26243. }
  26244. },
  26245. monthsParseExact : true,
  26246. weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  26247. weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  26248. weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  26249. weekdaysParseExact : true,
  26250. longDateFormat : {
  26251. LT : 'H:mm',
  26252. LTS : 'H:mm:ss',
  26253. L : 'DD/MM/YYYY',
  26254. LL : 'D [de] MMMM [de] YYYY',
  26255. LLL : 'D [de] MMMM [de] YYYY H:mm',
  26256. LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'
  26257. },
  26258. calendar : {
  26259. sameDay : function () {
  26260. return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  26261. },
  26262. nextDay : function () {
  26263. return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  26264. },
  26265. nextWeek : function () {
  26266. return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  26267. },
  26268. lastDay : function () {
  26269. return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  26270. },
  26271. lastWeek : function () {
  26272. return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  26273. },
  26274. sameElse : 'L'
  26275. },
  26276. relativeTime : {
  26277. future : 'en %s',
  26278. past : 'hace %s',
  26279. s : 'unos segundos',
  26280. m : 'un minuto',
  26281. mm : '%d minutos',
  26282. h : 'una hora',
  26283. hh : '%d horas',
  26284. d : 'un día',
  26285. dd : '%d días',
  26286. M : 'un mes',
  26287. MM : '%d meses',
  26288. y : 'un año',
  26289. yy : '%d años'
  26290. },
  26291. ordinalParse : /\d{1,2}º/,
  26292. ordinal : '%dº',
  26293. week : {
  26294. dow : 1, // Monday is the first day of the week.
  26295. doy : 4 // The week that contains Jan 4th is the first week of the year.
  26296. }
  26297. });
  26298. function et__processRelativeTime(number, withoutSuffix, key, isFuture) {
  26299. var format = {
  26300. 's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'],
  26301. 'm' : ['ühe minuti', 'üks minut'],
  26302. 'mm': [number + ' minuti', number + ' minutit'],
  26303. 'h' : ['ühe tunni', 'tund aega', 'üks tund'],
  26304. 'hh': [number + ' tunni', number + ' tundi'],
  26305. 'd' : ['ühe päeva', 'üks päev'],
  26306. 'M' : ['kuu aja', 'kuu aega', 'üks kuu'],
  26307. 'MM': [number + ' kuu', number + ' kuud'],
  26308. 'y' : ['ühe aasta', 'aasta', 'üks aasta'],
  26309. 'yy': [number + ' aasta', number + ' aastat']
  26310. };
  26311. if (withoutSuffix) {
  26312. return format[key][2] ? format[key][2] : format[key][1];
  26313. }
  26314. return isFuture ? format[key][0] : format[key][1];
  26315. }
  26316. var et = moment__default.defineLocale('et', {
  26317. months : 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),
  26318. monthsShort : 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),
  26319. weekdays : 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),
  26320. weekdaysShort : 'P_E_T_K_N_R_L'.split('_'),
  26321. weekdaysMin : 'P_E_T_K_N_R_L'.split('_'),
  26322. longDateFormat : {
  26323. LT : 'H:mm',
  26324. LTS : 'H:mm:ss',
  26325. L : 'DD.MM.YYYY',
  26326. LL : 'D. MMMM YYYY',
  26327. LLL : 'D. MMMM YYYY H:mm',
  26328. LLLL : 'dddd, D. MMMM YYYY H:mm'
  26329. },
  26330. calendar : {
  26331. sameDay : '[Täna,] LT',
  26332. nextDay : '[Homme,] LT',
  26333. nextWeek : '[Järgmine] dddd LT',
  26334. lastDay : '[Eile,] LT',
  26335. lastWeek : '[Eelmine] dddd LT',
  26336. sameElse : 'L'
  26337. },
  26338. relativeTime : {
  26339. future : '%s pärast',
  26340. past : '%s tagasi',
  26341. s : et__processRelativeTime,
  26342. m : et__processRelativeTime,
  26343. mm : et__processRelativeTime,
  26344. h : et__processRelativeTime,
  26345. hh : et__processRelativeTime,
  26346. d : et__processRelativeTime,
  26347. dd : '%d päeva',
  26348. M : et__processRelativeTime,
  26349. MM : et__processRelativeTime,
  26350. y : et__processRelativeTime,
  26351. yy : et__processRelativeTime
  26352. },
  26353. ordinalParse: /\d{1,2}\./,
  26354. ordinal : '%d.',
  26355. week : {
  26356. dow : 1, // Monday is the first day of the week.
  26357. doy : 4 // The week that contains Jan 4th is the first week of the year.
  26358. }
  26359. });
  26360. var eu = moment__default.defineLocale('eu', {
  26361. months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'),
  26362. monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'),
  26363. monthsParseExact : true,
  26364. weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'),
  26365. weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'),
  26366. weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'),
  26367. weekdaysParseExact : true,
  26368. longDateFormat : {
  26369. LT : 'HH:mm',
  26370. LTS : 'HH:mm:ss',
  26371. L : 'YYYY-MM-DD',
  26372. LL : 'YYYY[ko] MMMM[ren] D[a]',
  26373. LLL : 'YYYY[ko] MMMM[ren] D[a] HH:mm',
  26374. LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
  26375. l : 'YYYY-M-D',
  26376. ll : 'YYYY[ko] MMM D[a]',
  26377. lll : 'YYYY[ko] MMM D[a] HH:mm',
  26378. llll : 'ddd, YYYY[ko] MMM D[a] HH:mm'
  26379. },
  26380. calendar : {
  26381. sameDay : '[gaur] LT[etan]',
  26382. nextDay : '[bihar] LT[etan]',
  26383. nextWeek : 'dddd LT[etan]',
  26384. lastDay : '[atzo] LT[etan]',
  26385. lastWeek : '[aurreko] dddd LT[etan]',
  26386. sameElse : 'L'
  26387. },
  26388. relativeTime : {
  26389. future : '%s barru',
  26390. past : 'duela %s',
  26391. s : 'segundo batzuk',
  26392. m : 'minutu bat',
  26393. mm : '%d minutu',
  26394. h : 'ordu bat',
  26395. hh : '%d ordu',
  26396. d : 'egun bat',
  26397. dd : '%d egun',
  26398. M : 'hilabete bat',
  26399. MM : '%d hilabete',
  26400. y : 'urte bat',
  26401. yy : '%d urte'
  26402. },
  26403. ordinalParse: /\d{1,2}\./,
  26404. ordinal : '%d.',
  26405. week : {
  26406. dow : 1, // Monday is the first day of the week.
  26407. doy : 7 // The week that contains Jan 1st is the first week of the year.
  26408. }
  26409. });
  26410. var fa__symbolMap = {
  26411. '1': '۱',
  26412. '2': '۲',
  26413. '3': '۳',
  26414. '4': '۴',
  26415. '5': '۵',
  26416. '6': '۶',
  26417. '7': '۷',
  26418. '8': '۸',
  26419. '9': '۹',
  26420. '0': '۰'
  26421. }, fa__numberMap = {
  26422. '۱': '1',
  26423. '۲': '2',
  26424. '۳': '3',
  26425. '۴': '4',
  26426. '۵': '5',
  26427. '۶': '6',
  26428. '۷': '7',
  26429. '۸': '8',
  26430. '۹': '9',
  26431. '۰': '0'
  26432. };
  26433. var fa = moment__default.defineLocale('fa', {
  26434. months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
  26435. monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
  26436. weekdays : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
  26437. weekdaysShort : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
  26438. weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'),
  26439. weekdaysParseExact : true,
  26440. longDateFormat : {
  26441. LT : 'HH:mm',
  26442. LTS : 'HH:mm:ss',
  26443. L : 'DD/MM/YYYY',
  26444. LL : 'D MMMM YYYY',
  26445. LLL : 'D MMMM YYYY HH:mm',
  26446. LLLL : 'dddd, D MMMM YYYY HH:mm'
  26447. },
  26448. meridiemParse: /قبل از ظهر|بعد از ظهر/,
  26449. isPM: function (input) {
  26450. return /بعد از ظهر/.test(input);
  26451. },
  26452. meridiem : function (hour, minute, isLower) {
  26453. if (hour < 12) {
  26454. return 'قبل از ظهر';
  26455. } else {
  26456. return 'بعد از ظهر';
  26457. }
  26458. },
  26459. calendar : {
  26460. sameDay : '[امروز ساعت] LT',
  26461. nextDay : '[فردا ساعت] LT',
  26462. nextWeek : 'dddd [ساعت] LT',
  26463. lastDay : '[دیروز ساعت] LT',
  26464. lastWeek : 'dddd [پیش] [ساعت] LT',
  26465. sameElse : 'L'
  26466. },
  26467. relativeTime : {
  26468. future : 'در %s',
  26469. past : '%s پیش',
  26470. s : 'چندین ثانیه',
  26471. m : 'یک دقیقه',
  26472. mm : '%d دقیقه',
  26473. h : 'یک ساعت',
  26474. hh : '%d ساعت',
  26475. d : 'یک روز',
  26476. dd : '%d روز',
  26477. M : 'یک ماه',
  26478. MM : '%d ماه',
  26479. y : 'یک سال',
  26480. yy : '%d سال'
  26481. },
  26482. preparse: function (string) {
  26483. return string.replace(/[۰-۹]/g, function (match) {
  26484. return fa__numberMap[match];
  26485. }).replace(/،/g, ',');
  26486. },
  26487. postformat: function (string) {
  26488. return string.replace(/\d/g, function (match) {
  26489. return fa__symbolMap[match];
  26490. }).replace(/,/g, '،');
  26491. },
  26492. ordinalParse: /\d{1,2}م/,
  26493. ordinal : '%dم',
  26494. week : {
  26495. dow : 6, // Saturday is the first day of the week.
  26496. doy : 12 // The week that contains Jan 1st is the first week of the year.
  26497. }
  26498. });
  26499. var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '),
  26500. numbersFuture = [
  26501. 'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden',
  26502. numbersPast[7], numbersPast[8], numbersPast[9]
  26503. ];
  26504. function fi__translate(number, withoutSuffix, key, isFuture) {
  26505. var result = '';
  26506. switch (key) {
  26507. case 's':
  26508. return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
  26509. case 'm':
  26510. return isFuture ? 'minuutin' : 'minuutti';
  26511. case 'mm':
  26512. result = isFuture ? 'minuutin' : 'minuuttia';
  26513. break;
  26514. case 'h':
  26515. return isFuture ? 'tunnin' : 'tunti';
  26516. case 'hh':
  26517. result = isFuture ? 'tunnin' : 'tuntia';
  26518. break;
  26519. case 'd':
  26520. return isFuture ? 'päivän' : 'päivä';
  26521. case 'dd':
  26522. result = isFuture ? 'päivän' : 'päivää';
  26523. break;
  26524. case 'M':
  26525. return isFuture ? 'kuukauden' : 'kuukausi';
  26526. case 'MM':
  26527. result = isFuture ? 'kuukauden' : 'kuukautta';
  26528. break;
  26529. case 'y':
  26530. return isFuture ? 'vuoden' : 'vuosi';
  26531. case 'yy':
  26532. result = isFuture ? 'vuoden' : 'vuotta';
  26533. break;
  26534. }
  26535. result = verbalNumber(number, isFuture) + ' ' + result;
  26536. return result;
  26537. }
  26538. function verbalNumber(number, isFuture) {
  26539. return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number;
  26540. }
  26541. var fi = moment__default.defineLocale('fi', {
  26542. months : 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),
  26543. monthsShort : 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),
  26544. weekdays : 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),
  26545. weekdaysShort : 'su_ma_ti_ke_to_pe_la'.split('_'),
  26546. weekdaysMin : 'su_ma_ti_ke_to_pe_la'.split('_'),
  26547. longDateFormat : {
  26548. LT : 'HH.mm',
  26549. LTS : 'HH.mm.ss',
  26550. L : 'DD.MM.YYYY',
  26551. LL : 'Do MMMM[ta] YYYY',
  26552. LLL : 'Do MMMM[ta] YYYY, [klo] HH.mm',
  26553. LLLL : 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',
  26554. l : 'D.M.YYYY',
  26555. ll : 'Do MMM YYYY',
  26556. lll : 'Do MMM YYYY, [klo] HH.mm',
  26557. llll : 'ddd, Do MMM YYYY, [klo] HH.mm'
  26558. },
  26559. calendar : {
  26560. sameDay : '[tänään] [klo] LT',
  26561. nextDay : '[huomenna] [klo] LT',
  26562. nextWeek : 'dddd [klo] LT',
  26563. lastDay : '[eilen] [klo] LT',
  26564. lastWeek : '[viime] dddd[na] [klo] LT',
  26565. sameElse : 'L'
  26566. },
  26567. relativeTime : {
  26568. future : '%s päästä',
  26569. past : '%s sitten',
  26570. s : fi__translate,
  26571. m : fi__translate,
  26572. mm : fi__translate,
  26573. h : fi__translate,
  26574. hh : fi__translate,
  26575. d : fi__translate,
  26576. dd : fi__translate,
  26577. M : fi__translate,
  26578. MM : fi__translate,
  26579. y : fi__translate,
  26580. yy : fi__translate
  26581. },
  26582. ordinalParse: /\d{1,2}\./,
  26583. ordinal : '%d.',
  26584. week : {
  26585. dow : 1, // Monday is the first day of the week.
  26586. doy : 4 // The week that contains Jan 4th is the first week of the year.
  26587. }
  26588. });
  26589. var fo = moment__default.defineLocale('fo', {
  26590. months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
  26591. monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
  26592. weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'),
  26593. weekdaysShort : 'sun_mán_týs_mik_hós_frí_ley'.split('_'),
  26594. weekdaysMin : 'su_má_tý_mi_hó_fr_le'.split('_'),
  26595. longDateFormat : {
  26596. LT : 'HH:mm',
  26597. LTS : 'HH:mm:ss',
  26598. L : 'DD/MM/YYYY',
  26599. LL : 'D MMMM YYYY',
  26600. LLL : 'D MMMM YYYY HH:mm',
  26601. LLLL : 'dddd D. MMMM, YYYY HH:mm'
  26602. },
  26603. calendar : {
  26604. sameDay : '[Í dag kl.] LT',
  26605. nextDay : '[Í morgin kl.] LT',
  26606. nextWeek : 'dddd [kl.] LT',
  26607. lastDay : '[Í gjár kl.] LT',
  26608. lastWeek : '[síðstu] dddd [kl] LT',
  26609. sameElse : 'L'
  26610. },
  26611. relativeTime : {
  26612. future : 'um %s',
  26613. past : '%s síðani',
  26614. s : 'fá sekund',
  26615. m : 'ein minutt',
  26616. mm : '%d minuttir',
  26617. h : 'ein tími',
  26618. hh : '%d tímar',
  26619. d : 'ein dagur',
  26620. dd : '%d dagar',
  26621. M : 'ein mánaði',
  26622. MM : '%d mánaðir',
  26623. y : 'eitt ár',
  26624. yy : '%d ár'
  26625. },
  26626. ordinalParse: /\d{1,2}\./,
  26627. ordinal : '%d.',
  26628. week : {
  26629. dow : 1, // Monday is the first day of the week.
  26630. doy : 4 // The week that contains Jan 4th is the first week of the year.
  26631. }
  26632. });
  26633. var fr_ca = moment__default.defineLocale('fr-ca', {
  26634. months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
  26635. monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
  26636. monthsParseExact : true,
  26637. weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  26638. weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  26639. weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),
  26640. weekdaysParseExact : true,
  26641. longDateFormat : {
  26642. LT : 'HH:mm',
  26643. LTS : 'HH:mm:ss',
  26644. L : 'YYYY-MM-DD',
  26645. LL : 'D MMMM YYYY',
  26646. LLL : 'D MMMM YYYY HH:mm',
  26647. LLLL : 'dddd D MMMM YYYY HH:mm'
  26648. },
  26649. calendar : {
  26650. sameDay: '[Aujourd\'hui à] LT',
  26651. nextDay: '[Demain à] LT',
  26652. nextWeek: 'dddd [à] LT',
  26653. lastDay: '[Hier à] LT',
  26654. lastWeek: 'dddd [dernier à] LT',
  26655. sameElse: 'L'
  26656. },
  26657. relativeTime : {
  26658. future : 'dans %s',
  26659. past : 'il y a %s',
  26660. s : 'quelques secondes',
  26661. m : 'une minute',
  26662. mm : '%d minutes',
  26663. h : 'une heure',
  26664. hh : '%d heures',
  26665. d : 'un jour',
  26666. dd : '%d jours',
  26667. M : 'un mois',
  26668. MM : '%d mois',
  26669. y : 'un an',
  26670. yy : '%d ans'
  26671. },
  26672. ordinalParse: /\d{1,2}(er|e)/,
  26673. ordinal : function (number) {
  26674. return number + (number === 1 ? 'er' : 'e');
  26675. }
  26676. });
  26677. var fr_ch = moment__default.defineLocale('fr-ch', {
  26678. months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
  26679. monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
  26680. monthsParseExact : true,
  26681. weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  26682. weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  26683. weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),
  26684. weekdaysParseExact : true,
  26685. longDateFormat : {
  26686. LT : 'HH:mm',
  26687. LTS : 'HH:mm:ss',
  26688. L : 'DD.MM.YYYY',
  26689. LL : 'D MMMM YYYY',
  26690. LLL : 'D MMMM YYYY HH:mm',
  26691. LLLL : 'dddd D MMMM YYYY HH:mm'
  26692. },
  26693. calendar : {
  26694. sameDay: '[Aujourd\'hui à] LT',
  26695. nextDay: '[Demain à] LT',
  26696. nextWeek: 'dddd [à] LT',
  26697. lastDay: '[Hier à] LT',
  26698. lastWeek: 'dddd [dernier à] LT',
  26699. sameElse: 'L'
  26700. },
  26701. relativeTime : {
  26702. future : 'dans %s',
  26703. past : 'il y a %s',
  26704. s : 'quelques secondes',
  26705. m : 'une minute',
  26706. mm : '%d minutes',
  26707. h : 'une heure',
  26708. hh : '%d heures',
  26709. d : 'un jour',
  26710. dd : '%d jours',
  26711. M : 'un mois',
  26712. MM : '%d mois',
  26713. y : 'un an',
  26714. yy : '%d ans'
  26715. },
  26716. ordinalParse: /\d{1,2}(er|e)/,
  26717. ordinal : function (number) {
  26718. return number + (number === 1 ? 'er' : 'e');
  26719. },
  26720. week : {
  26721. dow : 1, // Monday is the first day of the week.
  26722. doy : 4 // The week that contains Jan 4th is the first week of the year.
  26723. }
  26724. });
  26725. var fr = moment__default.defineLocale('fr', {
  26726. months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
  26727. monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
  26728. monthsParseExact : true,
  26729. weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  26730. weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  26731. weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),
  26732. weekdaysParseExact : true,
  26733. longDateFormat : {
  26734. LT : 'HH:mm',
  26735. LTS : 'HH:mm:ss',
  26736. L : 'DD/MM/YYYY',
  26737. LL : 'D MMMM YYYY',
  26738. LLL : 'D MMMM YYYY HH:mm',
  26739. LLLL : 'dddd D MMMM YYYY HH:mm'
  26740. },
  26741. calendar : {
  26742. sameDay: '[Aujourd\'hui à] LT',
  26743. nextDay: '[Demain à] LT',
  26744. nextWeek: 'dddd [à] LT',
  26745. lastDay: '[Hier à] LT',
  26746. lastWeek: 'dddd [dernier à] LT',
  26747. sameElse: 'L'
  26748. },
  26749. relativeTime : {
  26750. future : 'dans %s',
  26751. past : 'il y a %s',
  26752. s : 'quelques secondes',
  26753. m : 'une minute',
  26754. mm : '%d minutes',
  26755. h : 'une heure',
  26756. hh : '%d heures',
  26757. d : 'un jour',
  26758. dd : '%d jours',
  26759. M : 'un mois',
  26760. MM : '%d mois',
  26761. y : 'un an',
  26762. yy : '%d ans'
  26763. },
  26764. ordinalParse: /\d{1,2}(er|)/,
  26765. ordinal : function (number) {
  26766. return number + (number === 1 ? 'er' : '');
  26767. },
  26768. week : {
  26769. dow : 1, // Monday is the first day of the week.
  26770. doy : 4 // The week that contains Jan 4th is the first week of the year.
  26771. }
  26772. });
  26773. var fy__monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'),
  26774. fy__monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');
  26775. var fy = moment__default.defineLocale('fy', {
  26776. months : 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'),
  26777. monthsShort : function (m, format) {
  26778. if (/-MMM-/.test(format)) {
  26779. return fy__monthsShortWithoutDots[m.month()];
  26780. } else {
  26781. return fy__monthsShortWithDots[m.month()];
  26782. }
  26783. },
  26784. monthsParseExact : true,
  26785. weekdays : 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'),
  26786. weekdaysShort : 'si._mo._ti._wo._to._fr._so.'.split('_'),
  26787. weekdaysMin : 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),
  26788. weekdaysParseExact : true,
  26789. longDateFormat : {
  26790. LT : 'HH:mm',
  26791. LTS : 'HH:mm:ss',
  26792. L : 'DD-MM-YYYY',
  26793. LL : 'D MMMM YYYY',
  26794. LLL : 'D MMMM YYYY HH:mm',
  26795. LLLL : 'dddd D MMMM YYYY HH:mm'
  26796. },
  26797. calendar : {
  26798. sameDay: '[hjoed om] LT',
  26799. nextDay: '[moarn om] LT',
  26800. nextWeek: 'dddd [om] LT',
  26801. lastDay: '[juster om] LT',
  26802. lastWeek: '[ôfrûne] dddd [om] LT',
  26803. sameElse: 'L'
  26804. },
  26805. relativeTime : {
  26806. future : 'oer %s',
  26807. past : '%s lyn',
  26808. s : 'in pear sekonden',
  26809. m : 'ien minút',
  26810. mm : '%d minuten',
  26811. h : 'ien oere',
  26812. hh : '%d oeren',
  26813. d : 'ien dei',
  26814. dd : '%d dagen',
  26815. M : 'ien moanne',
  26816. MM : '%d moannen',
  26817. y : 'ien jier',
  26818. yy : '%d jierren'
  26819. },
  26820. ordinalParse: /\d{1,2}(ste|de)/,
  26821. ordinal : function (number) {
  26822. return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
  26823. },
  26824. week : {
  26825. dow : 1, // Monday is the first day of the week.
  26826. doy : 4 // The week that contains Jan 4th is the first week of the year.
  26827. }
  26828. });
  26829. var gd__months = [
  26830. 'Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd'
  26831. ];
  26832. var gd__monthsShort = ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh'];
  26833. var gd__weekdays = ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne'];
  26834. var weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'];
  26835. var weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'];
  26836. var gd = moment__default.defineLocale('gd', {
  26837. months : gd__months,
  26838. monthsShort : gd__monthsShort,
  26839. monthsParseExact : true,
  26840. weekdays : gd__weekdays,
  26841. weekdaysShort : weekdaysShort,
  26842. weekdaysMin : weekdaysMin,
  26843. longDateFormat : {
  26844. LT : 'HH:mm',
  26845. LTS : 'HH:mm:ss',
  26846. L : 'DD/MM/YYYY',
  26847. LL : 'D MMMM YYYY',
  26848. LLL : 'D MMMM YYYY HH:mm',
  26849. LLLL : 'dddd, D MMMM YYYY HH:mm'
  26850. },
  26851. calendar : {
  26852. sameDay : '[An-diugh aig] LT',
  26853. nextDay : '[A-màireach aig] LT',
  26854. nextWeek : 'dddd [aig] LT',
  26855. lastDay : '[An-dè aig] LT',
  26856. lastWeek : 'dddd [seo chaidh] [aig] LT',
  26857. sameElse : 'L'
  26858. },
  26859. relativeTime : {
  26860. future : 'ann an %s',
  26861. past : 'bho chionn %s',
  26862. s : 'beagan diogan',
  26863. m : 'mionaid',
  26864. mm : '%d mionaidean',
  26865. h : 'uair',
  26866. hh : '%d uairean',
  26867. d : 'latha',
  26868. dd : '%d latha',
  26869. M : 'mìos',
  26870. MM : '%d mìosan',
  26871. y : 'bliadhna',
  26872. yy : '%d bliadhna'
  26873. },
  26874. ordinalParse : /\d{1,2}(d|na|mh)/,
  26875. ordinal : function (number) {
  26876. var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
  26877. return number + output;
  26878. },
  26879. week : {
  26880. dow : 1, // Monday is the first day of the week.
  26881. doy : 4 // The week that contains Jan 4th is the first week of the year.
  26882. }
  26883. });
  26884. var gl = moment__default.defineLocale('gl', {
  26885. months : 'Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro'.split('_'),
  26886. monthsShort : 'Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.'.split('_'),
  26887. monthsParseExact: true,
  26888. weekdays : 'Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado'.split('_'),
  26889. weekdaysShort : 'Dom._Lun._Mar._Mér._Xov._Ven._Sáb.'.split('_'),
  26890. weekdaysMin : 'Do_Lu_Ma_Mé_Xo_Ve_Sá'.split('_'),
  26891. weekdaysParseExact : true,
  26892. longDateFormat : {
  26893. LT : 'H:mm',
  26894. LTS : 'H:mm:ss',
  26895. L : 'DD/MM/YYYY',
  26896. LL : 'D MMMM YYYY',
  26897. LLL : 'D MMMM YYYY H:mm',
  26898. LLLL : 'dddd D MMMM YYYY H:mm'
  26899. },
  26900. calendar : {
  26901. sameDay : function () {
  26902. return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';
  26903. },
  26904. nextDay : function () {
  26905. return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';
  26906. },
  26907. nextWeek : function () {
  26908. return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
  26909. },
  26910. lastDay : function () {
  26911. return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT';
  26912. },
  26913. lastWeek : function () {
  26914. return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
  26915. },
  26916. sameElse : 'L'
  26917. },
  26918. relativeTime : {
  26919. future : function (str) {
  26920. if (str === 'uns segundos') {
  26921. return 'nuns segundos';
  26922. }
  26923. return 'en ' + str;
  26924. },
  26925. past : 'hai %s',
  26926. s : 'uns segundos',
  26927. m : 'un minuto',
  26928. mm : '%d minutos',
  26929. h : 'unha hora',
  26930. hh : '%d horas',
  26931. d : 'un día',
  26932. dd : '%d días',
  26933. M : 'un mes',
  26934. MM : '%d meses',
  26935. y : 'un ano',
  26936. yy : '%d anos'
  26937. },
  26938. ordinalParse : /\d{1,2}º/,
  26939. ordinal : '%dº',
  26940. week : {
  26941. dow : 1, // Monday is the first day of the week.
  26942. doy : 7 // The week that contains Jan 1st is the first week of the year.
  26943. }
  26944. });
  26945. var he = moment__default.defineLocale('he', {
  26946. months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),
  26947. monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),
  26948. weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
  26949. weekdaysShort : 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
  26950. weekdaysMin : 'א_ב_ג_ד_ה_ו_ש'.split('_'),
  26951. longDateFormat : {
  26952. LT : 'HH:mm',
  26953. LTS : 'HH:mm:ss',
  26954. L : 'DD/MM/YYYY',
  26955. LL : 'D [ב]MMMM YYYY',
  26956. LLL : 'D [ב]MMMM YYYY HH:mm',
  26957. LLLL : 'dddd, D [ב]MMMM YYYY HH:mm',
  26958. l : 'D/M/YYYY',
  26959. ll : 'D MMM YYYY',
  26960. lll : 'D MMM YYYY HH:mm',
  26961. llll : 'ddd, D MMM YYYY HH:mm'
  26962. },
  26963. calendar : {
  26964. sameDay : '[היום ב־]LT',
  26965. nextDay : '[מחר ב־]LT',
  26966. nextWeek : 'dddd [בשעה] LT',
  26967. lastDay : '[אתמול ב־]LT',
  26968. lastWeek : '[ביום] dddd [האחרון בשעה] LT',
  26969. sameElse : 'L'
  26970. },
  26971. relativeTime : {
  26972. future : 'בעוד %s',
  26973. past : 'לפני %s',
  26974. s : 'מספר שניות',
  26975. m : 'דקה',
  26976. mm : '%d דקות',
  26977. h : 'שעה',
  26978. hh : function (number) {
  26979. if (number === 2) {
  26980. return 'שעתיים';
  26981. }
  26982. return number + ' שעות';
  26983. },
  26984. d : 'יום',
  26985. dd : function (number) {
  26986. if (number === 2) {
  26987. return 'יומיים';
  26988. }
  26989. return number + ' ימים';
  26990. },
  26991. M : 'חודש',
  26992. MM : function (number) {
  26993. if (number === 2) {
  26994. return 'חודשיים';
  26995. }
  26996. return number + ' חודשים';
  26997. },
  26998. y : 'שנה',
  26999. yy : function (number) {
  27000. if (number === 2) {
  27001. return 'שנתיים';
  27002. } else if (number % 10 === 0 && number !== 10) {
  27003. return number + ' שנה';
  27004. }
  27005. return number + ' שנים';
  27006. }
  27007. },
  27008. meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,
  27009. isPM : function (input) {
  27010. return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input);
  27011. },
  27012. meridiem : function (hour, minute, isLower) {
  27013. if (hour < 5) {
  27014. return 'לפנות בוקר';
  27015. } else if (hour < 10) {
  27016. return 'בבוקר';
  27017. } else if (hour < 12) {
  27018. return isLower ? 'לפנה"צ' : 'לפני הצהריים';
  27019. } else if (hour < 18) {
  27020. return isLower ? 'אחה"צ' : 'אחרי הצהריים';
  27021. } else {
  27022. return 'בערב';
  27023. }
  27024. }
  27025. });
  27026. var hi__symbolMap = {
  27027. '1': '१',
  27028. '2': '२',
  27029. '3': '३',
  27030. '4': '४',
  27031. '5': '५',
  27032. '6': '६',
  27033. '7': '७',
  27034. '8': '८',
  27035. '9': '९',
  27036. '0': '०'
  27037. },
  27038. hi__numberMap = {
  27039. '१': '1',
  27040. '२': '2',
  27041. '३': '3',
  27042. '४': '4',
  27043. '५': '5',
  27044. '६': '6',
  27045. '७': '7',
  27046. '८': '8',
  27047. '९': '9',
  27048. '०': '0'
  27049. };
  27050. var hi = moment__default.defineLocale('hi', {
  27051. months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),
  27052. monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),
  27053. monthsParseExact: true,
  27054. weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
  27055. weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
  27056. weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
  27057. longDateFormat : {
  27058. LT : 'A h:mm बजे',
  27059. LTS : 'A h:mm:ss बजे',
  27060. L : 'DD/MM/YYYY',
  27061. LL : 'D MMMM YYYY',
  27062. LLL : 'D MMMM YYYY, A h:mm बजे',
  27063. LLLL : 'dddd, D MMMM YYYY, A h:mm बजे'
  27064. },
  27065. calendar : {
  27066. sameDay : '[आज] LT',
  27067. nextDay : '[कल] LT',
  27068. nextWeek : 'dddd, LT',
  27069. lastDay : '[कल] LT',
  27070. lastWeek : '[पिछले] dddd, LT',
  27071. sameElse : 'L'
  27072. },
  27073. relativeTime : {
  27074. future : '%s में',
  27075. past : '%s पहले',
  27076. s : 'कुछ ही क्षण',
  27077. m : 'एक मिनट',
  27078. mm : '%d मिनट',
  27079. h : 'एक घंटा',
  27080. hh : '%d घंटे',
  27081. d : 'एक दिन',
  27082. dd : '%d दिन',
  27083. M : 'एक महीने',
  27084. MM : '%d महीने',
  27085. y : 'एक वर्ष',
  27086. yy : '%d वर्ष'
  27087. },
  27088. preparse: function (string) {
  27089. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  27090. return hi__numberMap[match];
  27091. });
  27092. },
  27093. postformat: function (string) {
  27094. return string.replace(/\d/g, function (match) {
  27095. return hi__symbolMap[match];
  27096. });
  27097. },
  27098. // Hindi notation for meridiems are quite fuzzy in practice. While there exists
  27099. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
  27100. meridiemParse: /रात|सुबह|दोपहर|शाम/,
  27101. meridiemHour : function (hour, meridiem) {
  27102. if (hour === 12) {
  27103. hour = 0;
  27104. }
  27105. if (meridiem === 'रात') {
  27106. return hour < 4 ? hour : hour + 12;
  27107. } else if (meridiem === 'सुबह') {
  27108. return hour;
  27109. } else if (meridiem === 'दोपहर') {
  27110. return hour >= 10 ? hour : hour + 12;
  27111. } else if (meridiem === 'शाम') {
  27112. return hour + 12;
  27113. }
  27114. },
  27115. meridiem : function (hour, minute, isLower) {
  27116. if (hour < 4) {
  27117. return 'रात';
  27118. } else if (hour < 10) {
  27119. return 'सुबह';
  27120. } else if (hour < 17) {
  27121. return 'दोपहर';
  27122. } else if (hour < 20) {
  27123. return 'शाम';
  27124. } else {
  27125. return 'रात';
  27126. }
  27127. },
  27128. week : {
  27129. dow : 0, // Sunday is the first day of the week.
  27130. doy : 6 // The week that contains Jan 1st is the first week of the year.
  27131. }
  27132. });
  27133. function hr__translate(number, withoutSuffix, key) {
  27134. var result = number + ' ';
  27135. switch (key) {
  27136. case 'm':
  27137. return withoutSuffix ? 'jedna minuta' : 'jedne minute';
  27138. case 'mm':
  27139. if (number === 1) {
  27140. result += 'minuta';
  27141. } else if (number === 2 || number === 3 || number === 4) {
  27142. result += 'minute';
  27143. } else {
  27144. result += 'minuta';
  27145. }
  27146. return result;
  27147. case 'h':
  27148. return withoutSuffix ? 'jedan sat' : 'jednog sata';
  27149. case 'hh':
  27150. if (number === 1) {
  27151. result += 'sat';
  27152. } else if (number === 2 || number === 3 || number === 4) {
  27153. result += 'sata';
  27154. } else {
  27155. result += 'sati';
  27156. }
  27157. return result;
  27158. case 'dd':
  27159. if (number === 1) {
  27160. result += 'dan';
  27161. } else {
  27162. result += 'dana';
  27163. }
  27164. return result;
  27165. case 'MM':
  27166. if (number === 1) {
  27167. result += 'mjesec';
  27168. } else if (number === 2 || number === 3 || number === 4) {
  27169. result += 'mjeseca';
  27170. } else {
  27171. result += 'mjeseci';
  27172. }
  27173. return result;
  27174. case 'yy':
  27175. if (number === 1) {
  27176. result += 'godina';
  27177. } else if (number === 2 || number === 3 || number === 4) {
  27178. result += 'godine';
  27179. } else {
  27180. result += 'godina';
  27181. }
  27182. return result;
  27183. }
  27184. }
  27185. var hr = moment__default.defineLocale('hr', {
  27186. months : {
  27187. format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_'),
  27188. standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_')
  27189. },
  27190. monthsShort : 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'),
  27191. monthsParseExact: true,
  27192. weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
  27193. weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  27194. weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),
  27195. weekdaysParseExact : true,
  27196. longDateFormat : {
  27197. LT : 'H:mm',
  27198. LTS : 'H:mm:ss',
  27199. L : 'DD. MM. YYYY',
  27200. LL : 'D. MMMM YYYY',
  27201. LLL : 'D. MMMM YYYY H:mm',
  27202. LLLL : 'dddd, D. MMMM YYYY H:mm'
  27203. },
  27204. calendar : {
  27205. sameDay : '[danas u] LT',
  27206. nextDay : '[sutra u] LT',
  27207. nextWeek : function () {
  27208. switch (this.day()) {
  27209. case 0:
  27210. return '[u] [nedjelju] [u] LT';
  27211. case 3:
  27212. return '[u] [srijedu] [u] LT';
  27213. case 6:
  27214. return '[u] [subotu] [u] LT';
  27215. case 1:
  27216. case 2:
  27217. case 4:
  27218. case 5:
  27219. return '[u] dddd [u] LT';
  27220. }
  27221. },
  27222. lastDay : '[jučer u] LT',
  27223. lastWeek : function () {
  27224. switch (this.day()) {
  27225. case 0:
  27226. case 3:
  27227. return '[prošlu] dddd [u] LT';
  27228. case 6:
  27229. return '[prošle] [subote] [u] LT';
  27230. case 1:
  27231. case 2:
  27232. case 4:
  27233. case 5:
  27234. return '[prošli] dddd [u] LT';
  27235. }
  27236. },
  27237. sameElse : 'L'
  27238. },
  27239. relativeTime : {
  27240. future : 'za %s',
  27241. past : 'prije %s',
  27242. s : 'par sekundi',
  27243. m : hr__translate,
  27244. mm : hr__translate,
  27245. h : hr__translate,
  27246. hh : hr__translate,
  27247. d : 'dan',
  27248. dd : hr__translate,
  27249. M : 'mjesec',
  27250. MM : hr__translate,
  27251. y : 'godinu',
  27252. yy : hr__translate
  27253. },
  27254. ordinalParse: /\d{1,2}\./,
  27255. ordinal : '%d.',
  27256. week : {
  27257. dow : 1, // Monday is the first day of the week.
  27258. doy : 7 // The week that contains Jan 1st is the first week of the year.
  27259. }
  27260. });
  27261. var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');
  27262. function hu__translate(number, withoutSuffix, key, isFuture) {
  27263. var num = number,
  27264. suffix;
  27265. switch (key) {
  27266. case 's':
  27267. return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';
  27268. case 'm':
  27269. return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');
  27270. case 'mm':
  27271. return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
  27272. case 'h':
  27273. return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');
  27274. case 'hh':
  27275. return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
  27276. case 'd':
  27277. return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');
  27278. case 'dd':
  27279. return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
  27280. case 'M':
  27281. return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  27282. case 'MM':
  27283. return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  27284. case 'y':
  27285. return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');
  27286. case 'yy':
  27287. return num + (isFuture || withoutSuffix ? ' év' : ' éve');
  27288. }
  27289. return '';
  27290. }
  27291. function week(isFuture) {
  27292. return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]';
  27293. }
  27294. var hu = moment__default.defineLocale('hu', {
  27295. months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),
  27296. monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),
  27297. weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
  27298. weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
  27299. weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'),
  27300. longDateFormat : {
  27301. LT : 'H:mm',
  27302. LTS : 'H:mm:ss',
  27303. L : 'YYYY.MM.DD.',
  27304. LL : 'YYYY. MMMM D.',
  27305. LLL : 'YYYY. MMMM D. H:mm',
  27306. LLLL : 'YYYY. MMMM D., dddd H:mm'
  27307. },
  27308. meridiemParse: /de|du/i,
  27309. isPM: function (input) {
  27310. return input.charAt(1).toLowerCase() === 'u';
  27311. },
  27312. meridiem : function (hours, minutes, isLower) {
  27313. if (hours < 12) {
  27314. return isLower === true ? 'de' : 'DE';
  27315. } else {
  27316. return isLower === true ? 'du' : 'DU';
  27317. }
  27318. },
  27319. calendar : {
  27320. sameDay : '[ma] LT[-kor]',
  27321. nextDay : '[holnap] LT[-kor]',
  27322. nextWeek : function () {
  27323. return week.call(this, true);
  27324. },
  27325. lastDay : '[tegnap] LT[-kor]',
  27326. lastWeek : function () {
  27327. return week.call(this, false);
  27328. },
  27329. sameElse : 'L'
  27330. },
  27331. relativeTime : {
  27332. future : '%s múlva',
  27333. past : '%s',
  27334. s : hu__translate,
  27335. m : hu__translate,
  27336. mm : hu__translate,
  27337. h : hu__translate,
  27338. hh : hu__translate,
  27339. d : hu__translate,
  27340. dd : hu__translate,
  27341. M : hu__translate,
  27342. MM : hu__translate,
  27343. y : hu__translate,
  27344. yy : hu__translate
  27345. },
  27346. ordinalParse: /\d{1,2}\./,
  27347. ordinal : '%d.',
  27348. week : {
  27349. dow : 1, // Monday is the first day of the week.
  27350. doy : 7 // The week that contains Jan 1st is the first week of the year.
  27351. }
  27352. });
  27353. var hy_am = moment__default.defineLocale('hy-am', {
  27354. months : {
  27355. format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'),
  27356. standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_')
  27357. },
  27358. monthsShort : 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),
  27359. weekdays : 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'),
  27360. weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
  27361. weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
  27362. longDateFormat : {
  27363. LT : 'HH:mm',
  27364. LTS : 'HH:mm:ss',
  27365. L : 'DD.MM.YYYY',
  27366. LL : 'D MMMM YYYY թ.',
  27367. LLL : 'D MMMM YYYY թ., HH:mm',
  27368. LLLL : 'dddd, D MMMM YYYY թ., HH:mm'
  27369. },
  27370. calendar : {
  27371. sameDay: '[այսօր] LT',
  27372. nextDay: '[վաղը] LT',
  27373. lastDay: '[երեկ] LT',
  27374. nextWeek: function () {
  27375. return 'dddd [օրը ժամը] LT';
  27376. },
  27377. lastWeek: function () {
  27378. return '[անցած] dddd [օրը ժամը] LT';
  27379. },
  27380. sameElse: 'L'
  27381. },
  27382. relativeTime : {
  27383. future : '%s հետո',
  27384. past : '%s առաջ',
  27385. s : 'մի քանի վայրկյան',
  27386. m : 'րոպե',
  27387. mm : '%d րոպե',
  27388. h : 'ժամ',
  27389. hh : '%d ժամ',
  27390. d : 'օր',
  27391. dd : '%d օր',
  27392. M : 'ամիս',
  27393. MM : '%d ամիս',
  27394. y : 'տարի',
  27395. yy : '%d տարի'
  27396. },
  27397. meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,
  27398. isPM: function (input) {
  27399. return /^(ցերեկվա|երեկոյան)$/.test(input);
  27400. },
  27401. meridiem : function (hour) {
  27402. if (hour < 4) {
  27403. return 'գիշերվա';
  27404. } else if (hour < 12) {
  27405. return 'առավոտվա';
  27406. } else if (hour < 17) {
  27407. return 'ցերեկվա';
  27408. } else {
  27409. return 'երեկոյան';
  27410. }
  27411. },
  27412. ordinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/,
  27413. ordinal: function (number, period) {
  27414. switch (period) {
  27415. case 'DDD':
  27416. case 'w':
  27417. case 'W':
  27418. case 'DDDo':
  27419. if (number === 1) {
  27420. return number + '-ին';
  27421. }
  27422. return number + '-րդ';
  27423. default:
  27424. return number;
  27425. }
  27426. },
  27427. week : {
  27428. dow : 1, // Monday is the first day of the week.
  27429. doy : 7 // The week that contains Jan 1st is the first week of the year.
  27430. }
  27431. });
  27432. var id = moment__default.defineLocale('id', {
  27433. months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
  27434. monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),
  27435. weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
  27436. weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
  27437. weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
  27438. longDateFormat : {
  27439. LT : 'HH.mm',
  27440. LTS : 'HH.mm.ss',
  27441. L : 'DD/MM/YYYY',
  27442. LL : 'D MMMM YYYY',
  27443. LLL : 'D MMMM YYYY [pukul] HH.mm',
  27444. LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
  27445. },
  27446. meridiemParse: /pagi|siang|sore|malam/,
  27447. meridiemHour : function (hour, meridiem) {
  27448. if (hour === 12) {
  27449. hour = 0;
  27450. }
  27451. if (meridiem === 'pagi') {
  27452. return hour;
  27453. } else if (meridiem === 'siang') {
  27454. return hour >= 11 ? hour : hour + 12;
  27455. } else if (meridiem === 'sore' || meridiem === 'malam') {
  27456. return hour + 12;
  27457. }
  27458. },
  27459. meridiem : function (hours, minutes, isLower) {
  27460. if (hours < 11) {
  27461. return 'pagi';
  27462. } else if (hours < 15) {
  27463. return 'siang';
  27464. } else if (hours < 19) {
  27465. return 'sore';
  27466. } else {
  27467. return 'malam';
  27468. }
  27469. },
  27470. calendar : {
  27471. sameDay : '[Hari ini pukul] LT',
  27472. nextDay : '[Besok pukul] LT',
  27473. nextWeek : 'dddd [pukul] LT',
  27474. lastDay : '[Kemarin pukul] LT',
  27475. lastWeek : 'dddd [lalu pukul] LT',
  27476. sameElse : 'L'
  27477. },
  27478. relativeTime : {
  27479. future : 'dalam %s',
  27480. past : '%s yang lalu',
  27481. s : 'beberapa detik',
  27482. m : 'semenit',
  27483. mm : '%d menit',
  27484. h : 'sejam',
  27485. hh : '%d jam',
  27486. d : 'sehari',
  27487. dd : '%d hari',
  27488. M : 'sebulan',
  27489. MM : '%d bulan',
  27490. y : 'setahun',
  27491. yy : '%d tahun'
  27492. },
  27493. week : {
  27494. dow : 1, // Monday is the first day of the week.
  27495. doy : 7 // The week that contains Jan 1st is the first week of the year.
  27496. }
  27497. });
  27498. function is__plural(n) {
  27499. if (n % 100 === 11) {
  27500. return true;
  27501. } else if (n % 10 === 1) {
  27502. return false;
  27503. }
  27504. return true;
  27505. }
  27506. function is__translate(number, withoutSuffix, key, isFuture) {
  27507. var result = number + ' ';
  27508. switch (key) {
  27509. case 's':
  27510. return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum';
  27511. case 'm':
  27512. return withoutSuffix ? 'mínúta' : 'mínútu';
  27513. case 'mm':
  27514. if (is__plural(number)) {
  27515. return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum');
  27516. } else if (withoutSuffix) {
  27517. return result + 'mínúta';
  27518. }
  27519. return result + 'mínútu';
  27520. case 'hh':
  27521. if (is__plural(number)) {
  27522. return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum');
  27523. }
  27524. return result + 'klukkustund';
  27525. case 'd':
  27526. if (withoutSuffix) {
  27527. return 'dagur';
  27528. }
  27529. return isFuture ? 'dag' : 'degi';
  27530. case 'dd':
  27531. if (is__plural(number)) {
  27532. if (withoutSuffix) {
  27533. return result + 'dagar';
  27534. }
  27535. return result + (isFuture ? 'daga' : 'dögum');
  27536. } else if (withoutSuffix) {
  27537. return result + 'dagur';
  27538. }
  27539. return result + (isFuture ? 'dag' : 'degi');
  27540. case 'M':
  27541. if (withoutSuffix) {
  27542. return 'mánuður';
  27543. }
  27544. return isFuture ? 'mánuð' : 'mánuði';
  27545. case 'MM':
  27546. if (is__plural(number)) {
  27547. if (withoutSuffix) {
  27548. return result + 'mánuðir';
  27549. }
  27550. return result + (isFuture ? 'mánuði' : 'mánuðum');
  27551. } else if (withoutSuffix) {
  27552. return result + 'mánuður';
  27553. }
  27554. return result + (isFuture ? 'mánuð' : 'mánuði');
  27555. case 'y':
  27556. return withoutSuffix || isFuture ? 'ár' : 'ári';
  27557. case 'yy':
  27558. if (is__plural(number)) {
  27559. return result + (withoutSuffix || isFuture ? 'ár' : 'árum');
  27560. }
  27561. return result + (withoutSuffix || isFuture ? 'ár' : 'ári');
  27562. }
  27563. }
  27564. var is = moment__default.defineLocale('is', {
  27565. months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'),
  27566. monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
  27567. weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'),
  27568. weekdaysShort : 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
  27569. weekdaysMin : 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
  27570. longDateFormat : {
  27571. LT : 'H:mm',
  27572. LTS : 'H:mm:ss',
  27573. L : 'DD.MM.YYYY',
  27574. LL : 'D. MMMM YYYY',
  27575. LLL : 'D. MMMM YYYY [kl.] H:mm',
  27576. LLLL : 'dddd, D. MMMM YYYY [kl.] H:mm'
  27577. },
  27578. calendar : {
  27579. sameDay : '[í dag kl.] LT',
  27580. nextDay : '[á morgun kl.] LT',
  27581. nextWeek : 'dddd [kl.] LT',
  27582. lastDay : '[í gær kl.] LT',
  27583. lastWeek : '[síðasta] dddd [kl.] LT',
  27584. sameElse : 'L'
  27585. },
  27586. relativeTime : {
  27587. future : 'eftir %s',
  27588. past : 'fyrir %s síðan',
  27589. s : is__translate,
  27590. m : is__translate,
  27591. mm : is__translate,
  27592. h : 'klukkustund',
  27593. hh : is__translate,
  27594. d : is__translate,
  27595. dd : is__translate,
  27596. M : is__translate,
  27597. MM : is__translate,
  27598. y : is__translate,
  27599. yy : is__translate
  27600. },
  27601. ordinalParse: /\d{1,2}\./,
  27602. ordinal : '%d.',
  27603. week : {
  27604. dow : 1, // Monday is the first day of the week.
  27605. doy : 4 // The week that contains Jan 4th is the first week of the year.
  27606. }
  27607. });
  27608. var it = moment__default.defineLocale('it', {
  27609. months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
  27610. monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
  27611. weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'),
  27612. weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'),
  27613. weekdaysMin : 'Do_Lu_Ma_Me_Gi_Ve_Sa'.split('_'),
  27614. longDateFormat : {
  27615. LT : 'HH:mm',
  27616. LTS : 'HH:mm:ss',
  27617. L : 'DD/MM/YYYY',
  27618. LL : 'D MMMM YYYY',
  27619. LLL : 'D MMMM YYYY HH:mm',
  27620. LLLL : 'dddd, D MMMM YYYY HH:mm'
  27621. },
  27622. calendar : {
  27623. sameDay: '[Oggi alle] LT',
  27624. nextDay: '[Domani alle] LT',
  27625. nextWeek: 'dddd [alle] LT',
  27626. lastDay: '[Ieri alle] LT',
  27627. lastWeek: function () {
  27628. switch (this.day()) {
  27629. case 0:
  27630. return '[la scorsa] dddd [alle] LT';
  27631. default:
  27632. return '[lo scorso] dddd [alle] LT';
  27633. }
  27634. },
  27635. sameElse: 'L'
  27636. },
  27637. relativeTime : {
  27638. future : function (s) {
  27639. return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s;
  27640. },
  27641. past : '%s fa',
  27642. s : 'alcuni secondi',
  27643. m : 'un minuto',
  27644. mm : '%d minuti',
  27645. h : 'un\'ora',
  27646. hh : '%d ore',
  27647. d : 'un giorno',
  27648. dd : '%d giorni',
  27649. M : 'un mese',
  27650. MM : '%d mesi',
  27651. y : 'un anno',
  27652. yy : '%d anni'
  27653. },
  27654. ordinalParse : /\d{1,2}º/,
  27655. ordinal: '%dº',
  27656. week : {
  27657. dow : 1, // Monday is the first day of the week.
  27658. doy : 4 // The week that contains Jan 4th is the first week of the year.
  27659. }
  27660. });
  27661. var ja = moment__default.defineLocale('ja', {
  27662. months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  27663. monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  27664. weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
  27665. weekdaysShort : '日_月_火_水_木_金_土'.split('_'),
  27666. weekdaysMin : '日_月_火_水_木_金_土'.split('_'),
  27667. longDateFormat : {
  27668. LT : 'Ah時m分',
  27669. LTS : 'Ah時m分s秒',
  27670. L : 'YYYY/MM/DD',
  27671. LL : 'YYYY年M月D日',
  27672. LLL : 'YYYY年M月D日Ah時m分',
  27673. LLLL : 'YYYY年M月D日Ah時m分 dddd'
  27674. },
  27675. meridiemParse: /午前|午後/i,
  27676. isPM : function (input) {
  27677. return input === '午後';
  27678. },
  27679. meridiem : function (hour, minute, isLower) {
  27680. if (hour < 12) {
  27681. return '午前';
  27682. } else {
  27683. return '午後';
  27684. }
  27685. },
  27686. calendar : {
  27687. sameDay : '[今日] LT',
  27688. nextDay : '[明日] LT',
  27689. nextWeek : '[来週]dddd LT',
  27690. lastDay : '[昨日] LT',
  27691. lastWeek : '[前週]dddd LT',
  27692. sameElse : 'L'
  27693. },
  27694. ordinalParse : /\d{1,2}日/,
  27695. ordinal : function (number, period) {
  27696. switch (period) {
  27697. case 'd':
  27698. case 'D':
  27699. case 'DDD':
  27700. return number + '日';
  27701. default:
  27702. return number;
  27703. }
  27704. },
  27705. relativeTime : {
  27706. future : '%s後',
  27707. past : '%s前',
  27708. s : '数秒',
  27709. m : '1分',
  27710. mm : '%d分',
  27711. h : '1時間',
  27712. hh : '%d時間',
  27713. d : '1日',
  27714. dd : '%d日',
  27715. M : '1ヶ月',
  27716. MM : '%dヶ月',
  27717. y : '1年',
  27718. yy : '%d年'
  27719. }
  27720. });
  27721. var jv = moment__default.defineLocale('jv', {
  27722. months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split('_'),
  27723. monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),
  27724. weekdays : 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),
  27725. weekdaysShort : 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),
  27726. weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),
  27727. longDateFormat : {
  27728. LT : 'HH.mm',
  27729. LTS : 'HH.mm.ss',
  27730. L : 'DD/MM/YYYY',
  27731. LL : 'D MMMM YYYY',
  27732. LLL : 'D MMMM YYYY [pukul] HH.mm',
  27733. LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
  27734. },
  27735. meridiemParse: /enjing|siyang|sonten|ndalu/,
  27736. meridiemHour : function (hour, meridiem) {
  27737. if (hour === 12) {
  27738. hour = 0;
  27739. }
  27740. if (meridiem === 'enjing') {
  27741. return hour;
  27742. } else if (meridiem === 'siyang') {
  27743. return hour >= 11 ? hour : hour + 12;
  27744. } else if (meridiem === 'sonten' || meridiem === 'ndalu') {
  27745. return hour + 12;
  27746. }
  27747. },
  27748. meridiem : function (hours, minutes, isLower) {
  27749. if (hours < 11) {
  27750. return 'enjing';
  27751. } else if (hours < 15) {
  27752. return 'siyang';
  27753. } else if (hours < 19) {
  27754. return 'sonten';
  27755. } else {
  27756. return 'ndalu';
  27757. }
  27758. },
  27759. calendar : {
  27760. sameDay : '[Dinten puniko pukul] LT',
  27761. nextDay : '[Mbenjang pukul] LT',
  27762. nextWeek : 'dddd [pukul] LT',
  27763. lastDay : '[Kala wingi pukul] LT',
  27764. lastWeek : 'dddd [kepengker pukul] LT',
  27765. sameElse : 'L'
  27766. },
  27767. relativeTime : {
  27768. future : 'wonten ing %s',
  27769. past : '%s ingkang kepengker',
  27770. s : 'sawetawis detik',
  27771. m : 'setunggal menit',
  27772. mm : '%d menit',
  27773. h : 'setunggal jam',
  27774. hh : '%d jam',
  27775. d : 'sedinten',
  27776. dd : '%d dinten',
  27777. M : 'sewulan',
  27778. MM : '%d wulan',
  27779. y : 'setaun',
  27780. yy : '%d taun'
  27781. },
  27782. week : {
  27783. dow : 1, // Monday is the first day of the week.
  27784. doy : 7 // The week that contains Jan 1st is the first week of the year.
  27785. }
  27786. });
  27787. var ka = moment__default.defineLocale('ka', {
  27788. months : {
  27789. standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'),
  27790. format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_')
  27791. },
  27792. monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
  27793. weekdays : {
  27794. standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),
  27795. format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'),
  27796. isFormat: /(წინა|შემდეგ)/
  27797. },
  27798. weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
  27799. weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
  27800. longDateFormat : {
  27801. LT : 'h:mm A',
  27802. LTS : 'h:mm:ss A',
  27803. L : 'DD/MM/YYYY',
  27804. LL : 'D MMMM YYYY',
  27805. LLL : 'D MMMM YYYY h:mm A',
  27806. LLLL : 'dddd, D MMMM YYYY h:mm A'
  27807. },
  27808. calendar : {
  27809. sameDay : '[დღეს] LT[-ზე]',
  27810. nextDay : '[ხვალ] LT[-ზე]',
  27811. lastDay : '[გუშინ] LT[-ზე]',
  27812. nextWeek : '[შემდეგ] dddd LT[-ზე]',
  27813. lastWeek : '[წინა] dddd LT-ზე',
  27814. sameElse : 'L'
  27815. },
  27816. relativeTime : {
  27817. future : function (s) {
  27818. return (/(წამი|წუთი|საათი|წელი)/).test(s) ?
  27819. s.replace(/ი$/, 'ში') :
  27820. s + 'ში';
  27821. },
  27822. past : function (s) {
  27823. if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) {
  27824. return s.replace(/(ი|ე)$/, 'ის წინ');
  27825. }
  27826. if ((/წელი/).test(s)) {
  27827. return s.replace(/წელი$/, 'წლის წინ');
  27828. }
  27829. },
  27830. s : 'რამდენიმე წამი',
  27831. m : 'წუთი',
  27832. mm : '%d წუთი',
  27833. h : 'საათი',
  27834. hh : '%d საათი',
  27835. d : 'დღე',
  27836. dd : '%d დღე',
  27837. M : 'თვე',
  27838. MM : '%d თვე',
  27839. y : 'წელი',
  27840. yy : '%d წელი'
  27841. },
  27842. ordinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,
  27843. ordinal : function (number) {
  27844. if (number === 0) {
  27845. return number;
  27846. }
  27847. if (number === 1) {
  27848. return number + '-ლი';
  27849. }
  27850. if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) {
  27851. return 'მე-' + number;
  27852. }
  27853. return number + '-ე';
  27854. },
  27855. week : {
  27856. dow : 1,
  27857. doy : 7
  27858. }
  27859. });
  27860. var kk__suffixes = {
  27861. 0: '-ші',
  27862. 1: '-ші',
  27863. 2: '-ші',
  27864. 3: '-ші',
  27865. 4: '-ші',
  27866. 5: '-ші',
  27867. 6: '-шы',
  27868. 7: '-ші',
  27869. 8: '-ші',
  27870. 9: '-шы',
  27871. 10: '-шы',
  27872. 20: '-шы',
  27873. 30: '-шы',
  27874. 40: '-шы',
  27875. 50: '-ші',
  27876. 60: '-шы',
  27877. 70: '-ші',
  27878. 80: '-ші',
  27879. 90: '-шы',
  27880. 100: '-ші'
  27881. };
  27882. var kk = moment__default.defineLocale('kk', {
  27883. months : 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split('_'),
  27884. monthsShort : 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),
  27885. weekdays : 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split('_'),
  27886. weekdaysShort : 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),
  27887. weekdaysMin : 'жк_дй_сй_ср_бй_жм_сн'.split('_'),
  27888. longDateFormat : {
  27889. LT : 'HH:mm',
  27890. LTS : 'HH:mm:ss',
  27891. L : 'DD.MM.YYYY',
  27892. LL : 'D MMMM YYYY',
  27893. LLL : 'D MMMM YYYY HH:mm',
  27894. LLLL : 'dddd, D MMMM YYYY HH:mm'
  27895. },
  27896. calendar : {
  27897. sameDay : '[Бүгін сағат] LT',
  27898. nextDay : '[Ертең сағат] LT',
  27899. nextWeek : 'dddd [сағат] LT',
  27900. lastDay : '[Кеше сағат] LT',
  27901. lastWeek : '[Өткен аптаның] dddd [сағат] LT',
  27902. sameElse : 'L'
  27903. },
  27904. relativeTime : {
  27905. future : '%s ішінде',
  27906. past : '%s бұрын',
  27907. s : 'бірнеше секунд',
  27908. m : 'бір минут',
  27909. mm : '%d минут',
  27910. h : 'бір сағат',
  27911. hh : '%d сағат',
  27912. d : 'бір күн',
  27913. dd : '%d күн',
  27914. M : 'бір ай',
  27915. MM : '%d ай',
  27916. y : 'бір жыл',
  27917. yy : '%d жыл'
  27918. },
  27919. ordinalParse: /\d{1,2}-(ші|шы)/,
  27920. ordinal : function (number) {
  27921. var a = number % 10,
  27922. b = number >= 100 ? 100 : null;
  27923. return number + (kk__suffixes[number] || kk__suffixes[a] || kk__suffixes[b]);
  27924. },
  27925. week : {
  27926. dow : 1, // Monday is the first day of the week.
  27927. doy : 7 // The week that contains Jan 1st is the first week of the year.
  27928. }
  27929. });
  27930. var km = moment__default.defineLocale('km', {
  27931. months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
  27932. monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
  27933. weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
  27934. weekdaysShort: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
  27935. weekdaysMin: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
  27936. longDateFormat: {
  27937. LT: 'HH:mm',
  27938. LTS : 'HH:mm:ss',
  27939. L: 'DD/MM/YYYY',
  27940. LL: 'D MMMM YYYY',
  27941. LLL: 'D MMMM YYYY HH:mm',
  27942. LLLL: 'dddd, D MMMM YYYY HH:mm'
  27943. },
  27944. calendar: {
  27945. sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',
  27946. nextDay: '[ស្អែក ម៉ោង] LT',
  27947. nextWeek: 'dddd [ម៉ោង] LT',
  27948. lastDay: '[ម្សិលមិញ ម៉ោង] LT',
  27949. lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',
  27950. sameElse: 'L'
  27951. },
  27952. relativeTime: {
  27953. future: '%sទៀត',
  27954. past: '%sមុន',
  27955. s: 'ប៉ុន្មានវិនាទី',
  27956. m: 'មួយនាទី',
  27957. mm: '%d នាទី',
  27958. h: 'មួយម៉ោង',
  27959. hh: '%d ម៉ោង',
  27960. d: 'មួយថ្ងៃ',
  27961. dd: '%d ថ្ងៃ',
  27962. M: 'មួយខែ',
  27963. MM: '%d ខែ',
  27964. y: 'មួយឆ្នាំ',
  27965. yy: '%d ឆ្នាំ'
  27966. },
  27967. week: {
  27968. dow: 1, // Monday is the first day of the week.
  27969. doy: 4 // The week that contains Jan 4th is the first week of the year.
  27970. }
  27971. });
  27972. var ko = moment__default.defineLocale('ko', {
  27973. months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
  27974. monthsShort : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
  27975. weekdays : '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),
  27976. weekdaysShort : '일_월_화_수_목_금_토'.split('_'),
  27977. weekdaysMin : '일_월_화_수_목_금_토'.split('_'),
  27978. longDateFormat : {
  27979. LT : 'A h시 m분',
  27980. LTS : 'A h시 m분 s초',
  27981. L : 'YYYY.MM.DD',
  27982. LL : 'YYYY년 MMMM D일',
  27983. LLL : 'YYYY년 MMMM D일 A h시 m분',
  27984. LLLL : 'YYYY년 MMMM D일 dddd A h시 m분'
  27985. },
  27986. calendar : {
  27987. sameDay : '오늘 LT',
  27988. nextDay : '내일 LT',
  27989. nextWeek : 'dddd LT',
  27990. lastDay : '어제 LT',
  27991. lastWeek : '지난주 dddd LT',
  27992. sameElse : 'L'
  27993. },
  27994. relativeTime : {
  27995. future : '%s 후',
  27996. past : '%s 전',
  27997. s : '몇 초',
  27998. ss : '%d초',
  27999. m : '일분',
  28000. mm : '%d분',
  28001. h : '한 시간',
  28002. hh : '%d시간',
  28003. d : '하루',
  28004. dd : '%d일',
  28005. M : '한 달',
  28006. MM : '%d달',
  28007. y : '일 년',
  28008. yy : '%d년'
  28009. },
  28010. ordinalParse : /\d{1,2}일/,
  28011. ordinal : '%d일',
  28012. meridiemParse : /오전|오후/,
  28013. isPM : function (token) {
  28014. return token === '오후';
  28015. },
  28016. meridiem : function (hour, minute, isUpper) {
  28017. return hour < 12 ? '오전' : '오후';
  28018. }
  28019. });
  28020. var ky__suffixes = {
  28021. 0: '-чү',
  28022. 1: '-чи',
  28023. 2: '-чи',
  28024. 3: '-чү',
  28025. 4: '-чү',
  28026. 5: '-чи',
  28027. 6: '-чы',
  28028. 7: '-чи',
  28029. 8: '-чи',
  28030. 9: '-чу',
  28031. 10: '-чу',
  28032. 20: '-чы',
  28033. 30: '-чу',
  28034. 40: '-чы',
  28035. 50: '-чү',
  28036. 60: '-чы',
  28037. 70: '-чи',
  28038. 80: '-чи',
  28039. 90: '-чу',
  28040. 100: '-чү'
  28041. };
  28042. var ky = moment__default.defineLocale('ky', {
  28043. months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
  28044. monthsShort : 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),
  28045. weekdays : 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split('_'),
  28046. weekdaysShort : 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),
  28047. weekdaysMin : 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),
  28048. longDateFormat : {
  28049. LT : 'HH:mm',
  28050. LTS : 'HH:mm:ss',
  28051. L : 'DD.MM.YYYY',
  28052. LL : 'D MMMM YYYY',
  28053. LLL : 'D MMMM YYYY HH:mm',
  28054. LLLL : 'dddd, D MMMM YYYY HH:mm'
  28055. },
  28056. calendar : {
  28057. sameDay : '[Бүгүн саат] LT',
  28058. nextDay : '[Эртең саат] LT',
  28059. nextWeek : 'dddd [саат] LT',
  28060. lastDay : '[Кече саат] LT',
  28061. lastWeek : '[Өткен аптанын] dddd [күнү] [саат] LT',
  28062. sameElse : 'L'
  28063. },
  28064. relativeTime : {
  28065. future : '%s ичинде',
  28066. past : '%s мурун',
  28067. s : 'бирнече секунд',
  28068. m : 'бир мүнөт',
  28069. mm : '%d мүнөт',
  28070. h : 'бир саат',
  28071. hh : '%d саат',
  28072. d : 'бир күн',
  28073. dd : '%d күн',
  28074. M : 'бир ай',
  28075. MM : '%d ай',
  28076. y : 'бир жыл',
  28077. yy : '%d жыл'
  28078. },
  28079. ordinalParse: /\d{1,2}-(чи|чы|чү|чу)/,
  28080. ordinal : function (number) {
  28081. var a = number % 10,
  28082. b = number >= 100 ? 100 : null;
  28083. return number + (ky__suffixes[number] || ky__suffixes[a] || ky__suffixes[b]);
  28084. },
  28085. week : {
  28086. dow : 1, // Monday is the first day of the week.
  28087. doy : 7 // The week that contains Jan 1st is the first week of the year.
  28088. }
  28089. });
  28090. function lb__processRelativeTime(number, withoutSuffix, key, isFuture) {
  28091. var format = {
  28092. 'm': ['eng Minutt', 'enger Minutt'],
  28093. 'h': ['eng Stonn', 'enger Stonn'],
  28094. 'd': ['een Dag', 'engem Dag'],
  28095. 'M': ['ee Mount', 'engem Mount'],
  28096. 'y': ['ee Joer', 'engem Joer']
  28097. };
  28098. return withoutSuffix ? format[key][0] : format[key][1];
  28099. }
  28100. function processFutureTime(string) {
  28101. var number = string.substr(0, string.indexOf(' '));
  28102. if (eifelerRegelAppliesToNumber(number)) {
  28103. return 'a ' + string;
  28104. }
  28105. return 'an ' + string;
  28106. }
  28107. function processPastTime(string) {
  28108. var number = string.substr(0, string.indexOf(' '));
  28109. if (eifelerRegelAppliesToNumber(number)) {
  28110. return 'viru ' + string;
  28111. }
  28112. return 'virun ' + string;
  28113. }
  28114. /**
  28115. * Returns true if the word before the given number loses the '-n' ending.
  28116. * e.g. 'an 10 Deeg' but 'a 5 Deeg'
  28117. *
  28118. * @param number {integer}
  28119. * @returns {boolean}
  28120. */
  28121. function eifelerRegelAppliesToNumber(number) {
  28122. number = parseInt(number, 10);
  28123. if (isNaN(number)) {
  28124. return false;
  28125. }
  28126. if (number < 0) {
  28127. // Negative Number --> always true
  28128. return true;
  28129. } else if (number < 10) {
  28130. // Only 1 digit
  28131. if (4 <= number && number <= 7) {
  28132. return true;
  28133. }
  28134. return false;
  28135. } else if (number < 100) {
  28136. // 2 digits
  28137. var lastDigit = number % 10, firstDigit = number / 10;
  28138. if (lastDigit === 0) {
  28139. return eifelerRegelAppliesToNumber(firstDigit);
  28140. }
  28141. return eifelerRegelAppliesToNumber(lastDigit);
  28142. } else if (number < 10000) {
  28143. // 3 or 4 digits --> recursively check first digit
  28144. while (number >= 10) {
  28145. number = number / 10;
  28146. }
  28147. return eifelerRegelAppliesToNumber(number);
  28148. } else {
  28149. // Anything larger than 4 digits: recursively check first n-3 digits
  28150. number = number / 1000;
  28151. return eifelerRegelAppliesToNumber(number);
  28152. }
  28153. }
  28154. var lb = moment__default.defineLocale('lb', {
  28155. months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
  28156. monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
  28157. monthsParseExact : true,
  28158. weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),
  28159. weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
  28160. weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
  28161. weekdaysParseExact : true,
  28162. longDateFormat: {
  28163. LT: 'H:mm [Auer]',
  28164. LTS: 'H:mm:ss [Auer]',
  28165. L: 'DD.MM.YYYY',
  28166. LL: 'D. MMMM YYYY',
  28167. LLL: 'D. MMMM YYYY H:mm [Auer]',
  28168. LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]'
  28169. },
  28170. calendar: {
  28171. sameDay: '[Haut um] LT',
  28172. sameElse: 'L',
  28173. nextDay: '[Muer um] LT',
  28174. nextWeek: 'dddd [um] LT',
  28175. lastDay: '[Gëschter um] LT',
  28176. lastWeek: function () {
  28177. // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
  28178. switch (this.day()) {
  28179. case 2:
  28180. case 4:
  28181. return '[Leschten] dddd [um] LT';
  28182. default:
  28183. return '[Leschte] dddd [um] LT';
  28184. }
  28185. }
  28186. },
  28187. relativeTime : {
  28188. future : processFutureTime,
  28189. past : processPastTime,
  28190. s : 'e puer Sekonnen',
  28191. m : lb__processRelativeTime,
  28192. mm : '%d Minutten',
  28193. h : lb__processRelativeTime,
  28194. hh : '%d Stonnen',
  28195. d : lb__processRelativeTime,
  28196. dd : '%d Deeg',
  28197. M : lb__processRelativeTime,
  28198. MM : '%d Méint',
  28199. y : lb__processRelativeTime,
  28200. yy : '%d Joer'
  28201. },
  28202. ordinalParse: /\d{1,2}\./,
  28203. ordinal: '%d.',
  28204. week: {
  28205. dow: 1, // Monday is the first day of the week.
  28206. doy: 4 // The week that contains Jan 4th is the first week of the year.
  28207. }
  28208. });
  28209. var lo = moment__default.defineLocale('lo', {
  28210. months : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),
  28211. monthsShort : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),
  28212. weekdays : 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
  28213. weekdaysShort : 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
  28214. weekdaysMin : 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),
  28215. weekdaysParseExact : true,
  28216. longDateFormat : {
  28217. LT : 'HH:mm',
  28218. LTS : 'HH:mm:ss',
  28219. L : 'DD/MM/YYYY',
  28220. LL : 'D MMMM YYYY',
  28221. LLL : 'D MMMM YYYY HH:mm',
  28222. LLLL : 'ວັນdddd D MMMM YYYY HH:mm'
  28223. },
  28224. meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/,
  28225. isPM: function (input) {
  28226. return input === 'ຕອນແລງ';
  28227. },
  28228. meridiem : function (hour, minute, isLower) {
  28229. if (hour < 12) {
  28230. return 'ຕອນເຊົ້າ';
  28231. } else {
  28232. return 'ຕອນແລງ';
  28233. }
  28234. },
  28235. calendar : {
  28236. sameDay : '[ມື້ນີ້ເວລາ] LT',
  28237. nextDay : '[ມື້ອື່ນເວລາ] LT',
  28238. nextWeek : '[ວັນ]dddd[ໜ້າເວລາ] LT',
  28239. lastDay : '[ມື້ວານນີ້ເວລາ] LT',
  28240. lastWeek : '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT',
  28241. sameElse : 'L'
  28242. },
  28243. relativeTime : {
  28244. future : 'ອີກ %s',
  28245. past : '%sຜ່ານມາ',
  28246. s : 'ບໍ່ເທົ່າໃດວິນາທີ',
  28247. m : '1 ນາທີ',
  28248. mm : '%d ນາທີ',
  28249. h : '1 ຊົ່ວໂມງ',
  28250. hh : '%d ຊົ່ວໂມງ',
  28251. d : '1 ມື້',
  28252. dd : '%d ມື້',
  28253. M : '1 ເດືອນ',
  28254. MM : '%d ເດືອນ',
  28255. y : '1 ປີ',
  28256. yy : '%d ປີ'
  28257. },
  28258. ordinalParse: /(ທີ່)\d{1,2}/,
  28259. ordinal : function (number) {
  28260. return 'ທີ່' + number;
  28261. }
  28262. });
  28263. var lt__units = {
  28264. 'm' : 'minutė_minutės_minutę',
  28265. 'mm': 'minutės_minučių_minutes',
  28266. 'h' : 'valanda_valandos_valandą',
  28267. 'hh': 'valandos_valandų_valandas',
  28268. 'd' : 'diena_dienos_dieną',
  28269. 'dd': 'dienos_dienų_dienas',
  28270. 'M' : 'mėnuo_mėnesio_mėnesį',
  28271. 'MM': 'mėnesiai_mėnesių_mėnesius',
  28272. 'y' : 'metai_metų_metus',
  28273. 'yy': 'metai_metų_metus'
  28274. };
  28275. function translateSeconds(number, withoutSuffix, key, isFuture) {
  28276. if (withoutSuffix) {
  28277. return 'kelios sekundės';
  28278. } else {
  28279. return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
  28280. }
  28281. }
  28282. function translateSingular(number, withoutSuffix, key, isFuture) {
  28283. return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);
  28284. }
  28285. function special(number) {
  28286. return number % 10 === 0 || (number > 10 && number < 20);
  28287. }
  28288. function forms(key) {
  28289. return lt__units[key].split('_');
  28290. }
  28291. function lt__translate(number, withoutSuffix, key, isFuture) {
  28292. var result = number + ' ';
  28293. if (number === 1) {
  28294. return result + translateSingular(number, withoutSuffix, key[0], isFuture);
  28295. } else if (withoutSuffix) {
  28296. return result + (special(number) ? forms(key)[1] : forms(key)[0]);
  28297. } else {
  28298. if (isFuture) {
  28299. return result + forms(key)[1];
  28300. } else {
  28301. return result + (special(number) ? forms(key)[1] : forms(key)[2]);
  28302. }
  28303. }
  28304. }
  28305. var lt = moment__default.defineLocale('lt', {
  28306. months : {
  28307. format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'),
  28308. standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'),
  28309. isFormat: /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?|MMMM?(\[[^\[\]]*\]|\s+)+D[oD]?/
  28310. },
  28311. monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
  28312. weekdays : {
  28313. format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'),
  28314. standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'),
  28315. isFormat: /dddd HH:mm/
  28316. },
  28317. weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
  28318. weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'),
  28319. weekdaysParseExact : true,
  28320. longDateFormat : {
  28321. LT : 'HH:mm',
  28322. LTS : 'HH:mm:ss',
  28323. L : 'YYYY-MM-DD',
  28324. LL : 'YYYY [m.] MMMM D [d.]',
  28325. LLL : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  28326. LLLL : 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
  28327. l : 'YYYY-MM-DD',
  28328. ll : 'YYYY [m.] MMMM D [d.]',
  28329. lll : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  28330. llll : 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]'
  28331. },
  28332. calendar : {
  28333. sameDay : '[Šiandien] LT',
  28334. nextDay : '[Rytoj] LT',
  28335. nextWeek : 'dddd LT',
  28336. lastDay : '[Vakar] LT',
  28337. lastWeek : '[Praėjusį] dddd LT',
  28338. sameElse : 'L'
  28339. },
  28340. relativeTime : {
  28341. future : 'po %s',
  28342. past : 'prieš %s',
  28343. s : translateSeconds,
  28344. m : translateSingular,
  28345. mm : lt__translate,
  28346. h : translateSingular,
  28347. hh : lt__translate,
  28348. d : translateSingular,
  28349. dd : lt__translate,
  28350. M : translateSingular,
  28351. MM : lt__translate,
  28352. y : translateSingular,
  28353. yy : lt__translate
  28354. },
  28355. ordinalParse: /\d{1,2}-oji/,
  28356. ordinal : function (number) {
  28357. return number + '-oji';
  28358. },
  28359. week : {
  28360. dow : 1, // Monday is the first day of the week.
  28361. doy : 4 // The week that contains Jan 4th is the first week of the year.
  28362. }
  28363. });
  28364. var lv__units = {
  28365. 'm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
  28366. 'mm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
  28367. 'h': 'stundas_stundām_stunda_stundas'.split('_'),
  28368. 'hh': 'stundas_stundām_stunda_stundas'.split('_'),
  28369. 'd': 'dienas_dienām_diena_dienas'.split('_'),
  28370. 'dd': 'dienas_dienām_diena_dienas'.split('_'),
  28371. 'M': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
  28372. 'MM': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
  28373. 'y': 'gada_gadiem_gads_gadi'.split('_'),
  28374. 'yy': 'gada_gadiem_gads_gadi'.split('_')
  28375. };
  28376. /**
  28377. * @param withoutSuffix boolean true = a length of time; false = before/after a period of time.
  28378. */
  28379. function lv__format(forms, number, withoutSuffix) {
  28380. if (withoutSuffix) {
  28381. // E.g. "21 minūte", "3 minūtes".
  28382. return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3];
  28383. } else {
  28384. // E.g. "21 minūtes" as in "pēc 21 minūtes".
  28385. // E.g. "3 minūtēm" as in "pēc 3 minūtēm".
  28386. return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1];
  28387. }
  28388. }
  28389. function lv__relativeTimeWithPlural(number, withoutSuffix, key) {
  28390. return number + ' ' + lv__format(lv__units[key], number, withoutSuffix);
  28391. }
  28392. function relativeTimeWithSingular(number, withoutSuffix, key) {
  28393. return lv__format(lv__units[key], number, withoutSuffix);
  28394. }
  28395. function relativeSeconds(number, withoutSuffix) {
  28396. return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';
  28397. }
  28398. var lv = moment__default.defineLocale('lv', {
  28399. months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),
  28400. monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
  28401. weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),
  28402. weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'),
  28403. weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'),
  28404. weekdaysParseExact : true,
  28405. longDateFormat : {
  28406. LT : 'HH:mm',
  28407. LTS : 'HH:mm:ss',
  28408. L : 'DD.MM.YYYY.',
  28409. LL : 'YYYY. [gada] D. MMMM',
  28410. LLL : 'YYYY. [gada] D. MMMM, HH:mm',
  28411. LLLL : 'YYYY. [gada] D. MMMM, dddd, HH:mm'
  28412. },
  28413. calendar : {
  28414. sameDay : '[Šodien pulksten] LT',
  28415. nextDay : '[Rīt pulksten] LT',
  28416. nextWeek : 'dddd [pulksten] LT',
  28417. lastDay : '[Vakar pulksten] LT',
  28418. lastWeek : '[Pagājušā] dddd [pulksten] LT',
  28419. sameElse : 'L'
  28420. },
  28421. relativeTime : {
  28422. future : 'pēc %s',
  28423. past : 'pirms %s',
  28424. s : relativeSeconds,
  28425. m : relativeTimeWithSingular,
  28426. mm : lv__relativeTimeWithPlural,
  28427. h : relativeTimeWithSingular,
  28428. hh : lv__relativeTimeWithPlural,
  28429. d : relativeTimeWithSingular,
  28430. dd : lv__relativeTimeWithPlural,
  28431. M : relativeTimeWithSingular,
  28432. MM : lv__relativeTimeWithPlural,
  28433. y : relativeTimeWithSingular,
  28434. yy : lv__relativeTimeWithPlural
  28435. },
  28436. ordinalParse: /\d{1,2}\./,
  28437. ordinal : '%d.',
  28438. week : {
  28439. dow : 1, // Monday is the first day of the week.
  28440. doy : 4 // The week that contains Jan 4th is the first week of the year.
  28441. }
  28442. });
  28443. var me__translator = {
  28444. words: { //Different grammatical cases
  28445. m: ['jedan minut', 'jednog minuta'],
  28446. mm: ['minut', 'minuta', 'minuta'],
  28447. h: ['jedan sat', 'jednog sata'],
  28448. hh: ['sat', 'sata', 'sati'],
  28449. dd: ['dan', 'dana', 'dana'],
  28450. MM: ['mjesec', 'mjeseca', 'mjeseci'],
  28451. yy: ['godina', 'godine', 'godina']
  28452. },
  28453. correctGrammaticalCase: function (number, wordKey) {
  28454. return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
  28455. },
  28456. translate: function (number, withoutSuffix, key) {
  28457. var wordKey = me__translator.words[key];
  28458. if (key.length === 1) {
  28459. return withoutSuffix ? wordKey[0] : wordKey[1];
  28460. } else {
  28461. return number + ' ' + me__translator.correctGrammaticalCase(number, wordKey);
  28462. }
  28463. }
  28464. };
  28465. var me = moment__default.defineLocale('me', {
  28466. months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),
  28467. monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
  28468. monthsParseExact : true,
  28469. weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
  28470. weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  28471. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  28472. weekdaysParseExact : true,
  28473. longDateFormat: {
  28474. LT: 'H:mm',
  28475. LTS : 'H:mm:ss',
  28476. L: 'DD. MM. YYYY',
  28477. LL: 'D. MMMM YYYY',
  28478. LLL: 'D. MMMM YYYY H:mm',
  28479. LLLL: 'dddd, D. MMMM YYYY H:mm'
  28480. },
  28481. calendar: {
  28482. sameDay: '[danas u] LT',
  28483. nextDay: '[sjutra u] LT',
  28484. nextWeek: function () {
  28485. switch (this.day()) {
  28486. case 0:
  28487. return '[u] [nedjelju] [u] LT';
  28488. case 3:
  28489. return '[u] [srijedu] [u] LT';
  28490. case 6:
  28491. return '[u] [subotu] [u] LT';
  28492. case 1:
  28493. case 2:
  28494. case 4:
  28495. case 5:
  28496. return '[u] dddd [u] LT';
  28497. }
  28498. },
  28499. lastDay : '[juče u] LT',
  28500. lastWeek : function () {
  28501. var lastWeekDays = [
  28502. '[prošle] [nedjelje] [u] LT',
  28503. '[prošlog] [ponedjeljka] [u] LT',
  28504. '[prošlog] [utorka] [u] LT',
  28505. '[prošle] [srijede] [u] LT',
  28506. '[prošlog] [četvrtka] [u] LT',
  28507. '[prošlog] [petka] [u] LT',
  28508. '[prošle] [subote] [u] LT'
  28509. ];
  28510. return lastWeekDays[this.day()];
  28511. },
  28512. sameElse : 'L'
  28513. },
  28514. relativeTime : {
  28515. future : 'za %s',
  28516. past : 'prije %s',
  28517. s : 'nekoliko sekundi',
  28518. m : me__translator.translate,
  28519. mm : me__translator.translate,
  28520. h : me__translator.translate,
  28521. hh : me__translator.translate,
  28522. d : 'dan',
  28523. dd : me__translator.translate,
  28524. M : 'mjesec',
  28525. MM : me__translator.translate,
  28526. y : 'godinu',
  28527. yy : me__translator.translate
  28528. },
  28529. ordinalParse: /\d{1,2}\./,
  28530. ordinal : '%d.',
  28531. week : {
  28532. dow : 1, // Monday is the first day of the week.
  28533. doy : 7 // The week that contains Jan 1st is the first week of the year.
  28534. }
  28535. });
  28536. var mk = moment__default.defineLocale('mk', {
  28537. months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),
  28538. monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
  28539. weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'),
  28540. weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
  28541. weekdaysMin : 'нe_пo_вт_ср_че_пе_сa'.split('_'),
  28542. longDateFormat : {
  28543. LT : 'H:mm',
  28544. LTS : 'H:mm:ss',
  28545. L : 'D.MM.YYYY',
  28546. LL : 'D MMMM YYYY',
  28547. LLL : 'D MMMM YYYY H:mm',
  28548. LLLL : 'dddd, D MMMM YYYY H:mm'
  28549. },
  28550. calendar : {
  28551. sameDay : '[Денес во] LT',
  28552. nextDay : '[Утре во] LT',
  28553. nextWeek : '[Во] dddd [во] LT',
  28554. lastDay : '[Вчера во] LT',
  28555. lastWeek : function () {
  28556. switch (this.day()) {
  28557. case 0:
  28558. case 3:
  28559. case 6:
  28560. return '[Изминатата] dddd [во] LT';
  28561. case 1:
  28562. case 2:
  28563. case 4:
  28564. case 5:
  28565. return '[Изминатиот] dddd [во] LT';
  28566. }
  28567. },
  28568. sameElse : 'L'
  28569. },
  28570. relativeTime : {
  28571. future : 'после %s',
  28572. past : 'пред %s',
  28573. s : 'неколку секунди',
  28574. m : 'минута',
  28575. mm : '%d минути',
  28576. h : 'час',
  28577. hh : '%d часа',
  28578. d : 'ден',
  28579. dd : '%d дена',
  28580. M : 'месец',
  28581. MM : '%d месеци',
  28582. y : 'година',
  28583. yy : '%d години'
  28584. },
  28585. ordinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
  28586. ordinal : function (number) {
  28587. var lastDigit = number % 10,
  28588. last2Digits = number % 100;
  28589. if (number === 0) {
  28590. return number + '-ев';
  28591. } else if (last2Digits === 0) {
  28592. return number + '-ен';
  28593. } else if (last2Digits > 10 && last2Digits < 20) {
  28594. return number + '-ти';
  28595. } else if (lastDigit === 1) {
  28596. return number + '-ви';
  28597. } else if (lastDigit === 2) {
  28598. return number + '-ри';
  28599. } else if (lastDigit === 7 || lastDigit === 8) {
  28600. return number + '-ми';
  28601. } else {
  28602. return number + '-ти';
  28603. }
  28604. },
  28605. week : {
  28606. dow : 1, // Monday is the first day of the week.
  28607. doy : 7 // The week that contains Jan 1st is the first week of the year.
  28608. }
  28609. });
  28610. var ml = moment__default.defineLocale('ml', {
  28611. months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'),
  28612. monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'),
  28613. monthsParseExact : true,
  28614. weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'),
  28615. weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),
  28616. weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),
  28617. longDateFormat : {
  28618. LT : 'A h:mm -നു',
  28619. LTS : 'A h:mm:ss -നു',
  28620. L : 'DD/MM/YYYY',
  28621. LL : 'D MMMM YYYY',
  28622. LLL : 'D MMMM YYYY, A h:mm -നു',
  28623. LLLL : 'dddd, D MMMM YYYY, A h:mm -നു'
  28624. },
  28625. calendar : {
  28626. sameDay : '[ഇന്ന്] LT',
  28627. nextDay : '[നാളെ] LT',
  28628. nextWeek : 'dddd, LT',
  28629. lastDay : '[ഇന്നലെ] LT',
  28630. lastWeek : '[കഴിഞ്ഞ] dddd, LT',
  28631. sameElse : 'L'
  28632. },
  28633. relativeTime : {
  28634. future : '%s കഴിഞ്ഞ്',
  28635. past : '%s മുൻപ്',
  28636. s : 'അൽപ നിമിഷങ്ങൾ',
  28637. m : 'ഒരു മിനിറ്റ്',
  28638. mm : '%d മിനിറ്റ്',
  28639. h : 'ഒരു മണിക്കൂർ',
  28640. hh : '%d മണിക്കൂർ',
  28641. d : 'ഒരു ദിവസം',
  28642. dd : '%d ദിവസം',
  28643. M : 'ഒരു മാസം',
  28644. MM : '%d മാസം',
  28645. y : 'ഒരു വർഷം',
  28646. yy : '%d വർഷം'
  28647. },
  28648. meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,
  28649. meridiemHour : function (hour, meridiem) {
  28650. if (hour === 12) {
  28651. hour = 0;
  28652. }
  28653. if ((meridiem === 'രാത്രി' && hour >= 4) ||
  28654. meridiem === 'ഉച്ച കഴിഞ്ഞ്' ||
  28655. meridiem === 'വൈകുന്നേരം') {
  28656. return hour + 12;
  28657. } else {
  28658. return hour;
  28659. }
  28660. },
  28661. meridiem : function (hour, minute, isLower) {
  28662. if (hour < 4) {
  28663. return 'രാത്രി';
  28664. } else if (hour < 12) {
  28665. return 'രാവിലെ';
  28666. } else if (hour < 17) {
  28667. return 'ഉച്ച കഴിഞ്ഞ്';
  28668. } else if (hour < 20) {
  28669. return 'വൈകുന്നേരം';
  28670. } else {
  28671. return 'രാത്രി';
  28672. }
  28673. }
  28674. });
  28675. var mr__symbolMap = {
  28676. '1': '१',
  28677. '2': '२',
  28678. '3': '३',
  28679. '4': '४',
  28680. '5': '५',
  28681. '6': '६',
  28682. '7': '७',
  28683. '8': '८',
  28684. '9': '९',
  28685. '0': '०'
  28686. },
  28687. mr__numberMap = {
  28688. '१': '1',
  28689. '२': '2',
  28690. '३': '3',
  28691. '४': '4',
  28692. '५': '5',
  28693. '६': '6',
  28694. '७': '7',
  28695. '८': '8',
  28696. '९': '9',
  28697. '०': '0'
  28698. };
  28699. function relativeTimeMr(number, withoutSuffix, string, isFuture)
  28700. {
  28701. var output = '';
  28702. if (withoutSuffix) {
  28703. switch (string) {
  28704. case 's': output = 'काही सेकंद'; break;
  28705. case 'm': output = 'एक मिनिट'; break;
  28706. case 'mm': output = '%d मिनिटे'; break;
  28707. case 'h': output = 'एक तास'; break;
  28708. case 'hh': output = '%d तास'; break;
  28709. case 'd': output = 'एक दिवस'; break;
  28710. case 'dd': output = '%d दिवस'; break;
  28711. case 'M': output = 'एक महिना'; break;
  28712. case 'MM': output = '%d महिने'; break;
  28713. case 'y': output = 'एक वर्ष'; break;
  28714. case 'yy': output = '%d वर्षे'; break;
  28715. }
  28716. }
  28717. else {
  28718. switch (string) {
  28719. case 's': output = 'काही सेकंदां'; break;
  28720. case 'm': output = 'एका मिनिटा'; break;
  28721. case 'mm': output = '%d मिनिटां'; break;
  28722. case 'h': output = 'एका तासा'; break;
  28723. case 'hh': output = '%d तासां'; break;
  28724. case 'd': output = 'एका दिवसा'; break;
  28725. case 'dd': output = '%d दिवसां'; break;
  28726. case 'M': output = 'एका महिन्या'; break;
  28727. case 'MM': output = '%d महिन्यां'; break;
  28728. case 'y': output = 'एका वर्षा'; break;
  28729. case 'yy': output = '%d वर्षां'; break;
  28730. }
  28731. }
  28732. return output.replace(/%d/i, number);
  28733. }
  28734. var mr = moment__default.defineLocale('mr', {
  28735. months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'),
  28736. monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),
  28737. monthsParseExact : true,
  28738. weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
  28739. weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
  28740. weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
  28741. longDateFormat : {
  28742. LT : 'A h:mm वाजता',
  28743. LTS : 'A h:mm:ss वाजता',
  28744. L : 'DD/MM/YYYY',
  28745. LL : 'D MMMM YYYY',
  28746. LLL : 'D MMMM YYYY, A h:mm वाजता',
  28747. LLLL : 'dddd, D MMMM YYYY, A h:mm वाजता'
  28748. },
  28749. calendar : {
  28750. sameDay : '[आज] LT',
  28751. nextDay : '[उद्या] LT',
  28752. nextWeek : 'dddd, LT',
  28753. lastDay : '[काल] LT',
  28754. lastWeek: '[मागील] dddd, LT',
  28755. sameElse : 'L'
  28756. },
  28757. relativeTime : {
  28758. future: '%sमध्ये',
  28759. past: '%sपूर्वी',
  28760. s: relativeTimeMr,
  28761. m: relativeTimeMr,
  28762. mm: relativeTimeMr,
  28763. h: relativeTimeMr,
  28764. hh: relativeTimeMr,
  28765. d: relativeTimeMr,
  28766. dd: relativeTimeMr,
  28767. M: relativeTimeMr,
  28768. MM: relativeTimeMr,
  28769. y: relativeTimeMr,
  28770. yy: relativeTimeMr
  28771. },
  28772. preparse: function (string) {
  28773. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  28774. return mr__numberMap[match];
  28775. });
  28776. },
  28777. postformat: function (string) {
  28778. return string.replace(/\d/g, function (match) {
  28779. return mr__symbolMap[match];
  28780. });
  28781. },
  28782. meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/,
  28783. meridiemHour : function (hour, meridiem) {
  28784. if (hour === 12) {
  28785. hour = 0;
  28786. }
  28787. if (meridiem === 'रात्री') {
  28788. return hour < 4 ? hour : hour + 12;
  28789. } else if (meridiem === 'सकाळी') {
  28790. return hour;
  28791. } else if (meridiem === 'दुपारी') {
  28792. return hour >= 10 ? hour : hour + 12;
  28793. } else if (meridiem === 'सायंकाळी') {
  28794. return hour + 12;
  28795. }
  28796. },
  28797. meridiem: function (hour, minute, isLower) {
  28798. if (hour < 4) {
  28799. return 'रात्री';
  28800. } else if (hour < 10) {
  28801. return 'सकाळी';
  28802. } else if (hour < 17) {
  28803. return 'दुपारी';
  28804. } else if (hour < 20) {
  28805. return 'सायंकाळी';
  28806. } else {
  28807. return 'रात्री';
  28808. }
  28809. },
  28810. week : {
  28811. dow : 0, // Sunday is the first day of the week.
  28812. doy : 6 // The week that contains Jan 1st is the first week of the year.
  28813. }
  28814. });
  28815. var ms_my = moment__default.defineLocale('ms-my', {
  28816. months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
  28817. monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
  28818. weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
  28819. weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
  28820. weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
  28821. longDateFormat : {
  28822. LT : 'HH.mm',
  28823. LTS : 'HH.mm.ss',
  28824. L : 'DD/MM/YYYY',
  28825. LL : 'D MMMM YYYY',
  28826. LLL : 'D MMMM YYYY [pukul] HH.mm',
  28827. LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
  28828. },
  28829. meridiemParse: /pagi|tengahari|petang|malam/,
  28830. meridiemHour: function (hour, meridiem) {
  28831. if (hour === 12) {
  28832. hour = 0;
  28833. }
  28834. if (meridiem === 'pagi') {
  28835. return hour;
  28836. } else if (meridiem === 'tengahari') {
  28837. return hour >= 11 ? hour : hour + 12;
  28838. } else if (meridiem === 'petang' || meridiem === 'malam') {
  28839. return hour + 12;
  28840. }
  28841. },
  28842. meridiem : function (hours, minutes, isLower) {
  28843. if (hours < 11) {
  28844. return 'pagi';
  28845. } else if (hours < 15) {
  28846. return 'tengahari';
  28847. } else if (hours < 19) {
  28848. return 'petang';
  28849. } else {
  28850. return 'malam';
  28851. }
  28852. },
  28853. calendar : {
  28854. sameDay : '[Hari ini pukul] LT',
  28855. nextDay : '[Esok pukul] LT',
  28856. nextWeek : 'dddd [pukul] LT',
  28857. lastDay : '[Kelmarin pukul] LT',
  28858. lastWeek : 'dddd [lepas pukul] LT',
  28859. sameElse : 'L'
  28860. },
  28861. relativeTime : {
  28862. future : 'dalam %s',
  28863. past : '%s yang lepas',
  28864. s : 'beberapa saat',
  28865. m : 'seminit',
  28866. mm : '%d minit',
  28867. h : 'sejam',
  28868. hh : '%d jam',
  28869. d : 'sehari',
  28870. dd : '%d hari',
  28871. M : 'sebulan',
  28872. MM : '%d bulan',
  28873. y : 'setahun',
  28874. yy : '%d tahun'
  28875. },
  28876. week : {
  28877. dow : 1, // Monday is the first day of the week.
  28878. doy : 7 // The week that contains Jan 1st is the first week of the year.
  28879. }
  28880. });
  28881. var locale_ms = moment__default.defineLocale('ms', {
  28882. months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
  28883. monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
  28884. weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
  28885. weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
  28886. weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
  28887. longDateFormat : {
  28888. LT : 'HH.mm',
  28889. LTS : 'HH.mm.ss',
  28890. L : 'DD/MM/YYYY',
  28891. LL : 'D MMMM YYYY',
  28892. LLL : 'D MMMM YYYY [pukul] HH.mm',
  28893. LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
  28894. },
  28895. meridiemParse: /pagi|tengahari|petang|malam/,
  28896. meridiemHour: function (hour, meridiem) {
  28897. if (hour === 12) {
  28898. hour = 0;
  28899. }
  28900. if (meridiem === 'pagi') {
  28901. return hour;
  28902. } else if (meridiem === 'tengahari') {
  28903. return hour >= 11 ? hour : hour + 12;
  28904. } else if (meridiem === 'petang' || meridiem === 'malam') {
  28905. return hour + 12;
  28906. }
  28907. },
  28908. meridiem : function (hours, minutes, isLower) {
  28909. if (hours < 11) {
  28910. return 'pagi';
  28911. } else if (hours < 15) {
  28912. return 'tengahari';
  28913. } else if (hours < 19) {
  28914. return 'petang';
  28915. } else {
  28916. return 'malam';
  28917. }
  28918. },
  28919. calendar : {
  28920. sameDay : '[Hari ini pukul] LT',
  28921. nextDay : '[Esok pukul] LT',
  28922. nextWeek : 'dddd [pukul] LT',
  28923. lastDay : '[Kelmarin pukul] LT',
  28924. lastWeek : 'dddd [lepas pukul] LT',
  28925. sameElse : 'L'
  28926. },
  28927. relativeTime : {
  28928. future : 'dalam %s',
  28929. past : '%s yang lepas',
  28930. s : 'beberapa saat',
  28931. m : 'seminit',
  28932. mm : '%d minit',
  28933. h : 'sejam',
  28934. hh : '%d jam',
  28935. d : 'sehari',
  28936. dd : '%d hari',
  28937. M : 'sebulan',
  28938. MM : '%d bulan',
  28939. y : 'setahun',
  28940. yy : '%d tahun'
  28941. },
  28942. week : {
  28943. dow : 1, // Monday is the first day of the week.
  28944. doy : 7 // The week that contains Jan 1st is the first week of the year.
  28945. }
  28946. });
  28947. var my__symbolMap = {
  28948. '1': '၁',
  28949. '2': '၂',
  28950. '3': '၃',
  28951. '4': '၄',
  28952. '5': '၅',
  28953. '6': '၆',
  28954. '7': '၇',
  28955. '8': '၈',
  28956. '9': '၉',
  28957. '0': '၀'
  28958. }, my__numberMap = {
  28959. '၁': '1',
  28960. '၂': '2',
  28961. '၃': '3',
  28962. '၄': '4',
  28963. '၅': '5',
  28964. '၆': '6',
  28965. '၇': '7',
  28966. '၈': '8',
  28967. '၉': '9',
  28968. '၀': '0'
  28969. };
  28970. var my = moment__default.defineLocale('my', {
  28971. months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'),
  28972. monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),
  28973. weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'),
  28974. weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
  28975. weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
  28976. longDateFormat: {
  28977. LT: 'HH:mm',
  28978. LTS: 'HH:mm:ss',
  28979. L: 'DD/MM/YYYY',
  28980. LL: 'D MMMM YYYY',
  28981. LLL: 'D MMMM YYYY HH:mm',
  28982. LLLL: 'dddd D MMMM YYYY HH:mm'
  28983. },
  28984. calendar: {
  28985. sameDay: '[ယနေ.] LT [မှာ]',
  28986. nextDay: '[မနက်ဖြန်] LT [မှာ]',
  28987. nextWeek: 'dddd LT [မှာ]',
  28988. lastDay: '[မနေ.က] LT [မှာ]',
  28989. lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',
  28990. sameElse: 'L'
  28991. },
  28992. relativeTime: {
  28993. future: 'လာမည့် %s မှာ',
  28994. past: 'လွန်ခဲ့သော %s က',
  28995. s: 'စက္ကန်.အနည်းငယ်',
  28996. m: 'တစ်မိနစ်',
  28997. mm: '%d မိနစ်',
  28998. h: 'တစ်နာရီ',
  28999. hh: '%d နာရီ',
  29000. d: 'တစ်ရက်',
  29001. dd: '%d ရက်',
  29002. M: 'တစ်လ',
  29003. MM: '%d လ',
  29004. y: 'တစ်နှစ်',
  29005. yy: '%d နှစ်'
  29006. },
  29007. preparse: function (string) {
  29008. return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {
  29009. return my__numberMap[match];
  29010. });
  29011. },
  29012. postformat: function (string) {
  29013. return string.replace(/\d/g, function (match) {
  29014. return my__symbolMap[match];
  29015. });
  29016. },
  29017. week: {
  29018. dow: 1, // Monday is the first day of the week.
  29019. doy: 4 // The week that contains Jan 1st is the first week of the year.
  29020. }
  29021. });
  29022. var nb = moment__default.defineLocale('nb', {
  29023. months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
  29024. monthsShort : 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),
  29025. monthsParseExact : true,
  29026. weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
  29027. weekdaysShort : 'sø._ma._ti._on._to._fr._lø.'.split('_'),
  29028. weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),
  29029. weekdaysParseExact : true,
  29030. longDateFormat : {
  29031. LT : 'HH:mm',
  29032. LTS : 'HH:mm:ss',
  29033. L : 'DD.MM.YYYY',
  29034. LL : 'D. MMMM YYYY',
  29035. LLL : 'D. MMMM YYYY [kl.] HH:mm',
  29036. LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm'
  29037. },
  29038. calendar : {
  29039. sameDay: '[i dag kl.] LT',
  29040. nextDay: '[i morgen kl.] LT',
  29041. nextWeek: 'dddd [kl.] LT',
  29042. lastDay: '[i går kl.] LT',
  29043. lastWeek: '[forrige] dddd [kl.] LT',
  29044. sameElse: 'L'
  29045. },
  29046. relativeTime : {
  29047. future : 'om %s',
  29048. past : '%s siden',
  29049. s : 'noen sekunder',
  29050. m : 'ett minutt',
  29051. mm : '%d minutter',
  29052. h : 'en time',
  29053. hh : '%d timer',
  29054. d : 'en dag',
  29055. dd : '%d dager',
  29056. M : 'en måned',
  29057. MM : '%d måneder',
  29058. y : 'ett år',
  29059. yy : '%d år'
  29060. },
  29061. ordinalParse: /\d{1,2}\./,
  29062. ordinal : '%d.',
  29063. week : {
  29064. dow : 1, // Monday is the first day of the week.
  29065. doy : 4 // The week that contains Jan 4th is the first week of the year.
  29066. }
  29067. });
  29068. var ne__symbolMap = {
  29069. '1': '१',
  29070. '2': '२',
  29071. '3': '३',
  29072. '4': '४',
  29073. '5': '५',
  29074. '6': '६',
  29075. '7': '७',
  29076. '8': '८',
  29077. '9': '९',
  29078. '0': '०'
  29079. },
  29080. ne__numberMap = {
  29081. '१': '1',
  29082. '२': '2',
  29083. '३': '3',
  29084. '४': '4',
  29085. '५': '5',
  29086. '६': '6',
  29087. '७': '7',
  29088. '८': '8',
  29089. '९': '9',
  29090. '०': '0'
  29091. };
  29092. var ne = moment__default.defineLocale('ne', {
  29093. months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'),
  29094. monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'),
  29095. monthsParseExact : true,
  29096. weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'),
  29097. weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),
  29098. weekdaysMin : 'आ._सो._मं._बु._बि._शु._श.'.split('_'),
  29099. weekdaysParseExact : true,
  29100. longDateFormat : {
  29101. LT : 'Aको h:mm बजे',
  29102. LTS : 'Aको h:mm:ss बजे',
  29103. L : 'DD/MM/YYYY',
  29104. LL : 'D MMMM YYYY',
  29105. LLL : 'D MMMM YYYY, Aको h:mm बजे',
  29106. LLLL : 'dddd, D MMMM YYYY, Aको h:mm बजे'
  29107. },
  29108. preparse: function (string) {
  29109. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  29110. return ne__numberMap[match];
  29111. });
  29112. },
  29113. postformat: function (string) {
  29114. return string.replace(/\d/g, function (match) {
  29115. return ne__symbolMap[match];
  29116. });
  29117. },
  29118. meridiemParse: /राति|बिहान|दिउँसो|साँझ/,
  29119. meridiemHour : function (hour, meridiem) {
  29120. if (hour === 12) {
  29121. hour = 0;
  29122. }
  29123. if (meridiem === 'राति') {
  29124. return hour < 4 ? hour : hour + 12;
  29125. } else if (meridiem === 'बिहान') {
  29126. return hour;
  29127. } else if (meridiem === 'दिउँसो') {
  29128. return hour >= 10 ? hour : hour + 12;
  29129. } else if (meridiem === 'साँझ') {
  29130. return hour + 12;
  29131. }
  29132. },
  29133. meridiem : function (hour, minute, isLower) {
  29134. if (hour < 3) {
  29135. return 'राति';
  29136. } else if (hour < 12) {
  29137. return 'बिहान';
  29138. } else if (hour < 16) {
  29139. return 'दिउँसो';
  29140. } else if (hour < 20) {
  29141. return 'साँझ';
  29142. } else {
  29143. return 'राति';
  29144. }
  29145. },
  29146. calendar : {
  29147. sameDay : '[आज] LT',
  29148. nextDay : '[भोलि] LT',
  29149. nextWeek : '[आउँदो] dddd[,] LT',
  29150. lastDay : '[हिजो] LT',
  29151. lastWeek : '[गएको] dddd[,] LT',
  29152. sameElse : 'L'
  29153. },
  29154. relativeTime : {
  29155. future : '%sमा',
  29156. past : '%s अगाडि',
  29157. s : 'केही क्षण',
  29158. m : 'एक मिनेट',
  29159. mm : '%d मिनेट',
  29160. h : 'एक घण्टा',
  29161. hh : '%d घण्टा',
  29162. d : 'एक दिन',
  29163. dd : '%d दिन',
  29164. M : 'एक महिना',
  29165. MM : '%d महिना',
  29166. y : 'एक बर्ष',
  29167. yy : '%d बर्ष'
  29168. },
  29169. week : {
  29170. dow : 0, // Sunday is the first day of the week.
  29171. doy : 6 // The week that contains Jan 1st is the first week of the year.
  29172. }
  29173. });
  29174. var nl__monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),
  29175. nl__monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
  29176. var nl = moment__default.defineLocale('nl', {
  29177. months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
  29178. monthsShort : function (m, format) {
  29179. if (/-MMM-/.test(format)) {
  29180. return nl__monthsShortWithoutDots[m.month()];
  29181. } else {
  29182. return nl__monthsShortWithDots[m.month()];
  29183. }
  29184. },
  29185. monthsParseExact : true,
  29186. weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
  29187. weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),
  29188. weekdaysMin : 'Zo_Ma_Di_Wo_Do_Vr_Za'.split('_'),
  29189. weekdaysParseExact : true,
  29190. longDateFormat : {
  29191. LT : 'HH:mm',
  29192. LTS : 'HH:mm:ss',
  29193. L : 'DD-MM-YYYY',
  29194. LL : 'D MMMM YYYY',
  29195. LLL : 'D MMMM YYYY HH:mm',
  29196. LLLL : 'dddd D MMMM YYYY HH:mm'
  29197. },
  29198. calendar : {
  29199. sameDay: '[vandaag om] LT',
  29200. nextDay: '[morgen om] LT',
  29201. nextWeek: 'dddd [om] LT',
  29202. lastDay: '[gisteren om] LT',
  29203. lastWeek: '[afgelopen] dddd [om] LT',
  29204. sameElse: 'L'
  29205. },
  29206. relativeTime : {
  29207. future : 'over %s',
  29208. past : '%s geleden',
  29209. s : 'een paar seconden',
  29210. m : 'één minuut',
  29211. mm : '%d minuten',
  29212. h : 'één uur',
  29213. hh : '%d uur',
  29214. d : 'één dag',
  29215. dd : '%d dagen',
  29216. M : 'één maand',
  29217. MM : '%d maanden',
  29218. y : 'één jaar',
  29219. yy : '%d jaar'
  29220. },
  29221. ordinalParse: /\d{1,2}(ste|de)/,
  29222. ordinal : function (number) {
  29223. return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
  29224. },
  29225. week : {
  29226. dow : 1, // Monday is the first day of the week.
  29227. doy : 4 // The week that contains Jan 4th is the first week of the year.
  29228. }
  29229. });
  29230. var nn = moment__default.defineLocale('nn', {
  29231. months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
  29232. monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
  29233. weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),
  29234. weekdaysShort : 'sun_mån_tys_ons_tor_fre_lau'.split('_'),
  29235. weekdaysMin : 'su_må_ty_on_to_fr_lø'.split('_'),
  29236. longDateFormat : {
  29237. LT : 'HH:mm',
  29238. LTS : 'HH:mm:ss',
  29239. L : 'DD.MM.YYYY',
  29240. LL : 'D. MMMM YYYY',
  29241. LLL : 'D. MMMM YYYY [kl.] H:mm',
  29242. LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm'
  29243. },
  29244. calendar : {
  29245. sameDay: '[I dag klokka] LT',
  29246. nextDay: '[I morgon klokka] LT',
  29247. nextWeek: 'dddd [klokka] LT',
  29248. lastDay: '[I går klokka] LT',
  29249. lastWeek: '[Føregåande] dddd [klokka] LT',
  29250. sameElse: 'L'
  29251. },
  29252. relativeTime : {
  29253. future : 'om %s',
  29254. past : '%s sidan',
  29255. s : 'nokre sekund',
  29256. m : 'eit minutt',
  29257. mm : '%d minutt',
  29258. h : 'ein time',
  29259. hh : '%d timar',
  29260. d : 'ein dag',
  29261. dd : '%d dagar',
  29262. M : 'ein månad',
  29263. MM : '%d månader',
  29264. y : 'eit år',
  29265. yy : '%d år'
  29266. },
  29267. ordinalParse: /\d{1,2}\./,
  29268. ordinal : '%d.',
  29269. week : {
  29270. dow : 1, // Monday is the first day of the week.
  29271. doy : 4 // The week that contains Jan 4th is the first week of the year.
  29272. }
  29273. });
  29274. var pa_in__symbolMap = {
  29275. '1': '੧',
  29276. '2': '੨',
  29277. '3': '੩',
  29278. '4': '੪',
  29279. '5': '੫',
  29280. '6': '੬',
  29281. '7': '੭',
  29282. '8': '੮',
  29283. '9': '੯',
  29284. '0': '੦'
  29285. },
  29286. pa_in__numberMap = {
  29287. '੧': '1',
  29288. '੨': '2',
  29289. '੩': '3',
  29290. '੪': '4',
  29291. '੫': '5',
  29292. '੬': '6',
  29293. '੭': '7',
  29294. '੮': '8',
  29295. '੯': '9',
  29296. '੦': '0'
  29297. };
  29298. var pa_in = moment__default.defineLocale('pa-in', {
  29299. // There are months name as per Nanakshahi Calender but they are not used as rigidly in modern Punjabi.
  29300. months : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),
  29301. monthsShort : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),
  29302. weekdays : 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split('_'),
  29303. weekdaysShort : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
  29304. weekdaysMin : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
  29305. longDateFormat : {
  29306. LT : 'A h:mm ਵਜੇ',
  29307. LTS : 'A h:mm:ss ਵਜੇ',
  29308. L : 'DD/MM/YYYY',
  29309. LL : 'D MMMM YYYY',
  29310. LLL : 'D MMMM YYYY, A h:mm ਵਜੇ',
  29311. LLLL : 'dddd, D MMMM YYYY, A h:mm ਵਜੇ'
  29312. },
  29313. calendar : {
  29314. sameDay : '[ਅਜ] LT',
  29315. nextDay : '[ਕਲ] LT',
  29316. nextWeek : 'dddd, LT',
  29317. lastDay : '[ਕਲ] LT',
  29318. lastWeek : '[ਪਿਛਲੇ] dddd, LT',
  29319. sameElse : 'L'
  29320. },
  29321. relativeTime : {
  29322. future : '%s ਵਿੱਚ',
  29323. past : '%s ਪਿਛਲੇ',
  29324. s : 'ਕੁਝ ਸਕਿੰਟ',
  29325. m : 'ਇਕ ਮਿੰਟ',
  29326. mm : '%d ਮਿੰਟ',
  29327. h : 'ਇੱਕ ਘੰਟਾ',
  29328. hh : '%d ਘੰਟੇ',
  29329. d : 'ਇੱਕ ਦਿਨ',
  29330. dd : '%d ਦਿਨ',
  29331. M : 'ਇੱਕ ਮਹੀਨਾ',
  29332. MM : '%d ਮਹੀਨੇ',
  29333. y : 'ਇੱਕ ਸਾਲ',
  29334. yy : '%d ਸਾਲ'
  29335. },
  29336. preparse: function (string) {
  29337. return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) {
  29338. return pa_in__numberMap[match];
  29339. });
  29340. },
  29341. postformat: function (string) {
  29342. return string.replace(/\d/g, function (match) {
  29343. return pa_in__symbolMap[match];
  29344. });
  29345. },
  29346. // Punjabi notation for meridiems are quite fuzzy in practice. While there exists
  29347. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi.
  29348. meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,
  29349. meridiemHour : function (hour, meridiem) {
  29350. if (hour === 12) {
  29351. hour = 0;
  29352. }
  29353. if (meridiem === 'ਰਾਤ') {
  29354. return hour < 4 ? hour : hour + 12;
  29355. } else if (meridiem === 'ਸਵੇਰ') {
  29356. return hour;
  29357. } else if (meridiem === 'ਦੁਪਹਿਰ') {
  29358. return hour >= 10 ? hour : hour + 12;
  29359. } else if (meridiem === 'ਸ਼ਾਮ') {
  29360. return hour + 12;
  29361. }
  29362. },
  29363. meridiem : function (hour, minute, isLower) {
  29364. if (hour < 4) {
  29365. return 'ਰਾਤ';
  29366. } else if (hour < 10) {
  29367. return 'ਸਵੇਰ';
  29368. } else if (hour < 17) {
  29369. return 'ਦੁਪਹਿਰ';
  29370. } else if (hour < 20) {
  29371. return 'ਸ਼ਾਮ';
  29372. } else {
  29373. return 'ਰਾਤ';
  29374. }
  29375. },
  29376. week : {
  29377. dow : 0, // Sunday is the first day of the week.
  29378. doy : 6 // The week that contains Jan 1st is the first week of the year.
  29379. }
  29380. });
  29381. var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'),
  29382. monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');
  29383. function pl__plural(n) {
  29384. return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1);
  29385. }
  29386. function pl__translate(number, withoutSuffix, key) {
  29387. var result = number + ' ';
  29388. switch (key) {
  29389. case 'm':
  29390. return withoutSuffix ? 'minuta' : 'minutę';
  29391. case 'mm':
  29392. return result + (pl__plural(number) ? 'minuty' : 'minut');
  29393. case 'h':
  29394. return withoutSuffix ? 'godzina' : 'godzinę';
  29395. case 'hh':
  29396. return result + (pl__plural(number) ? 'godziny' : 'godzin');
  29397. case 'MM':
  29398. return result + (pl__plural(number) ? 'miesiące' : 'miesięcy');
  29399. case 'yy':
  29400. return result + (pl__plural(number) ? 'lata' : 'lat');
  29401. }
  29402. }
  29403. var pl = moment__default.defineLocale('pl', {
  29404. months : function (momentToFormat, format) {
  29405. if (format === '') {
  29406. // Hack: if format empty we know this is used to generate
  29407. // RegExp by moment. Give then back both valid forms of months
  29408. // in RegExp ready format.
  29409. return '(' + monthsSubjective[momentToFormat.month()] + '|' + monthsNominative[momentToFormat.month()] + ')';
  29410. } else if (/D MMMM/.test(format)) {
  29411. return monthsSubjective[momentToFormat.month()];
  29412. } else {
  29413. return monthsNominative[momentToFormat.month()];
  29414. }
  29415. },
  29416. monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
  29417. weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
  29418. weekdaysShort : 'nie_pon_wt_śr_czw_pt_sb'.split('_'),
  29419. weekdaysMin : 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
  29420. longDateFormat : {
  29421. LT : 'HH:mm',
  29422. LTS : 'HH:mm:ss',
  29423. L : 'DD.MM.YYYY',
  29424. LL : 'D MMMM YYYY',
  29425. LLL : 'D MMMM YYYY HH:mm',
  29426. LLLL : 'dddd, D MMMM YYYY HH:mm'
  29427. },
  29428. calendar : {
  29429. sameDay: '[Dziś o] LT',
  29430. nextDay: '[Jutro o] LT',
  29431. nextWeek: '[W] dddd [o] LT',
  29432. lastDay: '[Wczoraj o] LT',
  29433. lastWeek: function () {
  29434. switch (this.day()) {
  29435. case 0:
  29436. return '[W zeszłą niedzielę o] LT';
  29437. case 3:
  29438. return '[W zeszłą środę o] LT';
  29439. case 6:
  29440. return '[W zeszłą sobotę o] LT';
  29441. default:
  29442. return '[W zeszły] dddd [o] LT';
  29443. }
  29444. },
  29445. sameElse: 'L'
  29446. },
  29447. relativeTime : {
  29448. future : 'za %s',
  29449. past : '%s temu',
  29450. s : 'kilka sekund',
  29451. m : pl__translate,
  29452. mm : pl__translate,
  29453. h : pl__translate,
  29454. hh : pl__translate,
  29455. d : '1 dzień',
  29456. dd : '%d dni',
  29457. M : 'miesiąc',
  29458. MM : pl__translate,
  29459. y : 'rok',
  29460. yy : pl__translate
  29461. },
  29462. ordinalParse: /\d{1,2}\./,
  29463. ordinal : '%d.',
  29464. week : {
  29465. dow : 1, // Monday is the first day of the week.
  29466. doy : 4 // The week that contains Jan 4th is the first week of the year.
  29467. }
  29468. });
  29469. var pt_br = moment__default.defineLocale('pt-br', {
  29470. months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),
  29471. monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
  29472. weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),
  29473. weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
  29474. weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'),
  29475. weekdaysParseExact : true,
  29476. longDateFormat : {
  29477. LT : 'HH:mm',
  29478. LTS : 'HH:mm:ss',
  29479. L : 'DD/MM/YYYY',
  29480. LL : 'D [de] MMMM [de] YYYY',
  29481. LLL : 'D [de] MMMM [de] YYYY [às] HH:mm',
  29482. LLLL : 'dddd, D [de] MMMM [de] YYYY [às] HH:mm'
  29483. },
  29484. calendar : {
  29485. sameDay: '[Hoje às] LT',
  29486. nextDay: '[Amanhã às] LT',
  29487. nextWeek: 'dddd [às] LT',
  29488. lastDay: '[Ontem às] LT',
  29489. lastWeek: function () {
  29490. return (this.day() === 0 || this.day() === 6) ?
  29491. '[Último] dddd [às] LT' : // Saturday + Sunday
  29492. '[Última] dddd [às] LT'; // Monday - Friday
  29493. },
  29494. sameElse: 'L'
  29495. },
  29496. relativeTime : {
  29497. future : 'em %s',
  29498. past : '%s atrás',
  29499. s : 'poucos segundos',
  29500. m : 'um minuto',
  29501. mm : '%d minutos',
  29502. h : 'uma hora',
  29503. hh : '%d horas',
  29504. d : 'um dia',
  29505. dd : '%d dias',
  29506. M : 'um mês',
  29507. MM : '%d meses',
  29508. y : 'um ano',
  29509. yy : '%d anos'
  29510. },
  29511. ordinalParse: /\d{1,2}º/,
  29512. ordinal : '%dº'
  29513. });
  29514. var pt = moment__default.defineLocale('pt', {
  29515. months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),
  29516. monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
  29517. weekdays : 'Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado'.split('_'),
  29518. weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
  29519. weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'),
  29520. weekdaysParseExact : true,
  29521. longDateFormat : {
  29522. LT : 'HH:mm',
  29523. LTS : 'HH:mm:ss',
  29524. L : 'DD/MM/YYYY',
  29525. LL : 'D [de] MMMM [de] YYYY',
  29526. LLL : 'D [de] MMMM [de] YYYY HH:mm',
  29527. LLLL : 'dddd, D [de] MMMM [de] YYYY HH:mm'
  29528. },
  29529. calendar : {
  29530. sameDay: '[Hoje às] LT',
  29531. nextDay: '[Amanhã às] LT',
  29532. nextWeek: 'dddd [às] LT',
  29533. lastDay: '[Ontem às] LT',
  29534. lastWeek: function () {
  29535. return (this.day() === 0 || this.day() === 6) ?
  29536. '[Último] dddd [às] LT' : // Saturday + Sunday
  29537. '[Última] dddd [às] LT'; // Monday - Friday
  29538. },
  29539. sameElse: 'L'
  29540. },
  29541. relativeTime : {
  29542. future : 'em %s',
  29543. past : 'há %s',
  29544. s : 'segundos',
  29545. m : 'um minuto',
  29546. mm : '%d minutos',
  29547. h : 'uma hora',
  29548. hh : '%d horas',
  29549. d : 'um dia',
  29550. dd : '%d dias',
  29551. M : 'um mês',
  29552. MM : '%d meses',
  29553. y : 'um ano',
  29554. yy : '%d anos'
  29555. },
  29556. ordinalParse: /\d{1,2}º/,
  29557. ordinal : '%dº',
  29558. week : {
  29559. dow : 1, // Monday is the first day of the week.
  29560. doy : 4 // The week that contains Jan 4th is the first week of the year.
  29561. }
  29562. });
  29563. function ro__relativeTimeWithPlural(number, withoutSuffix, key) {
  29564. var format = {
  29565. 'mm': 'minute',
  29566. 'hh': 'ore',
  29567. 'dd': 'zile',
  29568. 'MM': 'luni',
  29569. 'yy': 'ani'
  29570. },
  29571. separator = ' ';
  29572. if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {
  29573. separator = ' de ';
  29574. }
  29575. return number + separator + format[key];
  29576. }
  29577. var ro = moment__default.defineLocale('ro', {
  29578. months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),
  29579. monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),
  29580. monthsParseExact: true,
  29581. weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
  29582. weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
  29583. weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
  29584. longDateFormat : {
  29585. LT : 'H:mm',
  29586. LTS : 'H:mm:ss',
  29587. L : 'DD.MM.YYYY',
  29588. LL : 'D MMMM YYYY',
  29589. LLL : 'D MMMM YYYY H:mm',
  29590. LLLL : 'dddd, D MMMM YYYY H:mm'
  29591. },
  29592. calendar : {
  29593. sameDay: '[azi la] LT',
  29594. nextDay: '[mâine la] LT',
  29595. nextWeek: 'dddd [la] LT',
  29596. lastDay: '[ieri la] LT',
  29597. lastWeek: '[fosta] dddd [la] LT',
  29598. sameElse: 'L'
  29599. },
  29600. relativeTime : {
  29601. future : 'peste %s',
  29602. past : '%s în urmă',
  29603. s : 'câteva secunde',
  29604. m : 'un minut',
  29605. mm : ro__relativeTimeWithPlural,
  29606. h : 'o oră',
  29607. hh : ro__relativeTimeWithPlural,
  29608. d : 'o zi',
  29609. dd : ro__relativeTimeWithPlural,
  29610. M : 'o lună',
  29611. MM : ro__relativeTimeWithPlural,
  29612. y : 'un an',
  29613. yy : ro__relativeTimeWithPlural
  29614. },
  29615. week : {
  29616. dow : 1, // Monday is the first day of the week.
  29617. doy : 7 // The week that contains Jan 1st is the first week of the year.
  29618. }
  29619. });
  29620. function ru__plural(word, num) {
  29621. var forms = word.split('_');
  29622. return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
  29623. }
  29624. function ru__relativeTimeWithPlural(number, withoutSuffix, key) {
  29625. var format = {
  29626. 'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
  29627. 'hh': 'час_часа_часов',
  29628. 'dd': 'день_дня_дней',
  29629. 'MM': 'месяц_месяца_месяцев',
  29630. 'yy': 'год_года_лет'
  29631. };
  29632. if (key === 'm') {
  29633. return withoutSuffix ? 'минута' : 'минуту';
  29634. }
  29635. else {
  29636. return number + ' ' + ru__plural(format[key], +number);
  29637. }
  29638. }
  29639. var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i];
  29640. // http://new.gramota.ru/spravka/rules/139-prop : § 103
  29641. // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637
  29642. // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753
  29643. var ru = moment__default.defineLocale('ru', {
  29644. months : {
  29645. format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'),
  29646. standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_')
  29647. },
  29648. monthsShort : {
  29649. // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку ?
  29650. format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'),
  29651. standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_')
  29652. },
  29653. weekdays : {
  29654. standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
  29655. format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'),
  29656. isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/
  29657. },
  29658. weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  29659. weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  29660. monthsParse : monthsParse,
  29661. longMonthsParse : monthsParse,
  29662. shortMonthsParse : monthsParse,
  29663. // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки
  29664. monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  29665. // копия предыдущего
  29666. monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  29667. // полные названия с падежами
  29668. monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,
  29669. // Выражение, которое соотвествует только сокращённым формам
  29670. monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,
  29671. longDateFormat : {
  29672. LT : 'HH:mm',
  29673. LTS : 'HH:mm:ss',
  29674. L : 'DD.MM.YYYY',
  29675. LL : 'D MMMM YYYY г.',
  29676. LLL : 'D MMMM YYYY г., HH:mm',
  29677. LLLL : 'dddd, D MMMM YYYY г., HH:mm'
  29678. },
  29679. calendar : {
  29680. sameDay: '[Сегодня в] LT',
  29681. nextDay: '[Завтра в] LT',
  29682. lastDay: '[Вчера в] LT',
  29683. nextWeek: function (now) {
  29684. if (now.week() !== this.week()) {
  29685. switch (this.day()) {
  29686. case 0:
  29687. return '[В следующее] dddd [в] LT';
  29688. case 1:
  29689. case 2:
  29690. case 4:
  29691. return '[В следующий] dddd [в] LT';
  29692. case 3:
  29693. case 5:
  29694. case 6:
  29695. return '[В следующую] dddd [в] LT';
  29696. }
  29697. } else {
  29698. if (this.day() === 2) {
  29699. return '[Во] dddd [в] LT';
  29700. } else {
  29701. return '[В] dddd [в] LT';
  29702. }
  29703. }
  29704. },
  29705. lastWeek: function (now) {
  29706. if (now.week() !== this.week()) {
  29707. switch (this.day()) {
  29708. case 0:
  29709. return '[В прошлое] dddd [в] LT';
  29710. case 1:
  29711. case 2:
  29712. case 4:
  29713. return '[В прошлый] dddd [в] LT';
  29714. case 3:
  29715. case 5:
  29716. case 6:
  29717. return '[В прошлую] dddd [в] LT';
  29718. }
  29719. } else {
  29720. if (this.day() === 2) {
  29721. return '[Во] dddd [в] LT';
  29722. } else {
  29723. return '[В] dddd [в] LT';
  29724. }
  29725. }
  29726. },
  29727. sameElse: 'L'
  29728. },
  29729. relativeTime : {
  29730. future : 'через %s',
  29731. past : '%s назад',
  29732. s : 'несколько секунд',
  29733. m : ru__relativeTimeWithPlural,
  29734. mm : ru__relativeTimeWithPlural,
  29735. h : 'час',
  29736. hh : ru__relativeTimeWithPlural,
  29737. d : 'день',
  29738. dd : ru__relativeTimeWithPlural,
  29739. M : 'месяц',
  29740. MM : ru__relativeTimeWithPlural,
  29741. y : 'год',
  29742. yy : ru__relativeTimeWithPlural
  29743. },
  29744. meridiemParse: /ночи|утра|дня|вечера/i,
  29745. isPM : function (input) {
  29746. return /^(дня|вечера)$/.test(input);
  29747. },
  29748. meridiem : function (hour, minute, isLower) {
  29749. if (hour < 4) {
  29750. return 'ночи';
  29751. } else if (hour < 12) {
  29752. return 'утра';
  29753. } else if (hour < 17) {
  29754. return 'дня';
  29755. } else {
  29756. return 'вечера';
  29757. }
  29758. },
  29759. ordinalParse: /\d{1,2}-(й|го|я)/,
  29760. ordinal: function (number, period) {
  29761. switch (period) {
  29762. case 'M':
  29763. case 'd':
  29764. case 'DDD':
  29765. return number + '-й';
  29766. case 'D':
  29767. return number + '-го';
  29768. case 'w':
  29769. case 'W':
  29770. return number + '-я';
  29771. default:
  29772. return number;
  29773. }
  29774. },
  29775. week : {
  29776. dow : 1, // Monday is the first day of the week.
  29777. doy : 7 // The week that contains Jan 1st is the first week of the year.
  29778. }
  29779. });
  29780. var se = moment__default.defineLocale('se', {
  29781. months : 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'),
  29782. monthsShort : 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'),
  29783. weekdays : 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'),
  29784. weekdaysShort : 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),
  29785. weekdaysMin : 's_v_m_g_d_b_L'.split('_'),
  29786. longDateFormat : {
  29787. LT : 'HH:mm',
  29788. LTS : 'HH:mm:ss',
  29789. L : 'DD.MM.YYYY',
  29790. LL : 'MMMM D. [b.] YYYY',
  29791. LLL : 'MMMM D. [b.] YYYY [ti.] HH:mm',
  29792. LLLL : 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm'
  29793. },
  29794. calendar : {
  29795. sameDay: '[otne ti] LT',
  29796. nextDay: '[ihttin ti] LT',
  29797. nextWeek: 'dddd [ti] LT',
  29798. lastDay: '[ikte ti] LT',
  29799. lastWeek: '[ovddit] dddd [ti] LT',
  29800. sameElse: 'L'
  29801. },
  29802. relativeTime : {
  29803. future : '%s geažes',
  29804. past : 'maŋit %s',
  29805. s : 'moadde sekunddat',
  29806. m : 'okta minuhta',
  29807. mm : '%d minuhtat',
  29808. h : 'okta diimmu',
  29809. hh : '%d diimmut',
  29810. d : 'okta beaivi',
  29811. dd : '%d beaivvit',
  29812. M : 'okta mánnu',
  29813. MM : '%d mánut',
  29814. y : 'okta jahki',
  29815. yy : '%d jagit'
  29816. },
  29817. ordinalParse: /\d{1,2}\./,
  29818. ordinal : '%d.',
  29819. week : {
  29820. dow : 1, // Monday is the first day of the week.
  29821. doy : 4 // The week that contains Jan 4th is the first week of the year.
  29822. }
  29823. });
  29824. /*jshint -W100*/
  29825. var si = moment__default.defineLocale('si', {
  29826. months : 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split('_'),
  29827. monthsShort : 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split('_'),
  29828. weekdays : 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split('_'),
  29829. weekdaysShort : 'ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන'.split('_'),
  29830. weekdaysMin : 'ඉ_ස_අ_බ_බ්‍ර_සි_සෙ'.split('_'),
  29831. weekdaysParseExact : true,
  29832. longDateFormat : {
  29833. LT : 'a h:mm',
  29834. LTS : 'a h:mm:ss',
  29835. L : 'YYYY/MM/DD',
  29836. LL : 'YYYY MMMM D',
  29837. LLL : 'YYYY MMMM D, a h:mm',
  29838. LLLL : 'YYYY MMMM D [වැනි] dddd, a h:mm:ss'
  29839. },
  29840. calendar : {
  29841. sameDay : '[අද] LT[ට]',
  29842. nextDay : '[හෙට] LT[ට]',
  29843. nextWeek : 'dddd LT[ට]',
  29844. lastDay : '[ඊයේ] LT[ට]',
  29845. lastWeek : '[පසුගිය] dddd LT[ට]',
  29846. sameElse : 'L'
  29847. },
  29848. relativeTime : {
  29849. future : '%sකින්',
  29850. past : '%sකට පෙර',
  29851. s : 'තත්පර කිහිපය',
  29852. m : 'මිනිත්තුව',
  29853. mm : 'මිනිත්තු %d',
  29854. h : 'පැය',
  29855. hh : 'පැය %d',
  29856. d : 'දිනය',
  29857. dd : 'දින %d',
  29858. M : 'මාසය',
  29859. MM : 'මාස %d',
  29860. y : 'වසර',
  29861. yy : 'වසර %d'
  29862. },
  29863. ordinalParse: /\d{1,2} වැනි/,
  29864. ordinal : function (number) {
  29865. return number + ' වැනි';
  29866. },
  29867. meridiemParse : /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,
  29868. isPM : function (input) {
  29869. return input === 'ප.ව.' || input === 'පස් වරු';
  29870. },
  29871. meridiem : function (hours, minutes, isLower) {
  29872. if (hours > 11) {
  29873. return isLower ? 'ප.ව.' : 'පස් වරු';
  29874. } else {
  29875. return isLower ? 'පෙ.ව.' : 'පෙර වරු';
  29876. }
  29877. }
  29878. });
  29879. var sk__months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'),
  29880. sk__monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
  29881. function sk__plural(n) {
  29882. return (n > 1) && (n < 5);
  29883. }
  29884. function sk__translate(number, withoutSuffix, key, isFuture) {
  29885. var result = number + ' ';
  29886. switch (key) {
  29887. case 's': // a few seconds / in a few seconds / a few seconds ago
  29888. return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami';
  29889. case 'm': // a minute / in a minute / a minute ago
  29890. return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou');
  29891. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  29892. if (withoutSuffix || isFuture) {
  29893. return result + (sk__plural(number) ? 'minúty' : 'minút');
  29894. } else {
  29895. return result + 'minútami';
  29896. }
  29897. break;
  29898. case 'h': // an hour / in an hour / an hour ago
  29899. return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
  29900. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  29901. if (withoutSuffix || isFuture) {
  29902. return result + (sk__plural(number) ? 'hodiny' : 'hodín');
  29903. } else {
  29904. return result + 'hodinami';
  29905. }
  29906. break;
  29907. case 'd': // a day / in a day / a day ago
  29908. return (withoutSuffix || isFuture) ? 'deň' : 'dňom';
  29909. case 'dd': // 9 days / in 9 days / 9 days ago
  29910. if (withoutSuffix || isFuture) {
  29911. return result + (sk__plural(number) ? 'dni' : 'dní');
  29912. } else {
  29913. return result + 'dňami';
  29914. }
  29915. break;
  29916. case 'M': // a month / in a month / a month ago
  29917. return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom';
  29918. case 'MM': // 9 months / in 9 months / 9 months ago
  29919. if (withoutSuffix || isFuture) {
  29920. return result + (sk__plural(number) ? 'mesiace' : 'mesiacov');
  29921. } else {
  29922. return result + 'mesiacmi';
  29923. }
  29924. break;
  29925. case 'y': // a year / in a year / a year ago
  29926. return (withoutSuffix || isFuture) ? 'rok' : 'rokom';
  29927. case 'yy': // 9 years / in 9 years / 9 years ago
  29928. if (withoutSuffix || isFuture) {
  29929. return result + (sk__plural(number) ? 'roky' : 'rokov');
  29930. } else {
  29931. return result + 'rokmi';
  29932. }
  29933. break;
  29934. }
  29935. }
  29936. var sk = moment__default.defineLocale('sk', {
  29937. months : sk__months,
  29938. monthsShort : sk__monthsShort,
  29939. weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
  29940. weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'),
  29941. weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'),
  29942. longDateFormat : {
  29943. LT: 'H:mm',
  29944. LTS : 'H:mm:ss',
  29945. L : 'DD.MM.YYYY',
  29946. LL : 'D. MMMM YYYY',
  29947. LLL : 'D. MMMM YYYY H:mm',
  29948. LLLL : 'dddd D. MMMM YYYY H:mm'
  29949. },
  29950. calendar : {
  29951. sameDay: '[dnes o] LT',
  29952. nextDay: '[zajtra o] LT',
  29953. nextWeek: function () {
  29954. switch (this.day()) {
  29955. case 0:
  29956. return '[v nedeľu o] LT';
  29957. case 1:
  29958. case 2:
  29959. return '[v] dddd [o] LT';
  29960. case 3:
  29961. return '[v stredu o] LT';
  29962. case 4:
  29963. return '[vo štvrtok o] LT';
  29964. case 5:
  29965. return '[v piatok o] LT';
  29966. case 6:
  29967. return '[v sobotu o] LT';
  29968. }
  29969. },
  29970. lastDay: '[včera o] LT',
  29971. lastWeek: function () {
  29972. switch (this.day()) {
  29973. case 0:
  29974. return '[minulú nedeľu o] LT';
  29975. case 1:
  29976. case 2:
  29977. return '[minulý] dddd [o] LT';
  29978. case 3:
  29979. return '[minulú stredu o] LT';
  29980. case 4:
  29981. case 5:
  29982. return '[minulý] dddd [o] LT';
  29983. case 6:
  29984. return '[minulú sobotu o] LT';
  29985. }
  29986. },
  29987. sameElse: 'L'
  29988. },
  29989. relativeTime : {
  29990. future : 'za %s',
  29991. past : 'pred %s',
  29992. s : sk__translate,
  29993. m : sk__translate,
  29994. mm : sk__translate,
  29995. h : sk__translate,
  29996. hh : sk__translate,
  29997. d : sk__translate,
  29998. dd : sk__translate,
  29999. M : sk__translate,
  30000. MM : sk__translate,
  30001. y : sk__translate,
  30002. yy : sk__translate
  30003. },
  30004. ordinalParse: /\d{1,2}\./,
  30005. ordinal : '%d.',
  30006. week : {
  30007. dow : 1, // Monday is the first day of the week.
  30008. doy : 4 // The week that contains Jan 4th is the first week of the year.
  30009. }
  30010. });
  30011. function sl__processRelativeTime(number, withoutSuffix, key, isFuture) {
  30012. var result = number + ' ';
  30013. switch (key) {
  30014. case 's':
  30015. return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';
  30016. case 'm':
  30017. return withoutSuffix ? 'ena minuta' : 'eno minuto';
  30018. case 'mm':
  30019. if (number === 1) {
  30020. result += withoutSuffix ? 'minuta' : 'minuto';
  30021. } else if (number === 2) {
  30022. result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
  30023. } else if (number < 5) {
  30024. result += withoutSuffix || isFuture ? 'minute' : 'minutami';
  30025. } else {
  30026. result += withoutSuffix || isFuture ? 'minut' : 'minutami';
  30027. }
  30028. return result;
  30029. case 'h':
  30030. return withoutSuffix ? 'ena ura' : 'eno uro';
  30031. case 'hh':
  30032. if (number === 1) {
  30033. result += withoutSuffix ? 'ura' : 'uro';
  30034. } else if (number === 2) {
  30035. result += withoutSuffix || isFuture ? 'uri' : 'urama';
  30036. } else if (number < 5) {
  30037. result += withoutSuffix || isFuture ? 'ure' : 'urami';
  30038. } else {
  30039. result += withoutSuffix || isFuture ? 'ur' : 'urami';
  30040. }
  30041. return result;
  30042. case 'd':
  30043. return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
  30044. case 'dd':
  30045. if (number === 1) {
  30046. result += withoutSuffix || isFuture ? 'dan' : 'dnem';
  30047. } else if (number === 2) {
  30048. result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
  30049. } else {
  30050. result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
  30051. }
  30052. return result;
  30053. case 'M':
  30054. return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
  30055. case 'MM':
  30056. if (number === 1) {
  30057. result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
  30058. } else if (number === 2) {
  30059. result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
  30060. } else if (number < 5) {
  30061. result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
  30062. } else {
  30063. result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
  30064. }
  30065. return result;
  30066. case 'y':
  30067. return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
  30068. case 'yy':
  30069. if (number === 1) {
  30070. result += withoutSuffix || isFuture ? 'leto' : 'letom';
  30071. } else if (number === 2) {
  30072. result += withoutSuffix || isFuture ? 'leti' : 'letoma';
  30073. } else if (number < 5) {
  30074. result += withoutSuffix || isFuture ? 'leta' : 'leti';
  30075. } else {
  30076. result += withoutSuffix || isFuture ? 'let' : 'leti';
  30077. }
  30078. return result;
  30079. }
  30080. }
  30081. var sl = moment__default.defineLocale('sl', {
  30082. months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),
  30083. monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),
  30084. monthsParseExact: true,
  30085. weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
  30086. weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
  30087. weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'),
  30088. weekdaysParseExact : true,
  30089. longDateFormat : {
  30090. LT : 'H:mm',
  30091. LTS : 'H:mm:ss',
  30092. L : 'DD. MM. YYYY',
  30093. LL : 'D. MMMM YYYY',
  30094. LLL : 'D. MMMM YYYY H:mm',
  30095. LLLL : 'dddd, D. MMMM YYYY H:mm'
  30096. },
  30097. calendar : {
  30098. sameDay : '[danes ob] LT',
  30099. nextDay : '[jutri ob] LT',
  30100. nextWeek : function () {
  30101. switch (this.day()) {
  30102. case 0:
  30103. return '[v] [nedeljo] [ob] LT';
  30104. case 3:
  30105. return '[v] [sredo] [ob] LT';
  30106. case 6:
  30107. return '[v] [soboto] [ob] LT';
  30108. case 1:
  30109. case 2:
  30110. case 4:
  30111. case 5:
  30112. return '[v] dddd [ob] LT';
  30113. }
  30114. },
  30115. lastDay : '[včeraj ob] LT',
  30116. lastWeek : function () {
  30117. switch (this.day()) {
  30118. case 0:
  30119. return '[prejšnjo] [nedeljo] [ob] LT';
  30120. case 3:
  30121. return '[prejšnjo] [sredo] [ob] LT';
  30122. case 6:
  30123. return '[prejšnjo] [soboto] [ob] LT';
  30124. case 1:
  30125. case 2:
  30126. case 4:
  30127. case 5:
  30128. return '[prejšnji] dddd [ob] LT';
  30129. }
  30130. },
  30131. sameElse : 'L'
  30132. },
  30133. relativeTime : {
  30134. future : 'čez %s',
  30135. past : 'pred %s',
  30136. s : sl__processRelativeTime,
  30137. m : sl__processRelativeTime,
  30138. mm : sl__processRelativeTime,
  30139. h : sl__processRelativeTime,
  30140. hh : sl__processRelativeTime,
  30141. d : sl__processRelativeTime,
  30142. dd : sl__processRelativeTime,
  30143. M : sl__processRelativeTime,
  30144. MM : sl__processRelativeTime,
  30145. y : sl__processRelativeTime,
  30146. yy : sl__processRelativeTime
  30147. },
  30148. ordinalParse: /\d{1,2}\./,
  30149. ordinal : '%d.',
  30150. week : {
  30151. dow : 1, // Monday is the first day of the week.
  30152. doy : 7 // The week that contains Jan 1st is the first week of the year.
  30153. }
  30154. });
  30155. var sq = moment__default.defineLocale('sq', {
  30156. months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),
  30157. monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),
  30158. weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),
  30159. weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
  30160. weekdaysMin : 'D_H_Ma_Më_E_P_Sh'.split('_'),
  30161. weekdaysParseExact : true,
  30162. meridiemParse: /PD|MD/,
  30163. isPM: function (input) {
  30164. return input.charAt(0) === 'M';
  30165. },
  30166. meridiem : function (hours, minutes, isLower) {
  30167. return hours < 12 ? 'PD' : 'MD';
  30168. },
  30169. longDateFormat : {
  30170. LT : 'HH:mm',
  30171. LTS : 'HH:mm:ss',
  30172. L : 'DD/MM/YYYY',
  30173. LL : 'D MMMM YYYY',
  30174. LLL : 'D MMMM YYYY HH:mm',
  30175. LLLL : 'dddd, D MMMM YYYY HH:mm'
  30176. },
  30177. calendar : {
  30178. sameDay : '[Sot në] LT',
  30179. nextDay : '[Nesër në] LT',
  30180. nextWeek : 'dddd [në] LT',
  30181. lastDay : '[Dje në] LT',
  30182. lastWeek : 'dddd [e kaluar në] LT',
  30183. sameElse : 'L'
  30184. },
  30185. relativeTime : {
  30186. future : 'në %s',
  30187. past : '%s më parë',
  30188. s : 'disa sekonda',
  30189. m : 'një minutë',
  30190. mm : '%d minuta',
  30191. h : 'një orë',
  30192. hh : '%d orë',
  30193. d : 'një ditë',
  30194. dd : '%d ditë',
  30195. M : 'një muaj',
  30196. MM : '%d muaj',
  30197. y : 'një vit',
  30198. yy : '%d vite'
  30199. },
  30200. ordinalParse: /\d{1,2}\./,
  30201. ordinal : '%d.',
  30202. week : {
  30203. dow : 1, // Monday is the first day of the week.
  30204. doy : 4 // The week that contains Jan 4th is the first week of the year.
  30205. }
  30206. });
  30207. var sr_cyrl__translator = {
  30208. words: { //Different grammatical cases
  30209. m: ['један минут', 'једне минуте'],
  30210. mm: ['минут', 'минуте', 'минута'],
  30211. h: ['један сат', 'једног сата'],
  30212. hh: ['сат', 'сата', 'сати'],
  30213. dd: ['дан', 'дана', 'дана'],
  30214. MM: ['месец', 'месеца', 'месеци'],
  30215. yy: ['година', 'године', 'година']
  30216. },
  30217. correctGrammaticalCase: function (number, wordKey) {
  30218. return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
  30219. },
  30220. translate: function (number, withoutSuffix, key) {
  30221. var wordKey = sr_cyrl__translator.words[key];
  30222. if (key.length === 1) {
  30223. return withoutSuffix ? wordKey[0] : wordKey[1];
  30224. } else {
  30225. return number + ' ' + sr_cyrl__translator.correctGrammaticalCase(number, wordKey);
  30226. }
  30227. }
  30228. };
  30229. var sr_cyrl = moment__default.defineLocale('sr-cyrl', {
  30230. months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split('_'),
  30231. monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split('_'),
  30232. monthsParseExact: true,
  30233. weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),
  30234. weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),
  30235. weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),
  30236. weekdaysParseExact : true,
  30237. longDateFormat: {
  30238. LT: 'H:mm',
  30239. LTS : 'H:mm:ss',
  30240. L: 'DD. MM. YYYY',
  30241. LL: 'D. MMMM YYYY',
  30242. LLL: 'D. MMMM YYYY H:mm',
  30243. LLLL: 'dddd, D. MMMM YYYY H:mm'
  30244. },
  30245. calendar: {
  30246. sameDay: '[данас у] LT',
  30247. nextDay: '[сутра у] LT',
  30248. nextWeek: function () {
  30249. switch (this.day()) {
  30250. case 0:
  30251. return '[у] [недељу] [у] LT';
  30252. case 3:
  30253. return '[у] [среду] [у] LT';
  30254. case 6:
  30255. return '[у] [суботу] [у] LT';
  30256. case 1:
  30257. case 2:
  30258. case 4:
  30259. case 5:
  30260. return '[у] dddd [у] LT';
  30261. }
  30262. },
  30263. lastDay : '[јуче у] LT',
  30264. lastWeek : function () {
  30265. var lastWeekDays = [
  30266. '[прошле] [недеље] [у] LT',
  30267. '[прошлог] [понедељка] [у] LT',
  30268. '[прошлог] [уторка] [у] LT',
  30269. '[прошле] [среде] [у] LT',
  30270. '[прошлог] [четвртка] [у] LT',
  30271. '[прошлог] [петка] [у] LT',
  30272. '[прошле] [суботе] [у] LT'
  30273. ];
  30274. return lastWeekDays[this.day()];
  30275. },
  30276. sameElse : 'L'
  30277. },
  30278. relativeTime : {
  30279. future : 'за %s',
  30280. past : 'пре %s',
  30281. s : 'неколико секунди',
  30282. m : sr_cyrl__translator.translate,
  30283. mm : sr_cyrl__translator.translate,
  30284. h : sr_cyrl__translator.translate,
  30285. hh : sr_cyrl__translator.translate,
  30286. d : 'дан',
  30287. dd : sr_cyrl__translator.translate,
  30288. M : 'месец',
  30289. MM : sr_cyrl__translator.translate,
  30290. y : 'годину',
  30291. yy : sr_cyrl__translator.translate
  30292. },
  30293. ordinalParse: /\d{1,2}\./,
  30294. ordinal : '%d.',
  30295. week : {
  30296. dow : 1, // Monday is the first day of the week.
  30297. doy : 7 // The week that contains Jan 1st is the first week of the year.
  30298. }
  30299. });
  30300. var sr__translator = {
  30301. words: { //Different grammatical cases
  30302. m: ['jedan minut', 'jedne minute'],
  30303. mm: ['minut', 'minute', 'minuta'],
  30304. h: ['jedan sat', 'jednog sata'],
  30305. hh: ['sat', 'sata', 'sati'],
  30306. dd: ['dan', 'dana', 'dana'],
  30307. MM: ['mesec', 'meseca', 'meseci'],
  30308. yy: ['godina', 'godine', 'godina']
  30309. },
  30310. correctGrammaticalCase: function (number, wordKey) {
  30311. return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
  30312. },
  30313. translate: function (number, withoutSuffix, key) {
  30314. var wordKey = sr__translator.words[key];
  30315. if (key.length === 1) {
  30316. return withoutSuffix ? wordKey[0] : wordKey[1];
  30317. } else {
  30318. return number + ' ' + sr__translator.correctGrammaticalCase(number, wordKey);
  30319. }
  30320. }
  30321. };
  30322. var sr = moment__default.defineLocale('sr', {
  30323. months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),
  30324. monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
  30325. monthsParseExact: true,
  30326. weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split('_'),
  30327. weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
  30328. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  30329. weekdaysParseExact : true,
  30330. longDateFormat: {
  30331. LT: 'H:mm',
  30332. LTS : 'H:mm:ss',
  30333. L: 'DD. MM. YYYY',
  30334. LL: 'D. MMMM YYYY',
  30335. LLL: 'D. MMMM YYYY H:mm',
  30336. LLLL: 'dddd, D. MMMM YYYY H:mm'
  30337. },
  30338. calendar: {
  30339. sameDay: '[danas u] LT',
  30340. nextDay: '[sutra u] LT',
  30341. nextWeek: function () {
  30342. switch (this.day()) {
  30343. case 0:
  30344. return '[u] [nedelju] [u] LT';
  30345. case 3:
  30346. return '[u] [sredu] [u] LT';
  30347. case 6:
  30348. return '[u] [subotu] [u] LT';
  30349. case 1:
  30350. case 2:
  30351. case 4:
  30352. case 5:
  30353. return '[u] dddd [u] LT';
  30354. }
  30355. },
  30356. lastDay : '[juče u] LT',
  30357. lastWeek : function () {
  30358. var lastWeekDays = [
  30359. '[prošle] [nedelje] [u] LT',
  30360. '[prošlog] [ponedeljka] [u] LT',
  30361. '[prošlog] [utorka] [u] LT',
  30362. '[prošle] [srede] [u] LT',
  30363. '[prošlog] [četvrtka] [u] LT',
  30364. '[prošlog] [petka] [u] LT',
  30365. '[prošle] [subote] [u] LT'
  30366. ];
  30367. return lastWeekDays[this.day()];
  30368. },
  30369. sameElse : 'L'
  30370. },
  30371. relativeTime : {
  30372. future : 'za %s',
  30373. past : 'pre %s',
  30374. s : 'nekoliko sekundi',
  30375. m : sr__translator.translate,
  30376. mm : sr__translator.translate,
  30377. h : sr__translator.translate,
  30378. hh : sr__translator.translate,
  30379. d : 'dan',
  30380. dd : sr__translator.translate,
  30381. M : 'mesec',
  30382. MM : sr__translator.translate,
  30383. y : 'godinu',
  30384. yy : sr__translator.translate
  30385. },
  30386. ordinalParse: /\d{1,2}\./,
  30387. ordinal : '%d.',
  30388. week : {
  30389. dow : 1, // Monday is the first day of the week.
  30390. doy : 7 // The week that contains Jan 1st is the first week of the year.
  30391. }
  30392. });
  30393. var ss = moment__default.defineLocale('ss', {
  30394. months : "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split('_'),
  30395. monthsShort : 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),
  30396. weekdays : 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split('_'),
  30397. weekdaysShort : 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),
  30398. weekdaysMin : 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),
  30399. weekdaysParseExact : true,
  30400. longDateFormat : {
  30401. LT : 'h:mm A',
  30402. LTS : 'h:mm:ss A',
  30403. L : 'DD/MM/YYYY',
  30404. LL : 'D MMMM YYYY',
  30405. LLL : 'D MMMM YYYY h:mm A',
  30406. LLLL : 'dddd, D MMMM YYYY h:mm A'
  30407. },
  30408. calendar : {
  30409. sameDay : '[Namuhla nga] LT',
  30410. nextDay : '[Kusasa nga] LT',
  30411. nextWeek : 'dddd [nga] LT',
  30412. lastDay : '[Itolo nga] LT',
  30413. lastWeek : 'dddd [leliphelile] [nga] LT',
  30414. sameElse : 'L'
  30415. },
  30416. relativeTime : {
  30417. future : 'nga %s',
  30418. past : 'wenteka nga %s',
  30419. s : 'emizuzwana lomcane',
  30420. m : 'umzuzu',
  30421. mm : '%d emizuzu',
  30422. h : 'lihora',
  30423. hh : '%d emahora',
  30424. d : 'lilanga',
  30425. dd : '%d emalanga',
  30426. M : 'inyanga',
  30427. MM : '%d tinyanga',
  30428. y : 'umnyaka',
  30429. yy : '%d iminyaka'
  30430. },
  30431. meridiemParse: /ekuseni|emini|entsambama|ebusuku/,
  30432. meridiem : function (hours, minutes, isLower) {
  30433. if (hours < 11) {
  30434. return 'ekuseni';
  30435. } else if (hours < 15) {
  30436. return 'emini';
  30437. } else if (hours < 19) {
  30438. return 'entsambama';
  30439. } else {
  30440. return 'ebusuku';
  30441. }
  30442. },
  30443. meridiemHour : function (hour, meridiem) {
  30444. if (hour === 12) {
  30445. hour = 0;
  30446. }
  30447. if (meridiem === 'ekuseni') {
  30448. return hour;
  30449. } else if (meridiem === 'emini') {
  30450. return hour >= 11 ? hour : hour + 12;
  30451. } else if (meridiem === 'entsambama' || meridiem === 'ebusuku') {
  30452. if (hour === 0) {
  30453. return 0;
  30454. }
  30455. return hour + 12;
  30456. }
  30457. },
  30458. ordinalParse: /\d{1,2}/,
  30459. ordinal : '%d',
  30460. week : {
  30461. dow : 1, // Monday is the first day of the week.
  30462. doy : 4 // The week that contains Jan 4th is the first week of the year.
  30463. }
  30464. });
  30465. var sv = moment__default.defineLocale('sv', {
  30466. months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),
  30467. monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
  30468. weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
  30469. weekdaysShort : 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
  30470. weekdaysMin : 'sö_må_ti_on_to_fr_lö'.split('_'),
  30471. longDateFormat : {
  30472. LT : 'HH:mm',
  30473. LTS : 'HH:mm:ss',
  30474. L : 'YYYY-MM-DD',
  30475. LL : 'D MMMM YYYY',
  30476. LLL : 'D MMMM YYYY [kl.] HH:mm',
  30477. LLLL : 'dddd D MMMM YYYY [kl.] HH:mm',
  30478. lll : 'D MMM YYYY HH:mm',
  30479. llll : 'ddd D MMM YYYY HH:mm'
  30480. },
  30481. calendar : {
  30482. sameDay: '[Idag] LT',
  30483. nextDay: '[Imorgon] LT',
  30484. lastDay: '[Igår] LT',
  30485. nextWeek: '[På] dddd LT',
  30486. lastWeek: '[I] dddd[s] LT',
  30487. sameElse: 'L'
  30488. },
  30489. relativeTime : {
  30490. future : 'om %s',
  30491. past : 'för %s sedan',
  30492. s : 'några sekunder',
  30493. m : 'en minut',
  30494. mm : '%d minuter',
  30495. h : 'en timme',
  30496. hh : '%d timmar',
  30497. d : 'en dag',
  30498. dd : '%d dagar',
  30499. M : 'en månad',
  30500. MM : '%d månader',
  30501. y : 'ett år',
  30502. yy : '%d år'
  30503. },
  30504. ordinalParse: /\d{1,2}(e|a)/,
  30505. ordinal : function (number) {
  30506. var b = number % 10,
  30507. output = (~~(number % 100 / 10) === 1) ? 'e' :
  30508. (b === 1) ? 'a' :
  30509. (b === 2) ? 'a' :
  30510. (b === 3) ? 'e' : 'e';
  30511. return number + output;
  30512. },
  30513. week : {
  30514. dow : 1, // Monday is the first day of the week.
  30515. doy : 4 // The week that contains Jan 4th is the first week of the year.
  30516. }
  30517. });
  30518. var sw = moment__default.defineLocale('sw', {
  30519. months : 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split('_'),
  30520. monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),
  30521. weekdays : 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split('_'),
  30522. weekdaysShort : 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),
  30523. weekdaysMin : 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),
  30524. weekdaysParseExact : true,
  30525. longDateFormat : {
  30526. LT : 'HH:mm',
  30527. LTS : 'HH:mm:ss',
  30528. L : 'DD.MM.YYYY',
  30529. LL : 'D MMMM YYYY',
  30530. LLL : 'D MMMM YYYY HH:mm',
  30531. LLLL : 'dddd, D MMMM YYYY HH:mm'
  30532. },
  30533. calendar : {
  30534. sameDay : '[leo saa] LT',
  30535. nextDay : '[kesho saa] LT',
  30536. nextWeek : '[wiki ijayo] dddd [saat] LT',
  30537. lastDay : '[jana] LT',
  30538. lastWeek : '[wiki iliyopita] dddd [saat] LT',
  30539. sameElse : 'L'
  30540. },
  30541. relativeTime : {
  30542. future : '%s baadaye',
  30543. past : 'tokea %s',
  30544. s : 'hivi punde',
  30545. m : 'dakika moja',
  30546. mm : 'dakika %d',
  30547. h : 'saa limoja',
  30548. hh : 'masaa %d',
  30549. d : 'siku moja',
  30550. dd : 'masiku %d',
  30551. M : 'mwezi mmoja',
  30552. MM : 'miezi %d',
  30553. y : 'mwaka mmoja',
  30554. yy : 'miaka %d'
  30555. },
  30556. week : {
  30557. dow : 1, // Monday is the first day of the week.
  30558. doy : 7 // The week that contains Jan 1st is the first week of the year.
  30559. }
  30560. });
  30561. var ta__symbolMap = {
  30562. '1': '௧',
  30563. '2': '௨',
  30564. '3': '௩',
  30565. '4': '௪',
  30566. '5': '௫',
  30567. '6': '௬',
  30568. '7': '௭',
  30569. '8': '௮',
  30570. '9': '௯',
  30571. '0': '௦'
  30572. }, ta__numberMap = {
  30573. '௧': '1',
  30574. '௨': '2',
  30575. '௩': '3',
  30576. '௪': '4',
  30577. '௫': '5',
  30578. '௬': '6',
  30579. '௭': '7',
  30580. '௮': '8',
  30581. '௯': '9',
  30582. '௦': '0'
  30583. };
  30584. var ta = moment__default.defineLocale('ta', {
  30585. months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
  30586. monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
  30587. weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'),
  30588. weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'),
  30589. weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),
  30590. longDateFormat : {
  30591. LT : 'HH:mm',
  30592. LTS : 'HH:mm:ss',
  30593. L : 'DD/MM/YYYY',
  30594. LL : 'D MMMM YYYY',
  30595. LLL : 'D MMMM YYYY, HH:mm',
  30596. LLLL : 'dddd, D MMMM YYYY, HH:mm'
  30597. },
  30598. calendar : {
  30599. sameDay : '[இன்று] LT',
  30600. nextDay : '[நாளை] LT',
  30601. nextWeek : 'dddd, LT',
  30602. lastDay : '[நேற்று] LT',
  30603. lastWeek : '[கடந்த வாரம்] dddd, LT',
  30604. sameElse : 'L'
  30605. },
  30606. relativeTime : {
  30607. future : '%s இல்',
  30608. past : '%s முன்',
  30609. s : 'ஒரு சில விநாடிகள்',
  30610. m : 'ஒரு நிமிடம்',
  30611. mm : '%d நிமிடங்கள்',
  30612. h : 'ஒரு மணி நேரம்',
  30613. hh : '%d மணி நேரம்',
  30614. d : 'ஒரு நாள்',
  30615. dd : '%d நாட்கள்',
  30616. M : 'ஒரு மாதம்',
  30617. MM : '%d மாதங்கள்',
  30618. y : 'ஒரு வருடம்',
  30619. yy : '%d ஆண்டுகள்'
  30620. },
  30621. ordinalParse: /\d{1,2}வது/,
  30622. ordinal : function (number) {
  30623. return number + 'வது';
  30624. },
  30625. preparse: function (string) {
  30626. return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) {
  30627. return ta__numberMap[match];
  30628. });
  30629. },
  30630. postformat: function (string) {
  30631. return string.replace(/\d/g, function (match) {
  30632. return ta__symbolMap[match];
  30633. });
  30634. },
  30635. // refer http://ta.wikipedia.org/s/1er1
  30636. meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,
  30637. meridiem : function (hour, minute, isLower) {
  30638. if (hour < 2) {
  30639. return ' யாமம்';
  30640. } else if (hour < 6) {
  30641. return ' வைகறை'; // வைகறை
  30642. } else if (hour < 10) {
  30643. return ' காலை'; // காலை
  30644. } else if (hour < 14) {
  30645. return ' நண்பகல்'; // நண்பகல்
  30646. } else if (hour < 18) {
  30647. return ' எற்பாடு'; // எற்பாடு
  30648. } else if (hour < 22) {
  30649. return ' மாலை'; // மாலை
  30650. } else {
  30651. return ' யாமம்';
  30652. }
  30653. },
  30654. meridiemHour : function (hour, meridiem) {
  30655. if (hour === 12) {
  30656. hour = 0;
  30657. }
  30658. if (meridiem === 'யாமம்') {
  30659. return hour < 2 ? hour : hour + 12;
  30660. } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {
  30661. return hour;
  30662. } else if (meridiem === 'நண்பகல்') {
  30663. return hour >= 10 ? hour : hour + 12;
  30664. } else {
  30665. return hour + 12;
  30666. }
  30667. },
  30668. week : {
  30669. dow : 0, // Sunday is the first day of the week.
  30670. doy : 6 // The week that contains Jan 1st is the first week of the year.
  30671. }
  30672. });
  30673. var te = moment__default.defineLocale('te', {
  30674. months : 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split('_'),
  30675. monthsShort : 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'),
  30676. monthsParseExact : true,
  30677. weekdays : 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split('_'),
  30678. weekdaysShort : 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),
  30679. weekdaysMin : 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),
  30680. longDateFormat : {
  30681. LT : 'A h:mm',
  30682. LTS : 'A h:mm:ss',
  30683. L : 'DD/MM/YYYY',
  30684. LL : 'D MMMM YYYY',
  30685. LLL : 'D MMMM YYYY, A h:mm',
  30686. LLLL : 'dddd, D MMMM YYYY, A h:mm'
  30687. },
  30688. calendar : {
  30689. sameDay : '[నేడు] LT',
  30690. nextDay : '[రేపు] LT',
  30691. nextWeek : 'dddd, LT',
  30692. lastDay : '[నిన్న] LT',
  30693. lastWeek : '[గత] dddd, LT',
  30694. sameElse : 'L'
  30695. },
  30696. relativeTime : {
  30697. future : '%s లో',
  30698. past : '%s క్రితం',
  30699. s : 'కొన్ని క్షణాలు',
  30700. m : 'ఒక నిమిషం',
  30701. mm : '%d నిమిషాలు',
  30702. h : 'ఒక గంట',
  30703. hh : '%d గంటలు',
  30704. d : 'ఒక రోజు',
  30705. dd : '%d రోజులు',
  30706. M : 'ఒక నెల',
  30707. MM : '%d నెలలు',
  30708. y : 'ఒక సంవత్సరం',
  30709. yy : '%d సంవత్సరాలు'
  30710. },
  30711. ordinalParse : /\d{1,2}వ/,
  30712. ordinal : '%dవ',
  30713. meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,
  30714. meridiemHour : function (hour, meridiem) {
  30715. if (hour === 12) {
  30716. hour = 0;
  30717. }
  30718. if (meridiem === 'రాత్రి') {
  30719. return hour < 4 ? hour : hour + 12;
  30720. } else if (meridiem === 'ఉదయం') {
  30721. return hour;
  30722. } else if (meridiem === 'మధ్యాహ్నం') {
  30723. return hour >= 10 ? hour : hour + 12;
  30724. } else if (meridiem === 'సాయంత్రం') {
  30725. return hour + 12;
  30726. }
  30727. },
  30728. meridiem : function (hour, minute, isLower) {
  30729. if (hour < 4) {
  30730. return 'రాత్రి';
  30731. } else if (hour < 10) {
  30732. return 'ఉదయం';
  30733. } else if (hour < 17) {
  30734. return 'మధ్యాహ్నం';
  30735. } else if (hour < 20) {
  30736. return 'సాయంత్రం';
  30737. } else {
  30738. return 'రాత్రి';
  30739. }
  30740. },
  30741. week : {
  30742. dow : 0, // Sunday is the first day of the week.
  30743. doy : 6 // The week that contains Jan 1st is the first week of the year.
  30744. }
  30745. });
  30746. var th = moment__default.defineLocale('th', {
  30747. months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),
  30748. monthsShort : 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split('_'),
  30749. monthsParseExact: true,
  30750. weekdays : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
  30751. weekdaysShort : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference
  30752. weekdaysMin : 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
  30753. weekdaysParseExact : true,
  30754. longDateFormat : {
  30755. LT : 'H นาฬิกา m นาที',
  30756. LTS : 'H นาฬิกา m นาที s วินาที',
  30757. L : 'YYYY/MM/DD',
  30758. LL : 'D MMMM YYYY',
  30759. LLL : 'D MMMM YYYY เวลา H นาฬิกา m นาที',
  30760. LLLL : 'วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที'
  30761. },
  30762. meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
  30763. isPM: function (input) {
  30764. return input === 'หลังเที่ยง';
  30765. },
  30766. meridiem : function (hour, minute, isLower) {
  30767. if (hour < 12) {
  30768. return 'ก่อนเที่ยง';
  30769. } else {
  30770. return 'หลังเที่ยง';
  30771. }
  30772. },
  30773. calendar : {
  30774. sameDay : '[วันนี้ เวลา] LT',
  30775. nextDay : '[พรุ่งนี้ เวลา] LT',
  30776. nextWeek : 'dddd[หน้า เวลา] LT',
  30777. lastDay : '[เมื่อวานนี้ เวลา] LT',
  30778. lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT',
  30779. sameElse : 'L'
  30780. },
  30781. relativeTime : {
  30782. future : 'อีก %s',
  30783. past : '%sที่แล้ว',
  30784. s : 'ไม่กี่วินาที',
  30785. m : '1 นาที',
  30786. mm : '%d นาที',
  30787. h : '1 ชั่วโมง',
  30788. hh : '%d ชั่วโมง',
  30789. d : '1 วัน',
  30790. dd : '%d วัน',
  30791. M : '1 เดือน',
  30792. MM : '%d เดือน',
  30793. y : '1 ปี',
  30794. yy : '%d ปี'
  30795. }
  30796. });
  30797. var tl_ph = moment__default.defineLocale('tl-ph', {
  30798. months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),
  30799. monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
  30800. weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'),
  30801. weekdaysShort : 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
  30802. weekdaysMin : 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
  30803. longDateFormat : {
  30804. LT : 'HH:mm',
  30805. LTS : 'HH:mm:ss',
  30806. L : 'MM/D/YYYY',
  30807. LL : 'MMMM D, YYYY',
  30808. LLL : 'MMMM D, YYYY HH:mm',
  30809. LLLL : 'dddd, MMMM DD, YYYY HH:mm'
  30810. },
  30811. calendar : {
  30812. sameDay: '[Ngayon sa] LT',
  30813. nextDay: '[Bukas sa] LT',
  30814. nextWeek: 'dddd [sa] LT',
  30815. lastDay: '[Kahapon sa] LT',
  30816. lastWeek: 'dddd [huling linggo] LT',
  30817. sameElse: 'L'
  30818. },
  30819. relativeTime : {
  30820. future : 'sa loob ng %s',
  30821. past : '%s ang nakalipas',
  30822. s : 'ilang segundo',
  30823. m : 'isang minuto',
  30824. mm : '%d minuto',
  30825. h : 'isang oras',
  30826. hh : '%d oras',
  30827. d : 'isang araw',
  30828. dd : '%d araw',
  30829. M : 'isang buwan',
  30830. MM : '%d buwan',
  30831. y : 'isang taon',
  30832. yy : '%d taon'
  30833. },
  30834. ordinalParse: /\d{1,2}/,
  30835. ordinal : function (number) {
  30836. return number;
  30837. },
  30838. week : {
  30839. dow : 1, // Monday is the first day of the week.
  30840. doy : 4 // The week that contains Jan 4th is the first week of the year.
  30841. }
  30842. });
  30843. var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');
  30844. function translateFuture(output) {
  30845. var time = output;
  30846. time = (output.indexOf('jaj') !== -1) ?
  30847. time.slice(0, -3) + 'leS' :
  30848. (output.indexOf('jar') !== -1) ?
  30849. time.slice(0, -3) + 'waQ' :
  30850. (output.indexOf('DIS') !== -1) ?
  30851. time.slice(0, -3) + 'nem' :
  30852. time + ' pIq';
  30853. return time;
  30854. }
  30855. function translatePast(output) {
  30856. var time = output;
  30857. time = (output.indexOf('jaj') !== -1) ?
  30858. time.slice(0, -3) + 'Hu’' :
  30859. (output.indexOf('jar') !== -1) ?
  30860. time.slice(0, -3) + 'wen' :
  30861. (output.indexOf('DIS') !== -1) ?
  30862. time.slice(0, -3) + 'ben' :
  30863. time + ' ret';
  30864. return time;
  30865. }
  30866. function tlh__translate(number, withoutSuffix, string, isFuture) {
  30867. var numberNoun = numberAsNoun(number);
  30868. switch (string) {
  30869. case 'mm':
  30870. return numberNoun + ' tup';
  30871. case 'hh':
  30872. return numberNoun + ' rep';
  30873. case 'dd':
  30874. return numberNoun + ' jaj';
  30875. case 'MM':
  30876. return numberNoun + ' jar';
  30877. case 'yy':
  30878. return numberNoun + ' DIS';
  30879. }
  30880. }
  30881. function numberAsNoun(number) {
  30882. var hundred = Math.floor((number % 1000) / 100),
  30883. ten = Math.floor((number % 100) / 10),
  30884. one = number % 10,
  30885. word = '';
  30886. if (hundred > 0) {
  30887. word += numbersNouns[hundred] + 'vatlh';
  30888. }
  30889. if (ten > 0) {
  30890. word += ((word !== '') ? ' ' : '') + numbersNouns[ten] + 'maH';
  30891. }
  30892. if (one > 0) {
  30893. word += ((word !== '') ? ' ' : '') + numbersNouns[one];
  30894. }
  30895. return (word === '') ? 'pagh' : word;
  30896. }
  30897. var tlh = moment__default.defineLocale('tlh', {
  30898. months : 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'),
  30899. monthsShort : 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'),
  30900. monthsParseExact : true,
  30901. weekdays : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
  30902. weekdaysShort : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
  30903. weekdaysMin : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
  30904. longDateFormat : {
  30905. LT : 'HH:mm',
  30906. LTS : 'HH:mm:ss',
  30907. L : 'DD.MM.YYYY',
  30908. LL : 'D MMMM YYYY',
  30909. LLL : 'D MMMM YYYY HH:mm',
  30910. LLLL : 'dddd, D MMMM YYYY HH:mm'
  30911. },
  30912. calendar : {
  30913. sameDay: '[DaHjaj] LT',
  30914. nextDay: '[wa’leS] LT',
  30915. nextWeek: 'LLL',
  30916. lastDay: '[wa’Hu’] LT',
  30917. lastWeek: 'LLL',
  30918. sameElse: 'L'
  30919. },
  30920. relativeTime : {
  30921. future : translateFuture,
  30922. past : translatePast,
  30923. s : 'puS lup',
  30924. m : 'wa’ tup',
  30925. mm : tlh__translate,
  30926. h : 'wa’ rep',
  30927. hh : tlh__translate,
  30928. d : 'wa’ jaj',
  30929. dd : tlh__translate,
  30930. M : 'wa’ jar',
  30931. MM : tlh__translate,
  30932. y : 'wa’ DIS',
  30933. yy : tlh__translate
  30934. },
  30935. ordinalParse: /\d{1,2}\./,
  30936. ordinal : '%d.',
  30937. week : {
  30938. dow : 1, // Monday is the first day of the week.
  30939. doy : 4 // The week that contains Jan 4th is the first week of the year.
  30940. }
  30941. });
  30942. var tr__suffixes = {
  30943. 1: '\'inci',
  30944. 5: '\'inci',
  30945. 8: '\'inci',
  30946. 70: '\'inci',
  30947. 80: '\'inci',
  30948. 2: '\'nci',
  30949. 7: '\'nci',
  30950. 20: '\'nci',
  30951. 50: '\'nci',
  30952. 3: '\'üncü',
  30953. 4: '\'üncü',
  30954. 100: '\'üncü',
  30955. 6: '\'ncı',
  30956. 9: '\'uncu',
  30957. 10: '\'uncu',
  30958. 30: '\'uncu',
  30959. 60: '\'ıncı',
  30960. 90: '\'ıncı'
  30961. };
  30962. var tr = moment__default.defineLocale('tr', {
  30963. months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),
  30964. monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
  30965. weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),
  30966. weekdaysShort : 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
  30967. weekdaysMin : 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
  30968. longDateFormat : {
  30969. LT : 'HH:mm',
  30970. LTS : 'HH:mm:ss',
  30971. L : 'DD.MM.YYYY',
  30972. LL : 'D MMMM YYYY',
  30973. LLL : 'D MMMM YYYY HH:mm',
  30974. LLLL : 'dddd, D MMMM YYYY HH:mm'
  30975. },
  30976. calendar : {
  30977. sameDay : '[bugün saat] LT',
  30978. nextDay : '[yarın saat] LT',
  30979. nextWeek : '[haftaya] dddd [saat] LT',
  30980. lastDay : '[dün] LT',
  30981. lastWeek : '[geçen hafta] dddd [saat] LT',
  30982. sameElse : 'L'
  30983. },
  30984. relativeTime : {
  30985. future : '%s sonra',
  30986. past : '%s önce',
  30987. s : 'birkaç saniye',
  30988. m : 'bir dakika',
  30989. mm : '%d dakika',
  30990. h : 'bir saat',
  30991. hh : '%d saat',
  30992. d : 'bir gün',
  30993. dd : '%d gün',
  30994. M : 'bir ay',
  30995. MM : '%d ay',
  30996. y : 'bir yıl',
  30997. yy : '%d yıl'
  30998. },
  30999. ordinalParse: /\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,
  31000. ordinal : function (number) {
  31001. if (number === 0) { // special case for zero
  31002. return number + '\'ıncı';
  31003. }
  31004. var a = number % 10,
  31005. b = number % 100 - a,
  31006. c = number >= 100 ? 100 : null;
  31007. return number + (tr__suffixes[a] || tr__suffixes[b] || tr__suffixes[c]);
  31008. },
  31009. week : {
  31010. dow : 1, // Monday is the first day of the week.
  31011. doy : 7 // The week that contains Jan 1st is the first week of the year.
  31012. }
  31013. });
  31014. // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals.
  31015. // This is currently too difficult (maybe even impossible) to add.
  31016. var tzl = moment__default.defineLocale('tzl', {
  31017. months : 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split('_'),
  31018. monthsShort : 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),
  31019. weekdays : 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),
  31020. weekdaysShort : 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),
  31021. weekdaysMin : 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),
  31022. longDateFormat : {
  31023. LT : 'HH.mm',
  31024. LTS : 'HH.mm.ss',
  31025. L : 'DD.MM.YYYY',
  31026. LL : 'D. MMMM [dallas] YYYY',
  31027. LLL : 'D. MMMM [dallas] YYYY HH.mm',
  31028. LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm'
  31029. },
  31030. meridiemParse: /d\'o|d\'a/i,
  31031. isPM : function (input) {
  31032. return 'd\'o' === input.toLowerCase();
  31033. },
  31034. meridiem : function (hours, minutes, isLower) {
  31035. if (hours > 11) {
  31036. return isLower ? 'd\'o' : 'D\'O';
  31037. } else {
  31038. return isLower ? 'd\'a' : 'D\'A';
  31039. }
  31040. },
  31041. calendar : {
  31042. sameDay : '[oxhi à] LT',
  31043. nextDay : '[demà à] LT',
  31044. nextWeek : 'dddd [à] LT',
  31045. lastDay : '[ieiri à] LT',
  31046. lastWeek : '[sür el] dddd [lasteu à] LT',
  31047. sameElse : 'L'
  31048. },
  31049. relativeTime : {
  31050. future : 'osprei %s',
  31051. past : 'ja%s',
  31052. s : tzl__processRelativeTime,
  31053. m : tzl__processRelativeTime,
  31054. mm : tzl__processRelativeTime,
  31055. h : tzl__processRelativeTime,
  31056. hh : tzl__processRelativeTime,
  31057. d : tzl__processRelativeTime,
  31058. dd : tzl__processRelativeTime,
  31059. M : tzl__processRelativeTime,
  31060. MM : tzl__processRelativeTime,
  31061. y : tzl__processRelativeTime,
  31062. yy : tzl__processRelativeTime
  31063. },
  31064. ordinalParse: /\d{1,2}\./,
  31065. ordinal : '%d.',
  31066. week : {
  31067. dow : 1, // Monday is the first day of the week.
  31068. doy : 4 // The week that contains Jan 4th is the first week of the year.
  31069. }
  31070. });
  31071. function tzl__processRelativeTime(number, withoutSuffix, key, isFuture) {
  31072. var format = {
  31073. 's': ['viensas secunds', '\'iensas secunds'],
  31074. 'm': ['\'n míut', '\'iens míut'],
  31075. 'mm': [number + ' míuts', '' + number + ' míuts'],
  31076. 'h': ['\'n þora', '\'iensa þora'],
  31077. 'hh': [number + ' þoras', '' + number + ' þoras'],
  31078. 'd': ['\'n ziua', '\'iensa ziua'],
  31079. 'dd': [number + ' ziuas', '' + number + ' ziuas'],
  31080. 'M': ['\'n mes', '\'iens mes'],
  31081. 'MM': [number + ' mesen', '' + number + ' mesen'],
  31082. 'y': ['\'n ar', '\'iens ar'],
  31083. 'yy': [number + ' ars', '' + number + ' ars']
  31084. };
  31085. return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1]);
  31086. }
  31087. var tzm_latn = moment__default.defineLocale('tzm-latn', {
  31088. months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
  31089. monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
  31090. weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  31091. weekdaysShort : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  31092. weekdaysMin : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  31093. longDateFormat : {
  31094. LT : 'HH:mm',
  31095. LTS : 'HH:mm:ss',
  31096. L : 'DD/MM/YYYY',
  31097. LL : 'D MMMM YYYY',
  31098. LLL : 'D MMMM YYYY HH:mm',
  31099. LLLL : 'dddd D MMMM YYYY HH:mm'
  31100. },
  31101. calendar : {
  31102. sameDay: '[asdkh g] LT',
  31103. nextDay: '[aska g] LT',
  31104. nextWeek: 'dddd [g] LT',
  31105. lastDay: '[assant g] LT',
  31106. lastWeek: 'dddd [g] LT',
  31107. sameElse: 'L'
  31108. },
  31109. relativeTime : {
  31110. future : 'dadkh s yan %s',
  31111. past : 'yan %s',
  31112. s : 'imik',
  31113. m : 'minuḍ',
  31114. mm : '%d minuḍ',
  31115. h : 'saɛa',
  31116. hh : '%d tassaɛin',
  31117. d : 'ass',
  31118. dd : '%d ossan',
  31119. M : 'ayowr',
  31120. MM : '%d iyyirn',
  31121. y : 'asgas',
  31122. yy : '%d isgasn'
  31123. },
  31124. week : {
  31125. dow : 6, // Saturday is the first day of the week.
  31126. doy : 12 // The week that contains Jan 1st is the first week of the year.
  31127. }
  31128. });
  31129. var tzm = moment__default.defineLocale('tzm', {
  31130. months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
  31131. monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
  31132. weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  31133. weekdaysShort : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  31134. weekdaysMin : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  31135. longDateFormat : {
  31136. LT : 'HH:mm',
  31137. LTS: 'HH:mm:ss',
  31138. L : 'DD/MM/YYYY',
  31139. LL : 'D MMMM YYYY',
  31140. LLL : 'D MMMM YYYY HH:mm',
  31141. LLLL : 'dddd D MMMM YYYY HH:mm'
  31142. },
  31143. calendar : {
  31144. sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',
  31145. nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',
  31146. nextWeek: 'dddd [ⴴ] LT',
  31147. lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',
  31148. lastWeek: 'dddd [ⴴ] LT',
  31149. sameElse: 'L'
  31150. },
  31151. relativeTime : {
  31152. future : 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',
  31153. past : 'ⵢⴰⵏ %s',
  31154. s : 'ⵉⵎⵉⴽ',
  31155. m : 'ⵎⵉⵏⵓⴺ',
  31156. mm : '%d ⵎⵉⵏⵓⴺ',
  31157. h : 'ⵙⴰⵄⴰ',
  31158. hh : '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',
  31159. d : 'ⴰⵙⵙ',
  31160. dd : '%d oⵙⵙⴰⵏ',
  31161. M : 'ⴰⵢoⵓⵔ',
  31162. MM : '%d ⵉⵢⵢⵉⵔⵏ',
  31163. y : 'ⴰⵙⴳⴰⵙ',
  31164. yy : '%d ⵉⵙⴳⴰⵙⵏ'
  31165. },
  31166. week : {
  31167. dow : 6, // Saturday is the first day of the week.
  31168. doy : 12 // The week that contains Jan 1st is the first week of the year.
  31169. }
  31170. });
  31171. function uk__plural(word, num) {
  31172. var forms = word.split('_');
  31173. return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
  31174. }
  31175. function uk__relativeTimeWithPlural(number, withoutSuffix, key) {
  31176. var format = {
  31177. 'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
  31178. 'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
  31179. 'dd': 'день_дні_днів',
  31180. 'MM': 'місяць_місяці_місяців',
  31181. 'yy': 'рік_роки_років'
  31182. };
  31183. if (key === 'm') {
  31184. return withoutSuffix ? 'хвилина' : 'хвилину';
  31185. }
  31186. else if (key === 'h') {
  31187. return withoutSuffix ? 'година' : 'годину';
  31188. }
  31189. else {
  31190. return number + ' ' + uk__plural(format[key], +number);
  31191. }
  31192. }
  31193. function weekdaysCaseReplace(m, format) {
  31194. var weekdays = {
  31195. 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),
  31196. 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),
  31197. 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')
  31198. },
  31199. nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ?
  31200. 'accusative' :
  31201. ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ?
  31202. 'genitive' :
  31203. 'nominative');
  31204. return weekdays[nounCase][m.day()];
  31205. }
  31206. function processHoursFunction(str) {
  31207. return function () {
  31208. return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
  31209. };
  31210. }
  31211. var uk = moment__default.defineLocale('uk', {
  31212. months : {
  31213. 'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'),
  31214. 'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_')
  31215. },
  31216. monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),
  31217. weekdays : weekdaysCaseReplace,
  31218. weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  31219. weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  31220. longDateFormat : {
  31221. LT : 'HH:mm',
  31222. LTS : 'HH:mm:ss',
  31223. L : 'DD.MM.YYYY',
  31224. LL : 'D MMMM YYYY р.',
  31225. LLL : 'D MMMM YYYY р., HH:mm',
  31226. LLLL : 'dddd, D MMMM YYYY р., HH:mm'
  31227. },
  31228. calendar : {
  31229. sameDay: processHoursFunction('[Сьогодні '),
  31230. nextDay: processHoursFunction('[Завтра '),
  31231. lastDay: processHoursFunction('[Вчора '),
  31232. nextWeek: processHoursFunction('[У] dddd ['),
  31233. lastWeek: function () {
  31234. switch (this.day()) {
  31235. case 0:
  31236. case 3:
  31237. case 5:
  31238. case 6:
  31239. return processHoursFunction('[Минулої] dddd [').call(this);
  31240. case 1:
  31241. case 2:
  31242. case 4:
  31243. return processHoursFunction('[Минулого] dddd [').call(this);
  31244. }
  31245. },
  31246. sameElse: 'L'
  31247. },
  31248. relativeTime : {
  31249. future : 'за %s',
  31250. past : '%s тому',
  31251. s : 'декілька секунд',
  31252. m : uk__relativeTimeWithPlural,
  31253. mm : uk__relativeTimeWithPlural,
  31254. h : 'годину',
  31255. hh : uk__relativeTimeWithPlural,
  31256. d : 'день',
  31257. dd : uk__relativeTimeWithPlural,
  31258. M : 'місяць',
  31259. MM : uk__relativeTimeWithPlural,
  31260. y : 'рік',
  31261. yy : uk__relativeTimeWithPlural
  31262. },
  31263. // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
  31264. meridiemParse: /ночі|ранку|дня|вечора/,
  31265. isPM: function (input) {
  31266. return /^(дня|вечора)$/.test(input);
  31267. },
  31268. meridiem : function (hour, minute, isLower) {
  31269. if (hour < 4) {
  31270. return 'ночі';
  31271. } else if (hour < 12) {
  31272. return 'ранку';
  31273. } else if (hour < 17) {
  31274. return 'дня';
  31275. } else {
  31276. return 'вечора';
  31277. }
  31278. },
  31279. ordinalParse: /\d{1,2}-(й|го)/,
  31280. ordinal: function (number, period) {
  31281. switch (period) {
  31282. case 'M':
  31283. case 'd':
  31284. case 'DDD':
  31285. case 'w':
  31286. case 'W':
  31287. return number + '-й';
  31288. case 'D':
  31289. return number + '-го';
  31290. default:
  31291. return number;
  31292. }
  31293. },
  31294. week : {
  31295. dow : 1, // Monday is the first day of the week.
  31296. doy : 7 // The week that contains Jan 1st is the first week of the year.
  31297. }
  31298. });
  31299. var uz = moment__default.defineLocale('uz', {
  31300. months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'),
  31301. monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
  31302. weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),
  31303. weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
  31304. weekdaysMin : 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),
  31305. longDateFormat : {
  31306. LT : 'HH:mm',
  31307. LTS : 'HH:mm:ss',
  31308. L : 'DD/MM/YYYY',
  31309. LL : 'D MMMM YYYY',
  31310. LLL : 'D MMMM YYYY HH:mm',
  31311. LLLL : 'D MMMM YYYY, dddd HH:mm'
  31312. },
  31313. calendar : {
  31314. sameDay : '[Бугун соат] LT [да]',
  31315. nextDay : '[Эртага] LT [да]',
  31316. nextWeek : 'dddd [куни соат] LT [да]',
  31317. lastDay : '[Кеча соат] LT [да]',
  31318. lastWeek : '[Утган] dddd [куни соат] LT [да]',
  31319. sameElse : 'L'
  31320. },
  31321. relativeTime : {
  31322. future : 'Якин %s ичида',
  31323. past : 'Бир неча %s олдин',
  31324. s : 'фурсат',
  31325. m : 'бир дакика',
  31326. mm : '%d дакика',
  31327. h : 'бир соат',
  31328. hh : '%d соат',
  31329. d : 'бир кун',
  31330. dd : '%d кун',
  31331. M : 'бир ой',
  31332. MM : '%d ой',
  31333. y : 'бир йил',
  31334. yy : '%d йил'
  31335. },
  31336. week : {
  31337. dow : 1, // Monday is the first day of the week.
  31338. doy : 7 // The week that contains Jan 4th is the first week of the year.
  31339. }
  31340. });
  31341. var vi = moment__default.defineLocale('vi', {
  31342. months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'),
  31343. monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),
  31344. monthsParseExact : true,
  31345. weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),
  31346. weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
  31347. weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
  31348. weekdaysParseExact : true,
  31349. meridiemParse: /sa|ch/i,
  31350. isPM : function (input) {
  31351. return /^ch$/i.test(input);
  31352. },
  31353. meridiem : function (hours, minutes, isLower) {
  31354. if (hours < 12) {
  31355. return isLower ? 'sa' : 'SA';
  31356. } else {
  31357. return isLower ? 'ch' : 'CH';
  31358. }
  31359. },
  31360. longDateFormat : {
  31361. LT : 'HH:mm',
  31362. LTS : 'HH:mm:ss',
  31363. L : 'DD/MM/YYYY',
  31364. LL : 'D MMMM [năm] YYYY',
  31365. LLL : 'D MMMM [năm] YYYY HH:mm',
  31366. LLLL : 'dddd, D MMMM [năm] YYYY HH:mm',
  31367. l : 'DD/M/YYYY',
  31368. ll : 'D MMM YYYY',
  31369. lll : 'D MMM YYYY HH:mm',
  31370. llll : 'ddd, D MMM YYYY HH:mm'
  31371. },
  31372. calendar : {
  31373. sameDay: '[Hôm nay lúc] LT',
  31374. nextDay: '[Ngày mai lúc] LT',
  31375. nextWeek: 'dddd [tuần tới lúc] LT',
  31376. lastDay: '[Hôm qua lúc] LT',
  31377. lastWeek: 'dddd [tuần rồi lúc] LT',
  31378. sameElse: 'L'
  31379. },
  31380. relativeTime : {
  31381. future : '%s tới',
  31382. past : '%s trước',
  31383. s : 'vài giây',
  31384. m : 'một phút',
  31385. mm : '%d phút',
  31386. h : 'một giờ',
  31387. hh : '%d giờ',
  31388. d : 'một ngày',
  31389. dd : '%d ngày',
  31390. M : 'một tháng',
  31391. MM : '%d tháng',
  31392. y : 'một năm',
  31393. yy : '%d năm'
  31394. },
  31395. ordinalParse: /\d{1,2}/,
  31396. ordinal : function (number) {
  31397. return number;
  31398. },
  31399. week : {
  31400. dow : 1, // Monday is the first day of the week.
  31401. doy : 4 // The week that contains Jan 4th is the first week of the year.
  31402. }
  31403. });
  31404. var x_pseudo = moment__default.defineLocale('x-pseudo', {
  31405. months : 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split('_'),
  31406. monthsShort : 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split('_'),
  31407. monthsParseExact : true,
  31408. weekdays : 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split('_'),
  31409. weekdaysShort : 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),
  31410. weekdaysMin : 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),
  31411. weekdaysParseExact : true,
  31412. longDateFormat : {
  31413. LT : 'HH:mm',
  31414. L : 'DD/MM/YYYY',
  31415. LL : 'D MMMM YYYY',
  31416. LLL : 'D MMMM YYYY HH:mm',
  31417. LLLL : 'dddd, D MMMM YYYY HH:mm'
  31418. },
  31419. calendar : {
  31420. sameDay : '[T~ódá~ý át] LT',
  31421. nextDay : '[T~ómó~rró~w át] LT',
  31422. nextWeek : 'dddd [át] LT',
  31423. lastDay : '[Ý~ést~érdá~ý át] LT',
  31424. lastWeek : '[L~ást] dddd [át] LT',
  31425. sameElse : 'L'
  31426. },
  31427. relativeTime : {
  31428. future : 'í~ñ %s',
  31429. past : '%s á~gó',
  31430. s : 'á ~féw ~sécó~ñds',
  31431. m : 'á ~míñ~úté',
  31432. mm : '%d m~íñú~tés',
  31433. h : 'á~ñ hó~úr',
  31434. hh : '%d h~óúrs',
  31435. d : 'á ~dáý',
  31436. dd : '%d d~áýs',
  31437. M : 'á ~móñ~th',
  31438. MM : '%d m~óñt~hs',
  31439. y : 'á ~ýéár',
  31440. yy : '%d ý~éárs'
  31441. },
  31442. ordinalParse: /\d{1,2}(th|st|nd|rd)/,
  31443. ordinal : function (number) {
  31444. var b = number % 10,
  31445. output = (~~(number % 100 / 10) === 1) ? 'th' :
  31446. (b === 1) ? 'st' :
  31447. (b === 2) ? 'nd' :
  31448. (b === 3) ? 'rd' : 'th';
  31449. return number + output;
  31450. },
  31451. week : {
  31452. dow : 1, // Monday is the first day of the week.
  31453. doy : 4 // The week that contains Jan 4th is the first week of the year.
  31454. }
  31455. });
  31456. var zh_cn = moment__default.defineLocale('zh-cn', {
  31457. months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
  31458. monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  31459. weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  31460. weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'),
  31461. weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
  31462. longDateFormat : {
  31463. LT : 'Ah点mm分',
  31464. LTS : 'Ah点m分s秒',
  31465. L : 'YYYY-MM-DD',
  31466. LL : 'YYYY年MMMD日',
  31467. LLL : 'YYYY年MMMD日Ah点mm分',
  31468. LLLL : 'YYYY年MMMD日ddddAh点mm分',
  31469. l : 'YYYY-MM-DD',
  31470. ll : 'YYYY年MMMD日',
  31471. lll : 'YYYY年MMMD日Ah点mm分',
  31472. llll : 'YYYY年MMMD日ddddAh点mm分'
  31473. },
  31474. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  31475. meridiemHour: function (hour, meridiem) {
  31476. if (hour === 12) {
  31477. hour = 0;
  31478. }
  31479. if (meridiem === '凌晨' || meridiem === '早上' ||
  31480. meridiem === '上午') {
  31481. return hour;
  31482. } else if (meridiem === '下午' || meridiem === '晚上') {
  31483. return hour + 12;
  31484. } else {
  31485. // '中午'
  31486. return hour >= 11 ? hour : hour + 12;
  31487. }
  31488. },
  31489. meridiem : function (hour, minute, isLower) {
  31490. var hm = hour * 100 + minute;
  31491. if (hm < 600) {
  31492. return '凌晨';
  31493. } else if (hm < 900) {
  31494. return '早上';
  31495. } else if (hm < 1130) {
  31496. return '上午';
  31497. } else if (hm < 1230) {
  31498. return '中午';
  31499. } else if (hm < 1800) {
  31500. return '下午';
  31501. } else {
  31502. return '晚上';
  31503. }
  31504. },
  31505. calendar : {
  31506. sameDay : function () {
  31507. return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT';
  31508. },
  31509. nextDay : function () {
  31510. return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT';
  31511. },
  31512. lastDay : function () {
  31513. return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT';
  31514. },
  31515. nextWeek : function () {
  31516. var startOfWeek, prefix;
  31517. startOfWeek = moment__default().startOf('week');
  31518. prefix = this.diff(startOfWeek, 'days') >= 7 ? '[下]' : '[本]';
  31519. return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';
  31520. },
  31521. lastWeek : function () {
  31522. var startOfWeek, prefix;
  31523. startOfWeek = moment__default().startOf('week');
  31524. prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]';
  31525. return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';
  31526. },
  31527. sameElse : 'LL'
  31528. },
  31529. ordinalParse: /\d{1,2}(日|月|周)/,
  31530. ordinal : function (number, period) {
  31531. switch (period) {
  31532. case 'd':
  31533. case 'D':
  31534. case 'DDD':
  31535. return number + '日';
  31536. case 'M':
  31537. return number + '月';
  31538. case 'w':
  31539. case 'W':
  31540. return number + '周';
  31541. default:
  31542. return number;
  31543. }
  31544. },
  31545. relativeTime : {
  31546. future : '%s内',
  31547. past : '%s前',
  31548. s : '几秒',
  31549. m : '1 分钟',
  31550. mm : '%d 分钟',
  31551. h : '1 小时',
  31552. hh : '%d 小时',
  31553. d : '1 天',
  31554. dd : '%d 天',
  31555. M : '1 个月',
  31556. MM : '%d 个月',
  31557. y : '1 年',
  31558. yy : '%d 年'
  31559. },
  31560. week : {
  31561. // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
  31562. dow : 1, // Monday is the first day of the week.
  31563. doy : 4 // The week that contains Jan 4th is the first week of the year.
  31564. }
  31565. });
  31566. var zh_tw = moment__default.defineLocale('zh-tw', {
  31567. months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
  31568. monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  31569. weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  31570. weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  31571. weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
  31572. longDateFormat : {
  31573. LT : 'Ah點mm分',
  31574. LTS : 'Ah點m分s秒',
  31575. L : 'YYYY年MMMD日',
  31576. LL : 'YYYY年MMMD日',
  31577. LLL : 'YYYY年MMMD日Ah點mm分',
  31578. LLLL : 'YYYY年MMMD日ddddAh點mm分',
  31579. l : 'YYYY年MMMD日',
  31580. ll : 'YYYY年MMMD日',
  31581. lll : 'YYYY年MMMD日Ah點mm分',
  31582. llll : 'YYYY年MMMD日ddddAh點mm分'
  31583. },
  31584. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  31585. meridiemHour : function (hour, meridiem) {
  31586. if (hour === 12) {
  31587. hour = 0;
  31588. }
  31589. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  31590. return hour;
  31591. } else if (meridiem === '中午') {
  31592. return hour >= 11 ? hour : hour + 12;
  31593. } else if (meridiem === '下午' || meridiem === '晚上') {
  31594. return hour + 12;
  31595. }
  31596. },
  31597. meridiem : function (hour, minute, isLower) {
  31598. var hm = hour * 100 + minute;
  31599. if (hm < 600) {
  31600. return '凌晨';
  31601. } else if (hm < 900) {
  31602. return '早上';
  31603. } else if (hm < 1130) {
  31604. return '上午';
  31605. } else if (hm < 1230) {
  31606. return '中午';
  31607. } else if (hm < 1800) {
  31608. return '下午';
  31609. } else {
  31610. return '晚上';
  31611. }
  31612. },
  31613. calendar : {
  31614. sameDay : '[今天]LT',
  31615. nextDay : '[明天]LT',
  31616. nextWeek : '[下]ddddLT',
  31617. lastDay : '[昨天]LT',
  31618. lastWeek : '[上]ddddLT',
  31619. sameElse : 'L'
  31620. },
  31621. ordinalParse: /\d{1,2}(日|月|週)/,
  31622. ordinal : function (number, period) {
  31623. switch (period) {
  31624. case 'd' :
  31625. case 'D' :
  31626. case 'DDD' :
  31627. return number + '日';
  31628. case 'M' :
  31629. return number + '月';
  31630. case 'w' :
  31631. case 'W' :
  31632. return number + '週';
  31633. default :
  31634. return number;
  31635. }
  31636. },
  31637. relativeTime : {
  31638. future : '%s內',
  31639. past : '%s前',
  31640. s : '幾秒',
  31641. m : '1 分鐘',
  31642. mm : '%d 分鐘',
  31643. h : '1 小時',
  31644. hh : '%d 小時',
  31645. d : '1 天',
  31646. dd : '%d 天',
  31647. M : '1 個月',
  31648. MM : '%d 個月',
  31649. y : '1 年',
  31650. yy : '%d 年'
  31651. }
  31652. });
  31653. var moment_with_locales = moment__default;
  31654. moment_with_locales.locale('en');
  31655. return moment_with_locales;
  31656. }));
  31657. /*
  31658. International Telephone Input v4.0.1
  31659. https://github.com/Bluefieldscom/intl-tel-input.git
  31660. */
  31661. // wrap in UMD - see https://github.com/umdjs/umd/blob/master/jqueryPlugin.js
  31662. (function(factory) {
  31663. if (typeof define === "function" && define.amd) {
  31664. define([ "jquery" ], function($) {
  31665. factory($, window, document);
  31666. });
  31667. } else {
  31668. factory(jQuery, window, document);
  31669. }
  31670. })(function($, window, document, undefined) {
  31671. "use strict";
  31672. var pluginName = "intlTelInput", id = 1, // give each instance it's own id for namespaced event handling
  31673. defaults = {
  31674. // automatically format the number according to the selected country
  31675. autoFormat: true,
  31676. // if there is just a dial code in the input: remove it on blur, and re-add it on focus
  31677. autoHideDialCode: true,
  31678. // default country
  31679. defaultCountry: "",
  31680. // token for ipinfo - required for https or over 1000 daily page views support
  31681. ipinfoToken: "",
  31682. // don't insert international dial codes
  31683. nationalMode: true,
  31684. // number type to use for placeholders
  31685. numberType: "MOBILE",
  31686. // display only these countries
  31687. onlyCountries: [],
  31688. // the countries at the top of the list. defaults to united states and united kingdom
  31689. preferredCountries: [ "us", "gb" ],
  31690. // stop the user from typing invalid numbers
  31691. preventInvalidNumbers: false,
  31692. // specify the path to the libphonenumber script to enable validation/formatting
  31693. utilsScript: ""
  31694. }, keys = {
  31695. UP: 38,
  31696. DOWN: 40,
  31697. ENTER: 13,
  31698. ESC: 27,
  31699. PLUS: 43,
  31700. A: 65,
  31701. Z: 90,
  31702. ZERO: 48,
  31703. NINE: 57,
  31704. SPACE: 32,
  31705. BSPACE: 8,
  31706. DEL: 46,
  31707. CTRL: 17,
  31708. CMD1: 91,
  31709. // Chrome
  31710. CMD2: 224
  31711. }, windowLoaded = false;
  31712. // keep track of if the window.load event has fired as impossible to check after the fact
  31713. $(window).load(function() {
  31714. windowLoaded = true;
  31715. });
  31716. function Plugin(element, options) {
  31717. this.element = element;
  31718. this.options = $.extend({}, defaults, options);
  31719. this._defaults = defaults;
  31720. // event namespace
  31721. this.ns = "." + pluginName + id++;
  31722. // Chrome, FF, Safari, IE9+
  31723. this.isGoodBrowser = Boolean(element.setSelectionRange);
  31724. this.hadInitialPlaceholder = Boolean($(element).attr("placeholder"));
  31725. this._name = pluginName;
  31726. this.init();
  31727. }
  31728. Plugin.prototype = {
  31729. init: function() {
  31730. var that = this;
  31731. // if defaultCountry is set to "auto", we must do a lookup first
  31732. if (this.options.defaultCountry == "auto") {
  31733. // reset this in case lookup fails
  31734. this.options.defaultCountry = "";
  31735. var ipinfoURL = "//ipinfo.io";
  31736. if (this.options.ipinfoToken) {
  31737. ipinfoURL += "?token=" + this.options.ipinfoToken;
  31738. }
  31739. $.get(ipinfoURL, function(response) {
  31740. if (response && response.country) {
  31741. that.options.defaultCountry = response.country.toLowerCase();
  31742. }
  31743. }, "jsonp").always(function() {
  31744. that._ready();
  31745. });
  31746. } else {
  31747. this._ready();
  31748. }
  31749. },
  31750. _ready: function() {
  31751. // if in nationalMode, disable options relating to dial codes
  31752. if (this.options.nationalMode) {
  31753. this.options.autoHideDialCode = false;
  31754. }
  31755. // IE Mobile doesn't support the keypress event (see issue 68) which makes autoFormat impossible
  31756. if (navigator.userAgent.match(/IEMobile/i)) {
  31757. this.options.autoFormat = false;
  31758. }
  31759. // process all the data: onlyCountries, preferredCountries etc
  31760. this._processCountryData();
  31761. // generate the markup
  31762. this._generateMarkup();
  31763. // set the initial state of the input value and the selected flag
  31764. this._setInitialState();
  31765. // start all of the event listeners: autoHideDialCode, input keydown, selectedFlag click
  31766. this._initListeners();
  31767. },
  31768. /********************
  31769. * PRIVATE METHODS
  31770. ********************/
  31771. // prepare all of the country data, including onlyCountries and preferredCountries options
  31772. _processCountryData: function() {
  31773. // set the instances country data objects
  31774. this._setInstanceCountryData();
  31775. // set the preferredCountries property
  31776. this._setPreferredCountries();
  31777. },
  31778. // add a country code to this.countryCodes
  31779. _addCountryCode: function(iso2, dialCode, priority) {
  31780. if (!(dialCode in this.countryCodes)) {
  31781. this.countryCodes[dialCode] = [];
  31782. }
  31783. var index = priority || 0;
  31784. this.countryCodes[dialCode][index] = iso2;
  31785. },
  31786. // process onlyCountries array if present, and generate the countryCodes map
  31787. _setInstanceCountryData: function() {
  31788. var i;
  31789. // process onlyCountries option
  31790. if (this.options.onlyCountries.length) {
  31791. this.countries = [];
  31792. for (i = 0; i < allCountries.length; i++) {
  31793. if ($.inArray(allCountries[i].iso2, this.options.onlyCountries) != -1) {
  31794. this.countries.push(allCountries[i]);
  31795. }
  31796. }
  31797. } else {
  31798. this.countries = allCountries;
  31799. }
  31800. // generate countryCodes map
  31801. this.countryCodes = {};
  31802. for (i = 0; i < this.countries.length; i++) {
  31803. var c = this.countries[i];
  31804. this._addCountryCode(c.iso2, c.dialCode, c.priority);
  31805. // area codes
  31806. if (c.areaCodes) {
  31807. for (var j = 0; j < c.areaCodes.length; j++) {
  31808. // full dial code is country code + dial code
  31809. this._addCountryCode(c.iso2, c.dialCode + c.areaCodes[j]);
  31810. }
  31811. }
  31812. }
  31813. },
  31814. // process preferred countries - iterate through the preferences,
  31815. // fetching the country data for each one
  31816. _setPreferredCountries: function() {
  31817. this.preferredCountries = [];
  31818. for (var i = 0; i < this.options.preferredCountries.length; i++) {
  31819. var countryCode = this.options.preferredCountries[i], countryData = this._getCountryData(countryCode, false, true);
  31820. if (countryData) {
  31821. this.preferredCountries.push(countryData);
  31822. }
  31823. }
  31824. },
  31825. // generate all of the markup for the plugin: the selected flag overlay, and the dropdown
  31826. _generateMarkup: function() {
  31827. // telephone input
  31828. this.telInput = $(this.element);
  31829. // prevent autocomplete as there's no safe, cross-browser event we can react to, so it can easily put the plugin in an inconsistent state e.g. the wrong flag selected for the autocompleted number, which on submit could mean the wrong number is saved (esp in nationalMode)
  31830. this.telInput.attr("autocomplete", "off");
  31831. // containers (mostly for positioning)
  31832. this.telInput.wrap($("<div>", {
  31833. "class": "intl-tel-input"
  31834. }));
  31835. var flagsContainer = $("<div>", {
  31836. "class": "flag-dropdown"
  31837. }).insertAfter(this.telInput);
  31838. // currently selected flag (displayed to left of input)
  31839. var selectedFlag = $("<div>", {
  31840. "class": "selected-flag"
  31841. }).appendTo(flagsContainer);
  31842. this.selectedFlagInner = $("<div>", {
  31843. "class": "iti-flag"
  31844. }).appendTo(selectedFlag);
  31845. // CSS triangle
  31846. $("<div>", {
  31847. "class": "arrow"
  31848. }).appendTo(this.selectedFlagInner);
  31849. // country list contains: preferred countries, then divider, then all countries
  31850. this.countryList = $("<ul>", {
  31851. "class": "country-list v-hide"
  31852. }).appendTo(flagsContainer);
  31853. if (this.preferredCountries.length) {
  31854. this._appendListItems(this.preferredCountries, "preferred");
  31855. $("<li>", {
  31856. "class": "divider"
  31857. }).appendTo(this.countryList);
  31858. }
  31859. this._appendListItems(this.countries, "");
  31860. // now we can grab the dropdown height, and hide it properly
  31861. this.dropdownHeight = this.countryList.outerHeight();
  31862. this.countryList.removeClass("v-hide").addClass("hide");
  31863. // on small screens make the dropdown the same width as the input
  31864. if (window.innerWidth < 500) {
  31865. this.countryList.outerWidth(this.telInput.outerWidth());
  31866. }
  31867. // this is useful in lots of places
  31868. this.countryListItems = this.countryList.children(".country");
  31869. },
  31870. // add a country <li> to the countryList <ul> container
  31871. _appendListItems: function(countries, className) {
  31872. // we create so many DOM elements, I decided it was faster to build a temp string
  31873. // and then add everything to the DOM in one go at the end
  31874. var tmp = "";
  31875. // for each country
  31876. for (var i = 0; i < countries.length; i++) {
  31877. var c = countries[i];
  31878. // open the list item
  31879. tmp += "<li class='country " + className + "' data-dial-code='" + c.dialCode + "' data-country-code='" + c.iso2 + "'>";
  31880. // add the flag
  31881. tmp += "<div class='iti-flag " + c.iso2 + "'></div>";
  31882. // and the country name and dial code
  31883. tmp += "<span class='country-name'>" + c.name + "</span>";
  31884. tmp += "<span class='dial-code'>+" + c.dialCode + "</span>";
  31885. // close the list item
  31886. tmp += "</li>";
  31887. }
  31888. this.countryList.append(tmp);
  31889. },
  31890. // set the initial state of the input value and the selected flag
  31891. _setInitialState: function() {
  31892. var val = this.telInput.val();
  31893. // if there is a number, and it's valid, we can go ahead and set the flag, else fall back to default
  31894. if (this._getDialCode(val)) {
  31895. this._updateFlagFromNumber(val);
  31896. } else {
  31897. var defaultCountry;
  31898. // check the defaultCountry option, else fall back to the first in the list
  31899. if (this.options.defaultCountry) {
  31900. defaultCountry = this._getCountryData(this.options.defaultCountry, false, false);
  31901. } else {
  31902. defaultCountry = this.preferredCountries.length ? this.preferredCountries[0] : this.countries[0];
  31903. }
  31904. this._selectFlag(defaultCountry.iso2);
  31905. // if empty, insert the default dial code (this function will check !nationalMode and !autoHideDialCode)
  31906. if (!val) {
  31907. this._updateDialCode(defaultCountry.dialCode, false);
  31908. }
  31909. }
  31910. // format
  31911. if (val) {
  31912. // this wont be run after _updateDialCode as that's only called if no val
  31913. this._updateVal(val, false);
  31914. }
  31915. },
  31916. // initialise the main event listeners: input keyup, and click selected flag
  31917. _initListeners: function() {
  31918. var that = this;
  31919. this._initKeyListeners();
  31920. // autoFormat prevents the change event from firing, so we need to check for changes between focus and blur in order to manually trigger it
  31921. if (this.options.autoHideDialCode || this.options.autoFormat) {
  31922. this._initFocusListeners();
  31923. }
  31924. // hack for input nested inside label: clicking the selected-flag to open the dropdown would then automatically trigger a 2nd click on the input which would close it again
  31925. var label = this.telInput.closest("label");
  31926. if (label.length) {
  31927. label.on("click" + this.ns, function(e) {
  31928. // if the dropdown is closed, then focus the input, else ignore the click
  31929. if (that.countryList.hasClass("hide")) {
  31930. that.telInput.focus();
  31931. } else {
  31932. e.preventDefault();
  31933. }
  31934. });
  31935. }
  31936. // toggle country dropdown on click
  31937. var selectedFlag = this.selectedFlagInner.parent();
  31938. selectedFlag.on("click" + this.ns, function(e) {
  31939. // only intercept this event if we're opening the dropdown
  31940. // else let it bubble up to the top ("click-off-to-close" listener)
  31941. // we cannot just stopPropagation as it may be needed to close another instance
  31942. if (that.countryList.hasClass("hide") && !that.telInput.prop("disabled") && !that.telInput.prop("readonly")) {
  31943. that._showDropdown();
  31944. }
  31945. });
  31946. // if the user has specified the path to the utils script, fetch it on window.load
  31947. if (this.options.utilsScript) {
  31948. // if the plugin is being initialised after the window.load event has already been fired
  31949. if (windowLoaded) {
  31950. this.loadUtils();
  31951. } else {
  31952. // wait until the load event so we don't block any other requests e.g. the flags image
  31953. $(window).load(function() {
  31954. that.loadUtils();
  31955. });
  31956. }
  31957. }
  31958. },
  31959. _initKeyListeners: function() {
  31960. var that = this;
  31961. if (this.options.autoFormat) {
  31962. // format number and update flag on keypress
  31963. // use keypress event as we want to ignore all input except for a select few keys,
  31964. // but we dont want to ignore the navigation keys like the arrows etc.
  31965. // NOTE: no point in refactoring this to only bind these listeners on focus/blur because then you would need to have those 2 listeners running the whole time anyway...
  31966. this.telInput.on("keypress" + this.ns, function(e) {
  31967. // 32 is space, and after that it's all chars (not meta/nav keys)
  31968. // this fix is needed for Firefox, which triggers keypress event for some meta/nav keys
  31969. // Update: also ignore if this is a metaKey e.g. FF and Safari trigger keypress on the v of Ctrl+v
  31970. // Update: also check that we have utils before we do any autoFormat stuff
  31971. if (e.which >= keys.SPACE && !e.metaKey && window.intlTelInputUtils && !that.telInput.prop("readonly")) {
  31972. e.preventDefault();
  31973. // allowed keys are just numeric keys and plus
  31974. // we must allow plus for the case where the user does select-all and then hits plus to start typing a new number. we could refine this logic to first check that the selection contains a plus, but that wont work in old browsers, and I think it's overkill anyway
  31975. var isAllowedKey = e.which >= keys.ZERO && e.which <= keys.NINE || e.which == keys.PLUS, input = that.telInput[0], noSelection = that.isGoodBrowser && input.selectionStart == input.selectionEnd, max = that.telInput.attr("maxlength"), val = that.telInput.val(), // assumes that if max exists, it is >0
  31976. isBelowMax = max ? val.length < max : true;
  31977. // first: ensure we dont go over maxlength. we must do this here to prevent adding digits in the middle of the number
  31978. // still reformat even if not an allowed key as they could by typing a formatting char, but ignore if there's a selection as doesn't make sense to replace selection with illegal char and then immediately remove it
  31979. if (isBelowMax && (isAllowedKey || noSelection)) {
  31980. var newChar = isAllowedKey ? String.fromCharCode(e.which) : null;
  31981. that._handleInputKey(newChar, true);
  31982. // if something has changed, trigger the input event (which was otherwised squashed by the preventDefault)
  31983. if (val != that.telInput.val()) {
  31984. that.telInput.trigger("input");
  31985. }
  31986. }
  31987. if (!isAllowedKey) {
  31988. that.telInput.trigger("invalidkey");
  31989. }
  31990. }
  31991. });
  31992. }
  31993. // handle keyup event
  31994. // for autoFormat: we use keyup to catch cut/paste events and also delete events (after the fact)
  31995. this.telInput.on("keyup" + this.ns, function(e) {
  31996. // the "enter" key event from selecting a dropdown item is triggered here on the input, because the document.keydown handler that initially handles that event triggers a focus on the input, and so the keyup for that same key event gets triggered here. weird, but just make sure we dont bother doing any re-formatting in this case (we've already done preventDefault in the keydown handler, so it wont actually submit the form or anything).
  31997. // ALSO: ignore keyup if readonly
  31998. if (e.which == keys.ENTER || that.telInput.prop("readonly")) {} else if (that.options.autoFormat && window.intlTelInputUtils) {
  31999. var isCtrl = e.which == keys.CTRL || e.which == keys.CMD1 || e.which == keys.CMD2, input = that.telInput[0], // noSelection defaults to false for bad browsers, else would be reformatting on all ctrl keys e.g. select-all/copy
  32000. noSelection = that.isGoodBrowser && input.selectionStart == input.selectionEnd, // cursorAtEnd defaults to false for bad browsers else they would never get a reformat on delete
  32001. cursorAtEnd = that.isGoodBrowser && input.selectionStart == that.telInput.val().length;
  32002. // if delete in the middle: reformat with no suffix (no need to reformat if delete at end)
  32003. // if backspace: reformat with no suffix (need to reformat if at end to remove any lingering suffix - this is a feature)
  32004. // if ctrl and no selection (i.e. could have just been a paste): reformat (if cursorAtEnd: add suffix)
  32005. if (e.which == keys.DEL && !cursorAtEnd || e.which == keys.BSPACE || isCtrl && noSelection) {
  32006. // important to remember never to add suffix on any delete key as can fuck up in ie8 so you can never delete a formatting char at the end
  32007. that._handleInputKey(null, isCtrl && cursorAtEnd);
  32008. }
  32009. // prevent deleting the plus (if not in nationalMode)
  32010. if (!that.options.nationalMode) {
  32011. var val = that.telInput.val();
  32012. if (val.substr(0, 1) != "+") {
  32013. // newCursorPos is current pos + 1 to account for the plus we are about to add
  32014. var newCursorPos = that.isGoodBrowser ? input.selectionStart + 1 : 0;
  32015. that.telInput.val("+" + val);
  32016. if (that.isGoodBrowser) {
  32017. input.setSelectionRange(newCursorPos, newCursorPos);
  32018. }
  32019. }
  32020. }
  32021. } else {
  32022. // if no autoFormat, just update flag
  32023. that._updateFlagFromNumber(that.telInput.val());
  32024. }
  32025. });
  32026. },
  32027. // when autoFormat is enabled: handle various key events on the input: the 2 main situations are 1) adding a new number character, which will replace any selection, reformat, and preserve the cursor position. and 2) reformatting on backspace, or paste event (etc)
  32028. _handleInputKey: function(newNumericChar, addSuffix) {
  32029. var val = this.telInput.val(), numericBefore = this._getNumeric(val), originalLeftChar, // raw DOM element
  32030. input = this.telInput[0], digitsOnRight = 0;
  32031. if (this.isGoodBrowser) {
  32032. // cursor strategy: maintain the number of digits on the right. we use the right instead of the left so that A) we dont have to account for the new digit (or digits if paste event), and B) we're always on the right side of formatting suffixes
  32033. digitsOnRight = this._getDigitsOnRight(val, input.selectionEnd);
  32034. // if handling a new number character: insert it in the right place
  32035. if (newNumericChar) {
  32036. // replace any selection they may have made with the new char
  32037. val = val.substr(0, input.selectionStart) + newNumericChar + val.substring(input.selectionEnd, val.length);
  32038. } else {
  32039. // here we're not handling a new char, we're just doing a re-format (e.g. on delete/backspace/paste, after the fact), but we still need to maintain the cursor position. so make note of the char on the left, and then after the re-format, we'll count in the same number of digits from the right, and then keep going through any formatting chars until we hit the same left char that we had before.
  32040. originalLeftChar = val.charAt(input.selectionStart - 1);
  32041. }
  32042. } else if (newNumericChar) {
  32043. val += newNumericChar;
  32044. }
  32045. // update the number and flag
  32046. this.setNumber(val, addSuffix);
  32047. val = this.telInput.val();
  32048. var numericAfter = this._getNumeric(val), numericIsSame = numericBefore == numericAfter;
  32049. if (this.options.preventInvalidNumbers && newNumericChar) {
  32050. if (numericIsSame) {
  32051. // if we're trying to add a new numeric char and the numeric digits haven't changed, then trigger invalid
  32052. this.telInput.trigger("invalidkey");
  32053. } else if (numericBefore.length == numericAfter.length) {
  32054. // preventInvalidNumbers edge case: adding digit in middle of full number, so a digit gets dropped from the end (numeric digits have changed but are same length)
  32055. digitsOnRight--;
  32056. }
  32057. }
  32058. // update the cursor position
  32059. if (this.isGoodBrowser) {
  32060. var newCursor;
  32061. // if it was at the end, keep it there
  32062. if (!digitsOnRight) {
  32063. newCursor = val.length;
  32064. } else {
  32065. // else count in the same number of digits from the right
  32066. newCursor = this._getCursorFromDigitsOnRight(val, digitsOnRight);
  32067. // but if delete/paste etc, keep going left until hit the same left char as before
  32068. if (!newNumericChar) {
  32069. newCursor = this._getCursorFromLeftChar(val, newCursor, originalLeftChar);
  32070. }
  32071. }
  32072. // set the new cursor
  32073. input.setSelectionRange(newCursor, newCursor);
  32074. }
  32075. },
  32076. // we start from the position in guessCursor, and work our way left until we hit the originalLeftChar or a number to make sure that after reformatting the cursor has the same char on the left in the case of a delete etc
  32077. _getCursorFromLeftChar: function(val, guessCursor, originalLeftChar) {
  32078. for (var i = guessCursor; i > 0; i--) {
  32079. var leftChar = val.charAt(i - 1);
  32080. if (leftChar == originalLeftChar || $.isNumeric(leftChar)) {
  32081. return i;
  32082. }
  32083. }
  32084. return 0;
  32085. },
  32086. // after a reformat we need to make sure there are still the same number of digits to the right of the cursor
  32087. _getCursorFromDigitsOnRight: function(val, digitsOnRight) {
  32088. for (var i = val.length - 1; i >= 0; i--) {
  32089. if ($.isNumeric(val.charAt(i))) {
  32090. if (--digitsOnRight === 0) {
  32091. return i;
  32092. }
  32093. }
  32094. }
  32095. return 0;
  32096. },
  32097. // get the number of numeric digits to the right of the cursor so we can reposition the cursor correctly after the reformat has happened
  32098. _getDigitsOnRight: function(val, selectionEnd) {
  32099. var digitsOnRight = 0;
  32100. for (var i = selectionEnd; i < val.length; i++) {
  32101. if ($.isNumeric(val.charAt(i))) {
  32102. digitsOnRight++;
  32103. }
  32104. }
  32105. return digitsOnRight;
  32106. },
  32107. // listen for focus and blur
  32108. _initFocusListeners: function() {
  32109. var that = this;
  32110. if (this.options.autoHideDialCode) {
  32111. // mousedown decides where the cursor goes, so if we're focusing we must preventDefault as we'll be inserting the dial code, and we want the cursor to be at the end no matter where they click
  32112. this.telInput.on("mousedown" + this.ns, function(e) {
  32113. if (!that.telInput.is(":focus") && !that.telInput.val()) {
  32114. e.preventDefault();
  32115. // but this also cancels the focus, so we must trigger that manually
  32116. that.telInput.focus();
  32117. }
  32118. });
  32119. }
  32120. this.telInput.on("focus" + this.ns, function(e) {
  32121. var value = that.telInput.val();
  32122. // save this to compare on blur
  32123. that.telInput.data("focusVal", value);
  32124. // on focus: if empty, insert the dial code for the currently selected flag
  32125. if (that.options.autoHideDialCode && !value && !that.telInput.prop("readonly")) {
  32126. that._updateVal("+" + that.selectedCountryData.dialCode, true);
  32127. // after auto-inserting a dial code, if the first key they hit is '+' then assume they are entering a new number, so remove the dial code. use keypress instead of keydown because keydown gets triggered for the shift key (required to hit the + key), and instead of keyup because that shows the new '+' before removing the old one
  32128. that.telInput.one("keypress.plus" + that.ns, function(e) {
  32129. if (e.which == keys.PLUS) {
  32130. // if autoFormat is enabled, this key event will have already have been handled by another keypress listener (hence we need to add the "+"). if disabled, it will be handled after this by a keyup listener (hence no need to add the "+").
  32131. var newVal = that.options.autoFormat && window.intlTelInputUtils ? "+" : "";
  32132. that.telInput.val(newVal);
  32133. }
  32134. });
  32135. // after tabbing in, make sure the cursor is at the end we must use setTimeout to get outside of the focus handler as it seems the selection happens after that
  32136. setTimeout(function() {
  32137. var input = that.telInput[0];
  32138. if (that.isGoodBrowser) {
  32139. var len = that.telInput.val().length;
  32140. input.setSelectionRange(len, len);
  32141. }
  32142. });
  32143. }
  32144. });
  32145. this.telInput.on("blur" + this.ns, function() {
  32146. if (that.options.autoHideDialCode) {
  32147. // on blur: if just a dial code then remove it
  32148. var value = that.telInput.val(), startsPlus = value.substr(0, 1) == "+";
  32149. if (startsPlus) {
  32150. var numeric = that._getNumeric(value);
  32151. // if just a plus, or if just a dial code
  32152. if (!numeric || that.selectedCountryData.dialCode == numeric) {
  32153. that.telInput.val("");
  32154. }
  32155. }
  32156. // remove the keypress listener we added on focus
  32157. that.telInput.off("keypress.plus" + that.ns);
  32158. }
  32159. // if autoFormat, we must manually trigger change event if value has changed
  32160. if (that.options.autoFormat && window.intlTelInputUtils && that.telInput.val() != that.telInput.data("focusVal")) {
  32161. that.telInput.trigger("change");
  32162. }
  32163. });
  32164. },
  32165. // extract the numeric digits from the given string
  32166. _getNumeric: function(s) {
  32167. return s.replace(/\D/g, "");
  32168. },
  32169. // show the dropdown
  32170. _showDropdown: function() {
  32171. this._setDropdownPosition();
  32172. // update highlighting and scroll to active list item
  32173. var activeListItem = this.countryList.children(".active");
  32174. this._highlightListItem(activeListItem);
  32175. // show it
  32176. this.countryList.removeClass("hide");
  32177. this._scrollTo(activeListItem);
  32178. // bind all the dropdown-related listeners: mouseover, click, click-off, keydown
  32179. this._bindDropdownListeners();
  32180. // update the arrow
  32181. this.selectedFlagInner.children(".arrow").addClass("up");
  32182. },
  32183. // decide where to position dropdown (depends on position within viewport, and scroll)
  32184. _setDropdownPosition: function() {
  32185. var inputTop = this.telInput.offset().top, windowTop = $(window).scrollTop(), // dropdownFitsBelow = (dropdownBottom < windowBottom)
  32186. dropdownFitsBelow = inputTop + this.telInput.outerHeight() + this.dropdownHeight < windowTop + $(window).height(), dropdownFitsAbove = inputTop - this.dropdownHeight > windowTop;
  32187. // dropdownHeight - 1 for border
  32188. var cssTop = !dropdownFitsBelow && dropdownFitsAbove ? "-" + (this.dropdownHeight - 1) + "px" : "";
  32189. this.countryList.css("top", cssTop);
  32190. },
  32191. // we only bind dropdown listeners when the dropdown is open
  32192. _bindDropdownListeners: function() {
  32193. var that = this;
  32194. // when mouse over a list item, just highlight that one
  32195. // we add the class "highlight", so if they hit "enter" we know which one to select
  32196. this.countryList.on("mouseover" + this.ns, ".country", function(e) {
  32197. that._highlightListItem($(this));
  32198. });
  32199. // listen for country selection
  32200. this.countryList.on("click" + this.ns, ".country", function(e) {
  32201. that._selectListItem($(this));
  32202. });
  32203. // click off to close
  32204. // (except when this initial opening click is bubbling up)
  32205. // we cannot just stopPropagation as it may be needed to close another instance
  32206. var isOpening = true;
  32207. $("html").on("click" + this.ns, function(e) {
  32208. if (!isOpening) {
  32209. that._closeDropdown();
  32210. }
  32211. isOpening = false;
  32212. });
  32213. // listen for up/down scrolling, enter to select, or letters to jump to country name.
  32214. // use keydown as keypress doesn't fire for non-char keys and we want to catch if they
  32215. // just hit down and hold it to scroll down (no keyup event).
  32216. // listen on the document because that's where key events are triggered if no input has focus
  32217. var query = "", queryTimer = null;
  32218. $(document).on("keydown" + this.ns, function(e) {
  32219. // prevent down key from scrolling the whole page,
  32220. // and enter key from submitting a form etc
  32221. e.preventDefault();
  32222. if (e.which == keys.UP || e.which == keys.DOWN) {
  32223. // up and down to navigate
  32224. that._handleUpDownKey(e.which);
  32225. } else if (e.which == keys.ENTER) {
  32226. // enter to select
  32227. that._handleEnterKey();
  32228. } else if (e.which == keys.ESC) {
  32229. // esc to close
  32230. that._closeDropdown();
  32231. } else if (e.which >= keys.A && e.which <= keys.Z || e.which == keys.SPACE) {
  32232. // upper case letters (note: keyup/keydown only return upper case letters)
  32233. // jump to countries that start with the query string
  32234. if (queryTimer) {
  32235. clearTimeout(queryTimer);
  32236. }
  32237. query += String.fromCharCode(e.which);
  32238. that._searchForCountry(query);
  32239. // if the timer hits 1 second, reset the query
  32240. queryTimer = setTimeout(function() {
  32241. query = "";
  32242. }, 1e3);
  32243. }
  32244. });
  32245. },
  32246. // highlight the next/prev item in the list (and ensure it is visible)
  32247. _handleUpDownKey: function(key) {
  32248. var current = this.countryList.children(".highlight").first();
  32249. var next = key == keys.UP ? current.prev() : current.next();
  32250. if (next.length) {
  32251. // skip the divider
  32252. if (next.hasClass("divider")) {
  32253. next = key == keys.UP ? next.prev() : next.next();
  32254. }
  32255. this._highlightListItem(next);
  32256. this._scrollTo(next);
  32257. }
  32258. },
  32259. // select the currently highlighted item
  32260. _handleEnterKey: function() {
  32261. var currentCountry = this.countryList.children(".highlight").first();
  32262. if (currentCountry.length) {
  32263. this._selectListItem(currentCountry);
  32264. }
  32265. },
  32266. // find the first list item whose name starts with the query string
  32267. _searchForCountry: function(query) {
  32268. for (var i = 0; i < this.countries.length; i++) {
  32269. if (this._startsWith(this.countries[i].name, query)) {
  32270. var listItem = this.countryList.children("[data-country-code=" + this.countries[i].iso2 + "]").not(".preferred");
  32271. // update highlighting and scroll
  32272. this._highlightListItem(listItem);
  32273. this._scrollTo(listItem, true);
  32274. break;
  32275. }
  32276. }
  32277. },
  32278. // check if (uppercase) string a starts with string b
  32279. _startsWith: function(a, b) {
  32280. return a.substr(0, b.length).toUpperCase() == b;
  32281. },
  32282. // update the input's value to the given val
  32283. // if autoFormat=true, format it first according to the country-specific formatting rules
  32284. _updateVal: function(val, addSuffix) {
  32285. var formatted;
  32286. if (this.options.autoFormat && window.intlTelInputUtils) {
  32287. formatted = intlTelInputUtils.formatNumber(val, this.selectedCountryData.iso2, addSuffix, this.options.preventInvalidNumbers);
  32288. // ensure we dont go over maxlength. we must do this here to truncate any formatting suffix, and also handle paste events
  32289. var max = this.telInput.attr("maxlength");
  32290. if (max && formatted.length > max) {
  32291. formatted = formatted.substr(0, max);
  32292. }
  32293. } else {
  32294. // no autoFormat, so just insert the original value
  32295. formatted = val;
  32296. }
  32297. this.telInput.val(formatted);
  32298. },
  32299. // check if need to select a new flag based on the given number
  32300. _updateFlagFromNumber: function(number) {
  32301. // if we're in nationalMode and we're on US/Canada, make sure the number starts with a +1 so _getDialCode will be able to extract the area code
  32302. // update: if we dont yet have selectedCountryData, but we're here (trying to update the flag from the number), that means we're initialising the plugin with a number that already has a dial code, so fine to ignore this bit
  32303. if (this.options.nationalMode && this.selectedCountryData && this.selectedCountryData.dialCode == "1" && number.substr(0, 1) != "+") {
  32304. number = "+1" + number;
  32305. }
  32306. // try and extract valid dial code from input
  32307. var dialCode = this._getDialCode(number);
  32308. if (dialCode) {
  32309. // check if one of the matching countries is already selected
  32310. var countryCodes = this.countryCodes[this._getNumeric(dialCode)], alreadySelected = false;
  32311. if (this.selectedCountryData) {
  32312. for (var i = 0; i < countryCodes.length; i++) {
  32313. if (countryCodes[i] == this.selectedCountryData.iso2) {
  32314. alreadySelected = true;
  32315. }
  32316. }
  32317. }
  32318. // if a matching country is not already selected (or this is an unknown NANP area code): choose the first in the list
  32319. if (!alreadySelected || this._isUnknownNanp(number, dialCode)) {
  32320. // if using onlyCountries option, countryCodes[0] may be empty, so we must find the first non-empty index
  32321. for (var j = 0; j < countryCodes.length; j++) {
  32322. if (countryCodes[j]) {
  32323. this._selectFlag(countryCodes[j]);
  32324. break;
  32325. }
  32326. }
  32327. }
  32328. }
  32329. },
  32330. // check if the given number contains an unknown area code from the North American Numbering Plan i.e. the only dialCode that could be extracted was +1 but the actual number's length is >=4
  32331. _isUnknownNanp: function(number, dialCode) {
  32332. return dialCode == "+1" && this._getNumeric(number).length >= 4;
  32333. },
  32334. // remove highlighting from other list items and highlight the given item
  32335. _highlightListItem: function(listItem) {
  32336. this.countryListItems.removeClass("highlight");
  32337. listItem.addClass("highlight");
  32338. },
  32339. // find the country data for the given country code
  32340. // the ignoreOnlyCountriesOption is only used during init() while parsing the onlyCountries array
  32341. _getCountryData: function(countryCode, ignoreOnlyCountriesOption, allowFail) {
  32342. var countryList = ignoreOnlyCountriesOption ? allCountries : this.countries;
  32343. for (var i = 0; i < countryList.length; i++) {
  32344. if (countryList[i].iso2 == countryCode) {
  32345. return countryList[i];
  32346. }
  32347. }
  32348. if (allowFail) {
  32349. return null;
  32350. } else {
  32351. throw new Error("No country data for '" + countryCode + "'");
  32352. }
  32353. },
  32354. // select the given flag, update the placeholder and the active list item
  32355. _selectFlag: function(countryCode) {
  32356. // do this first as it will throw an error and stop if countryCode is invalid
  32357. this.selectedCountryData = this._getCountryData(countryCode, false, false);
  32358. this.selectedFlagInner.attr("class", "iti-flag " + countryCode);
  32359. // update the selected country's title attribute
  32360. var title = this.selectedCountryData.name + ": +" + this.selectedCountryData.dialCode;
  32361. this.selectedFlagInner.parent().attr("title", title);
  32362. // and the input's placeholder
  32363. this._updatePlaceholder();
  32364. // update the active list item
  32365. var listItem = this.countryListItems.children(".iti-flag." + countryCode).first().parent();
  32366. this.countryListItems.removeClass("active");
  32367. listItem.addClass("active");
  32368. },
  32369. // update the input placeholder to an example number from the currently selected country
  32370. _updatePlaceholder: function() {
  32371. if (window.intlTelInputUtils && !this.hadInitialPlaceholder) {
  32372. var iso2 = this.selectedCountryData.iso2, numberType = intlTelInputUtils.numberType[this.options.numberType || "FIXED_LINE"], placeholder = intlTelInputUtils.getExampleNumber(iso2, this.options.nationalMode, numberType);
  32373. this.telInput.attr("placeholder", placeholder);
  32374. }
  32375. },
  32376. // called when the user selects a list item from the dropdown
  32377. _selectListItem: function(listItem) {
  32378. // update selected flag and active list item
  32379. var countryCode = listItem.attr("data-country-code");
  32380. this._selectFlag(countryCode);
  32381. this._closeDropdown();
  32382. this._updateDialCode(listItem.attr("data-dial-code"), true);
  32383. // always fire the change event as even if nationalMode=true (and we haven't updated the input val), the system as a whole has still changed - see country-sync example. think of it as making a selection from a select element.
  32384. this.telInput.trigger("change");
  32385. // focus the input
  32386. this.telInput.focus();
  32387. },
  32388. // close the dropdown and unbind any listeners
  32389. _closeDropdown: function() {
  32390. this.countryList.addClass("hide");
  32391. // update the arrow
  32392. this.selectedFlagInner.children(".arrow").removeClass("up");
  32393. // unbind key events
  32394. $(document).off(this.ns);
  32395. // unbind click-off-to-close
  32396. $("html").off(this.ns);
  32397. // unbind hover and click listeners
  32398. this.countryList.off(this.ns);
  32399. },
  32400. // check if an element is visible within it's container, else scroll until it is
  32401. _scrollTo: function(element, middle) {
  32402. var container = this.countryList, containerHeight = container.height(), containerTop = container.offset().top, containerBottom = containerTop + containerHeight, elementHeight = element.outerHeight(), elementTop = element.offset().top, elementBottom = elementTop + elementHeight, newScrollTop = elementTop - containerTop + container.scrollTop(), middleOffset = containerHeight / 2 - elementHeight / 2;
  32403. if (elementTop < containerTop) {
  32404. // scroll up
  32405. if (middle) {
  32406. newScrollTop -= middleOffset;
  32407. }
  32408. container.scrollTop(newScrollTop);
  32409. } else if (elementBottom > containerBottom) {
  32410. // scroll down
  32411. if (middle) {
  32412. newScrollTop += middleOffset;
  32413. }
  32414. var heightDifference = containerHeight - elementHeight;
  32415. container.scrollTop(newScrollTop - heightDifference);
  32416. }
  32417. },
  32418. // replace any existing dial code with the new one (if not in nationalMode)
  32419. // also we need to know if we're focusing for a couple of reasons e.g. if so, we want to add any formatting suffix, also if the input is empty and we're not in nationalMode, then we want to insert the dial code
  32420. _updateDialCode: function(newDialCode, focusing) {
  32421. var inputVal = this.telInput.val(), newNumber;
  32422. // save having to pass this every time
  32423. newDialCode = "+" + newDialCode;
  32424. if (this.options.nationalMode && inputVal.substr(0, 1) != "+") {
  32425. // if nationalMode, we just want to re-format
  32426. newNumber = inputVal;
  32427. } else if (inputVal) {
  32428. // if the previous number contained a valid dial code, replace it
  32429. // (if more than just a plus character)
  32430. var prevDialCode = this._getDialCode(inputVal);
  32431. if (prevDialCode.length > 1) {
  32432. newNumber = inputVal.replace(prevDialCode, newDialCode);
  32433. } else {
  32434. // if the previous number didn't contain a dial code, we should persist it
  32435. var existingNumber = inputVal.substr(0, 1) != "+" ? $.trim(inputVal) : "";
  32436. newNumber = newDialCode + existingNumber;
  32437. }
  32438. } else {
  32439. newNumber = !this.options.autoHideDialCode || focusing ? newDialCode : "";
  32440. }
  32441. this._updateVal(newNumber, focusing);
  32442. },
  32443. // try and extract a valid international dial code from a full telephone number
  32444. // Note: returns the raw string inc plus character and any whitespace/dots etc
  32445. _getDialCode: function(number) {
  32446. var dialCode = "";
  32447. // only interested in international numbers (starting with a plus)
  32448. if (number.charAt(0) == "+") {
  32449. var numericChars = "";
  32450. // iterate over chars
  32451. for (var i = 0; i < number.length; i++) {
  32452. var c = number.charAt(i);
  32453. // if char is number
  32454. if ($.isNumeric(c)) {
  32455. numericChars += c;
  32456. // if current numericChars make a valid dial code
  32457. if (this.countryCodes[numericChars]) {
  32458. // store the actual raw string (useful for matching later)
  32459. dialCode = number.substr(0, i + 1);
  32460. }
  32461. // longest dial code is 4 chars
  32462. if (numericChars.length == 4) {
  32463. break;
  32464. }
  32465. }
  32466. }
  32467. }
  32468. return dialCode;
  32469. },
  32470. /********************
  32471. * PUBLIC METHODS
  32472. ********************/
  32473. // remove plugin
  32474. destroy: function() {
  32475. // make sure the dropdown is closed (and unbind listeners)
  32476. this._closeDropdown();
  32477. // key events, and focus/blur events if autoHideDialCode=true
  32478. this.telInput.off(this.ns);
  32479. // click event to open dropdown
  32480. this.selectedFlagInner.parent().off(this.ns);
  32481. // label click hack
  32482. this.telInput.closest("label").off(this.ns);
  32483. // remove markup
  32484. var container = this.telInput.parent();
  32485. container.before(this.telInput).remove();
  32486. },
  32487. // format the number to the given type
  32488. getNumber: function(type) {
  32489. if (window.intlTelInputUtils) {
  32490. return intlTelInputUtils.formatNumberByType(this.telInput.val(), this.selectedCountryData.iso2, type);
  32491. }
  32492. return "";
  32493. },
  32494. // get the type of the entered number e.g. landline/mobile
  32495. getNumberType: function() {
  32496. if (window.intlTelInputUtils) {
  32497. return intlTelInputUtils.getNumberType(this.telInput.val(), this.selectedCountryData.iso2);
  32498. }
  32499. return -99;
  32500. },
  32501. // get the country data for the currently selected flag
  32502. getSelectedCountryData: function() {
  32503. // if this is undefined, the plugin will return it's instance instead, so in that case an empty object makes more sense
  32504. return this.selectedCountryData || {};
  32505. },
  32506. // get the validation error
  32507. getValidationError: function() {
  32508. if (window.intlTelInputUtils) {
  32509. return intlTelInputUtils.getValidationError(this.telInput.val(), this.selectedCountryData.iso2);
  32510. }
  32511. return -99;
  32512. },
  32513. // validate the input val - assumes the global function isValidNumber (from utilsScript)
  32514. isValidNumber: function() {
  32515. var val = $.trim(this.telInput.val()), countryCode = this.options.nationalMode ? this.selectedCountryData.iso2 : "", // libphonenumber allows alpha chars, but in order to allow that, we'd need a method to retrieve the processed number, with letters replaced with numbers
  32516. containsAlpha = /[a-zA-Z]/.test(val);
  32517. if (!containsAlpha && window.intlTelInputUtils) {
  32518. return intlTelInputUtils.isValidNumber(val, countryCode);
  32519. }
  32520. return false;
  32521. },
  32522. // load the utils script
  32523. loadUtils: function(path) {
  32524. var utilsScript = path || this.options.utilsScript;
  32525. if (!$.fn[pluginName].loadedUtilsScript && utilsScript) {
  32526. // don't do this twice! (dont just check if the global intlTelInputUtils exists as if init plugin multiple times in quick succession, it may not have finished loading yet)
  32527. $.fn[pluginName].loadedUtilsScript = true;
  32528. // dont use $.getScript as it prevents caching
  32529. $.ajax({
  32530. url: utilsScript,
  32531. success: function() {
  32532. // tell all instances the utils are ready
  32533. $(".intl-tel-input input").intlTelInput("utilsLoaded");
  32534. },
  32535. dataType: "script",
  32536. cache: true
  32537. });
  32538. }
  32539. },
  32540. // update the selected flag, and update the input val accordingly
  32541. selectCountry: function(countryCode) {
  32542. // check if already selected
  32543. if (!this.selectedFlagInner.hasClass(countryCode)) {
  32544. this._selectFlag(countryCode);
  32545. this._updateDialCode(this.selectedCountryData.dialCode, false);
  32546. }
  32547. },
  32548. // set the input value and update the flag
  32549. setNumber: function(number, addSuffix) {
  32550. // ensure starts with plus
  32551. if (!this.options.nationalMode && number.substr(0, 1) != "+") {
  32552. number = "+" + number;
  32553. }
  32554. // we must update the flag first, which updates this.selectedCountryData, which is used later for formatting the number before displaying it
  32555. this._updateFlagFromNumber(number);
  32556. this._updateVal(number, addSuffix);
  32557. },
  32558. // this is called when the utils are ready
  32559. utilsLoaded: function() {
  32560. // if autoFormat is enabled and there's an initial value in the input, then format it
  32561. if (this.options.autoFormat && this.telInput.val()) {
  32562. this._updateVal(this.telInput.val());
  32563. }
  32564. this._updatePlaceholder();
  32565. }
  32566. };
  32567. // adapted to allow public functions
  32568. // using https://github.com/jquery-boilerplate/jquery-boilerplate/wiki/Extending-jQuery-Boilerplate
  32569. $.fn[pluginName] = function(options) {
  32570. var args = arguments;
  32571. // Is the first parameter an object (options), or was omitted,
  32572. // instantiate a new instance of the plugin.
  32573. if (options === undefined || typeof options === "object") {
  32574. return this.each(function() {
  32575. if (!$.data(this, "plugin_" + pluginName)) {
  32576. $.data(this, "plugin_" + pluginName, new Plugin(this, options));
  32577. }
  32578. });
  32579. } else if (typeof options === "string" && options[0] !== "_" && options !== "init") {
  32580. // If the first parameter is a string and it doesn't start
  32581. // with an underscore or "contains" the `init`-function,
  32582. // treat this as a call to a public method.
  32583. // Cache the method call to make it possible to return a value
  32584. var returns;
  32585. this.each(function() {
  32586. var instance = $.data(this, "plugin_" + pluginName);
  32587. // Tests that there's already a plugin-instance
  32588. // and checks that the requested public method exists
  32589. if (instance instanceof Plugin && typeof instance[options] === "function") {
  32590. // Call the method of our plugin instance,
  32591. // and pass it the supplied arguments.
  32592. returns = instance[options].apply(instance, Array.prototype.slice.call(args, 1));
  32593. }
  32594. // Allow instances to be destroyed via the 'destroy' method
  32595. if (options === "destroy") {
  32596. $.data(this, "plugin_" + pluginName, null);
  32597. }
  32598. });
  32599. // If the earlier cached method gives a value back return the value,
  32600. // otherwise return this to preserve chainability.
  32601. return returns !== undefined ? returns : this;
  32602. }
  32603. };
  32604. /********************
  32605. * STATIC METHODS
  32606. ********************/
  32607. // get the country data object
  32608. $.fn[pluginName].getCountryData = function() {
  32609. return allCountries;
  32610. };
  32611. // Tell JSHint to ignore this warning: "character may get silently deleted by one or more browsers"
  32612. // jshint -W100
  32613. // Array of country objects for the flag dropdown.
  32614. // Each contains a name, country code (ISO 3166-1 alpha-2) and dial code.
  32615. // Originally from https://github.com/mledoze/countries
  32616. // then modified using the following JavaScript (NOW OUT OF DATE):
  32617. /*
  32618. var result = [];
  32619. _.each(countries, function(c) {
  32620. // ignore countries without a dial code
  32621. if (c.callingCode[0].length) {
  32622. result.push({
  32623. // var locals contains country names with localised versions in brackets
  32624. n: _.findWhere(locals, {
  32625. countryCode: c.cca2
  32626. }).name,
  32627. i: c.cca2.toLowerCase(),
  32628. d: c.callingCode[0]
  32629. });
  32630. }
  32631. });
  32632. JSON.stringify(result);
  32633. */
  32634. // then with a couple of manual re-arrangements to be alphabetical
  32635. // then changed Kazakhstan from +76 to +7
  32636. // and Vatican City from +379 to +39 (see issue 50)
  32637. // and Caribean Netherlands from +5997 to +599
  32638. // and Curacao from +5999 to +599
  32639. // Removed: Åland Islands, Christmas Island, Cocos Islands, Guernsey, Isle of Man, Jersey, Kosovo, Mayotte, Pitcairn Islands, South Georgia, Svalbard, Western Sahara
  32640. // Update: converted objects to arrays to save bytes!
  32641. // Update: added "priority" for countries with the same dialCode as others
  32642. // Update: added array of area codes for countries with the same dialCode as others
  32643. // So each country array has the following information:
  32644. // [
  32645. // Country name,
  32646. // iso2 code,
  32647. // International dial code,
  32648. // Order (if >1 country with same dial code),
  32649. // Area codes (if >1 country with same dial code)
  32650. // ]
  32651. var allCountries = [ [ "Afghanistan (‫افغانستان‬‎)", "af", "93" ], [ "Albania (Shqipëri)", "al", "355" ], [ "Algeria (‫الجزائر‬‎)", "dz", "213" ], [ "American Samoa", "as", "1684" ], [ "Andorra", "ad", "376" ], [ "Angola", "ao", "244" ], [ "Anguilla", "ai", "1264" ], [ "Antigua and Barbuda", "ag", "1268" ], [ "Argentina", "ar", "54" ], [ "Armenia (Հայաստան)", "am", "374" ], [ "Aruba", "aw", "297" ], [ "Australia", "au", "61" ], [ "Austria (Österreich)", "at", "43" ], [ "Azerbaijan (Azərbaycan)", "az", "994" ], [ "Bahamas", "bs", "1242" ], [ "Bahrain (‫البحرين‬‎)", "bh", "973" ], [ "Bangladesh (বাংলাদেশ)", "bd", "880" ], [ "Barbados", "bb", "1246" ], [ "Belarus (Беларусь)", "by", "375" ], [ "Belgium (België)", "be", "32" ], [ "Belize", "bz", "501" ], [ "Benin (Bénin)", "bj", "229" ], [ "Bermuda", "bm", "1441" ], [ "Bhutan (འབྲུག)", "bt", "975" ], [ "Bolivia", "bo", "591" ], [ "Bosnia and Herzegovina (Босна и Херцеговина)", "ba", "387" ], [ "Botswana", "bw", "267" ], [ "Brazil (Brasil)", "br", "55" ], [ "British Indian Ocean Territory", "io", "246" ], [ "British Virgin Islands", "vg", "1284" ], [ "Brunei", "bn", "673" ], [ "Bulgaria (България)", "bg", "359" ], [ "Burkina Faso", "bf", "226" ], [ "Burundi (Uburundi)", "bi", "257" ], [ "Cambodia (កម្ពុជា)", "kh", "855" ], [ "Cameroon (Cameroun)", "cm", "237" ], [ "Canada", "ca", "1", 1, [ "204", "226", "236", "249", "250", "289", "306", "343", "365", "387", "403", "416", "418", "431", "437", "438", "450", "506", "514", "519", "548", "579", "581", "587", "604", "613", "639", "647", "672", "705", "709", "742", "778", "780", "782", "807", "819", "825", "867", "873", "902", "905" ] ], [ "Cape Verde (Kabu Verdi)", "cv", "238" ], [ "Caribbean Netherlands", "bq", "599", 1 ], [ "Cayman Islands", "ky", "1345" ], [ "Central African Republic (République centrafricaine)", "cf", "236" ], [ "Chad (Tchad)", "td", "235" ], [ "Chile", "cl", "56" ], [ "China (中国)", "cn", "86" ], [ "Colombia", "co", "57" ], [ "Comoros (‫جزر القمر‬‎)", "km", "269" ], [ "Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)", "cd", "243" ], [ "Congo (Republic) (Congo-Brazzaville)", "cg", "242" ], [ "Cook Islands", "ck", "682" ], [ "Costa Rica", "cr", "506" ], [ "Côte d’Ivoire", "ci", "225" ], [ "Croatia (Hrvatska)", "hr", "385" ], [ "Cuba", "cu", "53" ], [ "Curaçao", "cw", "599", 0 ], [ "Cyprus (Κύπρος)", "cy", "357" ], [ "Czech Republic (Česká republika)", "cz", "420" ], [ "Denmark (Danmark)", "dk", "45" ], [ "Djibouti", "dj", "253" ], [ "Dominica", "dm", "1767" ], [ "Dominican Republic (República Dominicana)", "do", "1", 2, [ "809", "829", "849" ] ], [ "Ecuador", "ec", "593" ], [ "Egypt (‫مصر‬‎)", "eg", "20" ], [ "El Salvador", "sv", "503" ], [ "Equatorial Guinea (Guinea Ecuatorial)", "gq", "240" ], [ "Eritrea", "er", "291" ], [ "Estonia (Eesti)", "ee", "372" ], [ "Ethiopia", "et", "251" ], [ "Falkland Islands (Islas Malvinas)", "fk", "500" ], [ "Faroe Islands (Føroyar)", "fo", "298" ], [ "Fiji", "fj", "679" ], [ "Finland (Suomi)", "fi", "358" ], [ "France", "fr", "33" ], [ "French Guiana (Guyane française)", "gf", "594" ], [ "French Polynesia (Polynésie française)", "pf", "689" ], [ "Gabon", "ga", "241" ], [ "Gambia", "gm", "220" ], [ "Georgia (საქართველო)", "ge", "995" ], [ "Germany (Deutschland)", "de", "49" ], [ "Ghana (Gaana)", "gh", "233" ], [ "Gibraltar", "gi", "350" ], [ "Greece (Ελλάδα)", "gr", "30" ], [ "Greenland (Kalaallit Nunaat)", "gl", "299" ], [ "Grenada", "gd", "1473" ], [ "Guadeloupe", "gp", "590", 0 ], [ "Guam", "gu", "1671" ], [ "Guatemala", "gt", "502" ], [ "Guinea (Guinée)", "gn", "224" ], [ "Guinea-Bissau (Guiné Bissau)", "gw", "245" ], [ "Guyana", "gy", "592" ], [ "Haiti", "ht", "509" ], [ "Honduras", "hn", "504" ], [ "Hong Kong (香港)", "hk", "852" ], [ "Hungary (Magyarország)", "hu", "36" ], [ "Iceland (Ísland)", "is", "354" ], [ "India (भारत)", "in", "91" ], [ "Indonesia", "id", "62" ], [ "Iran (‫ایران‬‎)", "ir", "98" ], [ "Iraq (‫العراق‬‎)", "iq", "964" ], [ "Ireland", "ie", "353" ], [ "Israel (‫ישראל‬‎)", "il", "972" ], [ "Italy (Italia)", "it", "39", 0 ], [ "Jamaica", "jm", "1876" ], [ "Japan (日本)", "jp", "81" ], [ "Jordan (‫الأردن‬‎)", "jo", "962" ], [ "Kazakhstan (Казахстан)", "kz", "7", 1 ], [ "Kenya", "ke", "254" ], [ "Kiribati", "ki", "686" ], [ "Kuwait (‫الكويت‬‎)", "kw", "965" ], [ "Kyrgyzstan (Кыргызстан)", "kg", "996" ], [ "Laos (ລາວ)", "la", "856" ], [ "Latvia (Latvija)", "lv", "371" ], [ "Lebanon (‫لبنان‬‎)", "lb", "961" ], [ "Lesotho", "ls", "266" ], [ "Liberia", "lr", "231" ], [ "Libya (‫ليبيا‬‎)", "ly", "218" ], [ "Liechtenstein", "li", "423" ], [ "Lithuania (Lietuva)", "lt", "370" ], [ "Luxembourg", "lu", "352" ], [ "Macau (澳門)", "mo", "853" ], [ "Macedonia (FYROM) (Македонија)", "mk", "389" ], [ "Madagascar (Madagasikara)", "mg", "261" ], [ "Malawi", "mw", "265" ], [ "Malaysia", "my", "60" ], [ "Maldives", "mv", "960" ], [ "Mali", "ml", "223" ], [ "Malta", "mt", "356" ], [ "Marshall Islands", "mh", "692" ], [ "Martinique", "mq", "596" ], [ "Mauritania (‫موريتانيا‬‎)", "mr", "222" ], [ "Mauritius (Moris)", "mu", "230" ], [ "Mexico (México)", "mx", "52" ], [ "Micronesia", "fm", "691" ], [ "Moldova (Republica Moldova)", "md", "373" ], [ "Monaco", "mc", "377" ], [ "Mongolia (Монгол)", "mn", "976" ], [ "Montenegro (Crna Gora)", "me", "382" ], [ "Montserrat", "ms", "1664" ], [ "Morocco (‫المغرب‬‎)", "ma", "212" ], [ "Mozambique (Moçambique)", "mz", "258" ], [ "Myanmar (Burma) (မြန်မာ)", "mm", "95" ], [ "Namibia (Namibië)", "na", "264" ], [ "Nauru", "nr", "674" ], [ "Nepal (नेपाल)", "np", "977" ], [ "Netherlands (Nederland)", "nl", "31" ], [ "New Caledonia (Nouvelle-Calédonie)", "nc", "687" ], [ "New Zealand", "nz", "64" ], [ "Nicaragua", "ni", "505" ], [ "Niger (Nijar)", "ne", "227" ], [ "Nigeria", "ng", "234" ], [ "Niue", "nu", "683" ], [ "Norfolk Island", "nf", "672" ], [ "North Korea (조선 민주주의 인민 공화국)", "kp", "850" ], [ "Northern Mariana Islands", "mp", "1670" ], [ "Norway (Norge)", "no", "47" ], [ "Oman (‫عُمان‬‎)", "om", "968" ], [ "Pakistan (‫پاکستان‬‎)", "pk", "92" ], [ "Palau", "pw", "680" ], [ "Palestine (‫فلسطين‬‎)", "ps", "970" ], [ "Panama (Panamá)", "pa", "507" ], [ "Papua New Guinea", "pg", "675" ], [ "Paraguay", "py", "595" ], [ "Peru (Perú)", "pe", "51" ], [ "Philippines", "ph", "63" ], [ "Poland (Polska)", "pl", "48" ], [ "Portugal", "pt", "351" ], [ "Puerto Rico", "pr", "1", 3, [ "787", "939" ] ], [ "Qatar (‫قطر‬‎)", "qa", "974" ], [ "Réunion (La Réunion)", "re", "262" ], [ "Romania (România)", "ro", "40" ], [ "Russia (Россия)", "ru", "7", 0 ], [ "Rwanda", "rw", "250" ], [ "Saint Barthélemy (Saint-Barthélemy)", "bl", "590", 1 ], [ "Saint Helena", "sh", "290" ], [ "Saint Kitts and Nevis", "kn", "1869" ], [ "Saint Lucia", "lc", "1758" ], [ "Saint Martin (Saint-Martin (partie française))", "mf", "590", 2 ], [ "Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)", "pm", "508" ], [ "Saint Vincent and the Grenadines", "vc", "1784" ], [ "Samoa", "ws", "685" ], [ "San Marino", "sm", "378" ], [ "São Tomé and Príncipe (São Tomé e Príncipe)", "st", "239" ], [ "Saudi Arabia (‫المملكة العربية السعودية‬‎)", "sa", "966" ], [ "Senegal (Sénégal)", "sn", "221" ], [ "Serbia (Србија)", "rs", "381" ], [ "Seychelles", "sc", "248" ], [ "Sierra Leone", "sl", "232" ], [ "Singapore", "sg", "65" ], [ "Sint Maarten", "sx", "1721" ], [ "Slovakia (Slovensko)", "sk", "421" ], [ "Slovenia (Slovenija)", "si", "386" ], [ "Solomon Islands", "sb", "677" ], [ "Somalia (Soomaaliya)", "so", "252" ], [ "South Africa", "za", "27" ], [ "South Korea (대한민국)", "kr", "82" ], [ "South Sudan (‫جنوب السودان‬‎)", "ss", "211" ], [ "Spain (España)", "es", "34" ], [ "Sri Lanka (ශ්‍රී ලංකාව)", "lk", "94" ], [ "Sudan (‫السودان‬‎)", "sd", "249" ], [ "Suriname", "sr", "597" ], [ "Swaziland", "sz", "268" ], [ "Sweden (Sverige)", "se", "46" ], [ "Switzerland (Schweiz)", "ch", "41" ], [ "Syria (‫سوريا‬‎)", "sy", "963" ], [ "Taiwan (台灣)", "tw", "886" ], [ "Tajikistan", "tj", "992" ], [ "Tanzania", "tz", "255" ], [ "Thailand (ไทย)", "th", "66" ], [ "Timor-Leste", "tl", "670" ], [ "Togo", "tg", "228" ], [ "Tokelau", "tk", "690" ], [ "Tonga", "to", "676" ], [ "Trinidad and Tobago", "tt", "1868" ], [ "Tunisia (‫تونس‬‎)", "tn", "216" ], [ "Turkey (Türkiye)", "tr", "90" ], [ "Turkmenistan", "tm", "993" ], [ "Turks and Caicos Islands", "tc", "1649" ], [ "Tuvalu", "tv", "688" ], [ "U.S. Virgin Islands", "vi", "1340" ], [ "Uganda", "ug", "256" ], [ "Ukraine (Україна)", "ua", "380" ], [ "United Arab Emirates (‫الإمارات العربية المتحدة‬‎)", "ae", "971" ], [ "United Kingdom", "gb", "44" ], [ "United States", "us", "1", 0 ], [ "Uruguay", "uy", "598" ], [ "Uzbekistan (Oʻzbekiston)", "uz", "998" ], [ "Vanuatu", "vu", "678" ], [ "Vatican City (Città del Vaticano)", "va", "39", 1 ], [ "Venezuela", "ve", "58" ], [ "Vietnam (Việt Nam)", "vn", "84" ], [ "Wallis and Futuna", "wf", "681" ], [ "Yemen (‫اليمن‬‎)", "ye", "967" ], [ "Zambia", "zm", "260" ], [ "Zimbabwe", "zw", "263" ] ];
  32652. // loop over all of the countries above
  32653. for (var i = 0; i < allCountries.length; i++) {
  32654. var c = allCountries[i];
  32655. allCountries[i] = {
  32656. name: c[0],
  32657. iso2: c[1],
  32658. dialCode: c[2],
  32659. priority: c[3] || 0,
  32660. areaCodes: c[4] || null
  32661. };
  32662. }
  32663. });
  32664. /*
  32665. * JavaScript Load Image 1.10.0
  32666. * https://github.com/blueimp/JavaScript-Load-Image
  32667. *
  32668. * Copyright 2011, Sebastian Tschan
  32669. * https://blueimp.net
  32670. *
  32671. * Licensed under the MIT license:
  32672. * http://www.opensource.org/licenses/MIT
  32673. */
  32674. /*jslint nomen: true */
  32675. /*global define, window, document, URL, webkitURL, Blob, File, FileReader */
  32676. (function ($) {
  32677. 'use strict';
  32678. // Loads an image for a given File object.
  32679. // Invokes the callback with an img or optional canvas
  32680. // element (if supported by the browser) as parameter:
  32681. var loadImage = function (file, callback, options) {
  32682. var img = document.createElement('img'),
  32683. url,
  32684. oUrl;
  32685. img.onerror = callback;
  32686. img.onload = function () {
  32687. if (oUrl && !(options && options.noRevoke)) {
  32688. loadImage.revokeObjectURL(oUrl);
  32689. }
  32690. if (callback) {
  32691. callback(loadImage.scale(img, options));
  32692. }
  32693. };
  32694. if (loadImage.isInstanceOf('Blob', file) ||
  32695. // Files are also Blob instances, but some browsers
  32696. // (Firefox 3.6) support the File API but not Blobs:
  32697. loadImage.isInstanceOf('File', file)) {
  32698. url = oUrl = loadImage.createObjectURL(file);
  32699. // Store the file type for resize processing:
  32700. img._type = file.type;
  32701. } else if (typeof file === 'string') {
  32702. url = file;
  32703. if (options && options.crossOrigin) {
  32704. img.crossOrigin = options.crossOrigin;
  32705. }
  32706. } else {
  32707. return false;
  32708. }
  32709. if (url) {
  32710. img.src = url;
  32711. return img;
  32712. }
  32713. return loadImage.readFile(file, function (e) {
  32714. var target = e.target;
  32715. if (target && target.result) {
  32716. img.src = target.result;
  32717. } else {
  32718. if (callback) {
  32719. callback(e);
  32720. }
  32721. }
  32722. });
  32723. },
  32724. // The check for URL.revokeObjectURL fixes an issue with Opera 12,
  32725. // which provides URL.createObjectURL but doesn't properly implement it:
  32726. urlAPI = (window.createObjectURL && window) ||
  32727. (window.URL && URL.revokeObjectURL && URL) ||
  32728. (window.webkitURL && webkitURL);
  32729. loadImage.isInstanceOf = function (type, obj) {
  32730. // Cross-frame instanceof check
  32731. return Object.prototype.toString.call(obj) === '[object ' + type + ']';
  32732. };
  32733. // Transform image coordinates, allows to override e.g.
  32734. // the canvas orientation based on the orientation option,
  32735. // gets canvas, options passed as arguments:
  32736. loadImage.transformCoordinates = function () {
  32737. return;
  32738. };
  32739. // Returns transformed options, allows to override e.g.
  32740. // maxWidth, maxHeight and crop options based on the aspectRatio.
  32741. // gets img, options passed as arguments:
  32742. loadImage.getTransformedOptions = function (img, options) {
  32743. var aspectRatio = options.aspectRatio,
  32744. newOptions,
  32745. i,
  32746. width,
  32747. height;
  32748. if (!aspectRatio) {
  32749. return options;
  32750. }
  32751. newOptions = {};
  32752. for (i in options) {
  32753. if (options.hasOwnProperty(i)) {
  32754. newOptions[i] = options[i];
  32755. }
  32756. }
  32757. newOptions.crop = true;
  32758. width = img.naturalWidth || img.width;
  32759. height = img.naturalHeight || img.height;
  32760. if (width / height > aspectRatio) {
  32761. newOptions.maxWidth = height * aspectRatio;
  32762. newOptions.maxHeight = height;
  32763. } else {
  32764. newOptions.maxWidth = width;
  32765. newOptions.maxHeight = width / aspectRatio;
  32766. }
  32767. return newOptions;
  32768. };
  32769. // Canvas render method, allows to override the
  32770. // rendering e.g. to work around issues on iOS:
  32771. loadImage.renderImageToCanvas = function (
  32772. canvas,
  32773. img,
  32774. sourceX,
  32775. sourceY,
  32776. sourceWidth,
  32777. sourceHeight,
  32778. destX,
  32779. destY,
  32780. destWidth,
  32781. destHeight
  32782. ) {
  32783. canvas.getContext('2d').drawImage(
  32784. img,
  32785. sourceX,
  32786. sourceY,
  32787. sourceWidth,
  32788. sourceHeight,
  32789. destX,
  32790. destY,
  32791. destWidth,
  32792. destHeight
  32793. );
  32794. return canvas;
  32795. };
  32796. // This method is used to determine if the target image
  32797. // should be a canvas element:
  32798. loadImage.hasCanvasOption = function (options) {
  32799. return options.canvas || options.crop || options.aspectRatio;
  32800. };
  32801. // Scales and/or crops the given image (img or canvas HTML element)
  32802. // using the given options.
  32803. // Returns a canvas object if the browser supports canvas
  32804. // and the hasCanvasOption method returns true or a canvas
  32805. // object is passed as image, else the scaled image:
  32806. loadImage.scale = function (img, options) {
  32807. options = options || {};
  32808. var canvas = document.createElement('canvas'),
  32809. useCanvas = img.getContext ||
  32810. (loadImage.hasCanvasOption(options) && canvas.getContext),
  32811. width = img.naturalWidth || img.width,
  32812. height = img.naturalHeight || img.height,
  32813. destWidth = width,
  32814. destHeight = height,
  32815. maxWidth,
  32816. maxHeight,
  32817. minWidth,
  32818. minHeight,
  32819. sourceWidth,
  32820. sourceHeight,
  32821. sourceX,
  32822. sourceY,
  32823. tmp,
  32824. scaleUp = function () {
  32825. var scale = Math.max(
  32826. (minWidth || destWidth) / destWidth,
  32827. (minHeight || destHeight) / destHeight
  32828. );
  32829. if (scale > 1) {
  32830. destWidth = destWidth * scale;
  32831. destHeight = destHeight * scale;
  32832. }
  32833. },
  32834. scaleDown = function () {
  32835. var scale = Math.min(
  32836. (maxWidth || destWidth) / destWidth,
  32837. (maxHeight || destHeight) / destHeight
  32838. );
  32839. if (scale < 1) {
  32840. destWidth = destWidth * scale;
  32841. destHeight = destHeight * scale;
  32842. }
  32843. };
  32844. if (useCanvas) {
  32845. options = loadImage.getTransformedOptions(img, options);
  32846. sourceX = options.left || 0;
  32847. sourceY = options.top || 0;
  32848. if (options.sourceWidth) {
  32849. sourceWidth = options.sourceWidth;
  32850. if (options.right !== undefined && options.left === undefined) {
  32851. sourceX = width - sourceWidth - options.right;
  32852. }
  32853. } else {
  32854. sourceWidth = width - sourceX - (options.right || 0);
  32855. }
  32856. if (options.sourceHeight) {
  32857. sourceHeight = options.sourceHeight;
  32858. if (options.bottom !== undefined && options.top === undefined) {
  32859. sourceY = height - sourceHeight - options.bottom;
  32860. }
  32861. } else {
  32862. sourceHeight = height - sourceY - (options.bottom || 0);
  32863. }
  32864. destWidth = sourceWidth;
  32865. destHeight = sourceHeight;
  32866. }
  32867. maxWidth = options.maxWidth;
  32868. maxHeight = options.maxHeight;
  32869. minWidth = options.minWidth;
  32870. minHeight = options.minHeight;
  32871. if (useCanvas && maxWidth && maxHeight && options.crop) {
  32872. destWidth = maxWidth;
  32873. destHeight = maxHeight;
  32874. tmp = sourceWidth / sourceHeight - maxWidth / maxHeight;
  32875. if (tmp < 0) {
  32876. sourceHeight = maxHeight * sourceWidth / maxWidth;
  32877. if (options.top === undefined && options.bottom === undefined) {
  32878. sourceY = (height - sourceHeight) / 2;
  32879. }
  32880. } else if (tmp > 0) {
  32881. sourceWidth = maxWidth * sourceHeight / maxHeight;
  32882. if (options.left === undefined && options.right === undefined) {
  32883. sourceX = (width - sourceWidth) / 2;
  32884. }
  32885. }
  32886. } else {
  32887. if (options.contain || options.cover) {
  32888. minWidth = maxWidth = maxWidth || minWidth;
  32889. minHeight = maxHeight = maxHeight || minHeight;
  32890. }
  32891. if (options.cover) {
  32892. scaleDown();
  32893. scaleUp();
  32894. } else {
  32895. scaleUp();
  32896. scaleDown();
  32897. }
  32898. }
  32899. if (useCanvas) {
  32900. canvas.width = destWidth;
  32901. canvas.height = destHeight;
  32902. loadImage.transformCoordinates(
  32903. canvas,
  32904. options
  32905. );
  32906. return loadImage.renderImageToCanvas(
  32907. canvas,
  32908. img,
  32909. sourceX,
  32910. sourceY,
  32911. sourceWidth,
  32912. sourceHeight,
  32913. 0,
  32914. 0,
  32915. destWidth,
  32916. destHeight
  32917. );
  32918. }
  32919. img.width = destWidth;
  32920. img.height = destHeight;
  32921. return img;
  32922. };
  32923. loadImage.createObjectURL = function (file) {
  32924. return urlAPI ? urlAPI.createObjectURL(file) : false;
  32925. };
  32926. loadImage.revokeObjectURL = function (url) {
  32927. return urlAPI ? urlAPI.revokeObjectURL(url) : false;
  32928. };
  32929. // Loads a given File object via FileReader interface,
  32930. // invokes the callback with the event object (load or error).
  32931. // The result can be read via event.target.result:
  32932. loadImage.readFile = function (file, callback, method) {
  32933. if (window.FileReader) {
  32934. var fileReader = new FileReader();
  32935. fileReader.onload = fileReader.onerror = callback;
  32936. method = method || 'readAsDataURL';
  32937. if (fileReader[method]) {
  32938. fileReader[method](file);
  32939. return fileReader;
  32940. }
  32941. }
  32942. return false;
  32943. };
  32944. if (typeof define === 'function' && define.amd) {
  32945. define(function () {
  32946. return loadImage;
  32947. });
  32948. } else {
  32949. $.loadImage = loadImage;
  32950. }
  32951. }(this));
  32952. /*
  32953. * JavaScript Canvas to Blob 2.0.5
  32954. * https://github.com/blueimp/JavaScript-Canvas-to-Blob
  32955. *
  32956. * Copyright 2012, Sebastian Tschan
  32957. * https://blueimp.net
  32958. *
  32959. * Licensed under the MIT license:
  32960. * http://www.opensource.org/licenses/MIT
  32961. *
  32962. * Based on stackoverflow user Stoive's code snippet:
  32963. * http://stackoverflow.com/q/4998908
  32964. */
  32965. /*jslint nomen: true, regexp: true */
  32966. /*global window, atob, Blob, ArrayBuffer, Uint8Array, define */
  32967. (function (window) {
  32968. 'use strict';
  32969. var CanvasPrototype = window.HTMLCanvasElement &&
  32970. window.HTMLCanvasElement.prototype,
  32971. hasBlobConstructor = window.Blob && (function () {
  32972. try {
  32973. return Boolean(new Blob());
  32974. } catch (e) {
  32975. return false;
  32976. }
  32977. }()),
  32978. hasArrayBufferViewSupport = hasBlobConstructor && window.Uint8Array &&
  32979. (function () {
  32980. try {
  32981. return new Blob([new Uint8Array(100)]).size === 100;
  32982. } catch (e) {
  32983. return false;
  32984. }
  32985. }()),
  32986. BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder ||
  32987. window.MozBlobBuilder || window.MSBlobBuilder,
  32988. dataURLtoBlob = (hasBlobConstructor || BlobBuilder) && window.atob &&
  32989. window.ArrayBuffer && window.Uint8Array && function (dataURI) {
  32990. var byteString,
  32991. arrayBuffer,
  32992. intArray,
  32993. i,
  32994. mimeString,
  32995. bb;
  32996. if (dataURI.split(',')[0].indexOf('base64') >= 0) {
  32997. // Convert base64 to raw binary data held in a string:
  32998. byteString = atob(dataURI.split(',')[1]);
  32999. } else {
  33000. // Convert base64/URLEncoded data component to raw binary data:
  33001. byteString = decodeURIComponent(dataURI.split(',')[1]);
  33002. }
  33003. // Write the bytes of the string to an ArrayBuffer:
  33004. arrayBuffer = new ArrayBuffer(byteString.length);
  33005. intArray = new Uint8Array(arrayBuffer);
  33006. for (i = 0; i < byteString.length; i += 1) {
  33007. intArray[i] = byteString.charCodeAt(i);
  33008. }
  33009. // Separate out the mime component:
  33010. mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
  33011. // Write the ArrayBuffer (or ArrayBufferView) to a blob:
  33012. if (hasBlobConstructor) {
  33013. return new Blob(
  33014. [hasArrayBufferViewSupport ? intArray : arrayBuffer],
  33015. {type: mimeString}
  33016. );
  33017. }
  33018. bb = new BlobBuilder();
  33019. bb.append(arrayBuffer);
  33020. return bb.getBlob(mimeString);
  33021. };
  33022. if (window.HTMLCanvasElement && !CanvasPrototype.toBlob) {
  33023. if (CanvasPrototype.mozGetAsFile) {
  33024. CanvasPrototype.toBlob = function (callback, type, quality) {
  33025. if (quality && CanvasPrototype.toDataURL && dataURLtoBlob) {
  33026. callback(dataURLtoBlob(this.toDataURL(type, quality)));
  33027. } else {
  33028. callback(this.mozGetAsFile('blob', type));
  33029. }
  33030. };
  33031. } else if (CanvasPrototype.toDataURL && dataURLtoBlob) {
  33032. CanvasPrototype.toBlob = function (callback, type, quality) {
  33033. callback(dataURLtoBlob(this.toDataURL(type, quality)));
  33034. };
  33035. }
  33036. }
  33037. if (typeof define === 'function' && define.amd) {
  33038. define(function () {
  33039. return dataURLtoBlob;
  33040. });
  33041. } else {
  33042. window.dataURLtoBlob = dataURLtoBlob;
  33043. }
  33044. }(this));
  33045. "use strict";
  33046. ;(function() {
  33047. var root = this;
  33048. var previous_emoji = root.EmojiConvertor;
  33049. /**
  33050. * @global
  33051. * @namespace
  33052. */
  33053. var emoji = function(){
  33054. var self = this;
  33055. /**
  33056. * The set of images to use for graphical emoji.
  33057. *
  33058. * @memberof emoji
  33059. * @type {string}
  33060. */
  33061. self.img_set = 'apple';
  33062. /**
  33063. * Configuration details for different image sets. This includes a path to a directory containing the
  33064. * individual images (`path`) and a URL to sprite sheets (`sheet`). All of these images can be found
  33065. * in the [emoji-data repository]{@link https://github.com/iamcal/emoji-data}. Using a CDN for these
  33066. * is not a bad idea.
  33067. *
  33068. * @memberof emoji
  33069. * @type {object}
  33070. */
  33071. self.img_sets = {
  33072. 'apple' : {'path' : '/emoji-data/img-apple-64/' , 'sheet' : '/emoji-data/sheet_apple_64.png', 'mask' : 1 },
  33073. 'google' : {'path' : '/emoji-data/img-google-64/' , 'sheet' : '/emoji-data/sheet_google_64.png', 'mask' : 2 },
  33074. 'twitter' : {'path' : '/emoji-data/img-twitter-64/' , 'sheet' : '/emoji-data/sheet_twitter_64.png', 'mask' : 4 },
  33075. 'emojione' : {'path' : '/emoji-data/img-emojione-64/', 'sheet' : '/emoji-data/sheet_emojione_64.png', 'mask' : 8 }
  33076. };
  33077. /**
  33078. * Use a CSS class instead of specifying a sprite or background image for
  33079. * the span representing the emoticon. This requires a CSS sheet with
  33080. * emoticon data-uris.
  33081. *
  33082. * @memberof emoji
  33083. * @type bool
  33084. * @todo document how to build the CSS stylesheet self requires.
  33085. */
  33086. self.use_css_imgs = false;
  33087. /**
  33088. * Instead of replacing emoticons with the appropriate representations,
  33089. * replace them with their colon string representation.
  33090. * @memberof emoji
  33091. * @type bool
  33092. */
  33093. self.colons_mode = false;
  33094. self.text_mode = false;
  33095. /**
  33096. * If true, sets the "title" property on the span or image that gets
  33097. * inserted for the emoticon.
  33098. * @memberof emoji
  33099. * @type bool
  33100. */
  33101. self.include_title = false;
  33102. /**
  33103. * If the platform supports native emoticons, use those instead
  33104. * of the fallbacks.
  33105. * @memberof emoji
  33106. * @type bool
  33107. */
  33108. self.allow_native = true;
  33109. /**
  33110. * Set to true to use CSS sprites instead of individual images on
  33111. * platforms that support it.
  33112. *
  33113. * @memberof emoji
  33114. * @type bool
  33115. */
  33116. self.use_sheet = false;
  33117. /**
  33118. *
  33119. * Set to true to avoid black & white native Windows emoji being used.
  33120. *
  33121. * @memberof emoji
  33122. * @type bool
  33123. */
  33124. self.avoid_ms_emoji = true;
  33125. /**
  33126. *
  33127. * Set to true to allow :CAPITALIZATION:
  33128. *
  33129. * @memberof emoji
  33130. * @type bool
  33131. */
  33132. self.allow_caps = false;
  33133. /**
  33134. *
  33135. * Suffix to allow for individual image cache busting
  33136. *
  33137. * @memberof emoji
  33138. * @type string
  33139. */
  33140. self.img_suffix = '';
  33141. // Keeps track of what has been initialized.
  33142. /** @private */
  33143. self.inits = {};
  33144. self.map = {};
  33145. // discover the environment settings
  33146. self.init_env();
  33147. return self;
  33148. }
  33149. emoji.prototype.noConflict = function(){
  33150. root.EmojiConvertor = previous_emoji;
  33151. return emoji;
  33152. }
  33153. /**
  33154. * @memberof emoji
  33155. * @param {string} str A string potentially containing ascii emoticons
  33156. * (ie. `:)`)
  33157. *
  33158. * @returns {string} A new string with all emoticons in `str`
  33159. * replaced by a representatation that's supported by the current
  33160. * environtment.
  33161. */
  33162. emoji.prototype.replace_emoticons = function(str){
  33163. var self = this;
  33164. var colonized = self.replace_emoticons_with_colons(str);
  33165. return self.replace_colons(colonized);
  33166. };
  33167. /**
  33168. * @memberof emoji
  33169. * @param {string} str A string potentially containing ascii emoticons
  33170. * (ie. `:)`)
  33171. *
  33172. * @returns {string} A new string with all emoticons in `str`
  33173. * replaced by their colon string representations (ie. `:smile:`)
  33174. */
  33175. emoji.prototype.replace_emoticons_with_colons = function(str){
  33176. var self = this;
  33177. self.init_emoticons();
  33178. var _prev_offset = 0;
  33179. var emoticons_with_parens = [];
  33180. var str_replaced = str.replace(self.rx_emoticons, function(m, $1, emoticon, offset){
  33181. var prev_offset = _prev_offset;
  33182. _prev_offset = offset + m.length;
  33183. var has_open_paren = emoticon.indexOf('(') !== -1;
  33184. var has_close_paren = emoticon.indexOf(')') !== -1;
  33185. /*
  33186. * Track paren-having emoticons for fixing later
  33187. */
  33188. if ((has_open_paren || has_close_paren) && emoticons_with_parens.indexOf(emoticon) == -1) {
  33189. emoticons_with_parens.push(emoticon);
  33190. }
  33191. /*
  33192. * Look for preceding open paren for emoticons that contain a close paren
  33193. * This prevents matching "8)" inside "(around 7 - 8)"
  33194. */
  33195. if (has_close_paren && !has_open_paren) {
  33196. var piece = str.substring(prev_offset, offset);
  33197. if (piece.indexOf('(') !== -1 && piece.indexOf(')') === -1) return m;
  33198. }
  33199. /*
  33200. * See if we're in a numbered list
  33201. * This prevents matching "8)" inside "7) foo\n8) bar"
  33202. */
  33203. if (m === '\n8)') {
  33204. var before_match = str.substring(0, offset);
  33205. if (/\n?(6\)|7\))/.test(before_match)) return m;
  33206. }
  33207. var val = self.data[self.map.emoticons[emoticon]][3][0];
  33208. return val ? $1+':'+val+':' : m;
  33209. });
  33210. /*
  33211. * Come back and fix emoticons we ignored because they were inside parens.
  33212. * It's useful to do self at the end so we don't get tripped up by other,
  33213. * normal emoticons
  33214. */
  33215. if (emoticons_with_parens.length) {
  33216. var escaped_emoticons = emoticons_with_parens.map(self.escape_rx);
  33217. var parenthetical_rx = new RegExp('(\\(.+)('+escaped_emoticons.join('|')+')(.+\\))', 'g');
  33218. str_replaced = str_replaced.replace(parenthetical_rx, function(m, $1, emoticon, $2) {
  33219. var val = self.data[self.map.emoticons[emoticon]][3][0];
  33220. return val ? $1+':'+val+':'+$2 : m;
  33221. });
  33222. }
  33223. return str_replaced;
  33224. };
  33225. /**
  33226. * @memberof emoji
  33227. * @param {string} str A string potentially containing colon string
  33228. * representations of emoticons (ie. `:smile:`)
  33229. *
  33230. * @returns {string} A new string with all colon string emoticons replaced
  33231. * with the appropriate representation.
  33232. */
  33233. emoji.prototype.replace_colons = function(str){
  33234. var self = this;
  33235. self.init_colons();
  33236. return str.replace(self.rx_colons, function(m){
  33237. var idx = m.substr(1, m.length-2);
  33238. if (self.allow_caps) idx = idx.toLowerCase();
  33239. // special case - an emoji with a skintone modified
  33240. if (idx.indexOf('::skin-tone-') > -1){
  33241. var skin_tone = idx.substr(-1, 1);
  33242. var skin_idx = 'skin-tone-'+skin_tone;
  33243. var skin_val = self.map.colons[skin_idx];
  33244. idx = idx.substr(0, idx.length - 13);
  33245. var val = self.map.colons[idx];
  33246. if (val){
  33247. return self.replacement(val, idx, ':', {
  33248. 'idx' : skin_val,
  33249. 'actual' : skin_idx,
  33250. 'wrapper' : ':'
  33251. });
  33252. }else{
  33253. return ':' + idx + ':' + self.replacement(skin_val, skin_idx, ':');
  33254. }
  33255. }else{
  33256. var val = self.map.colons[idx];
  33257. return val ? self.replacement(val, idx, ':') : m;
  33258. }
  33259. });
  33260. };
  33261. /**
  33262. * @memberof emoji
  33263. * @param {string} str A string potentially containing unified unicode
  33264. * emoticons. (ie. 😄)
  33265. *
  33266. * @returns {string} A new string with all unicode emoticons replaced with
  33267. * the appropriate representation for the current environment.
  33268. */
  33269. emoji.prototype.replace_unified = function(str){
  33270. var self = this;
  33271. self.init_unified();
  33272. return str.replace(self.rx_unified, function(m, p1, p2){
  33273. var val = self.map.unified[p1];
  33274. if (!val) return m;
  33275. var idx = null;
  33276. if (p2 == '\uD83C\uDFFB') idx = '1f3fb';
  33277. if (p2 == '\uD83C\uDFFC') idx = '1f3fc';
  33278. if (p2 == '\uD83C\uDFFD') idx = '1f3fd';
  33279. if (p2 == '\uD83C\uDFFE') idx = '1f3fe';
  33280. if (p2 == '\uD83C\uDFFF') idx = '1f3ff';
  33281. if (idx){
  33282. return self.replacement(val, null, null, {
  33283. idx : idx,
  33284. actual : p2,
  33285. wrapper : ''
  33286. });
  33287. }
  33288. return self.replacement(val);
  33289. });
  33290. };
  33291. emoji.prototype.addAliases = function(map){
  33292. var self = this;
  33293. self.init_colons();
  33294. for (var i in map){
  33295. self.map.colons[i] = map[i];
  33296. }
  33297. };
  33298. emoji.prototype.removeAliases = function(list){
  33299. var self = this;
  33300. for (var i=0; i<list.length; i++){
  33301. var alias = list[i];
  33302. // first, delete the alias mapping
  33303. delete self.map.colons[alias];
  33304. // now reset it to the default, if one exists
  33305. finder_block: {
  33306. for (var j in self.data){
  33307. for (var k=0; k<self.data[j][3].length; k++){
  33308. if (alias == self.data[j][3][k]){
  33309. self.map.colons[alias] = j;
  33310. break finder_block;
  33311. }
  33312. }
  33313. }
  33314. }
  33315. }
  33316. };
  33317. // Does the actual replacement of a character with the appropriate
  33318. /** @private */
  33319. emoji.prototype.replacement = function(idx, actual, wrapper, variation){
  33320. var self = this;
  33321. // for emoji with variation modifiers, set `etxra` to the standalone output for the
  33322. // modifier (used if we can't combine the glyph) and set variation_idx to key of the
  33323. // variation modifier (used below)
  33324. var extra = '';
  33325. var variation_idx = 0;
  33326. if (typeof variation === 'object'){
  33327. extra = self.replacement(variation.idx, variation.actual, variation.wrapper);
  33328. variation_idx = idx + '-' + variation.idx;
  33329. }
  33330. var img_set = self.img_set;
  33331. // When not using sheets (which all contain all emoji),
  33332. // make sure we use an img_set that contains this emoji.
  33333. // For now, assume set "apple" has all individual images.
  33334. if ((!self.use_sheet || !self.supports_css) && !(self.data[idx][6] & self.img_sets[self.img_set].mask)) {
  33335. img_set = 'apple';
  33336. }
  33337. // deal with simple modes (colons and text) first
  33338. wrapper = wrapper || '';
  33339. if (self.colons_mode) return ':'+self.data[idx][3][0]+':'+extra;
  33340. var text_name = (actual) ? wrapper+actual+wrapper : self.data[idx][8] || wrapper+self.data[idx][3][0]+wrapper;
  33341. if (self.text_mode) return text_name + extra;
  33342. // native modes next.
  33343. // for variations selectors, we just need to output them raw, which `extra` will contain.
  33344. self.init_env();
  33345. if (self.replace_mode == 'unified' && self.allow_native && self.data[idx][0][0]) return self.data[idx][0][0] + extra;
  33346. if (self.replace_mode == 'softbank' && self.allow_native && self.data[idx][1]) return self.data[idx][1] + extra;
  33347. if (self.replace_mode == 'google' && self.allow_native && self.data[idx][2]) return self.data[idx][2] + extra;
  33348. // finally deal with image modes.
  33349. // variation selectors are more complex here - if the image set and particular emoji supports variations, then
  33350. // use the variation image. otherwise, return it as a separate image (already calculated in `extra`).
  33351. // first we set up the params we'll use if we can't use a variation.
  33352. var img = self.data[idx][7] || self.img_sets[img_set].path+idx+'.png' + self.img_suffix;
  33353. var title = self.include_title ? ' title="'+(actual || self.data[idx][3][0])+'"' : '';
  33354. var text = self.include_text ? wrapper+(actual || self.data[idx][3][0])+wrapper : '';
  33355. var px = self.data[idx][4];
  33356. var py = self.data[idx][5];
  33357. // now we'll see if we can use a varition. if we can, we can override the params above and blank
  33358. // out `extra` so we output a sinlge glyph.
  33359. // we need to check that:
  33360. // * we requested a variation
  33361. // * such a variation exists in `emoji.variations_data`
  33362. // * we're not using a custom image for self glyph
  33363. // * the variation has an image defined for the current image set
  33364. if (variation_idx && self.variations_data[variation_idx] && self.variations_data[variation_idx][2] && !self.data[idx][7]){
  33365. if (self.variations_data[variation_idx][2] & self.img_sets[self.img_set].mask){
  33366. img = self.img_sets[self.img_set].path+variation_idx+'.png';
  33367. px = self.variations_data[variation_idx][0];
  33368. py = self.variations_data[variation_idx][1];
  33369. extra = '';
  33370. }
  33371. }
  33372. if (self.supports_css) {
  33373. if (self.use_sheet && px != null && py != null){
  33374. var mul = 100 / (self.sheet_size - 1);
  33375. var style = 'background: url('+self.img_sets[img_set].sheet+');background-position:'+(mul*px)+'% '+(mul*py)+'%;background-size:'+self.sheet_size+'00%';
  33376. return '<span class="emoji-outer emoji-sizer"><span class="emoji-inner" style="'+style+'"'+title+'>'+text+'</span></span>'+extra;
  33377. }else if (self.use_css_imgs){
  33378. return '<span class="emoji emoji-'+idx+'"'+title+'>'+text+'</span>'+extra;
  33379. }else{
  33380. return '<span class="emoji emoji-sizer" style="background-image:url('+img+')"'+title+'>'+text+'</span>'+extra;
  33381. }
  33382. }
  33383. return '<img src="'+img+'" class="emoji" '+title+'/>'+extra;
  33384. };
  33385. // Initializes the text emoticon data
  33386. /** @private */
  33387. emoji.prototype.init_emoticons = function(){
  33388. var self = this;
  33389. if (self.inits.emoticons) return;
  33390. self.init_colons(); // we require this for the emoticons map
  33391. self.inits.emoticons = 1;
  33392. var a = [];
  33393. self.map.emoticons = {};
  33394. for (var i in self.emoticons_data){
  33395. // because we never see some characters in our text except as entities, we must do some replacing
  33396. var emoticon = i.replace(/\&/g, '&amp;').replace(/\</g, '&lt;').replace(/\>/g, '&gt;');
  33397. if (!self.map.colons[self.emoticons_data[i]]) continue;
  33398. self.map.emoticons[emoticon] = self.map.colons[self.emoticons_data[i]];
  33399. a.push(self.escape_rx(emoticon));
  33400. }
  33401. self.rx_emoticons = new RegExp(('(^|\\s)('+a.join('|')+')(?=$|[\\s|\\?\\.,!])'), 'g');
  33402. };
  33403. // Initializes the colon string data
  33404. /** @private */
  33405. emoji.prototype.init_colons = function(){
  33406. var self = this;
  33407. if (self.inits.colons) return;
  33408. self.inits.colons = 1;
  33409. self.rx_colons = new RegExp('\:[a-zA-Z0-9-_+]+\:(\:skin-tone-[2-6]\:)?', 'g');
  33410. self.map.colons = {};
  33411. for (var i in self.data){
  33412. for (var j=0; j<self.data[i][3].length; j++){
  33413. self.map.colons[self.data[i][3][j]] = i;
  33414. }
  33415. }
  33416. };
  33417. // initializes the unified unicode emoticon data
  33418. /** @private */
  33419. emoji.prototype.init_unified = function(){
  33420. var self = this;
  33421. if (self.inits.unified) return;
  33422. self.inits.unified = 1;
  33423. var a = [];
  33424. self.map.unified = {};
  33425. for (var i in self.data){
  33426. for (var j=0; j<self.data[i][0].length; j++){
  33427. a.push(self.data[i][0][j].replace('*', '\\*'));
  33428. self.map.unified[self.data[i][0][j]] = i;
  33429. }
  33430. }
  33431. a = a.sort(function(a,b){
  33432. return b.length - a.length;
  33433. });
  33434. self.rx_unified = new RegExp('('+a.join('|')+')(\uD83C[\uDFFB-\uDFFF])?', "g");
  33435. };
  33436. // initializes the environment, figuring out what representation
  33437. // of emoticons is best.
  33438. /** @private */
  33439. emoji.prototype.init_env = function(){
  33440. var self = this;
  33441. if (self.inits.env) return;
  33442. self.inits.env = 1;
  33443. self.replace_mode = 'img';
  33444. self.supports_css = false;
  33445. if (typeof(navigator) !== 'undefined') {
  33446. var ua = navigator.userAgent;
  33447. if (window.getComputedStyle){
  33448. var st = window.getComputedStyle(document.body);
  33449. if (st['background-size'] || st['backgroundSize']){
  33450. self.supports_css = true;
  33451. }
  33452. }
  33453. if (ua.match(/(iPhone|iPod|iPad|iPhone\s+Simulator)/i)){
  33454. if (ua.match(/OS\s+[12345]/i)){
  33455. self.replace_mode = 'softbank';
  33456. return;
  33457. }
  33458. if (ua.match(/OS\s+[6789]/i)){
  33459. self.replace_mode = 'unified';
  33460. return;
  33461. }
  33462. }
  33463. if (ua.match(/Mac OS X 10[._ ](?:[789]|1\d)/i)){
  33464. if (!ua.match(/Chrome/i) && !ua.match(/Firefox/i)){
  33465. self.replace_mode = 'unified';
  33466. return;
  33467. }
  33468. }
  33469. if (!self.avoid_ms_emoji){
  33470. if (ua.match(/Windows NT 6.[1-9]/i) || ua.match(/Windows NT 10.[0-9]/i)){
  33471. if (!ua.match(/Chrome/i) && !ua.match(/MSIE 8/i)){
  33472. self.replace_mode = 'unified';
  33473. return;
  33474. }
  33475. }
  33476. }
  33477. }
  33478. // Need a better way to detect android devices that actually
  33479. // support emoji.
  33480. if (false && ua.match(/Android/i)){
  33481. self.replace_mode = 'google';
  33482. return;
  33483. }
  33484. if (self.supports_css){
  33485. self.replace_mode = 'css';
  33486. }
  33487. // nothing fancy detected - use images
  33488. };
  33489. /** @private */
  33490. emoji.prototype.escape_rx = function(text){
  33491. return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
  33492. };
  33493. emoji.prototype.sheet_size = 41;
  33494. /** @private */
  33495. emoji.prototype.data = {
  33496. "00a9":[["\u00A9\uFE0F","\u00A9"],"\uE24E","\uDBBA\uDF29",["copyright"],0,0,11,0],
  33497. "00ae":[["\u00AE\uFE0F","\u00AE"],"\uE24F","\uDBBA\uDF2D",["registered"],0,1,11,0],
  33498. "203c":[["\u203C\uFE0F","\u203C"],"","\uDBBA\uDF06",["bangbang"],0,2,15,0],
  33499. "2049":[["\u2049\uFE0F","\u2049"],"","\uDBBA\uDF05",["interrobang"],0,3,15,0],
  33500. "2122":[["\u2122\uFE0F","\u2122"],"\uE537","\uDBBA\uDF2A",["tm"],0,4,11,0],
  33501. "2139":[["\u2139\uFE0F","\u2139"],"","\uDBBA\uDF47",["information_source"],0,5,15,0],
  33502. "2194":[["\u2194\uFE0F","\u2194"],"","\uDBBA\uDEF6",["left_right_arrow"],0,6,15,0],
  33503. "2195":[["\u2195\uFE0F","\u2195"],"","\uDBBA\uDEF7",["arrow_up_down"],0,7,15,0],
  33504. "2196":[["\u2196\uFE0F","\u2196"],"\uE237","\uDBBA\uDEF2",["arrow_upper_left"],0,8,15,0],
  33505. "2197":[["\u2197\uFE0F","\u2197"],"\uE236","\uDBBA\uDEF0",["arrow_upper_right"],0,9,15,0],
  33506. "2198":[["\u2198\uFE0F","\u2198"],"\uE238","\uDBBA\uDEF1",["arrow_lower_right"],0,10,15,0],
  33507. "2199":[["\u2199\uFE0F","\u2199"],"\uE239","\uDBBA\uDEF3",["arrow_lower_left"],0,11,15,0],
  33508. "21a9":[["\u21A9\uFE0F","\u21A9"],"","\uDBBA\uDF83",["leftwards_arrow_with_hook"],0,12,15,0],
  33509. "21aa":[["\u21AA\uFE0F","\u21AA"],"","\uDBBA\uDF88",["arrow_right_hook"],0,13,15,0],
  33510. "231a":[["\u231A\uFE0F","\u231A"],"","\uDBB8\uDC1D",["watch"],0,14,15,0],
  33511. "231b":[["\u231B\uFE0F","\u231B"],"","\uDBB8\uDC1C",["hourglass"],0,15,15,0],
  33512. "2328":[["\u2328\uFE0F","\u2328"],"","",["keyboard"],0,16,15,0],
  33513. "23cf":[["\u23CF"],"","",["eject"],0,17,2,0],
  33514. "23e9":[["\u23E9"],"\uE23C","\uDBBA\uDEFE",["fast_forward"],0,18,15,0],
  33515. "23ea":[["\u23EA"],"\uE23D","\uDBBA\uDEFF",["rewind"],0,19,15,0],
  33516. "23eb":[["\u23EB"],"","\uDBBA\uDF03",["arrow_double_up"],0,20,15,0],
  33517. "23ec":[["\u23EC"],"","\uDBBA\uDF02",["arrow_double_down"],0,21,15,0],
  33518. "23ed":[["\u23ED"],"","",["black_right_pointing_double_triangle_with_vertical_bar"],0,22,15,0],
  33519. "23ee":[["\u23EE"],"","",["black_left_pointing_double_triangle_with_vertical_bar"],0,23,15,0],
  33520. "23ef":[["\u23EF"],"","",["black_right_pointing_triangle_with_double_vertical_bar"],0,24,15,0],
  33521. "23f0":[["\u23F0"],"\uE02D","\uDBB8\uDC2A",["alarm_clock"],0,25,15,0],
  33522. "23f1":[["\u23F1"],"","",["stopwatch"],0,26,15,0],
  33523. "23f2":[["\u23F2"],"","",["timer_clock"],0,27,15,0],
  33524. "23f3":[["\u23F3"],"","\uDBB8\uDC1B",["hourglass_flowing_sand"],0,28,15,0],
  33525. "23f8":[["\u23F8"],"","",["double_vertical_bar"],0,29,15,0],
  33526. "23f9":[["\u23F9"],"","",["black_square_for_stop"],0,30,15,0],
  33527. "23fa":[["\u23FA"],"","",["black_circle_for_record"],0,31,15,0],
  33528. "24c2":[["\u24C2\uFE0F","\u24C2"],"\uE434","\uDBB9\uDFE1",["m"],0,32,15,0],
  33529. "25aa":[["\u25AA\uFE0F","\u25AA"],"\uE21A","\uDBBA\uDF6E",["black_small_square"],0,33,15,0],
  33530. "25ab":[["\u25AB\uFE0F","\u25AB"],"\uE21B","\uDBBA\uDF6D",["white_small_square"],0,34,15,0],
  33531. "25b6":[["\u25B6\uFE0F","\u25B6"],"\uE23A","\uDBBA\uDEFC",["arrow_forward"],0,35,15,0],
  33532. "25c0":[["\u25C0\uFE0F","\u25C0"],"\uE23B","\uDBBA\uDEFD",["arrow_backward"],0,36,15,0],
  33533. "25fb":[["\u25FB\uFE0F","\u25FB"],"\uE21B","\uDBBA\uDF71",["white_medium_square"],0,37,15,0],
  33534. "25fc":[["\u25FC\uFE0F","\u25FC"],"\uE21A","\uDBBA\uDF72",["black_medium_square"],0,38,15,0],
  33535. "25fd":[["\u25FD\uFE0F","\u25FD"],"\uE21B","\uDBBA\uDF6F",["white_medium_small_square"],0,39,15,0],
  33536. "25fe":[["\u25FE\uFE0F","\u25FE"],"\uE21A","\uDBBA\uDF70",["black_medium_small_square"],0,40,15,0],
  33537. "2600":[["\u2600\uFE0F","\u2600"],"\uE04A","\uDBB8\uDC00",["sunny"],1,0,15,0],
  33538. "2601":[["\u2601\uFE0F","\u2601"],"\uE049","\uDBB8\uDC01",["cloud"],1,1,15,0],
  33539. "2602":[["\u2602\uFE0F","\u2602"],"","",["umbrella"],1,2,15,0],
  33540. "2603":[["\u2603\uFE0F","\u2603"],"","",["snowman"],1,3,15,0],
  33541. "2604":[["\u2604\uFE0F","\u2604"],"","",["comet"],1,4,15,0],
  33542. "260e":[["\u260E\uFE0F","\u260E"],"\uE009","\uDBB9\uDD23",["phone","telephone"],1,5,15,0],
  33543. "2611":[["\u2611\uFE0F","\u2611"],"","\uDBBA\uDF8B",["ballot_box_with_check"],1,6,15,0],
  33544. "2614":[["\u2614\uFE0F","\u2614"],"\uE04B","\uDBB8\uDC02",["umbrella_with_rain_drops"],1,7,15,0],
  33545. "2615":[["\u2615\uFE0F","\u2615"],"\uE045","\uDBBA\uDD81",["coffee"],1,8,15,0],
  33546. "2618":[["\u2618"],"","",["shamrock"],1,9,15,0],
  33547. "261d":[["\u261D\uFE0F","\u261D"],"\uE00F","\uDBBA\uDF98",["point_up"],1,10,15,0],
  33548. "2620":[["\u2620\uFE0F","\u2620"],"","",["skull_and_crossbones"],1,16,15,0],
  33549. "2622":[["\u2622\uFE0F","\u2622"],"","",["radioactive_sign"],1,17,15,0],
  33550. "2623":[["\u2623\uFE0F","\u2623"],"","",["biohazard_sign"],1,18,15,0],
  33551. "2626":[["\u2626\uFE0F","\u2626"],"","",["orthodox_cross"],1,19,15,0],
  33552. "262a":[["\u262A\uFE0F","\u262A"],"","",["star_and_crescent"],1,20,15,0],
  33553. "262e":[["\u262E\uFE0F","\u262E"],"","",["peace_symbol"],1,21,15,0],
  33554. "262f":[["\u262F\uFE0F","\u262F"],"","",["yin_yang"],1,22,15,0],
  33555. "2638":[["\u2638\uFE0F","\u2638"],"","",["wheel_of_dharma"],1,23,15,0],
  33556. "2639":[["\u2639\uFE0F","\u2639"],"","",["white_frowning_face"],1,24,15,0],
  33557. "263a":[["\u263A\uFE0F","\u263A"],"\uE414","\uDBB8\uDF36",["relaxed"],1,25,15,0],
  33558. "2648":[["\u2648\uFE0F","\u2648"],"\uE23F","\uDBB8\uDC2B",["aries"],1,26,15,0],
  33559. "2649":[["\u2649\uFE0F","\u2649"],"\uE240","\uDBB8\uDC2C",["taurus"],1,27,15,0],
  33560. "264a":[["\u264A\uFE0F","\u264A"],"\uE241","\uDBB8\uDC2D",["gemini"],1,28,15,0],
  33561. "264b":[["\u264B\uFE0F","\u264B"],"\uE242","\uDBB8\uDC2E",["cancer"],1,29,15,0],
  33562. "264c":[["\u264C\uFE0F","\u264C"],"\uE243","\uDBB8\uDC2F",["leo"],1,30,15,0],
  33563. "264d":[["\u264D\uFE0F","\u264D"],"\uE244","\uDBB8\uDC30",["virgo"],1,31,15,0],
  33564. "264e":[["\u264E\uFE0F","\u264E"],"\uE245","\uDBB8\uDC31",["libra"],1,32,15,0],
  33565. "264f":[["\u264F\uFE0F","\u264F"],"\uE246","\uDBB8\uDC32",["scorpius"],1,33,15,0],
  33566. "2650":[["\u2650\uFE0F","\u2650"],"\uE247","\uDBB8\uDC33",["sagittarius"],1,34,15,0],
  33567. "2651":[["\u2651\uFE0F","\u2651"],"\uE248","\uDBB8\uDC34",["capricorn"],1,35,15,0],
  33568. "2652":[["\u2652\uFE0F","\u2652"],"\uE249","\uDBB8\uDC35",["aquarius"],1,36,15,0],
  33569. "2653":[["\u2653\uFE0F","\u2653"],"\uE24A","\uDBB8\uDC36",["pisces"],1,37,15,0],
  33570. "2660":[["\u2660\uFE0F","\u2660"],"\uE20E","\uDBBA\uDF1B",["spades"],1,38,15,0],
  33571. "2663":[["\u2663\uFE0F","\u2663"],"\uE20F","\uDBBA\uDF1D",["clubs"],1,39,15,0],
  33572. "2665":[["\u2665\uFE0F","\u2665"],"\uE20C","\uDBBA\uDF1A",["hearts"],1,40,15,0],
  33573. "2666":[["\u2666\uFE0F","\u2666"],"\uE20D","\uDBBA\uDF1C",["diamonds"],2,0,15,0],
  33574. "2668":[["\u2668\uFE0F","\u2668"],"\uE123","\uDBB9\uDFFA",["hotsprings"],2,1,15,0],
  33575. "267b":[["\u267B\uFE0F","\u267B"],"","\uDBBA\uDF2C",["recycle"],2,2,15,0],
  33576. "267f":[["\u267F\uFE0F","\u267F"],"\uE20A","\uDBBA\uDF20",["wheelchair"],2,3,15,0],
  33577. "2692":[["\u2692"],"","",["hammer_and_pick"],2,4,15,0],
  33578. "2693":[["\u2693\uFE0F","\u2693"],"\uE202","\uDBB9\uDCC1",["anchor"],2,5,15,0],
  33579. "2694":[["\u2694"],"","",["crossed_swords"],2,6,15,0],
  33580. "2696":[["\u2696"],"","",["scales"],2,7,15,0],
  33581. "2697":[["\u2697"],"","",["alembic"],2,8,15,0],
  33582. "2699":[["\u2699"],"","",["gear"],2,9,15,0],
  33583. "269b":[["\u269B"],"","",["atom_symbol"],2,10,15,0],
  33584. "269c":[["\u269C"],"","",["fleur_de_lis"],2,11,15,0],
  33585. "26a0":[["\u26A0\uFE0F","\u26A0"],"\uE252","\uDBBA\uDF23",["warning"],2,12,15,0],
  33586. "26a1":[["\u26A1\uFE0F","\u26A1"],"\uE13D","\uDBB8\uDC04",["zap"],2,13,15,0],
  33587. "26aa":[["\u26AA\uFE0F","\u26AA"],"\uE219","\uDBBA\uDF65",["white_circle"],2,14,15,0],
  33588. "26ab":[["\u26AB\uFE0F","\u26AB"],"\uE219","\uDBBA\uDF66",["black_circle"],2,15,15,0],
  33589. "26b0":[["\u26B0"],"","",["coffin"],2,16,15,0],
  33590. "26b1":[["\u26B1"],"","",["funeral_urn"],2,17,15,0],
  33591. "26bd":[["\u26BD\uFE0F","\u26BD"],"\uE018","\uDBB9\uDFD4",["soccer"],2,18,15,0],
  33592. "26be":[["\u26BE\uFE0F","\u26BE"],"\uE016","\uDBB9\uDFD1",["baseball"],2,19,15,0],
  33593. "26c4":[["\u26C4\uFE0F","\u26C4"],"\uE048","\uDBB8\uDC03",["snowman_without_snow"],2,20,15,0],
  33594. "26c5":[["\u26C5\uFE0F","\u26C5"],"\uE04A\uE049","\uDBB8\uDC0F",["partly_sunny"],2,21,15,0],
  33595. "26c8":[["\u26C8"],"","",["thunder_cloud_and_rain"],2,22,15,0],
  33596. "26ce":[["\u26CE"],"\uE24B","\uDBB8\uDC37",["ophiuchus"],2,23,15,0],
  33597. "26cf":[["\u26CF"],"","",["pick"],2,24,15,0],
  33598. "26d1":[["\u26D1"],"","",["helmet_with_white_cross"],2,25,15,0],
  33599. "26d3":[["\u26D3"],"","",["chains"],2,26,15,0],
  33600. "26d4":[["\u26D4\uFE0F","\u26D4"],"\uE137","\uDBBA\uDF26",["no_entry"],2,27,15,0],
  33601. "26e9":[["\u26E9"],"","",["shinto_shrine"],2,28,15,0],
  33602. "26ea":[["\u26EA\uFE0F","\u26EA"],"\uE037","\uDBB9\uDCBB",["church"],2,29,15,0],
  33603. "26f0":[["\u26F0"],"","",["mountain"],2,30,15,0],
  33604. "26f1":[["\u26F1"],"","",["umbrella_on_ground"],2,31,15,0],
  33605. "26f2":[["\u26F2\uFE0F","\u26F2"],"\uE121","\uDBB9\uDCBC",["fountain"],2,32,15,0],
  33606. "26f3":[["\u26F3\uFE0F","\u26F3"],"\uE014","\uDBB9\uDFD2",["golf"],2,33,15,0],
  33607. "26f4":[["\u26F4"],"","",["ferry"],2,34,15,0],
  33608. "26f5":[["\u26F5\uFE0F","\u26F5"],"\uE01C","\uDBB9\uDFEA",["boat","sailboat"],2,35,15,0],
  33609. "26f7":[["\u26F7"],"","",["skier"],2,36,15,0],
  33610. "26f8":[["\u26F8"],"","",["ice_skate"],2,37,15,0],
  33611. "26f9":[["\u26F9"],"","",["person_with_ball"],2,38,15,0],
  33612. "26fa":[["\u26FA\uFE0F","\u26FA"],"\uE122","\uDBB9\uDFFB",["tent"],3,3,15,0],
  33613. "26fd":[["\u26FD\uFE0F","\u26FD"],"\uE03A","\uDBB9\uDFF5",["fuelpump"],3,4,15,0],
  33614. "2702":[["\u2702\uFE0F","\u2702"],"\uE313","\uDBB9\uDD3E",["scissors"],3,5,15,0],
  33615. "2705":[["\u2705"],"","\uDBBA\uDF4A",["white_check_mark"],3,6,15,0],
  33616. "2708":[["\u2708\uFE0F","\u2708"],"\uE01D","\uDBB9\uDFE9",["airplane"],3,7,15,0],
  33617. "2709":[["\u2709\uFE0F","\u2709"],"\uE103","\uDBB9\uDD29",["email","envelope"],3,8,15,0],
  33618. "270a":[["\u270A"],"\uE010","\uDBBA\uDF93",["fist"],3,9,15,0],
  33619. "270b":[["\u270B"],"\uE012","\uDBBA\uDF95",["hand","raised_hand"],3,15,15,0],
  33620. "270c":[["\u270C\uFE0F","\u270C"],"\uE011","\uDBBA\uDF94",["v"],3,21,15,0],
  33621. "270d":[["\u270D\uFE0F","\u270D"],"","",["writing_hand"],3,27,15,0],
  33622. "270f":[["\u270F\uFE0F","\u270F"],"\uE301","\uDBB9\uDD39",["pencil2"],3,33,15,0],
  33623. "2712":[["\u2712\uFE0F","\u2712"],"","\uDBB9\uDD36",["black_nib"],3,34,15,0],
  33624. "2714":[["\u2714\uFE0F","\u2714"],"","\uDBBA\uDF49",["heavy_check_mark"],3,35,15,0],
  33625. "2716":[["\u2716\uFE0F","\u2716"],"\uE333","\uDBBA\uDF53",["heavy_multiplication_x"],3,36,15,0],
  33626. "271d":[["\u271D\uFE0F","\u271D"],"","",["latin_cross"],3,37,15,0],
  33627. "2721":[["\u2721\uFE0F","\u2721"],"","",["star_of_david"],3,38,15,0],
  33628. "2728":[["\u2728"],"\uE32E","\uDBBA\uDF60",["sparkles"],3,39,15,0],
  33629. "2733":[["\u2733\uFE0F","\u2733"],"\uE206","\uDBBA\uDF62",["eight_spoked_asterisk"],3,40,15,0],
  33630. "2734":[["\u2734\uFE0F","\u2734"],"\uE205","\uDBBA\uDF61",["eight_pointed_black_star"],4,0,15,0],
  33631. "2744":[["\u2744\uFE0F","\u2744"],"","\uDBB8\uDC0E",["snowflake"],4,1,15,0],
  33632. "2747":[["\u2747\uFE0F","\u2747"],"\uE32E","\uDBBA\uDF77",["sparkle"],4,2,15,0],
  33633. "274c":[["\u274C"],"\uE333","\uDBBA\uDF45",["x"],4,3,15,0],
  33634. "274e":[["\u274E"],"\uE333","\uDBBA\uDF46",["negative_squared_cross_mark"],4,4,15,0],
  33635. "2753":[["\u2753"],"\uE020","\uDBBA\uDF09",["question"],4,5,15,0],
  33636. "2754":[["\u2754"],"\uE336","\uDBBA\uDF0A",["grey_question"],4,6,15,0],
  33637. "2755":[["\u2755"],"\uE337","\uDBBA\uDF0B",["grey_exclamation"],4,7,15,0],
  33638. "2757":[["\u2757\uFE0F","\u2757"],"\uE021","\uDBBA\uDF04",["exclamation","heavy_exclamation_mark"],4,8,15,0],
  33639. "2763":[["\u2763\uFE0F","\u2763"],"","",["heavy_heart_exclamation_mark_ornament"],4,9,15,0],
  33640. "2764":[["\u2764\uFE0F","\u2764"],"\uE022","\uDBBA\uDF0C",["heart"],4,10,15,0,"<3"],
  33641. "2795":[["\u2795"],"","\uDBBA\uDF51",["heavy_plus_sign"],4,11,15,0],
  33642. "2796":[["\u2796"],"","\uDBBA\uDF52",["heavy_minus_sign"],4,12,15,0],
  33643. "2797":[["\u2797"],"","\uDBBA\uDF54",["heavy_division_sign"],4,13,15,0],
  33644. "27a1":[["\u27A1\uFE0F","\u27A1"],"\uE234","\uDBBA\uDEFA",["arrow_right"],4,14,15,0],
  33645. "27b0":[["\u27B0"],"","\uDBBA\uDF08",["curly_loop"],4,15,15,0],
  33646. "27bf":[["\u27BF"],"\uE211","\uDBBA\uDC2B",["loop"],4,16,15,0],
  33647. "2934":[["\u2934\uFE0F","\u2934"],"\uE236","\uDBBA\uDEF4",["arrow_heading_up"],4,17,15,0],
  33648. "2935":[["\u2935\uFE0F","\u2935"],"\uE238","\uDBBA\uDEF5",["arrow_heading_down"],4,18,15,0],
  33649. "2b05":[["\u2B05\uFE0F","\u2B05"],"\uE235","\uDBBA\uDEFB",["arrow_left"],4,19,15,0],
  33650. "2b06":[["\u2B06\uFE0F","\u2B06"],"\uE232","\uDBBA\uDEF8",["arrow_up"],4,20,15,0],
  33651. "2b07":[["\u2B07\uFE0F","\u2B07"],"\uE233","\uDBBA\uDEF9",["arrow_down"],4,21,15,0],
  33652. "2b1b":[["\u2B1B\uFE0F","\u2B1B"],"\uE21A","\uDBBA\uDF6C",["black_large_square"],4,22,15,0],
  33653. "2b1c":[["\u2B1C\uFE0F","\u2B1C"],"\uE21B","\uDBBA\uDF6B",["white_large_square"],4,23,15,0],
  33654. "2b50":[["\u2B50\uFE0F","\u2B50"],"\uE32F","\uDBBA\uDF68",["star"],4,24,15,0],
  33655. "2b55":[["\u2B55\uFE0F","\u2B55"],"\uE332","\uDBBA\uDF44",["o"],4,25,15,0],
  33656. "3030":[["\u3030\uFE0F","\u3030"],"","\uDBBA\uDF07",["wavy_dash"],4,26,15,0],
  33657. "303d":[["\u303D\uFE0F","\u303D"],"\uE12C","\uDBBA\uDC1B",["part_alternation_mark"],4,27,15,0],
  33658. "3297":[["\u3297\uFE0F","\u3297"],"\uE30D","\uDBBA\uDF43",["congratulations"],4,28,15,0],
  33659. "3299":[["\u3299\uFE0F","\u3299"],"\uE315","\uDBBA\uDF2B",["secret"],4,29,15,0],
  33660. "1f004":[["\uD83C\uDC04\uFE0F","\uD83C\uDC04"],"\uE12D","\uDBBA\uDC0B",["mahjong"],4,30,15,0],
  33661. "1f0cf":[["\uD83C\uDCCF"],"","\uDBBA\uDC12",["black_joker"],4,31,15,0],
  33662. "1f170":[["\uD83C\uDD70\uFE0F","\uD83C\uDD70"],"\uE532","\uDBB9\uDD0B",["a"],4,32,15,0],
  33663. "1f171":[["\uD83C\uDD71\uFE0F","\uD83C\uDD71"],"\uE533","\uDBB9\uDD0C",["b"],4,33,15,0],
  33664. "1f17e":[["\uD83C\uDD7E\uFE0F","\uD83C\uDD7E"],"\uE535","\uDBB9\uDD0E",["o2"],4,34,15,0],
  33665. "1f17f":[["\uD83C\uDD7F\uFE0F","\uD83C\uDD7F"],"\uE14F","\uDBB9\uDFF6",["parking"],4,35,15,0],
  33666. "1f18e":[["\uD83C\uDD8E"],"\uE534","\uDBB9\uDD0D",["ab"],4,36,15,0],
  33667. "1f191":[["\uD83C\uDD91"],"","\uDBBA\uDF84",["cl"],4,37,15,0],
  33668. "1f192":[["\uD83C\uDD92"],"\uE214","\uDBBA\uDF38",["cool"],4,38,15,0],
  33669. "1f193":[["\uD83C\uDD93"],"","\uDBBA\uDF21",["free"],4,39,15,0],
  33670. "1f194":[["\uD83C\uDD94"],"\uE229","\uDBBA\uDF81",["id"],4,40,15,0],
  33671. "1f195":[["\uD83C\uDD95"],"\uE212","\uDBBA\uDF36",["new"],5,0,15,0],
  33672. "1f196":[["\uD83C\uDD96"],"","\uDBBA\uDF28",["ng"],5,1,15,0],
  33673. "1f197":[["\uD83C\uDD97"],"\uE24D","\uDBBA\uDF27",["ok"],5,2,15,0],
  33674. "1f198":[["\uD83C\uDD98"],"","\uDBBA\uDF4F",["sos"],5,3,15,0],
  33675. "1f199":[["\uD83C\uDD99"],"\uE213","\uDBBA\uDF37",["up"],5,4,15,0],
  33676. "1f19a":[["\uD83C\uDD9A"],"\uE12E","\uDBBA\uDF32",["vs"],5,5,15,0],
  33677. "1f201":[["\uD83C\uDE01"],"\uE203","\uDBBA\uDF24",["koko"],5,6,15,0],
  33678. "1f202":[["\uD83C\uDE02\uFE0F","\uD83C\uDE02"],"\uE228","\uDBBA\uDF3F",["sa"],5,7,15,0],
  33679. "1f21a":[["\uD83C\uDE1A\uFE0F","\uD83C\uDE1A"],"\uE216","\uDBBA\uDF3A",["u7121"],5,8,15,0],
  33680. "1f22f":[["\uD83C\uDE2F\uFE0F","\uD83C\uDE2F"],"\uE22C","\uDBBA\uDF40",["u6307"],5,9,15,0],
  33681. "1f232":[["\uD83C\uDE32"],"","\uDBBA\uDF2E",["u7981"],5,10,15,0],
  33682. "1f233":[["\uD83C\uDE33"],"\uE22B","\uDBBA\uDF2F",["u7a7a"],5,11,15,0],
  33683. "1f234":[["\uD83C\uDE34"],"","\uDBBA\uDF30",["u5408"],5,12,15,0],
  33684. "1f235":[["\uD83C\uDE35"],"\uE22A","\uDBBA\uDF31",["u6e80"],5,13,15,0],
  33685. "1f236":[["\uD83C\uDE36"],"\uE215","\uDBBA\uDF39",["u6709"],5,14,15,0],
  33686. "1f237":[["\uD83C\uDE37\uFE0F","\uD83C\uDE37"],"\uE217","\uDBBA\uDF3B",["u6708"],5,15,15,0],
  33687. "1f238":[["\uD83C\uDE38"],"\uE218","\uDBBA\uDF3C",["u7533"],5,16,15,0],
  33688. "1f239":[["\uD83C\uDE39"],"\uE227","\uDBBA\uDF3E",["u5272"],5,17,15,0],
  33689. "1f23a":[["\uD83C\uDE3A"],"\uE22D","\uDBBA\uDF41",["u55b6"],5,18,15,0],
  33690. "1f250":[["\uD83C\uDE50"],"\uE226","\uDBBA\uDF3D",["ideograph_advantage"],5,19,15,0],
  33691. "1f251":[["\uD83C\uDE51"],"","\uDBBA\uDF50",["accept"],5,20,15,0],
  33692. "1f300":[["\uD83C\uDF00"],"\uE443","\uDBB8\uDC05",["cyclone"],5,21,15,0],
  33693. "1f301":[["\uD83C\uDF01"],"","\uDBB8\uDC06",["foggy"],5,22,15,0],
  33694. "1f302":[["\uD83C\uDF02"],"\uE43C","\uDBB8\uDC07",["closed_umbrella"],5,23,15,0],
  33695. "1f303":[["\uD83C\uDF03"],"\uE44B","\uDBB8\uDC08",["night_with_stars"],5,24,15,0],
  33696. "1f304":[["\uD83C\uDF04"],"\uE04D","\uDBB8\uDC09",["sunrise_over_mountains"],5,25,15,0],
  33697. "1f305":[["\uD83C\uDF05"],"\uE449","\uDBB8\uDC0A",["sunrise"],5,26,15,0],
  33698. "1f306":[["\uD83C\uDF06"],"\uE146","\uDBB8\uDC0B",["city_sunset"],5,27,15,0],
  33699. "1f307":[["\uD83C\uDF07"],"\uE44A","\uDBB8\uDC0C",["city_sunrise"],5,28,15,0],
  33700. "1f308":[["\uD83C\uDF08"],"\uE44C","\uDBB8\uDC0D",["rainbow"],5,29,15,0],
  33701. "1f309":[["\uD83C\uDF09"],"\uE44B","\uDBB8\uDC10",["bridge_at_night"],5,30,15,0],
  33702. "1f30a":[["\uD83C\uDF0A"],"\uE43E","\uDBB8\uDC38",["ocean"],5,31,15,0],
  33703. "1f30b":[["\uD83C\uDF0B"],"","\uDBB8\uDC3A",["volcano"],5,32,15,0],
  33704. "1f30c":[["\uD83C\uDF0C"],"\uE44B","\uDBB8\uDC3B",["milky_way"],5,33,15,0],
  33705. "1f30d":[["\uD83C\uDF0D"],"","",["earth_africa"],5,34,15,0],
  33706. "1f30e":[["\uD83C\uDF0E"],"","",["earth_americas"],5,35,15,0],
  33707. "1f30f":[["\uD83C\uDF0F"],"","\uDBB8\uDC39",["earth_asia"],5,36,15,0],
  33708. "1f310":[["\uD83C\uDF10"],"","",["globe_with_meridians"],5,37,15,0],
  33709. "1f311":[["\uD83C\uDF11"],"","\uDBB8\uDC11",["new_moon"],5,38,15,0],
  33710. "1f312":[["\uD83C\uDF12"],"","",["waxing_crescent_moon"],5,39,15,0],
  33711. "1f313":[["\uD83C\uDF13"],"\uE04C","\uDBB8\uDC13",["first_quarter_moon"],5,40,15,0],
  33712. "1f314":[["\uD83C\uDF14"],"\uE04C","\uDBB8\uDC12",["moon","waxing_gibbous_moon"],6,0,15,0],
  33713. "1f315":[["\uD83C\uDF15"],"","\uDBB8\uDC15",["full_moon"],6,1,15,0],
  33714. "1f316":[["\uD83C\uDF16"],"","",["waning_gibbous_moon"],6,2,15,0],
  33715. "1f317":[["\uD83C\uDF17"],"","",["last_quarter_moon"],6,3,15,0],
  33716. "1f318":[["\uD83C\uDF18"],"","",["waning_crescent_moon"],6,4,15,0],
  33717. "1f319":[["\uD83C\uDF19"],"\uE04C","\uDBB8\uDC14",["crescent_moon"],6,5,15,0],
  33718. "1f31a":[["\uD83C\uDF1A"],"","",["new_moon_with_face"],6,6,15,0],
  33719. "1f31b":[["\uD83C\uDF1B"],"\uE04C","\uDBB8\uDC16",["first_quarter_moon_with_face"],6,7,15,0],
  33720. "1f31c":[["\uD83C\uDF1C"],"","",["last_quarter_moon_with_face"],6,8,15,0],
  33721. "1f31d":[["\uD83C\uDF1D"],"","",["full_moon_with_face"],6,9,15,0],
  33722. "1f31e":[["\uD83C\uDF1E"],"","",["sun_with_face"],6,10,15,0],
  33723. "1f31f":[["\uD83C\uDF1F"],"\uE335","\uDBBA\uDF69",["star2"],6,11,15,0],
  33724. "1f320":[["\uD83C\uDF20"],"","\uDBBA\uDF6A",["stars"],6,12,15,0],
  33725. "1f321":[["\uD83C\uDF21"],"","",["thermometer"],6,13,15,0],
  33726. "1f324":[["\uD83C\uDF24"],"","",["mostly_sunny","sun_small_cloud"],6,14,15,0],
  33727. "1f325":[["\uD83C\uDF25"],"","",["barely_sunny","sun_behind_cloud"],6,15,15,0],
  33728. "1f326":[["\uD83C\uDF26"],"","",["partly_sunny_rain","sun_behind_rain_cloud"],6,16,15,0],
  33729. "1f327":[["\uD83C\uDF27"],"","",["rain_cloud"],6,17,15,0],
  33730. "1f328":[["\uD83C\uDF28"],"","",["snow_cloud"],6,18,15,0],
  33731. "1f329":[["\uD83C\uDF29"],"","",["lightning","lightning_cloud"],6,19,15,0],
  33732. "1f32a":[["\uD83C\uDF2A"],"","",["tornado","tornado_cloud"],6,20,15,0],
  33733. "1f32b":[["\uD83C\uDF2B"],"","",["fog"],6,21,15,0],
  33734. "1f32c":[["\uD83C\uDF2C"],"","",["wind_blowing_face"],6,22,15,0],
  33735. "1f32d":[["\uD83C\uDF2D"],"","",["hotdog"],6,23,15,0],
  33736. "1f32e":[["\uD83C\uDF2E"],"","",["taco"],6,24,15,0],
  33737. "1f32f":[["\uD83C\uDF2F"],"","",["burrito"],6,25,15,0],
  33738. "1f330":[["\uD83C\uDF30"],"","\uDBB8\uDC4C",["chestnut"],6,26,15,0],
  33739. "1f331":[["\uD83C\uDF31"],"\uE110","\uDBB8\uDC3E",["seedling"],6,27,15,0],
  33740. "1f332":[["\uD83C\uDF32"],"","",["evergreen_tree"],6,28,15,0],
  33741. "1f333":[["\uD83C\uDF33"],"","",["deciduous_tree"],6,29,15,0],
  33742. "1f334":[["\uD83C\uDF34"],"\uE307","\uDBB8\uDC47",["palm_tree"],6,30,15,0],
  33743. "1f335":[["\uD83C\uDF35"],"\uE308","\uDBB8\uDC48",["cactus"],6,31,15,0],
  33744. "1f336":[["\uD83C\uDF36"],"","",["hot_pepper"],6,32,15,0],
  33745. "1f337":[["\uD83C\uDF37"],"\uE304","\uDBB8\uDC3D",["tulip"],6,33,15,0],
  33746. "1f338":[["\uD83C\uDF38"],"\uE030","\uDBB8\uDC40",["cherry_blossom"],6,34,15,0],
  33747. "1f339":[["\uD83C\uDF39"],"\uE032","\uDBB8\uDC41",["rose"],6,35,15,0],
  33748. "1f33a":[["\uD83C\uDF3A"],"\uE303","\uDBB8\uDC45",["hibiscus"],6,36,15,0],
  33749. "1f33b":[["\uD83C\uDF3B"],"\uE305","\uDBB8\uDC46",["sunflower"],6,37,15,0],
  33750. "1f33c":[["\uD83C\uDF3C"],"\uE305","\uDBB8\uDC4D",["blossom"],6,38,15,0],
  33751. "1f33d":[["\uD83C\uDF3D"],"","\uDBB8\uDC4A",["corn"],6,39,15,0],
  33752. "1f33e":[["\uD83C\uDF3E"],"\uE444","\uDBB8\uDC49",["ear_of_rice"],6,40,15,0],
  33753. "1f33f":[["\uD83C\uDF3F"],"\uE110","\uDBB8\uDC4E",["herb"],7,0,15,0],
  33754. "1f340":[["\uD83C\uDF40"],"\uE110","\uDBB8\uDC3C",["four_leaf_clover"],7,1,15,0],
  33755. "1f341":[["\uD83C\uDF41"],"\uE118","\uDBB8\uDC3F",["maple_leaf"],7,2,15,0],
  33756. "1f342":[["\uD83C\uDF42"],"\uE119","\uDBB8\uDC42",["fallen_leaf"],7,3,15,0],
  33757. "1f343":[["\uD83C\uDF43"],"\uE447","\uDBB8\uDC43",["leaves"],7,4,15,0],
  33758. "1f344":[["\uD83C\uDF44"],"","\uDBB8\uDC4B",["mushroom"],7,5,15,0],
  33759. "1f345":[["\uD83C\uDF45"],"\uE349","\uDBB8\uDC55",["tomato"],7,6,15,0],
  33760. "1f346":[["\uD83C\uDF46"],"\uE34A","\uDBB8\uDC56",["eggplant"],7,7,15,0],
  33761. "1f347":[["\uD83C\uDF47"],"","\uDBB8\uDC59",["grapes"],7,8,15,0],
  33762. "1f348":[["\uD83C\uDF48"],"","\uDBB8\uDC57",["melon"],7,9,15,0],
  33763. "1f349":[["\uD83C\uDF49"],"\uE348","\uDBB8\uDC54",["watermelon"],7,10,15,0],
  33764. "1f34a":[["\uD83C\uDF4A"],"\uE346","\uDBB8\uDC52",["tangerine"],7,11,15,0],
  33765. "1f34b":[["\uD83C\uDF4B"],"","",["lemon"],7,12,15,0],
  33766. "1f34c":[["\uD83C\uDF4C"],"","\uDBB8\uDC50",["banana"],7,13,15,0],
  33767. "1f34d":[["\uD83C\uDF4D"],"","\uDBB8\uDC58",["pineapple"],7,14,15,0],
  33768. "1f34e":[["\uD83C\uDF4E"],"\uE345","\uDBB8\uDC51",["apple"],7,15,15,0],
  33769. "1f34f":[["\uD83C\uDF4F"],"\uE345","\uDBB8\uDC5B",["green_apple"],7,16,15,0],
  33770. "1f350":[["\uD83C\uDF50"],"","",["pear"],7,17,15,0],
  33771. "1f351":[["\uD83C\uDF51"],"","\uDBB8\uDC5A",["peach"],7,18,15,0],
  33772. "1f352":[["\uD83C\uDF52"],"","\uDBB8\uDC4F",["cherries"],7,19,15,0],
  33773. "1f353":[["\uD83C\uDF53"],"\uE347","\uDBB8\uDC53",["strawberry"],7,20,15,0],
  33774. "1f354":[["\uD83C\uDF54"],"\uE120","\uDBBA\uDD60",["hamburger"],7,21,15,0],
  33775. "1f355":[["\uD83C\uDF55"],"","\uDBBA\uDD75",["pizza"],7,22,15,0],
  33776. "1f356":[["\uD83C\uDF56"],"","\uDBBA\uDD72",["meat_on_bone"],7,23,15,0],
  33777. "1f357":[["\uD83C\uDF57"],"","\uDBBA\uDD76",["poultry_leg"],7,24,15,0],
  33778. "1f358":[["\uD83C\uDF58"],"\uE33D","\uDBBA\uDD69",["rice_cracker"],7,25,15,0],
  33779. "1f359":[["\uD83C\uDF59"],"\uE342","\uDBBA\uDD61",["rice_ball"],7,26,15,0],
  33780. "1f35a":[["\uD83C\uDF5A"],"\uE33E","\uDBBA\uDD6A",["rice"],7,27,15,0],
  33781. "1f35b":[["\uD83C\uDF5B"],"\uE341","\uDBBA\uDD6C",["curry"],7,28,15,0],
  33782. "1f35c":[["\uD83C\uDF5C"],"\uE340","\uDBBA\uDD63",["ramen"],7,29,15,0],
  33783. "1f35d":[["\uD83C\uDF5D"],"\uE33F","\uDBBA\uDD6B",["spaghetti"],7,30,15,0],
  33784. "1f35e":[["\uD83C\uDF5E"],"\uE339","\uDBBA\uDD64",["bread"],7,31,15,0],
  33785. "1f35f":[["\uD83C\uDF5F"],"\uE33B","\uDBBA\uDD67",["fries"],7,32,15,0],
  33786. "1f360":[["\uD83C\uDF60"],"","\uDBBA\uDD74",["sweet_potato"],7,33,15,0],
  33787. "1f361":[["\uD83C\uDF61"],"\uE33C","\uDBBA\uDD68",["dango"],7,34,15,0],
  33788. "1f362":[["\uD83C\uDF62"],"\uE343","\uDBBA\uDD6D",["oden"],7,35,15,0],
  33789. "1f363":[["\uD83C\uDF63"],"\uE344","\uDBBA\uDD6E",["sushi"],7,36,15,0],
  33790. "1f364":[["\uD83C\uDF64"],"","\uDBBA\uDD7F",["fried_shrimp"],7,37,15,0],
  33791. "1f365":[["\uD83C\uDF65"],"","\uDBBA\uDD73",["fish_cake"],7,38,15,0],
  33792. "1f366":[["\uD83C\uDF66"],"\uE33A","\uDBBA\uDD66",["icecream"],7,39,15,0],
  33793. "1f367":[["\uD83C\uDF67"],"\uE43F","\uDBBA\uDD71",["shaved_ice"],7,40,15,0],
  33794. "1f368":[["\uD83C\uDF68"],"","\uDBBA\uDD77",["ice_cream"],8,0,15,0],
  33795. "1f369":[["\uD83C\uDF69"],"","\uDBBA\uDD78",["doughnut"],8,1,15,0],
  33796. "1f36a":[["\uD83C\uDF6A"],"","\uDBBA\uDD79",["cookie"],8,2,15,0],
  33797. "1f36b":[["\uD83C\uDF6B"],"","\uDBBA\uDD7A",["chocolate_bar"],8,3,15,0],
  33798. "1f36c":[["\uD83C\uDF6C"],"","\uDBBA\uDD7B",["candy"],8,4,15,0],
  33799. "1f36d":[["\uD83C\uDF6D"],"","\uDBBA\uDD7C",["lollipop"],8,5,15,0],
  33800. "1f36e":[["\uD83C\uDF6E"],"","\uDBBA\uDD7D",["custard"],8,6,15,0],
  33801. "1f36f":[["\uD83C\uDF6F"],"","\uDBBA\uDD7E",["honey_pot"],8,7,15,0],
  33802. "1f370":[["\uD83C\uDF70"],"\uE046","\uDBBA\uDD62",["cake"],8,8,15,0],
  33803. "1f371":[["\uD83C\uDF71"],"\uE34C","\uDBBA\uDD6F",["bento"],8,9,15,0],
  33804. "1f372":[["\uD83C\uDF72"],"\uE34D","\uDBBA\uDD70",["stew"],8,10,15,0],
  33805. "1f373":[["\uD83C\uDF73"],"\uE147","\uDBBA\uDD65",["egg"],8,11,15,0],
  33806. "1f374":[["\uD83C\uDF74"],"\uE043","\uDBBA\uDD80",["fork_and_knife"],8,12,15,0],
  33807. "1f375":[["\uD83C\uDF75"],"\uE338","\uDBBA\uDD84",["tea"],8,13,15,0],
  33808. "1f376":[["\uD83C\uDF76"],"\uE30B","\uDBBA\uDD85",["sake"],8,14,15,0],
  33809. "1f377":[["\uD83C\uDF77"],"\uE044","\uDBBA\uDD86",["wine_glass"],8,15,15,0],
  33810. "1f378":[["\uD83C\uDF78"],"\uE044","\uDBBA\uDD82",["cocktail"],8,16,15,0],
  33811. "1f379":[["\uD83C\uDF79"],"\uE044","\uDBBA\uDD88",["tropical_drink"],8,17,15,0],
  33812. "1f37a":[["\uD83C\uDF7A"],"\uE047","\uDBBA\uDD83",["beer"],8,18,15,0],
  33813. "1f37b":[["\uD83C\uDF7B"],"\uE30C","\uDBBA\uDD87",["beers"],8,19,15,0],
  33814. "1f37c":[["\uD83C\uDF7C"],"","",["baby_bottle"],8,20,15,0],
  33815. "1f37d":[["\uD83C\uDF7D"],"","",["knife_fork_plate"],8,21,15,0],
  33816. "1f37e":[["\uD83C\uDF7E"],"","",["champagne"],8,22,15,0],
  33817. "1f37f":[["\uD83C\uDF7F"],"","",["popcorn"],8,23,15,0],
  33818. "1f380":[["\uD83C\uDF80"],"\uE314","\uDBB9\uDD0F",["ribbon"],8,24,15,0],
  33819. "1f381":[["\uD83C\uDF81"],"\uE112","\uDBB9\uDD10",["gift"],8,25,15,0],
  33820. "1f382":[["\uD83C\uDF82"],"\uE34B","\uDBB9\uDD11",["birthday"],8,26,15,0],
  33821. "1f383":[["\uD83C\uDF83"],"\uE445","\uDBB9\uDD1F",["jack_o_lantern"],8,27,15,0],
  33822. "1f384":[["\uD83C\uDF84"],"\uE033","\uDBB9\uDD12",["christmas_tree"],8,28,15,0],
  33823. "1f385":[["\uD83C\uDF85"],"\uE448","\uDBB9\uDD13",["santa"],8,29,15,0],
  33824. "1f386":[["\uD83C\uDF86"],"\uE117","\uDBB9\uDD15",["fireworks"],8,35,15,0],
  33825. "1f387":[["\uD83C\uDF87"],"\uE440","\uDBB9\uDD1D",["sparkler"],8,36,15,0],
  33826. "1f388":[["\uD83C\uDF88"],"\uE310","\uDBB9\uDD16",["balloon"],8,37,15,0],
  33827. "1f389":[["\uD83C\uDF89"],"\uE312","\uDBB9\uDD17",["tada"],8,38,15,0],
  33828. "1f38a":[["\uD83C\uDF8A"],"","\uDBB9\uDD20",["confetti_ball"],8,39,15,0],
  33829. "1f38b":[["\uD83C\uDF8B"],"","\uDBB9\uDD21",["tanabata_tree"],8,40,15,0],
  33830. "1f38c":[["\uD83C\uDF8C"],"\uE143","\uDBB9\uDD14",["crossed_flags"],9,0,15,0],
  33831. "1f38d":[["\uD83C\uDF8D"],"\uE436","\uDBB9\uDD18",["bamboo"],9,1,15,0],
  33832. "1f38e":[["\uD83C\uDF8E"],"\uE438","\uDBB9\uDD19",["dolls"],9,2,15,0],
  33833. "1f38f":[["\uD83C\uDF8F"],"\uE43B","\uDBB9\uDD1C",["flags"],9,3,15,0],
  33834. "1f390":[["\uD83C\uDF90"],"\uE442","\uDBB9\uDD1E",["wind_chime"],9,4,15,0],
  33835. "1f391":[["\uD83C\uDF91"],"\uE446","\uDBB8\uDC17",["rice_scene"],9,5,15,0],
  33836. "1f392":[["\uD83C\uDF92"],"\uE43A","\uDBB9\uDD1B",["school_satchel"],9,6,15,0],
  33837. "1f393":[["\uD83C\uDF93"],"\uE439","\uDBB9\uDD1A",["mortar_board"],9,7,15,0],
  33838. "1f396":[["\uD83C\uDF96"],"","",["medal"],9,8,15,0],
  33839. "1f397":[["\uD83C\uDF97"],"","",["reminder_ribbon"],9,9,15,0],
  33840. "1f399":[["\uD83C\uDF99"],"","",["studio_microphone"],9,10,15,0],
  33841. "1f39a":[["\uD83C\uDF9A"],"","",["level_slider"],9,11,15,0],
  33842. "1f39b":[["\uD83C\uDF9B"],"","",["control_knobs"],9,12,15,0],
  33843. "1f39e":[["\uD83C\uDF9E"],"","",["film_frames"],9,13,15,0],
  33844. "1f39f":[["\uD83C\uDF9F"],"","",["admission_tickets"],9,14,15,0],
  33845. "1f3a0":[["\uD83C\uDFA0"],"","\uDBB9\uDFFC",["carousel_horse"],9,15,15,0],
  33846. "1f3a1":[["\uD83C\uDFA1"],"\uE124","\uDBB9\uDFFD",["ferris_wheel"],9,16,15,0],
  33847. "1f3a2":[["\uD83C\uDFA2"],"\uE433","\uDBB9\uDFFE",["roller_coaster"],9,17,15,0],
  33848. "1f3a3":[["\uD83C\uDFA3"],"\uE019","\uDBB9\uDFFF",["fishing_pole_and_fish"],9,18,15,0],
  33849. "1f3a4":[["\uD83C\uDFA4"],"\uE03C","\uDBBA\uDC00",["microphone"],9,19,15,0],
  33850. "1f3a5":[["\uD83C\uDFA5"],"\uE03D","\uDBBA\uDC01",["movie_camera"],9,20,15,0],
  33851. "1f3a6":[["\uD83C\uDFA6"],"\uE507","\uDBBA\uDC02",["cinema"],9,21,15,0],
  33852. "1f3a7":[["\uD83C\uDFA7"],"\uE30A","\uDBBA\uDC03",["headphones"],9,22,15,0],
  33853. "1f3a8":[["\uD83C\uDFA8"],"\uE502","\uDBBA\uDC04",["art"],9,23,15,0],
  33854. "1f3a9":[["\uD83C\uDFA9"],"\uE503","\uDBBA\uDC05",["tophat"],9,24,15,0],
  33855. "1f3aa":[["\uD83C\uDFAA"],"","\uDBBA\uDC06",["circus_tent"],9,25,15,0],
  33856. "1f3ab":[["\uD83C\uDFAB"],"\uE125","\uDBBA\uDC07",["ticket"],9,26,15,0],
  33857. "1f3ac":[["\uD83C\uDFAC"],"\uE324","\uDBBA\uDC08",["clapper"],9,27,15,0],
  33858. "1f3ad":[["\uD83C\uDFAD"],"\uE503","\uDBBA\uDC09",["performing_arts"],9,28,15,0],
  33859. "1f3ae":[["\uD83C\uDFAE"],"","\uDBBA\uDC0A",["video_game"],9,29,15,0],
  33860. "1f3af":[["\uD83C\uDFAF"],"\uE130","\uDBBA\uDC0C",["dart"],9,30,15,0],
  33861. "1f3b0":[["\uD83C\uDFB0"],"\uE133","\uDBBA\uDC0D",["slot_machine"],9,31,15,0],
  33862. "1f3b1":[["\uD83C\uDFB1"],"\uE42C","\uDBBA\uDC0E",["8ball"],9,32,15,0],
  33863. "1f3b2":[["\uD83C\uDFB2"],"","\uDBBA\uDC0F",["game_die"],9,33,15,0],
  33864. "1f3b3":[["\uD83C\uDFB3"],"","\uDBBA\uDC10",["bowling"],9,34,15,0],
  33865. "1f3b4":[["\uD83C\uDFB4"],"","\uDBBA\uDC11",["flower_playing_cards"],9,35,15,0],
  33866. "1f3b5":[["\uD83C\uDFB5"],"\uE03E","\uDBBA\uDC13",["musical_note"],9,36,15,0],
  33867. "1f3b6":[["\uD83C\uDFB6"],"\uE326","\uDBBA\uDC14",["notes"],9,37,15,0],
  33868. "1f3b7":[["\uD83C\uDFB7"],"\uE040","\uDBBA\uDC15",["saxophone"],9,38,15,0],
  33869. "1f3b8":[["\uD83C\uDFB8"],"\uE041","\uDBBA\uDC16",["guitar"],9,39,15,0],
  33870. "1f3b9":[["\uD83C\uDFB9"],"","\uDBBA\uDC17",["musical_keyboard"],9,40,15,0],
  33871. "1f3ba":[["\uD83C\uDFBA"],"\uE042","\uDBBA\uDC18",["trumpet"],10,0,15,0],
  33872. "1f3bb":[["\uD83C\uDFBB"],"","\uDBBA\uDC19",["violin"],10,1,15,0],
  33873. "1f3bc":[["\uD83C\uDFBC"],"\uE326","\uDBBA\uDC1A",["musical_score"],10,2,15,0],
  33874. "1f3bd":[["\uD83C\uDFBD"],"","\uDBB9\uDFD0",["running_shirt_with_sash"],10,3,15,0],
  33875. "1f3be":[["\uD83C\uDFBE"],"\uE015","\uDBB9\uDFD3",["tennis"],10,4,15,0],
  33876. "1f3bf":[["\uD83C\uDFBF"],"\uE013","\uDBB9\uDFD5",["ski"],10,5,15,0],
  33877. "1f3c0":[["\uD83C\uDFC0"],"\uE42A","\uDBB9\uDFD6",["basketball"],10,6,15,0],
  33878. "1f3c1":[["\uD83C\uDFC1"],"\uE132","\uDBB9\uDFD7",["checkered_flag"],10,7,15,0],
  33879. "1f3c2":[["\uD83C\uDFC2"],"","\uDBB9\uDFD8",["snowboarder"],10,8,15,0],
  33880. "1f3c3":[["\uD83C\uDFC3"],"\uE115","\uDBB9\uDFD9",["runner","running"],10,9,15,0],
  33881. "1f3c4":[["\uD83C\uDFC4"],"\uE017","\uDBB9\uDFDA",["surfer"],10,15,15,0],
  33882. "1f3c5":[["\uD83C\uDFC5"],"","",["sports_medal"],10,21,15,0],
  33883. "1f3c6":[["\uD83C\uDFC6"],"\uE131","\uDBB9\uDFDB",["trophy"],10,22,15,0],
  33884. "1f3c7":[["\uD83C\uDFC7"],"","",["horse_racing"],10,23,15,0],
  33885. "1f3c8":[["\uD83C\uDFC8"],"\uE42B","\uDBB9\uDFDD",["football"],10,24,15,0],
  33886. "1f3c9":[["\uD83C\uDFC9"],"","",["rugby_football"],10,25,15,0],
  33887. "1f3ca":[["\uD83C\uDFCA"],"\uE42D","\uDBB9\uDFDE",["swimmer"],10,26,15,0],
  33888. "1f3cb":[["\uD83C\uDFCB"],"","",["weight_lifter"],10,32,15,0],
  33889. "1f3cc":[["\uD83C\uDFCC"],"","",["golfer"],10,38,15,0],
  33890. "1f3cd":[["\uD83C\uDFCD"],"","",["racing_motorcycle"],10,39,15,0],
  33891. "1f3ce":[["\uD83C\uDFCE"],"","",["racing_car"],10,40,15,0],
  33892. "1f3cf":[["\uD83C\uDFCF"],"","",["cricket_bat_and_ball"],11,0,15,0],
  33893. "1f3d0":[["\uD83C\uDFD0"],"","",["volleyball"],11,1,15,0],
  33894. "1f3d1":[["\uD83C\uDFD1"],"","",["field_hockey_stick_and_ball"],11,2,15,0],
  33895. "1f3d2":[["\uD83C\uDFD2"],"","",["ice_hockey_stick_and_puck"],11,3,15,0],
  33896. "1f3d3":[["\uD83C\uDFD3"],"","",["table_tennis_paddle_and_ball"],11,4,15,0],
  33897. "1f3d4":[["\uD83C\uDFD4"],"","",["snow_capped_mountain"],11,5,15,0],
  33898. "1f3d5":[["\uD83C\uDFD5"],"","",["camping"],11,6,15,0],
  33899. "1f3d6":[["\uD83C\uDFD6"],"","",["beach_with_umbrella"],11,7,15,0],
  33900. "1f3d7":[["\uD83C\uDFD7"],"","",["building_construction"],11,8,15,0],
  33901. "1f3d8":[["\uD83C\uDFD8"],"","",["house_buildings"],11,9,15,0],
  33902. "1f3d9":[["\uD83C\uDFD9"],"","",["cityscape"],11,10,15,0],
  33903. "1f3da":[["\uD83C\uDFDA"],"","",["derelict_house_building"],11,11,15,0],
  33904. "1f3db":[["\uD83C\uDFDB"],"","",["classical_building"],11,12,15,0],
  33905. "1f3dc":[["\uD83C\uDFDC"],"","",["desert"],11,13,15,0],
  33906. "1f3dd":[["\uD83C\uDFDD"],"","",["desert_island"],11,14,15,0],
  33907. "1f3de":[["\uD83C\uDFDE"],"","",["national_park"],11,15,15,0],
  33908. "1f3df":[["\uD83C\uDFDF"],"","",["stadium"],11,16,15,0],
  33909. "1f3e0":[["\uD83C\uDFE0"],"\uE036","\uDBB9\uDCB0",["house"],11,17,15,0],
  33910. "1f3e1":[["\uD83C\uDFE1"],"\uE036","\uDBB9\uDCB1",["house_with_garden"],11,18,15,0],
  33911. "1f3e2":[["\uD83C\uDFE2"],"\uE038","\uDBB9\uDCB2",["office"],11,19,15,0],
  33912. "1f3e3":[["\uD83C\uDFE3"],"\uE153","\uDBB9\uDCB3",["post_office"],11,20,15,0],
  33913. "1f3e4":[["\uD83C\uDFE4"],"","",["european_post_office"],11,21,15,0],
  33914. "1f3e5":[["\uD83C\uDFE5"],"\uE155","\uDBB9\uDCB4",["hospital"],11,22,15,0],
  33915. "1f3e6":[["\uD83C\uDFE6"],"\uE14D","\uDBB9\uDCB5",["bank"],11,23,15,0],
  33916. "1f3e7":[["\uD83C\uDFE7"],"\uE154","\uDBB9\uDCB6",["atm"],11,24,15,0],
  33917. "1f3e8":[["\uD83C\uDFE8"],"\uE158","\uDBB9\uDCB7",["hotel"],11,25,15,0],
  33918. "1f3e9":[["\uD83C\uDFE9"],"\uE501","\uDBB9\uDCB8",["love_hotel"],11,26,15,0],
  33919. "1f3ea":[["\uD83C\uDFEA"],"\uE156","\uDBB9\uDCB9",["convenience_store"],11,27,15,0],
  33920. "1f3eb":[["\uD83C\uDFEB"],"\uE157","\uDBB9\uDCBA",["school"],11,28,15,0],
  33921. "1f3ec":[["\uD83C\uDFEC"],"\uE504","\uDBB9\uDCBD",["department_store"],11,29,15,0],
  33922. "1f3ed":[["\uD83C\uDFED"],"\uE508","\uDBB9\uDCC0",["factory"],11,30,15,0],
  33923. "1f3ee":[["\uD83C\uDFEE"],"\uE30B","\uDBB9\uDCC2",["izakaya_lantern","lantern"],11,31,15,0],
  33924. "1f3ef":[["\uD83C\uDFEF"],"\uE505","\uDBB9\uDCBE",["japanese_castle"],11,32,15,0],
  33925. "1f3f0":[["\uD83C\uDFF0"],"\uE506","\uDBB9\uDCBF",["european_castle"],11,33,15,0],
  33926. "1f3f3":[["\uD83C\uDFF3"],"","",["waving_white_flag"],11,34,15,0],
  33927. "1f3f4":[["\uD83C\uDFF4"],"","",["waving_black_flag"],11,35,15,0],
  33928. "1f3f5":[["\uD83C\uDFF5"],"","",["rosette"],11,36,15,0],
  33929. "1f3f7":[["\uD83C\uDFF7"],"","",["label"],11,37,15,0],
  33930. "1f3f8":[["\uD83C\uDFF8"],"","",["badminton_racquet_and_shuttlecock"],11,38,15,0],
  33931. "1f3f9":[["\uD83C\uDFF9"],"","",["bow_and_arrow"],11,39,15,0],
  33932. "1f3fa":[["\uD83C\uDFFA"],"","",["amphora"],11,40,15,0],
  33933. "1f3fb":[["\uD83C\uDFFB"],"","",["skin-tone-2"],12,0,13,0],
  33934. "1f3fc":[["\uD83C\uDFFC"],"","",["skin-tone-3"],12,1,13,0],
  33935. "1f3fd":[["\uD83C\uDFFD"],"","",["skin-tone-4"],12,2,13,0],
  33936. "1f3fe":[["\uD83C\uDFFE"],"","",["skin-tone-5"],12,3,13,0],
  33937. "1f3ff":[["\uD83C\uDFFF"],"","",["skin-tone-6"],12,4,13,0],
  33938. "1f400":[["\uD83D\uDC00"],"","",["rat"],12,5,15,0],
  33939. "1f401":[["\uD83D\uDC01"],"","",["mouse2"],12,6,15,0],
  33940. "1f402":[["\uD83D\uDC02"],"","",["ox"],12,7,15,0],
  33941. "1f403":[["\uD83D\uDC03"],"","",["water_buffalo"],12,8,15,0],
  33942. "1f404":[["\uD83D\uDC04"],"","",["cow2"],12,9,15,0],
  33943. "1f405":[["\uD83D\uDC05"],"","",["tiger2"],12,10,15,0],
  33944. "1f406":[["\uD83D\uDC06"],"","",["leopard"],12,11,15,0],
  33945. "1f407":[["\uD83D\uDC07"],"","",["rabbit2"],12,12,15,0],
  33946. "1f408":[["\uD83D\uDC08"],"","",["cat2"],12,13,15,0],
  33947. "1f409":[["\uD83D\uDC09"],"","",["dragon"],12,14,15,0],
  33948. "1f40a":[["\uD83D\uDC0A"],"","",["crocodile"],12,15,15,0],
  33949. "1f40b":[["\uD83D\uDC0B"],"","",["whale2"],12,16,15,0],
  33950. "1f40c":[["\uD83D\uDC0C"],"","\uDBB8\uDDB9",["snail"],12,17,15,0],
  33951. "1f40d":[["\uD83D\uDC0D"],"\uE52D","\uDBB8\uDDD3",["snake"],12,18,15,0],
  33952. "1f40e":[["\uD83D\uDC0E"],"\uE134","\uDBB9\uDFDC",["racehorse"],12,19,15,0],
  33953. "1f40f":[["\uD83D\uDC0F"],"","",["ram"],12,20,15,0],
  33954. "1f410":[["\uD83D\uDC10"],"","",["goat"],12,21,15,0],
  33955. "1f411":[["\uD83D\uDC11"],"\uE529","\uDBB8\uDDCF",["sheep"],12,22,15,0],
  33956. "1f412":[["\uD83D\uDC12"],"\uE528","\uDBB8\uDDCE",["monkey"],12,23,15,0],
  33957. "1f413":[["\uD83D\uDC13"],"","",["rooster"],12,24,15,0],
  33958. "1f414":[["\uD83D\uDC14"],"\uE52E","\uDBB8\uDDD4",["chicken"],12,25,15,0],
  33959. "1f415":[["\uD83D\uDC15"],"","",["dog2"],12,26,15,0],
  33960. "1f416":[["\uD83D\uDC16"],"","",["pig2"],12,27,15,0],
  33961. "1f417":[["\uD83D\uDC17"],"\uE52F","\uDBB8\uDDD5",["boar"],12,28,15,0],
  33962. "1f418":[["\uD83D\uDC18"],"\uE526","\uDBB8\uDDCC",["elephant"],12,29,15,0],
  33963. "1f419":[["\uD83D\uDC19"],"\uE10A","\uDBB8\uDDC5",["octopus"],12,30,15,0],
  33964. "1f41a":[["\uD83D\uDC1A"],"\uE441","\uDBB8\uDDC6",["shell"],12,31,15,0],
  33965. "1f41b":[["\uD83D\uDC1B"],"\uE525","\uDBB8\uDDCB",["bug"],12,32,15,0],
  33966. "1f41c":[["\uD83D\uDC1C"],"","\uDBB8\uDDDA",["ant"],12,33,15,0],
  33967. "1f41d":[["\uD83D\uDC1D"],"","\uDBB8\uDDE1",["bee","honeybee"],12,34,15,0],
  33968. "1f41e":[["\uD83D\uDC1E"],"","\uDBB8\uDDE2",["beetle"],12,35,15,0],
  33969. "1f41f":[["\uD83D\uDC1F"],"\uE019","\uDBB8\uDDBD",["fish"],12,36,15,0],
  33970. "1f420":[["\uD83D\uDC20"],"\uE522","\uDBB8\uDDC9",["tropical_fish"],12,37,15,0],
  33971. "1f421":[["\uD83D\uDC21"],"\uE019","\uDBB8\uDDD9",["blowfish"],12,38,15,0],
  33972. "1f422":[["\uD83D\uDC22"],"","\uDBB8\uDDDC",["turtle"],12,39,15,0],
  33973. "1f423":[["\uD83D\uDC23"],"\uE523","\uDBB8\uDDDD",["hatching_chick"],12,40,15,0],
  33974. "1f424":[["\uD83D\uDC24"],"\uE523","\uDBB8\uDDBA",["baby_chick"],13,0,15,0],
  33975. "1f425":[["\uD83D\uDC25"],"\uE523","\uDBB8\uDDBB",["hatched_chick"],13,1,15,0],
  33976. "1f426":[["\uD83D\uDC26"],"\uE521","\uDBB8\uDDC8",["bird"],13,2,15,0],
  33977. "1f427":[["\uD83D\uDC27"],"\uE055","\uDBB8\uDDBC",["penguin"],13,3,15,0],
  33978. "1f428":[["\uD83D\uDC28"],"\uE527","\uDBB8\uDDCD",["koala"],13,4,15,0],
  33979. "1f429":[["\uD83D\uDC29"],"\uE052","\uDBB8\uDDD8",["poodle"],13,5,15,0],
  33980. "1f42a":[["\uD83D\uDC2A"],"","",["dromedary_camel"],13,6,15,0],
  33981. "1f42b":[["\uD83D\uDC2B"],"\uE530","\uDBB8\uDDD6",["camel"],13,7,15,0],
  33982. "1f42c":[["\uD83D\uDC2C"],"\uE520","\uDBB8\uDDC7",["dolphin","flipper"],13,8,15,0],
  33983. "1f42d":[["\uD83D\uDC2D"],"\uE053","\uDBB8\uDDC2",["mouse"],13,9,15,0],
  33984. "1f42e":[["\uD83D\uDC2E"],"\uE52B","\uDBB8\uDDD1",["cow"],13,10,15,0],
  33985. "1f42f":[["\uD83D\uDC2F"],"\uE050","\uDBB8\uDDC0",["tiger"],13,11,15,0],
  33986. "1f430":[["\uD83D\uDC30"],"\uE52C","\uDBB8\uDDD2",["rabbit"],13,12,15,0],
  33987. "1f431":[["\uD83D\uDC31"],"\uE04F","\uDBB8\uDDB8",["cat"],13,13,15,0],
  33988. "1f432":[["\uD83D\uDC32"],"","\uDBB8\uDDDE",["dragon_face"],13,14,15,0],
  33989. "1f433":[["\uD83D\uDC33"],"\uE054","\uDBB8\uDDC3",["whale"],13,15,15,0],
  33990. "1f434":[["\uD83D\uDC34"],"\uE01A","\uDBB8\uDDBE",["horse"],13,16,15,0],
  33991. "1f435":[["\uD83D\uDC35"],"\uE109","\uDBB8\uDDC4",["monkey_face"],13,17,15,0],
  33992. "1f436":[["\uD83D\uDC36"],"\uE052","\uDBB8\uDDB7",["dog"],13,18,15,0],
  33993. "1f437":[["\uD83D\uDC37"],"\uE10B","\uDBB8\uDDBF",["pig"],13,19,15,0],
  33994. "1f438":[["\uD83D\uDC38"],"\uE531","\uDBB8\uDDD7",["frog"],13,20,15,0],
  33995. "1f439":[["\uD83D\uDC39"],"\uE524","\uDBB8\uDDCA",["hamster"],13,21,15,0],
  33996. "1f43a":[["\uD83D\uDC3A"],"\uE52A","\uDBB8\uDDD0",["wolf"],13,22,15,0],
  33997. "1f43b":[["\uD83D\uDC3B"],"\uE051","\uDBB8\uDDC1",["bear"],13,23,15,0],
  33998. "1f43c":[["\uD83D\uDC3C"],"","\uDBB8\uDDDF",["panda_face"],13,24,15,0],
  33999. "1f43d":[["\uD83D\uDC3D"],"\uE10B","\uDBB8\uDDE0",["pig_nose"],13,25,15,0],
  34000. "1f43e":[["\uD83D\uDC3E"],"\uE536","\uDBB8\uDDDB",["feet","paw_prints"],13,26,15,0],
  34001. "1f43f":[["\uD83D\uDC3F"],"","",["chipmunk"],13,27,15,0],
  34002. "1f440":[["\uD83D\uDC40"],"\uE419","\uDBB8\uDD90",["eyes"],13,28,15,0],
  34003. "1f441":[["\uD83D\uDC41"],"","",["eye"],13,29,15,0],
  34004. "1f442":[["\uD83D\uDC42"],"\uE41B","\uDBB8\uDD91",["ear"],13,30,15,0],
  34005. "1f443":[["\uD83D\uDC43"],"\uE41A","\uDBB8\uDD92",["nose"],13,36,15,0],
  34006. "1f444":[["\uD83D\uDC44"],"\uE41C","\uDBB8\uDD93",["lips"],14,1,15,0],
  34007. "1f445":[["\uD83D\uDC45"],"\uE409","\uDBB8\uDD94",["tongue"],14,2,15,0],
  34008. "1f446":[["\uD83D\uDC46"],"\uE22E","\uDBBA\uDF99",["point_up_2"],14,3,15,0],
  34009. "1f447":[["\uD83D\uDC47"],"\uE22F","\uDBBA\uDF9A",["point_down"],14,9,15,0],
  34010. "1f448":[["\uD83D\uDC48"],"\uE230","\uDBBA\uDF9B",["point_left"],14,15,15,0],
  34011. "1f449":[["\uD83D\uDC49"],"\uE231","\uDBBA\uDF9C",["point_right"],14,21,15,0],
  34012. "1f44a":[["\uD83D\uDC4A"],"\uE00D","\uDBBA\uDF96",["facepunch","punch"],14,27,15,0],
  34013. "1f44b":[["\uD83D\uDC4B"],"\uE41E","\uDBBA\uDF9D",["wave"],14,33,15,0],
  34014. "1f44c":[["\uD83D\uDC4C"],"\uE420","\uDBBA\uDF9F",["ok_hand"],14,39,15,0],
  34015. "1f44d":[["\uD83D\uDC4D"],"\uE00E","\uDBBA\uDF97",["+1","thumbsup"],15,4,15,0],
  34016. "1f44e":[["\uD83D\uDC4E"],"\uE421","\uDBBA\uDFA0",["-1","thumbsdown"],15,10,15,0],
  34017. "1f44f":[["\uD83D\uDC4F"],"\uE41F","\uDBBA\uDF9E",["clap"],15,16,15,0],
  34018. "1f450":[["\uD83D\uDC50"],"\uE422","\uDBBA\uDFA1",["open_hands"],15,22,15,0],
  34019. "1f451":[["\uD83D\uDC51"],"\uE10E","\uDBB9\uDCD1",["crown"],15,28,15,0],
  34020. "1f452":[["\uD83D\uDC52"],"\uE318","\uDBB9\uDCD4",["womans_hat"],15,29,15,0],
  34021. "1f453":[["\uD83D\uDC53"],"","\uDBB9\uDCCE",["eyeglasses"],15,30,15,0],
  34022. "1f454":[["\uD83D\uDC54"],"\uE302","\uDBB9\uDCD3",["necktie"],15,31,15,0],
  34023. "1f455":[["\uD83D\uDC55"],"\uE006","\uDBB9\uDCCF",["shirt","tshirt"],15,32,15,0],
  34024. "1f456":[["\uD83D\uDC56"],"","\uDBB9\uDCD0",["jeans"],15,33,15,0],
  34025. "1f457":[["\uD83D\uDC57"],"\uE319","\uDBB9\uDCD5",["dress"],15,34,15,0],
  34026. "1f458":[["\uD83D\uDC58"],"\uE321","\uDBB9\uDCD9",["kimono"],15,35,15,0],
  34027. "1f459":[["\uD83D\uDC59"],"\uE322","\uDBB9\uDCDA",["bikini"],15,36,15,0],
  34028. "1f45a":[["\uD83D\uDC5A"],"\uE006","\uDBB9\uDCDB",["womans_clothes"],15,37,15,0],
  34029. "1f45b":[["\uD83D\uDC5B"],"","\uDBB9\uDCDC",["purse"],15,38,15,0],
  34030. "1f45c":[["\uD83D\uDC5C"],"\uE323","\uDBB9\uDCF0",["handbag"],15,39,15,0],
  34031. "1f45d":[["\uD83D\uDC5D"],"","\uDBB9\uDCF1",["pouch"],15,40,15,0],
  34032. "1f45e":[["\uD83D\uDC5E"],"\uE007","\uDBB9\uDCCC",["mans_shoe","shoe"],16,0,15,0],
  34033. "1f45f":[["\uD83D\uDC5F"],"\uE007","\uDBB9\uDCCD",["athletic_shoe"],16,1,15,0],
  34034. "1f460":[["\uD83D\uDC60"],"\uE13E","\uDBB9\uDCD6",["high_heel"],16,2,15,0],
  34035. "1f461":[["\uD83D\uDC61"],"\uE31A","\uDBB9\uDCD7",["sandal"],16,3,15,0],
  34036. "1f462":[["\uD83D\uDC62"],"\uE31B","\uDBB9\uDCD8",["boot"],16,4,15,0],
  34037. "1f463":[["\uD83D\uDC63"],"\uE536","\uDBB9\uDD53",["footprints"],16,5,15,0],
  34038. "1f464":[["\uD83D\uDC64"],"","\uDBB8\uDD9A",["bust_in_silhouette"],16,6,15,0],
  34039. "1f465":[["\uD83D\uDC65"],"","",["busts_in_silhouette"],16,7,15,0],
  34040. "1f466":[["\uD83D\uDC66"],"\uE001","\uDBB8\uDD9B",["boy"],16,8,15,0],
  34041. "1f467":[["\uD83D\uDC67"],"\uE002","\uDBB8\uDD9C",["girl"],16,14,15,0],
  34042. "1f468":[["\uD83D\uDC68"],"\uE004","\uDBB8\uDD9D",["man"],16,20,15,0],
  34043. "1f469":[["\uD83D\uDC69"],"\uE005","\uDBB8\uDD9E",["woman"],16,26,15,0],
  34044. "1f46a":[["\uD83D\uDC68\u200D\uD83D\uDC69\u200D\uD83D\uDC66","\uD83D\uDC6A"],"","\uDBB8\uDD9F",["family","man-woman-boy"],16,32,15,0],
  34045. "1f46b":[["\uD83D\uDC6B"],"\uE428","\uDBB8\uDDA0",["couple","man_and_woman_holding_hands"],16,33,15,0],
  34046. "1f46c":[["\uD83D\uDC6C"],"","",["two_men_holding_hands"],16,34,15,0],
  34047. "1f46d":[["\uD83D\uDC6D"],"","",["two_women_holding_hands"],16,35,15,0],
  34048. "1f46e":[["\uD83D\uDC6E"],"\uE152","\uDBB8\uDDA1",["cop"],16,36,15,0],
  34049. "1f46f":[["\uD83D\uDC6F"],"\uE429","\uDBB8\uDDA2",["dancers"],17,1,15,0],
  34050. "1f470":[["\uD83D\uDC70"],"","\uDBB8\uDDA3",["bride_with_veil"],17,2,15,0],
  34051. "1f471":[["\uD83D\uDC71"],"\uE515","\uDBB8\uDDA4",["person_with_blond_hair"],17,8,15,0],
  34052. "1f472":[["\uD83D\uDC72"],"\uE516","\uDBB8\uDDA5",["man_with_gua_pi_mao"],17,14,15,0],
  34053. "1f473":[["\uD83D\uDC73"],"\uE517","\uDBB8\uDDA6",["man_with_turban"],17,20,15,0],
  34054. "1f474":[["\uD83D\uDC74"],"\uE518","\uDBB8\uDDA7",["older_man"],17,26,15,0],
  34055. "1f475":[["\uD83D\uDC75"],"\uE519","\uDBB8\uDDA8",["older_woman"],17,32,15,0],
  34056. "1f476":[["\uD83D\uDC76"],"\uE51A","\uDBB8\uDDA9",["baby"],17,38,15,0],
  34057. "1f477":[["\uD83D\uDC77"],"\uE51B","\uDBB8\uDDAA",["construction_worker"],18,3,15,0],
  34058. "1f478":[["\uD83D\uDC78"],"\uE51C","\uDBB8\uDDAB",["princess"],18,9,15,0],
  34059. "1f479":[["\uD83D\uDC79"],"","\uDBB8\uDDAC",["japanese_ogre"],18,15,15,0],
  34060. "1f47a":[["\uD83D\uDC7A"],"","\uDBB8\uDDAD",["japanese_goblin"],18,16,15,0],
  34061. "1f47b":[["\uD83D\uDC7B"],"\uE11B","\uDBB8\uDDAE",["ghost"],18,17,15,0],
  34062. "1f47c":[["\uD83D\uDC7C"],"\uE04E","\uDBB8\uDDAF",["angel"],18,18,15,0],
  34063. "1f47d":[["\uD83D\uDC7D"],"\uE10C","\uDBB8\uDDB0",["alien"],18,24,15,0],
  34064. "1f47e":[["\uD83D\uDC7E"],"\uE12B","\uDBB8\uDDB1",["space_invader"],18,25,15,0],
  34065. "1f47f":[["\uD83D\uDC7F"],"\uE11A","\uDBB8\uDDB2",["imp"],18,26,15,0],
  34066. "1f480":[["\uD83D\uDC80"],"\uE11C","\uDBB8\uDDB3",["skull"],18,27,15,0],
  34067. "1f481":[["\uD83D\uDC81"],"\uE253","\uDBB8\uDDB4",["information_desk_person"],18,28,15,0],
  34068. "1f482":[["\uD83D\uDC82"],"\uE51E","\uDBB8\uDDB5",["guardsman"],18,34,15,0],
  34069. "1f483":[["\uD83D\uDC83"],"\uE51F","\uDBB8\uDDB6",["dancer"],18,40,15,0],
  34070. "1f484":[["\uD83D\uDC84"],"\uE31C","\uDBB8\uDD95",["lipstick"],19,5,15,0],
  34071. "1f485":[["\uD83D\uDC85"],"\uE31D","\uDBB8\uDD96",["nail_care"],19,6,15,0],
  34072. "1f486":[["\uD83D\uDC86"],"\uE31E","\uDBB8\uDD97",["massage"],19,12,15,0],
  34073. "1f487":[["\uD83D\uDC87"],"\uE31F","\uDBB8\uDD98",["haircut"],19,18,15,0],
  34074. "1f488":[["\uD83D\uDC88"],"\uE320","\uDBB8\uDD99",["barber"],19,24,15,0],
  34075. "1f489":[["\uD83D\uDC89"],"\uE13B","\uDBB9\uDD09",["syringe"],19,25,15,0],
  34076. "1f48a":[["\uD83D\uDC8A"],"\uE30F","\uDBB9\uDD0A",["pill"],19,26,15,0],
  34077. "1f48b":[["\uD83D\uDC8B"],"\uE003","\uDBBA\uDC23",["kiss"],19,27,15,0],
  34078. "1f48c":[["\uD83D\uDC8C"],"\uE103\uE328","\uDBBA\uDC24",["love_letter"],19,28,15,0],
  34079. "1f48d":[["\uD83D\uDC8D"],"\uE034","\uDBBA\uDC25",["ring"],19,29,15,0],
  34080. "1f48e":[["\uD83D\uDC8E"],"\uE035","\uDBBA\uDC26",["gem"],19,30,15,0],
  34081. "1f48f":[["\uD83D\uDC8F"],"\uE111","\uDBBA\uDC27",["couplekiss"],19,31,15,0],
  34082. "1f490":[["\uD83D\uDC90"],"\uE306","\uDBBA\uDC28",["bouquet"],19,32,15,0],
  34083. "1f491":[["\uD83D\uDC91"],"\uE425","\uDBBA\uDC29",["couple_with_heart"],19,33,15,0],
  34084. "1f492":[["\uD83D\uDC92"],"\uE43D","\uDBBA\uDC2A",["wedding"],19,34,15,0],
  34085. "1f493":[["\uD83D\uDC93"],"\uE327","\uDBBA\uDF0D",["heartbeat"],19,35,15,0],
  34086. "1f494":[["\uD83D\uDC94"],"\uE023","\uDBBA\uDF0E",["broken_heart"],19,36,15,0,"<\/3"],
  34087. "1f495":[["\uD83D\uDC95"],"\uE327","\uDBBA\uDF0F",["two_hearts"],19,37,15,0],
  34088. "1f496":[["\uD83D\uDC96"],"\uE327","\uDBBA\uDF10",["sparkling_heart"],19,38,15,0],
  34089. "1f497":[["\uD83D\uDC97"],"\uE328","\uDBBA\uDF11",["heartpulse"],19,39,15,0],
  34090. "1f498":[["\uD83D\uDC98"],"\uE329","\uDBBA\uDF12",["cupid"],19,40,15,0],
  34091. "1f499":[["\uD83D\uDC99"],"\uE32A","\uDBBA\uDF13",["blue_heart"],20,0,15,0,"<3"],
  34092. "1f49a":[["\uD83D\uDC9A"],"\uE32B","\uDBBA\uDF14",["green_heart"],20,1,15,0,"<3"],
  34093. "1f49b":[["\uD83D\uDC9B"],"\uE32C","\uDBBA\uDF15",["yellow_heart"],20,2,15,0,"<3"],
  34094. "1f49c":[["\uD83D\uDC9C"],"\uE32D","\uDBBA\uDF16",["purple_heart"],20,3,15,0,"<3"],
  34095. "1f49d":[["\uD83D\uDC9D"],"\uE437","\uDBBA\uDF17",["gift_heart"],20,4,15,0],
  34096. "1f49e":[["\uD83D\uDC9E"],"\uE327","\uDBBA\uDF18",["revolving_hearts"],20,5,15,0],
  34097. "1f49f":[["\uD83D\uDC9F"],"\uE204","\uDBBA\uDF19",["heart_decoration"],20,6,15,0],
  34098. "1f4a0":[["\uD83D\uDCA0"],"","\uDBBA\uDF55",["diamond_shape_with_a_dot_inside"],20,7,15,0],
  34099. "1f4a1":[["\uD83D\uDCA1"],"\uE10F","\uDBBA\uDF56",["bulb"],20,8,15,0],
  34100. "1f4a2":[["\uD83D\uDCA2"],"\uE334","\uDBBA\uDF57",["anger"],20,9,15,0],
  34101. "1f4a3":[["\uD83D\uDCA3"],"\uE311","\uDBBA\uDF58",["bomb"],20,10,15,0],
  34102. "1f4a4":[["\uD83D\uDCA4"],"\uE13C","\uDBBA\uDF59",["zzz"],20,11,15,0],
  34103. "1f4a5":[["\uD83D\uDCA5"],"","\uDBBA\uDF5A",["boom","collision"],20,12,15,0],
  34104. "1f4a6":[["\uD83D\uDCA6"],"\uE331","\uDBBA\uDF5B",["sweat_drops"],20,13,15,0],
  34105. "1f4a7":[["\uD83D\uDCA7"],"\uE331","\uDBBA\uDF5C",["droplet"],20,14,15,0],
  34106. "1f4a8":[["\uD83D\uDCA8"],"\uE330","\uDBBA\uDF5D",["dash"],20,15,15,0],
  34107. "1f4a9":[["\uD83D\uDCA9"],"\uE05A","\uDBB9\uDCF4",["hankey","poop","shit"],20,16,15,0],
  34108. "1f4aa":[["\uD83D\uDCAA"],"\uE14C","\uDBBA\uDF5E",["muscle"],20,17,15,0],
  34109. "1f4ab":[["\uD83D\uDCAB"],"\uE407","\uDBBA\uDF5F",["dizzy"],20,23,15,0],
  34110. "1f4ac":[["\uD83D\uDCAC"],"","\uDBB9\uDD32",["speech_balloon"],20,24,15,0],
  34111. "1f4ad":[["\uD83D\uDCAD"],"","",["thought_balloon"],20,25,15,0],
  34112. "1f4ae":[["\uD83D\uDCAE"],"","\uDBBA\uDF7A",["white_flower"],20,26,15,0],
  34113. "1f4af":[["\uD83D\uDCAF"],"","\uDBBA\uDF7B",["100"],20,27,15,0],
  34114. "1f4b0":[["\uD83D\uDCB0"],"\uE12F","\uDBB9\uDCDD",["moneybag"],20,28,15,0],
  34115. "1f4b1":[["\uD83D\uDCB1"],"\uE149","\uDBB9\uDCDE",["currency_exchange"],20,29,15,0],
  34116. "1f4b2":[["\uD83D\uDCB2"],"\uE12F","\uDBB9\uDCE0",["heavy_dollar_sign"],20,30,15,0],
  34117. "1f4b3":[["\uD83D\uDCB3"],"","\uDBB9\uDCE1",["credit_card"],20,31,15,0],
  34118. "1f4b4":[["\uD83D\uDCB4"],"","\uDBB9\uDCE2",["yen"],20,32,15,0],
  34119. "1f4b5":[["\uD83D\uDCB5"],"\uE12F","\uDBB9\uDCE3",["dollar"],20,33,15,0],
  34120. "1f4b6":[["\uD83D\uDCB6"],"","",["euro"],20,34,15,0],
  34121. "1f4b7":[["\uD83D\uDCB7"],"","",["pound"],20,35,15,0],
  34122. "1f4b8":[["\uD83D\uDCB8"],"","\uDBB9\uDCE4",["money_with_wings"],20,36,15,0],
  34123. "1f4b9":[["\uD83D\uDCB9"],"\uE14A","\uDBB9\uDCDF",["chart"],20,37,15,0],
  34124. "1f4ba":[["\uD83D\uDCBA"],"\uE11F","\uDBB9\uDD37",["seat"],20,38,15,0],
  34125. "1f4bb":[["\uD83D\uDCBB"],"\uE00C","\uDBB9\uDD38",["computer"],20,39,15,0],
  34126. "1f4bc":[["\uD83D\uDCBC"],"\uE11E","\uDBB9\uDD3B",["briefcase"],20,40,15,0],
  34127. "1f4bd":[["\uD83D\uDCBD"],"\uE316","\uDBB9\uDD3C",["minidisc"],21,0,15,0],
  34128. "1f4be":[["\uD83D\uDCBE"],"\uE316","\uDBB9\uDD3D",["floppy_disk"],21,1,15,0],
  34129. "1f4bf":[["\uD83D\uDCBF"],"\uE126","\uDBBA\uDC1D",["cd"],21,2,15,0],
  34130. "1f4c0":[["\uD83D\uDCC0"],"\uE127","\uDBBA\uDC1E",["dvd"],21,3,15,0],
  34131. "1f4c1":[["\uD83D\uDCC1"],"","\uDBB9\uDD43",["file_folder"],21,4,15,0],
  34132. "1f4c2":[["\uD83D\uDCC2"],"","\uDBB9\uDD44",["open_file_folder"],21,5,15,0],
  34133. "1f4c3":[["\uD83D\uDCC3"],"\uE301","\uDBB9\uDD40",["page_with_curl"],21,6,15,0],
  34134. "1f4c4":[["\uD83D\uDCC4"],"\uE301","\uDBB9\uDD41",["page_facing_up"],21,7,15,0],
  34135. "1f4c5":[["\uD83D\uDCC5"],"","\uDBB9\uDD42",["date"],21,8,15,0],
  34136. "1f4c6":[["\uD83D\uDCC6"],"","\uDBB9\uDD49",["calendar"],21,9,15,0],
  34137. "1f4c7":[["\uD83D\uDCC7"],"\uE148","\uDBB9\uDD4D",["card_index"],21,10,15,0],
  34138. "1f4c8":[["\uD83D\uDCC8"],"\uE14A","\uDBB9\uDD4B",["chart_with_upwards_trend"],21,11,15,0],
  34139. "1f4c9":[["\uD83D\uDCC9"],"","\uDBB9\uDD4C",["chart_with_downwards_trend"],21,12,15,0],
  34140. "1f4ca":[["\uD83D\uDCCA"],"\uE14A","\uDBB9\uDD4A",["bar_chart"],21,13,15,0],
  34141. "1f4cb":[["\uD83D\uDCCB"],"\uE301","\uDBB9\uDD48",["clipboard"],21,14,15,0],
  34142. "1f4cc":[["\uD83D\uDCCC"],"","\uDBB9\uDD4E",["pushpin"],21,15,15,0],
  34143. "1f4cd":[["\uD83D\uDCCD"],"","\uDBB9\uDD3F",["round_pushpin"],21,16,15,0],
  34144. "1f4ce":[["\uD83D\uDCCE"],"","\uDBB9\uDD3A",["paperclip"],21,17,15,0],
  34145. "1f4cf":[["\uD83D\uDCCF"],"","\uDBB9\uDD50",["straight_ruler"],21,18,15,0],
  34146. "1f4d0":[["\uD83D\uDCD0"],"","\uDBB9\uDD51",["triangular_ruler"],21,19,15,0],
  34147. "1f4d1":[["\uD83D\uDCD1"],"\uE301","\uDBB9\uDD52",["bookmark_tabs"],21,20,15,0],
  34148. "1f4d2":[["\uD83D\uDCD2"],"\uE148","\uDBB9\uDD4F",["ledger"],21,21,15,0],
  34149. "1f4d3":[["\uD83D\uDCD3"],"\uE148","\uDBB9\uDD45",["notebook"],21,22,15,0],
  34150. "1f4d4":[["\uD83D\uDCD4"],"\uE148","\uDBB9\uDD47",["notebook_with_decorative_cover"],21,23,15,0],
  34151. "1f4d5":[["\uD83D\uDCD5"],"\uE148","\uDBB9\uDD02",["closed_book"],21,24,15,0],
  34152. "1f4d6":[["\uD83D\uDCD6"],"\uE148","\uDBB9\uDD46",["book","open_book"],21,25,15,0],
  34153. "1f4d7":[["\uD83D\uDCD7"],"\uE148","\uDBB9\uDCFF",["green_book"],21,26,15,0],
  34154. "1f4d8":[["\uD83D\uDCD8"],"\uE148","\uDBB9\uDD00",["blue_book"],21,27,15,0],
  34155. "1f4d9":[["\uD83D\uDCD9"],"\uE148","\uDBB9\uDD01",["orange_book"],21,28,15,0],
  34156. "1f4da":[["\uD83D\uDCDA"],"\uE148","\uDBB9\uDD03",["books"],21,29,15,0],
  34157. "1f4db":[["\uD83D\uDCDB"],"","\uDBB9\uDD04",["name_badge"],21,30,15,0],
  34158. "1f4dc":[["\uD83D\uDCDC"],"","\uDBB9\uDCFD",["scroll"],21,31,15,0],
  34159. "1f4dd":[["\uD83D\uDCDD"],"\uE301","\uDBB9\uDD27",["memo","pencil"],21,32,15,0],
  34160. "1f4de":[["\uD83D\uDCDE"],"\uE009","\uDBB9\uDD24",["telephone_receiver"],21,33,15,0],
  34161. "1f4df":[["\uD83D\uDCDF"],"","\uDBB9\uDD22",["pager"],21,34,15,0],
  34162. "1f4e0":[["\uD83D\uDCE0"],"\uE00B","\uDBB9\uDD28",["fax"],21,35,15,0],
  34163. "1f4e1":[["\uD83D\uDCE1"],"\uE14B","\uDBB9\uDD31",["satellite_antenna"],21,36,15,0],
  34164. "1f4e2":[["\uD83D\uDCE2"],"\uE142","\uDBB9\uDD2F",["loudspeaker"],21,37,15,0],
  34165. "1f4e3":[["\uD83D\uDCE3"],"\uE317","\uDBB9\uDD30",["mega"],21,38,15,0],
  34166. "1f4e4":[["\uD83D\uDCE4"],"","\uDBB9\uDD33",["outbox_tray"],21,39,15,0],
  34167. "1f4e5":[["\uD83D\uDCE5"],"","\uDBB9\uDD34",["inbox_tray"],21,40,15,0],
  34168. "1f4e6":[["\uD83D\uDCE6"],"\uE112","\uDBB9\uDD35",["package"],22,0,15,0],
  34169. "1f4e7":[["\uD83D\uDCE7"],"\uE103","\uDBBA\uDF92",["e-mail"],22,1,15,0],
  34170. "1f4e8":[["\uD83D\uDCE8"],"\uE103","\uDBB9\uDD2A",["incoming_envelope"],22,2,15,0],
  34171. "1f4e9":[["\uD83D\uDCE9"],"\uE103","\uDBB9\uDD2B",["envelope_with_arrow"],22,3,15,0],
  34172. "1f4ea":[["\uD83D\uDCEA"],"\uE101","\uDBB9\uDD2C",["mailbox_closed"],22,4,15,0],
  34173. "1f4eb":[["\uD83D\uDCEB"],"\uE101","\uDBB9\uDD2D",["mailbox"],22,5,15,0],
  34174. "1f4ec":[["\uD83D\uDCEC"],"","",["mailbox_with_mail"],22,6,15,0],
  34175. "1f4ed":[["\uD83D\uDCED"],"","",["mailbox_with_no_mail"],22,7,15,0],
  34176. "1f4ee":[["\uD83D\uDCEE"],"\uE102","\uDBB9\uDD2E",["postbox"],22,8,15,0],
  34177. "1f4ef":[["\uD83D\uDCEF"],"","",["postal_horn"],22,9,15,0],
  34178. "1f4f0":[["\uD83D\uDCF0"],"","\uDBBA\uDC22",["newspaper"],22,10,15,0],
  34179. "1f4f1":[["\uD83D\uDCF1"],"\uE00A","\uDBB9\uDD25",["iphone"],22,11,15,0],
  34180. "1f4f2":[["\uD83D\uDCF2"],"\uE104","\uDBB9\uDD26",["calling"],22,12,15,0],
  34181. "1f4f3":[["\uD83D\uDCF3"],"\uE250","\uDBBA\uDC39",["vibration_mode"],22,13,15,0],
  34182. "1f4f4":[["\uD83D\uDCF4"],"\uE251","\uDBBA\uDC3A",["mobile_phone_off"],22,14,15,0],
  34183. "1f4f5":[["\uD83D\uDCF5"],"","",["no_mobile_phones"],22,15,15,0],
  34184. "1f4f6":[["\uD83D\uDCF6"],"\uE20B","\uDBBA\uDC38",["signal_strength"],22,16,15,0],
  34185. "1f4f7":[["\uD83D\uDCF7"],"\uE008","\uDBB9\uDCEF",["camera"],22,17,15,0],
  34186. "1f4f8":[["\uD83D\uDCF8"],"","",["camera_with_flash"],22,18,15,0],
  34187. "1f4f9":[["\uD83D\uDCF9"],"\uE03D","\uDBB9\uDCF9",["video_camera"],22,19,15,0],
  34188. "1f4fa":[["\uD83D\uDCFA"],"\uE12A","\uDBBA\uDC1C",["tv"],22,20,15,0],
  34189. "1f4fb":[["\uD83D\uDCFB"],"\uE128","\uDBBA\uDC1F",["radio"],22,21,15,0],
  34190. "1f4fc":[["\uD83D\uDCFC"],"\uE129","\uDBBA\uDC20",["vhs"],22,22,15,0],
  34191. "1f4fd":[["\uD83D\uDCFD"],"","",["film_projector"],22,23,15,0],
  34192. "1f4ff":[["\uD83D\uDCFF"],"","",["prayer_beads"],22,24,15,0],
  34193. "1f500":[["\uD83D\uDD00"],"","",["twisted_rightwards_arrows"],22,25,15,0],
  34194. "1f501":[["\uD83D\uDD01"],"","",["repeat"],22,26,15,0],
  34195. "1f502":[["\uD83D\uDD02"],"","",["repeat_one"],22,27,15,0],
  34196. "1f503":[["\uD83D\uDD03"],"","\uDBBA\uDF91",["arrows_clockwise"],22,28,15,0],
  34197. "1f504":[["\uD83D\uDD04"],"","",["arrows_counterclockwise"],22,29,15,0],
  34198. "1f505":[["\uD83D\uDD05"],"","",["low_brightness"],22,30,15,0],
  34199. "1f506":[["\uD83D\uDD06"],"","",["high_brightness"],22,31,15,0],
  34200. "1f507":[["\uD83D\uDD07"],"","",["mute"],22,32,15,0],
  34201. "1f508":[["\uD83D\uDD08"],"","",["speaker"],22,33,15,0],
  34202. "1f509":[["\uD83D\uDD09"],"","",["sound"],22,34,15,0],
  34203. "1f50a":[["\uD83D\uDD0A"],"\uE141","\uDBBA\uDC21",["loud_sound"],22,35,15,0],
  34204. "1f50b":[["\uD83D\uDD0B"],"","\uDBB9\uDCFC",["battery"],22,36,15,0],
  34205. "1f50c":[["\uD83D\uDD0C"],"","\uDBB9\uDCFE",["electric_plug"],22,37,15,0],
  34206. "1f50d":[["\uD83D\uDD0D"],"\uE114","\uDBBA\uDF85",["mag"],22,38,15,0],
  34207. "1f50e":[["\uD83D\uDD0E"],"\uE114","\uDBBA\uDF8D",["mag_right"],22,39,15,0],
  34208. "1f50f":[["\uD83D\uDD0F"],"\uE144","\uDBBA\uDF90",["lock_with_ink_pen"],22,40,15,0],
  34209. "1f510":[["\uD83D\uDD10"],"\uE144","\uDBBA\uDF8A",["closed_lock_with_key"],23,0,15,0],
  34210. "1f511":[["\uD83D\uDD11"],"\uE03F","\uDBBA\uDF82",["key"],23,1,15,0],
  34211. "1f512":[["\uD83D\uDD12"],"\uE144","\uDBBA\uDF86",["lock"],23,2,15,0],
  34212. "1f513":[["\uD83D\uDD13"],"\uE145","\uDBBA\uDF87",["unlock"],23,3,15,0],
  34213. "1f514":[["\uD83D\uDD14"],"\uE325","\uDBB9\uDCF2",["bell"],23,4,15,0],
  34214. "1f515":[["\uD83D\uDD15"],"","",["no_bell"],23,5,15,0],
  34215. "1f516":[["\uD83D\uDD16"],"","\uDBBA\uDF8F",["bookmark"],23,6,15,0],
  34216. "1f517":[["\uD83D\uDD17"],"","\uDBBA\uDF4B",["link"],23,7,15,0],
  34217. "1f518":[["\uD83D\uDD18"],"","\uDBBA\uDF8C",["radio_button"],23,8,15,0],
  34218. "1f519":[["\uD83D\uDD19"],"\uE235","\uDBBA\uDF8E",["back"],23,9,15,0],
  34219. "1f51a":[["\uD83D\uDD1A"],"","\uDBB8\uDC1A",["end"],23,10,15,0],
  34220. "1f51b":[["\uD83D\uDD1B"],"","\uDBB8\uDC19",["on"],23,11,15,0],
  34221. "1f51c":[["\uD83D\uDD1C"],"","\uDBB8\uDC18",["soon"],23,12,15,0],
  34222. "1f51d":[["\uD83D\uDD1D"],"\uE24C","\uDBBA\uDF42",["top"],23,13,15,0],
  34223. "1f51e":[["\uD83D\uDD1E"],"\uE207","\uDBBA\uDF25",["underage"],23,14,15,0],
  34224. "1f51f":[["\uD83D\uDD1F"],"","\uDBBA\uDC3B",["keycap_ten"],23,15,15,0],
  34225. "1f520":[["\uD83D\uDD20"],"","\uDBBA\uDF7C",["capital_abcd"],23,16,15,0],
  34226. "1f521":[["\uD83D\uDD21"],"","\uDBBA\uDF7D",["abcd"],23,17,15,0],
  34227. "1f522":[["\uD83D\uDD22"],"","\uDBBA\uDF7E",["1234"],23,18,15,0],
  34228. "1f523":[["\uD83D\uDD23"],"","\uDBBA\uDF7F",["symbols"],23,19,15,0],
  34229. "1f524":[["\uD83D\uDD24"],"","\uDBBA\uDF80",["abc"],23,20,15,0],
  34230. "1f525":[["\uD83D\uDD25"],"\uE11D","\uDBB9\uDCF6",["fire"],23,21,15,0],
  34231. "1f526":[["\uD83D\uDD26"],"","\uDBB9\uDCFB",["flashlight"],23,22,15,0],
  34232. "1f527":[["\uD83D\uDD27"],"","\uDBB9\uDCC9",["wrench"],23,23,15,0],
  34233. "1f528":[["\uD83D\uDD28"],"\uE116","\uDBB9\uDCCA",["hammer"],23,24,15,0],
  34234. "1f529":[["\uD83D\uDD29"],"","\uDBB9\uDCCB",["nut_and_bolt"],23,25,15,0],
  34235. "1f52a":[["\uD83D\uDD2A"],"","\uDBB9\uDCFA",["hocho","knife"],23,26,15,0],
  34236. "1f52b":[["\uD83D\uDD2B"],"\uE113","\uDBB9\uDCF5",["gun"],23,27,15,0],
  34237. "1f52c":[["\uD83D\uDD2C"],"","",["microscope"],23,28,15,0],
  34238. "1f52d":[["\uD83D\uDD2D"],"","",["telescope"],23,29,15,0],
  34239. "1f52e":[["\uD83D\uDD2E"],"\uE23E","\uDBB9\uDCF7",["crystal_ball"],23,30,15,0],
  34240. "1f52f":[["\uD83D\uDD2F"],"\uE23E","\uDBB9\uDCF8",["six_pointed_star"],23,31,15,0],
  34241. "1f530":[["\uD83D\uDD30"],"\uE209","\uDBB8\uDC44",["beginner"],23,32,15,0],
  34242. "1f531":[["\uD83D\uDD31"],"\uE031","\uDBB9\uDCD2",["trident"],23,33,15,0],
  34243. "1f532":[["\uD83D\uDD32"],"\uE21A","\uDBBA\uDF64",["black_square_button"],23,34,15,0],
  34244. "1f533":[["\uD83D\uDD33"],"\uE21B","\uDBBA\uDF67",["white_square_button"],23,35,15,0],
  34245. "1f534":[["\uD83D\uDD34"],"\uE219","\uDBBA\uDF63",["red_circle"],23,36,15,0],
  34246. "1f535":[["\uD83D\uDD35"],"\uE21A","\uDBBA\uDF64",["large_blue_circle"],23,37,15,0],
  34247. "1f536":[["\uD83D\uDD36"],"\uE21B","\uDBBA\uDF73",["large_orange_diamond"],23,38,15,0],
  34248. "1f537":[["\uD83D\uDD37"],"\uE21B","\uDBBA\uDF74",["large_blue_diamond"],23,39,15,0],
  34249. "1f538":[["\uD83D\uDD38"],"\uE21B","\uDBBA\uDF75",["small_orange_diamond"],23,40,15,0],
  34250. "1f539":[["\uD83D\uDD39"],"\uE21B","\uDBBA\uDF76",["small_blue_diamond"],24,0,15,0],
  34251. "1f53a":[["\uD83D\uDD3A"],"","\uDBBA\uDF78",["small_red_triangle"],24,1,15,0],
  34252. "1f53b":[["\uD83D\uDD3B"],"","\uDBBA\uDF79",["small_red_triangle_down"],24,2,15,0],
  34253. "1f53c":[["\uD83D\uDD3C"],"","\uDBBA\uDF01",["arrow_up_small"],24,3,15,0],
  34254. "1f53d":[["\uD83D\uDD3D"],"","\uDBBA\uDF00",["arrow_down_small"],24,4,15,0],
  34255. "1f549":[["\uD83D\uDD49"],"","",["om_symbol"],24,5,15,0],
  34256. "1f54a":[["\uD83D\uDD4A"],"","",["dove_of_peace"],24,6,15,0],
  34257. "1f54b":[["\uD83D\uDD4B"],"","",["kaaba"],24,7,15,0],
  34258. "1f54c":[["\uD83D\uDD4C"],"","",["mosque"],24,8,15,0],
  34259. "1f54d":[["\uD83D\uDD4D"],"","",["synagogue"],24,9,15,0],
  34260. "1f54e":[["\uD83D\uDD4E"],"","",["menorah_with_nine_branches"],24,10,15,0],
  34261. "1f550":[["\uD83D\uDD50"],"\uE024","\uDBB8\uDC1E",["clock1"],24,11,15,0],
  34262. "1f551":[["\uD83D\uDD51"],"\uE025","\uDBB8\uDC1F",["clock2"],24,12,15,0],
  34263. "1f552":[["\uD83D\uDD52"],"\uE026","\uDBB8\uDC20",["clock3"],24,13,15,0],
  34264. "1f553":[["\uD83D\uDD53"],"\uE027","\uDBB8\uDC21",["clock4"],24,14,15,0],
  34265. "1f554":[["\uD83D\uDD54"],"\uE028","\uDBB8\uDC22",["clock5"],24,15,15,0],
  34266. "1f555":[["\uD83D\uDD55"],"\uE029","\uDBB8\uDC23",["clock6"],24,16,15,0],
  34267. "1f556":[["\uD83D\uDD56"],"\uE02A","\uDBB8\uDC24",["clock7"],24,17,15,0],
  34268. "1f557":[["\uD83D\uDD57"],"\uE02B","\uDBB8\uDC25",["clock8"],24,18,15,0],
  34269. "1f558":[["\uD83D\uDD58"],"\uE02C","\uDBB8\uDC26",["clock9"],24,19,15,0],
  34270. "1f559":[["\uD83D\uDD59"],"\uE02D","\uDBB8\uDC27",["clock10"],24,20,15,0],
  34271. "1f55a":[["\uD83D\uDD5A"],"\uE02E","\uDBB8\uDC28",["clock11"],24,21,15,0],
  34272. "1f55b":[["\uD83D\uDD5B"],"\uE02F","\uDBB8\uDC29",["clock12"],24,22,15,0],
  34273. "1f55c":[["\uD83D\uDD5C"],"","",["clock130"],24,23,15,0],
  34274. "1f55d":[["\uD83D\uDD5D"],"","",["clock230"],24,24,15,0],
  34275. "1f55e":[["\uD83D\uDD5E"],"","",["clock330"],24,25,15,0],
  34276. "1f55f":[["\uD83D\uDD5F"],"","",["clock430"],24,26,15,0],
  34277. "1f560":[["\uD83D\uDD60"],"","",["clock530"],24,27,15,0],
  34278. "1f561":[["\uD83D\uDD61"],"","",["clock630"],24,28,15,0],
  34279. "1f562":[["\uD83D\uDD62"],"","",["clock730"],24,29,15,0],
  34280. "1f563":[["\uD83D\uDD63"],"","",["clock830"],24,30,15,0],
  34281. "1f564":[["\uD83D\uDD64"],"","",["clock930"],24,31,15,0],
  34282. "1f565":[["\uD83D\uDD65"],"","",["clock1030"],24,32,15,0],
  34283. "1f566":[["\uD83D\uDD66"],"","",["clock1130"],24,33,15,0],
  34284. "1f567":[["\uD83D\uDD67"],"","",["clock1230"],24,34,15,0],
  34285. "1f56f":[["\uD83D\uDD6F"],"","",["candle"],24,35,15,0],
  34286. "1f570":[["\uD83D\uDD70"],"","",["mantelpiece_clock"],24,36,15,0],
  34287. "1f573":[["\uD83D\uDD73"],"","",["hole"],24,37,15,0],
  34288. "1f574":[["\uD83D\uDD74"],"","",["man_in_business_suit_levitating"],24,38,15,0],
  34289. "1f575":[["\uD83D\uDD75"],"","",["sleuth_or_spy"],24,39,15,0],
  34290. "1f576":[["\uD83D\uDD76"],"","",["dark_sunglasses"],25,4,15,0],
  34291. "1f577":[["\uD83D\uDD77"],"","",["spider"],25,5,15,0],
  34292. "1f578":[["\uD83D\uDD78"],"","",["spider_web"],25,6,15,0],
  34293. "1f579":[["\uD83D\uDD79"],"","",["joystick"],25,7,15,0],
  34294. "1f587":[["\uD83D\uDD87"],"","",["linked_paperclips"],25,8,15,0],
  34295. "1f58a":[["\uD83D\uDD8A"],"","",["lower_left_ballpoint_pen"],25,9,15,0],
  34296. "1f58b":[["\uD83D\uDD8B"],"","",["lower_left_fountain_pen"],25,10,15,0],
  34297. "1f58c":[["\uD83D\uDD8C"],"","",["lower_left_paintbrush"],25,11,15,0],
  34298. "1f58d":[["\uD83D\uDD8D"],"","",["lower_left_crayon"],25,12,15,0],
  34299. "1f590":[["\uD83D\uDD90"],"","",["raised_hand_with_fingers_splayed"],25,13,15,0],
  34300. "1f595":[["\uD83D\uDD95"],"","",["middle_finger","reversed_hand_with_middle_finger_extended"],25,19,15,0],
  34301. "1f596":[["\uD83D\uDD96"],"","",["spock-hand"],25,25,15,0],
  34302. "1f5a5":[["\uD83D\uDDA5"],"","",["desktop_computer"],25,31,15,0],
  34303. "1f5a8":[["\uD83D\uDDA8"],"","",["printer"],25,32,15,0],
  34304. "1f5b1":[["\uD83D\uDDB1"],"","",["three_button_mouse"],25,33,15,0],
  34305. "1f5b2":[["\uD83D\uDDB2"],"","",["trackball"],25,34,15,0],
  34306. "1f5bc":[["\uD83D\uDDBC"],"","",["frame_with_picture"],25,35,15,0],
  34307. "1f5c2":[["\uD83D\uDDC2"],"","",["card_index_dividers"],25,36,15,0],
  34308. "1f5c3":[["\uD83D\uDDC3"],"","",["card_file_box"],25,37,15,0],
  34309. "1f5c4":[["\uD83D\uDDC4"],"","",["file_cabinet"],25,38,15,0],
  34310. "1f5d1":[["\uD83D\uDDD1"],"","",["wastebasket"],25,39,15,0],
  34311. "1f5d2":[["\uD83D\uDDD2"],"","",["spiral_note_pad"],25,40,15,0],
  34312. "1f5d3":[["\uD83D\uDDD3"],"","",["spiral_calendar_pad"],26,0,15,0],
  34313. "1f5dc":[["\uD83D\uDDDC"],"","",["compression"],26,1,15,0],
  34314. "1f5dd":[["\uD83D\uDDDD"],"","",["old_key"],26,2,15,0],
  34315. "1f5de":[["\uD83D\uDDDE"],"","",["rolled_up_newspaper"],26,3,15,0],
  34316. "1f5e1":[["\uD83D\uDDE1"],"","",["dagger_knife"],26,4,15,0],
  34317. "1f5e3":[["\uD83D\uDDE3"],"","",["speaking_head_in_silhouette"],26,5,15,0],
  34318. "1f5e8":[["\uD83D\uDDE8"],"","",["left_speech_bubble"],26,6,7,0],
  34319. "1f5ef":[["\uD83D\uDDEF"],"","",["right_anger_bubble"],26,7,15,0],
  34320. "1f5f3":[["\uD83D\uDDF3"],"","",["ballot_box_with_ballot"],26,8,15,0],
  34321. "1f5fa":[["\uD83D\uDDFA"],"","",["world_map"],26,9,15,0],
  34322. "1f5fb":[["\uD83D\uDDFB"],"\uE03B","\uDBB9\uDCC3",["mount_fuji"],26,10,15,0],
  34323. "1f5fc":[["\uD83D\uDDFC"],"\uE509","\uDBB9\uDCC4",["tokyo_tower"],26,11,15,0],
  34324. "1f5fd":[["\uD83D\uDDFD"],"\uE51D","\uDBB9\uDCC6",["statue_of_liberty"],26,12,15,0],
  34325. "1f5fe":[["\uD83D\uDDFE"],"","\uDBB9\uDCC7",["japan"],26,13,15,0],
  34326. "1f5ff":[["\uD83D\uDDFF"],"","\uDBB9\uDCC8",["moyai"],26,14,15,0],
  34327. "1f600":[["\uD83D\uDE00"],"","",["grinning"],26,15,15,0,":D"],
  34328. "1f601":[["\uD83D\uDE01"],"\uE404","\uDBB8\uDF33",["grin"],26,16,15,0],
  34329. "1f602":[["\uD83D\uDE02"],"\uE412","\uDBB8\uDF34",["joy"],26,17,15,0],
  34330. "1f603":[["\uD83D\uDE03"],"\uE057","\uDBB8\uDF30",["smiley"],26,18,15,0,":)"],
  34331. "1f604":[["\uD83D\uDE04"],"\uE415","\uDBB8\uDF38",["smile"],26,19,15,0,":)"],
  34332. "1f605":[["\uD83D\uDE05"],"\uE415\uE331","\uDBB8\uDF31",["sweat_smile"],26,20,15,0],
  34333. "1f606":[["\uD83D\uDE06"],"\uE40A","\uDBB8\uDF32",["laughing","satisfied"],26,21,15,0],
  34334. "1f607":[["\uD83D\uDE07"],"","",["innocent"],26,22,15,0],
  34335. "1f608":[["\uD83D\uDE08"],"","",["smiling_imp"],26,23,15,0],
  34336. "1f609":[["\uD83D\uDE09"],"\uE405","\uDBB8\uDF47",["wink"],26,24,15,0,";)"],
  34337. "1f60a":[["\uD83D\uDE0A"],"\uE056","\uDBB8\uDF35",["blush"],26,25,15,0,":)"],
  34338. "1f60b":[["\uD83D\uDE0B"],"\uE056","\uDBB8\uDF2B",["yum"],26,26,15,0],
  34339. "1f60c":[["\uD83D\uDE0C"],"\uE40A","\uDBB8\uDF3E",["relieved"],26,27,15,0],
  34340. "1f60d":[["\uD83D\uDE0D"],"\uE106","\uDBB8\uDF27",["heart_eyes"],26,28,15,0],
  34341. "1f60e":[["\uD83D\uDE0E"],"","",["sunglasses"],26,29,15,0],
  34342. "1f60f":[["\uD83D\uDE0F"],"\uE402","\uDBB8\uDF43",["smirk"],26,30,15,0],
  34343. "1f610":[["\uD83D\uDE10"],"","",["neutral_face"],26,31,15,0],
  34344. "1f611":[["\uD83D\uDE11"],"","",["expressionless"],26,32,15,0],
  34345. "1f612":[["\uD83D\uDE12"],"\uE40E","\uDBB8\uDF26",["unamused"],26,33,15,0,":("],
  34346. "1f613":[["\uD83D\uDE13"],"\uE108","\uDBB8\uDF44",["sweat"],26,34,15,0],
  34347. "1f614":[["\uD83D\uDE14"],"\uE403","\uDBB8\uDF40",["pensive"],26,35,15,0],
  34348. "1f615":[["\uD83D\uDE15"],"","",["confused"],26,36,15,0],
  34349. "1f616":[["\uD83D\uDE16"],"\uE407","\uDBB8\uDF3F",["confounded"],26,37,15,0],
  34350. "1f617":[["\uD83D\uDE17"],"","",["kissing"],26,38,15,0],
  34351. "1f618":[["\uD83D\uDE18"],"\uE418","\uDBB8\uDF2C",["kissing_heart"],26,39,15,0],
  34352. "1f619":[["\uD83D\uDE19"],"","",["kissing_smiling_eyes"],26,40,15,0],
  34353. "1f61a":[["\uD83D\uDE1A"],"\uE417","\uDBB8\uDF2D",["kissing_closed_eyes"],27,0,15,0],
  34354. "1f61b":[["\uD83D\uDE1B"],"","",["stuck_out_tongue"],27,1,15,0,":p"],
  34355. "1f61c":[["\uD83D\uDE1C"],"\uE105","\uDBB8\uDF29",["stuck_out_tongue_winking_eye"],27,2,15,0,";p"],
  34356. "1f61d":[["\uD83D\uDE1D"],"\uE409","\uDBB8\uDF2A",["stuck_out_tongue_closed_eyes"],27,3,15,0],
  34357. "1f61e":[["\uD83D\uDE1E"],"\uE058","\uDBB8\uDF23",["disappointed"],27,4,15,0,":("],
  34358. "1f61f":[["\uD83D\uDE1F"],"","",["worried"],27,5,15,0],
  34359. "1f620":[["\uD83D\uDE20"],"\uE059","\uDBB8\uDF20",["angry"],27,6,15,0],
  34360. "1f621":[["\uD83D\uDE21"],"\uE416","\uDBB8\uDF3D",["rage"],27,7,15,0],
  34361. "1f622":[["\uD83D\uDE22"],"\uE413","\uDBB8\uDF39",["cry"],27,8,15,0,":'("],
  34362. "1f623":[["\uD83D\uDE23"],"\uE406","\uDBB8\uDF3C",["persevere"],27,9,15,0],
  34363. "1f624":[["\uD83D\uDE24"],"\uE404","\uDBB8\uDF28",["triumph"],27,10,15,0],
  34364. "1f625":[["\uD83D\uDE25"],"\uE401","\uDBB8\uDF45",["disappointed_relieved"],27,11,15,0],
  34365. "1f626":[["\uD83D\uDE26"],"","",["frowning"],27,12,15,0],
  34366. "1f627":[["\uD83D\uDE27"],"","",["anguished"],27,13,15,0],
  34367. "1f628":[["\uD83D\uDE28"],"\uE40B","\uDBB8\uDF3B",["fearful"],27,14,15,0],
  34368. "1f629":[["\uD83D\uDE29"],"\uE403","\uDBB8\uDF21",["weary"],27,15,15,0],
  34369. "1f62a":[["\uD83D\uDE2A"],"\uE408","\uDBB8\uDF42",["sleepy"],27,16,15,0],
  34370. "1f62b":[["\uD83D\uDE2B"],"\uE406","\uDBB8\uDF46",["tired_face"],27,17,15,0],
  34371. "1f62c":[["\uD83D\uDE2C"],"","",["grimacing"],27,18,15,0],
  34372. "1f62d":[["\uD83D\uDE2D"],"\uE411","\uDBB8\uDF3A",["sob"],27,19,15,0,":'("],
  34373. "1f62e":[["\uD83D\uDE2E"],"","",["open_mouth"],27,20,15,0],
  34374. "1f62f":[["\uD83D\uDE2F"],"","",["hushed"],27,21,15,0],
  34375. "1f630":[["\uD83D\uDE30"],"\uE40F","\uDBB8\uDF25",["cold_sweat"],27,22,15,0],
  34376. "1f631":[["\uD83D\uDE31"],"\uE107","\uDBB8\uDF41",["scream"],27,23,15,0],
  34377. "1f632":[["\uD83D\uDE32"],"\uE410","\uDBB8\uDF22",["astonished"],27,24,15,0],
  34378. "1f633":[["\uD83D\uDE33"],"\uE40D","\uDBB8\uDF2F",["flushed"],27,25,15,0],
  34379. "1f634":[["\uD83D\uDE34"],"","",["sleeping"],27,26,15,0],
  34380. "1f635":[["\uD83D\uDE35"],"\uE406","\uDBB8\uDF24",["dizzy_face"],27,27,15,0],
  34381. "1f636":[["\uD83D\uDE36"],"","",["no_mouth"],27,28,15,0],
  34382. "1f637":[["\uD83D\uDE37"],"\uE40C","\uDBB8\uDF2E",["mask"],27,29,15,0],
  34383. "1f638":[["\uD83D\uDE38"],"\uE404","\uDBB8\uDF49",["smile_cat"],27,30,15,0],
  34384. "1f639":[["\uD83D\uDE39"],"\uE412","\uDBB8\uDF4A",["joy_cat"],27,31,15,0],
  34385. "1f63a":[["\uD83D\uDE3A"],"\uE057","\uDBB8\uDF48",["smiley_cat"],27,32,15,0],
  34386. "1f63b":[["\uD83D\uDE3B"],"\uE106","\uDBB8\uDF4C",["heart_eyes_cat"],27,33,15,0],
  34387. "1f63c":[["\uD83D\uDE3C"],"\uE404","\uDBB8\uDF4F",["smirk_cat"],27,34,15,0],
  34388. "1f63d":[["\uD83D\uDE3D"],"\uE418","\uDBB8\uDF4B",["kissing_cat"],27,35,15,0],
  34389. "1f63e":[["\uD83D\uDE3E"],"\uE416","\uDBB8\uDF4E",["pouting_cat"],27,36,15,0],
  34390. "1f63f":[["\uD83D\uDE3F"],"\uE413","\uDBB8\uDF4D",["crying_cat_face"],27,37,15,0],
  34391. "1f640":[["\uD83D\uDE40"],"\uE403","\uDBB8\uDF50",["scream_cat"],27,38,15,0],
  34392. "1f641":[["\uD83D\uDE41"],"","",["slightly_frowning_face"],27,39,15,0],
  34393. "1f642":[["\uD83D\uDE42"],"","",["slightly_smiling_face"],27,40,15,0],
  34394. "1f643":[["\uD83D\uDE43"],"","",["upside_down_face"],28,0,15,0],
  34395. "1f644":[["\uD83D\uDE44"],"","",["face_with_rolling_eyes"],28,1,15,0],
  34396. "1f645":[["\uD83D\uDE45"],"\uE423","\uDBB8\uDF51",["no_good"],28,2,15,0],
  34397. "1f646":[["\uD83D\uDE46"],"\uE424","\uDBB8\uDF52",["ok_woman"],28,8,15,0],
  34398. "1f647":[["\uD83D\uDE47"],"\uE426","\uDBB8\uDF53",["bow"],28,14,15,0],
  34399. "1f648":[["\uD83D\uDE48"],"","\uDBB8\uDF54",["see_no_evil"],28,20,15,0],
  34400. "1f649":[["\uD83D\uDE49"],"","\uDBB8\uDF56",["hear_no_evil"],28,21,15,0],
  34401. "1f64a":[["\uD83D\uDE4A"],"","\uDBB8\uDF55",["speak_no_evil"],28,22,15,0],
  34402. "1f64b":[["\uD83D\uDE4B"],"\uE012","\uDBB8\uDF57",["raising_hand"],28,23,15,0],
  34403. "1f64c":[["\uD83D\uDE4C"],"\uE427","\uDBB8\uDF58",["raised_hands"],28,29,15,0],
  34404. "1f64d":[["\uD83D\uDE4D"],"\uE403","\uDBB8\uDF59",["person_frowning"],28,35,15,0],
  34405. "1f64e":[["\uD83D\uDE4E"],"\uE416","\uDBB8\uDF5A",["person_with_pouting_face"],29,0,15,0],
  34406. "1f64f":[["\uD83D\uDE4F"],"\uE41D","\uDBB8\uDF5B",["pray"],29,6,15,0],
  34407. "1f680":[["\uD83D\uDE80"],"\uE10D","\uDBB9\uDFED",["rocket"],29,12,15,0],
  34408. "1f681":[["\uD83D\uDE81"],"","",["helicopter"],29,13,15,0],
  34409. "1f682":[["\uD83D\uDE82"],"","",["steam_locomotive"],29,14,15,0],
  34410. "1f683":[["\uD83D\uDE83"],"\uE01E","\uDBB9\uDFDF",["railway_car"],29,15,15,0],
  34411. "1f684":[["\uD83D\uDE84"],"\uE435","\uDBB9\uDFE2",["bullettrain_side"],29,16,15,0],
  34412. "1f685":[["\uD83D\uDE85"],"\uE01F","\uDBB9\uDFE3",["bullettrain_front"],29,17,15,0],
  34413. "1f686":[["\uD83D\uDE86"],"","",["train2"],29,18,15,0],
  34414. "1f687":[["\uD83D\uDE87"],"\uE434","\uDBB9\uDFE0",["metro"],29,19,15,0],
  34415. "1f688":[["\uD83D\uDE88"],"","",["light_rail"],29,20,15,0],
  34416. "1f689":[["\uD83D\uDE89"],"\uE039","\uDBB9\uDFEC",["station"],29,21,15,0],
  34417. "1f68a":[["\uD83D\uDE8A"],"","",["tram"],29,22,15,0],
  34418. "1f68b":[["\uD83D\uDE8B"],"","",["train"],29,23,15,0],
  34419. "1f68c":[["\uD83D\uDE8C"],"\uE159","\uDBB9\uDFE6",["bus"],29,24,15,0],
  34420. "1f68d":[["\uD83D\uDE8D"],"","",["oncoming_bus"],29,25,15,0],
  34421. "1f68e":[["\uD83D\uDE8E"],"","",["trolleybus"],29,26,15,0],
  34422. "1f68f":[["\uD83D\uDE8F"],"\uE150","\uDBB9\uDFE7",["busstop"],29,27,15,0],
  34423. "1f690":[["\uD83D\uDE90"],"","",["minibus"],29,28,15,0],
  34424. "1f691":[["\uD83D\uDE91"],"\uE431","\uDBB9\uDFF3",["ambulance"],29,29,15,0],
  34425. "1f692":[["\uD83D\uDE92"],"\uE430","\uDBB9\uDFF2",["fire_engine"],29,30,15,0],
  34426. "1f693":[["\uD83D\uDE93"],"\uE432","\uDBB9\uDFF4",["police_car"],29,31,15,0],
  34427. "1f694":[["\uD83D\uDE94"],"","",["oncoming_police_car"],29,32,15,0],
  34428. "1f695":[["\uD83D\uDE95"],"\uE15A","\uDBB9\uDFEF",["taxi"],29,33,15,0],
  34429. "1f696":[["\uD83D\uDE96"],"","",["oncoming_taxi"],29,34,15,0],
  34430. "1f697":[["\uD83D\uDE97"],"\uE01B","\uDBB9\uDFE4",["car","red_car"],29,35,15,0],
  34431. "1f698":[["\uD83D\uDE98"],"","",["oncoming_automobile"],29,36,15,0],
  34432. "1f699":[["\uD83D\uDE99"],"\uE42E","\uDBB9\uDFE5",["blue_car"],29,37,15,0],
  34433. "1f69a":[["\uD83D\uDE9A"],"\uE42F","\uDBB9\uDFF1",["truck"],29,38,15,0],
  34434. "1f69b":[["\uD83D\uDE9B"],"","",["articulated_lorry"],29,39,15,0],
  34435. "1f69c":[["\uD83D\uDE9C"],"","",["tractor"],29,40,15,0],
  34436. "1f69d":[["\uD83D\uDE9D"],"","",["monorail"],30,0,15,0],
  34437. "1f69e":[["\uD83D\uDE9E"],"","",["mountain_railway"],30,1,15,0],
  34438. "1f69f":[["\uD83D\uDE9F"],"","",["suspension_railway"],30,2,15,0],
  34439. "1f6a0":[["\uD83D\uDEA0"],"","",["mountain_cableway"],30,3,15,0],
  34440. "1f6a1":[["\uD83D\uDEA1"],"","",["aerial_tramway"],30,4,15,0],
  34441. "1f6a2":[["\uD83D\uDEA2"],"\uE202","\uDBB9\uDFE8",["ship"],30,5,15,0],
  34442. "1f6a3":[["\uD83D\uDEA3"],"","",["rowboat"],30,6,15,0],
  34443. "1f6a4":[["\uD83D\uDEA4"],"\uE135","\uDBB9\uDFEE",["speedboat"],30,12,15,0],
  34444. "1f6a5":[["\uD83D\uDEA5"],"\uE14E","\uDBB9\uDFF7",["traffic_light"],30,13,15,0],
  34445. "1f6a6":[["\uD83D\uDEA6"],"","",["vertical_traffic_light"],30,14,15,0],
  34446. "1f6a7":[["\uD83D\uDEA7"],"\uE137","\uDBB9\uDFF8",["construction"],30,15,15,0],
  34447. "1f6a8":[["\uD83D\uDEA8"],"\uE432","\uDBB9\uDFF9",["rotating_light"],30,16,15,0],
  34448. "1f6a9":[["\uD83D\uDEA9"],"","\uDBBA\uDF22",["triangular_flag_on_post"],30,17,15,0],
  34449. "1f6aa":[["\uD83D\uDEAA"],"","\uDBB9\uDCF3",["door"],30,18,15,0],
  34450. "1f6ab":[["\uD83D\uDEAB"],"","\uDBBA\uDF48",["no_entry_sign"],30,19,15,0],
  34451. "1f6ac":[["\uD83D\uDEAC"],"\uE30E","\uDBBA\uDF1E",["smoking"],30,20,15,0],
  34452. "1f6ad":[["\uD83D\uDEAD"],"\uE208","\uDBBA\uDF1F",["no_smoking"],30,21,15,0],
  34453. "1f6ae":[["\uD83D\uDEAE"],"","",["put_litter_in_its_place"],30,22,15,0],
  34454. "1f6af":[["\uD83D\uDEAF"],"","",["do_not_litter"],30,23,15,0],
  34455. "1f6b0":[["\uD83D\uDEB0"],"","",["potable_water"],30,24,15,0],
  34456. "1f6b1":[["\uD83D\uDEB1"],"","",["non-potable_water"],30,25,15,0],
  34457. "1f6b2":[["\uD83D\uDEB2"],"\uE136","\uDBB9\uDFEB",["bike"],30,26,15,0],
  34458. "1f6b3":[["\uD83D\uDEB3"],"","",["no_bicycles"],30,27,15,0],
  34459. "1f6b4":[["\uD83D\uDEB4"],"","",["bicyclist"],30,28,15,0],
  34460. "1f6b5":[["\uD83D\uDEB5"],"","",["mountain_bicyclist"],30,34,15,0],
  34461. "1f6b6":[["\uD83D\uDEB6"],"\uE201","\uDBB9\uDFF0",["walking"],30,40,15,0],
  34462. "1f6b7":[["\uD83D\uDEB7"],"","",["no_pedestrians"],31,5,15,0],
  34463. "1f6b8":[["\uD83D\uDEB8"],"","",["children_crossing"],31,6,15,0],
  34464. "1f6b9":[["\uD83D\uDEB9"],"\uE138","\uDBBA\uDF33",["mens"],31,7,15,0],
  34465. "1f6ba":[["\uD83D\uDEBA"],"\uE139","\uDBBA\uDF34",["womens"],31,8,15,0],
  34466. "1f6bb":[["\uD83D\uDEBB"],"\uE151","\uDBB9\uDD06",["restroom"],31,9,15,0],
  34467. "1f6bc":[["\uD83D\uDEBC"],"\uE13A","\uDBBA\uDF35",["baby_symbol"],31,10,15,0],
  34468. "1f6bd":[["\uD83D\uDEBD"],"\uE140","\uDBB9\uDD07",["toilet"],31,11,15,0],
  34469. "1f6be":[["\uD83D\uDEBE"],"\uE309","\uDBB9\uDD08",["wc"],31,12,15,0],
  34470. "1f6bf":[["\uD83D\uDEBF"],"","",["shower"],31,13,15,0],
  34471. "1f6c0":[["\uD83D\uDEC0"],"\uE13F","\uDBB9\uDD05",["bath"],31,14,15,0],
  34472. "1f6c1":[["\uD83D\uDEC1"],"","",["bathtub"],31,20,15,0],
  34473. "1f6c2":[["\uD83D\uDEC2"],"","",["passport_control"],31,21,15,0],
  34474. "1f6c3":[["\uD83D\uDEC3"],"","",["customs"],31,22,15,0],
  34475. "1f6c4":[["\uD83D\uDEC4"],"","",["baggage_claim"],31,23,15,0],
  34476. "1f6c5":[["\uD83D\uDEC5"],"","",["left_luggage"],31,24,15,0],
  34477. "1f6cb":[["\uD83D\uDECB"],"","",["couch_and_lamp"],31,25,15,0],
  34478. "1f6cc":[["\uD83D\uDECC"],"","",["sleeping_accommodation"],31,26,15,0],
  34479. "1f6cd":[["\uD83D\uDECD"],"","",["shopping_bags"],31,27,15,0],
  34480. "1f6ce":[["\uD83D\uDECE"],"","",["bellhop_bell"],31,28,15,0],
  34481. "1f6cf":[["\uD83D\uDECF"],"","",["bed"],31,29,15,0],
  34482. "1f6d0":[["\uD83D\uDED0"],"","",["place_of_worship"],31,30,15,0],
  34483. "1f6e0":[["\uD83D\uDEE0"],"","",["hammer_and_wrench"],31,31,15,0],
  34484. "1f6e1":[["\uD83D\uDEE1"],"","",["shield"],31,32,15,0],
  34485. "1f6e2":[["\uD83D\uDEE2"],"","",["oil_drum"],31,33,15,0],
  34486. "1f6e3":[["\uD83D\uDEE3"],"","",["motorway"],31,34,15,0],
  34487. "1f6e4":[["\uD83D\uDEE4"],"","",["railway_track"],31,35,15,0],
  34488. "1f6e5":[["\uD83D\uDEE5"],"","",["motor_boat"],31,36,15,0],
  34489. "1f6e9":[["\uD83D\uDEE9"],"","",["small_airplane"],31,37,15,0],
  34490. "1f6eb":[["\uD83D\uDEEB"],"","",["airplane_departure"],31,38,15,0],
  34491. "1f6ec":[["\uD83D\uDEEC"],"","",["airplane_arriving"],31,39,15,0],
  34492. "1f6f0":[["\uD83D\uDEF0"],"","",["satellite"],31,40,15,0],
  34493. "1f6f3":[["\uD83D\uDEF3"],"","",["passenger_ship"],32,0,15,0],
  34494. "1f910":[["\uD83E\uDD10"],"","",["zipper_mouth_face"],32,1,15,0],
  34495. "1f911":[["\uD83E\uDD11"],"","",["money_mouth_face"],32,2,15,0],
  34496. "1f912":[["\uD83E\uDD12"],"","",["face_with_thermometer"],32,3,15,0],
  34497. "1f913":[["\uD83E\uDD13"],"","",["nerd_face"],32,4,15,0],
  34498. "1f914":[["\uD83E\uDD14"],"","",["thinking_face"],32,5,15,0],
  34499. "1f915":[["\uD83E\uDD15"],"","",["face_with_head_bandage"],32,6,15,0],
  34500. "1f916":[["\uD83E\uDD16"],"","",["robot_face"],32,7,15,0],
  34501. "1f917":[["\uD83E\uDD17"],"","",["hugging_face"],32,8,15,0],
  34502. "1f918":[["\uD83E\uDD18"],"","",["the_horns","sign_of_the_horns"],32,9,15,0],
  34503. "1f980":[["\uD83E\uDD80"],"","",["crab"],32,15,15,0],
  34504. "1f981":[["\uD83E\uDD81"],"","",["lion_face"],32,16,15,0],
  34505. "1f982":[["\uD83E\uDD82"],"","",["scorpion"],32,17,15,0],
  34506. "1f983":[["\uD83E\uDD83"],"","",["turkey"],32,18,15,0],
  34507. "1f984":[["\uD83E\uDD84"],"","",["unicorn_face"],32,19,15,0],
  34508. "1f9c0":[["\uD83E\uDDC0"],"","",["cheese_wedge"],32,20,15,0],
  34509. "0023-20e3":[["\u0023\uFE0F\u20E3","\u0023\u20E3"],"\uE210","\uDBBA\uDC2C",["hash"],32,21,15,0],
  34510. "002a-20e3":[["\u002A\u20E3"],"","",["keycap_star"],32,22,15,0],
  34511. "0030-20e3":[["\u0030\uFE0F\u20E3","\u0030\u20E3"],"\uE225","\uDBBA\uDC37",["zero"],32,23,15,0],
  34512. "0031-20e3":[["\u0031\uFE0F\u20E3","\u0031\u20E3"],"\uE21C","\uDBBA\uDC2E",["one"],32,24,15,0],
  34513. "0032-20e3":[["\u0032\uFE0F\u20E3","\u0032\u20E3"],"\uE21D","\uDBBA\uDC2F",["two"],32,25,15,0],
  34514. "0033-20e3":[["\u0033\uFE0F\u20E3","\u0033\u20E3"],"\uE21E","\uDBBA\uDC30",["three"],32,26,15,0],
  34515. "0034-20e3":[["\u0034\uFE0F\u20E3","\u0034\u20E3"],"\uE21F","\uDBBA\uDC31",["four"],32,27,15,0],
  34516. "0035-20e3":[["\u0035\uFE0F\u20E3","\u0035\u20E3"],"\uE220","\uDBBA\uDC32",["five"],32,28,15,0],
  34517. "0036-20e3":[["\u0036\uFE0F\u20E3","\u0036\u20E3"],"\uE221","\uDBBA\uDC33",["six"],32,29,15,0],
  34518. "0037-20e3":[["\u0037\uFE0F\u20E3","\u0037\u20E3"],"\uE222","\uDBBA\uDC34",["seven"],32,30,15,0],
  34519. "0038-20e3":[["\u0038\uFE0F\u20E3","\u0038\u20E3"],"\uE223","\uDBBA\uDC35",["eight"],32,31,15,0],
  34520. "0039-20e3":[["\u0039\uFE0F\u20E3","\u0039\u20E3"],"\uE224","\uDBBA\uDC36",["nine"],32,32,15,0],
  34521. "1f1e6-1f1e8":[["\uD83C\uDDE6\uD83C\uDDE8"],"","",["flag-ac"],32,33,13,0],
  34522. "1f1e6-1f1e9":[["\uD83C\uDDE6\uD83C\uDDE9"],"","",["flag-ad"],32,34,15,0],
  34523. "1f1e6-1f1ea":[["\uD83C\uDDE6\uD83C\uDDEA"],"","",["flag-ae"],32,35,15,0],
  34524. "1f1e6-1f1eb":[["\uD83C\uDDE6\uD83C\uDDEB"],"","",["flag-af"],32,36,15,0],
  34525. "1f1e6-1f1ec":[["\uD83C\uDDE6\uD83C\uDDEC"],"","",["flag-ag"],32,37,15,0],
  34526. "1f1e6-1f1ee":[["\uD83C\uDDE6\uD83C\uDDEE"],"","",["flag-ai"],32,38,15,0],
  34527. "1f1e6-1f1f1":[["\uD83C\uDDE6\uD83C\uDDF1"],"","",["flag-al"],32,39,15,0],
  34528. "1f1e6-1f1f2":[["\uD83C\uDDE6\uD83C\uDDF2"],"","",["flag-am"],32,40,15,0],
  34529. "1f1e6-1f1f4":[["\uD83C\uDDE6\uD83C\uDDF4"],"","",["flag-ao"],33,0,15,0],
  34530. "1f1e6-1f1f6":[["\uD83C\uDDE6\uD83C\uDDF6"],"","",["flag-aq"],33,1,13,0],
  34531. "1f1e6-1f1f7":[["\uD83C\uDDE6\uD83C\uDDF7"],"","",["flag-ar"],33,2,15,0],
  34532. "1f1e6-1f1f8":[["\uD83C\uDDE6\uD83C\uDDF8"],"","",["flag-as"],33,3,15,0],
  34533. "1f1e6-1f1f9":[["\uD83C\uDDE6\uD83C\uDDF9"],"","",["flag-at"],33,4,15,0],
  34534. "1f1e6-1f1fa":[["\uD83C\uDDE6\uD83C\uDDFA"],"","",["flag-au"],33,5,15,0],
  34535. "1f1e6-1f1fc":[["\uD83C\uDDE6\uD83C\uDDFC"],"","",["flag-aw"],33,6,15,0],
  34536. "1f1e6-1f1fd":[["\uD83C\uDDE6\uD83C\uDDFD"],"","",["flag-ax"],33,7,15,0],
  34537. "1f1e6-1f1ff":[["\uD83C\uDDE6\uD83C\uDDFF"],"","",["flag-az"],33,8,15,0],
  34538. "1f1e7-1f1e6":[["\uD83C\uDDE7\uD83C\uDDE6"],"","",["flag-ba"],33,9,15,0],
  34539. "1f1e7-1f1e7":[["\uD83C\uDDE7\uD83C\uDDE7"],"","",["flag-bb"],33,10,15,0],
  34540. "1f1e7-1f1e9":[["\uD83C\uDDE7\uD83C\uDDE9"],"","",["flag-bd"],33,11,15,0],
  34541. "1f1e7-1f1ea":[["\uD83C\uDDE7\uD83C\uDDEA"],"","",["flag-be"],33,12,15,0],
  34542. "1f1e7-1f1eb":[["\uD83C\uDDE7\uD83C\uDDEB"],"","",["flag-bf"],33,13,15,0],
  34543. "1f1e7-1f1ec":[["\uD83C\uDDE7\uD83C\uDDEC"],"","",["flag-bg"],33,14,15,0],
  34544. "1f1e7-1f1ed":[["\uD83C\uDDE7\uD83C\uDDED"],"","",["flag-bh"],33,15,15,0],
  34545. "1f1e7-1f1ee":[["\uD83C\uDDE7\uD83C\uDDEE"],"","",["flag-bi"],33,16,15,0],
  34546. "1f1e7-1f1ef":[["\uD83C\uDDE7\uD83C\uDDEF"],"","",["flag-bj"],33,17,15,0],
  34547. "1f1e7-1f1f1":[["\uD83C\uDDE7\uD83C\uDDF1"],"","",["flag-bl"],33,18,13,0],
  34548. "1f1e7-1f1f2":[["\uD83C\uDDE7\uD83C\uDDF2"],"","",["flag-bm"],33,19,15,0],
  34549. "1f1e7-1f1f3":[["\uD83C\uDDE7\uD83C\uDDF3"],"","",["flag-bn"],33,20,15,0],
  34550. "1f1e7-1f1f4":[["\uD83C\uDDE7\uD83C\uDDF4"],"","",["flag-bo"],33,21,15,0],
  34551. "1f1e7-1f1f6":[["\uD83C\uDDE7\uD83C\uDDF6"],"","",["flag-bq"],33,22,13,0],
  34552. "1f1e7-1f1f7":[["\uD83C\uDDE7\uD83C\uDDF7"],"","",["flag-br"],33,23,15,0],
  34553. "1f1e7-1f1f8":[["\uD83C\uDDE7\uD83C\uDDF8"],"","",["flag-bs"],33,24,15,0],
  34554. "1f1e7-1f1f9":[["\uD83C\uDDE7\uD83C\uDDF9"],"","",["flag-bt"],33,25,15,0],
  34555. "1f1e7-1f1fb":[["\uD83C\uDDE7\uD83C\uDDFB"],"","",["flag-bv"],33,26,13,0],
  34556. "1f1e7-1f1fc":[["\uD83C\uDDE7\uD83C\uDDFC"],"","",["flag-bw"],33,27,15,0],
  34557. "1f1e7-1f1fe":[["\uD83C\uDDE7\uD83C\uDDFE"],"","",["flag-by"],33,28,15,0],
  34558. "1f1e7-1f1ff":[["\uD83C\uDDE7\uD83C\uDDFF"],"","",["flag-bz"],33,29,15,0],
  34559. "1f1e8-1f1e6":[["\uD83C\uDDE8\uD83C\uDDE6"],"","",["flag-ca"],33,30,15,0],
  34560. "1f1e8-1f1e8":[["\uD83C\uDDE8\uD83C\uDDE8"],"","",["flag-cc"],33,31,15,0],
  34561. "1f1e8-1f1e9":[["\uD83C\uDDE8\uD83C\uDDE9"],"","",["flag-cd"],33,32,15,0],
  34562. "1f1e8-1f1eb":[["\uD83C\uDDE8\uD83C\uDDEB"],"","",["flag-cf"],33,33,15,0],
  34563. "1f1e8-1f1ec":[["\uD83C\uDDE8\uD83C\uDDEC"],"","",["flag-cg"],33,34,15,0],
  34564. "1f1e8-1f1ed":[["\uD83C\uDDE8\uD83C\uDDED"],"","",["flag-ch"],33,35,15,0],
  34565. "1f1e8-1f1ee":[["\uD83C\uDDE8\uD83C\uDDEE"],"","",["flag-ci"],33,36,15,0],
  34566. "1f1e8-1f1f0":[["\uD83C\uDDE8\uD83C\uDDF0"],"","",["flag-ck"],33,37,15,0],
  34567. "1f1e8-1f1f1":[["\uD83C\uDDE8\uD83C\uDDF1"],"","",["flag-cl"],33,38,15,0],
  34568. "1f1e8-1f1f2":[["\uD83C\uDDE8\uD83C\uDDF2"],"","",["flag-cm"],33,39,15,0],
  34569. "1f1e8-1f1f3":[["\uD83C\uDDE8\uD83C\uDDF3"],"\uE513","\uDBB9\uDCED",["flag-cn","cn"],33,40,15,0],
  34570. "1f1e8-1f1f4":[["\uD83C\uDDE8\uD83C\uDDF4"],"","",["flag-co"],34,0,15,0],
  34571. "1f1e8-1f1f5":[["\uD83C\uDDE8\uD83C\uDDF5"],"","",["flag-cp"],34,1,13,0],
  34572. "1f1e8-1f1f7":[["\uD83C\uDDE8\uD83C\uDDF7"],"","",["flag-cr"],34,2,15,0],
  34573. "1f1e8-1f1fa":[["\uD83C\uDDE8\uD83C\uDDFA"],"","",["flag-cu"],34,3,15,0],
  34574. "1f1e8-1f1fb":[["\uD83C\uDDE8\uD83C\uDDFB"],"","",["flag-cv"],34,4,15,0],
  34575. "1f1e8-1f1fc":[["\uD83C\uDDE8\uD83C\uDDFC"],"","",["flag-cw"],34,5,15,0],
  34576. "1f1e8-1f1fd":[["\uD83C\uDDE8\uD83C\uDDFD"],"","",["flag-cx"],34,6,15,0],
  34577. "1f1e8-1f1fe":[["\uD83C\uDDE8\uD83C\uDDFE"],"","",["flag-cy"],34,7,15,0],
  34578. "1f1e8-1f1ff":[["\uD83C\uDDE8\uD83C\uDDFF"],"","",["flag-cz"],34,8,15,0],
  34579. "1f1e9-1f1ea":[["\uD83C\uDDE9\uD83C\uDDEA"],"\uE50E","\uDBB9\uDCE8",["flag-de","de"],34,9,15,0],
  34580. "1f1e9-1f1ec":[["\uD83C\uDDE9\uD83C\uDDEC"],"","",["flag-dg"],34,10,13,0],
  34581. "1f1e9-1f1ef":[["\uD83C\uDDE9\uD83C\uDDEF"],"","",["flag-dj"],34,11,15,0],
  34582. "1f1e9-1f1f0":[["\uD83C\uDDE9\uD83C\uDDF0"],"","",["flag-dk"],34,12,15,0],
  34583. "1f1e9-1f1f2":[["\uD83C\uDDE9\uD83C\uDDF2"],"","",["flag-dm"],34,13,15,0],
  34584. "1f1e9-1f1f4":[["\uD83C\uDDE9\uD83C\uDDF4"],"","",["flag-do"],34,14,15,0],
  34585. "1f1e9-1f1ff":[["\uD83C\uDDE9\uD83C\uDDFF"],"","",["flag-dz"],34,15,15,0],
  34586. "1f1ea-1f1e6":[["\uD83C\uDDEA\uD83C\uDDE6"],"","",["flag-ea"],34,16,13,0],
  34587. "1f1ea-1f1e8":[["\uD83C\uDDEA\uD83C\uDDE8"],"","",["flag-ec"],34,17,15,0],
  34588. "1f1ea-1f1ea":[["\uD83C\uDDEA\uD83C\uDDEA"],"","",["flag-ee"],34,18,15,0],
  34589. "1f1ea-1f1ec":[["\uD83C\uDDEA\uD83C\uDDEC"],"","",["flag-eg"],34,19,15,0],
  34590. "1f1ea-1f1ed":[["\uD83C\uDDEA\uD83C\uDDED"],"","",["flag-eh"],34,20,13,0],
  34591. "1f1ea-1f1f7":[["\uD83C\uDDEA\uD83C\uDDF7"],"","",["flag-er"],34,21,15,0],
  34592. "1f1ea-1f1f8":[["\uD83C\uDDEA\uD83C\uDDF8"],"\uE511","\uDBB9\uDCEB",["flag-es","es"],34,22,15,0],
  34593. "1f1ea-1f1f9":[["\uD83C\uDDEA\uD83C\uDDF9"],"","",["flag-et"],34,23,15,0],
  34594. "1f1ea-1f1fa":[["\uD83C\uDDEA\uD83C\uDDFA"],"","",["flag-eu"],34,24,15,0],
  34595. "1f1eb-1f1ee":[["\uD83C\uDDEB\uD83C\uDDEE"],"","",["flag-fi"],34,25,15,0],
  34596. "1f1eb-1f1ef":[["\uD83C\uDDEB\uD83C\uDDEF"],"","",["flag-fj"],34,26,15,0],
  34597. "1f1eb-1f1f0":[["\uD83C\uDDEB\uD83C\uDDF0"],"","",["flag-fk"],34,27,13,0],
  34598. "1f1eb-1f1f2":[["\uD83C\uDDEB\uD83C\uDDF2"],"","",["flag-fm"],34,28,15,0],
  34599. "1f1eb-1f1f4":[["\uD83C\uDDEB\uD83C\uDDF4"],"","",["flag-fo"],34,29,15,0],
  34600. "1f1eb-1f1f7":[["\uD83C\uDDEB\uD83C\uDDF7"],"\uE50D","\uDBB9\uDCE7",["flag-fr","fr"],34,30,15,0],
  34601. "1f1ec-1f1e6":[["\uD83C\uDDEC\uD83C\uDDE6"],"","",["flag-ga"],34,31,15,0],
  34602. "1f1ec-1f1e7":[["\uD83C\uDDEC\uD83C\uDDE7"],"\uE510","\uDBB9\uDCEA",["flag-gb","gb","uk"],34,32,15,0],
  34603. "1f1ec-1f1e9":[["\uD83C\uDDEC\uD83C\uDDE9"],"","",["flag-gd"],34,33,15,0],
  34604. "1f1ec-1f1ea":[["\uD83C\uDDEC\uD83C\uDDEA"],"","",["flag-ge"],34,34,15,0],
  34605. "1f1ec-1f1eb":[["\uD83C\uDDEC\uD83C\uDDEB"],"","",["flag-gf"],34,35,13,0],
  34606. "1f1ec-1f1ec":[["\uD83C\uDDEC\uD83C\uDDEC"],"","",["flag-gg"],34,36,15,0],
  34607. "1f1ec-1f1ed":[["\uD83C\uDDEC\uD83C\uDDED"],"","",["flag-gh"],34,37,15,0],
  34608. "1f1ec-1f1ee":[["\uD83C\uDDEC\uD83C\uDDEE"],"","",["flag-gi"],34,38,15,0],
  34609. "1f1ec-1f1f1":[["\uD83C\uDDEC\uD83C\uDDF1"],"","",["flag-gl"],34,39,15,0],
  34610. "1f1ec-1f1f2":[["\uD83C\uDDEC\uD83C\uDDF2"],"","",["flag-gm"],34,40,15,0],
  34611. "1f1ec-1f1f3":[["\uD83C\uDDEC\uD83C\uDDF3"],"","",["flag-gn"],35,0,15,0],
  34612. "1f1ec-1f1f5":[["\uD83C\uDDEC\uD83C\uDDF5"],"","",["flag-gp"],35,1,13,0],
  34613. "1f1ec-1f1f6":[["\uD83C\uDDEC\uD83C\uDDF6"],"","",["flag-gq"],35,2,15,0],
  34614. "1f1ec-1f1f7":[["\uD83C\uDDEC\uD83C\uDDF7"],"","",["flag-gr"],35,3,15,0],
  34615. "1f1ec-1f1f8":[["\uD83C\uDDEC\uD83C\uDDF8"],"","",["flag-gs"],35,4,13,0],
  34616. "1f1ec-1f1f9":[["\uD83C\uDDEC\uD83C\uDDF9"],"","",["flag-gt"],35,5,15,0],
  34617. "1f1ec-1f1fa":[["\uD83C\uDDEC\uD83C\uDDFA"],"","",["flag-gu"],35,6,15,0],
  34618. "1f1ec-1f1fc":[["\uD83C\uDDEC\uD83C\uDDFC"],"","",["flag-gw"],35,7,15,0],
  34619. "1f1ec-1f1fe":[["\uD83C\uDDEC\uD83C\uDDFE"],"","",["flag-gy"],35,8,15,0],
  34620. "1f1ed-1f1f0":[["\uD83C\uDDED\uD83C\uDDF0"],"","",["flag-hk"],35,9,15,0],
  34621. "1f1ed-1f1f2":[["\uD83C\uDDED\uD83C\uDDF2"],"","",["flag-hm"],35,10,13,0],
  34622. "1f1ed-1f1f3":[["\uD83C\uDDED\uD83C\uDDF3"],"","",["flag-hn"],35,11,15,0],
  34623. "1f1ed-1f1f7":[["\uD83C\uDDED\uD83C\uDDF7"],"","",["flag-hr"],35,12,15,0],
  34624. "1f1ed-1f1f9":[["\uD83C\uDDED\uD83C\uDDF9"],"","",["flag-ht"],35,13,15,0],
  34625. "1f1ed-1f1fa":[["\uD83C\uDDED\uD83C\uDDFA"],"","",["flag-hu"],35,14,15,0],
  34626. "1f1ee-1f1e8":[["\uD83C\uDDEE\uD83C\uDDE8"],"","",["flag-ic"],35,15,13,0],
  34627. "1f1ee-1f1e9":[["\uD83C\uDDEE\uD83C\uDDE9"],"","",["flag-id"],35,16,15,0],
  34628. "1f1ee-1f1ea":[["\uD83C\uDDEE\uD83C\uDDEA"],"","",["flag-ie"],35,17,15,0],
  34629. "1f1ee-1f1f1":[["\uD83C\uDDEE\uD83C\uDDF1"],"","",["flag-il"],35,18,15,0],
  34630. "1f1ee-1f1f2":[["\uD83C\uDDEE\uD83C\uDDF2"],"","",["flag-im"],35,19,15,0],
  34631. "1f1ee-1f1f3":[["\uD83C\uDDEE\uD83C\uDDF3"],"","",["flag-in"],35,20,15,0],
  34632. "1f1ee-1f1f4":[["\uD83C\uDDEE\uD83C\uDDF4"],"","",["flag-io"],35,21,15,0],
  34633. "1f1ee-1f1f6":[["\uD83C\uDDEE\uD83C\uDDF6"],"","",["flag-iq"],35,22,15,0],
  34634. "1f1ee-1f1f7":[["\uD83C\uDDEE\uD83C\uDDF7"],"","",["flag-ir"],35,23,15,0],
  34635. "1f1ee-1f1f8":[["\uD83C\uDDEE\uD83C\uDDF8"],"","",["flag-is"],35,24,15,0],
  34636. "1f1ee-1f1f9":[["\uD83C\uDDEE\uD83C\uDDF9"],"\uE50F","\uDBB9\uDCE9",["flag-it","it"],35,25,15,0],
  34637. "1f1ef-1f1ea":[["\uD83C\uDDEF\uD83C\uDDEA"],"","",["flag-je"],35,26,15,0],
  34638. "1f1ef-1f1f2":[["\uD83C\uDDEF\uD83C\uDDF2"],"","",["flag-jm"],35,27,15,0],
  34639. "1f1ef-1f1f4":[["\uD83C\uDDEF\uD83C\uDDF4"],"","",["flag-jo"],35,28,15,0],
  34640. "1f1ef-1f1f5":[["\uD83C\uDDEF\uD83C\uDDF5"],"\uE50B","\uDBB9\uDCE5",["flag-jp","jp"],35,29,15,0],
  34641. "1f1f0-1f1ea":[["\uD83C\uDDF0\uD83C\uDDEA"],"","",["flag-ke"],35,30,15,0],
  34642. "1f1f0-1f1ec":[["\uD83C\uDDF0\uD83C\uDDEC"],"","",["flag-kg"],35,31,15,0],
  34643. "1f1f0-1f1ed":[["\uD83C\uDDF0\uD83C\uDDED"],"","",["flag-kh"],35,32,15,0],
  34644. "1f1f0-1f1ee":[["\uD83C\uDDF0\uD83C\uDDEE"],"","",["flag-ki"],35,33,15,0],
  34645. "1f1f0-1f1f2":[["\uD83C\uDDF0\uD83C\uDDF2"],"","",["flag-km"],35,34,15,0],
  34646. "1f1f0-1f1f3":[["\uD83C\uDDF0\uD83C\uDDF3"],"","",["flag-kn"],35,35,15,0],
  34647. "1f1f0-1f1f5":[["\uD83C\uDDF0\uD83C\uDDF5"],"","",["flag-kp"],35,36,15,0],
  34648. "1f1f0-1f1f7":[["\uD83C\uDDF0\uD83C\uDDF7"],"\uE514","\uDBB9\uDCEE",["flag-kr","kr"],35,37,15,0],
  34649. "1f1f0-1f1fc":[["\uD83C\uDDF0\uD83C\uDDFC"],"","",["flag-kw"],35,38,15,0],
  34650. "1f1f0-1f1fe":[["\uD83C\uDDF0\uD83C\uDDFE"],"","",["flag-ky"],35,39,15,0],
  34651. "1f1f0-1f1ff":[["\uD83C\uDDF0\uD83C\uDDFF"],"","",["flag-kz"],35,40,15,0],
  34652. "1f1f1-1f1e6":[["\uD83C\uDDF1\uD83C\uDDE6"],"","",["flag-la"],36,0,15,0],
  34653. "1f1f1-1f1e7":[["\uD83C\uDDF1\uD83C\uDDE7"],"","",["flag-lb"],36,1,15,0],
  34654. "1f1f1-1f1e8":[["\uD83C\uDDF1\uD83C\uDDE8"],"","",["flag-lc"],36,2,15,0],
  34655. "1f1f1-1f1ee":[["\uD83C\uDDF1\uD83C\uDDEE"],"","",["flag-li"],36,3,15,0],
  34656. "1f1f1-1f1f0":[["\uD83C\uDDF1\uD83C\uDDF0"],"","",["flag-lk"],36,4,15,0],
  34657. "1f1f1-1f1f7":[["\uD83C\uDDF1\uD83C\uDDF7"],"","",["flag-lr"],36,5,15,0],
  34658. "1f1f1-1f1f8":[["\uD83C\uDDF1\uD83C\uDDF8"],"","",["flag-ls"],36,6,15,0],
  34659. "1f1f1-1f1f9":[["\uD83C\uDDF1\uD83C\uDDF9"],"","",["flag-lt"],36,7,15,0],
  34660. "1f1f1-1f1fa":[["\uD83C\uDDF1\uD83C\uDDFA"],"","",["flag-lu"],36,8,15,0],
  34661. "1f1f1-1f1fb":[["\uD83C\uDDF1\uD83C\uDDFB"],"","",["flag-lv"],36,9,15,0],
  34662. "1f1f1-1f1fe":[["\uD83C\uDDF1\uD83C\uDDFE"],"","",["flag-ly"],36,10,15,0],
  34663. "1f1f2-1f1e6":[["\uD83C\uDDF2\uD83C\uDDE6"],"","",["flag-ma"],36,11,15,0],
  34664. "1f1f2-1f1e8":[["\uD83C\uDDF2\uD83C\uDDE8"],"","",["flag-mc"],36,12,15,0],
  34665. "1f1f2-1f1e9":[["\uD83C\uDDF2\uD83C\uDDE9"],"","",["flag-md"],36,13,15,0],
  34666. "1f1f2-1f1ea":[["\uD83C\uDDF2\uD83C\uDDEA"],"","",["flag-me"],36,14,15,0],
  34667. "1f1f2-1f1eb":[["\uD83C\uDDF2\uD83C\uDDEB"],"","",["flag-mf"],36,15,13,0],
  34668. "1f1f2-1f1ec":[["\uD83C\uDDF2\uD83C\uDDEC"],"","",["flag-mg"],36,16,15,0],
  34669. "1f1f2-1f1ed":[["\uD83C\uDDF2\uD83C\uDDED"],"","",["flag-mh"],36,17,15,0],
  34670. "1f1f2-1f1f0":[["\uD83C\uDDF2\uD83C\uDDF0"],"","",["flag-mk"],36,18,15,0],
  34671. "1f1f2-1f1f1":[["\uD83C\uDDF2\uD83C\uDDF1"],"","",["flag-ml"],36,19,15,0],
  34672. "1f1f2-1f1f2":[["\uD83C\uDDF2\uD83C\uDDF2"],"","",["flag-mm"],36,20,15,0],
  34673. "1f1f2-1f1f3":[["\uD83C\uDDF2\uD83C\uDDF3"],"","",["flag-mn"],36,21,15,0],
  34674. "1f1f2-1f1f4":[["\uD83C\uDDF2\uD83C\uDDF4"],"","",["flag-mo"],36,22,15,0],
  34675. "1f1f2-1f1f5":[["\uD83C\uDDF2\uD83C\uDDF5"],"","",["flag-mp"],36,23,15,0],
  34676. "1f1f2-1f1f6":[["\uD83C\uDDF2\uD83C\uDDF6"],"","",["flag-mq"],36,24,13,0],
  34677. "1f1f2-1f1f7":[["\uD83C\uDDF2\uD83C\uDDF7"],"","",["flag-mr"],36,25,15,0],
  34678. "1f1f2-1f1f8":[["\uD83C\uDDF2\uD83C\uDDF8"],"","",["flag-ms"],36,26,15,0],
  34679. "1f1f2-1f1f9":[["\uD83C\uDDF2\uD83C\uDDF9"],"","",["flag-mt"],36,27,15,0],
  34680. "1f1f2-1f1fa":[["\uD83C\uDDF2\uD83C\uDDFA"],"","",["flag-mu"],36,28,15,0],
  34681. "1f1f2-1f1fb":[["\uD83C\uDDF2\uD83C\uDDFB"],"","",["flag-mv"],36,29,15,0],
  34682. "1f1f2-1f1fc":[["\uD83C\uDDF2\uD83C\uDDFC"],"","",["flag-mw"],36,30,15,0],
  34683. "1f1f2-1f1fd":[["\uD83C\uDDF2\uD83C\uDDFD"],"","",["flag-mx"],36,31,15,0],
  34684. "1f1f2-1f1fe":[["\uD83C\uDDF2\uD83C\uDDFE"],"","",["flag-my"],36,32,15,0],
  34685. "1f1f2-1f1ff":[["\uD83C\uDDF2\uD83C\uDDFF"],"","",["flag-mz"],36,33,15,0],
  34686. "1f1f3-1f1e6":[["\uD83C\uDDF3\uD83C\uDDE6"],"","",["flag-na"],36,34,15,0],
  34687. "1f1f3-1f1e8":[["\uD83C\uDDF3\uD83C\uDDE8"],"","",["flag-nc"],36,35,13,0],
  34688. "1f1f3-1f1ea":[["\uD83C\uDDF3\uD83C\uDDEA"],"","",["flag-ne"],36,36,15,0],
  34689. "1f1f3-1f1eb":[["\uD83C\uDDF3\uD83C\uDDEB"],"","",["flag-nf"],36,37,15,0],
  34690. "1f1f3-1f1ec":[["\uD83C\uDDF3\uD83C\uDDEC"],"","",["flag-ng"],36,38,15,0],
  34691. "1f1f3-1f1ee":[["\uD83C\uDDF3\uD83C\uDDEE"],"","",["flag-ni"],36,39,15,0],
  34692. "1f1f3-1f1f1":[["\uD83C\uDDF3\uD83C\uDDF1"],"","",["flag-nl"],36,40,15,0],
  34693. "1f1f3-1f1f4":[["\uD83C\uDDF3\uD83C\uDDF4"],"","",["flag-no"],37,0,15,0],
  34694. "1f1f3-1f1f5":[["\uD83C\uDDF3\uD83C\uDDF5"],"","",["flag-np"],37,1,15,0],
  34695. "1f1f3-1f1f7":[["\uD83C\uDDF3\uD83C\uDDF7"],"","",["flag-nr"],37,2,15,0],
  34696. "1f1f3-1f1fa":[["\uD83C\uDDF3\uD83C\uDDFA"],"","",["flag-nu"],37,3,15,0],
  34697. "1f1f3-1f1ff":[["\uD83C\uDDF3\uD83C\uDDFF"],"","",["flag-nz"],37,4,15,0],
  34698. "1f1f4-1f1f2":[["\uD83C\uDDF4\uD83C\uDDF2"],"","",["flag-om"],37,5,15,0],
  34699. "1f1f5-1f1e6":[["\uD83C\uDDF5\uD83C\uDDE6"],"","",["flag-pa"],37,6,15,0],
  34700. "1f1f5-1f1ea":[["\uD83C\uDDF5\uD83C\uDDEA"],"","",["flag-pe"],37,7,15,0],
  34701. "1f1f5-1f1eb":[["\uD83C\uDDF5\uD83C\uDDEB"],"","",["flag-pf"],37,8,15,0],
  34702. "1f1f5-1f1ec":[["\uD83C\uDDF5\uD83C\uDDEC"],"","",["flag-pg"],37,9,15,0],
  34703. "1f1f5-1f1ed":[["\uD83C\uDDF5\uD83C\uDDED"],"","",["flag-ph"],37,10,15,0],
  34704. "1f1f5-1f1f0":[["\uD83C\uDDF5\uD83C\uDDF0"],"","",["flag-pk"],37,11,15,0],
  34705. "1f1f5-1f1f1":[["\uD83C\uDDF5\uD83C\uDDF1"],"","",["flag-pl"],37,12,15,0],
  34706. "1f1f5-1f1f2":[["\uD83C\uDDF5\uD83C\uDDF2"],"","",["flag-pm"],37,13,13,0],
  34707. "1f1f5-1f1f3":[["\uD83C\uDDF5\uD83C\uDDF3"],"","",["flag-pn"],37,14,15,0],
  34708. "1f1f5-1f1f7":[["\uD83C\uDDF5\uD83C\uDDF7"],"","",["flag-pr"],37,15,15,0],
  34709. "1f1f5-1f1f8":[["\uD83C\uDDF5\uD83C\uDDF8"],"","",["flag-ps"],37,16,15,0],
  34710. "1f1f5-1f1f9":[["\uD83C\uDDF5\uD83C\uDDF9"],"","",["flag-pt"],37,17,15,0],
  34711. "1f1f5-1f1fc":[["\uD83C\uDDF5\uD83C\uDDFC"],"","",["flag-pw"],37,18,15,0],
  34712. "1f1f5-1f1fe":[["\uD83C\uDDF5\uD83C\uDDFE"],"","",["flag-py"],37,19,15,0],
  34713. "1f1f6-1f1e6":[["\uD83C\uDDF6\uD83C\uDDE6"],"","",["flag-qa"],37,20,15,0],
  34714. "1f1f7-1f1ea":[["\uD83C\uDDF7\uD83C\uDDEA"],"","",["flag-re"],37,21,13,0],
  34715. "1f1f7-1f1f4":[["\uD83C\uDDF7\uD83C\uDDF4"],"","",["flag-ro"],37,22,15,0],
  34716. "1f1f7-1f1f8":[["\uD83C\uDDF7\uD83C\uDDF8"],"","",["flag-rs"],37,23,15,0],
  34717. "1f1f7-1f1fa":[["\uD83C\uDDF7\uD83C\uDDFA"],"\uE512","\uDBB9\uDCEC",["flag-ru","ru"],37,24,15,0],
  34718. "1f1f7-1f1fc":[["\uD83C\uDDF7\uD83C\uDDFC"],"","",["flag-rw"],37,25,15,0],
  34719. "1f1f8-1f1e6":[["\uD83C\uDDF8\uD83C\uDDE6"],"","",["flag-sa"],37,26,15,0],
  34720. "1f1f8-1f1e7":[["\uD83C\uDDF8\uD83C\uDDE7"],"","",["flag-sb"],37,27,15,0],
  34721. "1f1f8-1f1e8":[["\uD83C\uDDF8\uD83C\uDDE8"],"","",["flag-sc"],37,28,15,0],
  34722. "1f1f8-1f1e9":[["\uD83C\uDDF8\uD83C\uDDE9"],"","",["flag-sd"],37,29,15,0],
  34723. "1f1f8-1f1ea":[["\uD83C\uDDF8\uD83C\uDDEA"],"","",["flag-se"],37,30,15,0],
  34724. "1f1f8-1f1ec":[["\uD83C\uDDF8\uD83C\uDDEC"],"","",["flag-sg"],37,31,15,0],
  34725. "1f1f8-1f1ed":[["\uD83C\uDDF8\uD83C\uDDED"],"","",["flag-sh"],37,32,13,0],
  34726. "1f1f8-1f1ee":[["\uD83C\uDDF8\uD83C\uDDEE"],"","",["flag-si"],37,33,15,0],
  34727. "1f1f8-1f1ef":[["\uD83C\uDDF8\uD83C\uDDEF"],"","",["flag-sj"],37,34,13,0],
  34728. "1f1f8-1f1f0":[["\uD83C\uDDF8\uD83C\uDDF0"],"","",["flag-sk"],37,35,15,0],
  34729. "1f1f8-1f1f1":[["\uD83C\uDDF8\uD83C\uDDF1"],"","",["flag-sl"],37,36,15,0],
  34730. "1f1f8-1f1f2":[["\uD83C\uDDF8\uD83C\uDDF2"],"","",["flag-sm"],37,37,15,0],
  34731. "1f1f8-1f1f3":[["\uD83C\uDDF8\uD83C\uDDF3"],"","",["flag-sn"],37,38,15,0],
  34732. "1f1f8-1f1f4":[["\uD83C\uDDF8\uD83C\uDDF4"],"","",["flag-so"],37,39,15,0],
  34733. "1f1f8-1f1f7":[["\uD83C\uDDF8\uD83C\uDDF7"],"","",["flag-sr"],37,40,15,0],
  34734. "1f1f8-1f1f8":[["\uD83C\uDDF8\uD83C\uDDF8"],"","",["flag-ss"],38,0,15,0],
  34735. "1f1f8-1f1f9":[["\uD83C\uDDF8\uD83C\uDDF9"],"","",["flag-st"],38,1,15,0],
  34736. "1f1f8-1f1fb":[["\uD83C\uDDF8\uD83C\uDDFB"],"","",["flag-sv"],38,2,15,0],
  34737. "1f1f8-1f1fd":[["\uD83C\uDDF8\uD83C\uDDFD"],"","",["flag-sx"],38,3,15,0],
  34738. "1f1f8-1f1fe":[["\uD83C\uDDF8\uD83C\uDDFE"],"","",["flag-sy"],38,4,15,0],
  34739. "1f1f8-1f1ff":[["\uD83C\uDDF8\uD83C\uDDFF"],"","",["flag-sz"],38,5,15,0],
  34740. "1f1f9-1f1e6":[["\uD83C\uDDF9\uD83C\uDDE6"],"","",["flag-ta"],38,6,13,0],
  34741. "1f1f9-1f1e8":[["\uD83C\uDDF9\uD83C\uDDE8"],"","",["flag-tc"],38,7,15,0],
  34742. "1f1f9-1f1e9":[["\uD83C\uDDF9\uD83C\uDDE9"],"","",["flag-td"],38,8,15,0],
  34743. "1f1f9-1f1eb":[["\uD83C\uDDF9\uD83C\uDDEB"],"","",["flag-tf"],38,9,13,0],
  34744. "1f1f9-1f1ec":[["\uD83C\uDDF9\uD83C\uDDEC"],"","",["flag-tg"],38,10,15,0],
  34745. "1f1f9-1f1ed":[["\uD83C\uDDF9\uD83C\uDDED"],"","",["flag-th"],38,11,15,0],
  34746. "1f1f9-1f1ef":[["\uD83C\uDDF9\uD83C\uDDEF"],"","",["flag-tj"],38,12,15,0],
  34747. "1f1f9-1f1f0":[["\uD83C\uDDF9\uD83C\uDDF0"],"","",["flag-tk"],38,13,15,0],
  34748. "1f1f9-1f1f1":[["\uD83C\uDDF9\uD83C\uDDF1"],"","",["flag-tl"],38,14,15,0],
  34749. "1f1f9-1f1f2":[["\uD83C\uDDF9\uD83C\uDDF2"],"","",["flag-tm"],38,15,15,0],
  34750. "1f1f9-1f1f3":[["\uD83C\uDDF9\uD83C\uDDF3"],"","",["flag-tn"],38,16,15,0],
  34751. "1f1f9-1f1f4":[["\uD83C\uDDF9\uD83C\uDDF4"],"","",["flag-to"],38,17,15,0],
  34752. "1f1f9-1f1f7":[["\uD83C\uDDF9\uD83C\uDDF7"],"","",["flag-tr"],38,18,15,0],
  34753. "1f1f9-1f1f9":[["\uD83C\uDDF9\uD83C\uDDF9"],"","",["flag-tt"],38,19,15,0],
  34754. "1f1f9-1f1fb":[["\uD83C\uDDF9\uD83C\uDDFB"],"","",["flag-tv"],38,20,15,0],
  34755. "1f1f9-1f1fc":[["\uD83C\uDDF9\uD83C\uDDFC"],"","",["flag-tw"],38,21,15,0],
  34756. "1f1f9-1f1ff":[["\uD83C\uDDF9\uD83C\uDDFF"],"","",["flag-tz"],38,22,15,0],
  34757. "1f1fa-1f1e6":[["\uD83C\uDDFA\uD83C\uDDE6"],"","",["flag-ua"],38,23,15,0],
  34758. "1f1fa-1f1ec":[["\uD83C\uDDFA\uD83C\uDDEC"],"","",["flag-ug"],38,24,15,0],
  34759. "1f1fa-1f1f2":[["\uD83C\uDDFA\uD83C\uDDF2"],"","",["flag-um"],38,25,13,0],
  34760. "1f1fa-1f1f8":[["\uD83C\uDDFA\uD83C\uDDF8"],"\uE50C","\uDBB9\uDCE6",["flag-us","us"],38,26,15,0],
  34761. "1f1fa-1f1fe":[["\uD83C\uDDFA\uD83C\uDDFE"],"","",["flag-uy"],38,27,15,0],
  34762. "1f1fa-1f1ff":[["\uD83C\uDDFA\uD83C\uDDFF"],"","",["flag-uz"],38,28,15,0],
  34763. "1f1fb-1f1e6":[["\uD83C\uDDFB\uD83C\uDDE6"],"","",["flag-va"],38,29,15,0],
  34764. "1f1fb-1f1e8":[["\uD83C\uDDFB\uD83C\uDDE8"],"","",["flag-vc"],38,30,15,0],
  34765. "1f1fb-1f1ea":[["\uD83C\uDDFB\uD83C\uDDEA"],"","",["flag-ve"],38,31,15,0],
  34766. "1f1fb-1f1ec":[["\uD83C\uDDFB\uD83C\uDDEC"],"","",["flag-vg"],38,32,15,0],
  34767. "1f1fb-1f1ee":[["\uD83C\uDDFB\uD83C\uDDEE"],"","",["flag-vi"],38,33,15,0],
  34768. "1f1fb-1f1f3":[["\uD83C\uDDFB\uD83C\uDDF3"],"","",["flag-vn"],38,34,15,0],
  34769. "1f1fb-1f1fa":[["\uD83C\uDDFB\uD83C\uDDFA"],"","",["flag-vu"],38,35,15,0],
  34770. "1f1fc-1f1eb":[["\uD83C\uDDFC\uD83C\uDDEB"],"","",["flag-wf"],38,36,13,0],
  34771. "1f1fc-1f1f8":[["\uD83C\uDDFC\uD83C\uDDF8"],"","",["flag-ws"],38,37,15,0],
  34772. "1f1fd-1f1f0":[["\uD83C\uDDFD\uD83C\uDDF0"],"","",["flag-xk"],38,38,13,0],
  34773. "1f1fe-1f1ea":[["\uD83C\uDDFE\uD83C\uDDEA"],"","",["flag-ye"],38,39,15,0],
  34774. "1f1fe-1f1f9":[["\uD83C\uDDFE\uD83C\uDDF9"],"","",["flag-yt"],38,40,13,0],
  34775. "1f1ff-1f1e6":[["\uD83C\uDDFF\uD83C\uDDE6"],"","",["flag-za"],39,0,15,0],
  34776. "1f1ff-1f1f2":[["\uD83C\uDDFF\uD83C\uDDF2"],"","",["flag-zm"],39,1,15,0],
  34777. "1f1ff-1f1fc":[["\uD83C\uDDFF\uD83C\uDDFC"],"","",["flag-zw"],39,2,15,0],
  34778. "1f468-200d-1f468-200d-1f466":[["\uD83D\uDC68\u200D\uD83D\uDC68\u200D\uD83D\uDC66"],"","",["man-man-boy"],39,3,15,0],
  34779. "1f468-200d-1f468-200d-1f466-200d-1f466":[["\uD83D\uDC68\u200D\uD83D\uDC68\u200D\uD83D\uDC66\u200D\uD83D\uDC66"],"","",["man-man-boy-boy"],39,4,15,0],
  34780. "1f468-200d-1f468-200d-1f467":[["\uD83D\uDC68\u200D\uD83D\uDC68\u200D\uD83D\uDC67"],"","",["man-man-girl"],39,5,15,0],
  34781. "1f468-200d-1f468-200d-1f467-200d-1f466":[["\uD83D\uDC68\u200D\uD83D\uDC68\u200D\uD83D\uDC67\u200D\uD83D\uDC66"],"","",["man-man-girl-boy"],39,6,15,0],
  34782. "1f468-200d-1f468-200d-1f467-200d-1f467":[["\uD83D\uDC68\u200D\uD83D\uDC68\u200D\uD83D\uDC67\u200D\uD83D\uDC67"],"","",["man-man-girl-girl"],39,7,15,0],
  34783. "1f468-200d-1f469-200d-1f466-200d-1f466":[["\uD83D\uDC68\u200D\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66"],"","",["man-woman-boy-boy"],39,8,15,0],
  34784. "1f468-200d-1f469-200d-1f467":[["\uD83D\uDC68\u200D\uD83D\uDC69\u200D\uD83D\uDC67"],"","",["man-woman-girl"],39,9,15,0],
  34785. "1f468-200d-1f469-200d-1f467-200d-1f466":[["\uD83D\uDC68\u200D\uD83D\uDC69\u200D\uD83D\uDC67\u200D\uD83D\uDC66"],"","",["man-woman-girl-boy"],39,10,15,0],
  34786. "1f468-200d-1f469-200d-1f467-200d-1f467":[["\uD83D\uDC68\u200D\uD83D\uDC69\u200D\uD83D\uDC67\u200D\uD83D\uDC67"],"","",["man-woman-girl-girl"],39,11,15,0],
  34787. "1f468-200d-2764-fe0f-200d-1f468":[["\uD83D\uDC68\u200D\u2764\uFE0F\u200D\uD83D\uDC68"],"","",["man-heart-man"],39,12,7,0],
  34788. "1f468-200d-2764-fe0f-200d-1f48b-200d-1f468":[["\uD83D\uDC68\u200D\u2764\uFE0F\u200D\uD83D\uDC8B\u200D\uD83D\uDC68"],"","",["man-kiss-man"],39,13,7,0],
  34789. "1f469-200d-1f469-200d-1f466":[["\uD83D\uDC69\u200D\uD83D\uDC69\u200D\uD83D\uDC66"],"","",["woman-woman-boy"],39,14,15,0],
  34790. "1f469-200d-1f469-200d-1f466-200d-1f466":[["\uD83D\uDC69\u200D\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66"],"","",["woman-woman-boy-boy"],39,15,15,0],
  34791. "1f469-200d-1f469-200d-1f467":[["\uD83D\uDC69\u200D\uD83D\uDC69\u200D\uD83D\uDC67"],"","",["woman-woman-girl"],39,16,15,0],
  34792. "1f469-200d-1f469-200d-1f467-200d-1f466":[["\uD83D\uDC69\u200D\uD83D\uDC69\u200D\uD83D\uDC67\u200D\uD83D\uDC66"],"","",["woman-woman-girl-boy"],39,17,15,0],
  34793. "1f469-200d-1f469-200d-1f467-200d-1f467":[["\uD83D\uDC69\u200D\uD83D\uDC69\u200D\uD83D\uDC67\u200D\uD83D\uDC67"],"","",["woman-woman-girl-girl"],39,18,15,0],
  34794. "1f469-200d-2764-fe0f-200d-1f469":[["\uD83D\uDC69\u200D\u2764\uFE0F\u200D\uD83D\uDC69"],"","",["woman-heart-woman"],39,19,7,0],
  34795. "1f469-200d-2764-fe0f-200d-1f48b-200d-1f469":[["\uD83D\uDC69\u200D\u2764\uFE0F\u200D\uD83D\uDC8B\u200D\uD83D\uDC69"],"","",["woman-kiss-woman"],39,20,7,0]
  34796. };
  34797. /** @private */
  34798. emoji.prototype.emoticons_data = {
  34799. "<3":"heart",
  34800. ":o)":"monkey_face",
  34801. ":*":"kiss",
  34802. ":-*":"kiss",
  34803. "<\/3":"broken_heart",
  34804. "=)":"smiley",
  34805. "=-)":"smiley",
  34806. "C:":"smile",
  34807. "c:":"smile",
  34808. ":D":"smile",
  34809. ":-D":"smile",
  34810. ":>":"laughing",
  34811. ":->":"laughing",
  34812. ";)":"wink",
  34813. ";-)":"wink",
  34814. "8)":"sunglasses",
  34815. ":|":"neutral_face",
  34816. ":-|":"neutral_face",
  34817. ":\\":"confused",
  34818. ":-\\":"confused",
  34819. ":\/":"confused",
  34820. ":-\/":"confused",
  34821. ":p":"stuck_out_tongue",
  34822. ":-p":"stuck_out_tongue",
  34823. ":P":"stuck_out_tongue",
  34824. ":-P":"stuck_out_tongue",
  34825. ":b":"stuck_out_tongue",
  34826. ":-b":"stuck_out_tongue",
  34827. ";p":"stuck_out_tongue_winking_eye",
  34828. ";-p":"stuck_out_tongue_winking_eye",
  34829. ";b":"stuck_out_tongue_winking_eye",
  34830. ";-b":"stuck_out_tongue_winking_eye",
  34831. ";P":"stuck_out_tongue_winking_eye",
  34832. ";-P":"stuck_out_tongue_winking_eye",
  34833. "):":"disappointed",
  34834. ":(":"disappointed",
  34835. ":-(":"disappointed",
  34836. ">:(":"angry",
  34837. ">:-(":"angry",
  34838. ":'(":"cry",
  34839. "D:":"anguished",
  34840. ":o":"open_mouth",
  34841. ":-o":"open_mouth",
  34842. ":O":"open_mouth",
  34843. ":-O":"open_mouth",
  34844. ":)":"slightly_smiling_face",
  34845. "(:":"slightly_smiling_face",
  34846. ":-)":"slightly_smiling_face"
  34847. };
  34848. /** @private */
  34849. emoji.prototype.variations_data = {
  34850. "261d-1f3fb":[1,11,13],
  34851. "261d-1f3fc":[1,12,13],
  34852. "261d-1f3fd":[1,13,13],
  34853. "261d-1f3fe":[1,14,13],
  34854. "261d-1f3ff":[1,15,13],
  34855. "26f9-1f3fb":[2,39,13],
  34856. "26f9-1f3fc":[2,40,13],
  34857. "26f9-1f3fd":[3,0,13],
  34858. "26f9-1f3fe":[3,1,13],
  34859. "26f9-1f3ff":[3,2,13],
  34860. "270a-1f3fb":[3,10,13],
  34861. "270a-1f3fc":[3,11,13],
  34862. "270a-1f3fd":[3,12,13],
  34863. "270a-1f3fe":[3,13,13],
  34864. "270a-1f3ff":[3,14,13],
  34865. "270b-1f3fb":[3,16,13],
  34866. "270b-1f3fc":[3,17,13],
  34867. "270b-1f3fd":[3,18,13],
  34868. "270b-1f3fe":[3,19,13],
  34869. "270b-1f3ff":[3,20,13],
  34870. "270c-1f3fb":[3,22,13],
  34871. "270c-1f3fc":[3,23,13],
  34872. "270c-1f3fd":[3,24,13],
  34873. "270c-1f3fe":[3,25,13],
  34874. "270c-1f3ff":[3,26,13],
  34875. "270d-1f3fb":[3,28,13],
  34876. "270d-1f3fc":[3,29,13],
  34877. "270d-1f3fd":[3,30,13],
  34878. "270d-1f3fe":[3,31,13],
  34879. "270d-1f3ff":[3,32,13],
  34880. "1f385-1f3fb":[8,30,13],
  34881. "1f385-1f3fc":[8,31,13],
  34882. "1f385-1f3fd":[8,32,13],
  34883. "1f385-1f3fe":[8,33,13],
  34884. "1f385-1f3ff":[8,34,13],
  34885. "1f3c3-1f3fb":[10,10,13],
  34886. "1f3c3-1f3fc":[10,11,13],
  34887. "1f3c3-1f3fd":[10,12,13],
  34888. "1f3c3-1f3fe":[10,13,13],
  34889. "1f3c3-1f3ff":[10,14,13],
  34890. "1f3c4-1f3fb":[10,16,13],
  34891. "1f3c4-1f3fc":[10,17,13],
  34892. "1f3c4-1f3fd":[10,18,13],
  34893. "1f3c4-1f3fe":[10,19,13],
  34894. "1f3c4-1f3ff":[10,20,13],
  34895. "1f3ca-1f3fb":[10,27,13],
  34896. "1f3ca-1f3fc":[10,28,13],
  34897. "1f3ca-1f3fd":[10,29,13],
  34898. "1f3ca-1f3fe":[10,30,13],
  34899. "1f3ca-1f3ff":[10,31,13],
  34900. "1f3cb-1f3fb":[10,33,13],
  34901. "1f3cb-1f3fc":[10,34,13],
  34902. "1f3cb-1f3fd":[10,35,13],
  34903. "1f3cb-1f3fe":[10,36,13],
  34904. "1f3cb-1f3ff":[10,37,13],
  34905. "1f442-1f3fb":[13,31,13],
  34906. "1f442-1f3fc":[13,32,13],
  34907. "1f442-1f3fd":[13,33,13],
  34908. "1f442-1f3fe":[13,34,13],
  34909. "1f442-1f3ff":[13,35,13],
  34910. "1f443-1f3fb":[13,37,13],
  34911. "1f443-1f3fc":[13,38,13],
  34912. "1f443-1f3fd":[13,39,13],
  34913. "1f443-1f3fe":[13,40,13],
  34914. "1f443-1f3ff":[14,0,13],
  34915. "1f446-1f3fb":[14,4,13],
  34916. "1f446-1f3fc":[14,5,13],
  34917. "1f446-1f3fd":[14,6,13],
  34918. "1f446-1f3fe":[14,7,13],
  34919. "1f446-1f3ff":[14,8,13],
  34920. "1f447-1f3fb":[14,10,13],
  34921. "1f447-1f3fc":[14,11,13],
  34922. "1f447-1f3fd":[14,12,13],
  34923. "1f447-1f3fe":[14,13,13],
  34924. "1f447-1f3ff":[14,14,13],
  34925. "1f448-1f3fb":[14,16,13],
  34926. "1f448-1f3fc":[14,17,13],
  34927. "1f448-1f3fd":[14,18,13],
  34928. "1f448-1f3fe":[14,19,13],
  34929. "1f448-1f3ff":[14,20,13],
  34930. "1f449-1f3fb":[14,22,13],
  34931. "1f449-1f3fc":[14,23,13],
  34932. "1f449-1f3fd":[14,24,13],
  34933. "1f449-1f3fe":[14,25,13],
  34934. "1f449-1f3ff":[14,26,13],
  34935. "1f44a-1f3fb":[14,28,13],
  34936. "1f44a-1f3fc":[14,29,13],
  34937. "1f44a-1f3fd":[14,30,13],
  34938. "1f44a-1f3fe":[14,31,13],
  34939. "1f44a-1f3ff":[14,32,13],
  34940. "1f44b-1f3fb":[14,34,13],
  34941. "1f44b-1f3fc":[14,35,13],
  34942. "1f44b-1f3fd":[14,36,13],
  34943. "1f44b-1f3fe":[14,37,13],
  34944. "1f44b-1f3ff":[14,38,13],
  34945. "1f44c-1f3fb":[14,40,13],
  34946. "1f44c-1f3fc":[15,0,13],
  34947. "1f44c-1f3fd":[15,1,13],
  34948. "1f44c-1f3fe":[15,2,13],
  34949. "1f44c-1f3ff":[15,3,13],
  34950. "1f44d-1f3fb":[15,5,13],
  34951. "1f44d-1f3fc":[15,6,13],
  34952. "1f44d-1f3fd":[15,7,13],
  34953. "1f44d-1f3fe":[15,8,13],
  34954. "1f44d-1f3ff":[15,9,13],
  34955. "1f44e-1f3fb":[15,11,13],
  34956. "1f44e-1f3fc":[15,12,13],
  34957. "1f44e-1f3fd":[15,13,13],
  34958. "1f44e-1f3fe":[15,14,13],
  34959. "1f44e-1f3ff":[15,15,13],
  34960. "1f44f-1f3fb":[15,17,13],
  34961. "1f44f-1f3fc":[15,18,13],
  34962. "1f44f-1f3fd":[15,19,13],
  34963. "1f44f-1f3fe":[15,20,13],
  34964. "1f44f-1f3ff":[15,21,13],
  34965. "1f450-1f3fb":[15,23,13],
  34966. "1f450-1f3fc":[15,24,13],
  34967. "1f450-1f3fd":[15,25,13],
  34968. "1f450-1f3fe":[15,26,13],
  34969. "1f450-1f3ff":[15,27,13],
  34970. "1f466-1f3fb":[16,9,13],
  34971. "1f466-1f3fc":[16,10,13],
  34972. "1f466-1f3fd":[16,11,13],
  34973. "1f466-1f3fe":[16,12,13],
  34974. "1f466-1f3ff":[16,13,13],
  34975. "1f467-1f3fb":[16,15,13],
  34976. "1f467-1f3fc":[16,16,13],
  34977. "1f467-1f3fd":[16,17,13],
  34978. "1f467-1f3fe":[16,18,13],
  34979. "1f467-1f3ff":[16,19,13],
  34980. "1f468-1f3fb":[16,21,13],
  34981. "1f468-1f3fc":[16,22,13],
  34982. "1f468-1f3fd":[16,23,13],
  34983. "1f468-1f3fe":[16,24,13],
  34984. "1f468-1f3ff":[16,25,13],
  34985. "1f469-1f3fb":[16,27,13],
  34986. "1f469-1f3fc":[16,28,13],
  34987. "1f469-1f3fd":[16,29,13],
  34988. "1f469-1f3fe":[16,30,13],
  34989. "1f469-1f3ff":[16,31,13],
  34990. "1f46e-1f3fb":[16,37,13],
  34991. "1f46e-1f3fc":[16,38,13],
  34992. "1f46e-1f3fd":[16,39,13],
  34993. "1f46e-1f3fe":[16,40,13],
  34994. "1f46e-1f3ff":[17,0,13],
  34995. "1f470-1f3fb":[17,3,13],
  34996. "1f470-1f3fc":[17,4,13],
  34997. "1f470-1f3fd":[17,5,13],
  34998. "1f470-1f3fe":[17,6,13],
  34999. "1f470-1f3ff":[17,7,13],
  35000. "1f471-1f3fb":[17,9,13],
  35001. "1f471-1f3fc":[17,10,13],
  35002. "1f471-1f3fd":[17,11,13],
  35003. "1f471-1f3fe":[17,12,13],
  35004. "1f471-1f3ff":[17,13,13],
  35005. "1f472-1f3fb":[17,15,13],
  35006. "1f472-1f3fc":[17,16,13],
  35007. "1f472-1f3fd":[17,17,13],
  35008. "1f472-1f3fe":[17,18,13],
  35009. "1f472-1f3ff":[17,19,13],
  35010. "1f473-1f3fb":[17,21,13],
  35011. "1f473-1f3fc":[17,22,13],
  35012. "1f473-1f3fd":[17,23,13],
  35013. "1f473-1f3fe":[17,24,13],
  35014. "1f473-1f3ff":[17,25,13],
  35015. "1f474-1f3fb":[17,27,13],
  35016. "1f474-1f3fc":[17,28,13],
  35017. "1f474-1f3fd":[17,29,13],
  35018. "1f474-1f3fe":[17,30,13],
  35019. "1f474-1f3ff":[17,31,13],
  35020. "1f475-1f3fb":[17,33,13],
  35021. "1f475-1f3fc":[17,34,13],
  35022. "1f475-1f3fd":[17,35,13],
  35023. "1f475-1f3fe":[17,36,13],
  35024. "1f475-1f3ff":[17,37,13],
  35025. "1f476-1f3fb":[17,39,13],
  35026. "1f476-1f3fc":[17,40,13],
  35027. "1f476-1f3fd":[18,0,13],
  35028. "1f476-1f3fe":[18,1,13],
  35029. "1f476-1f3ff":[18,2,13],
  35030. "1f477-1f3fb":[18,4,13],
  35031. "1f477-1f3fc":[18,5,13],
  35032. "1f477-1f3fd":[18,6,13],
  35033. "1f477-1f3fe":[18,7,13],
  35034. "1f477-1f3ff":[18,8,13],
  35035. "1f478-1f3fb":[18,10,13],
  35036. "1f478-1f3fc":[18,11,13],
  35037. "1f478-1f3fd":[18,12,13],
  35038. "1f478-1f3fe":[18,13,13],
  35039. "1f478-1f3ff":[18,14,13],
  35040. "1f47c-1f3fb":[18,19,13],
  35041. "1f47c-1f3fc":[18,20,13],
  35042. "1f47c-1f3fd":[18,21,13],
  35043. "1f47c-1f3fe":[18,22,13],
  35044. "1f47c-1f3ff":[18,23,13],
  35045. "1f481-1f3fb":[18,29,13],
  35046. "1f481-1f3fc":[18,30,13],
  35047. "1f481-1f3fd":[18,31,13],
  35048. "1f481-1f3fe":[18,32,13],
  35049. "1f481-1f3ff":[18,33,13],
  35050. "1f482-1f3fb":[18,35,13],
  35051. "1f482-1f3fc":[18,36,13],
  35052. "1f482-1f3fd":[18,37,13],
  35053. "1f482-1f3fe":[18,38,13],
  35054. "1f482-1f3ff":[18,39,13],
  35055. "1f483-1f3fb":[19,0,13],
  35056. "1f483-1f3fc":[19,1,13],
  35057. "1f483-1f3fd":[19,2,13],
  35058. "1f483-1f3fe":[19,3,13],
  35059. "1f483-1f3ff":[19,4,13],
  35060. "1f485-1f3fb":[19,7,13],
  35061. "1f485-1f3fc":[19,8,13],
  35062. "1f485-1f3fd":[19,9,13],
  35063. "1f485-1f3fe":[19,10,13],
  35064. "1f485-1f3ff":[19,11,13],
  35065. "1f486-1f3fb":[19,13,13],
  35066. "1f486-1f3fc":[19,14,13],
  35067. "1f486-1f3fd":[19,15,13],
  35068. "1f486-1f3fe":[19,16,13],
  35069. "1f486-1f3ff":[19,17,13],
  35070. "1f487-1f3fb":[19,19,13],
  35071. "1f487-1f3fc":[19,20,13],
  35072. "1f487-1f3fd":[19,21,13],
  35073. "1f487-1f3fe":[19,22,13],
  35074. "1f487-1f3ff":[19,23,13],
  35075. "1f4aa-1f3fb":[20,18,13],
  35076. "1f4aa-1f3fc":[20,19,13],
  35077. "1f4aa-1f3fd":[20,20,13],
  35078. "1f4aa-1f3fe":[20,21,13],
  35079. "1f4aa-1f3ff":[20,22,13],
  35080. "1f575-1f3fb":[24,40,9],
  35081. "1f575-1f3fc":[25,0,9],
  35082. "1f575-1f3fd":[25,1,9],
  35083. "1f575-1f3fe":[25,2,9],
  35084. "1f575-1f3ff":[25,3,9],
  35085. "1f590-1f3fb":[25,14,13],
  35086. "1f590-1f3fc":[25,15,13],
  35087. "1f590-1f3fd":[25,16,13],
  35088. "1f590-1f3fe":[25,17,13],
  35089. "1f590-1f3ff":[25,18,13],
  35090. "1f595-1f3fb":[25,20,13],
  35091. "1f595-1f3fc":[25,21,13],
  35092. "1f595-1f3fd":[25,22,13],
  35093. "1f595-1f3fe":[25,23,13],
  35094. "1f595-1f3ff":[25,24,13],
  35095. "1f596-1f3fb":[25,26,13],
  35096. "1f596-1f3fc":[25,27,13],
  35097. "1f596-1f3fd":[25,28,13],
  35098. "1f596-1f3fe":[25,29,13],
  35099. "1f596-1f3ff":[25,30,13],
  35100. "1f645-1f3fb":[28,3,13],
  35101. "1f645-1f3fc":[28,4,13],
  35102. "1f645-1f3fd":[28,5,13],
  35103. "1f645-1f3fe":[28,6,13],
  35104. "1f645-1f3ff":[28,7,13],
  35105. "1f646-1f3fb":[28,9,13],
  35106. "1f646-1f3fc":[28,10,13],
  35107. "1f646-1f3fd":[28,11,13],
  35108. "1f646-1f3fe":[28,12,13],
  35109. "1f646-1f3ff":[28,13,13],
  35110. "1f647-1f3fb":[28,15,13],
  35111. "1f647-1f3fc":[28,16,13],
  35112. "1f647-1f3fd":[28,17,13],
  35113. "1f647-1f3fe":[28,18,13],
  35114. "1f647-1f3ff":[28,19,13],
  35115. "1f64b-1f3fb":[28,24,13],
  35116. "1f64b-1f3fc":[28,25,13],
  35117. "1f64b-1f3fd":[28,26,13],
  35118. "1f64b-1f3fe":[28,27,13],
  35119. "1f64b-1f3ff":[28,28,13],
  35120. "1f64c-1f3fb":[28,30,13],
  35121. "1f64c-1f3fc":[28,31,13],
  35122. "1f64c-1f3fd":[28,32,13],
  35123. "1f64c-1f3fe":[28,33,13],
  35124. "1f64c-1f3ff":[28,34,13],
  35125. "1f64d-1f3fb":[28,36,13],
  35126. "1f64d-1f3fc":[28,37,13],
  35127. "1f64d-1f3fd":[28,38,13],
  35128. "1f64d-1f3fe":[28,39,13],
  35129. "1f64d-1f3ff":[28,40,13],
  35130. "1f64e-1f3fb":[29,1,13],
  35131. "1f64e-1f3fc":[29,2,13],
  35132. "1f64e-1f3fd":[29,3,13],
  35133. "1f64e-1f3fe":[29,4,13],
  35134. "1f64e-1f3ff":[29,5,13],
  35135. "1f64f-1f3fb":[29,7,13],
  35136. "1f64f-1f3fc":[29,8,13],
  35137. "1f64f-1f3fd":[29,9,13],
  35138. "1f64f-1f3fe":[29,10,13],
  35139. "1f64f-1f3ff":[29,11,13],
  35140. "1f6a3-1f3fb":[30,7,13],
  35141. "1f6a3-1f3fc":[30,8,13],
  35142. "1f6a3-1f3fd":[30,9,13],
  35143. "1f6a3-1f3fe":[30,10,13],
  35144. "1f6a3-1f3ff":[30,11,13],
  35145. "1f6b4-1f3fb":[30,29,13],
  35146. "1f6b4-1f3fc":[30,30,13],
  35147. "1f6b4-1f3fd":[30,31,13],
  35148. "1f6b4-1f3fe":[30,32,13],
  35149. "1f6b4-1f3ff":[30,33,13],
  35150. "1f6b5-1f3fb":[30,35,13],
  35151. "1f6b5-1f3fc":[30,36,13],
  35152. "1f6b5-1f3fd":[30,37,13],
  35153. "1f6b5-1f3fe":[30,38,13],
  35154. "1f6b5-1f3ff":[30,39,13],
  35155. "1f6b6-1f3fb":[31,0,13],
  35156. "1f6b6-1f3fc":[31,1,13],
  35157. "1f6b6-1f3fd":[31,2,13],
  35158. "1f6b6-1f3fe":[31,3,13],
  35159. "1f6b6-1f3ff":[31,4,13],
  35160. "1f6c0-1f3fb":[31,15,13],
  35161. "1f6c0-1f3fc":[31,16,13],
  35162. "1f6c0-1f3fd":[31,17,13],
  35163. "1f6c0-1f3fe":[31,18,13],
  35164. "1f6c0-1f3ff":[31,19,13],
  35165. "1f918-1f3fb":[32,10,13],
  35166. "1f918-1f3fc":[32,11,13],
  35167. "1f918-1f3fd":[32,12,13],
  35168. "1f918-1f3fe":[32,13,13],
  35169. "1f918-1f3ff":[32,14,13]
  35170. };
  35171. // export
  35172. if (typeof exports !== 'undefined'){
  35173. if (typeof module !== 'undefined' && module.exports){
  35174. exports = module.exports = emoji;
  35175. }
  35176. exports.EmojiConvertor = emoji;
  35177. }else if (typeof define === 'function' && define.amd){
  35178. define(function() { return emoji; })
  35179. }else{
  35180. root.EmojiConvertor = emoji;
  35181. }
  35182. }).call(function(){
  35183. return this || (typeof window !== 'undefined' ? window : global);
  35184. }());
  35185. /*!
  35186. Autosize 3.0.5
  35187. license: MIT
  35188. http://www.jacklmoore.com/autosize
  35189. */
  35190. (function (global, factory) {
  35191. if (typeof define === 'function' && define.amd) {
  35192. define(['exports', 'module'], factory);
  35193. } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
  35194. factory(exports, module);
  35195. } else {
  35196. var mod = {
  35197. exports: {}
  35198. };
  35199. factory(mod.exports, mod);
  35200. global.autosize = mod.exports;
  35201. }
  35202. })(this, function (exports, module) {
  35203. 'use strict';
  35204. function assign(ta) {
  35205. var _ref = arguments[1] === undefined ? {} : arguments[1];
  35206. var _ref$setOverflowX = _ref.setOverflowX;
  35207. var setOverflowX = _ref$setOverflowX === undefined ? true : _ref$setOverflowX;
  35208. var _ref$setOverflowY = _ref.setOverflowY;
  35209. var setOverflowY = _ref$setOverflowY === undefined ? true : _ref$setOverflowY;
  35210. if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || ta.hasAttribute('data-autosize-on')) return;
  35211. var heightOffset = null;
  35212. var overflowY = 'hidden';
  35213. function init() {
  35214. var style = window.getComputedStyle(ta, null);
  35215. if (style.resize === 'vertical') {
  35216. ta.style.resize = 'none';
  35217. } else if (style.resize === 'both') {
  35218. ta.style.resize = 'horizontal';
  35219. }
  35220. if (style.boxSizing === 'content-box') {
  35221. heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
  35222. } else {
  35223. heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
  35224. }
  35225. update();
  35226. }
  35227. function changeOverflow(value) {
  35228. {
  35229. // Chrome/Safari-specific fix:
  35230. // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space
  35231. // made available by removing the scrollbar. The following forces the necessary text reflow.
  35232. var width = ta.style.width;
  35233. ta.style.width = '0px';
  35234. // Force reflow:
  35235. /* jshint ignore:start */
  35236. ta.offsetWidth;
  35237. /* jshint ignore:end */
  35238. ta.style.width = width;
  35239. }
  35240. overflowY = value;
  35241. if (setOverflowY) {
  35242. ta.style.overflowY = value;
  35243. }
  35244. update();
  35245. }
  35246. function update() {
  35247. var startHeight = ta.style.height;
  35248. var htmlTop = document.documentElement.scrollTop;
  35249. var bodyTop = document.body.scrollTop;
  35250. var originalHeight = ta.style.height;
  35251. ta.style.height = 'auto';
  35252. var endHeight = ta.scrollHeight + heightOffset;
  35253. if (ta.scrollHeight === 0) {
  35254. // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
  35255. ta.style.height = originalHeight;
  35256. return;
  35257. }
  35258. ta.style.height = endHeight + 'px';
  35259. // prevents scroll-position jumping
  35260. document.documentElement.scrollTop = htmlTop;
  35261. document.body.scrollTop = bodyTop;
  35262. var style = window.getComputedStyle(ta, null);
  35263. if (style.height !== ta.style.height) {
  35264. if (overflowY !== 'visible') {
  35265. changeOverflow('visible');
  35266. return;
  35267. }
  35268. } else {
  35269. if (overflowY !== 'hidden') {
  35270. changeOverflow('hidden');
  35271. return;
  35272. }
  35273. }
  35274. if (startHeight !== ta.style.height) {
  35275. var evt = document.createEvent('Event');
  35276. evt.initEvent('autosize:resized', true, false);
  35277. ta.dispatchEvent(evt);
  35278. }
  35279. }
  35280. var destroy = (function (style) {
  35281. window.removeEventListener('resize', update);
  35282. ta.removeEventListener('input', update);
  35283. ta.removeEventListener('keyup', update);
  35284. ta.removeAttribute('data-autosize-on');
  35285. ta.removeEventListener('autosize:destroy', destroy);
  35286. Object.keys(style).forEach(function (key) {
  35287. ta.style[key] = style[key];
  35288. });
  35289. }).bind(ta, {
  35290. height: ta.style.height,
  35291. resize: ta.style.resize,
  35292. overflowY: ta.style.overflowY,
  35293. overflowX: ta.style.overflowX,
  35294. wordWrap: ta.style.wordWrap });
  35295. ta.addEventListener('autosize:destroy', destroy);
  35296. // IE9 does not fire onpropertychange or oninput for deletions,
  35297. // so binding to onkeyup to catch most of those events.
  35298. // There is no way that I know of to detect something like 'cut' in IE9.
  35299. if ('onpropertychange' in ta && 'oninput' in ta) {
  35300. ta.addEventListener('keyup', update);
  35301. }
  35302. window.addEventListener('resize', update);
  35303. ta.addEventListener('input', update);
  35304. ta.addEventListener('autosize:update', update);
  35305. ta.setAttribute('data-autosize-on', true);
  35306. if (setOverflowY) {
  35307. ta.style.overflowY = 'hidden';
  35308. }
  35309. if (setOverflowX) {
  35310. ta.style.overflowX = 'hidden';
  35311. ta.style.wordWrap = 'break-word';
  35312. }
  35313. init();
  35314. }
  35315. function destroy(ta) {
  35316. if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return;
  35317. var evt = document.createEvent('Event');
  35318. evt.initEvent('autosize:destroy', true, false);
  35319. ta.dispatchEvent(evt);
  35320. }
  35321. function update(ta) {
  35322. if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return;
  35323. var evt = document.createEvent('Event');
  35324. evt.initEvent('autosize:update', true, false);
  35325. ta.dispatchEvent(evt);
  35326. }
  35327. var autosize = null;
  35328. // Do nothing in Node.js environment and IE8 (or lower)
  35329. if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
  35330. autosize = function (el) {
  35331. return el;
  35332. };
  35333. autosize.destroy = function (el) {
  35334. return el;
  35335. };
  35336. autosize.update = function (el) {
  35337. return el;
  35338. };
  35339. } else {
  35340. autosize = function (el, options) {
  35341. if (el) {
  35342. Array.prototype.forEach.call(el.length ? el : [el], function (x) {
  35343. return assign(x, options);
  35344. });
  35345. }
  35346. return el;
  35347. };
  35348. autosize.destroy = function (el) {
  35349. if (el) {
  35350. Array.prototype.forEach.call(el.length ? el : [el], destroy);
  35351. }
  35352. return el;
  35353. };
  35354. autosize.update = function (el) {
  35355. if (el) {
  35356. Array.prototype.forEach.call(el.length ? el : [el], update);
  35357. }
  35358. return el;
  35359. };
  35360. }
  35361. module.exports = autosize;
  35362. });
  35363. (function(window) {
  35364. // internal: same as jQuery.extend(true, args...)
  35365. var extend = function() {
  35366. var target = arguments[0],
  35367. sources = [].slice.call(arguments, 1);
  35368. for (var i = 0; i < sources.length; ++i) {
  35369. var src = sources[i];
  35370. for (key in src) {
  35371. var val = src[key];
  35372. target[key] = typeof val === "object"
  35373. ? extend(typeof target[key] === "object" ? target[key] : {}, val)
  35374. : val;
  35375. }
  35376. }
  35377. return target;
  35378. };
  35379. var WORKER_FILE = {
  35380. wav: "WebAudioRecorderWav.js",
  35381. ogg: "WebAudioRecorderOgg.js",
  35382. mp3: "WebAudioRecorderMp3.js"
  35383. };
  35384. // default configs
  35385. var CONFIGS = {
  35386. workerDir: "/", // worker scripts dir (end with /)
  35387. numChannels: 2, // number of channels
  35388. encoding: "wav", // encoding (can be changed at runtime)
  35389. // runtime options
  35390. options: {
  35391. timeLimit: 300, // recording time limit (sec)
  35392. encodeAfterRecord: false, // process encoding after recording
  35393. progressInterval: 1000, // encoding progress report interval (millisec)
  35394. bufferSize: undefined, // buffer size (use browser default)
  35395. // encoding-specific options
  35396. wav: {
  35397. mimeType: "audio/wav"
  35398. },
  35399. ogg: {
  35400. mimeType: "audio/ogg",
  35401. quality: 0.5 // (VBR only): quality = [-0.1 .. 1]
  35402. },
  35403. mp3: {
  35404. mimeType: "audio/mpeg",
  35405. bitRate: 160 // (CBR only): bit rate = [64 .. 320]
  35406. }
  35407. }
  35408. };
  35409. // constructor
  35410. var WebAudioRecorder = function(sourceNode, configs) {
  35411. extend(this, CONFIGS, configs || {});
  35412. this.context = sourceNode.context;
  35413. if (this.context.createScriptProcessor == null)
  35414. this.context.createScriptProcessor = this.context.createJavaScriptNode;
  35415. this.input = this.context.createGain();
  35416. sourceNode.connect(this.input);
  35417. this.buffer = [];
  35418. this.initWorker();
  35419. };
  35420. // instance methods
  35421. extend(WebAudioRecorder.prototype, {
  35422. isRecording: function() { return this.processor != null; },
  35423. setEncoding: function(encoding) {
  35424. if (this.isRecording())
  35425. this.error("setEncoding: cannot set encoding during recording");
  35426. else if (this.encoding !== encoding) {
  35427. this.encoding = encoding;
  35428. this.initWorker();
  35429. }
  35430. },
  35431. setOptions: function(options) {
  35432. if (this.isRecording())
  35433. this.error("setOptions: cannot set options during recording");
  35434. else {
  35435. extend(this.options, options);
  35436. this.worker.postMessage({ command: "options", options: this.options });
  35437. }
  35438. },
  35439. startRecording: function() {
  35440. if (this.isRecording())
  35441. this.error("startRecording: previous recording is running");
  35442. else {
  35443. var numChannels = this.numChannels,
  35444. buffer = this.buffer,
  35445. worker = this.worker;
  35446. this.processor = this.context.createScriptProcessor(
  35447. this.options.bufferSize,
  35448. this.numChannels, this.numChannels);
  35449. this.input.connect(this.processor);
  35450. this.processor.connect(this.context.destination);
  35451. this.processor.onaudioprocess = function(event) {
  35452. for (var ch = 0; ch < numChannels; ++ch)
  35453. buffer[ch] = event.inputBuffer.getChannelData(ch);
  35454. worker.postMessage({ command: "record", buffer: buffer });
  35455. };
  35456. this.worker.postMessage({
  35457. command: "start",
  35458. bufferSize: this.processor.bufferSize
  35459. });
  35460. this.startTime = Date.now();
  35461. }
  35462. },
  35463. recordingTime: function() {
  35464. return this.isRecording() ? (Date.now() - this.startTime) * 0.001 : null;
  35465. },
  35466. cancelRecording: function() {
  35467. if (this.isRecording()) {
  35468. this.input.disconnect();
  35469. this.processor.disconnect();
  35470. delete this.processor;
  35471. this.worker.postMessage({ command: "cancel" });
  35472. } else
  35473. this.error("cancelRecording: no recording is running");
  35474. },
  35475. finishRecording: function() {
  35476. if (this.isRecording()) {
  35477. this.input.disconnect();
  35478. this.processor.disconnect();
  35479. delete this.processor;
  35480. this.worker.postMessage({ command: "finish" });
  35481. } else
  35482. this.error("finishRecording: no recording is running");
  35483. },
  35484. cancelEncoding: function() {
  35485. if (this.options.encodeAfterRecord)
  35486. if (this.isRecording())
  35487. this.error("cancelEncoding: recording is not finished");
  35488. else {
  35489. this.onEncodingCanceled(this);
  35490. this.initWorker();
  35491. }
  35492. else
  35493. this.error("cancelEncoding: invalid method call");
  35494. },
  35495. initWorker: function() {
  35496. if (this.worker != null)
  35497. this.worker.terminate();
  35498. this.onEncoderLoading(this, this.encoding);
  35499. this.worker = new Worker(this.workerDir + WORKER_FILE[this.encoding]);
  35500. var _this = this;
  35501. this.worker.onmessage = function(event) {
  35502. var data = event.data;
  35503. switch (data.command) {
  35504. case "loaded":
  35505. _this.onEncoderLoaded(_this, _this.encoding);
  35506. break;
  35507. case "timeout":
  35508. _this.onTimeout(_this);
  35509. break;
  35510. case "progress":
  35511. _this.onEncodingProgress(_this, data.progress);
  35512. break;
  35513. case "complete":
  35514. _this.onComplete(_this, data.blob);
  35515. break;
  35516. case "error":
  35517. _this.error(data.message);
  35518. }
  35519. };
  35520. this.worker.postMessage({
  35521. command: "init",
  35522. config: {
  35523. sampleRate: this.context.sampleRate,
  35524. numChannels: this.numChannels
  35525. },
  35526. options: this.options
  35527. });
  35528. },
  35529. error: function(message) {
  35530. this.onError(this, "WebAudioRecorder.js:" + message);
  35531. },
  35532. // event handlers
  35533. onEncoderLoading: function(recorder, encoding) {},
  35534. onEncoderLoaded: function(recorder, encoding) {},
  35535. onTimeout: function(recorder) { recorder.finishRecording(); },
  35536. onEncodingProgress: function (recorder, progress) {},
  35537. onEncodingCanceled: function(recorder) {},
  35538. onComplete: function(recorder, blob) {
  35539. recorder.onError(recorder, "WebAudioRecorder.js: You must override .onComplete event");
  35540. },
  35541. onError: function(recorder, message) { console.log(message); }
  35542. });
  35543. window.WebAudioRecorder = WebAudioRecorder;
  35544. })(window);